Spaces:
Build error
Build error
File size: 1,756 Bytes
1880a37 d2a5b85 1880a37 c0b2a4d 1880a37 c0b2a4d 1880a37 c0b2a4d 1880a37 c0b2a4d 1880a37 d2a5b85 |
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 |
---
title: Arabic RAG with DSPy
emoji: ๐ง
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 5.33.0
app_file: app.py
pinned: false
---
# ๐ง Arabic RAG System with DSPy + Gradio
This is a full Hugging Face Space project that allows:
- ๐งพ Uploading Arabic PDF documents.
- ๐ง Storing and indexing chunks using ChromaDB and SentenceTransformers.
- โ Asking questions and generating answers using DSPy with context retrieval.
- โ๏ธ Improving answer accuracy using MIPROv2 optimization based on `trainset.jsonl` and `valset.jsonl`.
---
## ๐ How to Use
1. Go to the **"๐ฅ ุชุญู
ูู ูุชุฎุฒูู"** tab to upload your Arabic PDF file.
2. Go to the **"โ ุณุคุงู"** tab to type a question.
3. (Optional) Go to the **"โ๏ธ ุชุญุณูู ุงููู
ูุฐุฌ"** tab to upload training and validation sets for improving answer accuracy.
---
## ๐ Project Structure
| File | Description |
|-------------------|---------------------------------------------------------|
| `app.py` | Main Gradio interface and DSPy logic |
| `requirements.txt`| Python dependencies |
| `trainset.jsonl` | Example training data (question/answer pairs) |
| `valset.jsonl` | Example validation data (question/answer pairs) |
---
## โจ Notes
- This project supports full Arabic interaction and is optimized for educational and research purposes.
- You can use any Arabic-compatible LLM via DSPy (e.g., OpenAI, OpenChat, Mistral).
---
## ๐ Resources
- [DSPy Official Documentation](https://dspy.ai)
- [Gradio Docs](https://www.gradio.app)
- [Hugging Face Spaces Guide](https://huggingface.co/docs/hub/spaces) |