diff --git a/submissions/Raghavan_Madabushi/README.md b/submissions/Raghavan_Madabushi/README.md new file mode 100644 index 0000000..f1bd718 --- /dev/null +++ b/submissions/Raghavan_Madabushi/README.md @@ -0,0 +1,27 @@ +# Mood Checker šŸŽ­ + +## What it does +A simple AI-powered tool that analyzes your text and tells you if you're feeling happy, sad, or neutral! It uses a pre-trained HuggingFace model to understand the emotional tone of your messages. + +## How to run it +1. Install the required packages: + ```bash + pip install transformers torch + ``` + +2. Run the mood checker: + ```bash + python mood_checker.py + ``` + +3. Type in any message when prompted, and it will tell you the mood! + +## Example +- Input: "I'm so excited about today!" +- Output: "😊 This message sounds HAPPY!" + +- Input: "I'm feeling down today" +- Output: "šŸ˜” This message sounds SAD!" + +## Why this project? +This project demonstrates how easy it is to use AI models for real-world applications. In just a few lines of code, we can analyze emotions in text - something that could be useful for mental health apps, customer service, or social media analysis! diff --git a/submissions/Raghavan_Madabushi/mood_checker.py b/submissions/Raghavan_Madabushi/mood_checker.py new file mode 100644 index 0000000..b71a980 --- /dev/null +++ b/submissions/Raghavan_Madabushi/mood_checker.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +""" +Mood Checker - A simple AI tool to analyze emotional tone in text +Uses HuggingFace transformers for sentiment analysis +""" + +from transformers import pipeline +import time + +def main(): + print("šŸŽ­ Welcome to Mood Checker! šŸŽ­") + print("I can tell you if your message sounds happy, sad, or neutral!") + print("=" * 50) + + # Load the sentiment analysis model (this might take a moment on first run) + print("Loading AI model... Please wait...") + sentiment_analyzer = pipeline("sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english") + print("āœ… Model loaded successfully!") + print() + + while True: + # Get user input + user_message = input("šŸ’¬ Type your message (or 'quit' to exit): ").strip() + + if user_message.lower() in ['quit', 'exit', 'q']: + print("šŸ‘‹ Thanks for using Mood Checker! Goodbye!") + break + + if not user_message: + print("āŒ Please type something!") + continue + + # Analyze the sentiment + print("šŸ¤” Analyzing your message...") + result = sentiment_analyzer(user_message)[0] + + # Convert sentiment to mood + sentiment = result['label'] + confidence = result['score'] + + if sentiment == 'POSITIVE': + mood = "HAPPY" + emoji = "😊" + elif sentiment == 'NEGATIVE': + mood = "SAD" + emoji = "šŸ˜”" + else: + mood = "NEUTRAL" + emoji = "😐" + + # Display results + print(f"{emoji} This message sounds {mood}!") + print(f" Confidence: {confidence:.1%}") + print("-" * 50) + print() + +if __name__ == "__main__": + try: + main() + except KeyboardInterrupt: + print("\nšŸ‘‹ Goodbye!") + except Exception as e: + print(f"āŒ Oops! Something went wrong: {e}") + print("Make sure you have the required packages installed:") + print("pip install transformers torch") diff --git a/submissions/Raghavan_Madabushi/requirements.txt b/submissions/Raghavan_Madabushi/requirements.txt new file mode 100644 index 0000000..ddb0d13 --- /dev/null +++ b/submissions/Raghavan_Madabushi/requirements.txt @@ -0,0 +1,2 @@ +transformers>=4.20.0 +torch>=1.9.0