Spaces:
Running
Running
removing cache
Browse files
app.py
CHANGED
@@ -12,7 +12,6 @@ retriever = TfidfRetriever(document_store=document_store)
|
|
12 |
reader = FARMReader(model_name_or_path="deepset/tinyroberta-squad2", use_gpu=True)
|
13 |
pipeline = ExtractiveQAPipeline(reader, retriever)
|
14 |
|
15 |
-
@st.cache
|
16 |
def load_and_write_data():
|
17 |
doc_dir = './article_txt_got'
|
18 |
docs = convert_files_to_docs(dir_path=doc_dir, clean_func=clean_wiki_text, split_paragraphs=True)
|
@@ -22,6 +21,7 @@ def load_and_write_data():
|
|
22 |
#Streamlit App
|
23 |
|
24 |
st.title('Game of Thrones QA with Haystack')
|
|
|
25 |
|
26 |
load_and_write_data()
|
27 |
|
@@ -31,7 +31,5 @@ def ask_question(question):
|
|
31 |
st.write(prediction['answers'][1])
|
32 |
st.write(prediction['answers'][2])
|
33 |
|
34 |
-
question = st.text_input(label="Ask a Question about Game of Thromes", value="Who is Arya's father?")
|
35 |
-
|
36 |
if question:
|
37 |
ask_question(question)
|
|
|
12 |
reader = FARMReader(model_name_or_path="deepset/tinyroberta-squad2", use_gpu=True)
|
13 |
pipeline = ExtractiveQAPipeline(reader, retriever)
|
14 |
|
|
|
15 |
def load_and_write_data():
|
16 |
doc_dir = './article_txt_got'
|
17 |
docs = convert_files_to_docs(dir_path=doc_dir, clean_func=clean_wiki_text, split_paragraphs=True)
|
|
|
21 |
#Streamlit App
|
22 |
|
23 |
st.title('Game of Thrones QA with Haystack')
|
24 |
+
question = st.text_input(label="Ask a Question about Game of Thromes", value="Who is Arya's father?")
|
25 |
|
26 |
load_and_write_data()
|
27 |
|
|
|
31 |
st.write(prediction['answers'][1])
|
32 |
st.write(prediction['answers'][2])
|
33 |
|
|
|
|
|
34 |
if question:
|
35 |
ask_question(question)
|