julietarubis commited on
Commit
662e8d9
Β·
1 Parent(s): d26e411

Add app.py and project files

Browse files
Files changed (3) hide show
  1. README.md +43 -11
  2. app.py +8 -0
  3. requirements.txt +0 -0
README.md CHANGED
@@ -1,14 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
- title: Internal Docs Qa
3
- emoji: πŸ†
4
- colorFrom: gray
5
- colorTo: green
6
- sdk: gradio
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
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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