This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Exploiting Global Contextual Information for Document-level Named Entity Recognition

Zanbo Wang, Wei Wei1, Xianling Mao, Shanshan Feng, Pan Zhou, Zhiyong He, Sheng Jiang This work was supported in part by the National Natural Science Foundation of China under Grant No. 61602197 and Grant No. 61772076, Grant No. 61972448, Grant No. L1924068 and in part by Equipment Pre-Research Fund for The 13th Five-year Plan under Grant No. 41412050801.*Corresponding author, E-mail addresses: [email protected] (W. Wei)Z. Wang, W. Wei and S. Jiang are with the School of Computer Science and Technology, Huazhong University of Science and Technology.X. Mao is with the School of Computer, Beijing Institute of Technology.S. Feng is with the Inception Institute of Artificial Intelligence Abu Dhabi, UAE.P. Zhou is with the School of Cyber Science and Engineering, Huazhong University of Science and Technology.Z. He is with the School of Electronic Engineering, Naval University of Engineering.
Abstract

Most existing named entity recognition (NER) approaches are based on sequence labeling models, which focus on capturing the local context dependencies. However, the way of taking one sentence as input prevents the modeling of non-sequential global context, which is useful especially when local context information is limited or ambiguous. To this end, we propose a model called Global Context enhanced Document-level NER (GCDoc) to leverage global contextual information from two levels, i.e., both word and sentence. At word-level, a document graph is constructed to model a wider range of dependencies between words, then obtain an enriched contextual representation for each word via graph neural networks (GNN). To avoid the interference of noise information, we further propose two strategies. First we apply the epistemic uncertainty theory to find out tokens whose representations are less reliable, thereby helping prune the document graph. Then a selective auxiliary classifier is proposed to effectively learn the weight of edges in document graph and reduce the importance of noisy neighbour nodes. At sentence-level, for appropriately modeling wider context beyond single sentence, we employ a cross-sentence module which encodes adjacent sentences and fuses it with the current sentence representation via attention and gating mechanisms. Extensive experiments on two benchmark NER datasets (CoNLL 2003 and Ontonotes 5.0 English dataset) demonstrate the effectiveness of our proposed model. Our model reaches F1F_{1} score of 92.22±\pm0.02 (93.40±\pm0.02 with BERT) on CoNLL 2003 dataset and 88.32±\pm0.04 (90.49±\pm0.09 with BERT) on Ontonotes 5.0 dataset, achieving new state-of-the-art performance.

Index Terms:
Named entity recognition, global Contextual Information, natural language processing.

I Introduction

Named Entity Recognition (a.k.a., entity chunking), which aims to identify and classify text spans that mention named entities into the pre-defined categories, e.g., persons, organizations and locations, etc., is one of the fundamental sub-tasks in information extraction (IE). With advances in deep learning, much research effort [13, 17, 23] has been dedicated to enhancing NER systems by utilizing neural networks (NNs) to automatically extract features, yielding state-of-the-art performance.

Most existing approaches address NER by sequence labeling models [24, 3], which process each sentence independently. However, in many scenarios, entities need to be extracted from a document, such as the financial field. The way of taking single sentence as input prevents the utilization of global information from the entire document. Intead of sentence-level NER, we focus on studying the document-level NER problem.

Refer to caption
Refer to caption
Refer to caption
Figure 1: Examples from the baseline and our model to illustrate our motivation.

Named entity mentions appearing repeatedly in a document may be naturally topically relevant to the current entity and thus can provide external context for entity understanding, for example, in Figure 1, the baseline model mistakenly tags “VOLENDAM” as a person (PER) instead of organization (ORG) owing to the limited local context, while some text in the two other sentences within the same document in Figure 1 such as “6-0 win over” clearly implies “VOLENDAM” to represent a team that should be tagged as ORG. Additionally, the semantic relevances are naturally distributed into the adjacent sentences. For example, in the case of Figure 1, the baseline model fails to recognize the OOV token “Rottweilers” as a Miscellaneous (MISC) entity, while the previous sentence actually has provided an obvious hint that it specifically refers to a Pet name like “Doberman”. Therefore, in this paper we propose to fully and effectively exploit the rich global contextual information for enhancing the performance of document-level NER.

However, the use of extra information will inevitably introduce noise. Since the entity category of words that repeatedly appear also can be different, and adjacent sentences might bring semantic interference. For example, in Figure 1, the first sentence provides useful information for tagging “Bucharest” as ORG in the query sentence, whereas the second sentence brings noise to some extent. In the end, proper strategies must be adopted to avoid the interference of noise information.

Indeed, there exist several attempts to utilize global information besides single sentence for NER [1, 23, 11, 4]. However, these methods still easily fail to achieve the above task due to the following facts.

First, they [1, 23, 4] don’t provide a sufficiently effective method to address the potential noise problems while introducing global information. Second, they [1, 23, 11] only utilize extra information at the word-level, but ignore the modeling at the sentence level.

In this paper, we propose GCDoc that exploit global contextual information for document-level NER from both word and sentence level perspectives. At the word level, a simple but effective document graph is constructed to model the connection between words that reoccur in document, then the contextualized representation of each word is enriched. To avoid the interference of noise information, we further propose two strategies. We first apply the epistemic uncertainty theory to find out tokens whose representations are less reliable, thereby helping prune the document graph. Then we explore a selective auxiliary classifier for effectively capturing the importance of different neighboring nodes. At the sentence level, we propose a cross-sentence module to appropriately model wider context. Three independent sentence encoders are utilized to encode the current sentence, its previous sentences as well as its next sentences with certain window size to be discussed later. The enhanced sentence representations are assigned to each token at the embedding layer. To verify the effectiveness of our proposed model, we conduct extensive experiments on two benchmark NER datasets. Experimental results suggest that our model can achieve state-of-the-art performance, demonstrating that our model truly exploits useful global contextual information.

The main contributions are as follows.

  • We propose a novel model named GCDoc to effectively exploit global contextual information by introducing document graph and cross-sentence module.

  • Extensive experiments on two benchmark NER datasets verify the effectiveness of our proposed model.

  • We conduct an elaborate analysis with various components in GCDoc and analyze the computation complexity to investigate our model in detail.

II Related Work

Most of conventional high performance NER systems are based on classical statistical machine learning models, such as Hidden Markov Model (HMM) [32], Conditional Random Field (CRF) [16, 25, 12], Support Vector Machine (SVM) [15] and etc. Although great success has been achieved, these methods heavily relying on handcrafted features and external domain-specific knowledge. With the rise of deep learning, many research efforts have been conducted on neural network based approaches to automatically learning feature representations for NER tasks.

LSTM-based NER. Currently, LSTM is widely adpoted as the context encoder for most NER models. Huang et al. [13] initially employ a Bi-directional LSTM (Bi-LSTM) and CRF model for NER for better capturing long-range dependency features and thus achieve excellent performances. Subsequently, the proposed architecture is widely used for various sequence labeling tasks [24, 17]. Several researches [24, 17] further extend such model with an additional LSTM/CNN layer to encode character-level representations. More recently, using contextualized representations from pretrained language models has been adopted to significantly improve performance [30, 8]. However, most of these approaches focus on capturing the local context dependencies, which prevents the modeling of global context.

Exploiting Global Context. Several researches have been carried out to utilize global information besides single sentence for NER. Qian et al. [31] model non-local context dependencies in document level and aggregates information from other sentences via convolution. Akbik et al. [1] dynamically aggregate contextualized embeddings for each unique string in previous sentences, and use a pooling operation to generate a global word representation. All these works ignore the potential noise problems while introducing global information. Luo et al. [22] adopt the attention mechanism to leverage document-level information and enforce label consistency across multiple instances of the same token. Similarly, Zhang et al. [37] propose to retrieve supporting document-level context and dynamically weight their contextual information by attention. More recently, Luo et al. [23] propose a model that adopts memory networks to memorize the word representations in training datasets. Following their work, Gui et al. [11] adopt similar memory networks to record document-level information and explicitly model the document-level label consistency between the same token sequences. Though attention operation is called in these models to compute the weight of document-level representations, it’s not clear enough which context information should be more reliable, thus the ability of these methods to filtering noise information is limited. Additionally, all the above work exploit extra information at the word-level, ignoring the modeling at the sentence level. Chen et al. [4] propose to capture interactions between sentences within the same document via a multi-head self attention network, while ignoring exploiting global information at the word level. Different from their work, we propose a more comprehensive approach to exploit global context information, which has been demonstrated more effective on NER task.

III Preliminary

In this section, we introduce the problem statement and then briefly describe a widely-adopted and well-known method for NER, i.e., Bi-LSTM-CRF, which is also a baseline in our experiment. And then we briefly present the theories of representing model uncertainty, which we apply for pruning the document graph module.

III-A Problem Formulation

Let 𝐗𝒟={xi}m\mathbf{X}_{\mathcal{D}}=\{x_{i}\}_{m} be a sequence composed of mm tokens that represents a document 𝒟\mathcal{D} and 𝐘𝒟={yi}m\mathbf{Y}_{\mathcal{D}}=\{y_{i}\}_{m} be its corresponding sequence of tags over 𝐗𝒟\mathbf{X}_{\mathcal{D}}. Specifically, each sentence sis_{i} in 𝒟\mathcal{D} is denoted by si={xji}nis_{i}=\{x^{i}_{j}\}_{n_{i}}, where nin_{i} is the length of sis_{i} and xjix^{i}_{j} indicates the jj-th token of sis_{i}. Formally, given a document 𝒟\mathcal{D}, the problem of document-level name entity recognition (NER) is to learn a parameterized (θ\theta) prediction function, i.e., fθ:𝐗𝒟𝐘𝒟f_{\theta}\colon\mathbf{X}_{\mathcal{D}}\mapsto\mathbf{Y}_{\mathcal{D}} from input tokens to NER labels over the entire document 𝒟\mathcal{D}.

III-B Baseline: Bi-LSTM-CRF Model

In Bi-LSTM-CRF Model, an input sequence 𝐗=[x1,x2,,xn]\mathbf{X}=[x_{1},x_{2},\ldots,x_{n}] is typically encoded into a sequence of low-dimensional distributed dense vectors, in which each element is formulated as a concatenation of pre-trained 𝐰i\mathbf{w}_{i} and character-level 𝐜i\mathbf{c}_{i} word embeddings 𝐱i=[𝐰i,𝐜i]\mathbf{x}_{i}=[\mathbf{w}_{i},\mathbf{c}_{i}]. Then, a context encoder is employed (i.e., Bi-directional LSTM) to encode the embedded 𝐗\mathbf{X} into a sequence of hidden states 𝐇=[𝐡1,𝐡2,,𝐡n]\mathbf{H}=[\mathbf{h}_{1},\mathbf{h}_{2},\ldots,\mathbf{h}_{n}] for capturing the local context dependencies within sequence, namely,

𝐡ii=LSTM(𝐡i1i1,[𝐰i;𝐜i])\displaystyle\stackrel{{\scriptstyle\rightarrow}}{{\mathbf{h}_{i}}}=\mbox{LSTM}(\stackrel{{\scriptstyle\longrightarrow}}{{\mathbf{h}_{i-1}}},[\mathbf{w}_{i};\mathbf{c}_{i}]) (1)
𝐡ii=LSTM(𝐡i1i1,[𝐰i;𝐜i])\displaystyle\stackrel{{\scriptstyle\leftarrow}}{{\mathbf{h}_{i}}}=\mbox{LSTM}(\stackrel{{\scriptstyle\longleftarrow}}{{\mathbf{h}_{i-1}}},[\mathbf{w}_{i};\mathbf{c}_{i}]) (2)
𝐡i=[𝐡ii,𝐡ii],\displaystyle\mathbf{h}_{i}=[\stackrel{{\scriptstyle\rightarrow}}{{\mathbf{h}_{i}}},\stackrel{{\scriptstyle\leftarrow}}{{\mathbf{h}_{i}}}], (3)

where 𝐡ii\stackrel{{\scriptstyle\rightarrow}}{{\mathbf{h}_{i}}} and 𝐡ii\stackrel{{\scriptstyle\leftarrow}}{{\mathbf{h}_{i}}} are the hidden states incorporating past and future contexts of 𝐱i\mathbf{x}_{i}, respectively.

Subsequently, conditional random field (CRF [16]), which is commonly used as a tag decoder, is employed for jointly modeling and predicting the final tags based on the output (i.e., 𝐇\mathbf{H}) of the context encoder, which can be transformed to the probability of label sequence 𝐘\mathbf{Y} being the correct tags to the given 𝐗\mathbf{X}, namely,

Pr(𝐘|𝐗)=yj𝐘ϕ(yj1,yj,𝐡j)yj𝐘;𝐘𝐘(𝐗)j=1nϕ(yj1,yj,𝐡j)\displaystyle\Pr(\mathbf{Y}|\mathbf{X})=\frac{\prod_{y_{j}\in\mathbf{Y}}\phi(y_{j-1},y_{j},\mathbf{h}_{j})}{\sum_{y^{{}^{\prime}}_{j}\in\mathbf{Y}^{{}^{\prime}};\mathbf{Y}^{{}^{\prime}}\in{\mathbf{Y}(\mathbf{X})}}\prod_{j=1}^{n}\phi(y^{{}^{\prime}}_{j-1},y^{{}^{\prime}}_{j},\mathbf{h}_{j})} (4)
ϕ(yj1,yj,𝐡j)=exp(𝐖yj1,yj𝐡j+byj1,yj),\displaystyle\phi(y_{j-1},y_{j},\mathbf{h}_{j})\!=\!\exp(\mathbf{W}_{y_{j-1},y_{j}}\mathbf{h}_{j}+b_{y_{j-1},y_{j}}), (5)

where ϕ(.)\phi(.) is the score function; 𝐘(𝐗)\mathbf{Y}(\mathbf{X}) is the set of possible label sequences for 𝐗\mathbf{X}; 𝐖yj1,yj\mathbf{W}_{y_{j-1},y_{j}} and byj1,yjb_{y_{j-1},y_{j}} indicate the weight matrix and bias corresponding to (yj1,yj)(y_{j-1},y_{j}). Then, a likelihood function m\mathcal{L}_{m} is employed to maximize the negative log probability of ground-truth sentences for training,

m=𝐗𝒳;𝐘𝒴logPr(𝐘|𝐗),\mathcal{L}_{m}=-\sum_{\mathbf{X}\in\mathcal{X};\mathbf{Y}\in\mathcal{Y}}\log\Pr(\mathbf{Y}|\mathbf{X}), (6)

where 𝒳\mathcal{X} denotes the set of training instances, and 𝒴\mathcal{Y} indicates the corresponding tag set.

III-C Representing Model Uncertainty

Epistemic (model) uncertainty explains the uncertainty in the model parameters. In this paper, we adopt the epistemic uncertainty to find out tokens whose labels are likely to be incorrectly predicted by the model, thereby pruning the document graph to effectively prevent the further spread of noise information.

Bayesian probability theory provides mathematical tools to estimate model uncertainty, but these usually lead to high computational cost. Recent advances in variational inference have introduced new techniques into this field, which are used to obtain new approximations for Bayesian neural networks. Among these, Monte Carlo dropout [9] is one of the simplest and most effective methods, which requires little modification to the original model and is applicable to any network architecture that makes use of dropout.

Given the dataset 𝒟\mathcal{D} with training inputs 𝐗={x1,,xn}\mathbf{X}=\{x_{1},\ldots,x_{n}\} and their corresponding labels 𝐘={y1,,yn}\mathbf{Y}=\{y_{1},\ldots,y_{n}\}, the objective of Bayesian inference is estimating p(𝐰|𝒟)p(\mathbf{w}|\mathcal{D}), i.e., the posterior distribution of the model parameters 𝐰\mathbf{w} given the dataset 𝒟\mathcal{D}. Then the prediction for a new input xx^{*} is obtained as follows:

p(y|x,𝒟)=p(y|x,𝐰)p(𝐰|𝒟)𝑑𝐰.p(y^{*}|x^{*},\mathcal{D})=\int p(y^{*}|x^{*},\mathbf{w})p(\mathbf{w}|\mathcal{D})d\mathbf{w}. (7)

Since the posterior distribution p(𝐰|𝒟)p(\mathbf{w}|\mathcal{D}) is intractable, Monte Carlo dropout adopts the variational inference approach to use qθ(𝐰)q_{\theta}(\mathbf{w}), a distribution over matrices whose columns are randomly set to zero, to approximate the intractable posterior. Then the minimisation objective is the Kullback-Leibler (KL) divergence between the approximate posterior qθ(𝐰)q_{\theta}(\mathbf{w}) and the true posterior p(𝐰|𝒟)p(\mathbf{w}|\mathcal{D}).

With Monte Carlo sampling strategy, the integral of Eq. 7 can be approximated as follows:

p(y|x,𝒟)t=1Tp(y|x,𝐰t)qθ(𝐰t),p(y^{*}|x^{*},\mathcal{D})\approx\sum_{t=1}^{T}p(y^{*}|x^{*},\mathbf{w}_{t})q_{\theta}(\mathbf{w}_{t}), (8)

where 𝐰tqθ(𝐰)\mathbf{w}_{t}\sim q_{\theta}(\mathbf{w}) and TT is the number of sampling. In fact, this is equivalent to performing TT stochastic forward passes through the network and averaging the results. In contrast to standard dropout that only works during training stage, the Monte Carlo dropouts are also activated at test time. And the predictive uncertainty can be estimated by collecting the results of stochastic forward passes through the model and summarizing the predictive variance.

Refer to caption
Figure 2: The architecture of our proposed NER model. The upper center side shows the overall architecture, including embedding layer, context encoder, graph layer and tag decoder. We show the uncertainty prediction sub-module on the upper left side, and on the upper right side, we show the details of the document graph module. Note that the vectors 𝐡i1𝐡ik\mathbf{h}_{i1}\ldots\mathbf{h}_{ik} represents the neighbor nodes’ representations of node viv_{i}. On the bottom we present the cross-sentence module that generates the enhanced sentence-level representation.

IV Proposed Model

IV-A Overview

In this section, we focus on fully exploiting the document-level global contexts for enhancing the word-level representation capability of tokens, and thus propose a novel NER model named GCDoc, and then we proceed to structure the following sections with more details about each submodule of GCDoc, which is under the Bi-LSTM-CRF framework (rf. Section III-B) and shown in Figure 2.

Token Representation. Given a document composed of a set of tokens, i.e., 𝐗𝒟=[x1,,xm]\mathbf{X}_{\mathcal{D}}=[x_{1},\cdots,x_{m}], the embedding layer is formulated as a concatenation of three different types of embeddings for obtaining the word-level (pre-trained 𝐰i\mathbf{w}_{i} and character-level 𝐜i\mathbf{c}_{i}) and the sentence-level (i.e., 𝐬i\mathbf{s}_{i}) simultaneously,

𝐱i=[𝐰i;𝐜i;𝐬i].\mathbf{x}_{i}=[\mathbf{w}_{i};\mathbf{c}_{i};\mathbf{s}_{i}]. (9)

Generally, the adjacent sentences may be naturally topically relevant to the current sentence within a same document, and thus we propose a novel cross-sentence contextual embedding module (bottom part in Figure 2, rf. Section IV-B) for encoding the global-level context information at sentence-level to enhance the representations of tokens within the current sentence.

Context Encoder. Next, the concatenated token embeddings 𝐱i=[𝐰i;𝐜i;𝐬i]\mathbf{x}_{i}=[\mathbf{w}_{i};\mathbf{c}_{i};\mathbf{s}_{i}] (instead of [𝐰i;𝐜i][\mathbf{w}_{i};\mathbf{c}_{i}]) is fed into a Bi-directional LSTM model to capture the local context dependencies within sequence, and then we obtain a sequence hidden states 𝐇=[𝐡1,𝐡2,,𝐡n]\mathbf{H}=[\mathbf{h}_{1},\mathbf{h}_{2},\ldots,\mathbf{h}_{n}].

For enriching the contextual representation of each token, we develop a document graph module based on gated graph neural networks to capture the non-local dependencies between tokens across sentences, namely,

𝐡^i=GGNN(𝐡i),\hat{\mathbf{h}}_{i}=GGNN(\mathbf{h}_{i}), (10)

where GGNN(.)GGNN(.) is the output of graph neural network for learning the contextualized representations of tokens. Then, the output of Eq (10) can be fed into the tag decoder for training via Eq (4), Eq (5) and Eq (6).

IV-B Cross-Sentence Contextual Embedding Module

Generally, the adjacent sentences may be topically relevant to the current sentence within a same document naturally, and thus we propose a novel cross-sentence contextual embedding module. To this end, in this section we propose a cross-sentence module, which treats the adjacent sentences as auxiliary context at sentence-level to enhance the representation capability of the given sentence. Similar to [26], we only take account of the cross-sentence context information within a certain range (e.g., kk) before and after the current sentence, namely, we concatenate the kk sentences before/after the current sentence for capturing cross-sentence context information.

Without loss of generality, suppose the representations of the current sentence, the past context representation of sentences and the future context representation of sentences are denoted by 𝐬c\mathbf{s}_{c}, 𝐬p\mathbf{s}_{p} and 𝐬f\mathbf{s}_{f}, respectively. Furthermore, we also introduce an attention mechanism for measuring the relevance of such two auxiliary representations to the current one, and thus a weighted sum (𝐬~c\tilde{\mathbf{s}}_{c}) of such two representations is calculated for the representation of the current sentence, namely,

𝐬~c=ap𝐬p+af𝐬f,\tilde{\mathbf{s}}_{c}={a_{p}{\mathbf{s}_{p}}}+{a_{f}{\mathbf{s}_{f}}}, (11)

where apa_{p} and afa_{f} are the learned attentions of the past and the future context information to the current sentence, which are used to control the contributions of such two context information and computed based on softmax,

ap=softmax(f(𝐬c,𝐬p))\displaystyle a_{p}=\mbox{softmax}(f(\mathbf{s}_{c},\mathbf{s}_{p})) (12)
af=softmax(f(𝐬c,𝐬f)),\displaystyle a_{f}=\mbox{softmax}(f(\mathbf{s}_{c},\mathbf{s}_{f})), (13)

where f(𝐬i,𝐬j)f(\mathbf{s}_{i},\mathbf{s}_{j}) is a compatibility function to calculate the pair-wise similarity between two sentences, which is computed by

f(𝐬i,𝐬j)=𝐰σ(𝐖𝐬(𝐢)𝐬i+𝐖𝐬(𝐣)𝐬j+𝐛),f(\mathbf{s}_{i},\mathbf{s}_{j})=\mathbf{w}^{\top}\sigma\left(\mathbf{W_{s}^{(i)}}\mathbf{s}_{i}+\mathbf{W_{s}^{(j)}}\mathbf{s}_{j}+\mathbf{b}\right), (14)

where σ()\sigma(\cdot) is an activation function; 𝐖𝐬(𝐢)\mathbf{W_{s}^{(i)}}, 𝐖𝐬(𝐣)ds×ds\mathbf{W_{s}^{(j)}}\in\mathbb{R}^{d_{s}\times{d_{s}}} are the learnable weight matrices; 𝐰ds\mathbf{w}^{\top}\in\mathbb{R}^{d_{s}} is a weight vector, and 𝐛\mathbf{b} denotes the bias vector.

Finally, a gating mechanism is employed to decide the amount of cross-sentence context information (𝐬~c\tilde{\mathbf{s}}_{c}) that should be incorporated and fused with the initial sentence representation 𝐬c\mathbf{s}_{c}:

𝐬c=λ𝐬c+(1λ)𝐬~c,\mathbf{s^{\prime}}_{c}=\lambda\odot\mathbf{s}_{c}+(1-\lambda)\odot\tilde{\mathbf{s}}_{c}, (15)

where \odot represents elementwise multiplication, and λ\lambda is the trade-off parameter, which is calculated by

λ=sigmoid(𝐖𝐠(𝟑)tanh(𝐖𝐠(𝟏)𝐬~c+𝐖𝐠(𝟐)𝐬c)),\lambda=\mbox{sigmoid}\left(\mathbf{W_{g}^{(3)}}\tanh(\mathbf{W_{g}^{(1)}}\tilde{\mathbf{s}}_{c}+\mathbf{W_{g}^{(2)}}\mathbf{s}_{c})\right), (16)

where 𝐖𝐠(𝟏),𝐖𝐠(𝟐),𝐖𝐠(𝟑)ds×ds\mathbf{W_{g}^{(1)}},\mathbf{W_{g}^{(2)}},\mathbf{W_{g}^{(3)}}\in\mathbb{R}^{d_{s}\times{d_{s}}} are trainable weight matrices.

Remark. The enhanced sentence-level representation 𝐬cds\mathbf{s^{\prime}}_{c}\in\mathbb{R}^{d_{s}} is then concatenated with the word-level embeddings of tokens (rf. Eq (9)) and fed into the context encoder. In particular, For each sentence, we adopt Bi-LSTM as the basic architecture for sentence embedding. Specifically, for each sentence ss, a sequence of hidden states 𝐇s={𝐡is}ds\mathbf{H}_{s}=\{\mathbf{h}^{s}_{i}\}\in\mathbb{R}^{d_{s}} are generated by Bi-LSTM model according to Eq (1)-(3), and then the sentence representation 𝐬\mathbf{s} is computed by mean pooling over all hidden states 𝐇s\mathbf{H}_{s}, that is,

𝐬=1ni=1n𝐡is,\mathbf{s}=\frac{1}{n}\sum_{i=1}^{n}\mathbf{h}^{s}_{i}, (17)

where nn is the length of the sequence.

Refer to caption
Figure 3: Illustration for constructing document graph. Words appearing repeatedly in a document are connected, and for clarity, we only adopt the word “Lombardi” as an example. Aside from the edge (solid line) connecting two nodes belonging to the same entity type, there are edges (dashed lines) that may introduce noise.

IV-C Gated Graph Neural Networks based Context Encoder

As mentioned, an intuition is that the entity mentions appearing repeatedly in a document are more likely to be of same entity category. To this end, in this section, we develop a simple but effective graph layer based on a word-level graph, which is built over the re-occurrent tokens to capture the non-local dependencies among them.

Graph Construction. Given a document 𝐗𝒟={xi}m\mathbf{X}_{\mathcal{D}}=\{x_{i}\}_{m}, a recurrent graph is defined as an undirected graph 𝒢𝒟=(𝒱𝒟,𝒟)\mathcal{G}_{\mathcal{D}}=(\mathcal{V}_{\mathcal{D}},\mathcal{E}_{\mathcal{D}}), where each node vi𝒱𝒟v_{i}\in\mathcal{V}_{\mathcal{D}} denotes a recurrent token, each edge eij=(vi,vj)𝒟e_{ij}=(v_{i},v_{j})\in\mathcal{E}_{\mathcal{D}} is a connection of every two same case-insensitive tokens (rf. Figure 3), which is used to model the re-occurrent context information of tokens across sentences, as the local context of a token in a sentence may be ambiguous or limited.

Node Representation Learning. To learn the node representations of tokens, we adopt graph neural networks to generate the local permutation-invariant aggregation on the neighborhood of a node in a graph, and thus the non-local context information of tokens can be efficiently captured.

Specifically, for each node viv_{i}, the information propagation process between different nodes can be formalized as:

𝐚i=ReLU(1|𝒩(i)|j𝒩(i)𝐖a𝐡j+𝐛a),\mathbf{a}_{i}=\mbox{ReLU}\left(\frac{1}{|\mathcal{N}(i)|}\sum_{j\in\mathcal{N}(i)}\mathbf{W}_{a}\mathbf{h}_{j}+\mathbf{b}_{a}\right), (18)

where 𝒩(i)\mathcal{N}(i) denotes the set of neighbors of viv_{i}, which does not include viv_{i} itself; 𝐖ad×d\mathbf{W}_{a}\in\mathbb{R}^{d\times d} indict the weight matrices and 𝐛d\mathbf{b}\in\mathbb{R}^{d} denotes the bias vector; 𝐡j\mathbf{h}_{j} is the hidden state of the neighbor node vj𝒩(i)v_{j}\in\mathcal{N}(i).

Through Eq (18), we can easily aggregate the neighbours’ information to enrich the context representation of node viv_{i} via the constrained edges (eij𝒟e_{ij}\in\mathcal{E}_{\mathcal{D}}). Inspired by the gated graph neural networks, the enhanced representation 𝐚i\mathbf{a}_{i} is combined with its initial embedding (𝐡i\mathbf{h}_{i}) via a gating mechanism, which is employed for deciding the amount of aggregated context information to be incorporated, namely,

𝐡^i=(1𝐳i)𝐡i+𝐳i𝐡i~\displaystyle\hat{\mathbf{h}}_{i}=(1-\mathbf{z}_{i})\odot\mathbf{h}_{i}+\mathbf{z}_{i}\odot\tilde{\mathbf{h}_{i}} (19)
𝐡~i=tanh(𝐖o𝐚i+𝐔o(𝐫i𝐡i))\displaystyle\tilde{\mathbf{h}}_{i}=\tanh(\mathbf{W}_{o}\mathbf{a}_{i}+\mathbf{U}_{o}(\mathbf{r}_{i}\odot\mathbf{h}_{i})) (20)
𝐳i=σ(𝐖z𝐚i+𝐔z𝐡i)\displaystyle\mathbf{z}_{i}=\sigma(\mathbf{W}_{z}\mathbf{a}_{i}+\mathbf{U}_{z}\mathbf{h}_{i}) (21)
𝐫i=σ(𝐖r𝐚i+𝐔r𝐡i),\displaystyle\mathbf{r}_{i}=\sigma(\mathbf{W}_{r}\mathbf{a}_{i}+\mathbf{U}_{r}\mathbf{h}_{i}), (22)

where 𝐖z,𝐖r,𝐖o,𝐔z,𝐔r,𝐔od×d\mathbf{W}_{z},\mathbf{W}_{r},\mathbf{W}_{o},\mathbf{U}_{z},\mathbf{U}_{r},\mathbf{U}_{o}\in\mathbb{R}^{d\times d} are learnable weight matrices, σ()\sigma(\cdot) denotes the logistic sigmoid function and \odot represents elementwise multiplication. 𝐳i\mathbf{z}_{i} and 𝐫i\mathbf{r}_{i} are update gate and reset gate, respectively. The output of Eq (19) 𝐡^i\hat{\mathbf{h}}_{i} is the final output of our document graph module (rf. Eq (10)), which will be fed into the tag decoder for generating the tag sequence.

Furthermore, directly aggregating the contextual information may contain noise, since not all re-occurrent tokens can provide reliable context information for disambiguating others. As such, we propose two strategies to avoid introducing noise information in the document graph module. First we apply the epistemic uncertainty to find out tokens whose labels are likely to be incorrectly predicted, thereby pruning the document graph. Then we adopt a selective auxiliary classifier for distinguishing the entity categories of two different nodes, thus guiding the process of calculating edge weights.

(1) Document Graph Pruning. We suppose that tokens whose labels are more likely to be correctly predicted by the model will have more reliable contextual representations, and will be more helpful in the graph module for disambiguating other tokens. In this paper, we use Monte Carlo dropout to estimate the model uncertainty for indicating whether model predictions are likely to be correct. Specifically, we obtain the uncertainty value of each token through an independent sub-module. Then we set a threshold 𝒯\mathcal{T}, and put tokens whose uncertainty value is greater than the threshold into a set DropDrop. Since the context information of these tokens should be less reliable, we prune the graph module by ignoring the impact of these tokens on their neighboring nodes. Thus Eq 18 is rewritten as follows,

𝐚i=ReLU(1Num(i)j𝒩(i)&jDrop𝐖a𝐡j+𝐛a),\mathbf{a}_{i}=\mbox{ReLU}\left(\frac{1}{Num(i)}\sum_{j\in\mathcal{N}(i)\&j\notin Drop}\mathbf{W}_{a}\mathbf{h}_{j}+\mathbf{b}_{a}\right), (23)

where Num(i)Num(i) denotes the the number of neighbor nodes of node ii that actually participating in the operation.

As for the model uncertainty prediction, we apply the Monte Carlo dropout and adopt a independent sub-module that predicts labels of each token by a simple architecture composed of a Bi-LSTM and dense layer. The forward pass of the Bi-LSTM is run TT times with the same inputs by using the approximated posterior qθ(𝐰)q_{\theta}(\mathbf{w}) in Eq 8. Then given the output representation 𝐡i\mathbf{h}_{i} of the Bi-LSTM layer, the probability distribution of the ii-th word’s label can be obtained by a fully connected layer and a final softmax function,

𝐩it=1Tsoftmax(𝐖𝐡i|𝐰t),\mathbf{p}_{i}\approx\sum_{t=1}^{T}\mbox{softmax}(\mathbf{W}^{\top}\mathbf{h}_{i}|\mathbf{w}_{t}), (24)

where 𝐰tqθ(𝐰)\mathbf{w}_{t}\sim q_{\theta}(\mathbf{w}), 𝐖d×𝒞\mathbf{W}\in\mathbb{R}^{d\times\mathcal{C}}, and 𝒞\mathcal{C} is the number of all possible labels. Then, the uncertainty value of the token can be represented by the uncertainty of its corresponding probability vector 𝐩i\mathbf{p}_{i}, which can be summarized using the entropy of the probability vector:

ui=c=1𝒞pclogpc.u_{i}=-\sum_{c=1}^{\mathcal{C}}p_{c}\log p_{c}. (25)

(2) Edge Weights Calculation. Since not all of repeated entity mentions in document belong to the same categories, which is shown in Figure 3, we propose a selective auxiliary classifier for distinguishing the entity categories of two different nodes, which is defined as a binary classifier that takes the representation of two nodes as input and outputs whether it should be the same entity category, which is denoted by the relation score rijr_{ij} for any edge eije_{ij} and is computed by

rij=σ(𝐖c[𝐡i;𝐡j]+bc),r_{ij}=\sigma(\mathbf{W}_{c}[\mathbf{h}_{i};\mathbf{h}_{j}]+b_{c}), (26)

where 𝐖c2d\mathbf{W}_{c}\in\mathbb{R}^{2d} is a learnable weight matrix, bcb_{c} represents the bias and σ()\sigma(\cdot) denotes the logistic sigmoid function.

In specific, the loss function of the selective auxiliary classifier is defined as:

a=i=1mj𝒩(i)[yijlog(rij)+(1yij)log(1rij)],\mathcal{L}_{a}=-\sum_{i=1}^{m}\sum_{j\in\mathcal{N}(i)}[y_{ij}\log(r_{ij})+(1-y_{ij})\log(1-r_{ij})], (27)

where yijy_{ij} is the ground truth label whose value is assigned 11 when nodes viv_{i} and vjv_{j} belong to the same entity category, and 0 for otherwise. As a result, Eq (23) can be transformed as follows via the computed relation scores, namely,

𝐚i=ReLU(1Num(i)j𝒩(i)&jDroprij(𝐖a𝐡j+𝐛a)).\mathbf{a}_{i}=\mbox{ReLU}\left(\frac{1}{Num(i)}\sum_{j\in\mathcal{N}(i)\&j\notin Drop}r_{ij}\left(\mathbf{W}_{a}\mathbf{h}_{j}+\mathbf{b}_{a}\right)\right). (28)

After obtaining the enhanced representation 𝐚i\mathbf{a}_{i} that encodes the neighbours’ information, Eq (19)-(22) are applied to generate the final output of our document graph module 𝐡^i\hat{\mathbf{h}}_{i}.

The employed auxiliary classifier can be regarded as a special regularization term, which explicitly injects the supervision information into the process of calculating edge weights and helps the model select useful information in the process of aggregating neighbors.

The final loss of our model is the sum of loss m\mathcal{L}_{m} (Eq 6) and loss a\mathcal{L}_{a} (Eq 27),

Loss=m+θa,Loss=\mathcal{L}_{m}+\theta\mathcal{L}_{a}, (29)

where θ\theta is a hyper-parameter.

V Experiments

V-A Data Sets

We use two benchmark NER datasets for evaluation, i.e., CoNLL 2003 dataset (CoNLL03) and OntoNotes 5.0 English datasets (OntoNotes 5.0). The details about corporas are shown in Table I.

  • CoNLL03 [33] is a collection of news wire articles from the Reuters corpus, which includes four different types of named entities: persons (PER), locations (LOC), organizations (ORG), and miscellaneous (MISC). We use the standard dataset split [7] and follow BIOES tagging scheme (B, I, E represent the beginning, middle and end of an entity, S means a single word entity and O means non-entity).

  • OntoNotes 5.0 is much larger than CoNLL 2003 dataset, and consists of text from a wide variety of sources (broadcast conversation, newswire, magazine and Web text, etc..) It is tagged with eighteen entity types, such as persons (PERSON), organizations (ORG), geopolitical entity (GPE), and law (LAW), etc.. Following previous works [5], we adopt the portion of the dataset with gold-standard named entity annotations, in which the New Testaments portion is excluded.

V-B Network Training

In this section, we show the details of network training. Related hyper-parameter settings are presented including initialization, optimization, and network structure. We also report the training time of our model on the two datasets.

Initialization. We initialize word embedding with 300300-dimensional GloVe [28] and randomly initialize 3030-dimensional character embedding. We adopt fine-tuning strategy and modify initial word embedding during training. All weight matrices in our model are initialized by Glorot Initialization [10], and the bias parameters are initialized with 0.

Optimization. We train the model parameters by the mini-batch stochastic gradient descent (SGD) with batch size 2020 and learning rate 0.010.01. The L2L_{2} regularization parameter is 1e1e-88. We adopt the dropout strategy to overcome the over-fitting on the input and the output of Bi-LSTM with a fixed ratio of 0.50.5. We also use a gradient clipping [27] to avoid gradient explosion problem. The threshold of the clip norm is set to 55. Early stopping [18] is applied for training models according to their performances on development sets.

Network Structure. We use Bi-LSTM to learn character-level representation of words, which will form the distributed representation for input together with the pre-trained word embedding and sentence-level representation. The size of hidden state of character and word-level Bi-LSTM are set to 5050 and 200200, respectively. And we fix the depth of these layers as 1 in our neural architecture. The hidden dim of sentence-level representation is set to 300300 and the window size kk in cross-sentence module is 22. The threshold 𝒯\mathcal{T} in uncertainty prediction sub-module is set to 0.50.5. The hyper-parameter θ\theta in Eq 29 is set to 0.10.1. In the auxiliary experiments, the output hidden states of BERT [8] are taken as additional contextualized embeddings, which are combined with other three types of word representations (rf. Eq 9). We still adopts Bi-LSTM to encode the context of words instead of using BERT as encoder and fine-tune it.

Training Time. We implement our model based on the PyTorch library and the training process has been conducted on one GeForce GTX 1080 Ti GPU. The model training completes in about 1.6 hours on the CoNLL03 dataset and about 6.7 hours on the OntoNotes 5.0 dataset.

Corpus Type Train Dev Test
CoNLL03 Sentences 14,987 3,466 3,684
Tokens 204,567 51,578 46,666
OntoNotes 5.0 Sentences 59,924 8,528 8,262
Tokens 1,088,503 147,724 152,728
TABLE I: Statistics of CoNLL03 and OntoNotes 5.0.

V-C Evaluation Results and Analysis

Category Index & Model F1F_{1}-score
Type Value(±\pmstd1\mbox{std}^{1})
Sentence-level   Lample et al., 2016 [17] reported 90.94
  Ma and Hovy, 2016 [24] reported 91.21
  Yang et al., 2017 [35] reported 91.26
  Liu et al., 2018 [20] avg 91.24±\pm0.12
max 91.35
  Ye and Ling, 2018 [36] reported 91.38
Document-level   Zhang et al., 2018 [37] avg 91.64
max 91.81
  Qian et al., 2019 [31] reported 91.74
  Luo et al., 2020 [23] reported 91.96±\pm0.03
  Gui et al., 2020 [11] reported 92.13
Bi-LSTM-CRF2\mbox{Bi-LSTM-CRF}^{2} [17] avg 91.01±\pm0.21
max 91.27
GCDoc\ast avg 92.22±\pm0.02
max 92.26
+ Language Models / External knowledge
Sentence-level   Peters et al., 2017 [29] reported 91.93±\pm0.19
  Peters et al., 2018 [30] reported 92.22±\pm0.10
  Akbik et al., 2018 [2] reported 92.61±\pm0.09
  Devlin et al., 2018 [8] reported 92.80
Document-level   Akbik et al., 2019 [1] reported 93.18±\pm0.09
  Chen et al., 2020 [4] reported 92.68
  Luo et al., 2020 [23] reported 93.37±\pm0.04
  Gui et al., 2020 [11] reported 93.05
GCDoc+BERTLARGEBERT_{LARGE} avg 93.40±\pm0.02
max 93.42
  • s1td{}^{1}~{}std means Standard Deviation.

  • 2 Here we re-implement the classical Bi-LSTM-CRF model using the same model setting and optimization method with our model.

TABLE II: Comparison of overall performance on CoNLL 2003 NER task. \ast indicates statistical significance on the test dataset against Bi-LSTM-CRF by a paired t-test with p<0.01p<0.01.

V-C1 Over Performance

This experiment is to evaluate the effectiveness of our approach on different datasets. Specifically, we report standard F1F_{1}-score for evaluation. In order to enhance the fairness of the comparisons and verify the solidity of our improvement, we rerun 33 times with different random initialization and report both average and max results of our proposed model. As for the previous methods, we will show their reported results. Note that these models use the same methods of dataset split and evaluation metrics calculation as ours, which can ensure the accuracy and fairness of the comparison. The results are given in Table II and Table III, respectively.

On CoNLL03 dataset, we compare our model with the state-of-the-art models which can be categorized into sentence-level models and document-level models. The listed sentence-level models are usually popular baselines for most subsequent work in this field [17, 24, 35, 20, 36]. And the document-level models are recent work that also utilize global information besides single sentence for NER as well [37, 31, 23, 11, 1, 4]. Besides, we leverage the pre-trained language model BERT (large version) as an external resource for fair comparison with other models that also use external knowledge [29, 30, 2] On CoNLL03 dataset, our model achieves 92.22%92.22\% F1F_{1}-score without external knowledge and 93.40%93.40\% with BERT. Even compared with the more recent top-performance baseline [11], our model achieves a better result with an improvement of 0.09%0.09\% and 0.35%0.35\%. Considering that the CoNLL03 dataset is relatively small, we further conduct experiment on a much more large OntoNotes 5.0 dataset. We compare our model with previous methods that also reported results on it [3, 23, 1]. As shown in Table III, our model shows a significant advantage on this dataset, which achieves 88.32%F188.32\%F_{1} score without external knowledge and 90.49%90.49\% with BERT, consistently outperforming all previous baseline results substantially. Besides, the std (Standard Deviation) value of our model is smaller than the one of Bi-LSTM-CRF, which demonstrates our proposed method is more stable and robust. In Tabel IV, we show the comparison results of the detailed metrics (including precision, recall and F1F_{1}) of GCDoc and Bi-LSTM-CRF on the two datasets. We can indicate from the table that compared with Bi-LSTM-CRF, the evaluation results of GCDoc under all metrics are significantly improved. And the score of recall is improved even more compared with precision.

Overall, the comparisons on these two benchmark datasets well demonstrate that our model can truly leverage the document-level contextual information to enhance NER tasks without the support from external knowledge.

Category Index & Model F1F_{1}-score
Type Value(±\pm std)
Sentence-level   Chiu and Nichols, 2016 [5] reported 86.28±\pm0.26
  Strubell et al., 2017 [34] reported 86.84±\pm0.19
  Li et al., 2017 [19] reported 87.21
  Chen et al., 2019 [3] reported 87.67±\pm0.17
Document-level   Qian et al., 2019 [31] reported 87.43
  Luo et al., 2020 [23] reported 87.98±\pm0.05
Bi-LSTM-CRF [17] avg 87.64±\pm0.23
max 87.80
GCDoc\ast avg 88.32±\pm0.04
max 88.35
+ Language Models / External knowledge
Sentence-level   Clark et al., 2018 [6] reported 88.81±\pm0.09
  Liu et al., 2019 [21] reported 89.94±\pm0.16
  Jie and Lu, 2019 [14] reported 89.88
Document-level   Luo et al., 2020 [23] reported 90.30
GCDoc+BERTLARGEBERT_{LARGE} avg 90.49±\pm0.09
max 90.56
TABLE III: Comparison of overall performance on OntoNotes 5.0 English datasets. \ast indicates statistical significance on the test dataset against Bi-LSTM-CRF by a paired t-test with p<0.01p<0.01.
Model CoNLL03 OntoNotes 5.0
Precision Recall F1F_{1}-score Precision Recall F1F_{1}-score
Bi-LSTM-CRF 90.96 91.07 91.01 87.58 87.70 87.64
GCDoc 92.12 92.33 92.22 87.90 88.74 88.32
Δ\Delta +1.16 +1.26 +1.21 +0.32 +1.04 +0.68
TABLE IV: Comparison of precision, recall and F1F_{1}-score between GCDoc and Bi-LSTM-CRF on CoNLL03 and OntoNotes 5.0 datasets.

V-C2 Ablation Study

In this section, we run experiments to dissect the relative impact of each modeling decision by ablation studies.

For better understanding the effectiveness of two key components in our model, i.e., document graph module and cross-sentence module, we conduct ablation tests where one of the two components is individually adopted. The results are reported in Table V. The experimental results show that by adding any of the two modules, the model’s performance on both datasets is significantly improved. We discover that just adopting the document graph module can get a large gain of 0.850.85%/0.560.56% over baseline. And by combining with the cross-sentence module, we achieve the final state-of-the-arts results, indicating the effectiveness of our proposed approach to exploit document-level contexual information at both the word and sentence level.

No Model CoNLL03 OntoNotes 5.0
1 base model\ast 91.01±\pm0.21 87.64±\pm0.23
2 + Cross-Sentence Module\ast 91.53±\pm0.09 87.91±\pm0.21
3 + Document Graph Module\ast 91.86±\pm0.02 88.20±\pm0.11
4 + ALL 92.22±\pm0.02 88.32±\pm0.04
TABLE V: Ablation study of overall architechture on the two benchmark datasets. \ast indicates statistical significance on the test dataset against GCDoc by a paired t-test with p<0.01p<0.01. Note that in this table, \ast measures the drop in performance.

In order to analyze the working mechanism of the document graph module in our porposed model, we conduct additional experiments on CoNLL03 dataset. We introduce 3 baselines as shown in Table VI: (1) base model only with cross-sentence module; (2) add document graph module but without the two strategies for avoiding noise, which means that Eq 18 is adopted to aggregate neighbor information, i.e., takes the average of all neighbors’ representations; (3) adopt document graph pruning strategy with uncertainty prediction sub-module, i.e., using Eq 23 to aggregate neighbor information; The last one is GCDoc, which applys a selective auxiliary classifier to guide the edge weights calculation progress and further helps the model select useful information. By comparing Model 1 and Model 2, we can find that just adding a simple document graph can get a significant improvement of 0.47%0.47\%, which shows that modeling the connection between words that reoccur in document indeed brings much useful global contextual information. The experiment that comparing Model 2 and Model 3 indicates that adding document graph pruning strategy will bring further improvement, since noise information is prevented from introducing by ignoring the impact of less reliable tokens on their neighboring nodes. And the result of comparing Model 3 and Model 4 demonstrates that the designed selective auxiliary classifier provides additional improvements, which proves its importance for capturing the weights of different neighbor nodes and filtering noise information.

In order to appropriately model a wider context beyond single sentence, we encode both the previous and next sentences to enhance the semantic information of the current sentence. In this experiment, one of the two parts is removed from model each time and the results are shown in Table VII. In the first baseline we only encode the current sentence and utilize it as the sentence-level representation. We can find that including either previous or next sentences contributes to an improvement over the base model, which verifies the effectiveness of modeling wider context and encoding neighbour sentences to improve NER performance.

No Strategies F1F_{1}-score±\pmstd
1 Base 91.53±\pm0.09
2 +Doc Graph 92.00±\pm0.07
3 +Pruning 92.10±\pm0.03
4 +Edge Weights 92.22±\pm0.02
TABLE VI: Comparison of different strategies of Document Graph Module on CoNLL03 dataset.
Refer to caption
Figure 4: Performance of our model with various window sizes.
Previous Sentences Next Sentences F1F_{1}-score±\pmstd
×\times ×\times 91.92±\pm0.14
×\times 92.04±\pm0.13
×\times 91.96±\pm0.18
92.22±\pm0.02
TABLE VII: Experimental results for ablating additional context in Cross-Sentence Module.
Refer to caption
Figure 5: Example of the predictions of Bi-LSTM-CRF baseline and our model.

V-C3 Complexity Analysis

In this section, we analyze in detail the computation complexity of the proposed GCDoc for a better comparison with the baseline model. Compared with Bi-LSTM-CRF, GCDoc mainly adds two modules, i.e., the cross-sentence module, and the document graph module. Therefore, we first analyze the complexity of these two modules separately. Then we compare the overall complexity of GCDoc and Bi-LSTM-CRF.

The cross-sentence module includes a sentence encoder based on Bi-LSTM (rf. Eq (1)-(3), Eq (17)) and an attention mechanism for aggregating cross-sentence context (rf. Eq (11)-(16)). The time complexity of the two can be expressed as O(nd2)O(nd^{2}) and O(d2)O(d^{2}) respectively, where nn denotes the sentence length and dd is the dimension of the sentence embeddings. Therefore, the overall time complexity of the cross-sentence module is O(nd2)O(nd^{2}).

The document graph module. The computation complexity of this module mainly comes from two parts: one is to use GNN to aggregate the neighbours’ information of each node (rf. Eq (26), (28)), and the other is to combine the enhanced representation with the initial embedding via a gating mechanism (rf. Eq (19)-(22)). Note that the size of each node’s neighbors varies and some may be very large. Therefore, we sample a fixed-size (i.e., pp) neighborhood of each node as the receptive field during the data preprocessing stage, which can facilitate parallel computing in batches and improve efficiency. In this way, the computational complexity of aggregating the neighbours’ information can be expressed as O(npd2)O(npd^{2}). And the gating mechanism for combining representations requires O(nd2)O(nd^{2}) computation complexity. Therefore, the overall time complexity of the document graph module is O(npd2)O(npd^{2}).

As for the Bi-LSTM-CRF model, its time complexity can be expressed as O(nd2)O(nd^{2}). GCDoc adds the above two modules on its basis, thus its overall time complexity is O(npd2)O(npd^{2}). Since pp here is actually a constant (set to 55 in our experiment), the time complexity of GCDoc is also O(nd2)O(nd^{2}). Compared with the Bi-LSTM-CRF baseline, our model’s performance on both datasets is significantly improved without leading to a higher computation complexity.

V-C4 Impact of Window Size in Cross-Sentence Module

The window size kk (rf. Section IV-B) is clearly a hyperparameter which must be optimized for, thus we investigate the influence of the value of kk on the CoNLL2003 NER task. The plot in Figure 4 shows that when assigning the value of kk to 22 the model achieves the best results. When kk is less than 22, the larger kk may incorporate more useful contextualized representation by encoding neighboring sentences and improve the results accordingly, when kk is larger than 22, our model drops slightly since more irrelevant context information is involved.

V-C5 Case Study

In this subsection, we present an in-depth analysis of results given by our proposed model. Figure 5 shows four cases that our model predicts correctly but Bi-LSTM-CRF model doesn’t. All examples are selected from the CoNLL 2003 test datasets. We also list sentences in the same document that contain words mistakenly tagged by baseline model (Doc-sents in the figure) for better understanding the influence of utilizing document-level context in our model.

In the first case, the word “Charlton” is a person name while baseline recognizes it as an organization (ORG). In the listed Doc-sents, PER related contextual information, such as “said” in the first sentence and “ENGLISHMAN” in the second sentence indicate “Charlton” to be a PER. Our model correctly tags “Charlton” as PER by leveraging document-level contextual information. In the second case, “Barcelona” is a polysemous word that can represent a city in spain, or represent an organization as a football club name. Without obvious ORG related context information, “Barcelona” is mistakenly labeled as S-LOC by the baseline model. However, our model successfully labels it as S-ORG by utilizing useful sentences in the document whose context inforamtion strongly indicates “Barcelona” to be a football club. Similar situation is shown in the third case. We can infer from “’s eldest daughter” that the word “Suharto” represents the name of a person in the sentence, rather than a part of an organization “City Group of Suharto”. And our model assigns correct label S-PER to it with the help of another sentence in the same document but the baseline model fails.

In the fourth case, we show situation where the document-level context information contains noise. The word “Bucharest” is part of the orgnazation “National Bucharest” while baseline mistakenly recognizes it as LOC. In the listed Doc-sents, in addition to useful contextual information brought by the first and third sentences, “Bucharest” in the second sentence represents LOC, i.e. a city in Romania, which will inevitibaly introduce noise. Our model makes a correct prediction which demenstrates the effectiveness of our model to avoid the interference of noise information.

V-C6 Performance on Different Types of Entities

We further compare the performance of our model and Bi-LSTM-CRF baseline with respect to different types of entities. We are interested in the proportion of each type of entity being correctly labeled by different models. Therefore, in Table VIII, we show the corresponding recall scores of the two models with respect to different types of entities on CoNLL03 dataset.

Compared with the Bi-LSTM-CRF model, the recall score of GCDoc drops slightly (0.47%) on the LOC type, while it’s significantly improved on the other three entity types. Among them, for PER and ORG types, GCDoc brings a great improvement of more than 2%. We speculate that this is because the document graph module of GCDoc can introduce more useful global information for these two types of entities, because in the CoNLL03 test dataset, there are more scenarios where entity tokens of these two types appear repeatedly in the same document.

Model PER LOC ORG MISC
Bi-LSTM-CRF 95.18 94.12 88.44 80.91
GCDoc 97.34 93.65 90.79 81.91
Δ\Delta +2.16 -0.47 +2.35 +1.00
TABLE VIII: Comparison of performance on different type of entities between Bi-LSTM-CRF baseline and our model on CoNLL03 dataset.

VI Conclusions

This paper proposes a model that exploits document-level contextual information for NER at both word-level and sentence-level. A document graph is constructed to model wider range of dependencies between words, then obtain an enriched contextual representation via graph neural networks (GNN), we further propose two strategies to avoid introducing noise information in the document graph module. A cross-sentence module is also designed to encode adjacent sentences for enriching the contexts of the current sentence. Extensive experiments are conducted on two benchmark NER datasets (CoNLL 2003 and Ontonotes 5.0 English datasets) and the results show that our proposed model achieves new state-of-the-art performance.

References

  • [1] Alan Akbik, Tanja Bergmann, and Roland Vollgraf. Pooled contextualized embeddings for named entity recognition. In NAACL, pages 724–728, 2019.
  • [2] Alan Akbik, Duncan Blythe, and Roland Vollgraf. Contextual string embeddings for sequence labeling. In COLING, pages 1638–1649, 2018.
  • [3] Hui Chen, Zijia Lin, Guiguang Ding, Jianguang Lou, Yusen Zhang, and Borje Karlsson. Grn: Gated relation network to enhance convolutional neural network for named entity recognition. AAAI, 2019.
  • [4] Yubo Chen, Chuhan Wu, Tao Qi, Zhigang Yuan, and Yongfeng Huang. Named entity recognition in multi-level contexts. Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing, 2020.
  • [5] Jason PC Chiu and Eric Nichols. Named entity recognition with bidirectional lstm-cnns. TACL, 4:357–370, 2016.
  • [6] Kevin Clark, Minh-Thang Luong, Christopher D Manning, and Quoc V Le. Semi-supervised sequence modeling with cross-view training. arXiv preprint arXiv:1809.08370, 2018.
  • [7] Ronan Collobert, Koray Kavukcuoglu, Jason Weston, Leon Bottou, Pavel Kuksa, and Michael Karlen. Natural language processing (almost) from scratch. JMLR, 12(1):2493–2537, 2011.
  • [8] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
  • [9] Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. ICML, 2016.
  • [10] Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In AISTATS, pages 249–256, 2010.
  • [11] Tao Gui, Jiacheng Ye, Qi Zhang, Yaqian Zhou, and Xuanjing Huang. Leveraging document-level label consistency for named entity recognition. In Twenty-Ninth International Joint Conference on Artificial Intelligence and Seventeenth Pacific Rim International Conference on Artificial Intelligence IJCAI-PRICAI-20, 2020.
  • [12] Aaron L. F. Han, Derek F. Wong, and Lidia S. Chao. Chinese Named Entity Recognition with Conditional Random Fields in the Light of Chinese Characteristics. Language Processing and Intelligent Information Systems, 2013.
  • [13] Zhiheng Huang, Wei Xu, and Kai Yu. Bidirectional lstm-crf models for sequence tagging. Computer Science, 2015.
  • [14] Zhanming Jie and Wei Lu. Dependency-guided lstm-crf for named entity recognition. EMNLP, 2019.
  • [15] Taku Kudoh and Yuji Matsumoto. Use of support vector learning for chunk identification. In CoNLL, 2000.
  • [16] John Lafferty, Andrew McCallum, and Fernando CN Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In ICML, 2001.
  • [17] Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. Neural architectures for named entity recognition. In NAACL, 2016.
  • [18] C. Lee, Giles Overfitting, Rich Caruana, Steve Lawrence, and Lee Giles. Overfitting in neural nets: Backpropagation, conjugate gradient, and early stopping. In NIPS, 2000.
  • [19] Peng-Hsuan Li, Ruo-Ping Dong, Yu-Siang Wang, Ju-Chieh Chou, and Wei-Yun Ma. Leveraging linguistic structures for named entity recognition with bidirectional recursive neural networks. In EMNLP, pages 2664–2669, 2017.
  • [20] Liyuan Liu, Jingbo Shang, Xiang Ren, Frank Fangzheng Xu, Huan Gui, Jian Peng, and Jiawei Han. Empower sequence labeling with task-aware neural language model. In AAAI, 2018.
  • [21] Tianyu Liu, Jin-Ge Yao, and Chin-Yew Lin. Towards improving neural named entity recognition with gazetteers. In ACL, pages 5301–5307, 2019.
  • [22] Ling Luo, Zhihao Yang, Pei Yang, Yin Zhang, Lei Wang, HongfeiH Lin, and Jian Wang. An attention-based bilstm-crf approach to document-level chemical named entity recognition. Bioinformatics, (8):8, 2017.
  • [23] Ying Luo, Fengshun Xiao, and Hai Zhao. Hierarchical contextualized representation for named entity recognition. AAAI, 2020.
  • [24] Xuezhe Ma and Eduard Hovy. End-to-end sequence labeling via bi-directional lstm-cnns-crf. In ACL, 2016.
  • [25] Andrew McCallum and Wei Li. Early results for named entity recognition with conditional random fields, feature induction and web-enhanced lexicons. In CoNLL@NAACL, pages 188–191. Association for Computational Linguistics, 2003.
  • [26] Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013.
  • [27] Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In ICML, 2013.
  • [28] Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In EMNLP, pages 1532–1543, 2014.
  • [29] Matthew E Peters, Waleed Ammar, Chandra Bhagavatula, and Russell Power. Semi-supervised sequence tagging with bidirectional language models. In ACL, 2017.
  • [30] Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. NAACL, 2018.
  • [31] Yujie Qian, Enrico Santus, Zhijing Jin, Jiang Guo, and Regina Barzilay. Graphie: A graph-based framework for information extraction. NAACL, 2019.
  • [32] Lawrence R Rabiner. A tutorial on hidden markov models and selected applications in speech recognition. Proceedings of the IEEE, 77(2):257–286, 1989.
  • [33] Erik F. Tjong Kim Sang and Fien De Meulder. Introduction to the conll-2003 shared task: Language-independent named entity recognition. NAACL-HLT, pages 142–147, 2003.
  • [34] Emma Strubell, Patrick Verga, David Belanger, and Andrew McCallum. Fast and accurate entity recognition with iterated dilated convolutions. EMNLP, 2017.
  • [35] Zhilin Yang, Ruslan Salakhutdinov, and William W Cohen. Transfer learning for sequence tagging with hierarchical recurrent networks. In ICLR, 2017.
  • [36] Zhi-Xiu Ye and Zhen-Hua Ling. Hybrid semi-markov crf for neural sequence labeling. ACL, 2018.
  • [37] Boliang Zhang, Spencer Whitehead, Lifu Huang, and Heng Ji. Global attention for name tagging. CoNLL, 2018.