Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’­ Emotion Detector Web App πŸ˜ƒπŸ˜’πŸ˜‘

Welcome to the Emotion Detector Web App! This project is a user-friendly web application that detects emotions from text using a machine learning model trained on the GoEmotions dataset. Whether you're building a chatbot, analyzing social media, or just curious about NLP, this project is for you! πŸš€

πŸ“¦ Features

  • Detects a wide range of emotions from text
  • Beautiful and interactive web interface (Streamlit)
  • Preprocessing, training, and evaluation scripts included
  • Uses scikit-learn for easy customization
  • Ready-to-use trained model

πŸ“ Project Structure

GALLERY/
β”œβ”€β”€ app.py                # Streamlit web app for emotion detection
β”œβ”€β”€ train.py              # Training and evaluation script
β”œβ”€β”€ model.py              # Model pipeline definition
β”œβ”€β”€ preprocess.py         # Text cleaning utilities
β”œβ”€β”€ goemotions/           # Dataset and label files
β”‚   β”œβ”€β”€ train.tsv
β”‚   β”œβ”€β”€ test.tsv
β”‚   β”œβ”€β”€ dev.tsv
β”‚   β”œβ”€β”€ emotions.txt
β”‚   └── ekman_mapping.json
β”œβ”€β”€ emotion_model.pkl     # Saved trained model
β”œβ”€β”€ emotion.txt           # (Optional) Additional emotion info
└── README.md             # Project documentation

πŸ› οΈ How to Run the Web App

  1. Clone the repository

    git clone https://github.com/nithins7676/emotion-classification.git
    cd emotion-classification
  2. Install dependencies

    pip install streamlit scikit-learn pandas numpy joblib
  3. Train the model (if not already trained)

    python train.py

    This will preprocess the data, train the model, and save it as emotion_model.pkl.

  4. Run the web app

    streamlit run app.py

    Then open your browser and go to the local URL shown in the terminal (usually http://localhost:8501).

πŸ“ Example: Predicting Emotions in Python

from joblib import load
model = load('emotion_model.pkl')
text = ["I am so happy to see you!"]
pred = model.predict(text)
print(f"Predicted emotion: {pred[0]}")

πŸ€– Dataset

✨ Contributing

Pull requests are welcome! For major changes, please open an issue first.

πŸ“§ Contact

For questions, open an issue or contact the maintainer.


Made with ❀️, Streamlit, and Python 🐍

About

Emotion Detector Web App A user-friendly web application that detects emotions from text using a machine learning model trained on the GoEmotions dataset. Features a beautiful Streamlit interface, easy training pipeline, and support for 27+ emotions. Perfect for chatbots, social media analysis, and NLP enthusiasts! πŸ˜ƒπŸ˜’πŸ˜‘πŸš€

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages