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! 😊