farjadmalik commited on
Commit
e0c919d
Β·
1 Parent(s): 8be9912

fix readme

Browse files
Files changed (1) hide show
  1. README.md +59 -16
README.md CHANGED
@@ -1,13 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Iqbal Poetry RAG System
2
 
3
  A Retrieval-Augmented Generation (RAG) system for exploring and querying the poetry of Allama Iqbal. This project leverages vector search and large language models (LLMs) to answer questions about Iqbal's poetry, providing relevant poem excerpts as context.
4
 
5
  ---
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  ## Features
8
 
9
  - **Semantic Search**: Retrieve the most relevant poems for a given question using vector embeddings.
10
  - **LLM-Powered Answers**: Generate answers using a language model, grounded in retrieved poem context.
 
 
11
  - **Configurable**: Easily adjust retrieval thresholds, model settings, and data sources.
12
  - **Error Handling**: Robust error management for smoother user experience.
13
  - **(Optional) Feedback Logging**: Log user feedback for continuous improvement.
@@ -38,38 +70,43 @@ uv pip install -r requirements.txt
38
 
39
  ## Usage
40
 
41
- 1. **Prepare your data**: Place your poems JSON file at the path specified in `app/config.py` (`JSON_FILE_PATH`).
42
- 2. **Run the main application** (example, adjust as needed):
 
 
43
 
44
  ```bash
45
  python app/main.py
46
  ```
47
 
48
- 3. **Query the system**: Enter your question about Iqbal's poetry and receive contextually grounded answers.
49
 
50
  ---
51
 
52
  ## Project Structure
53
 
54
- ```bash
55
  iqbal_poetry_rag/
56
  β”‚
57
  β”œβ”€β”€ app/
58
- β”‚ β”œβ”€β”€ RAGSystem.py # Main RAG system class
59
- β”‚ β”œβ”€β”€ main.py # Entry point for the application
60
- β”‚ └── config.py # Configuration (thresholds, file paths, etc.)
61
  β”‚
62
  β”œβ”€β”€ rag/
63
- β”‚ β”œβ”€β”€ vector_store.py # Vector store initialization and building
64
- β”‚ β”œβ”€β”€ retriever.py # Retriever configuration
65
- β”‚ β”œβ”€β”€ llm.py # LLM initialization and prompt management
66
  β”‚
67
  β”œβ”€β”€ utils/
68
- β”‚ β”œβ”€β”€ error_handling.py # Error handling decorators
69
- β”‚ └── feedback_logger.py # (Optional) Feedback logging
 
 
 
70
  β”‚
71
- β”œβ”€β”€ requirements.txt # Project dependencies
72
- └── README.md # This file
73
  ```
74
 
75
  ---
@@ -79,7 +116,7 @@ iqbal_poetry_rag/
79
  Edit `app/config.py` to set:
80
 
81
  - `SCORE_THRESHOLD`: Minimum similarity score for retrieved poems.
82
- - `JSON_FILE_PATH`: Path to your poems data file.
83
 
84
  ---
85
 
@@ -98,4 +135,10 @@ Contributions are welcome! Please open issues or submit pull requests for improv
98
  ## Acknowledgements
99
 
100
  - Inspired by the poetry of Allama Iqbal.
101
- - Built with Python, vector search, and LLM technologies.
 
 
 
 
 
 
 
1
+ ---
2
+ title: "Iqbal Poetry RAG System"
3
+ emoji: "πŸ“œ"
4
+ colorFrom: "yellow"
5
+ colorTo: "purple"
6
+ sdk: "gradio"
7
+ python_version: "3.10"
8
+ app_file: "app.py"
9
+ short_description: "A Gradio RAG app for exploring and querying the poetry of Allama Iqbal."
10
+ tags:
11
+ - rag
12
+ - poetry
13
+ - gradio
14
+ - iqbal
15
+ - language-models
16
+ ---
17
+
18
  # Iqbal Poetry RAG System
19
 
20
  A Retrieval-Augmented Generation (RAG) system for exploring and querying the poetry of Allama Iqbal. This project leverages vector search and large language models (LLMs) to answer questions about Iqbal's poetry, providing relevant poem excerpts as context.
21
 
22
  ---
23
 
24
+ ## πŸš€ Hugging Face Spaces Ready
25
+
26
+ This project is ready to be deployed as a [Hugging Face Space](https://huggingface.co/spaces). The configuration block above (in YAML) tells Hugging Face how to launch the app:
27
+ - **sdk**: Uses Gradio for the web interface.
28
+ - **app_file**: Entry point for the app (`app/main.py`).
29
+ - **python_version**: Uses Python 3.10.
30
+ - **short_description**: Shown in the Space's thumbnail.
31
+ - **tags**: For discoverability.
32
+
33
+ To deploy, simply upload this repository to your Hugging Face account as a new Space.
34
+
35
+ ---
36
+
37
  ## Features
38
 
39
  - **Semantic Search**: Retrieve the most relevant poems for a given question using vector embeddings.
40
  - **LLM-Powered Answers**: Generate answers using a language model, grounded in retrieved poem context.
41
+ - **Gradio Interface**: User-friendly web interface powered by [Gradio](https://gradio.app/).
42
+ - **Plug-and-Play Dataset**: The poetry dataset is already included in the repository, with all paths set up for immediate use.
43
  - **Configurable**: Easily adjust retrieval thresholds, model settings, and data sources.
44
  - **Error Handling**: Robust error management for smoother user experience.
45
  - **(Optional) Feedback Logging**: Log user feedback for continuous improvement.
 
70
 
71
  ## Usage
72
 
73
+ **Just plug and run!**
74
+ The poetry dataset is already included in the repository, and all file paths are set up using relative paths. No additional data preparation is required.
75
+
76
+ To launch the Gradio app locally:
77
 
78
  ```bash
79
  python app/main.py
80
  ```
81
 
82
+ This will start a Gradio web interface in your browser, where you can enter your questions about Iqbal's poetry and receive contextually grounded answers.
83
 
84
  ---
85
 
86
  ## Project Structure
87
 
88
+ ```
89
  iqbal_poetry_rag/
90
  β”‚
91
  β”œβ”€β”€ app/
92
+ β”‚ β”œβ”€β”€ RAGSystem.py # Main RAG system class
93
+ β”‚ β”œβ”€β”€ main.py # Entry point for the Gradio app
94
+ β”‚ └── config.py # Configuration (thresholds, file paths, etc.)
95
  β”‚
96
  β”œβ”€β”€ rag/
97
+ β”‚ β”œβ”€β”€ vector_store.py # Vector store initialization and building
98
+ β”‚ β”œβ”€β”€ retriever.py # Retriever configuration
99
+ β”‚ β”œβ”€β”€ llm.py # LLM initialization and prompt management
100
  β”‚
101
  β”œβ”€β”€ utils/
102
+ β”‚ β”œβ”€β”€ error_handling.py # Error handling decorators
103
+ β”‚ └── feedback_logger.py # (Optional) Feedback logging
104
+ β”‚
105
+ β”œβ”€β”€ dataset/
106
+ β”‚ └── poems.json # Iqbal's poetry dataset (already included)
107
  β”‚
108
+ β”œβ”€β”€ requirements.txt # Project dependencies
109
+ └── README.md # This file
110
  ```
111
 
112
  ---
 
116
  Edit `app/config.py` to set:
117
 
118
  - `SCORE_THRESHOLD`: Minimum similarity score for retrieved poems.
119
+ - `JSON_FILE_PATH`: Path to your poems data file (already set to the included dataset).
120
 
121
  ---
122
 
 
135
  ## Acknowledgements
136
 
137
  - Inspired by the poetry of Allama Iqbal.
138
+ - Built with Python, Gradio, vector search, and LLM technologies.
139
+
140
+ ---
141
+
142
+ ## References
143
+
144
+ - [Hugging Face Spaces Configuration Reference](https://huggingface.co/docs/hub/spaces-config-reference)