calpt commited on
Commit
6df6042
·
verified ·
1 Parent(s): 45b5848

Add adapter bert-base-arabert-ar-dialect version 2

Browse files
._adapter_config.json ADDED
Binary file (311 Bytes). View file
 
._head_config.json ADDED
Binary file (311 Bytes). View file
 
._pytorch_adapter.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e41746569fbb0d44f0d28599a7ce36e386f99e10e96f557194647b8dfb51b3e9
3
+ size 311
._pytorch_model_head.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7631942bfff3f512961630af1a68951a01303e57904e18d50cd073b7509c0db
3
+ size 311
README.md ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - adapterhub:dialect/arabic
4
+ - text-classification
5
+ - adapter-transformers
6
+ - bert
7
+ license: "apache-2.0"
8
+ ---
9
+
10
+ # Adapter `bert-base-arabert-ar-dialect` for aubmindlab/bert-base-arabert
11
+
12
+ **Note: This adapter was not trained by the AdapterHub team, but by these author(s): Nick Doiron.
13
+ See author details below.**
14
+
15
+ Adapter for AraBERT (aubmindlab/bert-base-arabert) trained to classify Arabic by dialect {0=Egyptian, 1=Gulf, 2=Levantine, 3=Maghrebi, 4=MSA}
16
+ Trained for 3 epochs on 85k samples (+ 28k test set) from University of British Columbia and John Hopkins University.
17
+
18
+
19
+ **This adapter was created for usage with the [Adapters](https://github.com/Adapter-Hub/adapters) library.**
20
+
21
+ ## Usage
22
+
23
+ First, install `adapters`:
24
+
25
+ ```
26
+ pip install -U adapters
27
+ ```
28
+
29
+ Now, the adapter can be loaded and activated like this:
30
+
31
+ ```python
32
+ from adapters import AutoAdapterModel
33
+
34
+ model = AutoAdapterModel.from_pretrained("aubmindlab/bert-base-arabert")
35
+ adapter_name = model.load_adapter("AdapterHub/bert-base-arabert-ar-dialect")
36
+ model.set_active_adapters(adapter_name)
37
+ ```
38
+
39
+ ## Architecture & Training
40
+
41
+ - Adapter architecture: pfeiffer
42
+ - Prediction head: classification
43
+ - Dataset: [ArabicDialect](https://adapterhub.ml/explore/dialect/arabic/)
44
+
45
+ ## Author Information
46
+
47
+ - Author name(s): Nick Doiron
48
+ - Author email: ndoiron@mapmeld.com
49
+ - Author links: [Website](https://github.com/MonsoonNLP/sanaa-dialect), [GitHub](https://github.com/mapmeld), [Twitter](https://twitter.com/@mapmeld)
50
+
51
+ ## Versions
52
+ - `1`
53
+ - `2` **(main)**
54
+
55
+ ## Citation
56
+
57
+ ```bibtex
58
+
59
+ ```
60
+
61
+ *This adapter has been auto-imported from https://github.com/Adapter-Hub/Hub/blob/master/adapters/mapmeld/bert-base-arabert-ar-dialect.yaml*.
adapter_config.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "adapter_residual_before_ln": false,
4
+ "cross_adapter": false,
5
+ "dropout": 0.0,
6
+ "factorized_phm_W": true,
7
+ "factorized_phm_rule": false,
8
+ "hypercomplex_nonlinearity": "glorot-uniform",
9
+ "init_weights": "bert",
10
+ "inv_adapter": null,
11
+ "inv_adapter_reduction_factor": null,
12
+ "is_parallel": false,
13
+ "learn_phm": true,
14
+ "leave_out": [],
15
+ "ln_after": false,
16
+ "ln_before": false,
17
+ "mh_adapter": false,
18
+ "non_linearity": "relu",
19
+ "original_ln_after": true,
20
+ "original_ln_before": true,
21
+ "output_adapter": true,
22
+ "phm_bias": true,
23
+ "phm_c_init": "normal",
24
+ "phm_dim": 4,
25
+ "phm_init_range": 0.0001,
26
+ "phm_layer": false,
27
+ "phm_rank": 1,
28
+ "reduction_factor": 16,
29
+ "residual_before_ln": true,
30
+ "scaling": 1.0,
31
+ "shared_W_phm": false,
32
+ "shared_phm_rule": true,
33
+ "use_gating": false
34
+ },
35
+ "hidden_size": 768,
36
+ "model_class": "BertAdapterModel",
37
+ "model_name": "aubmindlab/bert-base-arabert",
38
+ "model_type": "bert",
39
+ "name": "dialect-arabic",
40
+ "version": "0.2.0"
41
+ }
head_config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "activation_function": "tanh",
4
+ "bias": true,
5
+ "dropout_prob": null,
6
+ "head_type": "classification",
7
+ "label2id": {
8
+ "LABEL_0": 0,
9
+ "LABEL_1": 1,
10
+ "LABEL_2": 2,
11
+ "LABEL_3": 3,
12
+ "LABEL_4": 4
13
+ },
14
+ "layers": 2,
15
+ "num_labels": 5,
16
+ "use_pooler": false
17
+ },
18
+ "hidden_size": 768,
19
+ "model_class": "BertAdapterModel",
20
+ "model_name": "aubmindlab/bert-base-arabert",
21
+ "model_type": "bert",
22
+ "name": "dialect-arabic",
23
+ "version": "0.2.0"
24
+ }
pytorch_adapter.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c338b782bd430ce29c71651763c29d1beeb85c03df48cdeff70bc8c678ef8d0
3
+ size 3595238
pytorch_model_head.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8bc9509d641d5a3e15ed75bac96aea6974cca1979b2a10337600ccac526bb6d
3
+ size 2379880