🚀 意大利语T5小模型🇮🇹
意大利语T5(IT5)模型家族是首次为意大利语进行大规模序列到序列Transformer模型预训练的尝试,采用了原始 T5模型 的方法。该模型可解决意大利语相关的文本处理任务,为意大利语自然语言处理提供了有效的工具。
🚀 快速开始
本模型是由 Gabriele Sarti 和 Malvina Nissim 发起的项目 "IT5: Text-to-Text Pretraining for Italian Language Understanding and Generation" 的一部分,得到了 Huggingface 的支持,并且由谷歌的 TPU Research Cloud 赞助提供TPU使用。所有训练都在谷歌云的单台TPU3v8 - VM机器上进行。你可以参考仓库的Tensorboard标签了解训练过程的概况。
推理小部件已停用,因为该模型需要在下游任务上进行特定任务的序列到序列微调才能在实际中发挥作用。it5
组织中的模型提供了该模型在各种下游任务上微调的示例。
✨ 主要特性
模型变体
本仓库包含模型 base
版本的检查点。该模型使用 🤗 Datasets 和 google/t5 - v1_1 - small
改进配置,在 深度清理的意大利语mC4语料库(约410亿个单词,约275GB)上训练了一个周期(1050000步)。训练过程可在 [Github](https://github.com/gsarti/t5 - flax - gcp) 上查看。
以下表格总结了所有可用模型的参数:
属性 |
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 |
步数 |
1050000 |
1050000 |
2100000 |
258000 |
训练时间 |
36小时 |
101小时 |
370小时 |
98小时 |
前馈投影 |
gated-gelu |
gated-gelu |
gated-gelu |
relu |
绑定嵌入 |
false |
false |
false |
true |
优化器 |
adafactor |
adafactor |
adafactor |
adafactor |
最大序列长度 |
512 |
512 |
512 |
512 |
每设备批量大小 |
16 |
16 |
8 |
16 |
总批量大小 |
128 |
128 |
64 |
128 |
权重衰减 |
1e - 3 |
1e - 3 |
1e - 2 |
1e - 3 |
验证集分割大小 |
15000个示例 |
15000个示例 |
15000个示例 |
15000个示例 |
it5-base-oscar
训练时间长是由于训练脚本中的 一个bug。
如需单个模型参数列表,请参考各自仓库中的 config.json
文件。
💻 使用示例
基础用法
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("gsarti/it5-small")
model = AutoModelForSeq2SeqLM.from_pretrained("gsarti/it5-small")
注意:你需要在下游序列到序列任务上微调模型才能使用它。示例可参考 此处。
高级用法
Flax和Tensorflow版本的模型也可用:
from transformers import FlaxT5ForConditionalGeneration, TFT5ForConditionalGeneration
model_flax = FlaxT5ForConditionalGeneration.from_pretrained("gsarti/it5-small")
model_tf = TFT5ForConditionalGeneration.from_pretrained("gsarti/it5-small")
🔧 技术细节
由于IT5模型是在网络抓取的语料库上训练的,使用它们可能会重现并放大数据中已有的偏差,导致产生潜在有害内容,如种族或性别刻板印象和阴谋论观点。因此,鼓励对这些偏差进行研究,并且理想情况下,模型的使用应限于面向研究且不面向用户的项目。
📄 许可证
本模型采用 apache - 2.0
许可证。
模型维护者
如果你在使用本模型时遇到问题或需要更新,请联系 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",
}