E MPIRICAL A NALYSIS OF U NLABELED E NTITY P ROBLEM IN N AMED E NTITY R ECOGNITION
A BSTRACT
In many scenarios named entity recognition (NER) models severely suffer from unlabeled entity problem , where the entities of a sentence may not be fully annotated.
Through empirical studies performed on synthetic datasets, we ﬁnd two causes of performance degradation.
One is the reduction of annotated entities and the other is treating unlabeled entities as negative instances.
The ﬁrst cause has less impact than the second one and can be mitigated by adopting pretraining language models.
The second cause seriously misguides a model in training and greatly affects its performances.
Based on the above observations, we propose a general approach, which can almost eliminate the misguidance brought by unlabeled entities.
The key idea is to use negative sampling that, to a large extent, avoids training NER models with unlabeled entities.
Experiments on synthetic datasets and real-world datasets show that our model is robust to unlabeled entity problem and surpasses prior baselines.
On well-annotated datasets, our model is competitive with the state-of-the-art method
I NTRODUCTION
Named entity recognition (NER) is an important task in information extraction.
Previous methods typically cast it into a sequence labeling problem by adopting IOB tagging scheme (Mesnil et al., 2015; Huang et al., 2015; Ma & Hovy, 2016; Akbik et al., 2018; Qin et al., 2019).
A representative model is Bi-LSTM CRF (Lample et al., 2016).
The great success achieved by these methods beneﬁts from massive correctly labeled data.
However, in some real scenarios, not all the entities in the training corpus are annotated.
For example, in some NER tasks (Ling & Weld, 2012), the datasets contain too many entity types or a mention may be associated with multiple labels.
Since manual annotation on this condition is too hard, some entities are inevitably neglected by human annotators.
Situations in distantly supervised NER (Ren et al., 2015; Fries et al., 2017) are even more serious.
To reduce handcraft annotation, distant supervision (Mintz et al., 2009) is applied to automatically produce labeled data.
As a result, large amounts of entities in the corpus are missed due to the limited coverage of knowledge resources.
We refer this to unlabeled entity problem , which largely degrades performances of NER models.
There are several approaches used in prior works to alleviate this problem.
Fuzzy CRF and AutoNER (Shang et al., 2018b) allow models to learn from the phrases that may be potential entities.
However, since these phrases are obtained through a distantly supervised phrase mining method (Shang et al., 2018a), many unlabeled entities in the training data may still not be recalled.
In the context of only resorting to unlabeled corpora and an entity ontology, Mayhew et al. ; Peng et al.
(2019) employ positive-unlabeled (PU) learning (Li & Liu, 2005) to unbiasedly and consistently estimate the task loss.
In implementations, they build distinct binary classiﬁers for different labels.
Nevertheless, the unlabeled entities still impact the classiﬁers of the corresponding entity types and, importantly, the model can’t disambiguate neighboring entities.
Partial CRF (Tsuboi et al., 2008) is an extension of commonly used CRF (Lafferty et al., 2001) that supports learning from incomplete annotations.
Yang et al.
; Nooralahzadeh et al.
; Jie et al.
(2019) use it to circumvent training with false negatives.
However, as fully annotated corpora are still required to get ground truth training negatives, this approach is not applicable to the situations where little or even no high-quality data is available.
In this work, our goal is to study what are the impacts of unlabeled entity problem on the models and how to effectively eliminate them.
Initially, we construct some synthetic datasets and introduce degradation rates.
The datasets are constructed by randomly removing the annotated named entities in well-annotated datasets, e.g., CoNLL-2003 (Sang & De Meulder, 2003), with different probabilities.
The degradation rates measure how severe an impact of unlabeled entity problem degrades the performances of models.
Extensive studies are investigated on synthetic datasets.
We ﬁnd two causes: the reduction of annotated entities and treating unlabeled entities as negative instances.
The ﬁrst cause is obvious but has far fewer inﬂuences than the second one.
Besides, it can be mitigated well by using a pretraining language model, like BERT (Devlin et al., 2019)), as the sentence encoder.
The second cause seriously misleads the models in training and exerts a great negative impact on their performances.
Even in less severe cases, it can sharply reduce the F1 score by about 20% .
Based on the above observations, we propose a novel method that is capable of eliminating the misguidance of unlabeled entities in training.
The core idea is to apply negative sampling that avoids training NER models with unlabeled entities.
Studies on synthetic datasets and real-world datasets (e.g., EC) show that our model well handles unlabeled entities and notably surpasses prior baselines.
On well-annotated datasets (e.g., CoNLL2003), our model is competitive with the state-of-the-art method.
In industry, our method has been successfully applied to the ﬁne-grained NER module of T EX S MART (Zhang et al., 2020), where highly difﬁcult manual annotation results in serious unlabeled entity problem .
P RELIMINARIES
In this section, we formally deﬁne the unlabeled entity problem and brieﬂy describe a strong baseline,
BERT Tagging (Devlin et al., 2019), used in empirical studies.
2. U NLABELED E NTITY P ROBLEM
We denote an input sentence as x = [ x 1 , x 2 , · · · , x n ] and the annotated named entity set as y =
{ y 1 , y 2 , · · · , y m } .
n is the sentence length and m is the amount of entities.
Each member y k of set y is a tuple ( i k , j k , l k ) .
( i k , j k ) is the span of an entity which corresponds to the phrase x i k ,j k =
[ x i k , x i k +1 , · · · , x j k ] and l k is its label.
The unlabeled entity problem is deﬁned as, due to the limited coverage of machine annotator or the negligence of human annotator, some ground truth entities (cid:101) y of the sentence x are not covered by annotated entity set y . For instance, given a sentence x =
[Jack , and , Mary , are , from , New , York] and a labeled entity set y =
{ (1 , 1 , PER) } , unlabeled entity problem is that some entities, like (6 , 7 , LOC) , are neglected by annotators.
These unlabeled entities are denoted as (cid:101) y
= { (3 , 3 , PER) , (6 , 7 , LOC) } .
2. BERT T AGGING
BERT Tagging is present in Devlin et al. (2019), which adopts IOB tagging scheme, where each token x i in a sentence x is labeled with a ﬁne-grained tag, such as B-ORG, I-LOC, or O. Formally, its output is a n -length label sequence z =
[ z 1 , z 2 , · · · , z n ] .
Formally, BERT tagging ﬁrstly uses BERT to get the representation
h
i for every token x i : [ h
[Equation]
, · · · , h n ] = BERT(
[Equation]
Then, the label distribution q i is computed as Softmax( Wh i )
In training the loss is induced as (cid:80) 1 ≤ i ≤ n − log q i
[ z i ] .
At test time, it obtains the label for each token x
i by arg max q i
E MPIRICAL S TUDIES
To understand the impacts of unlabeled entity problem , we conduct empirical studies over multiple synthetic datasets, different methods, and various metrics.
3. P REPARATIONS
Synthetic Datasets.
We use synthetic datasets to simulate poorly-annotated datasets that contain unlabeled entities. They are obtained by randomly removing the labeled entities of well-annotated datasets with different masking probabilities p .
The material datasets are CoNLL-2003 (Sang & De Meulder, 2003) and OntoNotes 5.0 (Pradhan et al., 2013).
The probabilities p are respectively set as 0 . 0 , 0 . 1 , 0 . 2 , · · · , 0 . 9 .
In this way, 2 × 10 synthetic datasets are constructed.
Methods.
We adopt two models.
One of them is BERT Tagging, which has long been regarded as a strong baseline.
The other is LSTM Tagging that replaces the original encoder (i.e., BERT) of BERT Tagging with LSTM (Hochreiter & Schmidhuber, 1997).
We use it to study the effect of using pretraining language model.
To explore the negative impact brought by unlabeled entities in training, we present an adjusted training loss for above two models:
[Equation]
The idea here is to remove the incorrect loss incurred by unlabeled entities.
Note that missed entity set (cid:101)
y is reachable in synthetic datasets but unknown in real-world datasets.
Metrics.
Following prior works, the F1 scores of models are tested by using conlleval script 2 .
We also design two degradation rates to measure the different impacts of unlabeled entity problem .
One is erosion rate α p and the other is misguidance rate β p :
[Equation]
For a synthetic dataset with the masking probability being p , f p and f ap are the performances of a model and its adjusted version, respectively.
Erosion rate α p measures how severe the reduction of annotated entities degrades the F1 scores of a model.
Misguidance rate β p measures how serious unlabeled entities misguide the model during training. [Figure]
Sequence Encoder (BERT or LSTM)
[Figure]
# 𝑥 $ 𝒉 !
𝒉 " 𝒉 # 𝒉 $ 𝒔 !,# ⊕
MLP 𝒐 !,# 3. O VERALL A NALYSIS
The left parts of Fig. 1 and Fig. 2 show the results of empirical studies, where we evaluate the
F1 scores of BERT Tagging and LSTM Tagging on 20 synthetic datasets.
From them, we can draw the following observations.
Firstly, the signiﬁcant downward trends of solid lines conﬁrm the fact that NER models severely suffer from unlabeled entity problem .
For example, by setting the masking probability as 0 . 4 , the performance of LSTM Tagging decreases by 33 . 01% on CoNLL2003 and 19 .
58% on OntoNotes 5.0.
Secondly, in contrast, the dashed lines change very slowly, indicating that the models with adjusted training loss (see Eq.
(2)) are much less inﬂuenced by the issue.
For instance, when masking probability is 0 . 7 , adopting adjusted loss preserves the F scores of BERT Tagging by 41 .
04% on CoNLL-2003 and 57 .
38% on OntoNotes 5.0.
Lastly, for high masking probabilities, even though the negative impact of unlabeled entities is eliminated by adjusting the training loss, the performance still declines to a certain extent.
For example, when masking probability is set as 0 . 8 , the F1 scores of adjusted LSTM Tagging decrease by 31 .
64% on
CoNLL-2003 and 17 .
22% on OntoNotes 5.0.
Reduction of Annotated Entities.
From the last observation, we can infer that a cause of performance degradation is the reduction of annotated entities.
In the middle parts of Fig. 1 and Fig. 2, we plot the change of erosion rates α p (see Eq. (2)) with respect to masking probabilities.
We can see that its impact is not very serious when in low masking probabilities but can’t be neglected when in high ones.
Besides, using pre-training language models greatly mitigates the issue.
As an example, when the probability is 0 . 8 , on both CoNLL-2003 and OntoNotes 5.0, the erosion rates of adjusted BERT Tagging are only about half of those of adjusted LSTM Tagging.
Misguidance of Unlabeled Entities.
From the last two observations, we can conclude that the primary cause is treating unlabeled entities as negative instances, which severely misleads the models during training.
To better understand it, in the right parts of Fig. 1 and Fig. 2, we plot the change of misguidance rates β p (see Eq. (3)) with masking probabilities.
These rates are essentially the percentage decreases of F1 scores.
From them, we can see that the impact of misguidance is very much serious even when in low masking probabilities.
M ETHODOLOGY
Motivated by Sec. 3.2, we present a model that is robust to unlabeled entities.
4. S CORING M ODEL WITH BERT
Based on the ﬁndings in Sec. 3.2, we use BERT as the default encoder to mitigate the reduction of annotated entities.
Speciﬁcally, given a sentence x , we ﬁrstly obtain the token representations h i with Eq.
Then, we get the representation for every phrase x i,j as
[Equation]
(4) where ⊕ is column-wise vector concatenation and (cid:12) is element-wise vector product.
The design here is mainly inspired by Chen et al.
Finally, multi-layer perceptron (MLP) computes the label distribution o i,j for a span ( i, j ) : o i [Equation] tanh
[Equation]
The term o i,j [ l ] is the predicted score for an entity ( i, j, l ) .
4. T RAINING VIA N EGATIVE S AMPLING
From Sec. 3.2, we know that regarding all the unlabeled spans as negative instances certainly degrades the performances of models, since some of them may be missed entities.
Our solution to this issue is negative sampling.
Speciﬁcally, we randomly sample a small subset of unlabeled spans as the negative instances to induce the training loss.
Given the annotated entity set y , we ﬁrstly get all the negative instance candidates as
[Equation]
where L is the label space and O is the label for non-entity spans.
Then, we uniformly sample a subset (cid:98) y from the whole candidate set.
The size of sample set (cid:98) y is (cid:100) λ ∗ n (cid:101) , 0 < λ < 1 , where (cid:100)(cid:101) is the ceiling function.
Ultimately, a span-level cross entropy loss used for training is incurred as
[Equation]
Negative sampling incorporates some randomness into the training loss, which reduces the risk of training a NER model with unlabeled entities.
4. I NFERENCE
At test time, ﬁrstly, the label for every span ( i, j ) is obtained by arg max l o i,j [ l ] .
Then, we select the ones whose label l is not O as predicted entities.
When the spans of inferred entities intersects, we preserve the one with the highest predicted score and discard the others.
The time complexity of inference is O ( n 2 ) , which is majorly contributed by the span selection procedure.
While this seems a bit higher compared with our counterparts, we ﬁnd that, in practical use, its running time is far less than that of the forward computation of neural networks.
The algorithm for inference is greedy yet effective.
In experiments, we ﬁnd that the probability of our heuristic selecting a wrong labeled span when resolving the span conﬂict is very low.
D ISCUSSION
We show that, through negative sampling, the probability of not treating a speciﬁc missed entity in a n -length sentence as the negative instance is larger than 1 − 2 n − 3 :
[Equation]
Here n ( n +1) − m is the amount of negative candidates.
Besides, we use the facts, λ < 1 , m ≤ n , and (1 − z ) n ≥ 1 − nz, 0 ≤ z ≤ 1 , during the derivation.
Note that the above bound is only applicable to the special case where there is just one unlabeled entity in a sentence.
We remain the strict proof for general cases to future work.
E XPERIMENTS
We have conducted extensive experiments on multiple datasets to verify the effectiveness of our method.
Studies on synthetic datasets show that our model can almost eliminate the misguidance [Table] brought by unlabeled entities in training.
On real-world datasets, our model has notably outperformed prior baselines and achieved the state-of-the-art performances.
On well-annotated datasets, our model is competitive to current state-of-the-art method.
6. S ETTINGS
The setup of synthetic datasets and well-annotated datasets are the same as what we describe in
Sec. 3.1.
For real-world datasets, we use EC and NEWS, both of which are collected by Yang et al.
EC is in e-commerce domain, which has 5 entity types: Brand, Product, Model, Material, and Speciﬁcation.
The data contains 2400 sentences tagged by human annotators and are divided into three parts: 1200 for training, 400 for dev, and 800 for testing.
Yang et al.
(2018) also construct an entity dictionary of size 927 and apply distant supervision on a raw corpus to obtain additional 2500 sentences for training.
NEWS is from MSRA dataset (Levow, 2006).
Yang et al.
(2018) only adopt the PERSON entity type.
Training data of size 3000 , dev data of size 3328 , and testing data of size 3186 are all sampled from MSRA.
They collect an entity dictionary of size 71664 and perform distant supervision on the rest data to obtain extra 3722 training cases by using the dictionary.
Both
EC and NEWS contain a large amount of incompletely annotated sentences, and hence naturally suffer from the unlabeled entity problem .
We adopt the same hyper-parameter conﬁgurations of neural networks for all the datasets.
L2 regularization and dropout ratio are respectively set as 1 × 10 − 5 and 0 .
4 for reducing overﬁt.
The dimension of scoring layers is 256 .
Ratio λ is set as 0 . 35 .
When the sentence encoder is LSTM, we set the hidden dimension as 512 and use pretrained word embeddings (Pennington et al., 2014; Song et al., 2018) to initialize word representations.
We utilize Adam (Kingma & Ba, 2014) as the optimization algorithm and adopt the suggested hyper-parameters.
At evaluation time, we convert the predictions of our models into IOB format and use conlleval script to compute the F1 score.
In all the experiments, the improvements of our models over the baselines are statistically signiﬁcant with rejection probabilities smaller than 0 . [Table] [Table] Nooralahzadeh
[Table]
This Work
[Table] 6. R ESULTS ON S YNTHETIC D ATASETS
In this section [Table] our model is compared with BERT Tagging on the synthetic datasets of the masking probabilities being 0 . 1 , 0 .
From Table [Table] we can get two conclusions.
Firstly, our model signiﬁcantly outperforms BERT Tagging, especially in high masking probabilities.
For example, on
CoNLL-2003, our F1 scores outnumber those of BERT Tagging by 1 . 88% when the probability is 0 . 2 and 27 .
16% when the probability is 0 . 6 .
Secondly, our model is very robust to the unlabeled entity problem .
When increasing the masking probability from 0 .
1 to 0 .
5 , the results of our model only decrease by 2 .
35% on CoNLL-2003 and 1 .
91% on OntoNotes 5.0.
Fig. 4 demonstrates the misguidance rate comparisons between BERT Tagging and our models.
The way to adjust our model is reformulating Eq. (7) by deﬁning the negative term via { ( i, j, O)
| ∀ l : ( i, j, l ) / ∈
y ∪ (cid:101) y } rather than the negatively sampled ˆ y .
The idea here is to avoid the unlabeled entities being sampled.
From Fig. 4, we can discover that, in all masking probabilities, the misguidance rates of our model are far smaller than those of BERT Tagging and are consistently lower than 2 .
These indicate that, in training, our model indeed eliminates the misguidance brought by unlabeled entities to some extent.
6. R ESULTS ON F ULLY A NNOTATED D ATASETS
We additionally apply our model with negative sampling on the well-annotated datasets where the issue of incomplete entity annotation is not serious.
As shown in Table 2, the F1 scores of our model are very close to current best results.
Our model slightly underperforms BERT-Biafﬁne Model by only 0 .
09% on CoNLL-2003 and 0 .
78% on OntoNotes 5.0.
Besides, our model surpasses many other strong baselines.
On OntoNotes 5.0, our model outperforms HCR w/ BERT by 0 .
32% and
Flair Embedding by 1 . 44% .
On CoNLL-2003, the improvements of F1 scores are 0 .
41% over
BERT-MRC and 0 .
35% over Flair Embedding.
All these results indicate that our model is still very effective when applied to high-quality data.
6. R ESULTS ON R EAL - WORLD D ATASETS
For two real-world datasets, a large portion of training data is obtained via distant supervision.
As stated in Yang et al.
, the F1 scores of string matching through an entity dictionary are notably declined in terms of the low recall scores, although its precision scores are higher than those of other methods.
Therefore, unlabeled entity problem is serious in the datasets.
As shown in Table 3, the baselines come from three works (Yang et al., 2018; Nooralahzadeh et al., 2019; Jie et al., [Table]
Yang et al.
(2018) use Partial CRF to circumvent all possible unlabeled entities and utilize reinforcement learning (RL) to adaptively skip noisy annotation. Jie et al. and Nooralahzadeh et al.
(2019) respectively improve Partial CRF and the policy of RL.
All the F1 scores of baselines are copied from Yang et al. ; Nooralahzadeh et al. (2019), except for that of Weighted Partial
CRF, which is obtained by rerunning its open-source code 3 .
Our model has signiﬁcantly outperformed prior baselines and obtained new state-of-the-art results.
Compared with prior best model (Nooralahzadeh et al., 2019), we achieve the improvements of 3 .
94% on EC and 6 .
27% on NEWS.
Compared with strong baseline, BiLSTM + Partial CRF, the increases of F1 scores are 9 .
20% and 8 .
To make fair comparisons, we replace BERT with LSTM.
Even so, we still outperform (Nooralahzadeh et al., 2019) by 1 .
76% on EC and 2 .
52% on NEWS.
All these strongly conﬁrm the effectiveness of our model.
6. R ATIO λ IN N EGATIVE S AMPLING
Intuitively, setting ratio λ (see Sec. 4.2) as too large values or too small values both are inappropriate.
Large ratios increase the risks of training negatives containing unlabeled entities.
Small ratios reduce the number of negative instances used for training, leading to underﬁtting.
Fig. 5 shows the experiments on some synthetic datasets with the ratio λ of our method being 0 . 1 , 0 . 2 , · · · , 0 . 9 .
From it, we can see that all the score curves are roughly arched, which veriﬁes our intuition.
Besides, we ﬁnd that 0 .
3 < λ < 0 .
4 performs well in all the cases.
6. V ALIDITY OF D EGRADATION R ATES
As Table 4 shows, we use Pearson’s correlation coefﬁcient (PCC) to measure the statistical correlations between degradation rates (e.g., misguidance rate β p ) and the F1 score.
We can see that the correlation scores are generally close to − 1 .
For example, for LSTM Tagging, on the synthetic datasets built from CoNLL-2003, the correlation score of erosion rate α p is − 0 .
90 and that of misguidance rate β p is − 0 . The results indicate that not only degradation rates quantify speciﬁc impacts of unlabeled entities but also their negative values change synchronously with the F1 score. We conclude that degradation rates are appropriate metrics for evaluation.  R ELATED W ORK
NER is a classical task in information extraction.
Previous works commonly treat it as a sequence labeling problem by using IOB tagging scheme (Huang et al., 2015; Akbik et al., 2018; Luo et al., 2020; Li et al., 2020b;c).
Each word in the sentence is labeled as B-tag if it is the beginning of an entity, I-tag if it’s inside but not the ﬁrst one within the entity, or O otherwise.
This approach is extensively studied in prior works.
For example, Akbik et al.
(2018) propose Flair Embedding that pretrains character embedding in large corpora and uses it rather than token representations to represent a sentence.
Recently, there is a growing interest in span-based models (Li et al., 2020a;
Yu et al., 2020).
They treat the spans, instead of single words, as the basic units for labeling.
For example, Li et al.
(2020a) present BERT-MRC that regards NER as a MRC task, where named entities are extracted as retrieving answer spans.
Span-based models are also prevalent in language modeling (Li et al., 2020d), syntactic analysis (Stern et al., 2017), etc.
In some practical applications (e.g., data annotation in ﬁne-grained NER), NER models are faced with unlabeled entity problem , where the unlabeled entities seriously degrade the performances of models.
Several approaches to this issue have been proposed.
Fuzzy CRF and AutoNER (Shang et al., 2018b) allow learning from high-quality phrases.
However, since these phrases are obtained through distant supervision, the unlabeled entities in the corpora may still be missed.
PU learning (Peng et al., 2019; Mayhew et al., 2019) unbiasedly and consistently estimates the training loss.
Nevertheless, the unlabeled entities still impact the classiﬁers of the corresponding entity types and, importantly, the model can’t disambiguate neighboring entities.
Partial CRF (Yang et al., 2018; Jie et al., 2019) supports learning from incomplete annotations.
However, because fully annotated corpora are still needed to training models with true negative instances, this type of approach is not applicable to the situations where no high-quality data is available.
C ONCLUSION
In this work we study what are the impacts of unlabeled entities on NER models and how to effectively eliminate them.
Through empirical studies performed on synthetic datasets, we ﬁnd two causes: the reduction of annotated entities and treating unlabeled entities as training negatives.
The ﬁrst cause has fewer inﬂuences than the second one and can be mitigated by adopting pretraining language models.
The second cause seriously misleads the models in training and greatly affects their performances.
Based on the above observations, we propose a novel method that is capable of eliminating the misguidance of unlabeled entities during training.
The core idea is to apply negative sampling that avoids training NER models with unlabeled entities.
Experiments on synthetic datasets and real-world datasets demonstrate that our model handles unlabeled entities well and signiﬁcantly outperforms previous baselines.
On well-annotated datasets, our model is competitive with the existing state-of-the-art approach.