论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

时间:2022-12-21 13:55:57


论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Classification

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...



  关系抽取是自然语言处理任务中比较重要的任务,其是知识图谱构建的子任务。现如今常用的方法是基于监督学习方法,但由于人工标注语料太少,且成本较高,不利于大规模图谱的构建,因此远程监督学习方法引入。其通过现有的知识库(例如常用的FreeBase)已存在的三元组来从互联网语料中进行启发式对齐。即只要语料中出现目标两个实体,便将其认为是对应知识库中的关系。这种方法解决了语料问题,但引入了噪声。本文为2019ACL会议论文,主要解决语料的噪声。

一、简要信息

序号

属性


1

模型名称

ARNOR

2

所属领域

自然语言处理

3

研究内容

远程监督关系抽取

4

核心内容

Attention Regularization

5

GitHub源码

6

论文PDF

​https://www.aclweb.org/anthology/P19-1135.pdf​

二、全文摘要翻译

  远程监督被广泛应用到关系分类,其主要目的是通过远程知识库为无标签数据进行对齐来获得大量的训练数据。然而,这样也导致大量的噪声,一些句子事实上并没有表达标签对应的关系。本文,我们提出ARNOR模型(一个新的用于远程监督关系抽取的降噪注意力正则化方法)。ARNOR假定一个可信的关系标签应该是可以被神经网络所解释的,具体的来说,我们的模型可以迭代学习一个可解释的模型,并且利用它选择真实示例。我们首先引入注意力正则化促使模型可以更加关注于句子中的pattern,这些pattern是对关系的可解释的词或词组。其次,如果模型可以从候选的真实示例中定位出所有的pattern,我们将选取它们作为真实的样本用于接下来的训练。根据在NYT数据集上的实验结果表明,我们的模型相比最优模型在关系分类和降噪上获得很大的提升。

三、简要介绍

  作者认为,关系抽取中,句子之所以能表达对应的关系,很大程度上由句子中的pattern来决定,如图:

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

句子:Bill Lockyer was born in CaliforniaBill Lockyer is an attorney general of California 都包含两个实体 Bill LockyerCalifornia ,知识库中所有的关系是 place_of_birth,可知第一个句子是表达这个关系,而第二个句子并不能表达,所以第二个句子的标签是噪声。之所以可以判断两个句子是否能够表达这个关系,其中的pattern起到了很大的作用,作者认为 was born in 可以作为pattern。

  另外,作者认为传统的基于注意力的LSTM,两个实体对应的权重很大,而其他句子成分(例如pattern),如图所示:

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...


  对于远程监督关系抽取任务噪声问题,作者罗列了三种related work:

(1)多示例学习(multi-instance learning):主要将包含相同实体对的句子组合为一个包单位,并以包为单位进行分类。作者认为其不能在句子层面上降噪

(2)强化学习或对抗学习:强化学习和对抗学习都是试图从所有示例中找出可信的真实样本,直接剔除噪声;

(3)第三种则是基于pattern。过去的做法是利用远程监督的带有标签,以及人工为每个示例标注的pattern来完成降噪;也有工作是基于强化学习来提取pattern的。

四、提出的方法

  作者提出一种基于注意力正则化的降噪框架(ARNOR-Attention Reguriarization based NOisy Reduction Framework)实现关系抽取,整体框架如下图所示:

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

4.1 句子表征

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...的词向量,BiLSTM输出层为 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...,则有 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...。其中 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...表示句子最大长度。注意力层表示如下:

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

其中论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...表示学习的参数。输出部分 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class... 则为一个向量,向量维度为论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...,其中 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...为隐层维度。

  这一部分对应于上图中左侧虚线框部分。

4.2 注意力正则化(Attention Regularization)

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class... 首先根据一个策略获取句子 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class... 的所有patterns 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...(接下来讲解这个策略)。这里主要包括两个attention分布,分别如下:

(1)论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class... :其表示在句子编码部分,学习到的attention分布。这一部分作者发现绝大多数attention权重都集中在两个实体词,而pattern部分的权重很低。
(2)论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...:其表示带有patterns 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...的权重。作者首先定义了 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...:给定一个句子中每个词 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...分别代表两个实体,论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...则代表pattern词,则有

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

简单的说,就是如果确定一个句子的pattern,则句子中每个词的权重论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...取决于pattern的个数,不是pattern和实体的词权重一律为0,是pattern和实体的词权重相等且为 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...表示pattern的个数)。作者认为这个权重是一个理想条件下的权重,其能很好的反应句子的每个部分对预测关系 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

  因此任务的一个目标就是尽可能的让这两个attention分布距离减少,这样对于含有噪声的数据,就可以根据其pattern来确定,如果pattern的权重很低,则可以断定其是噪声。衡量分布距离的度量可选用KL散度:

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

训练模型的loss可以用交叉熵表达:

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

另外分类层的损失函数为 论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...,所以整体模型的loss为论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...,其中论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...是一个权重参数。

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...,通过这个模块来判断两者分布的差距,并以此作为训练的一部分。作者认为二者分布差距越大,则这个示例可能属于噪声,具体分析可见下面几节。下面主要介绍如何来判断噪声,以及如何确定pattern。

4.3 示例选择器(Instance Selector)

  为了比较仔细的描述该部分,截取一部分图

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...


  上一节讲了Attention Regularization,其输入包括两个attention,那如何来选择instance呢?同样也是根据这两个attention分布,作者定义了一个Confidence Calculation模块来计算一个置信得分。上面曾描述过,论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...是句子衡量每个词对关系分类的贡献权重,论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...则是每个pattern对关系分类的贡献分布,作者认为,如果一个句子所学习的这个权重分布与实际pattern的分布不相符时,这个示例被认为是一个噪声。也就是说作者更倾向于pattern是可以表达这个实体对的关系,如果某个句子不含有相关的pattern,则其无法表达这种关系,从attention分布上面看就是论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...的差距越大,越不能表现出这种分布,这也是为什么Attention Regularization部分以KL散度来作为训练的loss。因此本部分可以使用这两个分布来判断是否是噪声,作者依然使用KL散度:

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

分析可知,如果两个分布完全一致,则认为这个分类器学习到这个句子的分布与实际pattern是一致的,KL散度为0,得分论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...,否则KL越大,论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...值约趋向于0。论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...代表着这个示例的得分,设定一个阈值论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...,但凡超过该值的示例被划为真实示例,否则为噪声。

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...新选择了非噪声样本,则这个样本所包含的pattern被加入到pattern set中,也就是图中的New Confident部分;同样,这个示例也被加入到Dataset中,对应于New Confident部分。

4.4 训练策略(Bootstrap Learning Procedure)

  因此我们也理解了整个模型的运行顺序:

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...。其次根据当前的pattern和dataset来计算这个句子的对应两个attention分布的KL散度及论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...,并合并论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...进行模型的训练(粉色2);最后根据这两个分布计算得分,来判断这个示例是否是噪声,如果不是噪声则将其包含的pattern和整个示例作为New Confident(粉色3)。算法过程如下所示:

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...


  其中有两个细节需要说明的是:

(1)如何选择pattern?作者认为这是一个比较困难的工作,因此采用比较简单的方法:将句子中两个实体中间的所有词作为pattern,在初始化这个pattern集合时,则将所有示例的pattern累积起来,选择最好的前10%作为某个relation的pattern(作者并没有细讲最好是什么标准,初步认为是pattern词的计数越大表示越好)。

(2)如何重置dataset?在算法图第8行可知,每次更新了这个pattern集合后如何重新对数据集进行处理呢?作者认为,如果本身已经是非噪声示例(positive instance),如果其包含的pattern与pattern set(即算法中的M)不匹配,则其关系被改标为None

五、实验分析

  作者在NYT数据集上进行了实验。实验包括模型比对、消融实验和样例分析。

(1)模型比对:作者选择了部分基线模型进行了比对,发现在验证集合测试集上,F1值都达到了最好结果。

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...


(2)消融实验:作者对模型的各个模块进行了分析,如表所示

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...


其中IDR表示使用初始化的pattern集合,ART表示第一次迭代使用注意力正则化,BLP表示训练策略。三者累加实验对比可知,模型可达到60.9。  作者另外发现,许多基线模型训练过程中,都直接将含有大量噪声的句子一起训练,认为这并不是一个很好的策略。作者比较偏向于先通过对数据集的重置,选择示例少但保证非常clean的数据进行训练。

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...


  为了验证降噪的效果,作者在训练过程中,先随机选择200个示例,并标注是否为噪声。再由模型训练来进行判断。作者发现和基线模型比,我们的模型识别噪声的F1指标达到72.02。

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...

(3)样例分析。作者随机从测试集中选择某些示例,并进行可视化展示,如图所示:

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...


  第一行表示原始的att-BiLSTM模型注意力分布,发现大部分只有两个实体的权重最大,这也是作者在introduction部分提到的问题。而经过注意力正则化后,第二行显示,实体对及中间的pattern对应的权重更加均衡。  作者另外又对每次新加入的pattern进行了分析,如图所示:

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...


  作者展示了两个relation的pattern。每个relation包括两行,第一行表示初始的pattern set,第二行表示long tail,可以发现,每次对其进行更新,都会从句子中挖掘出更长的pattern。有的词只是在基础上添加了几个单词,这也证明每个词作为pattern都可以被选择。更重要的是,这些额外的模式中有一些在字面上并不相似,这表明该模型可以了解相关特征词之间的语义相关性。

六、总结

论文解读:ARNOR: Attention Regularization based Noise Reduction for Distant Supervision Relation Class...