Document OCR (Optical Character Recognition)
What is the Document OCR module?
The Document OCR module is an integration interface for the OCR services like Google Document AI to get contents of image and PDF files as text and if supported by the OCR service export text as properties. The module will map properties and import content into Drupal entities.
The module is extendable and supports many ways to transform data from files before saving into Drupal entities. By default the module comes with the Basic, Pipeline and the OpenAI transformer plugins.
Key Features
- Integration with Google Document AI (with support for large PDF files via Google Cloud Storage).
- Integration with Google Translation to translate extracted text.
- Integration with Google Text to Speech to generate mp3 file based on the extracted text and attach mp3 to a file field.
- Integration with PDF Parser PHP library.
- Integration with Tesseract OCR engine.
- Integration with PDFtoText (Poppler) engine.
- Integration with docconv to extract text from PDF, DOC, DOCX, XML, HTML, RTF, ODT, PAGES files.
- Integration with OpenAI to transcript audio files.
- OpenAI integration support (get summaries for PDF files, translate content and many more options).
- Integration with Microsoft Azure OpenAI using the same OpenAI plugins (see the README for the details).
- Integration with Microsoft Azure Translation to translate extracted text.
- Drupal entity and document properties mapping tool.
- Transformer plugins to preprocess data before saving it into Drupal entities.
- Pipeline transformer plugin allows to stack up multiple transformers and change their execution order.
- One-time import tool.
- Real-time processing and Queue processing.
- Option to store API response as JSON.
Use Cases
The following are some use cases and can be extended via module's plugin system.
- Process PDF files to extract its contents as text.
- Process PDF file forms and extract each element as property using services like Google Document AI. It also allows to train extraction from your own custom forms.
- Get summary of extracted PDF contents via OpenAI.
- Create entities and have PDF file contents stored in Drupal.
- Process receipts, tax forms and other documents.
- Transcribe audio files and translate content to different languages via Google Translate transformer plugin or OpenAI.
- Generate audio file (mp3) from the PDF extracted text via Google Text to Speech API.
Integration Modules
Configuration
Please read the README.md file for more details. It includes configuration details for the Google Document AI, OpenAI and other integrations.
Examples
Mapping listing page:
Mapping settings:
Drupal entity and document property mapping tool:
One-time import form (with the same Drupal entity and document property mapping tool)
Document processor listing page:
Add processor form:
Transformers listing page:
Basic property transformer plugin:
OpenAI property transformer plugin:
Document processing tasks listing page:
Installation
Use composer require 'drupal/document_ocr:^1.0' to install all required dependencies.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 1.0.14 | Stable | Aug 2, 2024 | ||
| 1.0.x-dev | Dev | Jul 29, 2024 | ||
| 1.0.13 | Stable | Jul 29, 2024 | ||
| 1.0.12 | Stable | Jul 29, 2024 | ||
| 1.0.11 | Stable | Jul 28, 2024 | ||
| 1.0.10 | Stable | Jul 27, 2024 | ||
| 1.0.9 | Stable | Jul 26, 2024 | ||
| 1.0.8 | Stable | Jul 15, 2024 | ||
| 1.0.7 | Stable | Jul 15, 2024 | ||
| 1.0.6 | Stable | Jul 14, 2024 | ||
| 1.0.5 | Stable | Jul 10, 2024 | ||
| 1.0.4 | Stable | Jun 25, 2024 | ||
| 1.0.3 | Stable | May 3, 2024 | ||
| 1.0.2 | Stable | May 3, 2024 | ||
| 1.0.1 | Stable | Mar 23, 2024 | ||
| 1.0.0 | Stable | Feb 27, 2024 | ||
| 1.0.0-rc1 | Pre-release | Aug 30, 2023 | ||
| 1.0.0-beta1 | Pre-release | Aug 3, 2023 | ||
| 1.0.0-alpha19 | Pre-release | Jul 29, 2023 | ||
| 1.0.0-alpha18 | Pre-release | Jul 22, 2023 | ||
| 1.0.0-alpha17 | Pre-release | Jul 5, 2023 | ||
| 1.0.0-alpha16 | Pre-release | Jul 4, 2023 | ||
| 1.0.0-alpha15 | Pre-release | Jul 1, 2023 | ||
| 1.0.0-alpha14 | Pre-release | Jun 25, 2023 | ||
| 1.0.0-alpha13 | Pre-release | Jun 23, 2023 | ||
| 1.0.0-alpha12 | Pre-release | Jun 21, 2023 | ||
| 1.0.0-alpha11 | Pre-release | Jun 20, 2023 | ||
| 1.0.0-alpha10 | Pre-release | Jun 19, 2023 | ||
| 1.0.0-alpha9 | Pre-release | Jun 18, 2023 | ||
| 1.0.0-alpha8 | Pre-release | Jun 16, 2023 | ||
| 1.0.0-alpha7 | Pre-release | Jun 15, 2023 | ||
| 1.0.0-alpha6 | Pre-release | Jun 11, 2023 | ||
| 1.0.0-alpha5 | Pre-release | Jun 9, 2023 | ||
| 1.0.0-alpha4 | Pre-release | Jun 7, 2023 | ||
| 1.0.0-alpha3 | Pre-release | Jun 6, 2023 | ||
| 1.0.0-alpha2 | Pre-release | Jun 5, 2023 | ||
| 1.0.0-alpha1 | Pre-release | Jun 4, 2023 |