分享

【NLP】Github标星7.7k :常见NLP模型的PyTorch代码实现

 520jefferson 2020-11-21

推荐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. Model based on Transformer(Transformer模型)

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)

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多