Downloads · 30 days
7
12% of all-time downloads
DS4AI-UPB/person-place-relation-xlmr
person-place-relation-xlmr is a text classification model from DS4AI-UPB. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as cc-by-nc-sa-4.0.
CLEF 2026 · HIPE Track · Task 1 · Team Awakened
Downloads · 30 days
7
12% of all-time downloads
All-time downloads
59
Public
Parameters
561M
2.2 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors2.2 GB · 100%
From the Hugging Face model README
CLEF 2026 · HIPE Track · Task 1 · Team Awakened
Dragoș-Mitruț Vasile · Elena-Simona Apostol · Ciprian-Octavian Truică
A fine-tuned XLM-RoBERTa-large for person–place relation extraction from historical documents, submitted as Run 2 (the efficiency-oriented system) of Team Awakened at HIPE-2026.
For each (person, place) pair the model predicts two labels:
at — is the person connected to the place? (TRUE / PROBABLE / FALSE)isAt — does that connection hold around the document's date? (TRUE / FALSE)The [CLS] representation of XLM-R is concatenated with 16 Wikidata knowledge-graph features (presence, temporal, and relation flags) and 6 text-pattern features (locative action, role, origin, time, departure, candidacy), then passed to two classification heads. Training uses a focal loss on the at head and an auxiliary logic-constrained loss that penalises inconsistent label pairs (e.g. at=FALSE with isAt=TRUE). A single multilingual model is trained jointly on German, English, and French.
| Property | Value |
|---|---|
| Base encoder | FacebookAI/xlm-roberta-large |
| Parameters | 560,965,127 |
| Languages | de, en, fr (single multilingual model) |
| KG features | 16 |
| Text features | 6 |
| Focal γ | 1.0 |
| λ_hard / λ_soft | 0.05 / 0.02 |
| FR Test A global | 0.6076 |
This model has a custom architecture (encoder + feature fusion + dual heads), so it loads with trust_remote_code=True. Besides the text, it expects a 16-dim Wikidata KG feature vector and a 6-dim text-pattern feature vector per (person, place) pair. These are built from the cached Wikidata facts and the local context using the code in the GitHub repository (hipe_dataset_fol.py).
import torch
from transformers import AutoModel, AutoTokenizer
device = (
torch.device("mps") if torch.backends.mps.is_available()
else torch.device("cuda") if torch.cuda.is_available()
else torch.device("cpu")
)
model = AutoModel.from_pretrained("DS4AI-UPB/<repo>", trust_remote_code=True).to(device).eval()
tokenizer = AutoTokenizer.from_pretrained("FacebookAI/xlm-roberta-large")
The KG and text-pattern features must match the ones the model was trained on, so reuse the repository's feature builders rather than reimplementing them:
from hipe_dataset_fol import build_kg_features, build_text_pattern_features, load_kg_caches
# load the cached Wikidata facts (shipped in the repo)
kg_pairs, kg_persons, kg_locations = load_kg_caches("kg_facts.jsonl")
# doc: {"text": ..., "language": "en"}; pair: QIDs, mentions, article_date
kg = build_kg_features(pair["pers_qid"], pair["loc_qid"], pair["article_date"],
kg_pairs=kg_pairs, kg_persons=kg_persons, kg_locations=kg_locations)
fol = build_text_pattern_features(doc, pair)
enc = tokenizer(doc["text"], return_tensors="pt", truncation=True, max_length=320).to(device)
with torch.no_grad():
out = model(
input_ids=enc["input_ids"],
attention_mask=enc["attention_mask"],
kg_features=torch.tensor([kg], dtype=torch.float, device=device),
fol_features=torch.tensor([fol], dtype=torch.float, device=device),
)
at = out.at_logits.argmax(-1).item() # 0=FALSE, 1=PROBABLE, 2=TRUE
isAt = out.isAt_logits.argmax(-1).item() # 0=FALSE, 1=TRUE
if at == 0: # hard rule: at=FALSE => isAt=FALSE
isAt = 0
pip install -U torch transformers safetensors
Requires
transformers >= 4.40,torch >= 2.1. Inference runs on a single GPU (~16 GB VRAM is sufficient); CPU works for small batches.
The HIPE-2026 sandbox split (German, English, French), provided by the organizers. Wikidata facts are cached from the public SPARQL endpoint and reused across runs; the cache is available in the code repository.
isAt (temporal grounding) is the weaker component; PROBABLE vs FALSE remains the hardest at distinction.@inproceedings{Vasile2026Awakened,
author = {Vasile, Dragoș-Mitruț and Apostol, Elena-Simona and Truică, Ciprian-Octavian},
title = {Team Awakened at HIPE-2026: Knowledge-Augmented Prompting and Logic-Constrained Fine-Tuning for Person--Place Relation Extraction},
booktitle = {Working Notes of CLEF 2026},
month = {September},
year = {2026}
}
| Resource | Link |
|---|---|
| Paper | WIP — will be updated when proceedings are published |
| Code | GitHub — DS4AI-UPB/Awakened-CLEF2026-HIPE |