Flair — State-of-the-Art NLP Framework
Simple NLP library with SOTA models for NER, POS tagging, chunking, text classification, and contextual string embeddings.
Flair
Flair provides a very simple API for applying SOTA NLP models — including its own contextual string embeddings — to sequence labelling, classification, and entity extraction tasks in 12+ languages. It stacks seamlessly on top of Hugging Face Transformers.
Key Features
- SOTA NER: 93.9 F1 on CoNLL-2003 English with stacked embeddings
- POS tagging, chunking, dependency parsing, NEL
- Contextual string embeddings (character-level LM) + BERT/XLM-R stacking
- Text classification: sentiment, intent, topic
- Multilingual: 12+ languages, zero-shot cross-lingual transfer
- Training API: train custom sequence labellers and classifiers in ~10 lines
Quick Start
from flair.data import Sentence
from flair.models import SequenceTagger
tagger = SequenceTagger.load("ner") # downloads pre-trained model
sentence = Sentence("George Washington went to Washington D.C.")
tagger.predict(sentence)
for entity in sentence.get_spans("ner"):
print(entity) # Span[0:2]: "George Washington" → [PER (0.9998)]
Install via ai-supply
npx ai-supply add flair-nlp-framework
Curated mirror of the open-source Flair (MIT). Get it from the source.
Compromise signals — malicious or tampered code (leaked secrets, backdoors, a dropped executable) — reduce the score, and known dependency CVEs carry a bounded penalty (they warrant review but never QUARANTINE — update the dependency to clear). Other dangerous-by-capability traits are risk surface, expected for some capabilities. Every finding is mapped to its OWASP control below.
Findings mapped to the OWASP Top 10 for LLM Applications (2025) and the OWASP Machine Learning Security Top 10. Expand any flagged control for the exact findings — compromise reduces the score; expected/risk-surface do not, except a known CVE, which carries a small bounded penalty (high/critical → Review).
The same gate an agent runs before installing (POST /api/v1/trust/flair-nlp-framework/check). Click a policy:
Consume Flair — State-of-the-Art NLP Framework programmatically. Authenticate with an API key or session — see Authorize an agent.
# Agents: CHECK BEFORE YOU INSTALL (no auth) — score, grade, level, capability manifest
curl https://ai-supply.store/api/v1/trust/flair-nlp-framework
# Gate against your org policy (returns { pass, violations })
curl -X POST https://ai-supply.store/api/v1/trust/flair-nlp-framework/check \
-H "Content-Type: application/json" \
-d '{"minGrade":"B","denyPermissions":["shell"],"denyUnknownEgress":true}'
# CLI
npx ai-supply add flair-nlp-framework
# REST (install → download)
curl -X POST https://ai-supply.store/api/v1/listings/flair-nlp-framework/install \
-H "Authorization: Bearer $AIM_KEY"
# MCP tool
install_listing({ "slug": "flair-nlp-framework" })OpenAPI spec →Curated mirror — latest upstream source. See the repository for tagged releases.