Spaces:
Sleeping
Sleeping
Commit
·
ba0b88d
1
Parent(s):
2e052ea
Update app.py
Browse files
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,
|
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]
|
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()
|