Commit ·
cb813ff
1
Parent(s): 4112459
README.md updated
Browse files
README.md
CHANGED
|
@@ -18,13 +18,13 @@ tags:
|
|
| 18 |
- indicnlp
|
| 19 |
---
|
| 20 |
|
| 21 |
-
|
| 22 |
|
| 23 |
<ul>
|
| 24 |
<li >Supported languages: Assamese, Bengali, Gujarati, Hindi, Marathi, Odiya, Punjabi, Kannada, Malayalam, Tamil, and Telugu. Not all of these languages are supported by mBART50 and mT5. </li>
|
| 25 |
<li >The model is much smaller than the mBART and mT5(-base) models, so less computationally expensive for finetuning and decoding. </li>
|
| 26 |
<li> Trained on large Indic language corpora (1.316 million paragraphs and 5.9 million unique tokens) . </li>
|
| 27 |
-
<li>
|
| 28 |
</ul>
|
| 29 |
|
| 30 |
|
|
@@ -54,8 +54,6 @@ inp = tokenizer("यूट्यूब या फेसबुक पर वी
|
|
| 54 |
|
| 55 |
out = tokenizer("<2hi> 5G इंटरनेट का इंतजार हुआ खत्म:अगस्त तक देश में शुरू हो सकती है 5G सर्विस </s>", add_special_tokens=False, return_tensors="pt", padding=True).input_ids # tensor([[64007, 329, 1906, 15429, . . . . ,17, 329, 1906, 27241, 64001]])
|
| 56 |
|
| 57 |
-
# Note that if you use any language other than Hindi or Marathi, you should convert its script to Devanagari using the Indic NLP Library.
|
| 58 |
-
|
| 59 |
model_outputs=model(input_ids=inp, decoder_input_ids=out[:,0:-1], labels=out[:,1:])
|
| 60 |
|
| 61 |
# For loss
|
|
@@ -74,13 +72,27 @@ model_output=model.generate(inp, use_cache=True, num_beams=4, max_length=32, min
|
|
| 74 |
decoded_output=tokenizer.decode(model_output[0], skip_special_tokens=True, clean_up_tokenization_spaces=False)
|
| 75 |
print(decoded_output) # अगस्त के अंत तक '5G' इंटरनेट लॉन्च हो जाएगा : अश्विनी वैष्णव
|
| 76 |
|
| 77 |
-
# Note that if your output language is not Hindi or Marathi, you should convert its script from Devanagari to the desired language using the Indic NLP Library.
|
| 78 |
|
| 79 |
```
|
| 80 |
|
| 81 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
-
If you wish to use any language written in a non-Devanagari script, then you should first convert it to Devanagari using the <a href="https://github.com/anoopkunchukuttan/indic_nlp_library">Indic NLP Library</a>. After you get the output, you should convert it back into the original script.
|
| 84 |
|
| 85 |
# Contributors
|
| 86 |
<ul>
|
|
|
|
| 18 |
- indicnlp
|
| 19 |
---
|
| 20 |
|
| 21 |
+
MultiIndicHeadlineGenerationSS is a multilingual, sequence-to-sequence pre-trained model focusing only on Indic languages. It currently supports 11 Indian languages and is finetuned on [IndicBARTSS](https://huggingface.co/ai4bharat/IndicBARTSS) checkpoint. You can use MultiIndicHeadlineGenerationSS model to build natural language generation applications in Indian languages for tasks like summarization, headline generation and other summarization related tasks. Some salient features of the MultiIndicHeadlineGeneration are:
|
| 22 |
|
| 23 |
<ul>
|
| 24 |
<li >Supported languages: Assamese, Bengali, Gujarati, Hindi, Marathi, Odiya, Punjabi, Kannada, Malayalam, Tamil, and Telugu. Not all of these languages are supported by mBART50 and mT5. </li>
|
| 25 |
<li >The model is much smaller than the mBART and mT5(-base) models, so less computationally expensive for finetuning and decoding. </li>
|
| 26 |
<li> Trained on large Indic language corpora (1.316 million paragraphs and 5.9 million unique tokens) . </li>
|
| 27 |
+
<li>Unlike ai4bharat/MultiIndicHeadlineGeneration each language is written in its own script so you do not need to perform any script mapping to/from Devanagari.</li>
|
| 28 |
</ul>
|
| 29 |
|
| 30 |
|
|
|
|
| 54 |
|
| 55 |
out = tokenizer("<2hi> 5G इंटरनेट का इंतजार हुआ खत्म:अगस्त तक देश में शुरू हो सकती है 5G सर्विस </s>", add_special_tokens=False, return_tensors="pt", padding=True).input_ids # tensor([[64007, 329, 1906, 15429, . . . . ,17, 329, 1906, 27241, 64001]])
|
| 56 |
|
|
|
|
|
|
|
| 57 |
model_outputs=model(input_ids=inp, decoder_input_ids=out[:,0:-1], labels=out[:,1:])
|
| 58 |
|
| 59 |
# For loss
|
|
|
|
| 72 |
decoded_output=tokenizer.decode(model_output[0], skip_special_tokens=True, clean_up_tokenization_spaces=False)
|
| 73 |
print(decoded_output) # अगस्त के अंत तक '5G' इंटरनेट लॉन्च हो जाएगा : अश्विनी वैष्णव
|
| 74 |
|
|
|
|
| 75 |
|
| 76 |
```
|
| 77 |
|
| 78 |
+
# Benchmarks
|
| 79 |
+
Scores on the `MultiIndicHeadlineGenerationSS` test sets are as follows:
|
| 80 |
+
|
| 81 |
+
Language | Rouge-1 / Rouge-2 / Rouge-L
|
| 82 |
+
---------|----------------------------
|
| 83 |
+
as | 48.10 / 32.41 / 46.82
|
| 84 |
+
bn | 35.71 / 18.93 / 33.49
|
| 85 |
+
gu | 32.41 / 16.95 / 30.87
|
| 86 |
+
hi | 38.48 / 18.44 / 33.60
|
| 87 |
+
kn | 65.22 / 54.23 / 64.50
|
| 88 |
+
ml | 58.52 / 47.02 / 57.60
|
| 89 |
+
mr | 34.11 / 18.36 / 33.04
|
| 90 |
+
or | 24.83 / 11.00 / 23.74
|
| 91 |
+
pa | 45.15 / 27.71 / 42.12
|
| 92 |
+
ta | 47.15 / 31.09 / 45.72
|
| 93 |
+
te | 36.80 / 20.81 / 35.58
|
| 94 |
+
average | 42.41 / 27.00 / 40.64
|
| 95 |
|
|
|
|
| 96 |
|
| 97 |
# Contributors
|
| 98 |
<ul>
|