code structure


nlp经典论文集

http://www.marekrei.com/blog/74-summaries-of-machine-learning-and-nlp-research/

prerequisite

MLemail

image-20200727181706415

bert相比于Transformer+Ngram

利用上下文相邻词的搭配信息计算出具有最大概率的句子。

image-20200727181533041

该表格是人为训练得到的词组附加信息

代码部分:

image-20200802103545203

data_preprocessing:运行模型前要安装的包

LICNSE:协议

gitgnore:上传GitHub时可忽略

modles:存放模型

机器学习流程:训练(用有标记的数据训练)、测试(用有标记的数据检测正确率)、预测(没有答案,没有标记)

huggingface/transformers NLP模型

confi设置

modeling模型

Tokenization符号化(按词分开按字分开)

image-20200802105517955

seq2seq翻译问题序列到序列finetune后训练 预训练

run_squard预测答案的所在的区间

做任务看example

_tf

wmseq.model

InputExample:ba’yi’ge’li’zi’zhuan’hua’wie’t

Bert

BIES

image-20200802110057407

word2id

image-20200727183526167

加载tokenazation

ymcil/Chinese-BERT-wwm#bert模型

image-20200727183644598

快速加载:只需要填词就可以

都会存在hpara

分类器只能告诉类别,不能加限制

解码器限制输出是合法输出BIE/BE,此刻输出

CRF概率模型B-F 50

image-20200727184205047

PYTORCH

forward数据流动

——init——()

img

forward call(tf)

![img](C:/Users/89582/Documents/Tencent Files/895824013/Image/C2C/J@QW_9L~)TBJX7F4K1Z)$D4.png)

input——id attention_mask:qkv

QKV:

Masked Self-attention:

attenton_mask:控制每个时间点看到的词语

bert

tansformer;enconder,decoder,enconder-deconder

信息流处理

模型尽可能小获取更多的信息transformer

istm模型遗忘

kv——memory

viterbi

crf参考了上一个的概率以及当前输入的-综合算出概率

概率图模型img

神经网络的前身是概率图模型

.class Word kVMN:

。batchsize越大越好permute

matmul

clamp

exp自然范围

stack对函数


Author: Weiruohe
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Weiruohe !
 Previous
MT book MT book
统计机器翻译3.基于词的机器翻译模型3.1 词在翻译中的作用先把句子中的每个词对应翻译后重新排序。包括三个步骤:分析、转换、生成。 3.2构建简单的机器翻译系统 人为翻译:翻译知识的学习(翻译候选),运用知识生成译文(处理常见的单词搭配、主
2020-09-20
Next 
neo4j neo4j
一、Basic conceptsExample graph: 1.Nodes:represent entities2.Labels:group nodes into sets by a certain label[^one node can
2020-08-29
  TOC