Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📄 Invoice Information Extraction Project

📋 Project Description

This project develops an automated system to extract and classify information from invoices using OCR (Optical Character Recognition) and document layout understanding techniques.

🎯 Goals

  • ✅ Automate invoice data entry
  • ✅ Reduce errors from manual processing
  • ✅ Speed up document processing
  • ✅ Support Vietnamese and other languages

🛠️ Technologies Used

Technology Purpose
PyTesseract OCR - Extract text from images
LayoutLM Detect layout and classify information
PyTorch Deep Learning framework
Streamlit Web interface
Python 3.9+ Primary programming language

📦 Project Structure

invoice-extraction-project/
├── src/
|   ├── inference.py  # Use LayoutLM to predict labels from OCR output
|   ├── ocr_engine.py  # Use Tesseract to recognize text from images
|   ├── utils.py  # Contains coordinate and helper functions
├── notebooks/
│   ├── 01_data_preprocessing.ipynb  # Data exploration and analysis
│   └── 02_train_layoutlm.ipynb    # Model training
├── data/
│   ├── raw/                    # Raw data
│   └── processed/              # Processed data
├── models/                     # Trained models
├── app.py                      # Main Streamlit application
├── requirements.txt            # Python dependencies
└── README.md                   # This file

🚀 Installation and Usage

System Requirements

  • Python 3.9 or higher
  • Tesseract-OCR 4.0+
  • Minimum 4GB RAM
  • Windows / Linux / macOS

Step 1: Clone the Repository

git clone https://github.com/mudotet/Invoice_Extraction_Project.git
cd invoice-extraction-project

Step 2: Create a Virtual Environment

python -m venv venv
# Windows
venv\Scripts\activate
# Linux/macOS
source venv/bin/activate

Step 3: Install Tesseract

Windows:

Linux:

sudo apt-get install tesseract-ocr

macOS:

brew install tesseract

Step 4: Install Python Libraries

pip install -r requirements.txt

Step 5: Run the Application

streamlit run app.py

The app will be available at: http://localhost:8501

📊 Main Features

1. OCR Recognition

  • Extract text from invoice images
  • Support for Vietnamese and English
  • Recognition reliability: >70%

2. Information Classification

  • Automatically identify invoice fields
  • Field types: Title, Date, Amount, etc.
  • Use LayoutLM to understand context and layout

3. Data Export

  • Export results as JSON
  • Export to CSV/Excel

📈 Performance

Metric Value
Accuracy ~92%
Recall ~88%
Precision ~95%
Processing Time / Image ~2-3 seconds

🔄 Changelog

v1.0.0 (2025-12-04)

  • ✨ Initial release
  • 🎯 Basic OCR support with PyTesseract
  • 🖼️ Visualize recognition results
  • 🌐 Initial web interface

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages