Run this model with HF Jobs
Run idoschw3/FlertDate on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/idoschw3/FlertDate. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/idoschw3/FlertDate on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use idoschw3/FlertDate with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Flair
How to use idoschw3/FlertDate with Flair:
from flair.data import Sentence from flair.models import SequenceTagger tagger = SequenceTagger.load("idoschw3/FlertDate") sentence = Sentence("George Washington went to Washington.") tagger.predict(sentence) print(sentence) - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse filesFix README.md and publish complete model card
10 unmodified lines1112131410 unmodified lines- flert- named-entity-recognition- date-extraction---10 unmodified lines111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015110 unmodified lines- flert- named-entity-recognition- date-extraction---# FlertDate: FLERT-Based Named Entity Recognition with DATE SupportFlertDate is an English Named Entity Recognition (NER) model based on the FLERT architecture, fine-tuned to support five entity categories, including DATE, which is not supported by the original four-label model. It was developed through additional fine-tuning and manual annotation refinement, using a corpus primarily focused on the Russia–Ukraine conflict.Although the model was fine-tuned and evaluated on Russia–Ukraine-related text, it is intended for general English NER applications. Its performance on other domains has not yet been systematically evaluated.The model is based on [FLERT](https://arxiv.org/abs/2011.06993) (*Document-Level Features for Named Entity Recognition*), developed by **Stefan Schweter and Alan Akbik (2020)**, and implemented using the [Flair NLP framework](https://github.com/flairNLP/flair).FlertDate was developed through domain-specific fine-tuning of the pretrained [flair/ner-english-large](https://huggingface.co/flair/ner-english-large) model, followed by additional training using manually reviewed and corrected entity annotations.Unlike the original four-category FLERT NER model, FlertDate recognizes **five entity categories**:| Label | Description ||---|---|| PER | Persons || ORG | Organizations and institutions || LOC | Geographic locations || MISC | Other named entities, including events and nationalities || DATE | Dates and temporal expressions |## AcknowledgmentsThis work builds upon the original FLERT model and the Flair framework. We gratefully acknowledge their developers and researchers.- **Schweter, S., & Akbik, A. (2020).** *FLERT: Document-Level Features for Named Entity Recognition.* [Paper](https://arxiv.org/abs/2011.06993).- **Akbik, A., et al. (2019).** *FLAIR: An Easy-to-Use Framework for State-of-the-Art NLP.* [Paper](https://aclanthology.org/N19-4010/).FlertDate is an independently fine-tuned derivative model and is not an official release by the original FLERT or Flair developers.## Training MethodologyFlertDate was developed through two stages of domain-specific fine-tuning using the Flair framework.**Stage 1 — DATE extension:** The original pretrained FLERT model (`flair/ner-english-large`) was fine-tuned to recognize five entity categories (PER, ORG, LOC, MISC, DATE), extending its original four-label classification.**Stage 2 — Annotation refinement:** The five-label model underwent additional fine-tuning using manually reviewed entity annotations, with particular attention to entity boundaries, classification consistency, and flat (non-overlapping) annotation.The second training stage used:- **1,022 training paragraphs**- **272 validation paragraphs**- Article-level separation between training and validation- Learning rate: 5 × 10⁻⁶- Batch size: 4- Maximum epochs: 20- Early stopping after 15 epochsThe published checkpoint is `final-model.pt` from the second training stage, renamed to `pytorch_model.bin` for distribution.The model was developed primarily for English-language texts concerning the Russia–Ukraine conflict.## Evaluation ResultsFlertDate was evaluated using two complementary approaches.### 1. Validation EvaluationThe model was evaluated on 272 validation paragraphs containing 2,018 annotated entities, using exact entity boundaries and labels.| Metric | Previous FlertDate | FlertDate ||---|---:|---:|| Micro-F1 (5 labels) | 83.00% | **84.14%** |### 2. Held-Out Manual EvaluationA separate evaluation was conducted on 100 manually adjudicated paragraphs containing 675 ground-truth entities.| Metric | Original FLERT | FlertDate ||---|---:|---:|| Precision (4 labels) | 86.88% | **92.23%** || Recall (4 labels) | **91.88%** | 90.36% || Micro-F1 (4 labels) | 89.31% | **91.28%** || Micro-F1 (5 labels) | N/A | **90.84%** || DATE F1 | N/A | **87.65%** |The four-label comparison includes PER, ORG, LOC, and MISC. DATE is evaluated separately because the original FLERT model does not support this category.All scores use strict exact-span-and-label matching.These results demonstrate improved performance on the evaluated corpus. Generalization to other domains has not yet been systematically assessed.## How to Use FlertDateFlertDate is compatible with the [Flair NLP framework](https://github.com/flairNLP/flair) and supports inference on both CPU and GPU.### InstallationInstall Flair using Python:```bashpip install flair```### Loading and Running the Model```pythonimport torchimport flairfrom flair.data import Sentencefrom flair.models import SequenceTagger# Use CPU (remove this line to allow automatic device selection)flair.device = torch.device("cpu")# Download and load FlertDate from Hugging Facemodel = SequenceTagger.load("idoschw3/FlertDate")# Example sentencesentence = Sentence("Russian forces entered Ukraine on 24 February 2022.")# Predict named entitiesmodel.predict(sentence)# Display predictionsfor entity in sentence.get_spans("ner"):print(entity.text, entity.get_label("ner").value)```The model is downloaded automatically from Hugging Face when first loaded.**GPU users:** Flair can automatically select a compatible GPU. The same checkpoint works on both CPU and GPU; no separate model is required.For document-level processing, users should follow Flair's document-context conventions to preserve context between related sentences.## LimitationsFlertDate is intended for English named entity recognition. Users should consider the following limitations:- **Domain generalization:** The model was fine-tuned and evaluated primarily on Russia–Ukraine-related texts. Its performance on other domains has not yet been systematically assessed.- **Entity recall:** Manual evaluation identified occasional missed entities, particularly nationality adjectives classified as MISC.- **Entity boundaries:** The model may occasionally identify incomplete entity names or split longer organizational names.- **Temporal expressions:** DATE recognition is supported, but some dates and complex temporal expressions may be missed or incorrectly identified.- **Annotation conventions:** The model follows a flat NER scheme with no overlapping or nested entities.Predictions should be independently verified when used in research requiring high annotation accuracy.
README.md+138-1