Spaces:
Sleeping
Download README.md from Goutam112/Text_Extracted: direct link, hf CLI and curl.
- Browser
- Download file 8.25 kB
-
https://huggingface.co/spaces/Goutam112/Text_Extracted/resolve/main/README.md
- Command line
-
hf download hf://spaces/Goutam112/Text_Extracted/README.md
-
curl -L -o README.md https://huggingface.co/spaces/Goutam112/Text_Extracted/resolve/main/README.md
A newer version of the Streamlit SDK is available: 1.66.1
title: DocIQ - Intelligent Document Processing
emoji: π§
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: 1.40.0
python_version: '3.10'
app_file: app.py
pinned: false
π§ DocIQ β Intelligent Document Processing
DocIQ is an Intelligent Document Processing (IDP) platform that transforms document images into structured, searchable, and exportable information.
Upload a document image, select a built-in sample, or capture an image using your webcam. DocIQ performs OCR, evaluates recognition confidence, visualizes detected text, extracts entities, detects sensitive information, and exports the results in multiple formats.
β¨ Features
| Feature | Description |
|---|---|
| π― OCR Accuracy Score | Confidence-weighted accuracy grade from A+ to D |
| πΌοΈ Visual Canvas | Bounding boxes, confidence heatmap, and reading-order overlay on the original image |
| π Keyword Search | Instantly search and highlight words on the document canvas |
| ποΈ Entity Extraction | Automatically detect dates, amounts, invoice numbers, emails, and phone numbers |
| π‘οΈ PII Redaction | Detect and mask sensitive information such as Aadhaar, PAN, and credit-card numbers |
| 𧬠Semantic Embeddings | Generate 2D word-cluster visualizations using sentence-transformers with PCA/t-SNE |
| π€ Multi-Format Export | Export searchable PDFs, annotated PDFs, JSON, CSV, plain text, and ZIP bundles |
| πΈ Camera Scanner | Capture documents directly through the webcam when the scanner is enabled |
π Quick Start
Run Locally
git clone https://github.com/Goutam16-Withcode/DocIQ---Intelligent-Document-Processing.git
cd DocIQ---Intelligent-Document-Processing
pip install -r requirements.txt
python -m streamlit run app.py
Open:
http://localhost:8501
π€ Live Demo
π How It Works
Upload / Camera Capture
β
Display Original Image
β
Image Preprocessing
βββ EXIF orientation correction
βββ Automatic deskew
βββ CLAHE contrast enhancement
βββ Shadow removal
βββ Unsharp-mask sharpening
β
EasyOCR Neural Inference
βββ Primary OCR pass
βββ High-sensitivity fallback pass
β
Structured Document Output
βββ Bounding boxes
βββ Confidence analysis
βββ OCR quality grade
βββ Entity extraction
βββ PII detection/redaction
βββ Multi-format export
π OCR Quality Grades
| Grade | Accuracy | Meaning |
|---|---|---|
| A+ | 90β100% | Exceptional recognition confidence |
| A | 80β89% | High recognition confidence |
| B | 68β79% | Good recognition with possible minor errors |
| C | 50β67% | Moderate recognition; manual review recommended |
| D | < 50% | Low recognition; better image quality may help |
Note: The grade is an application-level confidence metric and should not be interpreted as a formal benchmark of OCR accuracy against ground-truth annotations.
π§ Processing Pipeline
DocIQ separates the image shown to the user from the image transformations used internally for OCR.
1. Image Acquisition
Documents can be provided through:
- π File upload
- π§ͺ Built-in sample documents
- πΈ Webcam capture
2. Preprocessing
The OCR pipeline can apply several image-processing operations:
- EXIF orientation correction
- Deskewing
- CLAHE contrast enhancement
- Shadow removal for camera images
- Sharpening
These transformations are performed internally to improve OCR recognition while preserving the original document for visualization.
3. OCR
DocIQ uses EasyOCR with PyTorch to detect and recognize text.
The OCR output contains:
- Detected text
- Bounding boxes
- Confidence scores
- Reading order information
4. Information Extraction
The recognized text is further processed to identify structured information such as:
- Dates
- Currency amounts
- Invoice numbers
- Email addresses
- Phone numbers
5. PII Detection
Potentially sensitive identifiers can be detected and optionally redacted, including:
- Aadhaar numbers
- PAN numbers
- Credit-card numbers
6. Semantic Analysis
Recognized words can be converted into semantic embeddings and projected into a 2D visualization using dimensionality-reduction techniques such as PCA or t-SNE.
π€ Export Formats
DocIQ supports multiple output formats:
| Format | Use Case |
|---|---|
| Searchable PDF | Searchable version of the extracted document |
| Annotated PDF | Document with OCR annotations |
| JSON | Structured OCR and entity data |
| CSV | Tabular extraction results |
| TXT | Plain-text OCR output |
| ZIP | Bundle of multiple generated outputs |
π Project Structure
DocIQ/
βββ app.py # Main Streamlit application
βββ requirements.txt # Python dependencies
βββ src/
βββ preprocessor.py # Image enhancement pipeline
βββ ocr_engine.py # EasyOCR engine and OCR metrics
βββ visualizer.py # Bounding boxes, heatmap, reading order
βββ extractor.py # Entity and invoice field extraction
βββ embedder.py # Semantic embeddings and clustering
βββ exporter.py # PDF, JSON, CSV, ZIP export
βββ sample_docs.py # Built-in sample document generator
βοΈ Technology Stack
- Python 3.10+
- Streamlit
- PyTorch
- EasyOCR
- OpenCV
- NumPy
- Pandas
- Sentence Transformers
- PCA / t-SNE
- ReportLab
- JSON / CSV processing
π‘οΈ Privacy
DocIQ is designed with local processing in mind.
OCR processing, image preprocessing, and embedding generation are performed within the application environment. The application does not intentionally send uploaded document images or extracted text to external APIs as part of the core processing pipeline.
When deploying the application to a hosted environment such as Hugging Face Spaces, uploaded data is processed within that hosted runtime. Users should therefore avoid uploading sensitive documents unless they understand the hosting environment and its data-retention policies.
π€ Hugging Face Space
Live Demo:
π License
MIT License β open source and free to use.
π Project Repository
Check out the configuration reference at Hugging Face Spaces Configuration Reference