美文网首页
关系抽取实验debug记录train_demo.py

关系抽取实验debug记录train_demo.py

作者: 布口袋_天晴了 | 来源:发表于2019-08-10 22:12 被阅读0次
词矩阵 word.npy
头实体位置矩阵 pos1.npy
尾实体位置矩阵 pos2.npy
关系矩阵 rel.npy
长度矩阵 length.npy
实体对文件 entpair2scope.json
关系文件 relfact2scope.json
词向量矩阵 mat.npy
词-id文件 word2id.json

0.数据

self.ori_data #将原始的句子信息都加载进来
sentence
head
tail
relation
训练集:关系-18409   实体对-279915  句子-522611
测试集:关系-1950  实体对-96678  句子-172448

1.模型需要的输入

word  50维
pos1  5维
pos2  5维
label
ins_label
length  每个真实句子的实际长度
scope  

2.Embedding层

word  50维
pos1  5维
pos2  5维
word_pos_embedding = [word;pos1;pos2] = 60维

3.Encoder层

pcnn
cnn
rnn
birnn

4.Selector层

att
ave
one
cross_max

5.Classifier分类层

self._loss = nrekit.network.classifier.softmax_cross_entropy(self._train_logit, self.label, self.rel_tot, weights_table=self.get_weights())
softmax_cross_entropy交叉熵损失函数--多分类问题

相关文章

网友评论

      本文标题:关系抽取实验debug记录train_demo.py

      本文链接:https://www.haomeiwen.com/subject/iokdjctx.html