peter2000 commited on
Commit
65ba45d
1 Parent(s): 306e6e1

Update appStore/keyword_search.py

Browse files
Files changed (1) hide show
  1. appStore/keyword_search.py +2 -2
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"]: