Twitter-Sentiment-Analysis icon indicating copy to clipboard operation
Twitter-Sentiment-Analysis copied to clipboard

BiLSTM with Multi-Headed Self Attention for sentiment classification of Twitter data, implemented in Keras and PyTorch.

Sentiment Analysis on Twitter Data

Dataset used: Sentiment140

Models:

  • Keras-BiLSTM-with-MHSA.ipynb: A Bidirectional LSTM classifer implemented in Keras with a custom layer for computing the multi-headed self attention
  • PyTorch-BiLSTM-with-MHSA.ipynb: Similar network, but implemented in PyTorch

Older models:

  • old/Keras-Simple-BiLSTM.ipynb: A vanilla Bidirectional LSTM classifer
  • old/PyTorch-Simple-BiLSTM.ipynb: Same, but in PyTorch
  • old/Keras-Improved-BiLSTM.ipynb: Better preprocessing, lower complexity of the model
  • old/Keras-BiLSTM-with-MHSA-v1.ipynb: This has a minor bug, when the tensors are passed from the MHSA layer to the Dense layer we don't flatten it, Keras doesn't given an error even if we pass the 2D tensor to a Dense layer. This has been included because it still gives considerably good results.