🚀 意大利語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",
}