语言:
- 意大利语
数据集:
- gsarti/clean_mc4_it
标签:
- 序列到序列
- 语言模型头部
许可证: apache-2.0
推理: 不支持
缩略图: https://gsarti.com/publication/it5/featured.png
意大利语T5基础版 🇮🇹
IT5 模型家族是首个针对意大利语进行大规模序列到序列Transformer模型预训练的尝试,遵循了原始T5模型的方法。
该模型作为项目"IT5: 意大利语理解与生成的文本到文本预训练"的一部分发布,由Gabriele Sarti和Malvina Nissim在Huggingface的支持下完成,并由Google的TPU研究云赞助TPU使用。所有训练均在Google Cloud的单个TPU3v8-VM机器上进行。有关训练过程的概览,请参阅仓库的Tensorboard标签。
推理小部件已停用,因为该模型需要对下游任务进行特定任务的序列到序列微调才能在实际中发挥作用。
模型变体
此仓库包含模型base
版本的检查点。该模型在彻底清理的意大利语mC4语料库(约410亿词,275GB)上使用🤗 Datasets和google/t5-v1_1-base
改进配置训练了一个周期(105万步)。另一个在OSCAR语料库上训练的版本也可用,名为gsarti/it5-base-oscar
。训练过程在Github上公开。
下表总结了所有可用模型的参数:
|
it5-small |
it5-base (当前模型) |
it5-large |
it5-base-oscar |
数据集 |
gsarti/clean_mc4_it |
gsarti/clean_mc4_it |
gsarti/clean_mc4_it |
oscar/unshuffled_deduplicated_it |
架构 |
google/t5-v1_1-small |
google/t5-v1_1-base |
google/t5-v1_1-large |
t5-base |
学习率 |
5e-3 |
5e-3 |
5e-3 |
1e-2 |
步数 |
1,050,000 |
1,050,000 |
2,100,000 |
258,000 |
训练时间 |
36小时 |
101小时 |
370小时 |
98小时 |
前馈投影 |
门控GELU |
门控GELU |
门控GELU |
ReLU |
嵌入绑定 |
否 |
否 |
否 |
是 |
优化器 |
Adafactor |
Adafactor |
Adafactor |
Adafactor |
最大序列长度 |
512 |
512 |
512 |
512 |
每设备批大小 |
16 |
16 |
8 |
16 |
总批大小 |
128 |
128 |
64 |
128 |
权重衰减 |
1e-3 |
1e-3 |
1e-2 |
1e-3 |
验证集大小 |
15K样本 |
15K样本 |
15K样本 |
15K样本 |
it5-base-oscar
的高训练时间是由于训练脚本中的一个错误导致的。
有关各个模型参数的详细信息,请参阅相应仓库中的config.json
文件。
使用模型
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("gsarti/it5-base")
model = AutoModelForSeq2SeqLM.from_pretrained("gsarti/it5-base")
注意:您需要在下游序列到序列任务上微调模型才能使用。参见此处示例。
Flax和Tensorflow版本的模型也可用:
from transformers import FlaxT5ForConditionalGeneration, TFT5ForConditionalGeneration
model_flax = FlaxT5ForConditionalGeneration.from_pretrained("gsarti/it5-base")
model_tf = TFT5ForConditionalGeneration.from_pretrained("gsarti/it5-base")
局限性
由于IT5模型训练所基于的网络爬取语料库的性质,其使用可能会复制并放大数据中已有的偏见,导致潜在有害内容,如种族或性别刻板印象及阴谋论观点。因此,我们明确鼓励对这些偏见进行研究,理想情况下,模型的使用应限于研究导向和非面向用户的努力。
模型维护者
有关此模型的问题或更新,请联系gabriele.sarti996@gmail.com。
引用信息
@inproceedings{sarti-nissim-2024-it5-text,
title = "{IT}5: Text-to-text Pretraining for {I}talian Language Understanding and Generation",
author = "Sarti, Gabriele and
Nissim, Malvina",
editor = "Calzolari, Nicoletta and
Kan, Min-Yen and
Hoste, Veronique and
Lenci, Alessandro and
Sakti, Sakriani and
Xue, Nianwen",
booktitle = "Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)",
month = may,
year = "2024",
address = "Torino, Italia",
publisher = "ELRA and ICCL",
url = "https://aclanthology.org/2024.lrec-main.823",
pages = "9422--9433",
abstract = "We introduce IT5, the first family of encoder-decoder transformer models pretrained specifically on Italian. We document and perform a thorough cleaning procedure for a large Italian corpus and use it to pretrain four IT5 model sizes. We then introduce the ItaGen benchmark, which includes a broad range of natural language understanding and generation tasks for Italian, and use it to evaluate the performance of IT5 models and multilingual baselines. We find monolingual IT5 models to provide the best scale-to-performance ratio across tested models, consistently outperforming their multilingual counterparts and setting a new state-of-the-art for Italian language generation.",
}