This repository contains the many-to-one (m2o) mT5 checkpoint finetuned on all cross-lingual pairs of the
CrossSum
dataset, where the target summary was in
arabic
, i.e. this model tries to
summarize text written in any language in Arabic.
For finetuning details and scripts, see the
paper
and the
official repository
.
Using this model in
transformers
(tested on 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_arabic_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)
Citation
If you use this model, please cite the following paper:
@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}
}
Runs of csebuetnlp mT5_m2o_arabic_crossSum on huggingface.co
1.4K
Total runs
-5
24-hour runs
16
3-day runs
-36
7-day runs
126
30-day runs
More Information About mT5_m2o_arabic_crossSum huggingface.co Model
mT5_m2o_arabic_crossSum huggingface.co
mT5_m2o_arabic_crossSum huggingface.co is an AI model on huggingface.co that provides mT5_m2o_arabic_crossSum's model effect (), which can be used instantly with this csebuetnlp mT5_m2o_arabic_crossSum model. huggingface.co supports a free trial of the mT5_m2o_arabic_crossSum model, and also provides paid use of the mT5_m2o_arabic_crossSum. Support call mT5_m2o_arabic_crossSum model through api, including Node.js, Python, http.
mT5_m2o_arabic_crossSum huggingface.co is an online trial and call api platform, which integrates mT5_m2o_arabic_crossSum's modeling effects, including api services, and provides a free online trial of mT5_m2o_arabic_crossSum, you can try mT5_m2o_arabic_crossSum online for free by clicking the link below.
csebuetnlp mT5_m2o_arabic_crossSum online free url in huggingface.co:
mT5_m2o_arabic_crossSum is an open source model from GitHub that offers a free installation service, and any user can find mT5_m2o_arabic_crossSum on GitHub to install. At the same time, huggingface.co provides the effect of mT5_m2o_arabic_crossSum install, users can directly use mT5_m2o_arabic_crossSum installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
mT5_m2o_arabic_crossSum install url in huggingface.co: