A proof of concept on how we can leverage LLM to automate data entry faster.
|
|
1 тиждень тому | |
|---|---|---|
| sample_medical_receipts | 1 тиждень тому | |
| src | 1 тиждень тому | |
| .gitignore | 1 тиждень тому | |
| README.md | 1 тиждень тому | |
| requirements.txt | 1 тиждень тому |
This project provides a FastAPI-based backend for extracting structured data from medical receipts using OpenAI's GPT-4o model with structured outputs.
beta.chat.completions.parse to ensure extracted data adheres to a Pydantic schema.Initialize Virtual Environment: ```bash
python -m venv venv
# Activate environment (Windows) .\venv\Scripts\activate
# Activate environment (Mac/Linux) # source venv/bin/activate
2. **Install Dependencies**:
```bash
pip install -r requirements.txt
Configure Environment:
Create a .env file in the root directory and add your OpenAI API key:
OPENAI_API_KEY=your_api_key_here
bash
uvicorn src.main:app --reload
Install Dependencies:
cd ai-data-entry-ui
npm install --legacy-peer-deps
bash
npm start
GET /healthReturns the status of the server.
POST /api/v1/extractExtracts data from a medical receipt image.
Request Body:
file: Multipart image file.user_name (optional): Name of the employee.department (optional): Department of the employee.Response:
Returns a structured JSON matching the ExtractionResponse schema.
src/
main.py: Entry point and API endpoints.schemas.py: Pydantic models for data validation and structured output.services/:openai_service.py: Logic for interacting with OpenAI API.requirements.txt: Python dependencies..env: Environment variables (not tracked by git).