Spaces:
Sleeping
Sleeping
Replaced file-context with text-context to see if performance is much better.
Browse files
app.py
CHANGED
|
@@ -4,12 +4,12 @@ import docx
|
|
| 4 |
#from datasets import load_dataset
|
| 5 |
|
| 6 |
file_path = "Adrega_P.I._User_Manual.docx"
|
| 7 |
-
def read_docx(file_path):
|
| 8 |
-
doc = docx.Document(file_path)
|
| 9 |
-
text = []
|
| 10 |
-
for paragraph in doc.paragraphs:
|
| 11 |
-
text.append(paragraph.text)
|
| 12 |
-
return "\n".join(text)
|
| 13 |
|
| 14 |
#pipe = pipeline("question-answering")
|
| 15 |
#pipe = pipeline("text-generation")
|
|
@@ -17,9 +17,9 @@ pipe = pipeline("question-answering", model="deepset/roberta-base-squad2")
|
|
| 17 |
|
| 18 |
st.title("Adrega AI Help")
|
| 19 |
#dataset = load_dataset("andreska/adregadocs", split="test")
|
| 20 |
-
context = read_docx(file_path)
|
| 21 |
#context = dataset[0]["text"]
|
| 22 |
-
|
| 23 |
|
| 24 |
user_input = st.text_input('Ask me a question')
|
| 25 |
if st.button("Submit"):
|
|
|
|
| 4 |
#from datasets import load_dataset
|
| 5 |
|
| 6 |
file_path = "Adrega_P.I._User_Manual.docx"
|
| 7 |
+
#def read_docx(file_path):
|
| 8 |
+
# doc = docx.Document(file_path)
|
| 9 |
+
# text = []
|
| 10 |
+
# for paragraph in doc.paragraphs:
|
| 11 |
+
# text.append(paragraph.text)
|
| 12 |
+
# return "\n".join(text)
|
| 13 |
|
| 14 |
#pipe = pipeline("question-answering")
|
| 15 |
#pipe = pipeline("text-generation")
|
|
|
|
| 17 |
|
| 18 |
st.title("Adrega AI Help")
|
| 19 |
#dataset = load_dataset("andreska/adregadocs", split="test")
|
| 20 |
+
#context = read_docx(file_path)
|
| 21 |
#context = dataset[0]["text"]
|
| 22 |
+
context = "Adrega is a very cool company, that implements AI. Rett fra Rio is a company that specializes in body waxing and is owned by Cintia" #dataset[0]["text"]
|
| 23 |
|
| 24 |
user_input = st.text_input('Ask me a question')
|
| 25 |
if st.button("Submit"):
|