Boosting Named Entity Recognition with Neural Character Embeddings

Most state-of-the-art named entity recognition (NER) systems rely on handcrafted features and on the output of other NLP tasks such as part-of-speech (POS) tagging and text chunking. In this work we propose a language-independent NER system that uses automatically learned features only. Our approach is based on the CharWNN deep neural network, which uses word-level and character-level representations (embeddings) to perform sequential classification. We perform an extensive number of experiments using two annotated corpora in two different languages: HAREM I corpus, which contains texts in Portuguese; and the SPA CoNLL-2002 corpus, which contains texts in Spanish. Our experimental results shade light on the contribution of neural character embeddings for NER. Moreover, we demonstrate that the same neural network which has been successfully applied to POS tagging can also achieve state-of-the-art results for language-independet NER, using the same hyperparameters, and without any handcrafted features. 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).


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 languageindependent 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 out-performs 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 .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).

Word-and Character-level Embeddings
As illustrated in Figure 1, the first layer of the network transforms words into real-valued feature vectors (embeddings).These embeddings are meant to capture morphological, syntactic and semantic information about the words.We use a fixed-sized word vocabulary V wrd , and we consider that words are composed of characters from a fixed-sized character vocabulary V chr .Given a sentence consisting of N words {w 1 , w 2 , ..., w N }, every word w n is converted into a vector u n = [r wrd ; r wch ], which is composed of two subvectors: the word-level embedding r wrd ∈ R d wrd and the character-level embedding r wch ∈ R clu of w n .While word-level embeddings capture syntactic and semantic information, character-level embeddings capture morphological and shape information.
Word-level embeddings are encoded by column vectors in an embedding matrix W wrd ∈ R d wrd ×|V wrd | , and retrieving the embedding of a particular word consists in a simple matrix-vector multiplication.The matrix W wrd is a parameter to be learned, and the size of the word-level embedding d wrd is a hyperparameter to be set by the user.
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.
Given a word w composed of M characters {c 1 , c 2 , ..., c M }, we first transform each character c m into a character embedding r chr m .Character embeddings are encoded by column vectors in the embedding matrix W chr ∈ R d chr ×|V chr | .Given a character c, its embedding r chr is obtained by the matrix-vector product: r chr = W chr v c , where v c is a vector of size V chr which has value 1 at index c and zero in all other positions.The input for the convolutional layer is the sequence of character embeddings {r chr 1 , r chr 2 , ..., r chr M }.The convolutional layer applies a matrixvector operation to each window of size k chr of successive windows in the sequence {r chr 1 , r chr 2 , ..., r chr M }.Let us define the vector z m ∈ R d chr k chr as the concatenation of the character embedding m, its (k chr − 1)/2 left neighbors, and its (k chr − 1)/2 right neighbors: The convolutional layer computes the j-th element of the vector r wch , which is the character-level embedding of w, as follows: where W 0 ∈ R clu×d chr k chr is the weight matrix of the convolutional layer.The same matrix is used to extract local features around each character window of the given word.Using the max over all character windows of the word, we extract a fixedsized feature vector for the word.Matrices W chr and W 0 , and vector b 0 are parameters to be learned.The size of the character

Scoring and Structured Inference
We follow Collobert et al.'s (Collobert et al., 2011) window approach to score all tags T 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 N words {w 1 , w 2 , ..., w N }, which have been converted to joint word-level and character-level embedding {u 1 , u 2 , ..., u N }, to compute tag scores for the n-th word w n in the sentence, we first create a vector r resulting from the concatenation of a sequence of k wrd embeddings, centralized in the n-th word: We use a special padding token for the words with indices outside of the sentence boundaries.
Next, the vector r is processed by two usual neural network layers, which extract one more level of representation and compute the scores: where matrices W 1 ∈ R hlu×k wrd (d wrd +clu) and W 2 ∈ R |T |×hlu , and vectors b 1 ∈ R hlu and b 2 ∈ R |T | are parameters to be learned.The transfer function h(.) is the hyperbolic tangent.The size of the context window k wrd and the number of hidden units hl u are hyperparameters to be chosen by the user.Like in (Collobert et al., 2011), CharWNN uses a prediction scheme that takes into account the sentence structure.The method uses a transition score A tu for jumping from tag t ∈ T to u ∈ T in successive words, and a score A 0t for starting from the t-th tag.Given the sentence where s(w n ) tn is the score given for tag t n at word w n and θ is the set of all trainable network parameters After scoring each word in the sentence, the predicted sequence is inferred with the Viterbi algorithm.

Network Training
We train CharWNN by minimizing a negative likelihood over the training set D. 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 loglikelihood with respect to θ.We use the backpropagation algorithm to compute the gradients of the neural network.We implemented CharWNN using the Theano library (Bergstra et al., 2010).

Unsupervised Learning of Word Embeddings
The word embeddings used in our experiments are initialized by means of unsupervised pretraining.
We perform pre-training of wordlevel embeddings using the skip-gram NN architecture (Mikolov et al., 2013) available in the word2vec1 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 CETENFolha2 corpus and the CETEMPublico3 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 characterlevel embeddings.The character-level embeddings are initialized by randomly sampling each value from an uniform distribution: U (−r, r),

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 (ORGANIZA-CAO), 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.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 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.

Results for Spanish NER
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 script 4 .CharWNN achieves the 4 http://www.cnts.ua.ac.be/conll2002/ner/bin/conlleval.txtbest 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 characterlevel 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 characterlevel 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 stateof-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.

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 eval- uation 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 characterlevel 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 competition 5 (Santos and Cardoso, 5 http://www.linguateca.pt/primeiroHAREM/haremAr-2007), which uses a scoring strategy different from the CoNLL-2002 evaluation script.
In Table 6, we compare CharWNN results with the ones of ETL CM T , a state-of-the-art system for the HAREM I Corpus (dos Santos and Milidiú, 2012).ETL CM T is an ensemble method that uses Entropy Guided Transformation Learning (ETL) as the base learner.The ETL CM T 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 ETL CM T .These results were computed in the selective scenario.CharWNN produces a much better recall than ETL CM T for the classes LOC, PER and ORG.For the ORG entity, the improvement is of 21 points quitectura.html2010) 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. (2011) propose a deep neural network which is equivalent to the WNN architecture described in Section 3.3.They achieve stateof-the-art results for English NER by adding a feature based on gazetteer information.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,

Table 2
. We use the development sets to determine the number of training epochs, which is six for HAREM and sixteen for SPACoNLL-2002.

Table 3 :
Comparison of different NNs for the SPA CoNLL-2002 corpus.

Table 4 :
Comparison with the state-of-the-art for the SPA CoNLL-2002 corpus.

Table 5 :
Comparison of different NNs for the HAREM I corpus.

Table 6 :
Comparison with the State-of-the-art for the HAREM I corpus.

Table 8 :
Impact of unsup.pre-training of word emb. in CharWNN performance.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.