A dslim/bert-base-NER model fine-tuned for Named Entity Recognition (NER) to detect company names in financial news articles. The base model was already pre-trained on the CoNLL-2003 NER benchmark, giving it strong NER task knowledge before domain-specific fine-tuning.
dslim/bert-base-NER (110M params, BERT pre-trained on CoNLL-2003 NER)O, B-COMPANY, I-COMPANYEvaluated on a held-out test set of 167 articles.
| Metric | Entity-level | Token-level |
|---|---|---|
| Precision | 0.44 | 0.70 |
| Recall | 0.57 | 0.78 |
| F1 | 0.50 | 0.74 |
Confusion matrix (token level):
| Pred O | Pred COMPANY | |
|---|---|---|
| True O | 76,524 | 793 |
| True COMPANY | 518 | 1,818 |
This model has higher precision (0.70) — more conservative than the FinBERT variant, with fewer false positives. Prefer this model when false alarms are more costly than occasionally missing a company.
from transformers import pipeline
nlp = pipeline(
"ner",
model="ritam-m/bert-base-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/finbert-company-ner which trades precision for higher recallmodel.safetensors 431 MBtraining_args.bin 5.3 kBdslim/bert-base-NER