Bofandra commited on
Commit
7737bee
·
verified ·
1 Parent(s): e0f616c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -59,7 +59,8 @@ def find(query):
59
  results['text_ar'] = '<a href="'+url+'">'+results['text_ar']+'</a>'
60
  results = results.drop(columns=['source_cat'])
61
  results['source'] = results['source'] + "(chapter " + results['chapter_no'].astype(str) + " , hadith " + results['hadith_no'].astype(str) + ")"
62
- results = results.drop(columns=['chapter_no', 'hadith_no', 'chapter', 'similarity'])
 
63
 
64
  #return sorted_quran
65
  filepath = Path(query+'.csv')
@@ -69,7 +70,7 @@ def find(query):
69
  demo = gr.Interface(
70
  fn=find,
71
  inputs="textbox",
72
- outputs=[gr.Dataframe(headers=['source', 'text_ar', 'text_en'],datatype=["str", "markdown", "str"],wrap=True),gr.DownloadButton()],
73
  cache_examples="lazy",
74
  examples=[
75
  ["law of inheritance in islam"],
 
59
  results['text_ar'] = '<a href="'+url+'">'+results['text_ar']+'</a>'
60
  results = results.drop(columns=['source_cat'])
61
  results['source'] = results['source'] + "(chapter " + results['chapter_no'].astype(str) + " , hadith " + results['hadith_no'].astype(str) + ")"
62
+ results['text'] = '<a href="'+url+'">'+results['text_ar']+ '</a>' + ' (' + results['source'].astype(str) + ')'
63
+ results = results.drop(columns=['chapter_no', 'hadith_no', 'chapter', 'similarity', 'text_ar', 'text_en'])
64
 
65
  #return sorted_quran
66
  filepath = Path(query+'.csv')
 
70
  demo = gr.Interface(
71
  fn=find,
72
  inputs="textbox",
73
+ outputs=[gr.Dataframe(headers=[text'],datatype=["markdown"],wrap=True),gr.DownloadButton()],
74
  cache_examples="lazy",
75
  examples=[
76
  ["law of inheritance in islam"],