# On the Use of Parsing for Named Entity Recognition
## 2 Named Entity Recognition
### NER as a Sequence Labeling Task  
_Sequence labeling_ (also known as sequence tagging) is a type of classification task where the input is a sequence of observed values and the output is a categorical label for each member of the sequence. Sequence labeling has long been used to model and solve NLP tasks, where the input values are typically words, although, depending on the task, they can also be smaller units like individual characters [26] or larger units like sentences [27]. To a certain extent, in the context of NLP, sequence labeling can be considered analogous to a software-engineering design pattern [28], since it provides a template of how to solve a problem that can be reused and adapted to different tasks. It is worth clarifying that sequence labeling models are not to be confused with sequence-to-sequence (seq2 seq) models [29]. The main difference is that while sequence labeling models assign exactly one categorical label to each word of the sentence, seq2 seq models generate another sequence as output, which can be of arbitrary length. This means that seq2 seq models can be used for tasks that do not fit the sequence labeling framework, such as machine translation. Unfortunately, it also means that seq2 seq models require more complex architectures to run (with the use of neural attention being a must) and are significantly slower. Part-of-Speech (PoS) tagging is probably the most archetypical example of sequence labeling applied to NLP, because the task itself is defined as assigning one label (a part of speech, such as verb or noun) to each element (word) in a sequence. Thus, any implementation of PoS tagging could be said, by definition, to be performing a form of sequence labeling, although pioneering implementations [30] were task-specific (as well as language- and tagset-specific), since they were based on handwritten rules. However, more modern approaches feature trainable models that learn the correspondence between words and tags in context as a supervised learning problem, and thus are instantiations of true generic sequence labeling models, applied to the particular task of PoS tagging. These include early statistical taggers [31], trainable rule-based taggers [32], Hidden Markov Model (HMM) taggers [33], maximum-entropy taggers [34] and, lately, deep learning approaches [35]. Chunking, sometimes referred to as shallow parsing, was incorporated into the sequence labeling paradigm in the mid 90s. This task consists in finding relevant phrases (typically, verb, noun and/or prepositional phrases) in a text. While early approaches were ad hoc [36], the problem was reformulated as a tagging problem by [PERSON] and [PERSON] [37], who introduced an encoding scheme called IOB (or BIO) tagging. In this approach each word is assigned a tag \"I\", \"O\" or \"B\" depending on whether it occurs \"Inside,\" \"Outside,\" or at the \"Beginning\" of a chunk. Since then, most approaches to chunking, including machine learning approaches [38] and more recent deep learning approaches [39], have used the IOB tagging scheme or variants of it. Advances in machine learning (and in particular, new architectures for sequence labeling) have made it possible to apply the pattern to a wider range of tasks. In this line, after the introduction of Conditional Random Fields (CRF) [40] and the averaged perceptron [41], sequence labeling was applied to model a broader spectrum of problems. In sentiment analysis, [PERSON] et al. [42] used a CRF architecture for opinion source extraction, while [PERSON] and [PERSON] [43] did so for opinion target extraction. In shallow discourse parsing, [PERSON] et al. [44] used a sequence labeling model to extract arguments, given discourse connectives; and in question answering, [PERSON] et al. [45] presented the first sequence labeling approach to answer extraction. All of these approaches obtained competitive results at their time and were based in IOB tagging or variants thereof.