skillfed

flair

A very simple framework for state-of-the-art NLP

flair v0.15.1 234.3K downloads/30d#9,024 on PyPI14,382
Permissive license MIT AGING released

What it is and what it does

Flair is a PyTorch-based NLP framework that wraps state-of-the-art transformer and contextual models to make common NLP tasks accessible through a simple API. It ships with pre-trained models for named entity recognition, sentiment analysis, part-of-speech tagging, and biomedical text analysis across multiple languages, and allows you to load, apply, and combine embeddings without writing low-level PyTorch code.

The framework is built for both practitioners who want to apply existing models to text and researchers who want to train custom models. It depends on torch, transformers, huggingface-hub, and a large ecosystem of supporting libraries (scikit-learn, matplotlib, lxml, and others) to handle data loading, visualization, and model evaluation. The aging maintenance status (last release 555 days ago) means you should verify compatibility with your target PyTorch and transformer versions before committing to production use.

Use it for:

  • Extract named entities (persons, locations, organizations) from English, German, Dutch, Spanish, or other language text using pre-trained models.
  • Classify sentiment in text as positive or negative without training a custom model.
  • Generate word and document embeddings for downstream machine learning tasks using Flair embeddings or transformer models.
  • Train a custom sequence labeling model (NER, PoS tagging) on your own annotated dataset using the PyTorch framework.
  • Analyze biomedical or clinical text using specialized models and datasets designed for domain-specific NLP.
  • Combine multiple embeddings (word, document, transformer) and experiment with new architectures for sequence labeling.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Flair is a PyTorch-based NLP framework that applies pre-trained models for named entity recognition, sentiment analysis, part-of-speech tagging, and other sequence labeling tasks, plus text embedding and model training capabilities.

Yes, if you need a high-level NLP framework with pre-trained models and your Python and PyTorch versions align with the package's requirements. The low install friction, permissive license, and strong community adoption (14382 stars) make it a solid choice for NER, sentiment analysis, and embeddings. However, verify that the aging maintenance status (555 days since last release) does not conflict with your dependency update cycles, and test compatibility with your target PyTorch and transformer versions before production deployment.

Install

flair on PyPI

pip

pip install flair

uv

uv add flair

poetry

poetry add flair

Installing flair

Before you install

Low install friction with a pure-Python wheel. The package has 25 runtime dependencies including torch, transformers, and huggingface-hub, which are substantial but standard for modern NLP work. Maintenance status is aging—last release was 555 days ago—though the repository remains active with recent commits and 14382 stars.

License in practice

MIT license is permissive and imposes no restrictions on commercial or private use, modification, or redistribution.

Quickstart

pip install flair

from flair.data import Sentence
from flair.nn import Classifier

sentence = Sentence('I love Berlin .')
tagger = Classifier.load('ner')
tagger.predict(sentence)
print(sentence)

Requires Python 3.9+. Installing torch and transformers dependencies may take time and disk space; GPU support is optional but recommended for production use.

Verify before relying

  • Whether the 555-day gap since last release indicates active maintenance or reduced development velocity.
  • Performance characteristics and memory requirements for large-scale inference or training.
  • Compatibility with the latest transformer model releases and huggingface-hub API changes.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 25 — boto3, conllu, deprecated, ftfy, gdown, huggingface-hub, langdetect, lxml, matplotlib, more-itertools, mpld3, pptree, python-dateutil, pytorch-revgrad, regex, scikit-learn, segtok, sqlitedict, tabulate, torch, tqdm, transformer-smaller-training-vocab, transformers, wikipedia-api, bioc
Maintenance aging — 555 days since the last release
Last repo commit
First released
Downloads 234,314/month — #9,024 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: flair-0.15.1-py3-none-any.whl

Tags

named entity recognition NERsentiment analysis NLPpart-of-speech taggingtext embeddings frameworksequence labeling PyTorchbiomedical NLP modelstransformer embeddingsNLP model training
nlp-frameworksequence-labelingtransformers

More Artificial Intelligence packages