drelhaj commited on
Commit
457e7e8
·
verified ·
1 Parent(s): b33c95e

Upload 9 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ source.spm filter=lfs diff=lfs merge=lfs -text
37
+ target.spm filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,97 @@
1
  ---
2
- license: cc-by-4.0
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: apache-2.0
3
+ base_model: Helsinki-NLP/opus-mt-en-ar
4
+ tags:
5
+ - machine-translation
6
+ - marian
7
+ - mcwc
8
+ - legal-nlp
9
+ - constitutional-texts
10
+ - generated_from_keras_callback
11
+ model-index:
12
+ - name: marian-finetuned-mcwc-en-to-ar
13
+ results: []
14
  ---
15
+
16
+ # Marian MT fine-tuned on the Multilingual Corpus of World’s Constitutions (MCWC)
17
+ This model is a fine-tuned version of [Helsinki-NLP/opus-mt-es-en](https://huggingface.co/Helsinki-NLP/opus-mt-es-en), adapted using high-quality sentence-aligned constitutional text from the **Multilingual Corpus of World’s Constitutions (MCWC)**
18
+ 📄 MCWC paper (OSACT 2024): https://aclanthology.org/2024.osact-1.7/
19
+
20
+ **This variant handles: _English → Arabic_ translation.**
21
+
22
+ ---
23
+
24
+ ## Overview
25
+ The MCWC provides a curated multilingual collection of constitutional texts from countries across the world. The corpus emphasises data cleanliness, high-quality sentence alignment, and detailed metadata (including country and continent mappings). It supports research in:
26
+
27
+ - legal and constitutional NLP
28
+ - comparative constitutional studies
29
+ - multilingual machine translation
30
+ - cross-lingual semantic analysis
31
+
32
+ This model was fine-tuned on the English–Arabic segment of the MCWC, enabling translation that is more attuned to legal and constitutional language than general-purpose MT systems.
33
+
34
+ ---
35
+
36
+ ## Intended use
37
+ This model is suitable for tasks such as:
38
+
39
+ - translating constitutional or legal documents
40
+ - cross-lingual legal text comparison
41
+ - multilingual information extraction
42
+ - downstream legal NLP tasks requiring domain-specific MT
43
+
44
+ It is **not** intended for casual or conversational translation, as it is optimised for formal and legal text.
45
+
46
+ ---
47
+
48
+ ## Training data
49
+ The model was trained on the MCWC’s English–Arabic aligned sentence pairs.
50
+ The MCWC dataset includes:
51
+
52
+ - cleaned constitutional text
53
+ - high-quality sentence segmentation
54
+ - pairwise alignments
55
+ - country and regional metadata
56
+
57
+ More details may be found in the accompanying paper:
58
+ > *El-Haj, M. & Ezzini, S. (2024). “The Multilingual Corpus of World’s Constitutions (MCWC).”*
59
+ > OSACT @ LREC-COLING 2024.
60
+ > https://aclanthology.org/2024.osact-1.7/
61
+
62
+ ---
63
+
64
+ ## Training procedure
65
+
66
+ ### Training hyperparameters
67
+
68
+ The following hyperparameters were used during training:
69
+ - optimizer: {'name': 'AdamWeightDecay', 'learning_rate': {'module': 'keras.optimizers.schedules', 'class_name': 'PolynomialDecay', 'config': {'initial_learning_rate': 5e-05, 'decay_steps': 3912, 'end_learning_rate': 0.0, 'power': 1.0, 'cycle': False, 'name': None}, 'registered_name': None}, 'decay': 0.0, 'beta_1': 0.9, 'beta_2': 0.999, 'epsilon': 1e-08, 'amsgrad': False, 'weight_decay_rate': 0.01}
70
+ - training_precision: mixed_float16
71
+
72
+ ### Training results
73
+
74
+ | Train Loss | Validation Loss | Epoch |
75
+ |:----------:|:---------------:|:-----:|
76
+ | 1.8177 | 1.6380 | 0 |
77
+ | 1.5158 | 1.5928 | 1 |
78
+ | 1.3738 | 1.5802 | 2 |
79
+
80
+
81
+ ### Framework versions
82
+
83
+ - Transformers 4.33.3
84
+ - TensorFlow 2.13.0
85
+ - Datasets 2.14.5
86
+ - Tokenizers 0.13.3
87
+
88
+ ---
89
+
90
+ ## Citation
91
+
92
+ If you use this model, please cite the MCWC paper:
93
+
94
+ **El-Haj, M. & Ezzini, S. (2024).**
95
+ *The Multilingual Corpus of World’s Constitutions (MCWC).*
96
+ Proceedings of OSACT @ LREC-COLING 2024.
97
+ https://aclanthology.org/2024.osact-1.7/
config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "Helsinki-NLP/opus-mt-en-ar",
3
+ "activation_dropout": 0.0,
4
+ "activation_function": "swish",
5
+ "add_bias_logits": false,
6
+ "add_final_layer_norm": false,
7
+ "architectures": [
8
+ "MarianMTModel"
9
+ ],
10
+ "attention_dropout": 0.0,
11
+ "bad_words_ids": [
12
+ [
13
+ 62801
14
+ ]
15
+ ],
16
+ "bos_token_id": 0,
17
+ "classif_dropout": 0.0,
18
+ "classifier_dropout": 0.0,
19
+ "d_model": 512,
20
+ "decoder_attention_heads": 8,
21
+ "decoder_ffn_dim": 2048,
22
+ "decoder_layerdrop": 0.0,
23
+ "decoder_layers": 6,
24
+ "decoder_start_token_id": 62801,
25
+ "decoder_vocab_size": 62802,
26
+ "dropout": 0.1,
27
+ "encoder_attention_heads": 8,
28
+ "encoder_ffn_dim": 2048,
29
+ "encoder_layerdrop": 0.0,
30
+ "encoder_layers": 6,
31
+ "eos_token_id": 0,
32
+ "extra_pos_embeddings": 62802,
33
+ "forced_eos_token_id": 0,
34
+ "id2label": {
35
+ "0": "LABEL_0",
36
+ "1": "LABEL_1",
37
+ "2": "LABEL_2"
38
+ },
39
+ "init_std": 0.02,
40
+ "is_encoder_decoder": true,
41
+ "label2id": {
42
+ "LABEL_0": 0,
43
+ "LABEL_1": 1,
44
+ "LABEL_2": 2
45
+ },
46
+ "max_length": 512,
47
+ "max_position_embeddings": 512,
48
+ "model_type": "marian",
49
+ "normalize_before": false,
50
+ "normalize_embedding": false,
51
+ "num_beams": 4,
52
+ "num_hidden_layers": 6,
53
+ "pad_token_id": 62801,
54
+ "scale_embedding": true,
55
+ "share_encoder_decoder_embeddings": true,
56
+ "static_position_embeddings": true,
57
+ "transformers_version": "4.33.3",
58
+ "use_cache": true,
59
+ "vocab_size": 62802
60
+ }
generation_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bad_words_ids": [
4
+ [
5
+ 62801
6
+ ]
7
+ ],
8
+ "bos_token_id": 0,
9
+ "decoder_start_token_id": 62801,
10
+ "eos_token_id": 0,
11
+ "forced_eos_token_id": 0,
12
+ "max_length": 512,
13
+ "num_beams": 4,
14
+ "pad_token_id": 62801,
15
+ "transformers_version": "4.33.3"
16
+ }
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:81ac8f4d4ee271f4109eac67560a31f9c2d555463ba5eb95c32c6deee8ae819d
3
+ size 801074
special_tokens_map.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "eos_token": "</s>",
3
+ "pad_token": "<pad>",
4
+ "unk_token": "<unk>"
5
+ }
target.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67d0f6afb87768c078ee46c0756b8cc94b1ec23c5526b49ecf6c3b2f9197ec39
3
+ size 916890
tf_model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2d22e60ead73d8473f828ab238c9b9a12b9fafe1e4002c845058a40d66ab651
3
+ size 307808248
tokenizer_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "clean_up_tokenization_spaces": true,
3
+ "eos_token": "</s>",
4
+ "model_max_length": 512,
5
+ "pad_token": "<pad>",
6
+ "return_tensors": "pt",
7
+ "separate_vocabs": false,
8
+ "source_lang": "eng",
9
+ "sp_model_kwargs": {},
10
+ "target_lang": "ara",
11
+ "tokenizer_class": "MarianTokenizer",
12
+ "unk_token": "<unk>"
13
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff