File size: 4,689 Bytes
058cb54
 
 
 
 
 
 
 
 
 
 
 
300f169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
058cb54
89880ce
 
 
c34440c
1d40cd4
4c40802
b5923b2
d9e95f0
2390ada
51663e0
b8daaf7
38dc92b
39b72e5
5af4029
54a729d
b633531
29a0f15
77f1882
898f196
39408f6
a2a1d24
8af8e46
1faf2f5
6552a97
ad777ca
3c6846e
80f40db
8c7ad54
1a083b9
6c11658
fbdfe42
31b390c
63dcdd9
89880ce
 
 
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
---
title: DocumentQandAI
emoji: πŸ“Š
colorFrom: gray
colorTo: yellow
sdk: gradio
sdk_version: 5.31.0
app_file: app.py
pinned: false
license: apache-2.0
short_description: QandAI
---
# πŸ“ Document Q&A Demo  
[![Hugging Face Space](https://img.shields.io/badge/HuggingFace-Spaces-blue?logo=huggingface)](https://huggingface.co/spaces/your-username/doc-qa)  
[![Gradio UI](https://img.shields.io/badge/Gradio-5.31.0-brightgreen?logo=gradio)]  
[![Model](https://img.shields.io/badge/Model-RoBERTa--SQuAD2-orange)](https://huggingface.co/deepset/roberta-base-squad2)  
[![License](https://img.shields.io/badge/License-MIT-lightgrey)](LICENSE)

---

## πŸš€ Overview  
Turn **any piece of text**β€”policies, FAQs, product descriptionsβ€”into an interactive **QA interface**.  
Leverages **contextual embeddings** and **span‐extraction** to pinpoint precise answers in real time.

> **Key AI buzzwords:**  
> β€’ Contextual Question Answering β€’ Span Extraction β€’ Transformer-based NLP β€’ Real-time inference β€’ Edge (CPU) deployment β€’ User-centric UX β€’ Cloud-native AI

---

## ✨ Features

| πŸ”‘ Feature                  | πŸ” Description                                                    |
|-----------------------------|--------------------------------------------------------------------|
| **πŸ“š Document Context**      | Paste up to thousands of wordsβ€”no size limits beyond text input.    |
| **❓ Natural Questions**     | Ask anything about your document in plain English.                  |
| **⚑ Instant Answers**       | Results in <500 ms on free CPU tierβ€”no GPUs required.               |
| **πŸ“ˆ Confidence Score**      | See the model’s certainty (0–1) alongside each answer.              |
| **🎨 Sleek Gradio UI**       | Intuitive Blocks layout with input, button, and output panel.       |
| **πŸ”§ Drop-in Deployment**    | Commit three filesβ€”Spaces auto-builds and hosts your demo.          |

---

## πŸ—οΈ Architecture & Workflow

1. **User pastes** document text into the **Context** box.  
2. **User submits** a free-form question.  
3. **`transformers` QA pipeline** (RoBERTa-SQuAD2) locates the answer span.  
4. **Answer + confidence** rendered in the UI.

All computation happens **locally on the Space**, ensuring **data privacy** and **zero API costs**.

---

## πŸ› οΈ Local Development

```bash
git clone https://github.com/your-username/doc-qa.git
cd doc-qa
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python app.py

## Latest Update

- Upgraded RoBERTa-SQuAD2 model for better answers. - May 29, 2025 πŸ“
- Enhanced confidence score display. - June 30, 2025 πŸ“
- Improved handling of large documents. - June 29, 2025 πŸ“
- Upgraded RoBERTa-SQuAD2 model for better answers. - June 28, 2025 πŸ“
- Added support for multi-question inputs. - June 27, 2025 πŸ“
- Optimized CPU inference for faster responses. ❓ - June 26, 2025 πŸ“
- Enhanced confidence score display. - June 25, 2025 πŸ“
- Improved handling of large documents. ⚑ - June 24, 2025 πŸ“
- Added support for multi-question inputs. πŸ“Š - June 22, 2025 πŸ“
- Optimized CPU inference for faster responses. πŸ“ˆ - June 21, 2025 πŸ“
- Enhanced confidence score display. 🎨 - June 20, 2025 πŸ“
- Improved handling of large documents. - June 19, 2025 πŸ“
- Upgraded RoBERTa-SQuAD2 model for better answers. - June 18, 2025 πŸ“
- Added support for multi-question inputs. πŸ“ˆ - June 17, 2025 πŸ“
- Optimized CPU inference for faster responses. - June 16, 2025 πŸ“
- Enhanced confidence score display. ⚑ - June 15, 2025 πŸ“
- Improved handling of large documents. - June 14, 2025 πŸ“
- Upgraded RoBERTa-SQuAD2 model for better answers. ❓ - June 13, 2025 πŸ“
- Optimized CPU inference for faster responses. - June 11, 2025 πŸ“
- Enhanced confidence score display. 🎨 - June 10, 2025 πŸ“
- Improved handling of large documents. πŸ“Š - June 09, 2025 πŸ“
- Upgraded RoBERTa-SQuAD2 model for better answers. πŸ“ˆ - June 08, 2025 πŸ“
- Added support for multi-question inputs. 🎨 - June 07, 2025 πŸ“
- Optimized CPU inference for faster responses. ⚑ - June 06, 2025 πŸ“
- Enhanced confidence score display. - June 05, 2025 πŸ“
- Improved handling of large documents. - June 04, 2025 πŸ“
- Upgraded RoBERTa-SQuAD2 model for better answers. ❓ - June 03, 2025 πŸ“
- Added support for multi-question inputs. - June 02, 2025 πŸ“
- Optimized CPU inference for faster responses. πŸ“Š - June 01, 2025 πŸ“
- Enhanced confidence score display. - May 31, 2025 πŸ“
- Improved handling of large documents. - May 30, 2025 πŸ“

**Website**: https://ghostainews.com/
**Discord**: https://discord.gg/BfA23aYz