Entity Structure Within and Throughout: Modeling Mention Dependencies forDocument-Level RE笔记

Entity Structure Within and Throughout: Modeling Mention Dependencies for Document-Level Relation Extraction

摘要

作者把关系抽取中的实体表述为提及对(潜在的实体对)间不同的依赖。接着提出了SSAN,在整个编码阶段结合了这种结构依赖和标准的自注意力机制。具体来讲,作者在每个自注意力构建块设计了两个可选的变换模块来自适应地调整注意力流。

介绍

早期地研究限制关系抽取在句子内和单个实体对的设置,最近的研究已经努力在文档水平的文本进行关系抽取,使得关系抽取更为一个更实际的并且更具挑战的任务。
文档级的文本需要定义在许多提及上的实体,这些提及自然的展示出它们之间有意义的依赖。
![image1][image1]

之前的工作已经尝试利用这样的实体结构,尤其是指代相同的依赖。普遍被用的方法是简化指代相同的信息作为额外的特征,把它们整合到输入词嵌入中。Verga,Strubell,and McCallum(2018)提出了一个多实例学习的改编版本合并指代相同的预测。其他人直接用平均池化表述指代相同的提及Yao et al。总之,之前的这些启发的技术仅仅用实体依赖作为补充的证据在预处理或之后的处理阶段,因此支撑了有限的建模能力。此外,这些工作中大多数没能包括有意义的依赖出了指代相同。
最近,基于图的方法在建模实体结构的时候已经展现出了很大的优势,(Sahu et al.2019;Christopoulou, Miwa, and Ananiadou 2019;Nan et al.2020).典型的,这些方法依靠一个通用目的的编码器,通常是LSTM,首先获得一个输入文档的上下文表示。然后他们通过构建一个设计精巧的图来引入实体结构,实体的表示通过传播来跟新。这种方法隔离了上下文推理和结构推理,由于编码网络和图网络的异构,这意味着上下文表示不能首先受益于结构的指导。
作者认为结构的依赖应该合并编码网络,并贯穿整个系统。

方法

2.1形式化了实体结构2.2&&2.3详细介绍了SSAN模型2.4应用

2.1 实体结构

实体结构描述了实体实例在文本上的分布和依赖。在具体的文档级文本的场景中,作者考虑了下面两种结构。

  • 共现结构:两个提及是否出现在同一个句子中。
  • 共同指代结构:是否两个提及指相同的实体

两种结构都可以描述为真或假。对于共现结构,作者把文档分割成句子,把它们作为展示提及交互的最小单元。所以真或假区分句内交互和句间交互,句内依赖于局部上下文,句间需要跨语句推理。作者分别把真和假表示为’之内’和’之间’。对于共同指代结构,真指的是两个提及指同一个实体,因此应该被一块研究和推理,然而假指的是一个不同的实体对,在特定的谓语下可能相关。作者分别表述真和假为coref和relate。总之,两中结构相互正交。
![image2][image2]

除了实体提及之间的依赖外,我们跟深入地考虑另一种实体提及和它的局内 的非实体词之间的依赖。我们表述为它为intraNE(局内非实体)。对于其他句间非实体词,我们认为不存在关键的依赖,把它分类作NA。上边的结构因此表示到以实体为中心的邻接矩阵,它的所有的元素来自一个有限的依赖集,{intra+coref, inter+coref, intra+relate, inter+relate, intraNE, NA} (see figure 2).

2.2 SSAN

SSAN继承于Transformer。
核心部分为带两个可选的变换模块的结构化的自注意力机制。
鉴于输入序列,作者引入了 S ∈ { s i j } S\in \{s_{ij}\} S{sij}表示它的结构,其中 i , j ∈ { 1 , 2 , 3... , n } i,j\in\{1,2,3...,n\} i,j{1,2,3...,n} S i j ∈ { i n t r a + c o r e f , i n t e r + c o r e f , i n t r a + r e l a t e , i n t e r + r e l a t e , i n t r a N E , N A } S_{ij}\in\{intra+coref,inter+coref,intra+relate,inter+relate,intraNE,NA\} Sij{intra+coref,inter+coref,intra+relate,inter+relate,intraNE,NA}是离散变量表示xi到xj的依赖。注意我们实际应用的时候把依赖从提及级别扩展到了词元级别。如果提及包括多个子词,我们为每个词元分配了依赖。在每个提及内,子词符合intra+coref,因此被这样分配。
![image3][image3]

在每层l中,输入 x i l ∈ R d i n x_i^l\in {R^{d_{in}}} xilRdin首先被映射到query,key,value向量。
q i l = x i l W l Q , k i l = x i l W l K , v i l = x i l W l V q_i^l=x_i^lW_l^Q,k_i^l=x_i^lW_l^K,v_i^l=x_i^lW_l^V qil=xilWlQ,kil=xilWlK,vil=xilWlV
三个W都是din*dout维度。基于这些输入和实体结构,我们计算了非结构化的注意力得分和结构化的注意力偏差,把他们加到了一块指导最终的注意力流。非结构化的注意力像标准的自注意力一样query和key内积得到。
e i j l = q i l k j l T d e_{ij}^l=\frac{{q_i^lk_j^l}^T}{\sqrt{d}} eijl=d qilkjlT
和非结构化平行的,我们实施了一个额外的模块来建模以它们的上下文query和key为条件的结构化的依赖。我们把这个模块参数化为变换,这个变化映射sij、query向量、key向量映射到注意力偏差,然后把它加到eij上。
e ˇ i j l = e i j l + t r a n s f o r m a t i o n ( q i l , k j l , s i j ) d \check{e}^l_{ij}=e^l_{ij}+\frac{transformation(q_i^l,k_j^l,s_ij)}{\sqrt{d}} eˇijl=eijl+d transformation(qil,kjl,sij)
这个提出的转换模块调整了从xi到xj的注意力流。因此,模型从结构依赖的指引中收益。在获得调整的注意力得分 e ˇ i j l \check{e}^l_{ij} eˇijl后,用了一个softmax,然后value向量被相应的相加。
z i l + 1 = ∑ j = 1 n e x p e ˇ i j l ∑ k = 1 n e x p e ˇ i j l v j l z_i^{l+1}=\sum_{j=1}^n \frac{exp \check{e}^l_{ij}}{\sum_{k=1}^nexp \check{e}^l_{ij}}v_j^l zil+1=j=1nk=1nexpeˇijlexpeˇijlvjl
zil+1是xil的更新的上下文的表征。

2.3transformation模块

为了合并离散的结构到端到端的可训练的网络,我们用具体的参数实例化了每个sij作为神经层,以合成的方式训练并应用它们。结果,对于每个由sij组成的输入S,我们有一个由对应层参数组成的结构化的模型。至于这些神经层的具体设计,我们提出了两个可选的方案:Biaffine
Transformation 和 Decomposed Linear Transformation:
b i a s i j l = B i a f f i n e ( s i j , q i l , k j l ) o r = D e c o m p ( s i j , q i l , k j l ) bias_{ij}^l =Biaffine(s_{ij},q_i^l,k_j^l) \newline or \newline =Decomp(s_{ij},q_i^l,k_j^l) biasijl=Biaffine(sij,qil,kjl)or=Decomp(sij,qil,kjl)
Biaffine Transformation
b i a s i j l = q i l A l , s i j k j l T + b l , s i j bias_{ij}^l=q_i^lA_{l,s_{ij}}{k_j^l}^T+b_{l,s_{ij}} biasijl=qilAl,sijkjlT+bl,sij
A l , s i j ∈ R d o u t ∗ 1 ∗ d o u t A_{l,s_{ij}}\in R^{d_{out}*1*d_{out}} Al,sijRdout1dout同时方向性的注意query和key向量,把它们映射到一个一维偏差。第二项,我们直接为每个依赖项建立先验偏差,而不依赖于其上下文。
Decomposed Linear Transformation
Dai et al(2019)在transformer中分解词嵌入和位置嵌入的启发,我们提出引入在query和key向量上的偏差,如下:
b i a s i j l = q i l K l , s i j T + Q l , s i j k j l T + b l , s i j bias_{ij}^l=q_i^lK^T_{l,s_{ij}}+Q_{l,s_{ij}}{k_j^l}^T+b_{l,s_{ij}} biasijl=qilKl,sijT+Ql,sijkjlT+bl,sij
K,Q是可训练的神经层。直觉上三部分别表述为:1以query次元表述为条件的偏差2
以key词元表述为条件的偏差3先验偏差

References

Verga, P.; Strubell, E.; and McCallum, A. 2018.

Yao, Y.; Ye, D.; Li, P.; Han, X.; Lin, Y.; Liu, Z.; Liu, Z.; Huang, L.;
Zhou, J.; and Sun, M. 2019. DocRED: A Large-Scale Document-Level Relation Extraction Dataset .In Proceedings of the 57th
Annual Meeting of the Association for Computational Linguistics,
764–777. Florence, Italy: Association for Computational Linguistics. doi:10.18653/v1/P19-1074.

Sahu, S. K.; Christopoulou, F.; Miwa, M.; and Ananiadou, S.2019.Inter-sentence Relation Extraction with Document-level Graph Convolutional Neural Network.In Proceedings of the 57th
Annual Meeting of the Association for Computational Linguistics,
4309–4316. Florence, Italy: Association for Computational Linguistics. doi:10.18653/v1/P19-1423.

Christopoulou, F.; Miwa, M.; and Ananiadou, S. 2019. Connecting the Dots: Document-level Neural Relation Extraction with
Edge-oriented Graphs
. In Proceedings of the 2019 Conference on
Empirical Methods in Natural Language Processing and the 9th
International Joint Conference on Natural Language Processing
(EMNLP-IJCNLP), 4925–4936. Hong Kong, China: Association for Computational Linguistics. doi:10.18653/v1/D19-1498.

Nan, G.; Guo, Z.; Sekulic, I.; and Lu, W. 2020. Reasoning with
Latent Structure Refinement for Document-Level Relation Extraction
. In Proceedings of the 58th Annual Meeting of the Association
for Computational Linguistics, 1546–1557. Online: Association for
Computational Linguistics. doi:10.18653/v1/2020.acl-main.141.

Dai, Z.; Yang, Z.; Yang, Y.; Carbonell, J.; Le, Q.; and Salakhutdinov, R. 2019. Transformer-XL: Attentive Language Models beyond a Fixed-Length Context. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics,
2978–2988. Florence, Italy: Association for Computational Linguistics. doi:10.18653/v1/P19-1285.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值