Spaces:
Sleeping
Sleeping
display first 3 answers
Browse files
app.py
CHANGED
|
@@ -18,7 +18,13 @@ pipeline = ExtractiveQAPipeline(reader, retriever)
|
|
| 18 |
|
| 19 |
def ask_question(question):
|
| 20 |
prediction = pipeline.run(query=question, params={"Retriever": {"top_k": 10}, "Reader": {"top_k": 5}})
|
| 21 |
-
st.write(prediction)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
question = st.text_input(label="Ask a Question about Game of Thromes", value="Who is Arya's father?")
|
| 24 |
|
|
|
|
| 18 |
|
| 19 |
def ask_question(question):
|
| 20 |
prediction = pipeline.run(query=question, params={"Retriever": {"top_k": 10}, "Reader": {"top_k": 5}})
|
| 21 |
+
st.write(prediction['answers'][0])
|
| 22 |
+
st.write(prediction['answers'][1])
|
| 23 |
+
st.write(prediction['answers'][2])
|
| 24 |
+
|
| 25 |
+
#Streamlit App
|
| 26 |
+
|
| 27 |
+
st.set_page_config(page_title='Game of Thrones QA with Haystack')
|
| 28 |
|
| 29 |
question = st.text_input(label="Ask a Question about Game of Thromes", value="Who is Arya's father?")
|
| 30 |
|