alexaapo / Bidirectional-stacked-RNN-with-LSTM-GRU

Sentiment Classifier using a bidirectional stacked RNN with LSTM/GRU cells for the Twitter sentiment analysis dataset

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bidirectional stacked RNN with LSTM/GRU

Here I develop a sentiment classifier using a bidirectional stacked RNN with LSTM/GRU cells for the Twitter sentiment analysis dataset, which is available here.

For the development of the models, I experimented with the number of stacked RNNs, the number of hidden layers, type of cells, skip connections, gradient clipping and dropout probability. I use the Adam optimizer and the binary cross-entropy loss function and I transformed the predicted logits to probabilities using a sigmoid function.

For the best model I found:

  • Compute precision, recall and F1 for each class.
  • Plot the loss vs epochs curve and the ROC curve

My solution is implemented in PyTorch and the report is well documented. I also have a notebook with the preprocess of the data. For running them, I used the Google Colab with its GPU.

Note: I also utilize pre-trained word embeddings GloVe as the initial embeddings to input on your models.

You can check the Google Colab Notebooks here:

  • Preprocessing of data: Open In Colab
  • Bidirectional stacked RNN with LSTM/GRU: Open In Colab

About

Sentiment Classifier using a bidirectional stacked RNN with LSTM/GRU cells for the Twitter sentiment analysis dataset


Languages

Language:Jupyter Notebook 100.0%