|Project Name||Stars||Downloads||Repos Using This||Packages Using This||Most Recent Commit||Total Releases||Latest Release||Open Issues||License||Language|
|Pytorch Sentiment Analysis||2,905||2 years ago||16||mit||Jupyter Notebook|
|Tutorials on getting started with PyTorch and TorchText for sentiment analysis.|
|Kobert||1,035||4 months ago||5||apache-2.0||Jupyter Notebook|
|Korean BERT pre-trained cased (KoBERT)|
|Getting Things Done With Pytorch||873||2 years ago||13||apache-2.0||Jupyter Notebook|
|Jupyter Notebook tutorials on solving real-world problems with Machine Learning & Deep Learning using PyTorch. Topics: Face detection with Detectron 2, Time Series anomaly detection with LSTM Autoencoders, Object Detection with YOLO v5, Build your first Neural Network, Time Series forecasting for Coronavirus daily cases, Sentiment Analysis with BERT.|
|Post Tuto Deployment||269||3 years ago||2||mit||Python|
|Build and deploy a machine learning app from scratch 🚀|
|Sentimentanalysis||260||a year ago||2||mit||Python|
|Sentiment analysis neural network trained by fine-tuning BERT, ALBERT, or DistilBERT on the Stanford Sentiment Treebank.|
|Pytorch Nlp Notebooks||199||4 years ago||1||Jupyter Notebook|
|Learn how to use PyTorch to solve some common NLP problems with deep learning.|
|Pytorch Sentiment Neuron||171||5 years ago||9||mit||Python|
|Deploy Bert For Sentiment Analysis With Fastapi||129||9 months ago||6||mit||Python|
|Deploy BERT for Sentiment Analysis as REST API using FastAPI, Transformers by Hugging Face and PyTorch|
|Fine Grained Sentiment||126||2 years ago||mit||Python|
|A comparison and discussion of different NLP methods for 5-class sentiment classification on the SST-5 dataset.|
|Hierarchical Sentiment||96||4 years ago||1||mit||Python|
|Hierarchical Models for Sentiment Analysis in Pytorch|
This repo contains tutorials covering how to do sentiment analysis using PyTorch 1.8 and torchtext 0.9 using Python 3.7.
The first 2 tutorials will cover getting started with the de facto approach to sentiment analysis: recurrent neural networks (RNNs). The third notebook covers the FastText model and the final covers a convolutional neural network (CNN) model.
There are also 2 bonus "appendix" notebooks. The first covers loading your own datasets with torchtext, while the second contains a brief look at the pre-trained word embeddings provided by torchtext.
If you find any mistakes or disagree with any of the explanations, please do not hesitate to submit an issue. I welcome any feedback, positive or negative!
To install PyTorch, see installation instructions on the PyTorch website.
To install torchtext:
pip install torchtext
We'll also make use of spaCy to tokenize our data. To install spaCy, follow the instructions here making sure to install the English models with:
python -m spacy download en_core_web_sm
For tutorial 6, we'll use the transformers library, which can be installed via:
pip install transformers
These tutorials were created using version 4.3 of the transformers library.
This tutorial covers the workflow of a PyTorch with torchtext project. We'll learn how to: load data, create train/test/validation splits, build a vocabulary, create data iterators, define a model and implement the train/evaluate/test loop. The model will be simple and achieve poor performance, but this will be improved in the subsequent tutorials.
2 - Upgraded Sentiment Analysis
Now we have the basic workflow covered, this tutorial will focus on improving our results. We'll cover: using packed padded sequences, loading and using pre-trained word embeddings, different optimizers, different RNN architectures, bi-directional RNNs, multi-layer (aka deep) RNNs and regularization.
After we've covered all the fancy upgrades to RNNs, we'll look at a different approach that does not use RNNs. More specifically, we'll implement the model from Bag of Tricks for Efficient Text Classification. This simple model achieves comparable performance as the Upgraded Sentiment Analysis, but trains much faster.
4 - Convolutional Sentiment Analysis
Next, we'll cover convolutional neural networks (CNNs) for sentiment analysis. This model will be an implementation of Convolutional Neural Networks for Sentence Classification.
5 - Multi-class Sentiment Analysis
Then we'll cover the case where we have more than 2 classes, as is common in NLP. We'll be using the CNN model from the previous notebook and a new dataset which has 6 classes.
6 - Transformers for Sentiment Analysis
Finally, we'll show how to use the transformers library to load a pre-trained transformer model, specifically the BERT model from this paper, and use it to provide the embeddings for text. These embeddings can be fed into any model to predict sentiment, however we use a gated recurrent unit (GRU).
A - Using TorchText with your Own Datasets
The tutorials use TorchText's built in datasets. This first appendix notebook covers how to load your own datasets using TorchText.
B - A Closer Look at Word Embeddings
This appendix notebook covers a brief look at exploring the pre-trained word embeddings provided by TorchText by using them to look at similar words as well as implementing a basic spelling error corrector based entirely on word embeddings.
C - Loading, Saving and Freezing Embeddings
In this notebook we cover: how to load custom word embeddings, how to freeze and unfreeze word embeddings whilst training our models and how to save our learned embeddings so they can be used in another model.
Here are some things I looked at while making these tutorials. Some of it may be out of date.