Understanding sequence tagging in Flair
Before diving straight into how to use sequence taggers in Flair, let's first briefly explain how sequence tagging (also known as sequence labeling) works. From an engineering point of view, a sequence tagger is a tool that receives text as input and returns a list of assignments, where each assignment includes a tag name and a span indicating where the annotated unit of text (usually a word) begins and ends.
The architecture and design of sequence labeling in Flair can best be explained with the following diagram:
The preceding diagram displays the sequence tagging architecture consisting of two components: the language model (in yellow) and the sequence tagging (labeling) model (in blue). The bidirectional character language model receives the original text as input and computes contextual embeddings () for each word. These are then passed into a BiLSTM...