A ProsusAI/finbert model fine-tuned for Named Entity Recognition (NER) to detect company names in financial news articles. Trained on Indian financial news but generalises to broader financial English text.
ProsusAI/finbert (110M params, BERT pre-trained on financial text)O, B-COMPANY, I-COMPANYEvaluated on a held-out test set of 167 articles.
| Metric | Entity-level | Token-level |
|---|---|---|
| Precision | 0.43 | 0.67 |
| Recall | 0.58 | 0.88 |
| F1 | 0.49 | 0.76 |
Confusion matrix (token level):
| Pred O | Pred COMPANY | |
|---|---|---|
| True O | 76,046 | 948 |
| True COMPANY | 262 | 1,910 |
This model has high recall (0.88) — it finds the majority of company tokens but fires more false positives than the bert-base-NER variant. Prefer this model when missing a company is more costly than an occasional false alarm.
from transformers import pipeline
nlp = pipeline(
"ner",
model="ritam-m/finbert-company-ner",
aggregation_strategy="first",
)
text = "HDFC Bank reported strong Q1 earnings, while Infosys maintained its FY27 guidance."
results = nlp(text)
for entity in results:
if entity["entity_group"] == "COMPANY":
print(entity["word"], entity["score"])
ritam-m/bert-base-company-ner which trades recall for precisionmodel.safetensors 436 MBtraining_args.bin 5.3 kBProsusAI/finbert