Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,190 +1,198 @@
|
|
| 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 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
```
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
**
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
- [x]
|
| 179 |
-
- [x]
|
| 180 |
-
- [x]
|
| 181 |
-
- [x]
|
| 182 |
-
- [x]
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
MIT Β© [aiqualitylab](https://github.com/aiqualitylab)
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
title: ' QA Bug Triage Pipeline'
|
| 4 |
+
sdk: gradio
|
| 5 |
+
emoji: π
|
| 6 |
+
colorFrom: red
|
| 7 |
+
colorTo: gray
|
| 8 |
+
---
|
| 9 |
+
# π QA Bug Triage Pipeline
|
| 10 |
+
|
| 11 |
+
> A modern RAG workflow for turning messy app reviews into structured, searchable QA bug intelligence.
|
| 12 |
+
|
| 13 |
+
[](https://python.org)
|
| 14 |
+
[](https://openai.com)
|
| 15 |
+
[](https://gradio.app)
|
| 16 |
+
[](https://trychroma.com)
|
| 17 |
+
[](LICENSE)
|
| 18 |
+
|
| 19 |
+
**π Links:** [Hugging Face Demo](https://huggingface.co/spaces/aiqualitylab/qa-bug-triage) Β· [GitHub Repository](https://github.com/aiqualitylab/qa-bug-triage)
|
| 20 |
+
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
## π Overview
|
| 24 |
+
|
| 25 |
+
Teams often receive product feedback as noisy, repetitive, and unstructured review text. This project converts those reviews into structured bug reports with an LLM, stores them in a local vector database, and makes them easy to search and summarize.
|
| 26 |
+
|
| 27 |
+
The result is a lightweight **bug triage assistant** built with Python, Gradio, OpenAI, ChromaDB, and RAG evaluation tooling.
|
| 28 |
+
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
## β¨ What It Does
|
| 32 |
+
|
| 33 |
+
| Capability | Description |
|
| 34 |
+
|---|---|
|
| 35 |
+
| π₯ Review collection | Fetches real Google Play reviews |
|
| 36 |
+
| π Query routing | Classifies incoming text before triage |
|
| 37 |
+
| ποΈ Structured triage | Generates JSON bug reports with consistent fields |
|
| 38 |
+
| π Hybrid retrieval | Combines semantic retrieval with BM25 keyword matching |
|
| 39 |
+
| π€ AI summaries | Produces concise summaries for triage and search results |
|
| 40 |
+
| ποΈ Store reset | Clears persisted bugs directly from the UI |
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## ποΈ Architecture
|
| 45 |
+
|
| 46 |
+
```
|
| 47 |
+
Google Play Reviews
|
| 48 |
+
β
|
| 49 |
+
βΌ
|
| 50 |
+
βββββββββββββββ
|
| 51 |
+
β Query Router β βββ feature request / general complaint (dropped)
|
| 52 |
+
βββββββββββββββ
|
| 53 |
+
β bug report
|
| 54 |
+
βΌ
|
| 55 |
+
βββββββββββββββ
|
| 56 |
+
β Triage β βββ structured JSON bug record
|
| 57 |
+
βββββββββββββββ
|
| 58 |
+
β
|
| 59 |
+
βΌ
|
| 60 |
+
βββββββββββββββ
|
| 61 |
+
β ChromaDB β βββ vector + BM25 hybrid index
|
| 62 |
+
βββββββββββββββ
|
| 63 |
+
β
|
| 64 |
+
βΌ
|
| 65 |
+
βββββββββββββββ
|
| 66 |
+
β AI Summary β βββ concise triage output
|
| 67 |
+
βββββββββββββββ
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
+
|
| 72 |
+
## π Quick Start
|
| 73 |
+
|
| 74 |
+
```powershell
|
| 75 |
+
# Windows PowerShell
|
| 76 |
+
python -m venv .venv
|
| 77 |
+
.\.venv\Scripts\Activate.ps1
|
| 78 |
+
pip install -r requirements.txt
|
| 79 |
+
python app.py
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
Then open the local Gradio URL in your browser.
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## π API Keys
|
| 87 |
+
|
| 88 |
+
This app uses **BYOK (Bring Your Own Key)**:
|
| 89 |
+
|
| 90 |
+
- Paste your OpenAI API key into the masked field in the UI
|
| 91 |
+
- The key input is masked and never committed to the repository
|
| 92 |
+
|
| 93 |
+
> β οΈ **Never commit API keys to source control.**
|
| 94 |
+
|
| 95 |
+
---
|
| 96 |
+
|
| 97 |
+
## π₯οΈ How To Use
|
| 98 |
+
|
| 99 |
+
1. **Collect** β fetch and triage live Google Play reviews
|
| 100 |
+
2. **Triage** β analyze a single custom review
|
| 101 |
+
3. **Search** β retrieve similar bugs via hybrid retrieval
|
| 102 |
+
4. **Clear bugs** β reset the ChromaDB store
|
| 103 |
+
|
| 104 |
+
---
|
| 105 |
+
|
| 106 |
+
## π Project Structure
|
| 107 |
+
|
| 108 |
+
```
|
| 109 |
+
qa-bug-triage/
|
| 110 |
+
βββ app.py # Gradio app and interaction flows
|
| 111 |
+
βββ collect.py # Google Play review collection
|
| 112 |
+
βββ triage.py # Routing and structured triage logic
|
| 113 |
+
βββ rag.py # Chroma storage and hybrid retrieval
|
| 114 |
+
βββ eval/
|
| 115 |
+
βββ eval.py # RAG evaluation script
|
| 116 |
+
βββ eval_dataset.json # Evaluation dataset
|
| 117 |
+
βββ results.json # Latest saved evaluation metrics
|
| 118 |
+
```
|
| 119 |
+
|
| 120 |
+
---
|
| 121 |
+
|
| 122 |
+
## π Evaluation
|
| 123 |
+
|
| 124 |
+
Run the evaluation suite:
|
| 125 |
+
|
| 126 |
+
```powershell
|
| 127 |
+
python eval\eval.py --api-key YOUR_OPENAI_API_KEY
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
**Latest results:**
|
| 131 |
+
|
| 132 |
+
| Metric | Score |
|
| 133 |
+
|---|---|
|
| 134 |
+
| Answer Relevancy | `0.868` |
|
| 135 |
+
| Faithfulness | `0.292` |
|
| 136 |
+
| Context Precision | `0.020` |
|
| 137 |
+
|
| 138 |
+
---
|
| 139 |
+
|
| 140 |
+
## π° Cost Estimate
|
| 141 |
+
|
| 142 |
+
**Target:** under `$0.50` for a short demo session.
|
| 143 |
+
|
| 144 |
+
| Parameter | Value |
|
| 145 |
+
|---|---|
|
| 146 |
+
| Token range | ~8k β 20k tokens |
|
| 147 |
+
| Typical cost | < $0.50 per session |
|
| 148 |
+
| Recommended max reviews | 5 β 10 |
|
| 149 |
+
|
| 150 |
+
**Tips to keep costs low:**
|
| 151 |
+
- Keep max reviews between 5 and 10
|
| 152 |
+
- Avoid repeated large collect runs
|
| 153 |
+
- Use short test inputs for manual triage validation
|
| 154 |
+
|
| 155 |
+
---
|
| 156 |
+
|
| 157 |
+
## π οΈ Tech Stack
|
| 158 |
+
|
| 159 |
+
| Tool | Role |
|
| 160 |
+
|---|---|
|
| 161 |
+
| [Python](https://python.org) | Core language |
|
| 162 |
+
| [Gradio](https://gradio.app) | Web UI |
|
| 163 |
+
| [OpenAI GPT-4o](https://openai.com) | LLM for triage and summaries |
|
| 164 |
+
| [ChromaDB](https://trychroma.com) | Vector store |
|
| 165 |
+
| [rank-bm25](https://github.com/dorianbrown/rank_bm25) | Keyword retrieval |
|
| 166 |
+
| [RAGAS](https://docs.ragas.io) | RAG evaluation framework |
|
| 167 |
+
| [google-play-scraper](https://github.com/JoMingyu/google-play-scraper) | Review data source |
|
| 168 |
+
|
| 169 |
+
---
|
| 170 |
+
|
| 171 |
+
## β
Functionalities Implemented
|
| 172 |
+
|
| 173 |
+
### Requirements covered
|
| 174 |
+
|
| 175 |
+
- [x] RAG project written in Python
|
| 176 |
+
- [x] Uses at least one LLM
|
| 177 |
+
- [x] Public repository with collection and curation scripts
|
| 178 |
+
- [x] README with project explanation and setup
|
| 179 |
+
- [x] BYOK input in the UI β see [API Keys](#-api-keys)
|
| 180 |
+
- [x] Cost estimate included β see [Cost Estimate](#-cost-estimate)
|
| 181 |
+
- [x] API key requirements listed β see [API Keys](#-api-keys)
|
| 182 |
+
- [x] More than 5 optional techniques covered (7 total β see below)
|
| 183 |
+
|
| 184 |
+
### Techniques implemented
|
| 185 |
+
|
| 186 |
+
- [x] Streaming responses in the UI β `app.py`
|
| 187 |
+
- [x] Dynamic few-shot prompting using similar bugs β `triage.py`
|
| 188 |
+
- [x] Evaluation code and dataset included β `eval/eval.py`, `eval/eval_dataset.json`
|
| 189 |
+
- [x] Domain-specific app for QA bug triage β `triage.py`, `app.py`
|
| 190 |
+
- [x] Structured JSON data curation for RAG β `triage.py`
|
| 191 |
+
- [x] Hybrid retrieval with semantic search and BM25 β `rag.py`
|
| 192 |
+
- [x] Query routing in the active app flow β `triage.py`
|
| 193 |
+
|
| 194 |
+
---
|
| 195 |
+
|
| 196 |
+
## π License
|
| 197 |
+
|
| 198 |
MIT Β© [aiqualitylab](https://github.com/aiqualitylab)
|