Favicon of Flair

Flair

A free Python NLP library built on PyTorch for entity recognition, sentiment analysis and custom model training, with multilingual and biomedical support.

Screenshot of Flair website

Flair is a free Python library for developers and researchers who need to extract information from text or train their own natural language processing models. It combines pretrained text analysis models with tools for building word and document embeddings, all within a framework built directly on PyTorch.

Its text analysis capabilities include named entity recognition, sentiment analysis, part-of-speech tagging, word sense disambiguation and classification. Entity recognition identifies items such as locations in a sentence, while sentiment models classify text as positive or negative. Flair also has dedicated support for biomedical text and models for multiple languages, including English, German, Dutch and Spanish.

The embedding tools let you combine different representations of words and documents, including Flair embeddings and transformer models. This gives researchers room to experiment with how a model represents text, while developers can use pretrained models for established tasks. The same framework supports training custom models with PyTorch and Flair's own classes.

Many of its sequence tagging models are available through Hugging Face. Their model pages provide training details and online demos, so you can inspect a model before choosing it for your application. Flair requires Python 3.9 or later.

Similar to Flair