amirhosseinkarami commited on
Commit
ba0b88d
1 Parent(s): 2e052ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -23,12 +23,12 @@ k = 3
23
  table = [tuple(row) for row in data.to_numpy()]
24
 
25
  def recom (input) :
26
- id = input.split("-")[-1]
27
- indices, scores, title_scores = rec.recommend_k(table, k, id)
28
  out = list(data[indices]['title'])
29
  return "\n".join(out)
30
 
31
  demo = gr.Interface(fn=recom,
32
- inputs=[gr.Dropdown(choices = list(data['title'][:20] +'-'+ data['id'][:20].astype(str)), multiselect=False, label="Titles")],
33
  outputs=gr.Textbox(label="Titles of recommended items"))
34
  demo.launch()
 
23
  table = [tuple(row) for row in data.to_numpy()]
24
 
25
  def recom (input) :
26
+ # id = input.split("-")[-1]
27
+ indices, scores, title_scores = rec.recommend_k(table, k, input)
28
  out = list(data[indices]['title'])
29
  return "\n".join(out)
30
 
31
  demo = gr.Interface(fn=recom,
32
+ inputs=[gr.Dropdown(choices = list(data['title'][:20]), multiselect=False, label="Titles")],
33
  outputs=gr.Textbox(label="Titles of recommended items"))
34
  demo.launch()