Bofandra commited on
Commit
1043bb5
1 Parent(s): 615cf43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -40,16 +40,18 @@ def find(query):
40
  sorted_quran = quran_splitted.sort_values(by='similarity', ascending=False)
41
  print("cekpoin3\n")
42
 
43
- results = ""
 
44
  i = 0
45
  while i<6:
46
  result = sorted_quran.iloc[i]
47
  result_quran = quran.loc[(quran['sura']==result['sura']) & (quran['aya']==result['aya'])]
 
48
  results = results + result_quran['text'].item()+" (Q.S "+str(result['sura']).rstrip('.0')+":"+str(result['aya']).rstrip('.0')+")\n"
49
  i=i+1
50
 
51
- return sorted_quran
52
- #return results
53
 
54
  demo = gr.Interface(fn=find, inputs="textbox", outputs=gr.Dataframe(headers=['sura', 'aya', 'similarity', 'text']))
55
  #demo = gr.Interface(fn=find, inputs="textbox", outputs="textbox")
 
40
  sorted_quran = quran_splitted.sort_values(by='similarity', ascending=False)
41
  print("cekpoin3\n")
42
 
43
+ #results = ""
44
+ results = pd.DataFrame()
45
  i = 0
46
  while i<6:
47
  result = sorted_quran.iloc[i]
48
  result_quran = quran.loc[(quran['sura']==result['sura']) & (quran['aya']==result['aya'])]
49
+ results = pd.concat([results, result_quran])
50
  results = results + result_quran['text'].item()+" (Q.S "+str(result['sura']).rstrip('.0')+":"+str(result['aya']).rstrip('.0')+")\n"
51
  i=i+1
52
 
53
+ #return sorted_quran
54
+ return results
55
 
56
  demo = gr.Interface(fn=find, inputs="textbox", outputs=gr.Dataframe(headers=['sura', 'aya', 'similarity', 'text']))
57
  #demo = gr.Interface(fn=find, inputs="textbox", outputs="textbox")