Gopala Krishna
commited on
Commit
·
724f895
1
Parent(s):
9868478
Working code with clean output
Browse files- .vs/MovieRecommendations/FileContentIndex/{92fdff3f-601c-4439-a431-e379462fddf9.vsidx → 530d8d8c-d287-43e2-8e27-f75003c4e5d8.vsidx} +0 -0
- .vs/MovieRecommendations/FileContentIndex/f9de3a43-2837-44a5-86ca-17e7f15e5432.vsidx +0 -0
- .vs/MovieRecommendations/v17/.wsuo +0 -0
- .vs/VSWorkspaceState.json +1 -1
- .vs/slnx.sqlite +0 -0
- app.py +3 -4
.vs/MovieRecommendations/FileContentIndex/{92fdff3f-601c-4439-a431-e379462fddf9.vsidx → 530d8d8c-d287-43e2-8e27-f75003c4e5d8.vsidx}
RENAMED
File without changes
|
.vs/MovieRecommendations/FileContentIndex/f9de3a43-2837-44a5-86ca-17e7f15e5432.vsidx
DELETED
Binary file (11.4 kB)
|
|
.vs/MovieRecommendations/v17/.wsuo
CHANGED
Binary files a/.vs/MovieRecommendations/v17/.wsuo and b/.vs/MovieRecommendations/v17/.wsuo differ
|
|
.vs/VSWorkspaceState.json
CHANGED
@@ -2,6 +2,6 @@
|
|
2 |
"ExpandedNodes": [
|
3 |
""
|
4 |
],
|
5 |
-
"SelectedNode": "\\
|
6 |
"PreviewInSolutionExplorer": false
|
7 |
}
|
|
|
2 |
"ExpandedNodes": [
|
3 |
""
|
4 |
],
|
5 |
+
"SelectedNode": "\\app.py",
|
6 |
"PreviewInSolutionExplorer": false
|
7 |
}
|
.vs/slnx.sqlite
CHANGED
Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ
|
|
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
|
2 |
import gradio as gr
|
3 |
import numpy as np
|
4 |
import pandas as pd
|
@@ -43,7 +42,7 @@ def recommend_movies(movie_name):
|
|
43 |
return ["Movie not found"]
|
44 |
movie_id = movie_id[0]
|
45 |
similar_ids = find_similar_movies(movie_id, X, k=10)
|
46 |
-
recommendations = [movie_titles[i] for i in similar_ids]
|
47 |
return recommendations
|
48 |
|
49 |
|
@@ -65,11 +64,11 @@ movie_titles = dict(zip(movies['movieId'], movies['title']))
|
|
65 |
|
66 |
# Set up Gradio interface
|
67 |
movie_name = gr.inputs.Textbox(default="Sweet November", label="Movie Name")
|
68 |
-
outputs = gr.outputs.Textbox(label="Recommended Movies")
|
69 |
|
70 |
iface = gr.Interface(
|
71 |
fn=recommend_movies,
|
72 |
inputs=movie_name,
|
73 |
outputs=outputs
|
74 |
)
|
75 |
-
iface.launch()
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import pandas as pd
|
|
|
42 |
return ["Movie not found"]
|
43 |
movie_id = movie_id[0]
|
44 |
similar_ids = find_similar_movies(movie_id, X, k=10)
|
45 |
+
recommendations = "\n".join([movie_titles[i] for i in similar_ids])
|
46 |
return recommendations
|
47 |
|
48 |
|
|
|
64 |
|
65 |
# Set up Gradio interface
|
66 |
movie_name = gr.inputs.Textbox(default="Sweet November", label="Movie Name")
|
67 |
+
outputs = gr.outputs.Textbox(label="Recommended Movies", type="text")
|
68 |
|
69 |
iface = gr.Interface(
|
70 |
fn=recommend_movies,
|
71 |
inputs=movie_name,
|
72 |
outputs=outputs
|
73 |
)
|
74 |
+
iface.launch()
|