Downloads · 30 days
38
20% of all-time downloads
mdg-nlp/T5-timex-recognition-sentence
T5-timex-recognition-sentence is a token classification model from mdg-nlp. Use it when you need labels on individual words, such as names. The card lists the license as apache-2.0.
This model is a fully fine-tuned version of google/flan-t5-small for Time Expression Extraction (TIMEX).
Downloads · 30 days
38
20% of all-time downloads
All-time downloads
189
Public
Parameters
35.3M
425 MB on disk
Likes
0
Public
Click a slice to open those files.
.pt283 MB · 66%
From the Hugging Face model README
This model is a fully fine-tuned version of google/flan-t5-small for Time Expression Extraction (TIMEX).
The model identifies explicit temporal expressions in natural language text, including dates, times, durations, frequencies, and other temporal references.
The task is formulated as token-level sequence labeling using BIO tags.
| ID | Label | Description |
|---|---|---|
| 0 | O | Token is outside a temporal expression |
| 1 | B-T | Beginning of a temporal expression |
| 2 | I-T | Inside a temporal expression |
Time Expression Extraction (TIMEX)
Given an input sentence, the model identifies spans corresponding to temporal expressions.
For example:
Input:
The conference started on April 9, 1997 and lasted for three days.
Temporal expressions:
April 9, 1997
three days
Time expression extraction provides structured information about references to time in text and can serve as a component in broader temporal understanding and reasoning systems.
T5 is an encoder-decoder transformer architecture. For this task, FLAN-T5-small is adapted for token classification and configured to operate as an encoder for sentence-level temporal expression extraction.
The model is one of the fine-tuned pretrained language model baselines used to study multi-dimensional generalization in temporal extraction tasks.
Dataset: mdg-nlp/timex-recognition-sentence-original
0 -> O
1 -> B-T
2 -> I-T
| Configuration | Value |
|---|---|
| Base Model | google/flan-t5-small |
| Task | Time Expression Extraction |
| Formulation | Token Classification |
| Label Scheme | BIO |
| Fine-tuning | Full fine-tuning |
| Epochs | 3 |
| Learning Rate | 2e-5 |
| Optimizer | AdamW |
| Weight Decay | 0.01 |
| Warmup Steps | 500 |
| Train Batch Size | 16 |
| Evaluation Batch Size | 32 |
| Max Sequence Length | 128 |
All reported scores use micro-F1.
| Evaluation Setting | Micro-F1 |
|---|---|
| Base | 0.90 |
| T2C | 0.55 |
| Adversarial (Adv) | 0.89 |
| Length | 0.83 |
| Vocabulary (Voc) | 0.90 |
| Adversarial Perturbation (Adv_P) | 0.79 |
The evaluation settings measure generalization across the original task, cross-domain data, adversarial examples, structural changes, vocabulary variation, and adversarial perturbations.
from transformers import AutoTokenizer, AutoModelForTokenClassification
model_id = "mdg-nlp/T5-timex-recognition-sentence"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForTokenClassification.from_pretrained(model_id)
text = "The conference started on April 9, 1997."
inputs = tokenizer(text, return_tensors="pt", truncation=True)
outputs = model(**inputs)
predictions = outputs.logits.argmax(dim=-1)[0].tolist()
id2label = {
0: "O",
1: "B-T",
2: "I-T"
}
tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
for token, prediction in zip(tokens, predictions):
print(token, id2label[prediction])
This model was developed as part of research on multi-dimensional generalization in temporal extraction tasks.
The broader work studies temporal and event expression extraction under different forms of distribution shift, including domain shift, adversarial perturbations, vocabulary variation, compositional changes, and structural changes.
Author: Arnav Verma <br> Affiliation: New York University (2026–Present), University of North Texas (2023–2026) <br> Email: [email protected] <br>
If you use this model in your research, please cite the associated work when available.