Spaces:
Runtime error
Runtime error
Update appStore/keyword_search.py
Browse files
appStore/keyword_search.py
CHANGED
@@ -34,7 +34,7 @@ def start_haystack(documents_processed):
|
|
34 |
pipeline = ExtractiveQAPipeline(reader, retriever)
|
35 |
return pipeline
|
36 |
|
37 |
-
def ask_question(question):
|
38 |
prediction = pipeline.run(query=question, params={"Retriever": {"top_k": 10}, "Reader": {"top_k": 5}})
|
39 |
results = []
|
40 |
for answer in prediction["answers"]:
|
@@ -105,7 +105,7 @@ def app():
|
|
105 |
try:
|
106 |
msg = 'Asked ' + question
|
107 |
logging.info(msg)
|
108 |
-
results = ask_question(question)
|
109 |
st.write('## Top Results')
|
110 |
for count, result in enumerate(results):
|
111 |
if result["answer"]:
|
|
|
34 |
pipeline = ExtractiveQAPipeline(reader, retriever)
|
35 |
return pipeline
|
36 |
|
37 |
+
def ask_question(question,pipeline):
|
38 |
prediction = pipeline.run(query=question, params={"Retriever": {"top_k": 10}, "Reader": {"top_k": 5}})
|
39 |
results = []
|
40 |
for answer in prediction["answers"]:
|
|
|
105 |
try:
|
106 |
msg = 'Asked ' + question
|
107 |
logging.info(msg)
|
108 |
+
results = ask_question(question,pipeline)
|
109 |
st.write('## Top Results')
|
110 |
for count, result in enumerate(results):
|
111 |
if result["answer"]:
|