推荐github上的一个NLP代码教程:nlp-tutorial,教程中包含常见的NLP模型代码实现(基于Pytorch1.0+),而且教程中的大多数NLP模型都使用少于100行代码。 教程说明 这是使用Pytorch学习NLP(自然语言处理)的教程,把常用NLP模型用不到100行的代码实现了,教程里附论文下载,并且包含py和ipynb文件,经过测试全部通过。 仓库地址: https://github.com/graykode/nlp-tutorial 里面有使用说明和样例(py和ipynb格式)。 注意:论文下载请“阅读原文”。 教程目录 1. Basic Embedding Model(基础嵌入模型) 1-1. NNLM(Neural Network Language Model)- Predict Next Word
A Neural Probabilistic LanguageModel(2003)
1-2. Word2Vec(Skip-gram) - EmbeddingWords and Show Graph
Distributed Representations of Wordsand Phrases and their Compositionality(2013)
1-3. FastText(Application Level)- Sentence Classification
Bag of Tricks for Efficient Text Classification(2016)
2. CNN(卷积神经网络) 2-1. TextCNN - BinarySentiment Classification
Convolutional Neural Networks for SentenceClassification(2014)
2-2. DCNN(Dynamic Convolutional Neural Network) 3. RNN(循环神经网络) 3-1. TextRNN - Predict NextStep
Finding Structure in Time(1990)
3-2. TextLSTM - Autocomplete
LONG SHORT-TERM MEMORY(1997)
3-3. Bi-LSTM - Predict NextWord in Long Sentence
4. Attention Mechanism(注意力机制) 4-1. Seq2Seq - Change Word
Learning Phrase Representations using RNN Encoder–Decoder for Statistical MachineTranslation(2014)
4-2. Seq2Seq with Attention - Translate
NeuralMachine Translation by Jointly Learning to Align and Translate(2014)
4-3. Bi-LSTM with Attention - BinarySentiment Classification
5-1. The Transformer - Translate
Attention Is All You Need(2017)
5-2. BERT - ClassificationNext Sentence & Predict Masked Tokens
BERT: Pre-training of Deep Bidirectional Transformers for LanguageUnderstanding(2018)
TextCNN的两种实现方式(使用TensorFlow和Pytorch) 总结 推荐github上的一个NLP代码教程:nlp-tutorial,一个使用Pytorch实现NLP(自然语言处理)的教程,教程中的大多数NLP模型都使用少于100行代码实现。 仓库地址: https://github.com/graykode/nlp-tutorial 里面有使用说明和样例(py和ipynb格式)。 仓库作者:Tae Hwan Jung(Jeff Jung) |
|