This MoodSwing-Emotion-Classifier is a Flask-based web application that leverages a TensorFlow model trained on the "Emotion Dataset" from Kaggle. It classifies user-input text comments into emotions such as joy, anger, and fear, demonstrating the integration of a TensorFlow machine learning model with a web frontend for real-time emotion classification.
- Real-time Emotion Classification: Users can enter a text comment, and the application predicts the emotion behind the text.
- TensorFlow Integration: Utilizes a model built and trained using TensorFlow, showcasing how deep learning models can be seamlessly integrated into web applications.
- Flask Backend: A lightweight Flask application serves as the backend, handling the preprocessing of text inputs and model inference.
These instructions will guide you through setting up the project on your local machine for development and testing purposes.
Before you begin, ensure you have the following installed:
- Python 3.6 or higher
- pip and virtualenv
- Clone the repository:
git clone https://github.com/txhno/MoodSwing-Emotion-Classifier.git
- Navigate to the project directory::
cd MoodSwing-Emotion-Classifier
- Create a virtual environment and activate it::
python3 -m venv venv
source venv/bin/activate
- Install the required packages::
pip install -r requirements.txt
Before launching the Flask application, you need to train the model using the "Emotion Dataset" from Kaggle. This step is crucial for preparing the model for emotion classification.
-
Download the dataset emotion-dataset by abdallahwagih and place
Emotion_classify_Data.csv
in the root directory of the project. -
Ensure you are in the project's root directory.
-
Run the training script:
python model/model_training.py
This script trains the model and saves it, making it ready for inference by the Flask app.
- Run the Flask application:
python run.py
- Open a web browser and navigate to
http://localhost:5000
to access the application. - Use the text input to enter a comment and submit it to see the model’s prediction of the emotion.
- TensorFlow - The machine learning framework used for building and training the emotion classification model.
- Flask - The web framework used for the application backend.
- HTML/CSS/JavaScript - Used for the frontend interface.
- Roshan Warrier - Project Owner - txhno