This project provides a web-based dashboard to display document extraction stats, including the average field accuracy and OCR accuracy for each document. It allows users to filter documents by Document ID or Filename, and dynamically loads data from a backend API.
- Document Stats: Displays the average field accuracy and OCR accuracy for each document.
- Filters: Filter document stats by
Document IDorFilename. - Data Visualization: Includes charts for average field accuracy, confidence levels, and OCR confidence across various fields.
- Backend API: Fetches data from a backend service to populate the dashboard.
.
├── README.md
├── backend
│ ├── Dockerfile
│ ├── app
│ │ ├── api
│ │ ├── database.py
│ │ ├── main.py
│ │ └── models
│ │ ├── __init__.py
│ │ ├── classification_model.py
│ │ └── extraction_model.py
│ ├── pyproject.toml
│ └── uv.lock
├── docker-compose.yml
└── frontend
├── Dockerfile
└── app
├── css
│ └── process-docs.css
├── index.html
├── js
│ └── process-docs.js
├── pages
│ └── process-documents.html
├── pdfs
│ ├── id_card.jpg
│ └── invoice.pdf
├── script.js
└── style.cssFollow these steps to set up the project locally.
• Python =>3.10
-
Clone this repository:
git clone https://github.com/nvpnathan/extractly.git cd extractly/backend -
Install Python dependencies:
brew install uv uv venv source .venv/bin/activate uv sync -
Point to your sqlite document database
-
Run the backend API:
uvicorn main:app --reload
Once the backend is running:
- Open the
index.htmlfile in your browser to view the dashboard.
The dashboard should now be accessible and will automatically load document stats from the backend.
GET /extractions/Retrieves a paginated list of all extraction records.
Query Parameters:
skip(optional): Number of records to skip (default: 0)limit(optional): Maximum number of records to return (default: 10)
Response:
{
"data": [
{
// extraction record fields
}
]
}GET /extractions/{document_id}Retrieves all extraction records for a specific document.
Path Parameters:
document_id: Unique identifier of the document
Response:
{
"data": [
{
// extraction records for the document
}
]
}GET /document_statsRetrieves accuracy statistics grouped by document.
Query Parameters:
filename(optional): Filter results by filename (partial match)document_id(optional): Filter results by document ID (partial match)
Response:
[
{
"document_id": "string",
"filename": "string",
"avg_field_accuracy": "float",
"avg_ocr_accuracy": "float"
}
]GET /extractions/field-stats/Retrieves accuracy statistics grouped by field type.
Response:
[
{
"field_id": "string",
"field": "string",
"avg_field_accuracy": "float",
"avg_confidence": "float",
"avg_document_ocr_confidence": "float"
}
]GET /extractions/stats/Retrieves summary statistics for all extractions.
Response:
{
"total_documents": "integer",
"total_fields": "integer",
"correct_fields": "integer"
}Each endpoint supports standard HTTP response codes:
200: Successful request400: Bad request (invalid parameters)404: Resource not found500: Server error
☑ Group Classification Confidence Distribution into % buckets
☑ Limit Document Accuracy to limit of 20 with scroll
☑ Field Extraction data should be linked to Document Accuracy by filename
☑ Add conditional to prevent negative confidence scores to Field Extraction

