Spaces:
Runtime error
Runtime error
SagarBapodara
commited on
Commit
•
8f3fb8f
1
Parent(s):
d9ab710
Updated app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,13 @@
|
|
|
|
|
|
|
|
|
|
1 |
import pickle
|
2 |
import streamlit as st
|
3 |
import requests
|
4 |
|
|
|
|
|
5 |
def fetch_poster(movie_id):
|
6 |
url = "https://api.themoviedb.org/3/movie/{}?api_key=8265bd1679663a7ea12ac168da84d2e8&language=en-US".format(movie_id)
|
7 |
data = requests.get(url)
|
@@ -23,10 +29,13 @@ def recommend(movie):
|
|
23 |
|
24 |
return recommended_movie_names,recommended_movie_posters
|
25 |
|
|
|
|
|
26 |
st.markdown("<h1 style='text-align: center; color: black;'>Movie Recommender System</h1>", unsafe_allow_html=True)
|
27 |
st.markdown("<h4 style='text-align: center; color: black;'>Find a similar movie from a dataset of 5,000 movies!</h4>", unsafe_allow_html=True)
|
28 |
st.markdown("<h4 style='text-align: center; color: black;'>Web App created by Sagar Bapodara</h4>", unsafe_allow_html=True)
|
29 |
|
|
|
30 |
|
31 |
movies = pickle.load(open('movies.pkl','rb'))
|
32 |
similarity = pickle.load(open('similarity.pkl','rb'))
|
@@ -58,5 +67,4 @@ if st.button('Show Recommendation'):
|
|
58 |
st.text(recommended_movie_names[4])
|
59 |
st.image(recommended_movie_posters[4])
|
60 |
|
61 |
-
st.title(" ")
|
62 |
-
# st.write("The code for this recommender system is available [here](https://share.streamlit.io/mesmith027/streamlit_webapps/main/MC_pi/streamlit_app.py)")
|
|
|
1 |
+
# Movie Recommendation System (@ Author : Sagar Bapodara)
|
2 |
+
|
3 |
+
# <==== Importing Dependencies ====>
|
4 |
+
|
5 |
import pickle
|
6 |
import streamlit as st
|
7 |
import requests
|
8 |
|
9 |
+
# <==== Starts from here ====>
|
10 |
+
|
11 |
def fetch_poster(movie_id):
|
12 |
url = "https://api.themoviedb.org/3/movie/{}?api_key=8265bd1679663a7ea12ac168da84d2e8&language=en-US".format(movie_id)
|
13 |
data = requests.get(url)
|
|
|
29 |
|
30 |
return recommended_movie_names,recommended_movie_posters
|
31 |
|
32 |
+
# <==== Webpage HTML Code ====>
|
33 |
+
|
34 |
st.markdown("<h1 style='text-align: center; color: black;'>Movie Recommender System</h1>", unsafe_allow_html=True)
|
35 |
st.markdown("<h4 style='text-align: center; color: black;'>Find a similar movie from a dataset of 5,000 movies!</h4>", unsafe_allow_html=True)
|
36 |
st.markdown("<h4 style='text-align: center; color: black;'>Web App created by Sagar Bapodara</h4>", unsafe_allow_html=True)
|
37 |
|
38 |
+
# <==== Webpage HTML Code ====>
|
39 |
|
40 |
movies = pickle.load(open('movies.pkl','rb'))
|
41 |
similarity = pickle.load(open('similarity.pkl','rb'))
|
|
|
67 |
st.text(recommended_movie_names[4])
|
68 |
st.image(recommended_movie_posters[4])
|
69 |
|
70 |
+
st.title(" ")
|
|