Damai Dai, et.al, “Coarse-to-Fine Entity Representations for Document-level Relation Extraction”, ArXiv 2020
1 简介
这篇文章可以说是使用 graph 做文档级关系抽取的集大成者。原先使用 graph,要么是用 entity、mention、sentence 作为 node 构件图,要么是用边来建图,以此显式地寻找 inference path。本文的 coarse 2 fine 中,corse 是用 token node 建立图,过 DCGCN 得每个词的 global 表示;用两个 entity 对应的 mention 之间的所有最短路径分别计算特征表示,attn 平均,得到 fine 表示;最终二者拼一起,双线性变换分类。
2 方法
图的方法有两种:① integrate neighborhood information for each node, Although they consider the entire graph structure, they may fail to model the interactions between long-distance entities due to the inherent over-smoothing problem in GNN ② encode path information between the target entity pair in the grap, They have the ability to alleviate the problem of modeling long-distance entity interactions, but they may fail to capture more global contextual information since they usually integrate only local contextual informa- tion for nodes in the graph (摘抄一下好词好句)

本文算法如图所示,四个框框就是四步,encoder、coarse graph、fine path inference、classification,其中 encoder 是 BERT + Bi-GRU,下面具体说后三个模块。
2.1 Coarse representation
首先建图:用 document 中每个词的 glove 作为 node embedding,建图,只连接下面五种边:
- 句法树上的边
- 相邻词之间连边
- 自环
- 相邻句子之间,将句法树的根结点连起来
- 所有指向同一 entity 的所有 mention 之间两两相连
然后用 DCGCN【#TODO2】对这张图进行编码,DCGCN 是分成 $n$ blocks,$k$th block 有 $m_k$ sublayers。在 block-$k$ 的 $l$-th sublayer 中,对节点 $i$ 的计算是:$$h_i^{(k,l)} = \text{ReLU}(\sum_{j\in\mathcal{N}(i)}\textbf{W}^{(k,l)}\hat{h}_j^{(k,l)} + b^{(k,l)})$$ $$\hat{h}_j^{(k,l)} = [x_j^{k};h_j^{(k,1)};…;h_j^{(k,l-1)}]$$
其中 $\hat{h}_j^{(k,l)}$ 是表示 i 的一个邻居 j,是用输入和前面所有 sublayer 输出拼起来得到的;计算 i 的表示就是用邻居平滑一下。
然后,一个 block 的表示也是用输入和每个 sublayer 输出拼接得到;最后一个 block 的输出就作为 coarse representatoin $o_i^{n}$。
2.2 fine representation
coarse representation 可以捕捉上下文信息,但是无法对长距离实体之间的交互建模(因为无法理解,都已经加一起 7 层 GCN 了,为什么长距离还不行?他建的图就不适合找 path?)。作者希望可以在点的 fine representation 里面,整合 path 的信息。怎么整合呢?包含两步:path encoder 和 attn aggregater。
path encoder 就是字面意思,对于一条从 h 到 t 的 path,将前面得到的每个词的 coarse $o_i^{n}$ 输入 Bi-GRU,两个方向就分别得到头尾 mention 的 path-aware 表示 $m_i^{(h)}$ 和 $m_i^{(t)}$。
上面说的只是图中一条 path 头尾的 encoding 过程,怎么得到两个 entity 的 path-aware 表示呢?在两个 entity 分别包含的 mention 集合 $e_1$ 和 $e_2$ 中,两两相连,找到最短的 $|e_1|\times|e_2|$ 条 path(这里的 path 只能是图里五种边中的 1 和 2)。对每一个 path 都用 path encoder 得到头尾的表示 $m_i^{(h)}$ 和 $m_i^{(t)}$。

为了区分重要 path,就要搞个 attn 来做 weighted sum,进入 attn aggregater 这一步。怎么算 attn score 呢?如上图所示,先用 coarse representation 平均,得到 coarse 的头尾 entity 表示 $\tilde{h}, \tilde{t}$,然后将每一对 path-aware mention 和 coarse entity 拼接过 linear,就求得这对 mention 的 path 的 attn score。最终的 $h,t$ 就是 path-aware fine-level representation。
2.3 classification
用 fine 和 coarse 的 entity representation 拼接,双线性变换分类:$$P(r|e_1,e_2) = \text{Sigmmoid}([\tilde{h};h]^TW_c[\tilde{t};t] + b_c)_r$$
3 实验
- 基于图的方法们整体上更好一些
- EoG pays more attention to encoding paths. GAT, GCNN, and AGGCN focus on integrating informa- tion on the entire graph. These four models achieve similar performance. This suggests that these two kinds of models have their own characteristics, and no one has overwhelm- ing advantages
- LSR-GloVe also focuses on integrating information on the entire graph, but it achieves better per- formance than other graph-based baselines. This is because it designs a latent structure that can be learned by iterative refinements, thus enabling the model to better integrate in- formation.
- CFER sota
- 本文建立的是静态图,要比 LSR 的动态图更简单,更稀疏
- CFER 在长尾的关系上提升更大,对未见关系更 robust(作者说因为 we can capture both global information and subtle clues that may include spe- cial features of long-tail relations)
- fine representation 有用,attn 有用
- coarse representation 有用,DCGCN 比 GCN 好
4 思考
- 主要的创新点就应该是它后半部分对于 path 的“推断”:他是显式找出 path,用路过的 node 作为序列,输入双向 GRU,得到双向的表示,拼一起作为 path 的表示。所以说,除了用拆点和拆边这样图论的方法做点边转化,还可以用 rnn 做!
- 他选择路径,是直接在图上找最短路。这样的 path 其实只跟句子的 adjacent 和句法的 dependency 相关,并不是大家想要的 inference path。虽然不是,但是,前者是不是相当于包含后者呢?或者说,这俩是同一趟公交车,前者只是慢车,多停几站呢?感觉可以稍微统计一下,如果是包含的,那就可以用它这个思路做下去,直接用这个 naive 的方法替代原来 inference path 的思路;如果不是包含的,可以想想,怎么用这样 naive 的方法找到一条包含 inference 的 path,我感觉会更有道理一些。
5 TODO
- Huang, G.; Liu, Z.; van der Maaten, L.; and Weinberger, K. Q. 2017. Densely Connected Convolutional Networks. In CVPR 2017, 2261–2269.
- Guo, Z.; Zhang, Y.; Teng, Z.; and Lu, W. 2019. Densely Connected Graph Convolutional Networks for Graph-to- Sequence Learning. Transactions of the Association for Computational Linguistics 7: 297–312.