neuropark/sahajBERT

Model

12

stars

407

commits

5

repos using this model

2

linked in READMEs

Jun 24, 2021

updated

albert
bangla
bengali
collaborative
endpoints_compatible
fill-mask
pretraining
pytorch
transformers

README

sahajBERT

Collaboratively pre-trained model on Bengali language using masked language modeling (MLM) and Sentence Order Prediction (SOP) objectives.

Model description

sahajBERT is a model composed of 1) a tokenizer specially designed for Bengali and 2) an ALBERT architecture collaboratively pre-trained on a dump of Wikipedia in Bengali and the Bengali part of OSCAR.

Intended uses & limitations

You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to be fine-tuned on a downstream task that use the whole sentence (potentially masked) to make decisions, such as sequence classification, token classification or question answering.

We trained our model on 2 of these downstream tasks: sequence classification and token classification

How to use

You can use this model directly with a pipeline for masked language modeling:


from transformers import AlbertForMaskedLM, FillMaskPipeline, PreTrainedTokenizerFast

# Initialize tokenizer

tokenizer = PreTrainedTokenizerFast.from_pretrained("neuropark/sahajBERT")

# Initialize model

model = AlbertForMaskedLM.from_pretrained("neuropark/sahajBERT")

# Initialize pipeline

pipeline = FillMaskPipeline(tokenizer=tokenizer, model=model)

raw_text = "ধন্যবাদ। আপনার সাথে কথা [MASK] ভালো লাগলো" # Change me

pipeline(raw_text)

Here is how to use this model to get the features of a given text in PyTorch:


from transformers import AlbertModel, PreTrainedTokenizerFast

# Initialize tokenizer

tokenizer = PreTrainedTokenizerFast.from_pretrained("neuropark/sahajBERT")

# Initialize model

model = AlbertModel.from_pretrained("neuropark/sahajBERT")

text = "ধন্যবাদ। আপনার সাথে কথা বলে ভালো লাগলো" # Change me

encoded_input = tokenizer(text, return_tensors='pt')

output = model(**encoded_input)

Limitations and bias

WIP

Training data

The tokenizer was trained on he Bengali part of OSCAR and the model on a dump of Wikipedia in Bengali and the Bengali part of OSCAR.

Training procedure

This model was trained in a collaborative manner by volunteer participants.

Contributors leaderboard

RankUsernameTotal contributed runtime
1khalidsaifullaah11 days 21:02:08
2ishanbagchi9 days 20:37:00
3tanmoyio9 days 18:08:34
4debajit8 days 14:15:10
5skylord6 days 16:35:29
6ibraheemmoosa5 days 01:05:57
7SaulLu5 days 00:46:36
8lhoestq4 days 20:11:16
9nilavya4 days 08:51:51
10Priyadarshan4 days 02:28:55
11anuragshas3 days 05:00:55
12sujitpal2 days 20:52:33
13manandey2 days 16:17:13
14albertvillanova2 days 14:14:31
15justheuristic2 days 13:20:52
16w0lfw1tz2 days 07:22:48
17smoker2 days 02:52:03
18Soumi1 days 20:42:02
19Anjali1 days 16:28:00
20OptimusPrime1 days 09:16:57
21theainerd1 days 04:48:57
22yhn1120 days 20:57:02
23kolk0 days 17:57:37
24arnab0 days 17:54:12
25imavijit0 days 16:07:26
26osanseviero0 days 14:16:45
27subhranilsarkar0 days 13:04:46
28sagnik15110 days 12:24:57
29anindabitm0 days 08:56:44
30borzunov0 days 04:07:35
31thomwolf0 days 03:53:15
32priyadarshan0 days 03:40:11
33ali0070 days 03:34:37
34sbrandeis0 days 03:18:16
35Preetha0 days 03:13:47
36Mrinal0 days 03:01:43
37laxya0070 days 02:18:34
38lewtun0 days 00:34:43
39Rounak0 days 00:26:10
40kshmax0 days 00:06:38

Hardware used

Eval results

We evaluate sahajBERT model quality and 2 other model benchmarks (XLM-R-large and IndicBert) by fine-tuning 3 times their pre-trained models on two downstream tasks in Bengali:

  • NER: a named entity recognition on Bengali split of WikiANN dataset

  • NCC: a multi-class classification task on news Soham News Category Classification dataset from IndicGLUE

Base pre-trained ModelNER - F1 (mean ± std)NCC - Accuracy (mean ± std)
sahajBERT95.45 ± 0.5391.97 ± 0.47
XLM-R-large96.48 ± 0.2290.05 ± 0.38
IndicBert92.52 ± 0.4574.46 ± 1.91

BibTeX entry and citation info

Coming soon!

Contributors

Upload

398 commits

SaulLu

7 commits

OptimusPrime

1 commits

system

1 commits

neuropark/sahajBERT

Model

12

stars

407

commits

5

repos using this model

2

linked in READMEs

Jun 24, 2021

updated

albert
bangla
bengali
collaborative
endpoints_compatible
fill-mask
pretraining
pytorch
transformers

README

sahajBERT

Collaboratively pre-trained model on Bengali language using masked language modeling (MLM) and Sentence Order Prediction (SOP) objectives.

Model description

sahajBERT is a model composed of 1) a tokenizer specially designed for Bengali and 2) an ALBERT architecture collaboratively pre-trained on a dump of Wikipedia in Bengali and the Bengali part of OSCAR.

Intended uses & limitations

You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to be fine-tuned on a downstream task that use the whole sentence (potentially masked) to make decisions, such as sequence classification, token classification or question answering.

We trained our model on 2 of these downstream tasks: sequence classification and token classification

How to use

You can use this model directly with a pipeline for masked language modeling:


from transformers import AlbertForMaskedLM, FillMaskPipeline, PreTrainedTokenizerFast

# Initialize tokenizer

tokenizer = PreTrainedTokenizerFast.from_pretrained("neuropark/sahajBERT")

# Initialize model

model = AlbertForMaskedLM.from_pretrained("neuropark/sahajBERT")

# Initialize pipeline

pipeline = FillMaskPipeline(tokenizer=tokenizer, model=model)

raw_text = "ধন্যবাদ। আপনার সাথে কথা [MASK] ভালো লাগলো" # Change me

pipeline(raw_text)

Here is how to use this model to get the features of a given text in PyTorch:


from transformers import AlbertModel, PreTrainedTokenizerFast

# Initialize tokenizer

tokenizer = PreTrainedTokenizerFast.from_pretrained("neuropark/sahajBERT")

# Initialize model

model = AlbertModel.from_pretrained("neuropark/sahajBERT")

text = "ধন্যবাদ। আপনার সাথে কথা বলে ভালো লাগলো" # Change me

encoded_input = tokenizer(text, return_tensors='pt')

output = model(**encoded_input)

Limitations and bias

WIP

Training data

The tokenizer was trained on he Bengali part of OSCAR and the model on a dump of Wikipedia in Bengali and the Bengali part of OSCAR.

Training procedure

This model was trained in a collaborative manner by volunteer participants.

Contributors leaderboard

RankUsernameTotal contributed runtime
1khalidsaifullaah11 days 21:02:08
2ishanbagchi9 days 20:37:00
3tanmoyio9 days 18:08:34
4debajit8 days 14:15:10
5skylord6 days 16:35:29
6ibraheemmoosa5 days 01:05:57
7SaulLu5 days 00:46:36
8lhoestq4 days 20:11:16
9nilavya4 days 08:51:51
10Priyadarshan4 days 02:28:55
11anuragshas3 days 05:00:55
12sujitpal2 days 20:52:33
13manandey2 days 16:17:13
14albertvillanova2 days 14:14:31
15justheuristic2 days 13:20:52
16w0lfw1tz2 days 07:22:48
17smoker2 days 02:52:03
18Soumi1 days 20:42:02
19Anjali1 days 16:28:00
20OptimusPrime1 days 09:16:57
21theainerd1 days 04:48:57
22yhn1120 days 20:57:02
23kolk0 days 17:57:37
24arnab0 days 17:54:12
25imavijit0 days 16:07:26
26osanseviero0 days 14:16:45
27subhranilsarkar0 days 13:04:46
28sagnik15110 days 12:24:57
29anindabitm0 days 08:56:44
30borzunov0 days 04:07:35
31thomwolf0 days 03:53:15
32priyadarshan0 days 03:40:11
33ali0070 days 03:34:37
34sbrandeis0 days 03:18:16
35Preetha0 days 03:13:47
36Mrinal0 days 03:01:43
37laxya0070 days 02:18:34
38lewtun0 days 00:34:43
39Rounak0 days 00:26:10
40kshmax0 days 00:06:38

Hardware used

Eval results

We evaluate sahajBERT model quality and 2 other model benchmarks (XLM-R-large and IndicBert) by fine-tuning 3 times their pre-trained models on two downstream tasks in Bengali:

  • NER: a named entity recognition on Bengali split of WikiANN dataset

  • NCC: a multi-class classification task on news Soham News Category Classification dataset from IndicGLUE

Base pre-trained ModelNER - F1 (mean ± std)NCC - Accuracy (mean ± std)
sahajBERT95.45 ± 0.5391.97 ± 0.47
XLM-R-large96.48 ± 0.2290.05 ± 0.38
IndicBert92.52 ± 0.4574.46 ± 1.91

BibTeX entry and citation info

Coming soon!

Contributors

Upload

398 commits

SaulLu

7 commits

OptimusPrime

1 commits

system

1 commits