Downloads · 30 days
8
9% of all-time downloads
giovannip/eu-delegation-constraints-bert
eu-delegation-constraints-bert is a text classification model from giovannip. 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-sa-4.0.
This model is a fine-tuned version of bert-base-uncased trained on the giovannip/eu-delegation-constraints-annotations dataset. It detects delegating, constraining, and soft obligation provisions in sentences from EU…
Downloads · 30 days
8
9% of all-time downloads
All-time downloads
93
Public
Parameters
109M
438 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of bert-base-uncased trained on the
giovannip/eu-delegation-constraints-annotations dataset.
It detects delegating, constraining, and soft obligation provisions in sentences from EU secondary legislation (directives and regulations, 1958–2019).
The model is part of the benchmark suite introduced in
Franchino, F., Migliorati, M., Pagano, G., & Vignoli, V. (2025).
Identifying Delegation and Constraints in Legislative Texts: A Computational Method Applied to the European Union.
European Union Politics.
from transformers import pipeline
# Load the fine-tuned model
classifier = pipeline(
"text-classification",
model="giovannip/eu-delegation-constraints-bert",
tokenizer="giovannip/eu-delegation-constraints-bert",
return_all_scores=True,
function_to_apply="sigmoid"
)
# Example:
sentence = "The Commission shall adopt implementing acts to lay down the detailed arrangements for achieving the objectives referred to in paragraph 1."
preds = classifier(sentence)[0]
# Display results (sorted by score)
for p in sorted(preds, key=lambda x: x['score'], reverse=True):
print(f"{p['label']:10s} | {p['score']:.3f}")
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "giovannip/eu-delegation-constraints-bert"
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Ensure multi-label mode
model.config.problem_type = "multi_label_classification"
# Example
text = "Member States shall adopt measures necessary to ensure compliance with this Directive."
# Tokenize and run inference
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.sigmoid(logits).squeeze().tolist()
labels = list(model.config.id2label.values())
results = sorted(zip(labels, probs), key=lambda x: x[1], reverse=True)
print("\nIndependent multi-label predictions:")
for label, score in results:
print(f"{label:10s} | {score:.3f}")
| Metric | Mean (%) |
|---|---|
| Precision | 87.7 |
| Recall | 87.9 |
| F1-score | 87.6 |
| Matthews Corr. Coef. (MCC) | 86.8 |
lr=2e-5)APA
Franchino, F., Migliorati, M., Pagano, G., & Vignoli, V. (2025).
Identifying Delegation and Constraints in Legislative Texts: A Computational Method Applied to the European Union.
European Union Politics.
BibTeX
@article{franchino2025delegation,
title={Identifying Delegation and Constraints in Legislative Texts: A Computational Method Applied to the European Union},
author={Franchino, Fabio and Migliorati, Marta and Pagano, Giovanni and Vignoli, Valerio},
journal={European Union Politics},
year={2025}
}