Jorge Henao commited on
Commit
fcc4f87
1 Parent(s): bcd2d10

fix when 0 results

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -24,7 +24,7 @@ def fake_search(question, retriever_top_k, reader_top_k):
24
  def search(question, retriever_top_k, reader_top_k):
25
  query_result = extractive_query.search_by_query(query = question, retriever_top_k = retriever_top_k, reader_top_k = reader_top_k, es_index = "informecomisionverdad")
26
  result = []
27
- for i in range(0, reader_top_k):
28
  item = query_result[i]
29
  result.append([[i+1], item.answer, item.context[:200], item.meta['title'], item.meta['source']])
30
 
 
24
  def search(question, retriever_top_k, reader_top_k):
25
  query_result = extractive_query.search_by_query(query = question, retriever_top_k = retriever_top_k, reader_top_k = reader_top_k, es_index = "informecomisionverdad")
26
  result = []
27
+ for i in range(0, len(query_result)):
28
  item = query_result[i]
29
  result.append([[i+1], item.answer, item.context[:200], item.meta['title'], item.meta['source']])
30