/Text-Emotion-Recognition

SC4001 Neural Networks and Deep Learning: Text Emotion Recognition.

Primary LanguageJupyter Notebook

Project Setup Instructions

This README provides a step-by-step guide to setting up your Python project. Follow these instructions to initialize a virtual environment, install necessary dependencies, and run preprocessing scripts.

Initialising a Virtual Environment

To isolate the project dependencies, it's recommended to use a virtual environment. Follow these steps to set it up:

  1. Create a Virtual Environment: Run the following command in your terminal:

    python -m venv venv
    
  2. Activate the Virtual Environment: Run the following command in your terminal:

    source venv/bin/activate
    
  3. Install Dependencies: Run the following command in your terminal:

    pip install -r requirements.txt
    

Running Preprocessing Scripts

To run the preprocessing scripts, follow these steps:

  1. Run the Script: Run the following command in your terminal:

    python Baseline/tweets_emotions/preprocessing.py
    python Baseline/emo2019/preprocessing.py
    

Repository Contents

This section describes the contents of the repository, divided into two main directories: tweets_emotions and emo2019. Each directory contains notebooks associated with various models.

To view the results of the baseline models, please refer to the model_comparison notebooks in each directory. For BERT + CNN models, please refer to the bert_cnn_cf.ipynb and bert_cnn_emo.ipynb notebooks in the tweets_emotions and emo2019 directories respectively.

tweets_emotions Directory

Notebook Description
CNN Notebook for the Convolutional Neural Network model.
BiLSTM Notebook for the Bidirectional Long Short-Term Memory model.
AttBiLSTM Notebook for the Attention-based Bidirectional LSTM model.
[Model Comparison]Baseline/(tweets_emotions/model_comparison.ipynb) Notebook for comparing the performance of the different models.

emo2019 Directory

Notebook Description
CNN Notebook for the Convolutional Neural Network model.
BiLSTM Notebook for the Bidirectional Long Short-Term Memory model.
AttBiLSTM Notebook for the Attention-based Bidirectional LSTM model.
Model Comparison Notebook for comparing the performance of the different models.

Running BERT-CNN files

pip install tf-models-official Before running the BERT Models as they require an extra library, this libray may interfere with packages used for the above models. (Create new virtual environment if necessary)

BERT-CNN Directory

Notebook Description
BERT + CNN Notebook for the combination of BERT and CNN models.
BERT + CNN Notebook for the combination of BERT and CNN models.