The
LEGIT-BART models are a family of
pre-trained transformer-based models for
Italian legal text processing.
They build upon
BART-IT (
morenolq/bart-it) and are further pre-trained on
Italian legal corpora.
1from transformers import BartForConditionalGeneration, AutoTokenizer
2
3# Load tokenizer and model
4model_name = "morenolq/LEGIT-BART"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = BartForConditionalGeneration.from_pretrained(model_name)
7
8# Example input
9input_text = "<mask> 1234: Il contratto si intende concluso quando..."
10inputs = tokenizer(input_text, return_tensors="pt", max_length=512, truncation=True)
11
12# Pre-trained model fill the mask
13output_ids = model.generate(inputs.input_ids, max_length=150, num_beams=4, early_stopping=True)
14output_text = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
15print("📝:", output_text)
The paper presenting LEGIT-BART models is currently under review and will be updated here once published.
1@article{benedetto2025legitbart,
2 title = {LegItBART: a summarization model for Italian legal documents},
3 author = {Benedetto, Irene and La Quatra, Moreno and Cagliero, Luca},
4 year = 2025,
5 journal = {Artificial Intelligence and Law},
6 publisher = {Springer},
7 pages = {1--31},
8 doi = {10.1007/s10506-025-09436-y},
9 url = {doi.org/10.1007/s10506-025-09436-y}
10}