Repolode
flairNLP

flairNLP/flair

A Python NLP framework built on PyTorch for named entity recognition, sentiment analysis, PoS tagging, and text embeddings.

Stars
14,398
Forks
2,095
Open issues
34
Last commit
18 days ago

What is it?

Flair is a Python library and PyTorch-based framework for natural language processing. It provides pre-trained models for tasks such as named entity recognition (NER), sentiment analysis, and part-of-speech tagging, and it includes specialized support for biomedical text.

Beyond ready-made taggers, Flair offers a unified interface for word and document embeddings, including its own Flair embeddings and a range of transformer-based models that can be combined. Many of its sequence tagging models are also hosted on the Hugging Face model hub.

Because it is built directly on PyTorch, developers can train their own sequence labeling and text classification models with Flair's classes and experiment with new approaches. The project requires Python 3.9 or later and installs with pip.

Key features

  • 01Pre-trained models for NER, sentiment analysis, and part-of-speech tagging.
  • 02Word and document embeddings, including Flair embeddings and transformer models, that can be combined.
  • 03Specialized support for biomedical text.
  • 04Hosted models on the Hugging Face model hub.
  • 05Training custom models on top of PyTorch.

Use cases

  • Extracting people, places, and organizations from news or documents.
  • Running sentiment analysis on customer reviews or social media text.
  • Building and training a custom sequence labeling model for a specific domain.
  • Generating word or document embeddings for downstream NLP tasks.

Quick start

  1. 1

    Install Flair with pip in a virtual environment (requires Python 3.9+)

    pip install flair
  2. 2

    Run the NER example from the README in Python

Things to know

  • The repository metadata shows an unclear license, although the README states MIT.

In collections

Topics

#nlp#pytorch#named-entity-recognition#sentiment-analysis#embeddings#sequence-labeling#machine-learning#natural-language-processing#semantic-role-labeling#word-embeddings

FAQ

What is flair?
A Python NLP framework built on PyTorch for named entity recognition, sentiment analysis, PoS tagging, and text embeddings. Flair is a Python library and PyTorch-based framework for natural language processing. It provides pre-trained models for tasks such as named entity recognition (NER), sentiment analysis, and part-of-speech tagging, and it includes specialized support for biomedical text.
Is flair free to use? What license does it have?
flair is open source under the Other license. Check the license terms before using it in commercial products.
Is flair still maintained?
Actively maintained. The last commit to flair was on Oct 19, 2026.
What can I use flair for?
Extracting people, places, and organizations from news or documents. Running sentiment analysis on customer reviews or social media text. Building and training a custom sequence labeling model for a specific domain. Generating word or document embeddings for downstream NLP tasks.
How do I install flair?
Install Flair with pip in a virtual environment (requires Python 3.9+): pip install flair Run the NER example from the README in Python
Where can I get flair?
The source code and installation instructions are on GitHub: https://github.com/flairNLP/flair

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects