Spaces:
Runtime error
Runtime error
File size: 2,301 Bytes
fe6855c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | # π§ Gen AI Email Processing
This project is an AI-powered email processing system that reads, extracts, classifies, and analyzes emails and documents using LLaMA models. It supports OCR for images/PDFs and utilizes machine learning to classify emails.
---
## π Tech Stack
- **Python** (Backend Development)
- **FastAPI** (API Framework)
- **PyTorch & Transformers** (AI Model - LLaMA)
- **OCR Tools** (Tesseract, pdfplumber, python-docx)
- **Langchain & Sentence-Transformers** (Text Processing & Embeddings)
- **Uvicorn** (ASGI Server)
- **Scikit-learn & Pandas** (Data Processing)
- **LLama-CPP-Python** (LLaMA Model Integration)
---
## π₯ Installation & Setup
Follow these steps to set up the project on your local machine:
### 1οΈβ£ Clone the Repository
```sh
git clone https://github.com/your-username/gen_ai_email_processing.git
cd gen_ai_email_processing
```
### 2οΈβ£ Create a Virtual Environment
```sh
python -m venv env
source env/bin/activate # On macOS/Linux
env\Scripts\activate # On Windows
```
### 3οΈβ£ Install Dependencies
```sh
pip install --upgrade pip
pip install -r requirements.txt
```
### 4οΈβ£ Run the FastAPI Server
```sh
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
```
### 5οΈβ£ Access the API Documentation
- Open **Swagger UI**: [http://localhost:8000/docs](http://localhost:8000/docs)
- Open **ReDoc**: [http://localhost:8000/redoc](http://localhost:8000/redoc)
---
## π¬ API Endpoints
| Method | Endpoint | Description |
|--------|------------------|--------------------------|
| POST | `/upload-email` | Upload and process email |
| GET | `/health` | Check API status |
---
## π Environment Variables
Create a `.env` file in the **config/** directory and add the necessary settings:
```ini
MODEL_PATH=/path/to/llama/model
OCR_LANGUAGE=eng
```
---
## π Updating the Project
If you pull new changes from GitHub, remember to update dependencies:
```sh
git pull origin main
pip install -r requirements.txt
```
---
## π€ Pushing the Project to GitHub
After making changes, push them to GitHub:
```sh
git add .
git commit -m "Updated project files"
git push origin main
```
---
## π Contributing
Feel free to fork and contribute to this project! π
|