Parse
Parse a document and extract its content and metadata.
type: "io.kestra.plugin.tika.Parse"
Extract text from a file.
id: tika_parse
namespace: company.team
inputs:
- id: file
type: FILE
tasks:
- id: parse
type: io.kestra.plugin.tika.Parse
from: '{{ inputs.file }}'
extractEmbedded: true
store: false
Extract text from an image using OCR.
id: tika_parse
namespace: company.team
inputs:
- id: file
type: FILE
tasks:
- id: parse
type: io.kestra.plugin.tika.Parse
from: '{{ inputs.file }}'
ocrOptions:
strategy: OCR_AND_TEXT_EXTRACTION
store: true
Download and extract image metadata using Apache Tika
id: parse-image-metadata-using-apache-tika
namespace: company.team
tasks:
- id: get_image
type: io.kestra.plugin.core.http.Download
uri: https://kestra.io/blogs/2023-05-31-beginner-guide-kestra.jpg
- id: tika
type: io.kestra.plugin.tika.Parse
from: "{{ outputs.get_image.uri }}"
store: false
contentType: TEXT
ocrOptions:
strategy: OCR_AND_TEXT_EXTRACTION
Download a PDF file and extract text from it using Apache Tika
id: parse-pdf
namespace: company.team
tasks:
- id: download_pdf
type: io.kestra.plugin.core.http.Download
uri: https://huggingface.co/datasets/kestra/datasets/resolve/main/pdf/app_store.pdf
- id: parse_text
type: io.kestra.plugin.tika.Parse
from: "{{ outputs.download_pdf.uri }}"
contentType: TEXT
store: false
- id: log_extracted_text
type: io.kestra.plugin.core.log.Log
message: "{{ outputs.parse_text.result.content }}"
YES
XHTML
TEXT
XHTML
XHTML_NO_HEADER
The content type of the extracted text.
YES
false
Whether to extract the embedded document.
YES
The file to parse.
Must be an internal storage URI.
NO
{
"strategy": "NO_OCR"
}
Custom options for OCR processing.
You need to install Tesseract to enable OCR processing.
YES
true
Whether to store the data from the query result into an ion serialized data file in Kestra internal storage.
uri
YES
Whether to enable image preprocessing.
Apache Tika will run preprocessing of images (rotation detection and image normalizing with ImageMagick) before sending the image to Tesseract if the user has included dependencies (listed below) and if the user opts to include these preprocessing steps.
YES
Language used for OCR.
YES
NO_OCR
AUTO
NO_OCR
OCR_ONLY
OCR_AND_TEXT_EXTRACTION
OCR strategy to use for OCR processing.
You need to install Tesseract to enable OCR processing, along with Tesseract language pack.
NO
NO
NO