🚀 mT5-m2o-hindi-CrossSum
本项目包含在CrossSum数据集的所有跨语言对上进行微调的多对一(m2o)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_m2o_hindi_crossSum"
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)
📄 许可证
本项目采用 cc-by-nc-sa-4.0
许可证。
📚 引用
如果您使用了此模型,请引用以下论文:
@article{hasan2021crosssum,
author = {Tahmid Hasan and Abhik Bhattacharjee and Wasi Uddin Ahmad and Yuan-Fang Li and Yong-bin Kang and Rifat Shahriyar},
title = {CrossSum: Beyond English-Centric Cross-Lingual Abstractive Text Summarization for 1500+ Language Pairs},
journal = {CoRR},
volume = {abs/2112.08804},
year = {2021},
url = {https://arxiv.org/abs/2112.08804},
eprinttype = {arXiv},
eprint = {2112.08804}
}
相关信息表格
属性 |
详情 |
标签 |
总结、mT5 |
支持语言 |
阿姆哈拉语、阿拉伯语、阿塞拜疆语、孟加拉语、缅甸语、中文、英语、法语、古吉拉特语、豪萨语、印地语、伊博语、印尼语、日语、基隆迪语、韩语、吉尔吉斯语、马拉地语、尼泊尔语、奥罗莫语、普什图语、波斯语、皮钦语、葡萄牙语、旁遮普语、俄语、苏格兰盖尔语、塞尔维亚语、僧伽罗语、索马里语、西班牙语、斯瓦希里语、泰米尔语、泰卢固语、泰语、提格雷尼亚语、土耳其语、乌克兰语、乌尔都语、乌兹别克语、越南语、威尔士语、约鲁巴语 |
许可证 |
cc-by-nc-sa-4.0 |