当前位置: 代码迷 >> 综合 >> 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》
  详细解决方案

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

热度:48   发布时间:2023-09-10 17:22:59.0
论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

Matching the Blanks: Relation Learning

? 论文:《Matching the Blanks: Distributional Similarity for Relation Learning》? arxiv.org

Matching the Blanks: Distributional Similarity for Relation Learning

Abstract

可以对任意关系进行建模的通用关系抽取器是信息抽取的核心技术。人们已经尝试建立通用的抽取器抽取文字表面形式的信息来表示关系,或者将文字表面形式与现有知识图的关系联合嵌入。然而,这两种方法的概括能力都是有限的。本文基于关系的Harris分布假设进行拓展,以及近年来在学习文本表示(特别是BERT)方面的研究进展,从实体链接文本中构建与任务无关的关系表示。我们表明,即使不使用任何任务的训练数据,这些表示也明显优于以前在基于样本的关系抽取(FewRel)方面的工作。我们还表示了,使用我们的与任务无关的表示初始化模型,然后在有监督关系提取数据集上进行微调,在SemEval 2010 Task 8, KBP37, 和 TACRED上明显优于以前的方法。

Introduction

关系抽取的主要分为三种方法:

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

本文idea:提出了从文本中学习关系表示的,一种不需要任何知识图或人类注释监督的关系表示的方法:Matching the Blanks。

1、假设能够访问一个文本语料库,其中实体已链接到唯一标识符,并且我们将关系语句定义为包含两个标记实体的文本块。由此,我们创建包含关系语句的训练数据,其中的实体已替换为特殊的[BLANK]符号,如图1所示。

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

2、训练过程采用包含关系语句的(blank-完整)对,并且目标是,如果它们分布在相同的实体对上,则关系的编码表示将是相似的。

3、经过训练后,将学习到的关系表示应用于最近发布的FewRel任务(Han et al., 2018)上,在该任务中,特定关系(如“original language of work”)用一些示例来表示,如“The Crowd (Italian: La Folla) is a 1951 Italian film.” Han et al. (2018)将FewRel作为标记数据集,旨在评估模型在测试时适应新域关系的能力。

Overview

Task definition

本文主要研究从关系语句到关系表示的映射学习。

x = [x0 . . . xn]表示词语序列,其中,x0 = [CLS],xn = [SEP] 特殊的开始和结束标记。

s1 = (i, j),s2 = (k, l) 是一对整数,0 < i < j ? 1, j < k, k ≤ l ? 1, l ≤ n.

r = (x, s1, s2)关系语句用一个三元组来表示,其中s1,s2用来标记实体,[xi . . . xj?1]表示第一个实体[xk . . . xl?1]表示第二个实体。

目标是学习一个函数hr = fθ(r),将关系语句映射到一个固定长度的向量hr∈Rd,该向量表示由s1和s2标记的实体之间以x表示的关系。

Contributions

1)我们研究了关系编码器fθ的不同架构,这些架构都建立在广泛使用的transformer序列模型之上(Devlin等人,2018;Vaswani等人,2017)。我们会将它们应用在一系列的关系抽取数据集上,进行有监督训练和评估。

2)证明了函数fθ可以从广泛使用的远程监控中以实体链接文本的形式学习得到。

Architectures for Relation Learning

Relation Classification and Extraction Tasks

关系抽取任务主要分为两类:充分的有监督关系抽取和few-shot关系抽取。

有监督关系抽取:给定一个关系的描述r,预测关系的类型t ∈ T,T是固定的关系类型字典,t=0表示关系语句中的实体之间缺乏关系。这种类型我们一般会在SemEval 2010 Task 8、KBP-37、TACRED数据集上进行评估。

few-shot关系抽取:根据查询关系语句对一组候选关系语句进行排序和匹配。在此任务中,测试和开发集中的样本通常是训练集里没有出现过的关系类型。这种类型我们一般会在FewRel数据集上进行评估。具体地说,给定K组有N个有标记的关系语句,Sk = {(r0, t0) . . . (rN , tN )},ti ∈ {1 . . . K } 代表对应的关系类型,目标是预测查询关系语句rq的tq∈{1…K}。

Relation Representations from Deep Transformers Model

在本节的所有实验中,都使用Devlin等人提供的BERTLARGE模型作为开始。(2018年)并针对特定任务的损失进行训练。由于BERT以前没有应用于关系表示问题,我们主要解决两个主要的建模问题:

1)如何表示对实体进行表示作为BERT的输入。

2)我们如何从BERT的输出中提取出固定长度的关系表示。

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

Entity span identification

介绍三种BERT encoder输入的方法。

Standard input :直接放入x,没有输入对两个实体进行显示标注。因为我们相信BERT有能力识别x中的实体,但是对于标准输入(Standard input),当x包含两个以上的实体引用时,无法知道哪个实体处于焦点。

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

Positional embeddings:bert中对于每个输入的词语都会添加一个segment embedding的分段标记,为了对实体进行显示标记,在segment embedding添加两种标记来分别标记第一个实体和第二个实体。

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

Entity marker tokens:用四个标记[E1start], [E1end], [E2start] and [E2end] 来扩充x,以标记关系语句中提到的每个实体的开始和结束。更新x ? =[x0 . . . [E1start] xi . . . xj?1 [E1end] ...[E2start] xk ...xl?1 [E2end]...xn]. ~s1 = (i + 1,j+1) ?~s2 =(k+3,l+3)

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

Fixed length relation representation

介绍三种从BERT encoder中提取固定长度关系表示hr的方法。这三个方法依赖于抽取transformer网络的最后一个隐藏层H = [h0, ...hn],其中n=|x|。

[CLS] token:采用[CLS]输出h0作为第一种关系表示。

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

Entity mention pooling:将与两个实体对应的向量he1 = MAXPOOL([hi...hj?1]),he2 = MAXPOOL([hk...hl?1]) 进行拼接得到hr = ?he1|he2 ? 来作为关系表示。

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

Entity start state:在使用ENTITY MARKERS 的方式作为输入的情况下,采用两个实体的开始标记所对应的隐藏层输出进行拼接rh = ?hi|hj+2?.作为关系的表示。

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

除了定义模型输入和输出架构之外,我们还修改了了用于训练模型的损失(如figure2所示)。

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

对于有监督任务,介绍一种新的分类层,W ∈ RKxH ,其中H是关系表示的大小,K是关系类型的数量,损失为softmax(hrWT)和样本真正关系类别的交叉熵损失。

对于few-shot任务,我们使用查询语句的关系表示和每个候选语句之间的点积作为相似度得分,并用softmax(相似度得分)和样本真正关系类别的交叉熵损失作为训练损失。

我们使用以下一组超参数对BERT模型对特定于任务进行微调:

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》
论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

Table 1显示了三个有监督关系提取任务的模型变量和few-shot关系分类任务的5-way-1-shot变量的结果。对于以上四个任务,都显示使用ENTITY MARKERS输入表示和ENTITY START输出表示的模型获得了最好的分数,说明添加实体的位置信息是非常有必要的,但与以往从position embedding中获益的工作不同(Zhang et al., 2017; Bilan and Roth, 2018),deep Transformers从看到新的实体边界词(ENTITY MARKERS)中获益最大。

Learning by Matching the Blanks

介绍一种新的训练关系语句编码器fθ的方法,不使用有标签的训练数据,而是使用以下想法替代:对于任何一对关系语句r和r′,如果r和r′这两个关系语句在语义上相似,那么内积fθ(r)?fθ(r′)应该是较大的;如果两个关系状态表示语义上不同的关系,那么这个内积应该是较小的。

我们发现web文本中存在高度的冗余,任意一对实体之间的每一个关系都可能多次出现。如果s1与s′1指同一个实体,s2与s′2指同一个实体,则r=(x,s1,s2)更有可能编码与r′=(x′,s′1,s′2)相同的语义关系。从这个观察出发,我们引入了一种从实体链接文本中学习fθ的新方法——Matching the Blanks(MTB)。

Learning Setup

D = [(r0,e01,e02)...(rN,eN1 ,eN2 )] 是一个标记了两个实体的关系语句语料库。

定义一个二分类器

p(l = 1|r,r′) =1/(1+expfθ(r)?fθ(r′) )

给r和r′表示相同关系(l=1)或不是相同关系(l=0)的情况分配一个概率,然后我们将学习fθ的参数,使损失最小化

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

其中,δe,e′ 是Kronecker delta,当e = e′ 时值为1,否则为0。

Introducing Blanks

由于这个链接系统没有任何关系的概念,因此假设fθ能够构建有意义的关系表示是不合理的,为了避免简单地重新学习实体链接系统,我们引入了一个经过修改的语料库

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

?ri = (x ?i, si1, si2) 包含一个关系语句,其中一个或两个实体提到已被特殊的[BLANK]符号替换,具体来说,~x?包含由s1或s2定义的具有概率α的实体。否则,该实体已被单个[BLANK]]符号替换。只有α2的关系语句中参与关系的两个实体是显式的。这样使得最小化L(~D),fθ需要做的不仅仅是简单地识别r中的命名实体。

Matching the Blanks Training

训练语料采用英语维基百科,使用现成的实体链接系统(Google Cloud Natural Language API)用唯一的知识库标识符(例如,Freebase ID或Wikipedia URL)注释文本中的实体。为了减小涉及流行实体的关系语句的较大偏差,我们对每个给定实体都采用随机采样的方式,来限定包含该实体的关系语句的数量。

使用训练语料来使L(D ?)最小化,事实上,不可能使任意两个关系语句都进行比较,所以我们使用噪声对比估计(Gutmann and Hyva ?rinen, 2012; Mnih and Kavukcuoglu, 2013):认为所有的正样本对包含相同的实体,因此Equation 1中第一项的贡献没有变化,其中δe1,e′1δe2,e′2=1,近似值改变了第二项的贡献。从所有关系语句的中均匀随机抽样,或者从只共享一个实体的关系语句中抽样,来作为负样本。同时,构建一个“hard”数据集,来考虑关系语句对相似,但其实并不是一种关系的情况,来减小随机抽样作为负样本的不精确度。

最后,选择α=0.7的概率来用实体替换[blank], 确保模型不会因评估任务中缺少[blank]符号而混淆。一共生成了6亿关系语句对,其中包括50%的正样本和50%的负样本。

Experimental Evaluation

BERTEM +MTB 参数

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

Few-shot Relation Matching

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

图4显示了当我们为每个关系类型增加训练样本的数量,或者我们在训练数据中增加关系类型的数量时,性能会提高。当获得所有训练数据时,BERTEM接近BERTEM+MTB的性能。然而,当我们在训练过程中保留所有的关系类型,并且改变每个样本的类型数时,BERTEM+MTB只需要6%的训练数据就可以匹配BERTEM模型在所有训练数据上训练的的性能。图4中的结果表明,MTB训练可用于显著减少实现基于样本的关系抽取系统的工作量。

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

表3中报告BERTEM+MTB在FewRel的所有完全监督任务上的性能。我们发现它的性能优于Han等人(2018年)宣布的人类上限。,而且它的表现明显优于所有其他提交给FewRel排行榜的投稿,无论是已发表还是未发表。

Supervised Relation Extraction

论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》
论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》 论文笔记《Matching the Blanks: Distributional Similarity for Relation Learning》

Future Work

在以后的工作中,我们计划根据BERTEM+MTB对具有相似表示的关系语句进行聚类,从而进行关系发现。我们还将研究可用于在分布式知识库中存储关系三元组的关系和实体的表示。这是受最近知识库嵌入工作的启发(Bordes et al., 2013; Nickel et al., 2016)。

查看全文
  相关解决方案
  • xml文件不能被准确解析/The processing instruction target matching "[xX][mM][lL]" is not al
  • 运行程序时报java.lang.IllegalArgumentException: No line matching interface Clip supporting format PCM_SIGNED, 11025.0 Hz, 16 bit, mono解决方案
  • learning content in All Star 一
  • learning content in All Star 1,该怎么处理
  • Learning JQuery 读书笔记――第四章 成效-为艺术添加艺术性(CSS)
  • Learning PHP -数据的储存与检索
  • Follow your heart(114)-the first day of learning php
  • Learning Dojo - 5. Remote Scripting (AJAX)
  • S2SH调整注入@Autowired出现expected single matching bean but found 2: [iDAO, areaDAO]
  • Learning Dojo - 4. DOM APIs
  • Learning Dojo - 7. dojo.data
  • 00.The processing instruction target matching "[xX][mM][lL]" is not allowed
  • Learning Dojo - 3.1 Core features of the Dojo language
  • 回本JQUery的书《Learning JQuery 1.3》
  • Learning Dojo - 3.2 OO APIs
  • Learning Dojo - 1. Introduction
  • Learning Dojo - 2. A quick tour
  • Learning Website Development with Django译文-序言
  • Learning Website Development with Django译文-第一章:Django引见
  • 犀牛书札记:(13)Pattern Matching with Regular Expressions
  • xml文件不能被准确解析 matching "[xX][mM][lL]"
  • 请问数据库连接池的配置有关问题No rules found matching 'Server/Service/Engine/Host/Resource'
  • spring整合mybatis出现No matching bean of type有关问题,新人求教
  • 导入项目报错: The matching wildcard is strict, but no declaration can,该如何处理
  • tomcat 警告: No rules found matching 'Server/Service/Engine/Host/Host'.解决思路
  • java.lang.Exception: No tests found matching Method main解决办法
  • j2ee框架筹建 [javax.sql.DataSource] for property 'dataSource': no matching editors or conversion strategy found
  • org.xml.sax.SAXException: The processing instruction target matching "[xX][mM][lL]" is not allowed
  • The server has not found anything matching the Request-URI.
  • Eclipse下的Setting property 'source' to '.' did not find a matching property 异常

代码迷 - 您身边的软件异常,代码异常,编程异常助手(发现,解决,分享)
Copyright © 2009-2013 DAIMAMI.COM. All rights reserved.