Instructions to use DS4AI-UPB/span-detector-en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DS4AI-UPB/span-detector-en with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="DS4AI-UPB/span-detector-en")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("DS4AI-UPB/span-detector-en") model = AutoModelForTokenClassification.from_pretrained("DS4AI-UPB/span-detector-en", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Span detector (English) — entity detection for end-to-end RE
Dragoș Mitruț Vasile · Elena-Simona Apostol · Stefan-Adrian Toma · Adrian Paschke · Ciprian-Octavian Truică
A token-classification model (FacebookAI/xlm-roberta-large, 560M) that tags the two entity spans e1 and e2 in a plain English sentence, using a five-label BIO scheme (O, B-E1, I-E1, B-E2, I-E2). It is the first stage of the end-to-end pipeline baseline: its predicted spans are wrapped in entity markers and passed to the relation classifier (DS4AI-UPB/xlmr-large-ro-re).
The SemEval-2010 Task 8 entities are common nominals, not named entities, so an off-the-shelf NER model does not transfer — this detector is trained on the task's own spans instead.
Results (span F1-Score, held-out validation split)
| Metric | Value |
|---|---|
| Span F1-Score | 0.847 |
| Precision | 0.83 |
| Recall | 0.87 |
Training
- Base:
FacebookAI/xlm-roberta-large - Token classification, 5 BIO labels
- 5 epochs, batch size 16, LR 2e-5, 10% warmup, weight decay 0.01
- Best checkpoint by span F1-Score on a 10% validation split
- Single NVIDIA A100 40GB, about 6 min
Usage
from transformers import AutoModelForTokenClassification, AutoTokenizer
tok = AutoTokenizer.from_pretrained("DS4AI-UPB/span-detector-en")
model = AutoModelForTokenClassification.from_pretrained("DS4AI-UPB/span-detector-en")
The full pipeline (span detection then relation classification) is in pipeline_e2e.py in the code repository.
Citation
@misc{vasile2026crosslingual,
title = {Cross-lingual Relation Extraction with Large Language Models: Zero-Shot, Few-Shot, and Fine-Tuned Evaluation on Romanian},
author = {Vasile, Drago\c{s}-Mitru\c{t} and Apostol, Elena-Simona and Toma, \c{S}tefan-Adrian and Paschke, Adrian and Truic\u{a}, Ciprian-Octavian},
year = {2026},
note = {Preprint}
}
- Downloads last month
- -
Model tree for DS4AI-UPB/span-detector-en
Base model
FacebookAI/xlm-roberta-large