Parallel text extraction and processing customizable pipeline
Project description
Patee
Patee (Parallel Text Extraction and Processing Pipeline) is a Python library designed for processing and extracting text from monolingual or multilingual documents in different languages.
It provides a flexible pipeline architecture for working with multilingual content.
The library allows users to extract, align, and process text across language pairs in a structured manner.
Installation:
pip install patee
How it Works
Patee operates through a configurable pipeline system:
-
Configuration: Pipelines are defined in YAML files (e.g., pdf.yml that specify processing steps.
-
Source Documents: The library works with document sources such as:
MultilingualSingleFile: Represents a single document mixing multiple languagesMonolingualSingleFilePair: Pairs two documents in different languages for parallel processing
-
Processing Flow:
- The pipeline is initialized with a configuration file
- Documents are loaded into the pipeline
- Each configured step is executed sequentially
- Processing parameters can be controlled (e.g., page ranges via
PageInfo) - Results are collected and made available after pipeline execution
-
Execution: The pipeline is executed via the
run()method, which returns a result object indicating whether processing completed successfully.
Run modes
Patee supports two run modes:
- Non-persistent: All processing is done in memory, and step results are not saved
result = pipeline.run(source)
- Persistent run: Every step result is saved to disk, allowing for later retrieval and analysis
result = pipeline.run(source, Path("path/to/dir"))
Available Pipeline Steps
There are two types of pipelines available in Patee:
- Extract steps: Should be the first step in the pipeline and retrieves the initial texts pair to start the processing
- Process steps: Process the extracted texts and can be used in any order after the first extract step
Available Extract Steps
text_reader_extractor: Extract text from sources in text format (e.g., TXT)docling_extractor: Extracts text from different document formats using the docling library. Supported formats includePDF,DOCX,HTMLand more. The full list can be found here.
Available Process Steps
noop_step_processor: Test step that does nothinghuman_in_the_loop_processor: A step that requires human input to process the text
human_in_the_loop_processor details
This step only works in persistent mode. In non-persistent mode, it is ignored.
It stops the pipeline execution to perform a human revision/edition of the text.
In the first execution of the step:
- The text of the previous step is persisted
- A marker file is created (
patee_rename_me_to_done_when_human_in_the_loop_is_done) - The pipeline execution is stopped and returns a
stoppedexecution result
When the human revision is done, the user should rename the marker file to patee_done and run the pipeline again.
The pipeline will then continue from the last step.
Example Usage
You can explore different examples in the samples directory.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file patee-0.4.0.tar.gz.
File metadata
- Download URL: patee-0.4.0.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4ac22dba55745319f2b3f28cc56a874549a22b3a674e0c1f2d1387e2cf090a8
|
|
| MD5 |
bbd570181ec88e5c2558cdebc7fd9673
|
|
| BLAKE2b-256 |
0b33a488e4ee26731e1cc2ab4396373e331d572ec6a190190dfce0a3bc2419ec
|
Provenance
The following attestation bundles were made for patee-0.4.0.tar.gz:
Publisher:
publish.yml on hbiarge/patee
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
patee-0.4.0.tar.gz -
Subject digest:
c4ac22dba55745319f2b3f28cc56a874549a22b3a674e0c1f2d1387e2cf090a8 - Sigstore transparency entry: 205589807
- Sigstore integration time:
-
Permalink:
hbiarge/patee@e6274f609cca2a261c7bd8ea9e7a70347778cee6 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/hbiarge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e6274f609cca2a261c7bd8ea9e7a70347778cee6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file patee-0.4.0-py2.py3-none-any.whl.
File metadata
- Download URL: patee-0.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74f8331a835fafa36f1765496274e387a33535ef5be172d148c81a4c88720879
|
|
| MD5 |
93709cb439a92911a0e07e74dd2172c9
|
|
| BLAKE2b-256 |
363f3f581c74e1d82f384a629b1b05afcfc9bc359090c1e3a173465b567f7a6c
|
Provenance
The following attestation bundles were made for patee-0.4.0-py2.py3-none-any.whl:
Publisher:
publish.yml on hbiarge/patee
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
patee-0.4.0-py2.py3-none-any.whl -
Subject digest:
74f8331a835fafa36f1765496274e387a33535ef5be172d148c81a4c88720879 - Sigstore transparency entry: 205589812
- Sigstore integration time:
-
Permalink:
hbiarge/patee@e6274f609cca2a261c7bd8ea9e7a70347778cee6 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/hbiarge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e6274f609cca2a261c7bd8ea9e7a70347778cee6 -
Trigger Event:
release
-
Statement type: