Spaces:
Sleeping
Sleeping
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,14 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title: Predii
|
| 3 |
emoji: π€
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: green
|
| 6 |
-
sdk:
|
| 7 |
-
|
| 8 |
-
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
-
python_version: "3.10"
|
| 12 |
short_description: Ford F-150 Service Manual RAG System
|
| 13 |
---
|
| 14 |
|
|
@@ -26,90 +24,15 @@ A production-ready Retrieval-Augmented Generation (RAG) system for querying Ford
|
|
| 26 |
- **Faithfulness Evaluation**: Quality assurance using LLM-as-judge
|
| 27 |
- **Comprehensive Audit Logging**: Track all queries and responses
|
| 28 |
|
| 29 |
-
## Quick Start
|
| 30 |
-
|
| 31 |
-
### Prerequisites
|
| 32 |
-
|
| 33 |
-
- Python 3.8+
|
| 34 |
-
- OpenAI API Key
|
| 35 |
-
- Cohere API Key (optional, for reranking)
|
| 36 |
-
|
| 37 |
-
### Installation
|
| 38 |
-
|
| 39 |
-
```bash
|
| 40 |
-
pip install -r requirements.txt
|
| 41 |
-
```
|
| 42 |
-
|
| 43 |
-
### Setup
|
| 44 |
-
|
| 45 |
-
1. Create a `.env` file in the root directory:
|
| 46 |
-
```
|
| 47 |
-
OPENAI_API_KEY=your_openai_api_key
|
| 48 |
-
COHERE_API_KEY=your_cohere_api_key
|
| 49 |
-
```
|
| 50 |
-
|
| 51 |
-
2. Preprocess the PDF (first time only):
|
| 52 |
-
```bash
|
| 53 |
-
python -m preprocessing.embeddings
|
| 54 |
-
```
|
| 55 |
-
|
| 56 |
-
3. Run the web interface:
|
| 57 |
-
```bash
|
| 58 |
-
python app.py
|
| 59 |
-
```
|
| 60 |
-
|
| 61 |
-
4. Or run the CLI:
|
| 62 |
-
```bash
|
| 63 |
-
python unified_rag_system.py
|
| 64 |
-
```
|
| 65 |
-
|
| 66 |
## Usage
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
The Gradio interface provides a user-friendly way to interact with the RAG system:
|
| 71 |
-
|
| 72 |
-
- Ask questions about Ford F-150 suspension and repair
|
| 73 |
-
- Toggle query rewriting, MMR diversification, and evaluation
|
| 74 |
-
- View retrieved chunks and evaluation metrics
|
| 75 |
-
|
| 76 |
-
### CLI
|
| 77 |
-
|
| 78 |
-
Run queries from the command line:
|
| 79 |
-
|
| 80 |
-
```python
|
| 81 |
-
from unified_rag_system import UnifiedRAGSystem
|
| 82 |
-
|
| 83 |
-
rag = UnifiedRAGSystem()
|
| 84 |
-
result = rag.query("What is the torque specification for the front shock absorber?")
|
| 85 |
-
print(result.answer)
|
| 86 |
-
```
|
| 87 |
-
|
| 88 |
-
## Project Structure
|
| 89 |
-
|
| 90 |
-
```
|
| 91 |
-
RAG-Assignment/
|
| 92 |
-
βββ preprocessing/ # PDF processing and chunking
|
| 93 |
-
βββ retrieval/ # Retrieval and generation
|
| 94 |
-
βββ reranking/ # Reranking and diversification
|
| 95 |
-
βββ utils/ # Shared utilities
|
| 96 |
-
βββ chunks/ # Document chunks
|
| 97 |
-
βββ chroma_db/ # Vector database
|
| 98 |
-
βββ tests/ # Test files
|
| 99 |
-
βββ app.py # Gradio web interface
|
| 100 |
-
βββ unified_rag_system.py
|
| 101 |
-
βββ requirements.txt
|
| 102 |
-
βββ .env
|
| 103 |
-
```
|
| 104 |
-
|
| 105 |
-
## Architecture
|
| 106 |
-
|
| 107 |
-
See [ARCHITECTURE.md](ARCHITECTURE.md) for detailed system architecture.
|
| 108 |
-
|
| 109 |
-
## Requirements
|
| 110 |
-
|
| 111 |
-
See [requirements.txt](requirements.txt) for dependencies.
|
| 112 |
|
| 113 |
-
##
|
| 114 |
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Predii-RAG-Assignment
|
| 3 |
emoji: π€
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
|
|
|
| 8 |
pinned: false
|
| 9 |
license: mit
|
|
|
|
| 10 |
short_description: Ford F-150 Service Manual RAG System
|
| 11 |
---
|
| 12 |
|
|
|
|
| 24 |
- **Faithfulness Evaluation**: Quality assurance using LLM-as-judge
|
| 25 |
- **Comprehensive Audit Logging**: Track all queries and responses
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
## Usage
|
| 28 |
|
| 29 |
+
Simply type your question about Ford F-150 suspension and repair procedures in the interface above.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
## Technology Stack
|
| 32 |
|
| 33 |
+
- **LLM**: OpenAI GPT-4o-mini
|
| 34 |
+
- **Embeddings**: OpenAI text-embedding-3-large
|
| 35 |
+
- **Vector DB**: ChromaDB
|
| 36 |
+
- **Reranking**: Cohere rerank-english-v3.0
|
| 37 |
+
- **Web Framework**: Gradio
|
| 38 |
+
- **Deployment**: Docker
|