Boosting Named Entity Recognition with Neural Character Embeddings

Cicero Nogueira dos Santos, Victor Guimarães

Introduction

Named entity recognition is a natural language processing (NLP) task that consists of finding names in a text and classifying them among several predefined categories of interest such as person, organization, location and time. Although machine learning based systems have been the predominant approach to achieve state-of-the-art results for NER, most of these NER systems rely on the use of costly handcrafted features and on the output of other NLP tasks [Tjong Kim Sang, 2002, Tjong Kim Sang and De Meulder, 2003, Doddington et al., 2004, Finkel et al., 2005, Milidiú et al., 2007]. On the other hand, some recent work on NER have used deep learning strategies which minimize the need of these costly features [Chen et al., 2010, Collobert et al., 2011, Passos et al., 2014, Tang et al., 2014]. However, as far as we know, there are still no work on deep learning approaches for NER that use character-level embeddings.

In this paper we approach language-independent NER using CharWNN, a recently proposed deep neural network (DNN) architecture that jointly uses word-level and character-level embeddings to perform sequential classification [dos Santos and Zadrozny, 2014]. CharWNN employs a convolutional layer that allows effective character-level feature extraction from words of any size. This approach has proven to be very effective for language-independent POS tagging [dos Santos and Zadrozny, 2014].

We perform an extensive number of experiments using two annotated corpora: HAREM I corpus, which contains texts in Portuguese; and the SPA CoNLL-2002, which contains texts in Spanish. In our experiments, we compare the performance of the joint and individual use of character-level and word-level embeddings. We provide information on the impact of unsupervised pre-training of word embeddings in the performance of our proposed NER approach. Our experimental results evidence that CharWNN is effective and robust for Portuguese and Spanish NER. Using the same CharWNN configuration used by dos Santos and Zadrozny (2014) for POS Tagging, we achieve state-of-the-art results for both corpora. For the HAREM I corpus, CharWNN outperforms the state-of-the-art system by 7.9 points in the F1-score for the total scenario (ten NE classes), and by 7.2 points in the F1 for the selective scenario (five NE classes). This is a remarkable result for a NER system that uses only automatically learned features.

This work is organized as follows. In Section 2, we briefly describe the CharWNN architecture. Section 3 details our experimental setup and Section 4 discuss our experimental results. Section 6 presents our final remarks.

CharWNN

CharWNN extends Collobert et al.’s (2011) neural network architecture for sequential classification by adding a convolutional layer to extract character-level representations [dos Santos and Zadrozny, 2014]. Given a sentence, the network gives for each word a score for each class (tag) τT\tau\in T. As depicted in Figure 1, in order to score a word, the network takes as input a fixed-sized window of words centralized in the target word. The input is passed through a sequence of layers where features with increasing levels of complexity are extracted. The output for the whole sentence is then processed using the Viterbi algorithm [Viterbi, 1967] to perform structured prediction. For a detailed description of the CharWNN neural network we refer the reader to [dos Santos and Zadrozny, 2014].

The character-level embedding of each word is computed using a convolutional layer [Waibel et al., 1989, Lecun et al., 1998]. In Figure 1, we illustrate the construction of the character-level embedding for the word Bennett, but the same process is used to construct the character-level embedding of each word in the input. The convolutional layer first produces local features around each character of the word, and then combines them using a max operation to create a fixed-sized character-level embedding of the word.

The convolutional layer computes the jj-th element of the vector rwchr^{wch}, which is the character-level embedding of ww, as follows:

Matrices WchrW^{chr} and W0W^{0}, and vector b0b^{0} are parameters to be learned. The size of the character vector dchrd^{chr}, the number of convolutional units clucl_{u} (which corresponds to the size of the character-level embedding of a word), and the size of the character context window kchrk^{chr} are hyperparameters.

2 Scoring and Structured Inference

We follow Collobert et al.’s [Collobert et al., 2011] window approach to score all tags TT for each word in a sentence. This approach follows the assumption that in sequential classification the tag of a word depends mainly on its neighboring words. Given a sentence with NN words {w1,w2,...,wN}\{w_{1},w_{2},...,w_{N}\}, which have been converted to joint word-level and character-level embedding {u1,u2,...,uN}\{u_{1},u_{2},...,u_{N}\}, to compute tag scores for the nn-th word wnw_{n} in the sentence, we first create a vector rr resulting from the concatenation of a sequence of kwrdk^{wrd} embeddings, centralized in the nn-th word:

We use a special padding token for the words with indices outside of the sentence boundaries.

Next, the vector rr is processed by two usual neural network layers, which extract one more level of representation and compute the scores:

Like in [Collobert et al., 2011], CharWNN uses a prediction scheme that takes into account the sentence structure. The method uses a transition score AtuA_{tu} for jumping from tag tTt\in T to uTu\in T in successive words, and a score A0tA_{0t} for starting from the tt-th tag. Given the sentence [w]1N={w1,w2,...,wN}[w]_{1}^{N}=\{w_{1},w_{2},...,w_{N}\}, the score for tag path [t]1N={t1,t2,...,tN}[t]_{1}^{N}=\{t_{1},t_{2},...,t_{N}\} is computed as follows:

where s(wn)tns(w_{n})_{t_{n}} is the score given for tag tnt_{n} at word wnw_{n} and θ\theta is the set of all trainable network parameters (Wwrd,Wchr,W0,b0,W1,b1,W2,b2,A)\left(W^{wrd},W^{chr},W^{0},b^{0},W^{1},b^{1},W^{2},b^{2},A\right). After scoring each word in the sentence, the predicted sequence is inferred with the Viterbi algorithm.

3 Network Training

We train CharWNN by minimizing a negative likelihood over the training set DD. In the same way as in [Collobert et al., 2011], we interpret the sentence score (3) as a conditional probability over a path. For this purpose, we exponentiate the score (3) and normalize it with respect to all possible paths. Taking the log, we arrive at the following conditional log-probability:

The log-likelihood in Equation 4 can be computed efficiently using dynamic programming [Collobert, 2011]. We use stochastic gradient descent (SGD) to minimize the negative log-likelihood with respect to θ\theta. We use the backpropagation algorithm to compute the gradients of the neural network. We implemented CharWNN using the Theano library [Bergstra et al., 2010].

Experimental Setup

The word embeddings used in our experiments are initialized by means of unsupervised pre-training. We perform pre-training of word-level embeddings using the skip-gram NN architecture [Mikolov et al., 2013] available in the word2vec http://code.google.com/p/word2vec/ tool.

In our experiments on Portuguese NER, we use the word-level embeddings previously trained by [dos Santos and Zadrozny, 2014]. They have used a corpus composed of the Portuguese Wikipedia, the CETENFolhahttp://www.linguateca.pt/cetenfolha/ corpus and the CETEMPublicohttp://www.linguateca.pt/cetempublico/ corpus.

In our experiments on Spanish NER, we use the Spanish Wikipedia. We process the Spanish Wikipedia corpus using the same steps used by [dos Santos and Zadrozny, 2014]: (1) remove paragraphs that are not in Spanish; (2) substitute non-roman characters by a special character; (3) tokenize the text using a tokenizer that we have implemented; (4) remove sentences that are less than 20 characters long (including white spaces) or have less than 5 tokens; (5) lowercase all words and substitute each numerical digit by a 0. The resulting corpus contains around 450 million tokens.

Following [dos Santos and Zadrozny, 2014], we do not perform unsupervised learning of character-level embeddings. The character-level embeddings are initialized by randomly sampling each value from an uniform distribution: U(r,r)\mathcal{U}\left(-r,r\right), where r=6Vchr+dchrr=\sqrt{\dfrac{6}{|V^{chr}|+d^{chr}}}.

2 Corpora

We use the corpus from the first HAREM evaluation [Santos and Cardoso, 2007] in our experiments on Portuguese NER. This corpus is annotated with ten named entity categories: Person (PESSOA), Organization (ORGANIZACAO), Location (LOCAL), Value (VALOR), Date (TEMPO), Abstraction (ABSTRACCAO), Title (OBRA), Event (ACONTECIMENTO), Thing (COISA) and Other (OUTRO). The HAREM corpus is already divided into two subsets: First HAREM and MiniHAREM. Each subset corresponds to a different Portuguese NER contest. In our experiments, we call HAREM I the setup where we use the First HAREM corpus as the training set and the MiniHAREM corpus as the test set. This is the same setup used by dos Santos and Milidiú (2012). Additionally, we tokenize the HAREM corpus and create a development set that comprises 5% of the training set. Table 1 present some details of this dataset.

In our experiments on Spanish NER we use the SPA CoNLL-2002 Corpus, which was developed for the CoNLL-2002 shared task [Tjong Kim Sang, 2002]. It is annotated with four named entity categories: Person, Organization, Location and Miscellaneous. The SPA CoNLL-2002 corpus is already divided into training, development and test sets. The development set has characteristics similar to the test corpora.

We treat NER as a sequential classification problem. Hence, in both corpora we use the IOB2 tagging style where: O, means that the word is not a NE; B-X is used for the leftmost word of a NE type X; and I-X means that the word is inside of a NE type X. The IOB2 tagging style is illustrated in the following example.

Wolff//B-PER ,//O currently//O a//O journalist//O in//O Argentina//B-LOC ,//O played//O with//O Del//B-PER Bosque//I-PER in//O the//O final//O years//O of//O the//O seventies//O in//O Real//B-ORG Madrid//I-ORG

3 Model Setup

In most of our experiments, we use the same hyperparameters used by dos Santos and Zadrozny (2014) for part-of-speech tagging. The only exception is the learning rate for SPA CoNLL-2002, which we set to 0.005 in order to avoid divergence. The hyperparameter values are presented in Table 2. We use the development sets to determine the number of training epochs, which is six for HAREM and sixteen for SPA CoNLL-2002.

We compare CharWNN with two similar neural network architectures: CharNN and WNN. CharNN is equivalent to CharWNN without word embeddings, i.e., it uses character-level embeddings only. WNN is equivalent to CharWNN without character-level embeddings, i.e., it uses word embeddings only. Additionally, in the same way as in [Collobert et al., 2011], we check the impact of adding to WNN two handcrafted features that contain character-level information, namely capitalization and suffix. The capitalization feature has five possible values: all lowercased, first uppercased, all uppercased, contains an uppercased letter, and all other cases. We use suffix of size three. In our experiments, both capitalization and suffix embeddings have dimension five. The hyperparameters values for these two NNs are shown in Table 2.

Experimental Results

In Table 3, we report the performance of different NNs for the SPA CoNLL-2002 corpus. All results for this corpus were computed using the CoNLL-2002 evaluation scripthttp://www.cnts.ua.ac.be/conll2002/ner/bin/conlleval.txt. CharWNN achieves the best precision, recall and F1 in both development and test sets. For the test set, the F1 of CharWNN is 3 points larger than the F1 of the WNN that uses two additional handcrafted features: suffixes and capitalization. This result suggests that, for the NER task, the character-level embeddings are as or more effective as the two character-level features used in WNN. Similar results were obtained by dos Santos and Zadrozny (2014) in the POS tagging task.

In the two last lines of Table 3 we can see the results of using word embeddings and character-level embeddings separately. Both, WNN that uses word embeddings only and CharNN, do not achieve results competitive with the results of the networks that jointly use word-level and character-level information. This is not surprising, since it is already known in the NLP community that jointly using word-level and character-level features is important to perform named entity recognition.

In Table 4, we compare CharWNN results with the ones of a state-of-the-art system for the SPA CoNLL-2002 Corpus. This system was trained using AdaBoost and is described in [Carreras et al., 2002]. It employs decision trees as a base learner and uses handcrafted features as input. Among others, these features include gazetteers with people names and geographical location names. The AdaBoost based system divide the NER task into two intermediate sub-tasks: NE identification and NE classification. In the first sub-task, the system identifies NE candidates. In the second sub-task, the system classifies the identified candidates. In Table 4, we can see that even using only automatically learned features, CharWNN achieves state-of-the-art results for the SPA CoNLL-2002. This is an impressive result, since NER is a challenging task to perform without the use of gazetteers.

2 Results for Portuguese NER

In Table 5, we report the performance of different NNs for the HAREM I corpus. The results in this table were computed using the CoNLL-2002 evaluation script. We report results in two scenarios: total and selective. In the total scenario, all ten categories are taken into account when scoring the systems. In the selective scenario, only five chosen categories (Person, Organization, Location, Date and Value) are taken into account. We can see in Table 5, that CharWNN and WNN that uses two additional handcrafted features have similar results. We think that by increasing the training data, CharWNN has the potential to learn better character embeddings and outperform WNN, like happens in the SPA CoNLL-2002 corpus, which is larger than the HAREM I corpus. Again, CharNN and WNN that uses word embeddings only, do not achieve results competitive with the results of the networks that jointly use word-level and character-level information.

In order to compare CharWNN results with the one of the state-of-the-art system, we report in tables 6 and 7 the precision, recall, and F1 scores computed with the evaluation scripts from the HAREM I competitionhttp://www.linguateca.pt/primeiroHAREM/harem_Arquitectura.html [Santos and Cardoso, 2007], which uses a scoring strategy different from the CoNLL-2002 evaluation script.

In Table 6, we compare CharWNN results with the ones of ETLCMT, a state-of-the-art system for the HAREM I Corpus [dos Santos and Milidiú, 2012]. ETLCMT is an ensemble method that uses Entropy Guided Transformation Learning (ETL) as the base learner. The ETLCMT system uses handcrafted features like gazetteers and dictionaries as well as the output of other NLP tasks such as POS tagging and noun phrase (NP) chunking. As we can see in Table 6, CharWNN outperforms the state-of-the-art system by a large margin in both total and selective scenarios, which is an remarkable result for a system that uses automatically learned features only.

In Table 7, we compare CharWNN results by entity type with the ones of ETLCMT. These results were computed in the selective scenario. CharWNN produces a much better recall than ETLCMT for the classes LOC, PER and ORG. For the ORG entity, the improvement is of 21 points in the recall. We believe that a large part of this boost in the recall is due to the unsupervised pre-training of word embeddings, which can leverage large amounts of unlabeled data to produce reliable word representations.

3 Impact of unsupervised pre-training of word embeddings

In Table 8 we assess the impact of unsupervised pre-training of word embeddings in CharWNN performance for both SPA CoNLL-2002 and HAREM I (selective). The results were computed using the CoNLL-2002 evaluation script. For both corpora, CharWNN results are improved when using unsupervised pre-training. The impact of unsupervised pre-training is larger for the HAREM I corpus (13.2 points in the F1) than for the SPA CoNLL-2002 (4.3 points in the F1). We believe one of the main reasons of this difference in the impact is the training set size, which is much smaller in the HAREM I corpus.

Related Work

Some recent work on deep learning for named entity recognition include Chen et al. [Chen et al., 2010], Collobert et al. [Collobert et al., 2011] and Passos et al. [Passos et al., 2014].

Chen et al. [Chen et al., 2010] employ deep belief networks (DBN) to perform named entity categorization. In their system, they assume that the boundaries of all the entity mentions were previously identified, which makes their task easier than the one we tackle in this paper. The input for their model is the character-level information of the entity to be classified. They apply their system for a Chinese corpus and achieve state-of-the-art results for the NE categorization task.

Collobert et al. [Collobert et al., 2011] propose a deep neural network which is equivalent to the WNN architecture described in Section 3.3. They achieve state-of-the-art results for English NER by adding a feature based on gazetteer information.

Passos et al. [Passos et al., 2014] extend the Skip-Gram language model [Mikolov et al., 2013] to produce phrase embeddings that are more suitable to be used in a linear-chain CRF to perform NER. Their linear-chain CRF, which also uses additional handcrafted features such as gazetteer based, achieves state-of-the-art results on two English corpora: CoNLL 2003 and Ontonotes NER.

The main difference between our approach and the ones proposed in previous work is the use of neural character embeddings. This type of embedding allows us to achieve state-of-the-art results for the full task of identifying and classifying named entities using only features automatically learned. Additionally, we perform experiments with two different languages, while previous work focused in one language.

Conclusions

In this work we approach language-independent NER using a DNN that employs word- and character-level embeddings to perform sequential classification. We demonstrate that the same DNN which was successfully applied for POS tagging can also achieve state-of-the-art results for NER, using the same hyperparameters, and without any handcrafted features. Moreover, we shade some light on the contribution of neural character embeddings for NER; and define new state-of-the-art results for Portuguese and Spanish NER.

References