Go Inoue
commited on
Commit
·
cc503d0
1
Parent(s):
c489607
Add model files
Browse files- CAMeLBERT_MIX_preds_test_results +2 -0
- README.md +47 -0
- config.json +67 -0
- optimizer.pt +3 -0
- pytorch_model.bin +3 -0
- scheduler.pt +3 -0
- special_tokens_map.json +1 -0
- tf_model.h5 +3 -0
- tokenizer_config.json +1 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
CAMeLBERT_MIX_preds_test_results
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
Scores:
|
2 |
+
{'recall': 0.25444826156406991, 'f1': 0.24724637848149009, 'precision': 0.27170344297962074, 'accuracy': 0.40899999999999997}
|
README.md
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- ar
|
4 |
+
license: apache-2.0
|
5 |
+
widget:
|
6 |
+
- text: "عامل ايه ؟"
|
7 |
+
---
|
8 |
+
# CAMeLBERT-Mix DID NADI Model
|
9 |
+
## Model description
|
10 |
+
**CAMeLBERT-Mix DID NADI 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 [NADI Coountry-level](https://sites.google.com/view/nadi-shared-task) dataset, which includes 21 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 NADI 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-nadi')
|
23 |
+
>>> sentences = ['عامل ايه ؟', 'شلونك ؟ شخبارك ؟']
|
24 |
+
>>> did(sentences)
|
25 |
+
[{'label': 'Egypt', 'score': 0.920274019241333},
|
26 |
+
{'label': 'Saudi_Arabia', 'score': 0.26750022172927856}]
|
27 |
+
```
|
28 |
+
*Note*: to download our models, you would need `transformers>=3.5.0`.
|
29 |
+
Otherwise, you could download the models manually.
|
30 |
+
|
31 |
+
## Citation
|
32 |
+
```bibtex
|
33 |
+
@inproceedings{inoue-etal-2021-interplay,
|
34 |
+
title = "The Interplay of Variant, Size, and Task Type in {A}rabic Pre-trained Language Models",
|
35 |
+
author = "Inoue, Go and
|
36 |
+
Alhafni, Bashar and
|
37 |
+
Baimukan, Nurpeiis and
|
38 |
+
Bouamor, Houda and
|
39 |
+
Habash, Nizar",
|
40 |
+
booktitle = "Proceedings of the Sixth Arabic Natural Language Processing Workshop",
|
41 |
+
month = apr,
|
42 |
+
year = "2021",
|
43 |
+
address = "Kyiv, Ukraine (Online)",
|
44 |
+
publisher = "Association for Computational Linguistics",
|
45 |
+
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.",
|
46 |
+
}
|
47 |
+
```
|
config.json
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"BertForSequenceClassification"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"finetuning_task": "arabic_did_nadi_country",
|
7 |
+
"gradient_checkpointing": false,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 768,
|
11 |
+
"id2label": {
|
12 |
+
"0": "Algeria",
|
13 |
+
"1": "Bahrain",
|
14 |
+
"10": "Morocco",
|
15 |
+
"11": "Oman",
|
16 |
+
"12": "Palestine",
|
17 |
+
"13": "Qatar",
|
18 |
+
"14": "Saudi_Arabia",
|
19 |
+
"15": "Somalia",
|
20 |
+
"16": "Sudan",
|
21 |
+
"17": "Syria",
|
22 |
+
"18": "Tunisia",
|
23 |
+
"19": "United_Arab_Emirates",
|
24 |
+
"2": "Djibouti",
|
25 |
+
"20": "Yemen",
|
26 |
+
"3": "Egypt",
|
27 |
+
"4": "Iraq",
|
28 |
+
"5": "Jordan",
|
29 |
+
"6": "Kuwait",
|
30 |
+
"7": "Lebanon",
|
31 |
+
"8": "Libya",
|
32 |
+
"9": "Mauritania"
|
33 |
+
},
|
34 |
+
"initializer_range": 0.02,
|
35 |
+
"intermediate_size": 3072,
|
36 |
+
"label2id": {
|
37 |
+
"Algeria": 0,
|
38 |
+
"Bahrain": 1,
|
39 |
+
"Djibouti": 2,
|
40 |
+
"Egypt": 3,
|
41 |
+
"Iraq": 4,
|
42 |
+
"Jordan": 5,
|
43 |
+
"Kuwait": 6,
|
44 |
+
"Lebanon": 7,
|
45 |
+
"Libya": 8,
|
46 |
+
"Mauritania": 9,
|
47 |
+
"Morocco": 10,
|
48 |
+
"Oman": 11,
|
49 |
+
"Palestine": 12,
|
50 |
+
"Qatar": 13,
|
51 |
+
"Saudi_Arabia": 14,
|
52 |
+
"Somalia": 15,
|
53 |
+
"Sudan": 16,
|
54 |
+
"Syria": 17,
|
55 |
+
"Tunisia": 18,
|
56 |
+
"United_Arab_Emirates": 19,
|
57 |
+
"Yemen": 20
|
58 |
+
},
|
59 |
+
"layer_norm_eps": 1e-12,
|
60 |
+
"max_position_embeddings": 512,
|
61 |
+
"model_type": "bert",
|
62 |
+
"num_attention_heads": 12,
|
63 |
+
"num_hidden_layers": 12,
|
64 |
+
"pad_token_id": 0,
|
65 |
+
"type_vocab_size": 2,
|
66 |
+
"vocab_size": 30000
|
67 |
+
}
|
optimizer.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1e9fcdd45c0b172d453e94e0960861a0a59867bd68b9c29d331442aac123b033
|
3 |
+
size 872839970
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:536809cb29d1416e0ae34b27e11d15718c9414fa325157f31eda31d7132723b5
|
3 |
+
size 436444537
|
scheduler.pt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d65d2c871523b6ee588c9f6d581bd283838a260385ed7707db33ff79f60f9774
|
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:1d307c14e3fe72711345680b475c150ee4b8a1a68ba2445db0525c7e296f05d0
|
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:76140491bee99d35c545192620f87c95e7b4066640bb87bc815a7450d9f0ec42
|
3 |
+
size 1388
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|