Skip to content

shubhamsrkdev/Movie-Recommendation-System-LLM-Based

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Movie Recommendation System (LLM-Based)

This project is a simple movie recommendation system powered by a Large Language Model (LLM) like OpenAI's GPT. Instead of maintaining a local movie database, the system dynamically fetches recommendations based on user preferences.

Features

  • Personalized movie recommendations based on genre, language, mood, release year, and popularity.
  • Utilizes OpenAI's API for up-to-date and diverse movie suggestions.
  • Simple command-line interface for easy interaction.

Prerequisites

  • Python 3.7+
  • OpenAI API key (You can get it from OpenAI)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/movie-recommender-llm.git
    cd movie-recommender-llm
  2. Create and activate a virtual environment (optional but recommended):

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

    pip install -r requirements.txt
  4. Set your OpenAI API key:

    • Option 1: Set it as an environment variable:

      export OPENAI_API_KEY="your-api-key-here"  # On Windows: set OPENAI_API_KEY=your-api-key-here
    • Option 2: Alternatively, you can hardcode your API key in api_communicator.py:

      openai.api_key = "your-api-key-here"

How to Run

  1. Run the program:

    python main.py
  2. Follow the prompts: The program will ask you a series of questions about your movie preferences (e.g., genre, language, mood). Answer them to receive personalized recommendations.

  3. View Recommendations: After answering the questions, the program will display a list of recommended movies based on your preferences.

Example

Answer the following questions to get movie recommendations:
What genre do you prefer (e.g., Action, Comedy, Drama)? Comedy
Which language do you prefer (e.g., English, Hindi, Spanish)? English
What mood do you prefer (e.g., Happy, Sad, Suspense)? Happy
What is the minimum release year you'd like (e.g., 2000)? 2010
On a scale of 1-10, how popular do you want the movie to be? 8

Recommended Movies:
- The Grand Budapest Hotel
- Crazy Rich Asians
- The Intern
- La La Land

Project Structure

movie_recommender/
β”œβ”€β”€ main.py                # Entry point to the program
β”œβ”€β”€ recommender.py         # LLM-based recommendation logic
β”œβ”€β”€ user_input.py          # Handles user input and questions
β”œβ”€β”€ api_communicator.py    # Communicates with the LLM API
β”œβ”€β”€ utils.py               # Helper functions for the project
└── requirements.txt       # Dependencies for the project

Contributing

Feel free to fork this repository and submit pull requests. If you encounter any issues, please open an issue to discuss improvements.

License

This project is licensed under the MIT License.


Enjoy your personalized movie recommendations! 🎬

About

This project is a simple movie recommendation system powered by a Large Language Model (LLM) like OpenAI's GPT. Instead of maintaining a local movie database, the system dynamically fetches recommendations based on user preferences.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages