一个现代、快速的、使用 C 语言编写的文档解析器
Work in Progress: Check out our roadmap for upcoming features and development plans.
Ferrules is an opinionated high-performance document parsing library designed to generate LLM-ready documents efficiently.
Unlike alternatives such as unstructured which are slow and Python-based, ferrules is written in Rust and aims to provide a seamless experience with robust deployment across various platforms.
| NOTE A ferrule is a corruption of Latin viriola on a pencil known as a Shoe, is any of a number of types of objects, generally used for fastening, joining, sealing, or reinforcement.
** PDF Parsing and Layout Extraction:**
pdfium2 to parse documents.objc2 Rust bindings and VNRecognizeTextRequest functionality).ort library).** Advanced Table Parsing:**
** Document Transformation:**
️ Rendering: Provides HTML, Markdown, and JSON rendering options for versatile use cases.
⚡ High Performance & Easy Deployment:
⚙️ Advanced Functionalities: : Offers configurable inference parameters for optimized processing (COMING SOON)
️ API and CLI:
Ferrules provides precompiled binaries for macOS, available for download from the GitHub Releases page.
Download the latest ferrules binary from the releases.
Verify the installation:
ferrules --versionLinux support with NVIDIA GPU acceleration will be available soon. Keep an eye out for updates on the releases page.
⚠️ Note: Ensure that you have the necessary permissions to execute and move files to system directories.
Visit the GitHub Releases page to find the latest version suitable for your operating system.
Ferrules provides two ways to use the library:
ferrules path/to/your.pdfThis will parse the PDF and save the results in the current directory:
ferrules file.pdf
[00:00:02] [########################################] Parsed document in 108ms
✓ Results saved in: ./file-results.jsonTo get detailed processing information and debug outputs:
ferrules path/to/your.pdf --debugRunning with --debug will generate:
.ferr debug archive containing all intermediate states (layout, OCR, native lines, tables).ferrules-debug)ferrules-debug is a lightweight, cross-platform visualizer built with Iced. It allows you to inspect exactly how the engine interpreted your document.
How to use:
ferrules sample.pdf --debug.ferr file: ferrules-debug --file path/to/sample.ferrFerrules uses a tiered approach to table extraction:
Heuristics: The engine automatically sequences these algorithms. If a Stream result appears incomplete or messy, it triggers Vision to verify and improve the structure recognition.
…You can also configure some options through environment variables:
FERRULES_OUTPUT_DIR: Set the output directoryFERRULES_LAYOUT_MODEL_PATH: Set the layout model pathFERRULES_DEBUG: Enable debug modeFERRULES_DEBUG_PATH: Set the debug output directoryFerrules also provides an HTTP API server for integration into existing systems.
To start the API server locally:
ferrules-apiFor systems with NVIDIA GPU support, you can run the API server using Docker:
docker run -p 3002:3002 --gpus all aminediro/ferrules-api-gpuBy default, the server listens on 0.0.0.0:3002. For detailed API documentation and additional running options, see API.md.
Apple vision text detection:
ort : https://ort.pyke.io/
This project uses models from the yolo-doclaynet repository. We are grateful to the contributors of that project.
暂无开放 Issues,或尚未同步最近议题。