ibraheemmoosa commited on
Commit
e9953ea
1 Parent(s): 2d9673d

Soham model for seed 109

Browse files
README.md ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - as
4
+ - bn
5
+ - gu
6
+ - hi
7
+ - mr
8
+ - ne
9
+ - or
10
+ - pa
11
+ - si
12
+ - sa
13
+ - bpy
14
+ - bh
15
+ - gom
16
+ - mai
17
+ license: apache-2.0
18
+ datasets:
19
+ - oscar
20
+ tags:
21
+ - multilingual
22
+ - albert
23
+ - fill-mask
24
+ - xlmindic
25
+ - nlp
26
+ - indoaryan
27
+ - indicnlp
28
+ - iso15919
29
+ - text-classification
30
+ widget:
31
+ - text : 'চীনের মধ্যাঞ্চলে আরও একটি শহরের বাসিন্দারা আবার ঘরবন্দী হয়ে পড়েছেন। আজ মঙ্গলবার নতুন করে লকডাউন–সংক্রান্ত বিধিনিষেধ জারি হওয়ার পর ঘরে আটকা পড়েছেন তাঁরা। করোনার অতি সংক্রামক নতুন ধরন অমিক্রনের বিস্তার ঠেকাতে এমন পদক্ষেপ নিয়েছে কর্তৃপক্ষ। খবর বার্তা সংস্থা এএফপির।'
32
+
33
+
34
+ co2_eq_emissions:
35
+ emissions: "0.21 in grams of CO2"
36
+ source: "calculated using this webstie https://mlco2.github.io/impact/#compute"
37
+ training_type: "fine-tuning"
38
+ geographical_location: "NA"
39
+ hardware_used: "P100 for about 1.5 hours"
40
+ ---
41
+
42
+ # XLMIndic Base Multiscript
43
+
44
+ This model is finetuned from [this model](https://huggingface.co/ibraheemmoosa/xlmindic-base-multiscript) on Soham Bangla News Classification task which is part of the IndicGLUE benchmark.
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 fine-tuned on Soham dataset that is part of the IndicGLUE benchmark.
57
+
58
+ ## Training procedure
59
+ ### Preprocessing
60
+ The texts are tokenized using SentencePiece and a vocabulary size of 50,000.
61
+
62
+ ### Training
63
+ The model was trained for 8 epochs with a batch size of 16 and a learning rate of *2e-5*.
64
+ ## Evaluation results
65
+
66
+ See results specific to Soham in the following table.
67
+ ### IndicGLUE
68
+ Task | mBERT | XLM-R | IndicBERT-Base | XLMIndic-Base-Uniscript | XLMIndic-Base-Multiscript (This Model)
69
+ -----| ----- | ----- | ------ | ------- | --------
70
+ Wikipedia Section Title Prediction | 71.90 | 65.45 | 69.40 | **81.78 ± 0.60** | 77.17 ± 0.76
71
+ Article Genre Classification | 88.64 | 96.61 | 97.72 | **98.70 ± 0.29** | 98.30 ± 0.26
72
+ Named Entity Recognition (F1-score) | 71.29 | 62.18 | 56.69 | **89.85 ± 1.14** | 83.19 ± 1.58
73
+ BBC Hindi News Article Classification | 60.55 | 75.52 | 74.60 | **79.14 ± 0.60** | 77.28 ± 1.50
74
+ Soham Bangla News Article Classification | 80.23 | 87.6 | 78.45 | **93.89 ± 0.48** | 93.22 ± 0.49
75
+ INLTK Gujarati Headlines Genre Classification | - | - | **92.91** | 90.73 ± 0.75 | 90.41 ± 0.69
76
+ INLTK Marathi Headlines Genre Classification | - | - | **94.30** | 92.04 ± 0.47 | 92.21 ± 0.23
77
+ IITP Hindi Product Reviews Sentiment Classification | 74.57 | **78.97** | 71.32 | 77.18 ± 0.77 | 76.33 ± 0.84
78
+ IITP Hindi Movie Reviews Sentiment Classification | 56.77 | 61.61 | 59.03 | **66.34 ± 0.16** | 65.91 ± 2.20
79
+ MIDAS Hindi Discourse Type Classification | 71.20 | **79.94** | 78.44 | 78.54 ± 0.91 | 78.39 ± 0.33
80
+ Cloze Style Question Answering (Fill-mask task) | - | - | 37.16 | **41.54** | 38.21
81
+
82
+ ## Intended uses & limitations
83
+ This model is pretrained on Indo-Aryan languages. Thus it is intended to be used for downstream tasks on these languages.
84
+ You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to
85
+ be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=xlmindic) to look for
86
+ fine-tuned versions on a task that interests you.
87
+ Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
88
+ to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
89
+ generation you should look at model like GPT2.
90
+
91
+ ### How to use
92
+
93
+ Then you can use this model directly with a pipeline for masked language modeling:
94
+ ```python
95
+ >>> from transformers import pipeline
96
+ >>> unmasker = pipeline('fill-mask', model='ibraheemmoosa/xlmindic-base-multiscript')
97
+ >>> text = "রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি [MASK], ঔপন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ��জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য তিনি এশীয়দের মধ্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।"
98
+ >>> unmasker(text)
99
+ [{'score': 0.34163928031921387,
100
+ 'token': 5399,
101
+ 'token_str': 'কবি',
102
+ 'sequence': 'রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি কবি, পন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ্জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য তিনি এশীয়দের মধ্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।'},
103
+ {'score': 0.30519795417785645,
104
+ 'token': 33436,
105
+ 'token_str': 'people',
106
+ 'sequence': 'রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি people, পন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ্জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য তিনি এশীয়দের মধ্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।'},
107
+ {'score': 0.29130080342292786,
108
+ 'token': 30476,
109
+ 'token_str': 'সাহিত্যিক',
110
+ 'sequence': 'রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি সাহিত্যিক, পন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ্জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য তিনি এশীয়দের মধ্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।'},
111
+ {'score': 0.031051287427544594,
112
+ 'token': 6139,
113
+ 'token_str': 'লেখক',
114
+ 'sequence': 'রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি লেখক, পন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ্জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য তিনি এশীয়দের মধ্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।'},
115
+ {'score': 0.002705035964027047,
116
+ 'token': 38443,
117
+ 'token_str': 'শিল্পীরা',
118
+ 'sequence': 'রবীন্দ্রনাথ ঠাকুর এফআরএএস (৭ মে ১৮৬১ - ৭ আগস্ট ১৯৪১; ২৫ বৈশাখ ১২৬৮ - ২২ শ্রাবণ ১৩৪৮ বঙ্গাব্দ) ছিলেন অগ্রণী বাঙালি শিল্পীরা, পন্যাসিক, সংগীতস্রষ্টা, নাট্যকার, চিত্রকর, ছোটগল্পকার, প্রাবন্ধিক, অভিনেতা, কণ্ঠশিল্পী ও দার্শনিক। ১৯১৩ সালে গীতাঞ্জলি কাব্যগ্রন্থের ইংরেজি অনুবাদের জন্য তিনি এশীয়দের ম��্যে সাহিত্যে প্রথম নোবেল পুরস্কার লাভ করেন।'}]
119
+ ```
120
+ ### Limitations and bias
121
+ 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.
122
+
123
+ ## Contact
124
+ Feel free to contact us if you have any ideas or if you want to know more about our models.
125
+ - Ibraheem Muhammad Moosa (ibraheemmoosa1347@gmail.com)
126
+ - Mahmud Elahi Akhter (mahmud.akhter01@northsouth.edu)
127
+ - Ashfia Binte Habib
128
+
129
+ ## BibTeX entry and citation info
130
+ Coming soon!
config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": ".",
3
+ "architectures": [
4
+ "AlbertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0,
7
+ "bos_token_id": 2,
8
+ "classifier_dropout_prob": 0.1,
9
+ "embedding_size": 128,
10
+ "eos_token_id": 3,
11
+ "hidden_act": "gelu_new",
12
+ "hidden_dropout_prob": 0,
13
+ "hidden_size": 768,
14
+ "id2label": {
15
+ "0": "LABEL_0",
16
+ "1": "LABEL_1",
17
+ "2": "LABEL_2",
18
+ "3": "LABEL_3",
19
+ "4": "LABEL_4",
20
+ "5": "LABEL_5"
21
+ },
22
+ "initializer_range": 0.02,
23
+ "inner_group_num": 1,
24
+ "intermediate_size": 3072,
25
+ "label2id": {
26
+ "LABEL_0": 0,
27
+ "LABEL_1": 1,
28
+ "LABEL_2": 2,
29
+ "LABEL_3": 3,
30
+ "LABEL_4": 4,
31
+ "LABEL_5": 5
32
+ },
33
+ "layer_norm_eps": 1e-12,
34
+ "max_position_embeddings": 512,
35
+ "model_type": "albert",
36
+ "num_attention_heads": 12,
37
+ "num_hidden_groups": 1,
38
+ "num_hidden_layers": 12,
39
+ "pad_token_id": 0,
40
+ "position_embedding_type": "absolute",
41
+ "torch_dtype": "float32",
42
+ "transformers_version": "4.15.0",
43
+ "type_vocab_size": 2,
44
+ "vocab_size": 50000
45
+ }
flax_model.msgpack ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4f6b032ad9edccc67892c3bb4d0e2d98b196e0ff56c6f21ebdfc3ad6282b8338
3
+ size 56993846
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f7b03c60678b0f3a58c5bebd28eff6fad66428fa2fa1898ef59a41318eecf18
3
+ size 57007313
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
1
+ {"bos_token": "[CLS]", "eos_token": "[SEP]", "unk_token": "<unk>", "sep_token": "[SEP]", "pad_token": "<pad>", "cls_token": "[CLS]", "mask_token": {"content": "[MASK]", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}}
spiece.model ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:214c9308d6ff921b9fab019e628c17ab57c95b0d01904ae298e7a2205abf9ef6
3
+ size 1526052
tf_model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c352ffcfde66c8be6d3ab18f1516c5f46c88e7b3c6c9466b685513aaa7add9a
3
+ size 57034056
tokenizer.vocab ADDED
The diff for this file is too large to render. See raw diff
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"do_lower_case": false, "remove_space": true, "keep_accents": true, "bos_token": "[CLS]", "eos_token": "[SEP]", "unk_token": "<unk>", "sep_token": "[SEP]", "pad_token": "<pad>", "cls_token": "[CLS]", "mask_token": {"content": "[MASK]", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false, "__type": "AddedToken"}, "sp_model_kwargs": {}, "model_max_length": 512, "tokenizer_class": "AlbertTokenizer"}