项目
在 GitHub 查看
gaoisbest/NLP-Projects
关于
word2vec、sentence2vec、机器阅读理解、对话系统、文本分类、预训练语言模型(如 XLNet、BERT、ELMo、GPT)、序列标注、信息检索、信息抽取(如实体、关系和事件抽取)、知识图谱、文本生成、网络嵌入
数据与分析实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文NLP-Projects
Natural Language Processing projects, which includes concepts and scripts about:
-
gensim,fastTextandtensorflowimplementations. See Chinese notes, 中文解读
-
doc2vec,word2vec averagingandSmooth Inverse Frequencyimplementations
-
- Categories and components of dialog system
-
tensorflow LSTM(See Chinese notes 1, 中文解读 1 and Chinese notes 2, 中文解读 2)fastTextimplementation
-
- Principle of ELMo, ULMFit, GPT, BERT, XLNet
-
- Chinese_word_segmentation
HMM Viterbiimplementations. See Chinese notes, 中文解读
- Named_Entity_Recognition
- Brands NER via bi-directional LSTM + CRF,
tensorflowimplementation. See Chinese notes, 中文解读
- Brands NER via bi-directional LSTM + CRF,
- Chinese_word_segmentation
Concepts
1. Attention
- Attention == weighted averages
- The attention review 1 and review 2 summarize attention mechanism into several types:
- Additive vs Multiplicative attention
- Self attention
- Soft vs Hard attention
- Global vs Local attention
2. CNNs, RNNs and Transformer
Parallelization [1]
- RNNs
- Why not good ?
- Last step's output is input of current step
- Solutions
- Simple Recurrent Units (SRU)
- Perform parallelization on each hidden state neuron independently
- Sliced RNNs
- Separate sequences into windows, use RNNs in each window, use another RNNs above windows
- Same as CNNs
- Simple Recurrent Units (SRU)
- CNNs
- Why good ?
- For different windows in one filter
- For different filters
- RNNs
Long-range dependency [1]
- CNNs
- Why not good ?
- Single convolution can only caputure window-range dependency
- Solutions
- Dilated CNNs
- Deep CNNs
N * [Convolution + skip-connection]- For example, window size=3 and sliding step=1, second convolution can cover 5 words (i.e., 1-2-3, 2-3-4, 3-4-5)
- Transformer > RNNs > CNNs
- CNNs
Position [1]
CNNs
- Why not good ?
- Convolution preserves relative-order information, but max-pooling discards them
Solutions
- Discard max-pooling, use deep CNNs with skip-connections instead
- Add position embedding, just like in ConvS2S
-
- Why not good ?
- In self-attention, one word attends to other words and generate the summarization vector without relative position information
Semantic features extraction [2]
- Transformer > CNNs == RNNs
3. Pattern of DL in NLP models [3]
Data
- Preprocess
- Sub-word segmentation to avoid OOV and reduce vocabulary size
- Pre-training (e.g., ELMO, BERT)
- Multi-task learning
- Transfer learning, ref_1, ref_2
- Use source task/domain
Sto increase target task/domainT
- Use source task/domain
- If
Shas a zero/one/few instances, we call it zero-shot, one-shot, few-shot learning, respectively
- Preprocess
Model
- Encoder
- CNNs, RNNs, Transformer
- Structure
- Sequential, Tree, Graph
- Encoder
Learning (change loss definition)
- Adversarial learning
- Reinforcement learning
References
- [1] Review
- [2] Why self-attention? A targeted evaluation of neural machine translation architectures
- [3] ACL 2019 oral
Awesome public apis
Awesome packages
Chinese
English
- Spacy
- gensim
- Install tensorflow with one line:
conda install tensorflow-gpu
Future directions
探索相关项目
加载中…