![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
unstructured-inference
Advanced tools
Open-Source Pre-Processing Tools for Unstructured Data
The unstructured-inference
repo contains hosted model inference code for layout parsing models.
These models are invoked via API as part of the partitioning bricks in the unstructured
package.
Run pip install unstructured-inference
.
Detectron2 is required for using models from the layoutparser model zoo but is not automatically installed with this package. For MacOS and Linux, build from source with:
pip install 'git+https://github.com/facebookresearch/detectron2.git@57bdb21249d5418c130d54e2ebdc94dda7a4c01a'
Other install options can be found in the Detectron2 installation guide.
Windows is not officially supported by Detectron2, but some users are able to install it anyway. See discussion here for tips on installing Detectron2 on Windows.
To install the repository for development, clone the repo and run make install
to install dependencies.
Run make help
for a full list of install options.
To get started with the layout parsing model, use the following commands:
from unstructured_inference.inference.layout import DocumentLayout
layout = DocumentLayout.from_file("sample-docs/loremipsum.pdf")
print(layout.pages[0].elements)
Once the model has detected the layout and OCR'd the document, the text extracted from the first
page of the sample document will be displayed.
You can convert a given element to a dict
by running the .to_dict()
method.
The inference pipeline operates by finding text elements in a document page using a detection model, then extracting the contents of the elements using direct extraction (if available), OCR, and optionally table inference models.
We offer several detection models including Detectron2 and YOLOX.
When doing inference, an alternate model can be used by passing the model object to the ingestion method via the model
parameter. The get_model
function can be used to construct one of our out-of-the-box models from a keyword, e.g.:
from unstructured_inference.models.base import get_model
from unstructured_inference.inference.layout import DocumentLayout
model = get_model("yolox")
layout = DocumentLayout.from_file("sample-docs/layout-parser-paper.pdf", detection_model=model)
Any detection model can be used for in the unstructured_inference
pipeline by wrapping the model in the UnstructuredObjectDetectionModel
class. To integrate with the DocumentLayout
class, a subclass of UnstructuredObjectDetectionModel
must have a predict
method that accepts a PIL.Image.Image
and returns a list of LayoutElement
s, and an initialize
method, which loads the model and prepares it for inference.
See our security policy for information on how to report security vulnerabilities.
Section | Description |
---|---|
Unstructured Community Github | Information about Unstructured.io community projects |
Unstructured Github | Unstructured.io open source repositories |
Company Website | Unstructured.io product and company info |
FAQs
A library for performing inference using trained models.
We found that unstructured-inference demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.