abhibisht89 commited on
Commit
0c39a08
1 Parent(s): 69aa6c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -32,14 +32,18 @@ def search(query,top_k=100):
32
 
33
  for idx, hit in enumerate(hits[0:5]):
34
  ans.append(corpus[hit['corpus_id']])
35
- return [ans[0],ans[1],ans[2],ans[3],ans[4]]
36
 
37
  exp=["Who is steve jobs?","What is coldplay?","What is a turing test?","What is the most interesting thing about our universe?","What are the most beautiful places on earth?"]
38
 
39
  desc="This is a semantic search engine powered by SentenceTransformers (Nils_Reimers) with a retrieval and reranking system on Wikipedia corous. This will return the top 5 results. So Quest on with Transformers."
40
 
41
  inp=gr.Textbox(lines=1, placeholder=None,label="search you query here")
42
- out=gr.Textbox(type="text",label="search results")
 
 
 
 
43
 
44
- iface = gr.Interface(fn=search, inputs=inp, outputs=out,examples=exp,article=desc,title="Neural Search Engine")
45
  iface.launch()
 
32
 
33
  for idx, hit in enumerate(hits[0:5]):
34
  ans.append(corpus[hit['corpus_id']])
35
+ return ans[0],ans[1],ans[2],ans[3],ans[4]
36
 
37
  exp=["Who is steve jobs?","What is coldplay?","What is a turing test?","What is the most interesting thing about our universe?","What are the most beautiful places on earth?"]
38
 
39
  desc="This is a semantic search engine powered by SentenceTransformers (Nils_Reimers) with a retrieval and reranking system on Wikipedia corous. This will return the top 5 results. So Quest on with Transformers."
40
 
41
  inp=gr.Textbox(lines=1, placeholder=None,label="search you query here")
42
+ out1=gr.Textbox(type="text", label="Search result 1")
43
+ out2=gr.Textbox(type="text", label="Search result 2")
44
+ out3=gr.Textbox(type="text", label="Search result 3")
45
+ out4=gr.Textbox(type="text", label="Search result 4")
46
+ out5=gr.Textbox(type="text", label="Search result 5")
47
 
48
+ iface = gr.Interface(fn=search, inputs=inp, outputs=[out1,out2,out3,out4,out5],examples=exp,article=desc,title="Neural Search Engine")
49
  iface.launch()