Views
No views yet
1lora_cfg = LoraConfig(
2 r=32,
3 lora_alpha=64,
4 lora_dropout=0.05,
5 bias="none",
6 task_type="CAUSAL_LM",
7 target_modules=[
8 "q_proj", "k_proj", "v_proj", "o_proj",
9 "gate_proj", "up_proj", "down_proj"
10 ],
11 modules_to_save=["embed_tokens", "lm_head"]
12 )<|readability_0|>
<|readability_5|>
<|readability_10|>
<|readability_15|>
<|readability_20|>
<|readability_25|>
<|readability_30|>
<|readability_35|>
<|readability_40|>
<|readability_45|>
<|readability_50|>
<|readability_55|>
<|readability_60|>
<|readability_65|>
<|readability_70|>
<|readability_75|>
<|readability_80|>
<|readability_85|>
<|readability_90|>
<|readability_95|>
<|readability_100|><|readability_target|>\n original_italian_sentence\n. The model will try to generate a simplification at the target readability, where a higher readability score means a more complex sentence. Aim for low readability values.1from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
2from peft import PeftModel
3
4tokenizer = AutoTokenizer.from_pretrained("mpapucci/Qwen3-1.7B-Public-Administration-Controllable-Text-Simplification-25000-42")
5
6# If you need padding, ensure that these two lines are uncommented:
7# tokenizer.pad_token = tokenizer.eos_token
8# tokenizer.padding_side = "left"
9
10model = AutoModelForCausalLM.from_pretrained(
11 "Qwen/Qwen3-1.7B-Base",
12 device_map="auto",
13)
14model.resize_token_embeddings(len(tokenizer), pad_to_multiple_of=8)
15model.config.vocab_size = len(tokenizer)
16model = PeftModel.from_pretrained(model, "mpapucci/Qwen3-1.7B-Public Administration-Controllable-Text-Simplification-25000-42")
17
18messages = []
19text = f"<|readability_20|>\nProdotto dalla BBC, il film esce solo nel 1998 ed ottiene numerosi riconoscimenti internazionali, tra cui la candidatura al Premio Oscar per il miglior cortometraggio animato.\n"
20messages.append(text)
21
22pipe = pipeline(
23 model=model,
24 tokenizer=tokenizer,
25 task='text-generation',
26 max_new_tokens=128,
27 )
28
29sequences = pipe(messages)
30
31print(sequences)
321 @inproceedings{papucci-etal-2026-controllable,
2 title = {Controllable Sentence Simplification in Italian: Fine-Tuning Large Language Models on Automatically Generated Resources},
3 author = {Papucci, Michele and Venturi, Giulia and Dell'Orletta, Felice},
4 booktitle = {Proceedings of the Fifteenth Language Resources and Evaluation Conference (LREC 2026)},
5 month = {May},
6 year = {2026},
7 pages = {7178--7191},
8 address = {Palma, Mallorca, Spain},
9 publisher = {European Language Resources Association (ELRA)},
10 doi = {10.63317/5fgm358dfxt5},
11 abstract = {This paper presents a study on readability-controlled Sentence Simplification for Italian, addressing the scarcity of annotated resources for low-resource languages. We introduce IMPaCTS (Italian Multilevel Parallel Corpus for Text Simplification), the first fully automatically created corpus of 1,444,160 original–simple sentence pairs automatically annotated with readability levels and linguistic features. It was generated using an Italian LLM prompted in zero-shot to produce multiple simplifications per input sentence. Increasing portions of the resource are used to fine-tune mono- and multilingual open-weight LLMs, conditioning them to generate simplifications at a target readability level. Results from automatic and human evaluations show that fine-tuning on IMPaCTS improves performance both in terms of task completion and adherence to the targeted readability levels compared to few-shot baselines.}
12 }