A Python toolkit that splits text into sentences or other semantic units, with pretrained SaT and WtP models covering 85 languages.
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
Install Flair with pip in a virtual environment (requires Python 3.9+)
pip install flair - 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
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
Open-source large language models fine-tuned for financial tasks such as sentiment analysis, forecasting and financial NLP benchmarks.
Industrial-strength NLP library for Python and Cython, offering tokenization, pretrained pipelines and trained models for tagging, parsing and entity recognition.
Stanford NLP Group's Python library for tokenization, sentence segmentation, NER, and dependency parsing across 60+ human languages.
No-code tool from Hugging Face for training and fine-tuning ML models (LLMs, text, image, token tasks) via a web UI, CLI or YAML configs.
The official CLI (hf) and Python client for downloading, uploading and managing repositories on the Hugging Face Hub.