If you post some code, there's a chance somebody who is familiar with what you're are doing can help but this forum is not usually a place where you'll get much programming help. You should head over to Stack Overflow or somewhere similar if that's what you're looking for.
import streamlit as st
import pickle
import pandas as pd
import requests
# def fetch_poster(movie_id):
# requests.get('')
def recommend(movie):
movie_index = movies[movies['title'] == movie].index[0]
distances = similarity[movie_index]
movies_list = sorted(list(enumerate(distances)), reverse=True, key=lambda x: x[1])[1:6]
recommended_movies = []
recommended_movies_posters = []
for i in movies_list:
movie_id = i[0]
#fetching the poster from api
recommended_movies.append(movies.iloc[i[0]].title)
# recommended_movies_posters.append(fetch_poster(movie_id))
return recommended_movies
movie_dict = pickle.load(open('movie_dict.pkl','rb'))
movies = pd.DataFrame(movie_dict)
similarity = pickle.load(open('similarity.pkl','rb'))
st.title('Movie Recommender System')
selected_movie_name = st.selectbox(
'How would you like to be contacted?',
movies['title'].values)
if st.button('Recommend'):
recommendations = recommend(selected_movie_name)
for i in recommendations:
st.write(i)
I want to add the posters in this code so please you give me the API key for supporting this code .
Travis Bell님의 댓글
12월 17, 2024 at 11:08 오전
Hi @visha65456,
If you post some code, there's a chance somebody who is familiar with what you're are doing can help but this forum is not usually a place where you'll get much programming help. You should head over to Stack Overflow or somewhere similar if that's what you're looking for.
Ayu_D님의 댓글
12월 22, 2024 at 11:35 오전
I want to add the posters in this code so please you give me the API key for supporting this code .