🚀 mT5-multilingual-XLSum
このリポジトリには、XL - Sumデータセットの45言語でファインチューニングされたmT5チェックポイントが含まれています。ファインチューニングの詳細とスクリプトについては、論文と公式リポジトリを参照してください。
🚀 クイックスタート
💻 使用例
基本的な使用法
import re
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
WHITESPACE_HANDLER = lambda k: re.sub('\s+', ' ', re.sub('\n+', ' ', k.strip()))
article_text = """Videos that say approved vaccines are dangerous and cause autism, cancer or infertility are among those that will be taken down, the company said. The policy includes the termination of accounts of anti-vaccine influencers. Tech giants have been criticised for not doing more to counter false health information on their sites. In July, US President Joe Biden said social media platforms were largely responsible for people's scepticism in getting vaccinated by spreading misinformation, and appealed for them to address the issue. YouTube, which is owned by Google, said 130,000 videos were removed from its platform since last year, when it implemented a ban on content spreading misinformation about Covid vaccines. In a blog post, the company said it had seen false claims about Covid jabs "spill over into misinformation about vaccines in general". The new policy covers long-approved vaccines, such as those against measles or hepatitis B. "We're expanding our medical misinformation policies on YouTube with new guidelines on currently administered vaccines that are approved and confirmed to be safe and effective by local health authorities and the WHO," the post said, referring to the World Health Organization."""
model_name = "csebuetnlp/mT5_multilingual_XLSum"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
input_ids = tokenizer(
[WHITESPACE_HANDLER(article_text)],
return_tensors="pt",
padding="max_length",
truncation=True,
max_length=512
)["input_ids"]
output_ids = model.generate(
input_ids=input_ids,
max_length=84,
no_repeat_ngram_size=2,
num_beams=4
)[0]
summary = tokenizer.decode(
output_ids,
skip_special_tokens=True,
clean_up_tokenization_spaces=False
)
print(summary)
🔧 技術詳細
ベンチマーク
XL - Sumのテストセットでのスコアは以下の通りです。
言語 |
ROUGE - 1 / ROUGE - 2 / ROUGE - L |
アムハラ語 |
20.0485 / 7.4111 / 18.0753 |
アラビア語 |
34.9107 / 14.7937 / 29.1623 |
アゼルバイジャン語 |
21.4227 / 9.5214 / 19.3331 |
ベンガル語 |
29.5653 / 12.1095 / 25.1315 |
ビルマ語 |
15.9626 / 5.1477 / 14.1819 |
中国語(簡体字) |
39.4071 / 17.7913 / 33.406 |
中国語(繁体字) |
37.1866 / 17.1432 / 31.6184 |
英語 |
37.601 / 15.1536 / 29.8817 |
フランス語 |
35.3398 / 16.1739 / 28.2041 |
グジャラート語 |
21.9619 / 7.7417 / 19.86 |
ハウサ語 |
39.4375 / 17.6786 / 31.6667 |
ヒンディー語 |
38.5882 / 16.8802 / 32.0132 |
イボ語 |
31.6148 / 10.1605 / 24.5309 |
インドネシア語 |
37.0049 / 17.0181 / 30.7561 |
日本語 |
48.1544 / 23.8482 / 37.3636 |
キルンディ語 |
31.9907 / 14.3685 / 25.8305 |
韓国語 |
23.6745 / 11.4478 / 22.3619 |
キルギス語 |
18.3751 / 7.9608 / 16.5033 |
マラーティー語 |
22.0141 / 9.5439 / 19.9208 |
ネパール語 |
26.6547 / 10.2479 / 24.2847 |
オロモ語 |
18.7025 / 6.1694 / 16.1862 |
パシュトー語 |
38.4743 / 15.5475 / 31.9065 |
ペルシャ語 |
36.9425 / 16.1934 / 30.0701 |
ピジン語 |
37.9574 / 15.1234 / 29.872 |
ポルトガル語 |
37.1676 / 15.9022 / 28.5586 |
パンジャブ語 |
30.6973 / 12.2058 / 25.515 |
ロシア語 |
32.2164 / 13.6386 / 26.1689 |
スコットランド・ゲール語 |
29.0231 / 10.9893 / 22.8814 |
セルビア語(キリル文字) |
23.7841 / 7.9816 / 20.1379 |
セルビア語(ラテン文字) |
21.6443 / 6.6573 / 18.2336 |
シンハラ語 |
27.2901 / 13.3815 / 23.4699 |
ソマリ語 |
31.5563 / 11.5818 / 24.2232 |
スペイン語 |
31.5071 / 11.8767 / 24.0746 |
スワヒリ語 |
37.6673 / 17.8534 / 30.9146 |
タミル語 |
24.3326 / 11.0553 / 22.0741 |
テルグ語 |
19.8571 / 7.0337 / 17.6101 |
タイ語 |
37.3951 / 17.275 / 28.8796 |
ティグリニャ語 |
25.321 / 8.0157 / 21.1729 |
トルコ語 |
32.9304 / 15.5709 / 29.2622 |
ウクライナ語 |
23.9908 / 10.1431 / 20.9199 |
ウルドゥー語 |
39.5579 / 18.3733 / 32.8442 |
ウズベク語 |
16.8281 / 6.3406 / 15.4055 |
ベトナム語 |
32.8826 / 16.2247 / 26.0844 |
ウェールズ語 |
32.6599 / 11.596 / 26.1164 |
ヨルバ語 |
31.6595 / 11.6599 / 25.0898 |
📄 ライセンス
このモデルはcc-by-nc-sa-4.0
ライセンスの下で提供されています。
📚 引用
このモデルを使用する場合は、以下の論文を引用してください。
@inproceedings{hasan-etal-2021-xl,
title = "{XL}-Sum: Large-Scale Multilingual Abstractive Summarization for 44 Languages",
author = "Hasan, Tahmid and
Bhattacharjee, Abhik and
Islam, Md. Saiful and
Mubasshir, Kazi and
Li, Yuan-Fang and
Kang, Yong-Bin and
Rahman, M. Sohel and
Shahriyar, Rifat",
booktitle = "Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021",
month = aug,
year = "2021",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2021.findings-acl.413",
pages = "4693--4703",
}