Mt5 Multilingual XLSum Rust
模型简介
该模型是基于mT5架构的多语言摘要生成模型,支持45种语言的文本摘要任务,特别针对新闻摘要场景进行了优化。
模型特点
多语言支持
支持45种语言的摘要生成,包括多种亚洲、非洲和欧洲语言。
高质量摘要
在XL-Sum数据集上微调,能够生成准确、简洁的新闻摘要。
基于mT5架构
使用强大的mT5多语言Transformer架构,具有良好的迁移学习能力。
模型能力
文本摘要生成
多语言处理
新闻内容浓缩
使用案例
新闻媒体
多语言新闻摘要
为国际新闻机构提供自动化的多语言新闻摘要服务。
可快速生成多种语言的新闻要点,提高内容分发效率。
内容分析
跨语言内容分析
分析不同语言的新闻内容并生成统一语言的摘要。
便于比较不同语言媒体对同一事件的报道。
🚀 mT5-multilingual-XLSum
本项目包含在XL - Sum数据集的45种语言上微调的mT5检查点。有关微调的详细信息和脚本,请参阅论文和官方仓库。
🚀 快速开始
环境要求
本项目使用的transformers
库版本为 4.11.0.dev0。
代码示例
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)
✨ 主要特性
- 多语言支持:该模型在45种语言的XL - Sum数据集上进行了微调,能够处理多种语言的摘要生成任务。
- 高性能:在多个语言的评估指标上取得了较好的成绩,如ROUGE - 1、ROUGE - 2和ROUGE - L等。
📚 详细文档
基准测试
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 |
引用
如果您使用了该模型,请引用以下论文:
@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",
}
📄 许可证
本项目采用CC - BY - NC - SA 4.0许可证。
Bart Large Cnn
MIT
基于英语语料预训练的BART模型,专门针对CNN每日邮报数据集进行微调,适用于文本摘要任务
文本生成 英语
B
facebook
3.8M
1,364
Parrot Paraphraser On T5
Parrot是一个基于T5的释义框架,专为加速训练自然语言理解(NLU)模型而设计,通过生成高质量释义实现数据增强。
文本生成
Transformers

P
prithivida
910.07k
152
Distilbart Cnn 12 6
Apache-2.0
DistilBART是BART模型的蒸馏版本,专门针对文本摘要任务进行了优化,在保持较高性能的同时显著提升了推理速度。
文本生成 英语
D
sshleifer
783.96k
278
T5 Base Summarization Claim Extractor
基于T5架构的模型,专门用于从摘要文本中提取原子声明,是摘要事实性评估流程的关键组件。
文本生成
Transformers 英语

T
Babelscape
666.36k
9
Unieval Sum
UniEval是一个统一的多维评估器,用于自然语言生成任务的自动评估,支持多个可解释维度的评估。
文本生成
Transformers

U
MingZhong
318.08k
3
Pegasus Paraphrase
Apache-2.0
基于PEGASUS架构微调的文本复述模型,能够生成语义相同但表达不同的句子。
文本生成
Transformers 英语

P
tuner007
209.03k
185
T5 Base Korean Summarization
这是一个基于T5架构的韩语文本摘要模型,专为韩语文本摘要任务设计,通过微调paust/pko-t5-base模型在多个韩语数据集上训练而成。
文本生成
Transformers 韩语

T
eenzeenee
148.32k
25
Pegasus Xsum
PEGASUS是一种基于Transformer的预训练模型,专门用于抽象文本摘要任务。
文本生成 英语
P
google
144.72k
198
Bart Large Cnn Samsum
MIT
基于BART-large架构的对话摘要模型,专为SAMSum语料库微调,适用于生成对话摘要。
文本生成
Transformers 英语

B
philschmid
141.28k
258
Kobart Summarization
MIT
基于KoBART架构的韩语文本摘要模型,能够生成韩语新闻文章的简洁摘要。
文本生成
Transformers 韩语

K
gogamza
119.18k
12
精选推荐AI模型
Llama 3 Typhoon V1.5x 8b Instruct
专为泰语设计的80亿参数指令模型,性能媲美GPT-3.5-turbo,优化了应用场景、检索增强生成、受限生成和推理任务
大型语言模型
Transformers 支持多种语言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一个基于SODA数据集训练的超小型对话模型,专为边缘设备推理设计,体积仅为Cosmo-3B模型的2%左右。
对话系统
Transformers 英语

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基于RoBERTa架构的中文抽取式问答模型,适用于从给定文本中提取答案的任务。
问答系统 中文
R
uer
2,694
98