Spaces:
Runtime error
Runtime error
Commit Β·
662e8d9
1
Parent(s): d26e411
Add app.py and project files
Browse files- README.md +43 -11
- app.py +8 -0
- requirements.txt +0 -0
README.md
CHANGED
|
@@ -1,14 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
sdk_version: 5.37.0
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
-
license: mit
|
| 11 |
-
short_description: A smart internal document Q&A assistant powered by Hugging
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# π Internal Docs Q&A
|
| 2 |
+
|
| 3 |
+
This app allows you to **ask questions about internal documents** (like PDFs) and get accurate, AI-generated answers using embeddings and semantic search.
|
| 4 |
+
|
| 5 |
+
Built with:
|
| 6 |
+
- π§ Transformers
|
| 7 |
+
- π¬ Sentence Transformers
|
| 8 |
+
- π PDFPlumber
|
| 9 |
+
- π Gradio UI
|
| 10 |
+
- π FAISS Vector Search
|
| 11 |
+
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
## π How It Works
|
| 15 |
+
|
| 16 |
+
1. Documents are parsed into chunks.
|
| 17 |
+
2. Each chunk is embedded using a pre-trained model.
|
| 18 |
+
3. When you ask a question, itβs converted to an embedding.
|
| 19 |
+
4. The app retrieves the most relevant chunks and uses a language model to answer.
|
| 20 |
+
5. Done β the answer is displayed with context!
|
| 21 |
+
|
| 22 |
---
|
| 23 |
+
|
| 24 |
+
## π Upload Your Own PDFs (Coming Soon)
|
| 25 |
+
|
| 26 |
+
This Space will support dynamic PDF uploads to retrain the knowledge base on the fly β stay tuned!
|
| 27 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
---
|
| 29 |
|
| 30 |
+
## π Example Questions
|
| 31 |
+
|
| 32 |
+
- What is GitLabβs mission?
|
| 33 |
+
- How does GitLab support contributions?
|
| 34 |
+
- Who is responsible for security policies?
|
| 35 |
+
|
| 36 |
+
---
|
| 37 |
+
|
| 38 |
+
## π€ Contributions
|
| 39 |
+
|
| 40 |
+
Feel free to fork, experiment, and improve it! PRs are welcome.
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## π License
|
| 45 |
+
|
| 46 |
+
MIT
|
app.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from app.qa_pipeline import answer_question
|
| 3 |
+
|
| 4 |
+
def qa_interface(question):
|
| 5 |
+
return answer_question(question)
|
| 6 |
+
|
| 7 |
+
iface = gr.Interface(fn=qa_interface, inputs="text", outputs="text", title="Internal Docs Q&A")
|
| 8 |
+
iface.launch()
|
requirements.txt
ADDED
|
Binary file (2.82 kB). View file
|
|
|