0% found this document useful (0 votes)
3 views7 pages

Project Python Rep Final

The Movie Recommendation System suggests films based on the user's emotional state, detected through text input rather than traditional ratings. Implemented using Flask, it employs a keyword-based approach for mood detection and provides tailored movie recommendations for various moods. The system can be enhanced with machine learning or sentiment analysis for improved accuracy and scalability.

Uploaded by

deversh174
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

Project Python Rep Final

The Movie Recommendation System suggests films based on the user's emotional state, detected through text input rather than traditional ratings. Implemented using Flask, it employs a keyword-based approach for mood detection and provides tailored movie recommendations for various moods. The system can be enhanced with machine learning or sentiment analysis for improved accuracy and scalability.

Uploaded by

deversh174
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

“MOVIE RECOMMENDATION SYSTEM”

Gaurav Salunke(2252)
Angad Shinde(2257)
Soham Patil(2244)
Atharva Shelar(2255)
Abhishek Shedge(2254)
Kamal Singh(2258)
Mayur Pawar(2247)

Name of Project Guide


Prof. Sandip Chavan
“MOVIE RECOMMENDATION SYSTEM”

Gaurav Salunke(2252)
Angad Shinde(2257)
Soham Patil(2244)
Atharva Shelar(2255)
Abhishek Shedge(2254)
Kamal Singh(2258)
Mayur Pawar(2247)
INTRODUCTION:

Movies are a significant source of entertainment, and selecting the right movie
based on a person's mood enhances the viewing experience. The Movie
Recommendation System in this project suggests movies to users based on their
emotional state. Unlike traditional recommendation systems that rely on ratings or
viewing history, this system detects a user's mood from text input and recommends
movies accordingly.

The project is implemented using Flask as the backend framework. It features a


simple Natural Language Processing (NLP) approach, where mood detection is
performed using keyword-based matching. The user provides a text input
describing their feelings, and the system categorizes their mood into one of the
predefined categories: happy, sad, angry, relaxed, scared, or neutral. Based on
this detected mood, an appropriate list of movies is suggested.

This system demonstrates the practical application of mood-based content


recommendation, offering a simple yet effective way to personalize movie
suggestions. It can be further enhanced with machine learning models or sentiment
analysis techniques to improve accuracy and scalability.
Program Code :-

from flask import Flask, request, jsonify

from flask_cors import CORS

app = Flask( name )

CORS(app) # Enable CORS for all routes

@app.route('/detect-mood', methods=['POST'])

def detect_mood():

data = request.json

text = data.get('text', '')

# Simple mood detection based on keywords

# In a real app, you might use NLP or ML for this

mood_keywords = {

'happy': ['happy', 'joy', 'excited', 'cheerful', 'good', 'great', 'excellent'],

'sad': ['sad', 'down', 'upset', 'depressed', 'unhappy', 'miserable', 'bad'],

'angry': ['angry', 'mad', 'furious', 'annoyed', 'irritated', 'frustrated'],

'relaxed': ['calm', 'relaxed', 'peaceful', 'chill', 'mellow', 'serene'],

'scared': ['scared', 'afraid', 'fearful', 'anxious', 'nervous', 'terrified']

# Default mood if none detected

detected_mood = 'neutral'

# Simple detection algorithm

text_lower = text.lower()
for mood, keywords in mood_keywords.items():

if any(keyword in text_lower for keyword in keywords):

detected_mood = mood

break

return jsonify({"mood": detected_mood})

@app.route('/get-movies', methods=['GET'])

def get_movies():

mood = request.args.get('mood', 'neutral')

# Movie recommendations based on mood

mood_movies = {

"happy": ["Inside Out", "The Lego Movie", "Finding Nemo", "La La Land", "Mamma Mia!","stree"],

"sad": ["The Fault in Our Stars", "A Walk to Remember", "The Notebook", "Titanic", "Schindler's List"],

"angry": ["John Wick", "The Dark Knight", "Fight Club", "The Godfather", "Mad Max: Fury Road"],

"relaxed": ["The Secret Life of Walter Mitty", "Eat Pray Love", "Under the Tuscan Sun", "Soul", "Amélie"],

"scared": ["Get Out", "The Sixth Sense", "A Quiet Place", "The Conjuring", "Hereditary"],

"neutral": ["The Shawshank Redemption", "Forrest Gump", "Inception", "The Matrix", "Interstellar"]

return jsonify({"movies": mood_movies.get(mood, mood_movies["neutral"])})

if name == ' main ':

app.run(debug=True)
Output:-

You might also like