PitchHut logo
MoodSense AI
AI-driven emotion detection and tailored recommendations.
Pitch

MoodSense AI is a sophisticated application that analyzes emotional states from text and offers personalized content suggestions. Leveraging advanced NLP techniques, it classifies text into 8 moods and recommends music, activities, films, and quotes, ensuring an immersive user experience.

Description

MoodSense AI is an advanced, AI-based application designed to detect emotional states through natural language processing (NLP) and offer personalized content recommendations. By leveraging cutting-edge techniques, including TF-IDF, sentence embeddings, and ensemble machine learning models, this application effectively classifies user input into one of eight distinct moods: happy, sad, angry, anxious, neutral, excited, bored, or confused. It not only identifies emotions but also suggests relevant music, activities, movies, and quotes tailored to the user's mood.

Key Features

  • Text Analysis: Accurately understands and interprets the emotional context of user messages.
  • Confidence Scoring: Provides a probability distribution across all mood categories, enhancing the reliability of results.
  • Smart Recommendations: Offers personalized suggestions based on the detected mood to improve user experience.
  • Production API: Easily integrates with other applications via a RESTful API built with FastAPI.
  • Interactive UI: Features a user-friendly Gradio interface for immediate interaction and testing capabilities.
  • Containerized Deployment: Supports Docker for streamlined deployment processes.

Technology Stack

MoodSense AI is built using a robust stack of technologies, including:

  • Language: Python 3.11+
  • Web Framework: FastAPI, utilized for high-performance asynchronous API capabilities.
  • Machine Learning: Implemented with scikit-learn and LightGBM to enhance predictive capabilities.
  • NLP Libraries: Integrates spaCy, NLTK, and Sentence Transformers for effective text analysis and processing.
  • Deep Learning: Utilizes Hugging Face Transformers and PyTorch for advanced neural network models.
  • User Interface: Designed with Gradio for a modern and accessible user interface.

Why Choose MoodSense AI?

MoodSense AI offers distinct advantages over traditional sentiment analysis tools by:

  • Identifying a broader spectrum of emotions through nuanced classification.
  • Providing clear explanations for predictions to increase transparency.
  • Combining machine learning and recommendation systems to create a more engaging experience.
  • Ensuring readiness for production environments with scalable features.

API Usage

The application seamlessly handles requests to analyze text and provide mood predictions along with tailored recommendations. Example usage includes sending a text for analysis, as demonstrated below:

curl -X POST "http://localhost:8000/predict" \
  -H "Content-Type: application/json" \
  -d '{"text": "I feel sad today", "include_recommendations": true, "include_explanation": true}'

Sample Response

The API returns detailed information about the mood detected, the confidence level, and personalized recommendations:

{
  "text": "I feel sad today",
  "mood": "sad",
  "confidence": 0.89,
  "all_probabilities": {
    "sad": 0.89,
    "anxious": 0.06,
    "neutral": 0.03,
    "happy": 0.01,
    "angry": 0.01,
    "bored": 0.00,
    "confused": 0.00,
    "excited": 0.00
  },
  "recommendations": {
    "recommendations": [
      {
        "type": "music",
        "title": "Fix You - Coldplay",
        "url": "https://open.spotify.com/track/..."
      },
      {
        "type": "activity",
        "title": "Practice self-compassion",
        "description": "Take a warm bath and be kind to yourself"
      }
    ],
    "strategy": "hybrid"
  },
  "explanation": "Based on your message, I detected a need for comfort and self-care."
}

Future Enhancements

MoodSense AI is poised for continuous improvement, with potential upgrades including:

  • Integration with external APIs for expanded recommendations (e.g., Spotify, YouTube).
  • Enhanced user experience through authentication features for saving history and preferences.
  • Training on more diverse datasets for improved accuracy in mood detection.

For more information, a live demo, and further details, visit the MoodSense AI repository. This project exemplifies the intersection of technology and emotional intelligence, facilitating personal growth and well-being through its intelligent recommendations.

0 comments

No comments yet.

Sign in to be the first to comment.