unstructured
unstructured is a set of open-source pre-processing tools for unstructured data.
Verified
Core facts
Read by a script from the official API, not rewritten by a model.
- License
- Apache-2.0
- Languages
- HTML
- Maintainer
- Unstructured-IO
- Homepage
- https://www.unstructured.io/
- Verified
What it is
unstructured is a set of open-source pre-processing tools for unstructured data. The unstructured library provides open-source components for ingesting and pre-processing images and text documents, such as PDFs, HTML, Word docs. The project states that the open-source library is, and will stay, completely free.
Main features
When the partition function is used, unstructured detects the file type and routes it to the appropriate file-specific partitioning function.
When the partition function is used, additional dependencies per doc type may need to be installed.
The project builds multi-platform images to support both x86_64 and Apple silicon hardware.
The project builds Docker images for each push to main.
The project provides an optional pre-commit configuration.
In addition to developing in the local OS, the project provides a helper that uses docker to provide a development environment.
Getting started
For plain text files, HTML, XML, JSON and emails that do not require extra dependencies, the base package unstructured can be installed.
To process other doc types, the extras required for those documents can be installed, such as docx and pptx.
A user can also build their own Docker image.
Once the image is pulled, a container can be created from it and a shell opened in it.
Once in the running container, things can be tried directly in the Python interpreter's interactive mode.
docker pull downloads.unstructured.io/unstructured-io/unstructured:latest# create the container
docker run -dt --name unstructured downloads.unstructured.io/unstructured-io/unstructured:latest
# this will drop you into a bash shell where the Docker image is running
docker exec -it unstructured bashmake docker-build
# this will drop you into a bash shell where the Docker image is running
make docker-start-bash# this will drop you into a python console so you can run the below partition functions
python3
>>> from unstructured.partition.pdf import partition_pdf
>>> elements = partition_pdf(filename="example-docs/layout-parser-paper-fast.pdf")
>>> from unstructured.partition.text import partition_text
>>> elements = partition_text(filename="example-docs/fake-text.txt")from unstructured.partition.auto import partition
elements = partition(filename="example-docs/eml/fake-email.eml")
print("\n\n".join([str(el) for el in elements]))Who it is for
libmagic-dev is used for filetype detection. poppler-utils is used for images and PDFs. tesseract-ocr is used for images and PDFs, and tesseract-lang is installed for additional language support.
libreoffice is used for MS Office docs. pandoc is bundled automatically via the pypandoc-binary Python package, without a system install. In the optional items of the local development install, processing image files requires tesseract.
In the optional items of the local development install, processing PDF files requires tesseract and poppler. The runtime events of unstructured contain the package version, normalized platform, Python and architecture values, fixed-enum partition characteristics, and aggregate final-element counts as URL query parameters, with no request body. Runtime events never contain document or element content, filenames, paths, URLs supplied for partitioning, raw MIME values, exception details, credentials, proxy configuration, or persistent installation, machine, process, account, user, or developer identifiers.
Before importing or partitioning, setting either DO_NOT_TRACK or SCARF_NO_ANALYTICS to a non-empty value after trimming whitespace, such as true, 1, yes, false, or 0, disables both library-load and runtime telemetry. At most one telemetry daemon can remain stranded in a network operation.
Sources
This page is written from the official sources below. Open them to check the original text.
- GitHub READMEhttps://github.com/Unstructured-IO/unstructuredFetched
Verified ·
This page is written by AI from the official sources above and checked automatically. This site has not tested it. Found a mistake? Tell us.