Skip to content

JeetChaurasia/Multi-Task-Learning-MTL-Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Multi-Task & Emotion Analysis (don't give a fck, it's shit (used ai))

This project builds a multi-task learning model to classify text for three tasks:

  1. Aspect-Based Sentiment Analysis (positive/negative/neutral) πŸ’‘
  2. Emotion Detection (happy/sad/angry) πŸ˜„πŸ˜’πŸ˜‘
  3. Sentiment-Emotion Joint Modeling (combining sentiment & emotion)

πŸ“‹ Requirements

  • Python 3.6+
  • TensorFlow (Keras) & PyTorch
  • Libraries: pandas, numpy, nltk, spacy, scikit-learn, etc.

Install all dependencies with:

pip install -r requirements.txt

πŸš€ Setup & Installation

  1. Clone the repo:
    https://github.com/JeetChaurasia/Multi-Task-Learning-MTL-Model.git
  2. Download the spaCy model:
    python -m spacy download en_core_web_sm
  3. Get the Semeval-2014 dataset and save as semeval2014_train.csv & semeval2014_test.csv.

🧠 Model Architecture

  • Input: Preprocessed text (tokenized, stopword removed)
  • Embedding Layer: Converts tokens to dense vectors
  • LSTM Layer: Captures text sequence dependencies
  • Outputs:
    • Aspect Sentiment (positive/negative/neutral)
    • Emotion (happy/sad/angry)

Adversarial training improves model robustness using PyTorch.

πŸŽ“ Training

Train the model with:

python train.py

⚑ Metrics:

  • Accuracy πŸ“Š
  • F1 Score πŸ”₯
  • ROC AUC 🎯
  • MSE πŸ“‰

πŸ“ Save/Load Model

Save the model with:

model.save('multi_task_learning_model.h5')

Load the model:

loaded_model = keras.models.load_model('multi_task_learning_model.h5')

πŸ“„ License

MIT License - see LICENSE for details.





About

This is a Python script that implements a multi-task learning model for aspect-based sentiment analysis, emotion detection, and sentiment-emotion joint modeling.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages