nlp-tutorial

nlp-tutorial 是一份面向学习 NLP(自然语言处理,Natural Language Processing)者的教程,使用 Pytorch 实现。NLP 中的大多数模型均用不到 100 行代码实现。(注释和空行除外)
- [08-14-2020] 旧版 TensorFlow v1 代码已归档至 archive 文件夹。为便于初学者阅读,仅支持 PyTorch 1.0 及以上版本。
课程大纲 -(示例用途)
1. 基础嵌入模型(Embedding Model)
2. CNN(卷积神经网络,Convolutional Neural Network)
- 2-1. TextCNN - 二分类情感分析(Binary Sentiment Classification)
3. RNN(循环神经网络,Recurrent Neural Network)
- 3-1. TextRNN - 预测下一步(Predict Next Step)
- 3-2. TextLSTM - 自动补全(Autocomplete)
- 3-3. Bi-LSTM - 在长句中预测下一个词(Predict Next Word in Long Sentence)
4. 注意力机制(Attention Mechanism)
5. 基于 Transformer 的模型
- 5-1. The Transformer - 机器翻译(Translate)
- 5-2. BERT - 下一句分类与掩码词预测(Classification Next Sentence & Predict Masked Tokens)
依赖项
- Python 3.5+
- Pytorch 1.0.0+
作者