abhik1505040 commited on
Commit
25aebab
1 Parent(s): 0bc3410

Added README.md

Browse files
Files changed (1) hide show
  1. README.md +116 -0
README.md ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - summarization
4
+ - mT5
5
+ language:
6
+ - am
7
+ - ar
8
+ - az
9
+ - bn
10
+ - my
11
+ - zh
12
+ - en
13
+ - fr
14
+ - gu
15
+ - ha
16
+ - hi
17
+ - ig
18
+ - id
19
+ - ja
20
+ - rn
21
+ - ko
22
+ - ky
23
+ - mr
24
+ - ne
25
+ - om
26
+ - ps
27
+ - fa
28
+ - pcm
29
+ - pt
30
+ - pa
31
+ - ru
32
+ - gd
33
+ - sr
34
+ - si
35
+ - so
36
+ - es
37
+ - sw
38
+ - ta
39
+ - te
40
+ - th
41
+ - ti
42
+ - tr
43
+ - uk
44
+ - ur
45
+ - uz
46
+ - vi
47
+ - cy
48
+ - yo
49
+ licenses:
50
+ - cc-by-nc-sa-4.0
51
+ widget:
52
+ - 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."
53
+
54
+ ---
55
+
56
+ # mT5-m2o-russian-CrossSum
57
+
58
+ This repository contains the many-to-one (m2o) mT5 checkpoint finetuned on all cross-lingual pairs of the [CrossSum](https://huggingface.co/datasets/csebuetnlp/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](https://arxiv.org/abs/2112.08804) and the [official repository](https://github.com/csebuetnlp/CrossSum).
59
+
60
+
61
+ ## Using this model in `transformers` (tested on 4.11.0.dev0)
62
+
63
+ ```python
64
+ import re
65
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
66
+
67
+ WHITESPACE_HANDLER = lambda k: re.sub('\s+', ' ', re.sub('\n+', ' ', k.strip()))
68
+
69
+ 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."""
70
+
71
+ model_name = "mT5_m2o_arabic_crossSum"
72
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
73
+ model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
74
+
75
+ input_ids = tokenizer(
76
+ [WHITESPACE_HANDLER(article_text)],
77
+ return_tensors="pt",
78
+ padding="max_length",
79
+ truncation=True,
80
+ max_length=512
81
+ )["input_ids"]
82
+
83
+ output_ids = model.generate(
84
+ input_ids=input_ids,
85
+ max_length=84,
86
+ no_repeat_ngram_size=2,
87
+ num_beams=4
88
+ )[0]
89
+
90
+ summary = tokenizer.decode(
91
+ output_ids,
92
+ skip_special_tokens=True,
93
+ clean_up_tokenization_spaces=False
94
+ )
95
+
96
+ print(summary)
97
+ ```
98
+
99
+
100
+
101
+
102
+ ## Citation
103
+
104
+ If you use this model, please cite the following paper:
105
+ ```
106
+ @article{hasan2021crosssum,
107
+ author = {Tahmid Hasan and Abhik Bhattacharjee and Wasi Uddin Ahmad and Yuan-Fang Li and Yong-bin Kang and Rifat Shahriyar},
108
+ title = {CrossSum: Beyond English-Centric Cross-Lingual Abstractive Text Summarization for 1500+ Language Pairs},
109
+ journal = {CoRR},
110
+ volume = {abs/2112.08804},
111
+ year = {2021},
112
+ url = {https://arxiv.org/abs/2112.08804},
113
+ eprinttype = {arXiv},
114
+ eprint = {2112.08804}
115
+ }
116
+ ```