A content-based movie recommendation system that suggests similar movies based on your selection. The system uses natural language processing and machine learning techniques to analyze movie features and provide personalized recommendations.
- Interactive web interface built with Streamlit
- Movie recommendations based on content similarity
- Movie poster display for visual reference
- User-friendly dropdown selection
- Real-time movie poster fetching using TMDB API
- Python 3.x
- Streamlit
- Pandas
- scikit-learn
- NLTK
- TMDB API
- Pickle (for model serialization)
The project uses the TMDB 5000 Movie Dataset from Kaggle, which includes:
- TMDB 5000 Movie Dataset
tmdb_5000_movies.csv: Contains movie metadatatmdb_5000_credits.csv: Contains movie credits and cast information
- Clone the repository
- Install required packages:
pip install -r requirements.txt
- Set up TMDB API key:
- Create a
.envfile in the root directory - Add your TMDB API key:
TMDB_API_KEY=your_api_key_here
- Create a
-
Data Preprocessing:
- Merges movies and credits data
- Extracts relevant features (genres, cast, crew, keywords)
- Processes text data using natural language processing techniques
-
Feature Engineering:
- Converts text data to vectors
- Calculates similarity scores between movies
- Creates a recommendation model
-
Recommendation Process:
- Takes a movie input from user
- Finds similar movies using cosine similarity
- Fetches movie posters from TMDB API
- Displays top 5 recommendations with posters
Run the Streamlit app:
streamlit run app.pymain.ipynb: Contains the data preprocessing and model creation codeapp.py: Streamlit web application codemovies.pkl: Serialized movie datavectorsSim.pkl: Serialized similarity vectorsrequirements.txt: Project dependencies
Feel free to fork this repository and submit pull requests. You can also open issues for bugs or feature requests.
This project is open source and available under the MIT License.