🚀 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 |