Unstructured API Docker Image
1.6K
Unstructured offers a powerful and flexible document preprocessing API that supports structured parsing of a wide variety of file formats, including PDFs, Word documents, images, emails, and more. You can choose from multiple processing strategies (hi_res, fast, ocr_only, and auto), with the new Chipper model (beta) offering enhanced accuracy for high-resolution and complex documents.
The API is suitable for use cases such as building knowledge bases, OCR pipelines, and structured data extraction.
docker run -p 9001:9001 -d --rm --name unstructured-api \
-e PORT=9001 \
-e HF_ENDPOINT=https://hf-mirror.com \
-e UNSTRUCTURED_PARALLEL_MODE_ENABLED=true \
-e UNSTRUCTURED_PARALLEL_MODE_THREADS=32 \
-e UNSTRUCTURED_PARALLEL_MODE_SPLIT_SIZE=32 \
longkeyy/unstructured-api:latest
version: '3'
services:
unstructured-api:
image: longkeyy/unstructured-api:latest
ports:
- "9001:9001"
environment:
- PORT=9001
- HF_ENDPOINT=https://hf-mirror.com
- UNSTRUCTURED_PARALLEL_MODE_ENABLED=true
- UNSTRUCTURED_PARALLEL_MODE_THREADS=32
- UNSTRUCTURED_PARALLEL_MODE_SPLIT_SIZE=32
restart: unless-stopped
Start the service:
docker-compose up -d
The API will be available at http://localhost:9001.
curl -X 'POST' 'http://localhost:9001/general/v0/general' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'files=@sample-docs/family-day.eml' \
| jq -C . | less -R
hi_res + chipper Strategycurl -X 'POST' 'http://localhost:9001/general/v0/general' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'files=@sample-docs/layout-parser-paper.pdf' \
-F 'strategy=hi_res' \
-F 'hi_res_model_name=chipper' \
| jq -C . | less -R
curl -X 'POST' 'http://localhost:9001/general/v0/general' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'files=@sample-docs/english-and-korean.png' \
-F 'strategy=ocr_only' \
-F 'languages=eng' \
-F 'languages=kor' \
| jq -C . | less -R
curl -X 'POST' 'http://localhost:9001/general/v0/general' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'files=@sample-docs/layout-parser-paper.pdf' \
-F 'coordinates=true' \
| jq -C . | less -R
curl -X 'POST' 'http://localhost:9001/general/v0/general' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'files=@sample-docs/layout-parser-paper-fast.pdf' \
-F 'chunking_strategy=by_title' \
| jq -C . | less -R
| Category | File Types |
|---|---|
| Plaintext | .txt, .eml, .msg, .xml, .html, .md, .rst, .json, .rtf |
| Images | .jpeg, .png |
| Documents | .doc, .docx, .ppt, .pptx, .pdf, .odt, .epub, .csv, .tsv, .xlsx |
| Compressed | .gz |
docker pull longkeyy/unstructured-api:latest