Skip to content

Movie-Media 🎬 is a web application that enhances your movie-watching experience by providing personalized movie recommendations and insights into current movie trends worldwide. Utilizing advanced machine learning algorithms and the NLTK library functions

Notifications You must be signed in to change notification settings

agneepradeep/Movie-Media

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Movie Recommendation System

Overview

This project focuses on building a movie recommendation system using a dataset from TMDB (The Movie Database). The system provides two types of recommendations:

  1. Demographic Filtering: Recommends top movies based on score.
  2. Content-Based Filtering: Recommends movies based on plot similarity or actor/director/keyword similarity.

The primary purpose of this system is to suggest movies that users might enjoy based on their preferences, enhancing their movie-watching experience.

Model Architecture

The recommendation system consists of two main components:

  1. Demographic Filtering: Uses a predefined score to recommend movies.
  2. Content-Based Filtering:
    • TF-IDF Vectorizer: For vectorizing movie plots.
    • Count Vectorizer: For vectorizing actors, directors, and keywords.
    • Cosine Similarity: For calculating similarity between movies.

Data Preprocessing

Steps Taken:

  1. Data Cleaning:
    • Removed null values.
    • Merged datasets on the movie ID to combine features like cast, crew, and title.
  2. Feature Engineering:
    • Extracted important features such as cast, crew, keywords, and genres.
    • Converted stringified lists into Python lists using literal_eval.
  3. Normalization/Scaling:
    • Applied vectorization using CountVectorizer and TfidfVectorizer to normalize text features.

Model Training

Training Process:

  1. Demographic Filtering:
    • No training required.
    • Simply sorted movies based on a predefined score.
  2. Content-Based Filtering:
    • Vectorized the movie plots and other features.
    • Calculated cosine similarity between movies.

Hyperparameters:

  • CountVectorizer: Default parameters.
  • TfidfVectorizer: Default parameters.

Training/Validation Split:

  • Not applicable as it's an unsupervised approach.

Model Evaluation

Evaluation Metrics:

  • Precision and Recall: Evaluated recommendations based on user feedback.
  • Cosine Similarity Score: Used to measure similarity between movies.

Test Data:

  • Used a subset of the TMDB dataset for testing recommendations.

Results and Analysis:

  • The system effectively recommends movies based on plot and other features.
  • Higher cosine similarity scores correlate with more relevant recommendations.

Model Deployment

Deployment Process:

  1. Environment:
    • Streamlit application deployed on a web server.
  2. APIs/Endpoints:
    • /recommend: Endpoint to get movie recommendations based on user input.
  3. Testing:
    • Tested the deployment with different movie inputs to ensure accurate recommendations.

Conclusion

The movie recommendation system provides accurate and relevant suggestions based on user preferences. The combination of demographic and content-based filtering enhances the recommendation quality, making it a robust solution for movie enthusiasts.

References

Appendix

Additional Information:

  • Data preprocessing scripts.
  • Sample API requests and responses.

Dependencies:

  • Python 3.8+
  • Streamlit
  • Pandas
  • Numpy
  • Scikit-learn
  • Joblib
  • Requests

Installation:

pip install streamlit pandas numpy scikit-learn joblib requests

How to Run:

  1. Clone the repository:

    git clone https://github.com/agneepradeep/Movie-Media.git
    cd Movie-Media
  2. Set up virtual environment:

    python -m venv venv
    source venv/bin/activate # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up the OMDB API key:

    • Obtain an API key from OMDB API.
    • Create a .env file in the root directory of the project and add your API key:
      OMDB_API_KEY=your_api_key_here
    • In place of OMDB_API_KEY = st.secrets['API_key'] write this lines:
      from dotenv import load_dotenv
      import os
      
      load_dotenv()
      OMDB_API_KEY = os.getenv('API_Key')
    • It will directly use your api key from your .env file
  5. Run the Streamlit app:

    streamlit run app.py
  6. Access the application: Open your browser and navigate to http://192.168.29.239:8501/.

By following these steps, you can set up and run the movie recommendation system locally.
Enjoy exploring and finding new movies to watch! on our website Movie-Media

About

Movie-Media 🎬 is a web application that enhances your movie-watching experience by providing personalized movie recommendations and insights into current movie trends worldwide. Utilizing advanced machine learning algorithms and the NLTK library functions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published