scholarly360 commited on
Commit
c0cc382
·
1 Parent(s): 4ce90ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -153,7 +153,8 @@ def util_get_list_pageno_and_contents(some_query_passage, page_documents,passage
153
  tmp_dict = {"passage_content":x.page_content, "page_no":int(x.metadata['page_index'])+1, "file_name": str(x.metadata['file_name']), "score" : float(rescore[i])}
154
  tmp_array.append(tmp_dict)
155
  df = pd.DataFrame(tmp_array)
156
-
 
157
 
158
  # print('rescore ' , rescore)
159
  # print(rescore)
 
153
  tmp_dict = {"passage_content":x.page_content, "page_no":int(x.metadata['page_index'])+1, "file_name": str(x.metadata['file_name']), "score" : float(rescore[i])}
154
  tmp_array.append(tmp_dict)
155
  df = pd.DataFrame(tmp_array)
156
+ df = df.sort_values(by='score', ascending=False)
157
+ df = df.drop_duplicates(subset=['file_name'], keep='first')
158
 
159
  # print('rescore ' , rescore)
160
  # print(rescore)