Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Movie Recommender Chatbot

A context-aware movie recommendation chatbot that combines collaborative filtering with natural language processing to provide personalized movie recommendations.

Features

  • Personalized Recommendations: Uses the SAR (Simple Algorithm for Recommendation) model to provide personalized movie recommendations based on user ratings.
  • Context-Aware: Understands different contexts (e.g., Valentine's Day, Halloween) and adjusts recommendations accordingly.
  • Natural Language Interface: Powered by Google's Gemini AI for natural and engaging conversations.
  • Smart Search: Search for movies by title or genre with intelligent filtering.
  • User Preference Analysis: Analyzes user ratings to understand preferences and provide better recommendations.
  • Fallback Mechanisms: Provides template-based responses when AI generation is unavailable.

Project Structure

movie_chatbot/
├── data/               # Data storage directory
├── models/            # Saved model files
├── notebooks/         # Jupyter notebooks for analysis
├── src/
│   ├── api/          # API interfaces (e.g., LLM)
│   ├── config/       # Configuration files
│   ├── models/       # Model implementations
│   └── utils/        # Utility functions
├── tests/            # Test files
├── requirements.txt  # Project dependencies
└── README.md        # Project documentation

Installation

  1. Clone the repository:
git clone https://github.com/DavidVart/First-Chatbot-Test.git
cd movie_chatbot
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables: Create a .env file in the project root with:
GOOGLE_API_KEY=your_gemini_api_key_here

Usage

  1. Run the chatbot:
python src/main.py

Or with a specific API key:

python src/main.py --api-key your_api_key_here
  1. Interact with the chatbot:
  • Set your user ID: "I am user 123"
  • Get recommendations: "Recommend some movies"
  • Search for movies: "Find Star Wars movies"
  • Get context-specific recommendations: "What are good movies for Halloween?"
  • Get help: "help"
  • Exit: "quit"

Example Interactions

You: Hello!
Assistant: Hello! I'm your movie recommendation assistant. To get started, tell me your user ID or ask me to help you find movies!

You: I am user 123
Assistant: Great! I'll remember you as user 123. I can see you've rated 50 movies with an average rating of 3.8/5.
Here are some movies you've rated highly:
- The Shawshank Redemption (Drama): 5.0/5
- Pulp Fiction (Crime | Drama): 4.5/5
- The Matrix (Action | Sci-Fi): 4.5/5
Would you like me to recommend similar movies? Just ask!

You: What are some good movies for Halloween?
Assistant: Based on your preferences for suspense and drama, here are some Halloween-appropriate movies you might enjoy:
1. The Silence of the Lambs (Thriller | Crime) - A psychological thriller that will keep you on the edge of your seat
2. Alien (Sci-Fi | Horror) - Combines your interest in sci-fi with horror elements
3. The Thing (Horror | Sci-Fi) - Another sci-fi horror classic that matches your taste
4. Se7en (Crime | Thriller) - A dark thriller that aligns with your appreciation for crime dramas
5. The Sixth Sense (Mystery | Thriller) - A supernatural thriller with excellent storytelling

You: quit
Assistant: Goodbye! Hope to help you find more great movies next time! 👋

Configuration

The chatbot's behavior can be customized through the configuration files in src/config/:

  • Movie dataset size
  • Recommendation model parameters
  • Special contexts and their genre preferences
  • LLM parameters
  • Keyword lists for intent detection

Development

Running Tests

pytest tests/

Adding New Features

  1. Update configuration in src/config/config.py
  2. Implement new functionality in appropriate module
  3. Add tests in tests/ directory
  4. Update documentation

Dependencies

  • recommenders: For recommendation algorithms
  • google-generativeai: For natural language processing
  • pandas: For data manipulation
  • numpy: For numerical operations
  • python-dotenv: For environment variable management
  • pytest: For testing

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages