utrobinmv commited on
Commit
d95876b
·
1 Parent(s): 15f2ed2

add readme

Browse files
Files changed (1) hide show
  1. README.md +254 -0
README.md ADDED
@@ -0,0 +1,254 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - ru
5
+ - zh
6
+ tags:
7
+ - summarization
8
+ - text2text-generation
9
+ - t5
10
+ base_model:
11
+ - utrobinmv/t5_translate_en_ru_zh_large_1024_v2
12
+ license: apache-2.0
13
+ widget:
14
+
15
+
16
+ - example_title: en summ
17
+ text: >
18
+ summary: 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.
19
+ - example_title: en summ brief
20
+ text: >
21
+ summary brief: 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.
22
+ - example_title: en summ big
23
+ text: >
24
+ summary big: 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.
25
+ - example_title: en summ to zh
26
+ text: >
27
+ summary to zh: 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.
28
+
29
+ - example_title: en summ big to zh
30
+ text: >
31
+ summary big to zh: 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.
32
+ - example_title: en summ brief to ru
33
+ text: >
34
+ summary to ru: 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.
35
+
36
+
37
+ - example_title: ru summ
38
+ text: >
39
+ summary: Высота башни составляет 324 метра (1063 фута), примерно такая же высота, как у 81-этажного здания, и самое высокое сооружение в Париже. Его основание квадратно, размером 125 метров (410 футов) с любой стороны. Во время строительства Эйфелева башня превзошла монумент Вашингтона, став самым высоким искусственным сооружением в мире, и этот титул она удерживала в течение 41 года до завершения строительство здания Крайслер в Нью-Йорке в 1930 году. Это первое сооружение которое достигло высоты 300 метров. Из-за добавления вещательной антенны на вершине башни в 1957 году она сейчас выше здания Крайслер на 5,2 метра (17 футов). За исключением передатчиков, Эйфелева башня является второй самой высокой отдельно стоящей структурой во Франции после виадука Мийо.
40
+ - example_title: ru summ to en
41
+ text: >
42
+ summary to en: Высота башни составляет 324 метра (1063 фута), примерно такая же высота, как у 81-этажного здания, и самое высокое сооружение в Париже. Его основание квадратно, размером 125 метров (410 футов) с любой стороны. Во время строительства Эйфелева башня превзошла монумент Вашингтона, став самым высоким искусственным сооружением в мире, и этот титул она удерживала в течение 41 года до завершения строительство здания Крайслер в Нью-Йорке в 1930 году. Это первое сооружение которое достигло высоты 300 метров. Из-за добавления вещательной антенны на вершине башни в 1957 году она сейчас выше здания Крайслер на 5,2 метра (17 футов). За исключением передатчиков, Эйфелева башня является второй самой высокой отдельно стоящей структурой во Франции после виадука Мийо.
43
+ - example_title: ru summ to zh
44
+ text: >
45
+ summary to zh: Высота башни составляет 324 метра (1063 фута), примерно такая же высота, как у 81-этажного здания, и самое высокое сооружение в Париже. Его основание квадратно, размером 125 метров (410 футов) с любой стороны. Во время строительства Эйфелева башня превзошла монумент Вашингтона, став самым высоким искусственным сооружением в мире, и этот титул она удерживала в течение 41 года до завершения строительство здания Крайслер в Нью-Йорке в 1930 году. Это первое сооружение которое достигло высоты 300 метров. Из-за добавления вещательной антенны на вершине башни в 1957 году она сейчас выше здания Крайслер на 5,2 метра (17 футов). За исключением передатчиков, Эйфелева башня является второй самой высокой отдельно стоящей структурой во Франции после виадука Мийо.
46
+
47
+ - example_title: zh summ big
48
+ text: >
49
+ summary big: 在北京冬奥会自由式滑雪女子坡面障碍技巧决赛中,中国选手谷爱凌夺得银牌。祝贺谷爱凌!今天上午,自由式滑雪女子坡面障碍技巧决赛举行。决赛分三轮进行,取选手最佳成绩排名决出奖牌。第一跳,中国选手谷爱凌获得69.90分。在12位选手中排名第三。完成动作后,谷爱凌又扮了个鬼脸,甚是可爱。第二轮中,谷爱凌在道具区第三个障碍处失误,落地时摔倒。获得16.98分。网友:摔倒了也没关系,继续加油!在第二跳失误摔倒的情况下,谷爱凌顶住压力,第三跳稳稳发挥,流畅落地!获得86.23分!此轮比赛,共12位选手参赛,谷爱凌第10位出场。网友:看比赛时我比谷爱凌紧张,加油!
50
+ - example_title: zh summ to en
51
+ text: >
52
+ summary to en: 在北京冬奥会自由式滑雪女子坡面障碍技巧决赛中,中国选手谷爱凌夺得银牌。祝贺谷爱凌!今天上午,自由式滑雪女子坡面障碍技巧决赛举行。决赛分三轮进行,取选手最佳成绩排名决出奖牌。第一跳,中国选手谷爱凌获得69.90分。在12位选手中排名第三。完成动作后,谷爱凌又扮了个鬼脸,甚是可爱。第二轮中,谷爱凌在道具区第三个障碍处失误,落地时摔倒。获得16.98分。网友:摔倒了也没关系,继续加油!在第二跳失误摔倒的情况下,谷爱凌顶住压力,第三跳稳稳发挥,流畅落地!获得86.23分!此轮比赛,共12位选手参赛,谷爱凌第10位出场。网友:看比赛时我比谷爱凌紧张,加油!
53
+ - example_title: zh summ brief to ru
54
+ text: >
55
+ summary brief to ru: 在北京冬奥会自由式滑雪女子坡面障碍技巧决赛中,中国选手谷爱凌夺得银牌。祝贺谷爱凌!今天上午,自由式滑雪女子坡面障碍技巧决赛举行。决赛分三轮进行,取选手最佳成绩排名决出奖牌。第一跳,中国选手谷爱凌获得69.90分。在12位选手中排名第三。完成动作后,谷爱凌又扮了个鬼脸,甚是可爱。第二轮中,谷爱凌在道具区第三个障碍处失误,落地时摔倒。获得16.98分。网友:摔倒了也没关系,继续加油!在第二跳失误摔倒的情况下,谷爱凌顶住压力,第三跳稳稳发挥,流畅落地!获得86.23分!此轮比赛,共12位选手参赛,谷爱凌第10位出场。网友:看比赛时我比谷爱凌紧张,加油!
56
+ ---
57
+
58
+ # T5 model for multilingual text Summary in English, Russian and Chinese language
59
+
60
+ This model is designed to perform the task of controlled generation of summary text content in multitasking mode with a built-in translation function for languages: Russian, Chinese, English.
61
+
62
+ This is the T5 multitasking model. Which has a conditionally controlled ability to generate summary text content, and translate this. In total, she understands 12 commands, according to the set prefix:
63
+ 1) "summary: " - to generate simple concise content in the source language
64
+ 2) "summary brief: " - to generate a shortened summary content in the source language
65
+ 3) "summary big: " - to generate elongated summary content in the source language
66
+
67
+ You can conditionally limit the output to a given N number of words, just add the phrase "N words" after the task.
68
+
69
+ 1) "summary 20 words: " - to generate simple concise content in the source language
70
+ 2) "summary brief 4 words: " - to generate a shortened summary content in the source language
71
+ 3) "summary big 100 words: " - to generate elongated summary content in the source language
72
+
73
+ The model can understand text in any language from the list: Russian, Chinese or English. It can also translate the result into any language from the list: Russian, Chinese or English.
74
+
75
+ For translation into the target language, the target language identifier is specified as a prefix "... to <lang>:". Where lang can take the values: ru, en, zh. The source language may not be specified, in addition, the source text may be multilingual.
76
+
77
+ task prefix:
78
+
79
+ 4) "summary to en: " - to generate summary content in English from multilingual text
80
+ 5) "summary brief to en: " - to generate a shortened summary of the content in English from multilingual text
81
+ 6) "summary big to en: " - to generate elongated summary content in English from multilingual text
82
+ 7) "summary to ru: " - to generate summary content in Russian from multilingual text
83
+ 8) "summary brief to ru: " - to generate a shortened summary of the content in Russian from multilingual text
84
+ 9) "summary big to ru: " - to generate elongated summary content in Russian from multilingual text
85
+ 10) "summary to zh: " - to generate summary content in Chinese from multilingual text
86
+ 11) "summary brief to zh: " - to generate a shortened summary of the content in Chinese from multilingual text
87
+ 12) "summary big to zh: " - to generate elongated summary content in Chinese from multilingual text
88
+
89
+ A training model for compressing a context of 2048 tokens and outputs a summary of up to 200 tokens in big task, 50 tokens in summary, and 20 tokens in brief task.
90
+
91
+
92
+
93
+ Example resume for English:
94
+
95
+ ```python
96
+ from transformers import T5ForConditionalGeneration, T5Tokenizer
97
+
98
+ device = 'cuda' #or 'cpu' for translate on cpu
99
+
100
+ model_name = 'utrobinmv/t5_summary_en_ru_zh_large_2048'
101
+ model = T5ForConditionalGeneration.from_pretrained(model_name)
102
+ model.eval()
103
+ model.to(device)
104
+ tokenizer = T5Tokenizer.from_pretrained(model_name)
105
+
106
+ 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."""
107
+
108
+ # text summary generate
109
+ prefix = 'summary: '
110
+ src_text = prefix + text
111
+ input_ids = tokenizer(src_text, return_tensors="pt")
112
+
113
+ generated_tokens = model.generate(**input_ids.to(device))
114
+
115
+ result = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
116
+ print(result)
117
+ #YouTube is cracking down on videos that suggest Covid-19 vaccines are dangerous and harmful.
118
+
119
+ # text brief summary generate
120
+ prefix = 'summary brief: '
121
+ src_text = prefix + text
122
+ input_ids = tokenizer(src_text, return_tensors="pt")
123
+
124
+ generated_tokens = model.generate(**input_ids.to(device))
125
+
126
+ result = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
127
+ print(result)
128
+ #YouTube is cracking down on misleading information about Covid vaccines.
129
+
130
+ # text big summary generate
131
+ prefix = 'summary big: '
132
+ src_text = prefix + text
133
+ input_ids = tokenizer(src_text, return_tensors="pt")
134
+
135
+ generated_tokens = model.generate(**input_ids.to(device))
136
+
137
+ result = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
138
+ print(result)
139
+ #YouTube has said it will remove more than 1,500 videos of Covid vaccines from its platform in a bid to tackle the spread of misinformation about the jabs.
140
+ ```
141
+
142
+
143
+
144
+ Example resume for Chinese text on English language:
145
+
146
+ ```python
147
+ from transformers import T5ForConditionalGeneration, T5Tokenizer
148
+
149
+ device = 'cuda' #or 'cpu' for translate on cpu
150
+
151
+ model_name = 'utrobinmv/t5_summary_en_ru_zh_large_2048'
152
+ model = T5ForConditionalGeneration.from_pretrained(model_name)
153
+ model.eval()
154
+ model.to(device)
155
+ tokenizer = T5Tokenizer.from_pretrained(model_name)
156
+
157
+ text = """在北京冬奥会自由式滑雪女子坡面障碍技巧决赛中,中国选手谷爱凌夺得银牌。祝贺谷爱凌!今天上午,自由式滑雪女子坡面障碍技巧决赛举行。决赛分三轮进行,取选手最佳成绩排名决出奖牌。第一跳,中国选手谷爱凌获得69.90分。在12位选手中排名第三。完成动作后,谷爱凌又扮了个鬼脸,甚是可爱。第二轮中,谷爱凌在道具区第三个障碍处失误,落地时摔倒。获得16.98分。网友:摔倒了也没关系,继续加油!在第二跳失误摔倒的情况下,谷爱凌顶住压力,第三跳稳稳发挥,流畅落地!获得86.23分!此轮比赛,共12位选手参赛,谷爱凌第10位出场。网友:看比赛时我比谷爱凌紧张,加油!"""
158
+
159
+ # text summary generate
160
+ prefix = 'summary to en: '
161
+ src_text = prefix + text
162
+ input_ids = tokenizer(src_text, return_tensors="pt")
163
+
164
+ generated_tokens = model.generate(**input_ids.to(device))
165
+
166
+ result = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
167
+ print(result)
168
+ #In Beijing Winter Olympics Games, Chinese contestant Grulove凌 won the silver card. Celebrate.
169
+
170
+ # text brief summary generate
171
+ prefix = 'summary brief to en: '
172
+ src_text = prefix + text
173
+ input_ids = tokenizer(src_text, return_tensors="pt")
174
+
175
+ generated_tokens = model.generate(**input_ids.to(device))
176
+
177
+ result = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
178
+ print(result)
179
+ #In Beijing Winter Olympics Games, Chinese contestant Gruelean won the silver card.
180
+
181
+ # text big summary generate
182
+ prefix = 'summary big to en: '
183
+ src_text = prefix + text
184
+ input_ids = tokenizer(src_text, return_tensors="pt")
185
+
186
+ generated_tokens = model.generate(**input_ids.to(device))
187
+
188
+ result = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
189
+ print(result)
190
+ #In Beijing's Winter Olympics Games, the 12-year-old has won the silver card in a free-skating lady hillwalking contest. The first jump, Chinese contestant, 69.90.
191
+ ```
192
+
193
+
194
+
195
+ and Example resume for Russian:
196
+
197
+ ```python
198
+ from transformers import T5ForConditionalGeneration, T5Tokenizer
199
+
200
+ device = 'cuda' #or 'cpu' for translate on cpu
201
+
202
+ model_name = 'utrobinmv/t5_summary_en_ru_zh_large_2048'
203
+ model = T5ForConditionalGeneration.from_pretrained(model_name)
204
+ model.eval()
205
+ model.to(device)
206
+ tokenizer = T5Tokenizer.from_pretrained(model_name)
207
+
208
+ text = """Высота башни составляет 324 метра (1063 фута), примерно такая же высота, как у 81-этажного здания, и самое высокое сооружение в Париже. Его основание квадратно, размером 125 метров (410 футов) с любой стороны. Во время строительства Эйфелева башня превзошла монумент Вашингтона, став самым высоким искусственным сооружением в мире, и этот титул она удерживала в течение 41 года до завершения строительство здания Крайслер в Нью-Йорке в 1930 году. Это первое сооружение которое достигло высоты 300 метров. Из-за добавления вещательной антенны на вершине башни в 1957 году она сейчас выше здания Крайслер на 5,2 метра (17 футов). За исключением передатчиков, Эйфелева башня является второй самой высокой отдельно стоящей структурой во Франции после виадука Мийо."""
209
+
210
+ # text summary generate
211
+ prefix = 'summary: '
212
+ src_text = prefix + text
213
+ input_ids = tokenizer(src_text, return_tensors="pt")
214
+
215
+ generated_tokens = model.generate(**input_ids.to(device))
216
+
217
+ result = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
218
+ print(result)
219
+ #Французская Эйфелева башня, ставшая самой высокой в мире, достигла высоты 300 метров (1063 фута).
220
+
221
+ # text brief summary generate
222
+ prefix = 'summary brief: '
223
+ src_text = prefix + text
224
+ input_ids = tokenizer(src_text, return_tensors="pt")
225
+
226
+ generated_tokens = model.generate(**input_ids.to(device))
227
+
228
+ result = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
229
+ print(result)
230
+ #Французская Эйфелева башня стала самой высокой в мире.
231
+
232
+ # text big summary generate
233
+ prefix = 'summary big: '
234
+ src_text = prefix + text
235
+ input_ids = tokenizer(src_text, return_tensors="pt")
236
+
237
+ generated_tokens = model.generate(**input_ids.to(device))
238
+
239
+ result = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
240
+ print(result)
241
+ #Французская Эйфелева башня, построенная в 1957 году, достигла высоты 300 метров (1063 фута) с любой стороны. Это самый высокий сооружения в мире после виадука Мийо.
242
+ ```
243
+
244
+
245
+
246
+
247
+
248
+ ##
249
+
250
+
251
+
252
+ ## Languages covered
253
+
254
+ Russian (ru_RU), Chinese (zh_CN), English (en_US)