This project is a Movie Recommender System built with Streamlit, using cosine similarity to recommend movies based on a selected title. It leverages movie metadata and the OMDb API to fetch movie posters, providing an engaging, interactive experience for users to discover similar movies.
- Movie Recommendation: Based on a selected movie, the system provides recommendations for five similar movies.
- Poster Display: Movie posters are fetched using the OMDb API, offering a visual appeal.
- Interactive Interface: The application is deployed with Streamlit for a user-friendly, interactive experience.
git clone https://github.com/yourusername/movie-recommender-system.git
cd movie-recommender-system
Install the necessary packages listed in the requirements.txt
file:
pip install -r requirements.txt
- Sign up at OMDb API to get an API key.
- Replace
api_key=YOUR_API_KEY
in thefetch_poster
function with your OMDb API key.
streamlit run app.py
app.py
: Main file containing the Streamlit app code.movies.pkl
: A pickled file containing movie metadata.similarity.pkl
: A pickled file with the precomputed similarity matrix.requirements.txt
: Lists all required Python libraries for the project.
The application is built around content-based filtering:
- Movie Metadata: The system uses metadata about each movie to compute a similarity matrix using cosine similarity.
- Recommendation Function: The
recommend
function retrieves the top five similar movies for a selected movie. - Poster Fetching: The
fetch_poster
function uses the OMDb API to fetch poster images for each recommended movie.
- Select a Movie: Choose a movie title from the dropdown menu.
- Show Recommendation: Click on "Show Recommendation" to view five similar movie recommendations with posters.
- View Recommendations: Recommended movies with their posters will be displayed in a 5-column layout.
Selecting "Inception" from the dropdown and clicking "Show Recommendation" will display five movies similar to "Inception," with their posters.
Selecting "Spider-Man 3" from the dropdown and clicking "Show Recommendation" will display five movies similar to "Inception," with their posters.
- Enhanced Recommendation Algorithm : Experimenting with other recommendation algorithms for improved recommendations.
- Expanded Movie Metadata: Incorporating genres, actors, and directors to improve similarity calculations.
- User Ratings Integration: Allowing users to rate movies, potentially enhancing personalized recommendations.