Skip to content

pierreprudh/Document-Information-Extraction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Autogen - Installation


⚑ Quick Start

  • Project context: This interface will help you extract information from every document you need to given a prompt and json extraction template for visualization. It uses different Open-source OCR and OpenAI API key to extract the result from the text.

  • Prepare

    • Activate your venv (or create one):
      • macOS/Linux: source .venv/bin/activate
      • Windows (PowerShell): .venv\Scripts\Activate
    • Install deps: pip install -r requirements.txt
  • Run UI

πŸš€ Launch the app

For the Streamlit interface:

python app/run_app.py

Agentic Extraction Workflow Schema

Project Structure

  β”œβ”€β”€ resources
  |  β”œβ”€β”€ prompts.py # Contains the prompts in dict
  |  └── OCR.py # Centralize OCR method
  |
  β”œβ”€β”€ autogen3.13 - virtual env
  |
  β”œβ”€β”€ results - local db to temporarily store results
  |  β”œβ”€β”€ XXX.json # extraction results
  |  β”œβ”€β”€ XXX.txt # OCR extraction results
  |  └── XXX.prompt # Prompt used
  |
  β”œβ”€β”€ app - Streamlit interface application
  |  β”œβ”€β”€ run_app.py # Launch to run the app, check the needs
  |  └── streamlit_app.py # Application definition
  |
  └── requirements.txt # Library resources
  └── README.md # Explanation and information

🐍 Python Setup with Pyenv

βœ‹ Virtual Environment

Set the python version with pyenv

pyenv install 3.13

pyenv local 3.13

Add to PATH (if not already done):

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init --path)"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
source ~/.zshrc

It will create the .python-version containing the following version

Create the virtual environment with :

py -3.13 -m venv .venv #Name whatever you want

Try to use the most recent of python, I tried to use an older version and got the a different interface with less options.

Activate the virtual environment :

.venv\Scripts\activate # On Windows
or
source .venv/bin/activate # On macOS/Linux

If it worked you should see in your console something like :

(.venv) PS C:\Users\admin\Documents\limpide autogen>

The (...) specify your python environment

And now you should be able to select the environment in your IDE

Select it in VS code/Cursor :

  • Open Command Palette (Ctrl + Shift + P)
  • Type >Python : Select Interpreter
  • Select your environment (e.g : .venv)

πŸ“š Install Dependencies

Install project dependencies:

pip install -r requirements.txt

# Try this if failed on autogen-agenchat
pip install -U "autogen-agentchat" "autogen-ext[openai]"

πŸ”§ System Prerequisites (OCR)

  • Tesseract OCR (with English + French models):
    • macOS: brew install tesseract tesseract-lang
    • Ubuntu/Debian: sudo apt-get install tesseract-ocr tesseract-ocr-fra tesseract-ocr-eng
    • Windows: installer from the UB Mannheim page
  • Poppler (for pdf2image PDF rendering):
    • macOS: brew install poppler
    • Ubuntu/Debian: sudo apt-get install poppler-utils

Self Host LLM

You can self host your model via Ollama or Lmstudio if you need UI. I will maybe add it.

About

Autogen-powered document extractor using OCR + OpenAI 🧠✨

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages