-
Notifications
You must be signed in to change notification settings - Fork 32
Getting Started
Most users want Datashare, not the raw CLI. Datashare installs as a desktop or server application, embeds this extraction engine, and adds search, named-entity recognition and a web UI on top. Use the CLI directly only when you need a scriptable, headless extraction step. See Extract and Datashare.
First, build Extract. We recommend copying the extract.jar file to a location that makes it available system-wide and installing a small wrapping script that lets you execute it from anywhere.
You'll need a Java 17 (or newer) runtime on your PATH.
You should set JAVA_OPTS before running Extract. Whatever is in this environment variable is passed to the JVM. At a minimum, set the amount of memory available to it. For example:
echo "export JAVA_OPTS=\"-Xms512m -Xmx1024m\"" >> ~/.bashrc
source ~/.bashrcFrom then on, Extract will have up to 1GB of memory available to it. Because Extract streams Tika output rather than buffering whole files, this is usually enough even for large documents — but give it more if you process many files in parallel (see the --jobs option) or hit very large embedded archives.
Run extract -h to view the list of available commands and extract -h [command] for help on a particular command. extract version prints the build version.
Text will not be extracted from images (including those embedded in PDFs) unless you have Tesseract installed and on your PATH. OCR is on by default; disable it with --ocr false.
Tesseract needs one trained data file per language. To OCR documents in languages other than English, install the matching language packs (e.g. tesseract-ocr-fra on Debian/Ubuntu, port install tesseract-fra on macOS MacPorts) and pass their 3-letter codes via --ocrLanguage, for example --ocrLanguage "fra+deu". The full list of language codes is in the Tesseract data-files documentation.
Because OCR runs as an external process, you can bound it with --ocrTimeout (e.g. --ocrTimeout 1m) so a single slow image can't stall a job.
There are many ways to use Extract, in a distributed, parallel-processing setup or with a single instance. See our Workflows page. For how Datashare drives the same engine through its SCAN → INDEX → NLP pipeline, see Extract and Datashare.
Using Extract
Developing