Spaces:
Build error
Build error
Update README.md
Browse files
README.md
CHANGED
@@ -1,19 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# ๐ง Arabic RAG System with DSPy + Gradio
|
2 |
|
3 |
This is a full Hugging Face Space project that allows:
|
4 |
-
- Uploading Arabic PDF documents.
|
5 |
-
- Storing and indexing chunks using ChromaDB.
|
6 |
-
- Asking questions and generating answers using DSPy with context retrieval.
|
7 |
-
- Improving answer accuracy using MIPROv2 optimization based on train/val sets.
|
8 |
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
-
|
12 |
-
2. Ask a question in Arabic.
|
13 |
-
3. Optionally upload `trainset.jsonl` and `valset.jsonl` to fine-tune the DSPy RAG module.
|
14 |
|
15 |
-
##
|
16 |
|
17 |
-
-
|
18 |
-
-
|
19 |
-
-
|
|
|
1 |
+
---
|
2 |
+
title: Arabic RAG with DSPy
|
3 |
+
emoji: ๐ง
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: indigo
|
6 |
+
sdk: gradio
|
7 |
+
sdk_version: "4.25.0"
|
8 |
+
app_file: app.py
|
9 |
+
pinned: false
|
10 |
+
---
|
11 |
+
|
12 |
# ๐ง Arabic RAG System with DSPy + Gradio
|
13 |
|
14 |
This is a full Hugging Face Space project that allows:
|
|
|
|
|
|
|
|
|
15 |
|
16 |
+
- ๐งพ Uploading Arabic PDF documents.
|
17 |
+
- ๐ง Storing and indexing chunks using ChromaDB and SentenceTransformers.
|
18 |
+
- โ Asking questions and generating answers using DSPy with context retrieval.
|
19 |
+
- โ๏ธ Improving answer accuracy using MIPROv2 optimization based on `trainset.jsonl` and `valset.jsonl`.
|
20 |
+
|
21 |
+
---
|
22 |
+
|
23 |
+
## ๐ How to Use
|
24 |
+
|
25 |
+
1. Go to the **"๐ฅ ุชุญู
ูู ูุชุฎุฒูู"** tab to upload your Arabic PDF file.
|
26 |
+
2. Go to the **"โ ุณุคุงู"** tab to type a question.
|
27 |
+
3. (Optional) Go to the **"โ๏ธ ุชุญุณูู ุงููู
ูุฐุฌ"** tab to upload training and validation sets for improving answer accuracy.
|
28 |
+
|
29 |
+
---
|
30 |
+
|
31 |
+
## ๐ Project Structure
|
32 |
+
|
33 |
+
| File | Description |
|
34 |
+
|-------------------|---------------------------------------------------------|
|
35 |
+
| `app.py` | Main Gradio interface and DSPy logic |
|
36 |
+
| `requirements.txt`| Python dependencies |
|
37 |
+
| `trainset.jsonl` | Example training data (question/answer pairs) |
|
38 |
+
| `valset.jsonl` | Example validation data (question/answer pairs) |
|
39 |
+
|
40 |
+
---
|
41 |
+
|
42 |
+
## โจ Notes
|
43 |
+
|
44 |
+
- This project supports full Arabic interaction and is optimized for educational and research purposes.
|
45 |
+
- You can use any Arabic-compatible LLM via DSPy (e.g., OpenAI, OpenChat, Mistral).
|
46 |
|
47 |
+
---
|
|
|
|
|
48 |
|
49 |
+
## ๐ Resources
|
50 |
|
51 |
+
- [DSPy Official Documentation](https://dspy.ai)
|
52 |
+
- [Gradio Docs](https://www.gradio.app)
|
53 |
+
- [Hugging Face Spaces Guide](https://huggingface.co/docs/hub/spaces)
|