Go Inoue commited on
Commit
7893bb2
1 Parent(s): 5dbf358

Add model files

Browse files
README.md ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ar
4
+ license: apache-2.0
5
+ widget:
6
+ - text: "عامل ايه ؟"
7
+ ---
8
+ # CAMeLBERT-Mix DID Corpus6 Model
9
+ ## Model description
10
+ **CAMeLBERT-Mix DID Corpus6 Model** is a dialect identification (DID) model that was built by fine-tuning the [CAMeLBERT-Mix](https://huggingface.co/CAMeL-Lab/bert-base-arabic-camelbert-mix/) model.
11
+ For the fine-tuning, we used the [MADAR Corpus 6](https://camel.abudhabi.nyu.edu/madar-shared-task-2019/) dataset, which includes 6 labels.
12
+ Our fine-tuning procedure and the hyperparameters we used can be found in our paper *"[The Interplay of Variant, Size, and Task Type in Arabic Pre-trained Language Models](https://arxiv.org/abs/2103.06678)."* Our fine-tuning code can be found [here](https://github.com/CAMeL-Lab/CAMeLBERT).
13
+
14
+ ## Intended uses
15
+ You can use the CAMeLBERT-Mix DID Corpus6 model as part of the transformers pipeline.
16
+ This model will also be available in [CAMeL Tools](https://github.com/CAMeL-Lab/camel_tools) soon.
17
+
18
+ #### How to use
19
+ To use the model with a transformers pipeline:
20
+ ```python
21
+ >>> from transformers import pipeline
22
+ >>> did = pipeline('text-classification', model='CAMeL-Lab/bert-base-arabic-camelbert-mix-did-madar6')
23
+ >>> sentences = ['عامل ايه ؟', 'شلونك ؟ شخبارك ؟']
24
+ >>> did(sentences)
25
+ [{'label': 'CAI', 'score': 0.9996405839920044},
26
+ {'label': 'DOH', 'score': 0.9997853636741638}]
27
+
28
+ ```
29
+ *Note*: to download our models, you would need `transformers>=3.5.0`. Otherwise, you could download the models
30
+ ## Citation
31
+ ```bibtex
32
+ @inproceedings{inoue-etal-2021-interplay,
33
+ title = "The Interplay of Variant, Size, and Task Type in {A}rabic Pre-trained Language Models",
34
+ author = "Inoue, Go and
35
+ Alhafni, Bashar and
36
+ Baimukan, Nurpeiis and
37
+ Bouamor, Houda and
38
+ Habash, Nizar",
39
+ booktitle = "Proceedings of the Sixth Arabic Natural Language Processing Workshop",
40
+ month = apr,
41
+ year = "2021",
42
+ address = "Kyiv, Ukraine (Online)",
43
+ publisher = "Association for Computational Linguistics",
44
+ abstract = "In this paper, we explore the effects of language variants, data sizes, and fine-tuning task types in Arabic pre-trained language models. To do so, we build three pre-trained language models across three variants of Arabic: Modern Standard Arabic (MSA), dialectal Arabic, and classical Arabic, in addition to a fourth language model which is pre-trained on a mix of the three. We also examine the importance of pre-training data size by building additional models that are pre-trained on a scaled-down set of the MSA variant. We compare our different models to each other, as well as to eight publicly available models by fine-tuning them on five NLP tasks spanning 12 datasets. Our results suggest that the variant proximity of pre-training data to fine-tuning data is more important than the pre-training data size. We exploit this insight in defining an optimized system selection model for the studied tasks.",
45
+ }
46
+ ```
config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "bert-base-arabic-camelbert-mix-did-madar6/",
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "finetuning_task": "arabic_did_madar_6",
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "id2label": {
13
+ "0": "TUN",
14
+ "1": "CAI",
15
+ "2": "DOH",
16
+ "3": "MSA",
17
+ "4": "BEI",
18
+ "5": "RAB"
19
+ },
20
+ "initializer_range": 0.02,
21
+ "intermediate_size": 3072,
22
+ "label2id": {
23
+ "BEI": 4,
24
+ "CAI": 1,
25
+ "DOH": 2,
26
+ "MSA": 3,
27
+ "RAB": 5,
28
+ "TUN": 0
29
+ },
30
+ "layer_norm_eps": 1e-12,
31
+ "max_position_embeddings": 512,
32
+ "model_type": "bert",
33
+ "num_attention_heads": 12,
34
+ "num_hidden_layers": 12,
35
+ "pad_token_id": 0,
36
+ "type_vocab_size": 2,
37
+ "vocab_size": 30000
38
+ }
optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a403a243be7219bb452adc0d68d0cf8725577702b6ecde2e1bddab62af9e6ee
3
+ size 872747690
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3951a3b7a17bf6e446f1fb25a7abc3a976aa2203ba6fcf7ea8dff3aa7553ef65
3
+ size 436398397
scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9de25e7ab0d6db8f742c17dd2eeba87f6bcd7a80a97a1490638782e3a538885
3
+ size 326
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
1
+ {"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
tf_model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:276cdc915b90a6b178f8322dd7e3162b852c2b4e5bd0e583147d41102fbae2ec
3
+ size 436592640
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"do_lower_case": false, "special_tokens_map_file": null, "full_tokenizer_file": null}
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:094a9dce2ac085dd319585728b0912fd9dc282ee3ed36e1f03e41bb88e607dd3
3
+ size 1414
vocab.txt ADDED
The diff for this file is too large to render. See raw diff