Commit
·
6e57129
1
Parent(s):
c2fd454
Add evaluation results etc
Browse files
README.md
CHANGED
@@ -23,11 +23,133 @@ tags:
|
|
23 |
- masked-language-modeling
|
24 |
- sentence-order-prediction
|
25 |
- fill-mask
|
|
|
26 |
- nlp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
---
|
28 |
|
29 |
# XLMIndic Base Multiscript
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
- masked-language-modeling
|
24 |
- sentence-order-prediction
|
25 |
- fill-mask
|
26 |
+
- xlmindic
|
27 |
- nlp
|
28 |
+
- indoaryan
|
29 |
+
- indicnlp
|
30 |
+
- iso15919
|
31 |
+
widget:
|
32 |
+
- text : 'রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি [MASK], ঔপন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ্জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য তিনি এশীয়দের মধ্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।'
|
33 |
+
|
34 |
+
co2_eq_emissions:
|
35 |
+
emissions: "28.53 in grams of CO2"
|
36 |
+
source: "calculated using this webstie https://mlco2.github.io/impact/#compute"
|
37 |
+
training_type: "pretraining"
|
38 |
+
geographical_location: "NA"
|
39 |
+
hardware_used: "TPUv3-8 for about 180 hours or 7.5 days"
|
40 |
---
|
41 |
|
42 |
# XLMIndic Base Multiscript
|
43 |
|
44 |
+
This model is identical in all aspects to [this model](https://huggingface.co/ibraheemmoosa/xlmindic-base-uniscript) except that we do not perform the ISO-15919 transliteration. Thus it is intended to serve as an ablation model for our study. See [this](https://huggingface.co/ibraheemmoosa/xlmindic-base-uniscript) to understand the details.
|
45 |
+
|
46 |
+
## Model description
|
47 |
+
This model has the same configuration as the [ALBERT Base v2 model](https://huggingface.co/albert-base-v2/). Specifically, this model has the following configuration:
|
48 |
+
- 12 repeating layers
|
49 |
+
- 128 embedding dimension
|
50 |
+
- 768 hidden dimension
|
51 |
+
- 12 attention heads
|
52 |
+
- 11M parameters
|
53 |
+
- 512 sequence length
|
54 |
+
|
55 |
+
## Training data
|
56 |
+
This model was pretrained on the [OSCAR](https://huggingface.co/datasets/oscar) dataset which is a medium sized multilingual corpus containing text from 163 languages. We select a subset of 14 languages based on the following criteria:
|
57 |
+
- Belongs to the [Indo-Aryan language family](https://en.wikipedia.org/wiki/Indo-Aryan_languages).
|
58 |
+
- Uses a [Brahmic script](https://en.wikipedia.org/wiki/Brahmic_scripts).
|
59 |
+
|
60 |
+
These are the 14 languages we pretrain this model on:
|
61 |
+
- Assamese
|
62 |
+
- Bangla
|
63 |
+
- Bihari
|
64 |
+
- Bishnupriya Manipuri
|
65 |
+
- Goan Konkani
|
66 |
+
- Gujarati
|
67 |
+
- Hindi
|
68 |
+
- Maithili
|
69 |
+
- Marathi
|
70 |
+
- Nepali
|
71 |
+
- Oriya
|
72 |
+
- Panjabi
|
73 |
+
- Sanskrit
|
74 |
+
- Sinhala
|
75 |
+
|
76 |
+
## Training procedure
|
77 |
+
### Preprocessing
|
78 |
+
The texts are tokenized using SentencePiece and a vocabulary size of 50,000. The inputs of the model are
|
79 |
+
then of the form:
|
80 |
+
```
|
81 |
+
[CLS] Sentence A [SEP] Sentence B [SEP]
|
82 |
+
```
|
83 |
+
### Training
|
84 |
+
Training objective is the same as the original ALBERT.
|
85 |
+
.
|
86 |
+
The details of the masking procedure for each sentence are the following:
|
87 |
+
- 15% of the tokens are masked.
|
88 |
+
- In 80% of the cases, the masked tokens are replaced by `[MASK]`.
|
89 |
+
- In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
|
90 |
+
- In the 10% remaining cases, the masked tokens are left as is.
|
91 |
+
The details of the sentence order prediction example generation procedure for each sentence are the following:
|
92 |
+
- Split the sentence into two parts A and B at a random index.
|
93 |
+
- With 50% probability swap the two parts.
|
94 |
+
The model was pretrained on TPUv3-8 for 1M steps. We have checkpoints available every 10k steps. We will upload these in the future.
|
95 |
+
|
96 |
+
## Evaluation results
|
97 |
+
We evaluated this model on the Indo-Aryan subset of languages (Panjabi, Oriya, Assamese, Bangla, Hindi, Marathi, Gujarati) from the [IndicGLUE](https://huggingface.co/datasets/indic_glue) benchmark dataset. We report the mean and standard deviation of nine fine-tuning runs for this model.
|
98 |
+
|
99 |
+
### IndicGLUE
|
100 |
+
Task | mBERT | XLM-R | IndicBERT-Base | XLMIndic-Base-Uniscript | XLMIndic-Base-Multiscript (This Model)
|
101 |
+
-----| ----- | ----- | ------ | ------- | --------
|
102 |
+
Wikipedia Section Title Prediction| 71.90 | 65.45 | 69.40 | **81.78 ± 0.60** | 77.17 ± 0.76
|
103 |
+
Article Genre Classification | 88.64 | 96.61 | 97.72 | **98.70 ± 0.29** | 98.30 ± 0.26
|
104 |
+
Named Entity Recognition (F1-score) | 71.29 | 62.18 | 56.69 | **89.85 ± 1.14** | 83.19 ± 1.58
|
105 |
+
BBC Hindi News Article Classification | 60.55 | 75.52 | 74.60 | **79.14 ± 0.60** | 77.28 ± 1.50
|
106 |
+
Soham Bangla News Article Classification | 80.23 | 87.6 | 78.45 | **93.89 ± 0.48** | 93.22 ± 0.49
|
107 |
+
INLTK Gujarati Headlines | - | - | **92.91** | 90.73 ± 0.75 | 90.41 ± 0.69
|
108 |
+
INLTK Marathi Headlines | - | - | **94.30** | 92.04 ± 0.47 | 92.21 ± 0.23
|
109 |
+
IITP Hindi Product Reviews Sentiment Classification | 74.57 | **78.97** | 71.32 | 77.18 ± 0.77 | 76.33 ± 0.84
|
110 |
+
IITP Hindi Movie Reviews Sentiment Classification | 56.77 | 61.61 | 59.03 | **66.34 ± 0.16** | 65.91 ± 2.20
|
111 |
+
MIDAS Hindi Discourse Classification | 71.20 | **79.94** | 78.44 | 78.54 ± 0.91 | 78.39 ± 0.33
|
112 |
+
Cloze Style Question Answering | - | - | 37.16 | **41.54** | 38.21
|
113 |
+
|
114 |
+
## Intended uses & limitations
|
115 |
+
This model is pretrained on Indo-Aryan languages. Thus it is intended to be used for downstream tasks on these languages.
|
116 |
+
You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to
|
117 |
+
be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=xlmindic) to look for
|
118 |
+
fine-tuned versions on a task that interests you.
|
119 |
+
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
|
120 |
+
to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
|
121 |
+
generation you should look at model like GPT2.
|
122 |
+
|
123 |
+
### How to use
|
124 |
+
|
125 |
+
Then you can use this model directly with a pipeline for masked language modeling:
|
126 |
+
```python
|
127 |
+
>>> from transformers import pipeline
|
128 |
+
>>> unmasker = pipeline('fill-mask', model='ibraheemmoosa/xlmindic-base-uniscript')
|
129 |
+
>>> text = "রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি [MASK], ঔপন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ্জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য তিনি এশীয়দের মধ্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।"
|
130 |
+
>>> unmasker(text)
|
131 |
+
[{'score': 0.34163928031921387,
|
132 |
+
'token': 5399,
|
133 |
+
'token_str': 'কবি',
|
134 |
+
'sequence': 'রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি কবি, পন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ্জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য তিনি এশীয়দের মধ্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।'},
|
135 |
+
{'score': 0.30519795417785645,
|
136 |
+
'token': 33436,
|
137 |
+
'token_str': 'people',
|
138 |
+
'sequence': 'রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি people, পন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ্জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য তিনি এশীয়দের মধ্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।'},
|
139 |
+
{'score': 0.29130080342292786,
|
140 |
+
'token': 30476,
|
141 |
+
'token_str': 'সাহিত্যিক',
|
142 |
+
'sequence': 'রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি সাহিত্যিক, পন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ্জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য ত��নি এশীয়দের মধ্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।'},
|
143 |
+
{'score': 0.031051287427544594,
|
144 |
+
'token': 6139,
|
145 |
+
'token_str': 'লেখক',
|
146 |
+
'sequence': 'রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি লেখক, পন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ্জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য তিনি এশীয়দের মধ্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।'},
|
147 |
+
{'score': 0.002705035964027047,
|
148 |
+
'token': 38443,
|
149 |
+
'token_str': 'শিল্পীরা',
|
150 |
+
'sequence': 'রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি শিল্পীরা, পন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ্জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য তিনি এশীয়দের মধ্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।'}]
|
151 |
+
```
|
152 |
+
### Limitations and bias
|
153 |
+
Even though we pretrain on a comparatively large multilingual corpus the model may exhibit harmful gender, ethnic and political bias. If you fine-tune this model on a task where these issues are important you should take special care when relying on the model to make decisions.
|
154 |
+
### BibTeX entry and citation info
|
155 |
+
Coming soon!
|