FLAIR: An Easy-to-Use Framework for State-of-the-Art NLP
Paper · 2019 · Alan Akbik, Tanja Bergmann, Duncan Blythe et al.
Summary
A word can be represented by a vector looked up in a file, by features computed from its spelling, or by a vector that changes with the sentence in which it appears. Before FLAIR, switching between these approaches could require changes to the neural network that used them. The authors asked whether a researcher could change what goes into a sequence tagger or text classifier without rebuilding the connection between the representation and the task. They present FLAIR, an open-source Python framework built on PyTorch, with a common way to request word embeddings.
FLAIR represents text with sentence and token objects. An embedding component takes a sentence or a list of sentences and supplies vectors at the appropriate level. A conventional component can put a GloVe vector on each token. A contextual component can read the surrounding text before assigning its vectors. A stack takes several such components and can be called in the same way as an individual one. For tasks that need a representation of a complete text, FLAIR can pool the word vectors or process their sequence with a recurrent network.
The framework also handles much of the work around an experiment. A fetcher retrieves supported public datasets and reads them into corpora with training, development, and test partitions. The availability of automatic downloads depends on the dataset’s licence. A shared trainer handles operations such as batching, saving checkpoints, adjusting the learning rate, and recording evaluations. Its integration with Hyperopt uses development data for tuning by default, leaving the test data available for the final assessment.
A collection of pretrained resources supports another route through the framework. Users can load a tagger or classifier for immediate prediction or adapt an existing predictor to another use case. The paper describes single-language versions intended for GPU use, smaller versions intended for CPUs, and multilingual versions for selected tasks. In the worked tagging example, the result goes back onto the tokens of the sentence the user supplied.
The authors recommend stacking conventional word vectors with Flair embeddings and point to their earlier sequence-labeling research for the comparison behind that choice. The demonstration reports no new benchmark scores. What it shows is how different representations can enter the same task code, how experiments can use a common training workflow, and how trained predictors can be loaded and applied through the same text objects. The contribution is a practical way to bring those activities together in natural language processing.
Deep dive: FLAIR: An Easy-to-Use Framework for State-of-the-Art NLP
FLAIR gives word and document embeddings a common interface and brings dataset loading, training, tuning, and pretrained NLP tools together. · about 32 minutes to read
The problem and its context
The simplicity of a lookup
Consider a tagger about to decide whether a word names a person or a place. Before it can make that decision, the word must be put into a numerical form the tagger can use. With a conventional embedding, the basic operation is a lookup. A particular word form has an associated vector, and that representation is available to a new task even if the people building the tagger did not train the vectors themselves. The pattern is familiar from work on distributed word representations and GloVe.
The FLAIR authors identify a benefit on each side of this arrangement. The vectors bring information learned from unlabeled text, giving the downstream learner a starting point beyond its labeled examples. They also fit comfortably into a neural architecture. A researcher can use the pretrained vectors to initialize the part of the network responsible for representing words. Much of the work of producing the representations has already happened, and the downstream network can access them through its embedding layer.
A lookup has a particular relationship to the word it represents. Take a familiar spelling that can refer to different things. Each occurrence starts from the same lookup entry, even when the sentences point to different readings. This does not prevent the tagger itself from using the sentence to reach different decisions. It means the starting vector alone carries no distinction between those occurrences. A contextual embedding moves some of that work into the computation of the representation itself.
The paper uses Washington to make this point. In a sentence where the word functions as a surname, the contextual representation can differ from the one it receives when the sentence points to a location. The representation must therefore depend on more than the lookup key. The code needs access to an occurrence and its surroundings, and the vector becomes an output of processing that text. For integration purposes, that is a different operation from reading a row of stored numbers.
When spelling becomes another input
A different reason to go beyond lookup is that the letters of a word can provide information of their own. The representation can incorporate patterns within the form, including patterns shared across words. The paper situates this development alongside earlier work on subword information in word vectors.
The authors describe systems that learn character features directly on the downstream task. A character-level network reads the spelling and supplies a vector of features. A conventional word vector comes from another part of the network. The two outputs can then be concatenated, meaning that their coordinates are placed end to end so the downstream computation can use both. The paper points to earlier tagging architectures that use convolutional or recurrent networks for the character computation, including work on neural architectures for entity recognition and end-to-end sequence labeling.
There are two levels to this computation. At the inner level, a network works through the characters that make up a word. At the outer level, a task such as tagging works through the resulting word representations. The additional level makes sense for the task. It also creates an integration requirement. Someone must connect the character network, the lookup layer, and the part of the system that receives their combined output.
A general neural-network library can make it straightforward to define these operations. The paper’s concern is what happens on the next experiment. Trying a new representation can still entail changing the structure by which the task obtains its inputs. An experimenter interested in how much spelling helps may therefore have to alter the implementation of the tagger before that question can be investigated. The authors view those repeated changes as a software responsibility that can be moved into the representation component.
When the same spelling needs different vectors
Contextual representations bring a related integration problem with a different source of information. A trained language model processes text and produces internal states that another task can use as features. In the authors’ account, earlier systems obtained those states from the language component and joined them to the output of a conventional embedding layer. The new features were useful, especially in combinations, but the downstream architecture had to receive and assemble them.
The paper places its own earlier work among several examples of this shift. ELMo illustrates contextual word representations, while the earlier Flair research obtains contextual features through character-level processing. BERT is also cited as a contextual approach. For the framework argument, the common feature is that the vector for a word can be derived from processing the text in which it occurs. The earlier publications supply the representation methods. ELMo, Contextual String Embeddings, BERT.
A useful way to see the design problem is to follow the word spans through these earlier arrangements. The lookup component cares about the words as keys. The character component needs access to the contents of each word. The contextual component needs text that extends beyond any individual word. Eventually their outputs all have to be available at word positions if they are to be used by a sequence tagger. The computations begin with different views of the text and meet at a common destination.
FLAIR places the interface at that destination. A caller gives the representation component a sentence, which contains the individual words and preserves their sequence. Each component can take what it needs from that object. The tagger can then deal with the representations associated with the words. The design allows the two pieces of code to deal with the text at different levels of detail.
This is particularly relevant to sequence labeling, the task of assigning annotations along a sequence. A part-of-speech tagger, for instance, indicates grammatical categories at word positions. An entity recognizer identifies text referring to entities and supplies categories for the recognized material. Both need the connection from a word position to features at that position, although their answers describe different properties of the text. The paper’s examples include part-of-speech tagging and named entity recognition.
The work around a representation experiment
Choosing a representation is only part of setting up a task. A researcher also needs annotated examples in a form the code can read. Some examples fit the predictor, others guide choices during development, and a reserved set supports final evaluation. Those roles have to survive the transition from benchmark files on disk to objects consumed by the program.
Training brings a further set of recurring operations. The program has to deliver groups of examples to the learner, store its progress, and record the results of evaluation. Someone experimenting with a new representation may need to repeat this process across several settings. Meanwhile, a user who already has a suitable trained predictor needs a way to obtain it and apply it to text. These activities motivated the surrounding parts of FLAIR. The paper introduces the corpus and loading facilities, the training utilities, and the pretrained collection as parts of the same workflow.
The authors thus address two practical scales of reuse. At the smaller scale, a feature component can serve more than one downstream task without the integration being written again for each task. At the larger scale, several experiments can draw on the same data and training infrastructure. The parts meet in the sentence and corpus objects. They give the framework a way to carry text from its source to feature computation, learning, and prediction.
The method, step by step
Start with the text the task will annotate
The paper’s examples begin with a brief sentence expressing affection for Berlin. At this point it is simply a Sentence, with its words represented by Token objects. The classes for the core linguistic objects are ordinary classes rather than tensors. The individual token has fields for annotations such as grammatical or entity tags, along with fields for embeddings in different spaces. From the perspective of a user inspecting the object, the text and its associated information stay together.
This separation between the linguistic object and its numerical contents gives the framework room to do different things with the same input. The sentence preserves word order and supplies an identifiable place for each word’s information. A numerical operation can then produce vectors and put them on those positions. A prediction operation can add tags to the positions where they belong. Neither operation needs the user to bring a separate representation of the text for its own exclusive use.
For a newcomer, the important distinction is between a tag and an embedding. A tag names a property the task cares about, such as an entity category. An embedding gives the computational system a vector of features it can use to make a prediction. The vector can come from another resource and need never be interpreted coordinate by coordinate by the user. Both are associated with the word, but they enter the workflow at different points.
The distinction also clarifies the relationship between token and sentence objects. A component may need the sentence as its input in order to compute meaningful features. Its results can still belong to individual words. Context is part of what the component reads. The token position identifies where its output goes.
How FLAIR organizes a downstream experiment
The steps in order.
The last stages describe an experiment with training and selection. The paper’s demonstration with a pretrained tagger starts from a sentence and loads a completed predictor, so the user need not take the corpus and training route simply to obtain an annotation.
Ask for the representation through a common operation
An embedding class implements either TokenEmbedding or DocumentEmbedding. These are the contracts for word-level and document-level representations. Both define .embed(), which takes a Sentence or a list of sentences. An implementation supplies vectors in its own embedding space, the numerical representation determined by the chosen method.
The receiving code needs to know whether it requires a representation per word or a representation for the complete input. Within the corresponding level, it can ask for different representations through the same operation. For a token provider, the contract gives the result a consistent destination at each token. For a document provider, the result describes the full text being embedded. The shared verb describes the caller’s action, while the interface type identifies the scope of the output.
The conventional vector example makes the call concrete. The authors choose a GloVe resource through WordEmbeddings. The class looks for the requested data on disk, downloads it if necessary, and attaches the vectors to the sentence’s tokens. The demonstration puts this resource handling inside the embedding class. The user works with the original sentence and the chosen resource, without first having to construct a vocabulary from the experimental corpus or give the words one-hot encodings. A one-hot encoding would assign a separate numerical position to each item in a vocabulary, with only the item’s own position active.
The simplicity of that example partly reflects the nature of a pretrained lookup. The stored vectors are already available when it is time to represent the sentence. The paper names FastText as another conventional option. Choosing between such resources affects the representations attached to the words, while the application still obtains them through WordEmbeddings.
The BERT example exercises the same operation with a different kind of provider. The authors instantiate BertEmbeddings and apply it to a sentence. The contextual computation belongs inside the embedding class. The caller can use substantially the same interaction as for GloVe, although the way the vectors are generated is different. These examples demonstrate the boundary from either side. A relatively simple resource and a contextual computation both leave the application with the kind of object it already knows how to pass on.
Read the inventory in terms of information and training
The inventory includes CharacterEmbeddings for features derived from spelling and BytePairEmbeddings for pretrained sub-word representations. With a sub-word representation, units inside a written word contribute to its features. The inventory identifies BPEmb as the work associated with the byte-pair option. For understanding the framework, the important relation is that this provider can work with smaller units internally while participating in the word-level embedding interface. Subword tokenization, BPEmb.
FlairEmbeddings supplies contextual features from a character-level language component. PooledFlairEmbeddings is the pooled version associated with the authors’ companion research on entity recognition. The framework paper names that representation and its implementation class and gives it a place in the same inventory as other token providers. The pooling rule for that representation is a subject of the cited work. Pooled Contextualized Embeddings.
The inventory also includes ELMoEmbeddings and ELMoTransformerEmbeddings, with both described as deriving features from word-level processing. The transformer version is listed separately. The presence of multiple contextual providers matters to the framework because contextuality is a property of the produced features, while the common interface concerns how the task asks for them. Providers can share the former property without using the same architecture to arrive there. Dissecting Contextual Word Embeddings.
The classes differ in how they come to have useful parameters. The inventory marks CharacterEmbeddings as lacking pretraining. The character component can learn as part of fitting the downstream task. Conventional word vectors and the listed contextual word resources have pretraining. The paper’s note on the inventory explains that embedding components requiring learning can be fitted or adjusted during downstream training. A uniform way of calling components is compatible with more than one training arrangement.
This is worth following through a concrete use. A conventional vector may already encode information obtained on unlabeled text. A character component can acquire features in response to the labeled task examples. When both are present, they contribute at the same word position, even though their learning histories differ. A downstream system can use these features together because they share a destination. The framework inventory tells the experimenter which components bring pretrained information and which rely on learning within that workflow.
Put several sources behind the same call
StackedEmbeddings is constructed from a list of embedding components. Once assembled, it exposes the usual embedding operation. At a word position, the stack makes the constituent representations available together. This expresses the combination that earlier architectures implemented by concatenating outputs from separate parts of a network.
Imagine a tagging experiment that begins with conventional word vectors and then asks whether information learned from spelling improves a tagger. With the FLAIR design, the feature configuration can change from a word-vector component to a stack containing that component and a character component. The tagging code can invoke the stack in the usual way. The added representation comes through the embedding side of the interface, where its computation and connection to each token are handled.
A change to the feature stack is still a change to the inputs on which the tagger learns. If a representation contributes additional coordinates, the input has a different size. A tagger built and fitted with the new representation can follow the same architectural pattern as its predecessor, while learning to use a different input. The paper’s claim is about reusing that pattern and its implementation when setting up the experiment. A trained predictor is tied to the representation arrangement with which its parameters were fitted.
The example of a conventional vector plus character features illustrates an arrangement already used in earlier research. The authors’ recommended stack is WordEmbeddings with FlairEmbeddings. In this case the inputs to a tagger include information from the conventional word resource and from the character-level contextual representation. The justification for choosing that stack in sequence labeling comes from the authors’ earlier evaluation. Here the emphasis is on making the configuration expressible using the normal embedding interface.
A consequence of the design is that the downstream task can depend on the composite in the same way it depends on an individual component. From a reader’s perspective, this is where FLAIR does more than give unrelated methods similar names. The framework provides an object representing a combination, and the task can make its ordinary request of that object. The combination does not have to be scattered through the code of the tagger or classifier.
Derive a vector for a complete text
Word representations are a natural place to start when the expected answers are aligned to words. A classification task can instead ask for a property of a complete text. A sentiment classifier, for instance, can produce an output about the text as a whole. FLAIR offers components that express a complete input as a vector derived from its word representations. Text classification.
DocumentPoolEmbeddings applies a pooling operation to the word vectors, with mean pooling given as an example. To understand that example, consider one coordinate of the vectors. The mean operation averages the values at that coordinate across the words, then does the same for the other coordinates. The resulting vector has information contributed by the whole text. Since averaging the same set of word vectors in a different order yields the same average, the pooling operation itself supplies no separate description of order. The inputs may already encode context, so that observation applies specifically to how fixed input vectors are combined.
DocumentLSTMEmbeddings processes the word vectors with a long short-term memory network, or LSTM, to obtain a document vector. An LSTM is a recurrent network. As it goes through a sequence it uses an internal state informed by the preceding computation. Word order therefore enters the operation by which the representation is produced. The framework paper describes the choice at that level. It does not specify a new recurrent algorithm or give an equation for extracting the document vector.
Both document components depend on word representations, but they transform those inputs differently. In the inventory, the pooling entry is marked as pretrained and the LSTM entry as lacking pretraining. The descriptions also make clear that pooling derives an aggregate from its word inputs. The inventory provides the status of the offered components and a general note on downstream training. It supplies no parameter-by-parameter account of which inputs are fixed during a particular classification run.
No mathematical formula is given for the embedding interfaces, the pooling example, or the training objective. The paper specifies the design through class roles, examples of calls, and descriptions of what is produced. The precise part of the method is the distribution of responsibilities, from the component that reads the text to the task that consumes the attached representation.
Bring the benchmark into the same object structure
The dataset example begins with the English treebank in Universal Dependencies. A treebank is a corpus annotated with grammatical structure. The framework allows the user to identify the English resource through a task identifier and ask NLPTaskDataFetcher for the corpus. The fetcher checks for the files locally and downloads them when they are missing and available for automatic retrieval.
The downloaded or locally available files are read into a TaggedCorpus. This object exposes training, development, and test partitions. The loader’s role is to make the data and those partitions available in a consistent form. The description gives no general sampling rule for dividing a previously unpartitioned collection. Its example concerns obtaining a named benchmark and loading it for use.
These partitions serve different moments in the experiment. The training partition supplies examples used in fitting. The development partition gives feedback while choosing settings. The test partition supplies examples for the final assessment. Keeping those roles visible in the corpus object connects data loading to the way the training and search utilities are intended to operate.
Automatic fetching has a practical boundary. The paper cites English and German CoNLL-03 as datasets that require licences and therefore cannot be obtained through the automatic downloader. This matters to interpreting the benchmark inventory. The framework can name a benchmark family in its description of data support while access to particular resources remains governed by separate terms.
Fit and select a downstream configuration
ModelTrainer provides a common training routine for task implementations conforming to flair.nn.Model. The authors identify sequence tagging and text classification as examples. The common interface lets the trainer handle responsibilities that recur even when the output changes from a sequence of tags to a category for the whole text.
The paper lists mini-batching, checkpointing, learning-rate annealing, evaluation, and logging. A mini-batch is a group of examples processed together during a training step. A checkpoint records an intermediate training state. Learning-rate annealing adjusts the size of parameter updates over training according to a schedule. Evaluation records how a predictor performs on data assigned to that purpose, and logging gives the run a record of its progress. These are facilities for running an experiment, while the downstream task provides the learning problem.
A hyper-parameter is a setting chosen for the training procedure or architecture. It differs from the individual parameter values obtained by fitting. When comparing hyper-parameter settings, an experimenter may train several configurations, examine their development results, and select one for final testing. FLAIR integrates Hyperopt to support this process. The paper names its Tree of Parzen Estimators approach, abbreviated TPE, without deriving the search algorithm.
The integration uses the development partition for hyper-parameter selection by default. Feedback from that data can therefore guide the search while the test partition remains held out. The selected configuration can then be evaluated using the reserved test data. This arrangement connects the experimenter’s choices to the already defined roles of the corpus partitions. The paper presents the default workflow without giving a fixed search budget or a task-specific search space.
The software is distributed as an open-source Python package, with its official source in the FLAIR repository. The publication states a minimum Python version of 3.6 and describes installation with the package manager, which also brings in dependencies such as PyTorch. This is the release setup described for the demonstration. The user-facing examples use the framework’s Python objects and classes to express the workflow.
Load a predictor when the learning has already been done
For immediate entity tagging, the authors use the framework’s SequenceTagger class to load the default English recognizer. On loading, the framework looks for the requested predictor on disk and downloads it if necessary. The user then supplies a sentence to the tagger’s prediction method. The entity output is put into the token objects, where it can be inspected alongside the input word forms.
In the demonstration, Berlin is assigned the entity type for a location. There is no need to prepare a training corpus for this use of a pretrained tagger. The example traces the application path from text to annotation, including where to find the result. It is also a concrete illustration of why the token objects carry places for tags as well as embeddings. Those fields serve different stages of the task.
The collection includes pretrained sequence taggers, classifiers, and language resources. It supports immediate use and also gives users starting points they may adapt to their own use cases through fine-tuning. The paper demonstrates immediate application. It describes adaptation as a further use of pretrained resources without presenting an adaptation run alongside the tagging example.
Experiments and results
What the demonstration evaluates
The paper presents implemented workflows and inventories. Its worked examples show a conventional embedding applied to a sentence, a contextual embedding requested through the same operation, and an English entity recognizer loaded and used to annotate text. These examples answer practical questions about compatibility. They show what the caller supplies, where representations or tags appear, and how particular resources are brought into use.
There is no new task benchmark behind the workflow examples. The paper reports no predictive metric on a train, development, or test split and gives no baseline score for a comparison with FLAIR. It also presents no measured comparison of FLAIR with another software framework. The discussion instead points to prior sequence-labeling research for the evidence behind the recommended word-vector and Flair stack. Preliminary multilingual evaluation is also referred to a separate publication. The figures below describe coverage and configuration as reported in the demonstration.
The Berlin example illustrates the scope of a successful prediction in this setting. It identifies the output for a particular place name in a short sentence and shows that the tag was attached to the corresponding token. That makes the tagging interface easier to understand. Generalization would require scored predictions on a collection with a specified metric and partition. Such a test would answer a different question from whether the call can be made and the output inspected.
The datasets available to the workflow
The benchmark inventory covers distinct kinds of annotated text. CoNLL 2000 is listed for English noun-phrase chunking. Chunking identifies phrase groups, and in this entry the groups of interest are noun phrases. The assignment is a sequence task because the predictor must recover groups from words in context. It gives the framework a use for token-level representations beyond assigning categories to individual named entities. CoNLL-2000 chunking.
Entity-recognition entries include EIEC for Basque, WNUT-17 for English, and WikiNER across 9 languages. These entries identify the tasks and languages covered by the inventory. They supply no per-language breakdown of the quantity of annotated material or performance on it. The table also names CoNLL 2003. As the authors explain in the discussion of licences, the English and German CoNLL-03 datasets are outside automatic acquisition. CoNLL-2003 entity recognition.
For classification, the inventory includes English IMDB, TREC-6, and TREC-50. IMDB is also used in the paper’s pretrained inventory for sentiment analysis. The TREC entries are classification resources, with the paper connecting TREC-50 to earlier work on classifying questions. These benchmarks exemplify why the framework has a representation path for complete texts. In this setting a label can concern the entire input. IMDB sentiment research, Learning Question Classifiers.
The Universal Dependencies entry covers 30 languages for part-of-speech tagging and parsing. Here the language count is attached to the data inventory. Parsing concerns the grammatical structure of a sentence, while part-of-speech tagging assigns grammatical categories to the words. The worked loading example instantiates the English case. The paper shows how the source becomes a corpus with defined partitions and provides no parsing score for any split. Dependency parsing, CoNLL 2018 multilingual parsing.
These examples give the dataset facility a concrete scope. A task identifier can give users access to benchmark text already organized in the object structure used by the rest of the framework. For some comparisons, that makes it practical to keep the loaded corpus constant while changing an embedding configuration. Turning that possibility into an empirical result would require running the configurations and reporting their evaluation. No such outcomes are included in the dataset inventory.
What can be loaded already trained
The pretrained inventory describes a different set of resources from the downloader. For CoNLL 2003 it lists 4-class entity recognition and names English, German, Dutch, and Spanish. Its WikiNER entry lists 4-class entity recognition for French. The English OntoNotes recognizer uses a 12-class scheme. The numbers describe how many entity categories the associated entries cover. A larger label inventory says nothing by itself about how reliably each category is predicted. OntoNotes.
Other entries include an English noun-phrase chunker associated with CoNLL 2000, a German offensive-language detector associated with GermEval 2018, and an English part-of-speech tagger associated with OntoNotes. The paper also lists semantic frame detection for English with PropBank and sentiment analysis for English with IMDB. Together, these examples show the range of outputs distributed through the framework, from annotations attached along a sentence to decisions covering a complete text.
The distribution choices vary by task. The paper lists default and fast versions for English noun-phrase chunking, for instance, and a default version for French WikiNER. The CoNLL entity-recognition entry describes default, fast, and multilingual variants. The inventory identifies the choices at the level of its entries. It does not give separate settings and evaluation scores for every possible combination of language, task, and variant.
Universal part-of-speech tagging appears as a multilingual entry. The paper describes a single predictor capable of supplying universal tags in 12 languages. In this context, multilingual indicates that the same trained system handles text from multiple languages. The 12 languages quantify the stated scope of that offering. The 30 languages in the dataset inventory quantify the reach of the Universal Dependencies data entry for tagging and parsing. The inventories answer different questions about the package and can be read independently.
The paper refers readers to its associated research on multilingual sequence labeling for preliminary evaluation numbers. The demonstration therefore establishes that the multilingual option is part of the collection and identifies its scope. It gives no accuracy or per-language results for choosing between it and the single-language offerings.
Configuration of the default and fast variants
The default variants are single-language offerings intended for GPU use. The authors describe them as usually using embeddings drawn from language components with 2048 hidden states. The fast variants are designed for CPU use and typically use embeddings from components with 1024 hidden states. The stated sizes concern the internal representations associated with the embeddings. They are configuration figures for the two variant families.
Typical hidden-state counts for FLAIR default and fast variants
The CPU-oriented variant uses the smaller typical hidden-state configuration.
The numbers
| System or setting | hidden states |
|---|---|
| Default GPU variant | 2048 |
| Fast CPU variant (this paper) | 1024 |
Here the direction of the chart expresses smaller configuration size. Both variants belong to FLAIR. The comparison is independent of any one dataset or split because the paper gives typical settings across the variant families. The authors qualify the figures as typical, so the chart applies to the configurations they describe and does not specify every resource in the collection.
The paper describes the fast embeddings as computationally less demanding. The hidden-state counts give the reader a concrete difference underlying the packaging. No observed runtime, memory usage, or predictive score is supplied for a paired CPU and GPU comparison. A deployment choice can use the stated hardware orientation as a guide to the purpose of each offering, while an evaluation of costs and quality would need measurements in the intended environment.
Taken together, the examples and inventories support the paper’s claims at the level of an implemented framework. They connect names of resources to ways of obtaining and applying them. The evidence for the recommended sequence-labeling representation lies in the study cited for that comparison. None of the numerical coverage or configuration figures serve as a substitute for that evaluation.
What the ablations show
The paper reports no ablation study, in which a component would be removed and the changed system measured under comparable conditions, and instead demonstrates common calls for conventional and contextual embeddings, explains how stacking makes a combination callable through that interface, distinguishes typical hardware-oriented settings, and refers to earlier sequence-labeling work for the empirical comparison behind its recommended stack.
Limitations
Boundaries stated by the authors
The clearest stated boundary is on data acquisition. Automatic downloading is meant for publicly available resources, and the authors explicitly identify the English and German CoNLL-03 data as requiring licences. The framework descriptions of loading and partitioned corpora apply once the necessary data can be obtained. Obtaining permission and retrieving the licensed data remain separate from the automatic route demonstrated for the English Universal Dependencies treebank.
The authors describe both the list of embeddings and the scope of dataset support as open to expansion. In the outlook, they name additional transformer-derived representations, InferSent, and LASER as directions for embedding support. These are planned additions. The inventory already includes BERT and the transformer-based ELMo component, so the outlook refers to further representation approaches within a family already represented in the software. LASER.
The paper also identifies data formats, additional tasks, and multitask learning as directions for development. Multitask learning here concerns a workflow in which learning can involve several tasks. The demonstration describes a common trainer usable by different task implementations. The outlook extends beyond that shared trainer to the problem of facilitating joint learning. It provides no jointly trained configuration or task results for that direction.
The variant descriptions state their intended deployment conditions. The default and fast offerings are developed with different hardware settings in mind, and the reported hidden-state sizes are typical. Multilingual versions are supplied for selected tasks. These qualifications are part of the authors’ own account of what the collection offers at publication.
What follows from the evidence
The main design claim is illustrated through compact examples. They show that different embedding computations can be called from similar application code and that the application can receive the corresponding results in a consistent form. An evaluation of how much engineering time this saves would need observations of people or projects doing comparable integration work. The paper supplies no such measurements. Its usability argument rests on the visible structure of the workflow and the amount of specialized work moved behind the interfaces.
Predictive quality raises a separate question about attribution. A tagging system’s score would reflect its representation, its task architecture, its training, and the data on which it was scored. The paper cites earlier evaluations for the claim about the recommended representation stack. Isolating the predictive effect of an embedding from other choices would require matched task settings and scored runs. Isolating the effect of the framework as software would require a design that tracks what using the framework changes. The demonstration gives the reader an account of the software contribution and no new estimate of either effect.
The range of the embedding inventory also has to be interpreted within the level of the interface. A token component can use a common output destination while varying substantially in its internal computation. Contextual features may involve processing the sentence; character features can learn from task examples; conventional vectors can draw on separate pretraining. The uniform call makes these differences easier to manage from the task code. It does not give the reader comparable measurements of computation, memory, or predictive value across the components.
The same reasoning applies to document representations. Mean pooling has a clear mathematical interpretation when the input vectors are given, and the LSTM processes those vectors in order. Which gives a better basis for classification is a question about the task, the inputs, and the details of fitting. The paper supplies no head-to-head classification results for these options. Its descriptions are sufficient to understand what kinds of alternatives the interface exposes.
There are also questions of reproducibility that the demonstrations leave open. A loader that checks disk and obtains a named resource can standardize how a user starts an experiment. To reproduce a result later, a reader would need to identify the exact corpus and embedding resources, their partitions, and the training configuration used for that result. The paper does not describe an artifact identification scheme, version guarantees for downloaded files, or an evaluation of agreement between separate runs. This limits what can be inferred from the fetching examples about reproducing a particular outcome.
Using the development partition for search is a concrete default. It gives the training workflow a place to take feedback while a setting is being chosen. The quality of the resulting comparison also depends on what was searched, how frequently a configuration was tried, and when the test results were inspected. The paper explains the intended role of the partitions without reporting a particular search space, repeated trials, or a final table of scores. It consequently supports understanding of the evaluation arrangement without estimating how much Hyperopt improves outcomes.
Language coverage is similarly descriptive. A multilingual predictor can make tags available for the stated languages, but performance may depend on the language and on how closely an input resembles the training material. The paper supplies no language-by-language score or breakdown by textual setting. A reader can tell that the multilingual option exists and what task it targets. To judge suitability for a particular language or genre would require evidence at that level.
Finally, the examples show the successful path through a small set of interfaces. The user sees what happens when the requested resource is available and the input can be processed. The account gives little detail about handling failed downloads, differences among file formats, or unusual inputs. These aspects matter for the operational robustness of a toolkit. The paper’s evidence is strongest on the organization of supported components and the mechanics of the illustrated workflows.
What came after
A representation extension visible in FLAIR itself
The clearest technical connection is Pooled Contextualized Embeddings. That work concerns a pooled contextual representation for entity recognition, and the framework paper explicitly associates it with PooledFlairEmbeddings. The pooling approach thus appears in the demonstration’s list of word-level providers. A downstream consumer can request it through the same interface as the original Flair provider.
This relationship shows how research on an individual representation can be exposed by the framework. Pooling changes how the embedding is obtained, while the consumer still receives a representation at the token level. The association between the representation paper and the class is documented directly. The comparison that would tell a reader when pooling improves entity recognition belongs to the representation research. The framework paper shows the integration and identifies its source.
The other later publications have a different kind of documented relationship. They cite FLAIR, and their subjects show the range of problems in which the framework was referenced. A citation and a title identify a research connection at that level. Whether a paper reused a FLAIR embedding class, ran one of its distributed predictors, or discussed the framework in the context of related work is a more specific historical claim. The named subjects support the connections below, while the exact software role remains unspecified.
Toolkits and language-specific resources
Transformers takes up practical support for advanced NLP in a toolkit centered on transformers. That subject overlaps with FLAIR’s effort to make pretrained resources usable without requiring application code to reproduce their internal computation. FLAIR’s contribution is especially explicit about placing conventional, character-based, and contextual providers behind a common entry point. The citation establishes a link between the toolkit papers. It does not establish reuse of FLAIR’s sentence objects or stack implementation.
German’s Next Language Model takes the question of language resources into a specific language setting. FLAIR’s inventory makes language visibly relevant to resource selection, since several pretrained offerings target particular languages. The German study concerns the development of a language resource itself. Its citation links that investigation to the framework literature, without identifying an embedding configuration or a training run carried out in FLAIR.
iNLTK presents a toolkit for Indic languages. It is a later example of research concerned with making language processing available through software, with language coverage central to its subject. FLAIR’s own inventory illustrates why that concern reaches several layers. Data can be available in a language even when a suitable pretrained predictor must be obtained or built separately. The citation provides a connection at the toolkit level. The specific implementation relationship is undocumented here.
Tagging, data scarcity, and richer extraction
DAGA pursues generation-based data augmentation for tagging tasks with limited resources. Data augmentation changes the examples from which a task predictor can learn. FLAIR’s interchangeable embeddings change how those examples are represented for the task. The methods address different parts of a tagging experiment, which explains their conceptual proximity without implying that the same software component is involved. The citation does not specify the tagger or the augmentations’ point of connection to FLAIR.
Two are Better than One studies extracting entities together with relations using table-sequence encoders. Entity recognition is already a prominent example in the framework demonstration. Joint extraction adds the problem of predicting relationships among the entities. This makes the later paper relevant to the question of how far a word-aligned representation can serve a task with outputs that extend beyond individual token tags. The citation gives no evidence that the later encoder adopts a particular FLAIR provider.
Arabic-English Contextual Embeddings brings contextual representation into a setting where the text switches between Arabic and English. This is a closer thematic link to the embedding interface itself. The framework paper’s example of Washington concerns how surrounding words affect the reading of an identical spelling. The code-switching study concerns another kind of context in which the design and choice of contextual representations matter. Its citation leaves open which resources or interfaces entered the investigation.
Evaluation and the production of examples
KILT addresses benchmarking across knowledge-intensive language tasks. FLAIR addresses part of the practical path by which benchmark data reaches task code, including the assignment of explicit roles to the partitions. KILT’s subject is the benchmark itself, and its citation places FLAIR within the related research context. There is no documented connection here between KILT and FLAIR’s downloader or corpus classes.
WANLI studies dataset creation for natural language inference through collaboration between workers and AI. It directs attention to the process that produces the labeled examples a framework might ultimately load. FLAIR’s demonstration begins its data workflow with named benchmarks already available for use. The WANLI citation links the literature on producing evaluation and training data with the literature on tooling around experiments. The title does not identify a FLAIR component in the collaboration.
Annotation Error Detection examines research on detecting errors in annotations. In the framework demonstration, annotations have explicit places on the sentence’s token objects, and the benchmark loader makes the data available to training and evaluation. Detecting errors in those labels is a research problem in its own right. The citation brings the framework into that discussion without identifying it as the error detector or establishing what predictor, if any, the study used from FLAIR.
The later work spans the preparation of examples, the choice of representations, the design of downstream predictors, and the organization of benchmarks. The pooled embedding provides the concrete example of a research development surfaced through FLAIR’s shared interface. The other citations document the framework’s presence across those research areas, with the details of its use left open.
Fields, topics and concepts
Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 worksArts and Humanities · 17,959 worksLanguage and Linguistics · 17,789 works
Cite
Cite as Alan Akbik, Tanja Bergmann, Duncan Blythe, Kashif Rasul, Stefan Schweter and Roland Vollgraf. 2019. FLAIR: An Easy-to-Use Framework for State-of-the-Art NLP. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations).
@inproceedings{akbik2019flair,
title = {{FLAIR: An Easy-to-Use Framework for State-of-the-Art NLP}},
author = {Alan Akbik, Tanja Bergmann, Duncan Blythe, Kashif Rasul, Stefan Schweter and Roland Vollgraf},
booktitle = {Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (Demonstrations)},
year = {2019},
doi = {10.18653/v1/n19-4010},
url = {https://doi.org/10.18653/v1/n19-4010}
}References
- Alan Akbik, Tanja Bergmann, and Roland Vollgraf. 2019a. Multilingual sequence labeling with one model. In NLDL 2019, Northern Lights Deep Learning Workshop. OpenAlex ↗ · Scholar ↗
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.
- Alan Akbik, Tanja Bergmann, and Roland Vollgraf. 2019b. Pooled contextualized embeddings for named entity recognition. In NAACL, 2019 Annual Conference of the North American Chapter of the Association for Computational Linguistics, page to appear.
- Benjamin Heinzerling and Michael Strube. 2018. BPEmb: Tokenization-free Pre-trained Subword Embeddings in 275 Languages. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan. European Language Resources Association (ELRA).
- Alan Akbik, Duncan Blythe, and Roland Vollgraf. 2018. Contextual string embeddings for sequence labeling. In COLING 2018, 27th International Conference on Computational Linguistics, pages 1638– 1649.
- Eduard Hovy, Mitchell Marcus, Martha Palmer, Lance Ramshaw, and Ralph Weischedel. 2006. Ontonotes: the 90% solution. In Proceedings of the human language technology conference of the NAACL, Companion Volume: Short Papers, pages 57–60. Association for Computational Linguistics. OpenAlex ↗ · Scholar ↗
- Inaki Alegria, Olatz Arregi, Irene Balza, Nerea Ezeiza, Izaskun Fernandez, and Ruben Urizar. Design and development of a named entity recognizer for an agglutinative language. OpenAlex ↗ · Scholar ↗
- Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomas Mikolov. 2017. Bag of tricks for efficient text classification. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, volume 2, pages 427–431. OpenAlex ↗ · Scholar ↗
- Mikel Artetxe and Holger Schwenk. 2018. Massively multilingual sentence embeddings for zero-shot cross-lingual transfer and beyond. arXiv preprint arXiv:1812.10464.
- Guillaume Lample, Miguel Ballesteros, Sandeep Subramanian, Kazuya Kawakami, and Chris Dyer. 2016. Neural architectures for named entity recognition. arXiv preprint arXiv:1603.01360.
- James Bergstra, Daniel Yamins, and David Daniel Cox. 2013. Making a science of model search: Hyperparameter optimization in hundreds of dimensions for vision architectures. OpenAlex ↗ · Scholar ↗
- Xin Li and Dan Roth. 2002. Learning question classifiers. In Proceedings of the 19th international conference on Computational linguistics-Volume 1, pages 1–7. Association for Computational Linguistics.
- Piotr Bojanowski, Edouard Grave, Armand Joulin, and Tomas Mikolov. 2017. Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 5:135–146. pages 142–147. Association for Computational Linguistics.
- Xuezhe Ma and Eduard Hovy. 2016. End-to-end sequence labeling via bi-directional LSTMs-CNNs-CRF. arXiv preprint arXiv:1603.01354.
- Ellen M Voorhees and Donna Harman. 2000. Overview of the sixth text retrieval conference (trec-6). Information Processing & Management, 36(1):3–35. OpenAlex ↗ · Scholar ↗
- Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. 2011. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 142–150, Portland, Oregon…
- Michael Wiegand, Melanie Siegel, and Josef Ruppenhofer. 2018. Overview of the germeval 2018 shared task on the identification of offensive language. Austrian Academy of Sciences, Vienna September 21, 2018. OpenAlex ↗ · Scholar ↗
- Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111–3119.
- Daniel Zeman, Jan Haji, Martin Popel, Martin Potthast, Milan Straka, Filip Ginter, Joakim Nivre, and Slav Petrov. 2018. OpenAlex ↗ · Scholar ↗
- Conll 2018 shared task: Multilingual parsing from raw text to universal dependencies. Proceedings of the CoNLL 2018 Shared Task: Multilingual Parsing from Raw Text to Universal Dependencies, pages 1–21.
- Joel Nothman, Nicky Ringland, Will Radford, Tara Murphy, and James R. Curran. 2012. Learning multilingual named entity recognition from Wikipedia. Artificial Intelligence, 194:151–175. OpenAlex ↗ · Scholar ↗
- Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. 2017. Automatic differentiation in pytorch. OpenAlex ↗ · Scholar ↗
- Jeffrey Pennington, Richard Socher, and Christopher Manning. 2014. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532–1543.
- Matthew Peters, Mark Neumann, and Christopher Clark Kenton Lee Luke Zettlemoyer Mohit Iyyer, Matt Gardner. 2018a. Deep contextualized word representations. 6th International Conference on Learning Representations.
- Matthew Peters, Mark Neumann, Luke Zettlemoyer, and Wen-tau Yih. 2018b. Dissecting contextual word embeddings: Architecture and representation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 1499–1509.
- Alec Radford, Karthik Narasimhan, Time Salimans, and Ilya Sutskever. 2018. Improving language understanding with unsupervised learning. Technical report, Technical report, OpenAI. OpenAlex ↗ · Scholar ↗
- Erik F Tjong Kim Sang and Sabine Buchholz. 2000. Introduction to the CoNLL-2000 shared task: Chunking. In Proceedings of the 2nd workshop on Learning language in logic and the 4th conference on Computational natural language learning-Volume 7, pages 127–132. Association for Computational Linguistics…
- Erik F Tjong Kim Sang and Fien De Meulder. 2003. Introduction to the CoNLL-2003 shared task: Language-independent named entity recognition. In Proceedings of the seventh conference on Natural language learning at HLT-NAACL 2003-Volume 4,
This page in Markdown https://md.research.elamur.ai/free/en/papers/akbik-2019-flair-easy-use-framework-state/