nlp-tutorial
is a tutorial for who is studying NLP(Natural Language Processing) using Pytorch. Most of the models in NLP were implemented with less than 100 lines of code.(except comments or blank lines)
- Python 3.6+
- Pytorch 1.2.0+
- 1-1. NNLM(Neural Network Language Model) - Predict Next Word
- 1-2. Word2Vec(Skip-gram) - Embedding Words and Show Graph
- 1-3. FastText(Application Level) - Sentence Classification
- Paper - Bag of Tricks for Efficient Text Classification(2016)
- Colab - FastText.ipynb
- 2-1. TextCNN - Binary Sentiment Classification
- 3-1. TextRNN - Predict Next Step
- 3-2. TextLSTM - Autocomplete
- Paper - LONG SHORT-TERM MEMORY(1997)
- Colab - TextLSTM_Torch.ipynb
- 3-3. Bi-LSTM - Predict Next Word in Long Sentence
- 4-1. Seq2Seq - Change Word
- 4-2. Seq2Seq with Attention - Translate
- 4-3. Bi-LSTM with Attention - Binary Sentiment Classification
- Colab - Bi_LSTM(Attention)_Torch.ipynb
- 5-1. The Transformer - Translate
- 5-2. BERT - Classification Next Sentence & Predict Masked Tokens
Model | Example |
---|---|
NNLM | Predict Next Word |
Word2Vec(Softmax) | Embedding Words and Show Graph |
TextCNN | Sentence Classification |
TextRNN | Predict Next Step |
TextLSTM | Autocomplete |
Bi-LSTM | Predict Next Word in Long Sentence |
Seq2Seq | Change Word |
Seq2Seq with Attention | Translate |
Bi-LSTM with Attention | Binary Sentiment Classification |
Transformer | Translate |
Greedy Decoder Transformer | Translate |
BERT | how to train |
- Tae Hwan Jung(Jeff Jung) @graykode,modify by wmathor
- Author Email : [email protected]
- Acknowledgements to mojitok as NLP Research Internship.