drelhaj commited on
Commit
d08f9ca
·
verified ·
1 Parent(s): 9b00495

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +211 -258
README.md CHANGED
@@ -1,258 +1,211 @@
1
- ---
2
- license: cc-by-nc-4.0
3
- tags:
4
- - legal-nlp
5
- - multilingual
6
- - constitutions
7
- - machine-translation
8
- - comparative-law
9
- - mcwc
10
- dataset-name: MCWC
11
- ---
12
-
13
- # Multilingual Corpus of World’s Constitutions (MCWC)
14
-
15
- The **MCWC** is a curated multilingual corpus of constitutional texts from **191 countries**, including both current and historical versions. The dataset provides aligned constitutional content in **English, Arabic, and Spanish**, enabling comparative legal analysis and multilingual NLP research.
16
-
17
- This CSV version is a cleaned, structured, and sentence-aligned representation of the corpus, suitable for machine translation, information retrieval, and a wide range of legal NLP tasks.
18
-
19
- 📄 **Paper (OSACT @ LREC-COLING 2024):**
20
- https://aclanthology.org/2024.osact-1.7/
21
-
22
- ---
23
-
24
- ## Contents of the dataset
25
-
26
- `MCWC.csv` contains:
27
-
28
- - **Constitutional text in three languages:** English, Arabic, Spanish
29
- - **Pairwise sentence alignments** using a stable `AlignID`
30
- - **Country and continent metadata**
31
- - **Cleaned and normalised text** for direct use in NLP pipelines
32
- - **Translations** for constitutions originally missing in Arabic or Spanish, generated using a fine-tuned NMT model
33
- - **One row per sentence**, enabling easy filtering and cross-lingual matching
34
-
35
- Typical columns include:
36
-
37
- - `country`
38
- - `continent`
39
- - `align_id`
40
- - `text_en`
41
- - `text_ar`
42
- - `text_es`
43
- - `constitution_year`
44
- - `language_source` (original vs. machine-translated)
45
-
46
- ---
47
-
48
- ## Motivation
49
-
50
- Constitutions form the legal and philosophical foundation of nation-states. However, constitutional research is often limited by:
51
-
52
- - fragmented access to multilingual versions
53
- - inconsistent formatting and metadata
54
- - lack of high-quality sentence alignment
55
- - scarcity of constitutional text in Arabic and Spanish
56
-
57
- The MCWC addresses these gaps by offering a unified and multilingual corpus built for computational analysis, comparative constitutional research, and machine translation development.
58
-
59
- The acronym **MCWC** is pronounced *“Makkuk”*, an Arabic word for *space shuttle*, chosen to symbolise the corpus’s role in enabling cross-lingual travel between legal systems.
60
-
61
- ---
62
-
63
- ## Data sources and preparation
64
-
65
- The corpus integrates material from:
66
-
67
- - the Comparative Constitutions Project
68
- - the Constitute Project
69
- - Wikipedia and various governmental archives
70
-
71
- Raw texts—primarily in XML—were normalised, cleaned, and sentence-segmented. For constitutions lacking Arabic or Spanish versions, we generated translations using a fine-tuned state-of-the-art MT model.
72
-
73
- A custom parser aligned sentences across languages using structural cues (article numbers, section labels, etc.), with each sentence assigned a persistent `AlignID` for alignment across all three languages.
74
-
75
- To support comparative analysis, we applied:
76
-
77
- - continent classification via gazetteer matching
78
- - tokenisation and normalisation
79
- - vocabulary overlap statistics
80
- - TF-IDF cosine-similarity analysis (English)
81
-
82
- The paper provides further detail, including heatmaps of by-continent overlap and cross-lingual similarity.
83
-
84
- ---
85
-
86
- ## Dataset statistics
87
-
88
- - **223 constitutions**
89
- - **191 countries**
90
- - **95 constitutions available in all three languages**
91
- - **52,177 aligned English–Arabic sentences**
92
- - **48,892 aligned English–Spanish sentences**
93
- - **27,352 aligned Arabic–Spanish sentences**
94
- - **236,156 parallel machine-generated sentences** (SeamlessM4T-v2)
95
-
96
- Across continents:
97
-
98
- - Africa: 65 constitutions
99
- - Asia: 54
100
- - Europe: 49
101
- - North America: 26
102
- - South America: 15
103
- - Oceania: 14
104
-
105
- Average lengths and TTR values are reported in the paper.
106
-
107
- ---
108
-
109
- ## Intended uses
110
-
111
- The MCWC is designed to support:
112
-
113
- - multilingual machine translation
114
- - legal text analysis and retrieval
115
- - constitutional comparison and modelling
116
- - multilingual topic modelling
117
- - cross-lingual semantic similarity
118
- - legal corpus linguistics
119
- - training/testing MT systems for legal text
120
-
121
- Users may also employ the dataset to study variation in legal language across jurisdictions and historical periods.
122
-
123
- ---
124
-
125
- ## Translation and evaluation
126
-
127
- For missing Arabic/Spanish texts, English constitutions were translated using **Facebook’s Seamless-m4t-v2-large**.
128
-
129
- Evaluation included:
130
-
131
- - **BLEU = 0.68** on 500 manually inspected En–Ar and En–Es pairs
132
- - **Human annotation** by two Arabic NLP experts
133
- - Cohen’s κ = 0.30 (due to label imbalance)
134
- - Krippendorff’s α ≈ 0.90 (robust reliability)
135
-
136
- Fine-tuned Marian NMT models trained on the MCWC consistently improved translation quality across all six language pairs. These models are available on HuggingFace.
137
-
138
- ---
139
- ### Train / Validation / Test Splits
140
-
141
- The original MCWC paper does not define an official train–validation–test split.
142
- To support reproducibility and facilitate machine-learning experiments, we provide a recommended **80/10/10** split using a fixed random seed. This ensures consistent partitioning whilst keeping the dataset fully shuffled.
143
-
144
- The split is applied over the complete CSV file (`MCWC.csv`) and does not use stratification, as constitutional texts vary considerably across countries and languages.
145
-
146
- #### Splitting script
147
-
148
- ```python
149
- import pandas as pd
150
- from sklearn.model_selection import train_test_split
151
-
152
- # Load the full corpus
153
- df = pd.read_csv("MCWC.csv")
154
-
155
- # First split: train vs temporary (validation + test)
156
- train_df, temp_df = train_test_split(
157
- df,
158
- test_size=0.2, # 20% goes to val+test
159
- random_state=42,
160
- shuffle=True
161
- )
162
-
163
- # Second split: create separate validation and test sets
164
- val_df, test_df = train_test_split(
165
- temp_df,
166
- test_size=0.5, # half of 20% → 10% each
167
- random_state=42,
168
- shuffle=True
169
- )
170
-
171
- # Save the splits
172
- train_df.to_csv("MCWC_train.csv", index=False)
173
- val_df.to_csv("MCWC_val.csv", index=False)
174
- test_df.to_csv("MCWC_test.csv", index=False)
175
-
176
- print("Train:", len(train_df))
177
- print("Validation:", len(val_df))
178
- print("Test:", len(test_df))
179
- ```
180
-
181
- This produces three files:
182
-
183
- - `MCWC_train.csv`
184
- - `MCWC_val.csv`
185
- - `MCWC_test.csv`
186
-
187
- These splits can be uploaded to HuggingFace or used directly for machine translation, classification, or any downstream constitutional NLP research.
188
-
189
- ---
190
-
191
- ### Train–Validation–Test Split
192
-
193
- ```python
194
- import pandas as pd
195
- from sklearn.model_selection import train_test_split
196
-
197
- # Load the full corpus
198
- df = pd.read_csv("MCWC.csv")
199
-
200
- # First split: train vs temporary (validation + test)
201
- train_df, temp_df = train_test_split(
202
- df,
203
- test_size=0.2, # 20% goes to val+test
204
- random_state=42,
205
- shuffle=True
206
- )
207
-
208
- # Second split: create separate validation and test sets
209
- val_df, test_df = train_test_split(
210
- temp_df,
211
- test_size=0.5, # half of 20% → 10% each
212
- random_state=42,
213
- shuffle=True
214
- )
215
-
216
- # Save the splits
217
- train_df.to_csv("MCWC_train.csv", index=False)
218
- val_df.to_csv("MCWC_val.csv", index=False)
219
- test_df.to_csv("MCWC_test.csv", index=False)
220
-
221
- print("Train:", len(train_df))
222
- print("Validation:", len(val_df))
223
- print("Test:", len(test_df))
224
- ```
225
-
226
- ---
227
-
228
- ## Ethical considerations and limitations
229
-
230
- - Source texts originate from open datasets (CCP, Constitute Project) and governmental archives.
231
- - This CSV is a *processed* and *aligned* derivative, not a redistribution of the original XML files.
232
- - Translation quality varies depending on source material and MT system limitations.
233
- - Some constitutions contain archaic, historical, or culturally-specific legal phrasing that may not translate literally.
234
- - Differences in translation providers (HeinOnline, IDEA, OUP, etc.) may introduce stylistic or interpretative variance.
235
-
236
- Users requiring original XML files should retrieve them directly from the Constitute Project.
237
-
238
- ---
239
-
240
- ## Citation
241
-
242
- If you use this dataset, please cite:
243
-
244
- **El-Haj, M. & Ezzini, S. (2024).**
245
- *The Multilingual Corpus of World’s Constitutions (MCWC).*
246
- OSACT Workshop @ LREC-COLING 2024.
247
- https://aclanthology.org/2024.osact-1.7/
248
-
249
- ---
250
-
251
- ## Contact
252
-
253
- For questions or collaboration:
254
-
255
- **Mo El-Haj**
256
- UCREL NLP Group
257
- Lancaster University & VinUniversity
258
- Email: m.el-haj@lancaster.ac.uk / elhaj.m@vinuni.edu.vn
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ tags:
4
+ - legal-nlp
5
+ - multilingual
6
+ - constitutions
7
+ - machine-translation
8
+ - comparative-law
9
+ - mcwc
10
+ dataset-name: MCWC
11
+ ---
12
+
13
+ # Multilingual Corpus of World’s Constitutions (MCWC)
14
+
15
+ The **MCWC** is a curated multilingual corpus of constitutional texts from **191 countries**, including both current and historical versions. The dataset provides aligned constitutional content in **English, Arabic, and Spanish**, enabling comparative legal analysis and multilingual NLP research.
16
+
17
+ This CSV version is a cleaned, structured, and sentence-aligned representation of the corpus, suitable for machine translation, information retrieval, and a wide range of legal NLP tasks.
18
+
19
+ 📄 **Paper (OSACT @ LREC-COLING 2024):**
20
+ https://aclanthology.org/2024.osact-1.7/
21
+
22
+ ---
23
+
24
+ ## Contents of the dataset
25
+
26
+ `MCWC.csv` contains:
27
+
28
+ - **Constitutional text in three languages:** English, Arabic, Spanish
29
+ - **Pairwise sentence alignments** using a stable `AlignID`
30
+ - **Country and continent metadata**
31
+ - **Cleaned and normalised text** for direct use in NLP pipelines
32
+ - **Translations** for constitutions originally missing in Arabic or Spanish, generated using a fine-tuned NMT model
33
+ - **One row per sentence**, enabling easy filtering and cross-lingual matching
34
+
35
+ Typical columns include:
36
+
37
+ - `country`
38
+ - `continent`
39
+ - `align_id`
40
+ - `text_en`
41
+ - `text_ar`
42
+ - `text_es`
43
+ - `constitution_year`
44
+ - `language_source` (original vs. machine-translated)
45
+
46
+ ---
47
+
48
+ ## Motivation
49
+
50
+ Constitutions form the legal and philosophical foundation of nation-states. However, constitutional research is often limited by:
51
+
52
+ - fragmented access to multilingual versions
53
+ - inconsistent formatting and metadata
54
+ - lack of high-quality sentence alignment
55
+ - scarcity of constitutional text in Arabic and Spanish
56
+
57
+ The MCWC addresses these gaps by offering a unified and multilingual corpus built for computational analysis, comparative constitutional research, and machine translation development.
58
+
59
+ The acronym **MCWC** is pronounced *“Makkuk”*, an Arabic word for *space shuttle*, chosen to symbolise the corpus’s role in enabling cross-lingual travel between legal systems.
60
+
61
+ ---
62
+
63
+ ## Data sources and preparation
64
+
65
+ The corpus integrates material from:
66
+
67
+ - the Comparative Constitutions Project
68
+ - the Constitute Project
69
+ - Wikipedia and various governmental archives
70
+
71
+ Raw texts—primarily in XML—were normalised, cleaned, and sentence-segmented. For constitutions lacking Arabic or Spanish versions, we generated translations using a fine-tuned state-of-the-art MT model.
72
+
73
+ A custom parser aligned sentences across languages using structural cues (article numbers, section labels, etc.), with each sentence assigned a persistent `AlignID` for alignment across all three languages.
74
+
75
+ To support comparative analysis, we applied:
76
+
77
+ - continent classification via gazetteer matching
78
+ - tokenisation and normalisation
79
+ - vocabulary overlap statistics
80
+ - TF-IDF cosine-similarity analysis (English)
81
+
82
+ The paper provides further detail, including heatmaps of by-continent overlap and cross-lingual similarity.
83
+
84
+ ---
85
+
86
+ ## Dataset statistics
87
+
88
+ - **223 constitutions**
89
+ - **191 countries**
90
+ - **95 constitutions available in all three languages**
91
+ - **52,177 aligned English–Arabic sentences**
92
+ - **48,892 aligned English–Spanish sentences**
93
+ - **27,352 aligned Arabic–Spanish sentences**
94
+ - **236,156 parallel machine-generated sentences** (SeamlessM4T-v2)
95
+
96
+ Across continents:
97
+
98
+ - Africa: 65 constitutions
99
+ - Asia: 54
100
+ - Europe: 49
101
+ - North America: 26
102
+ - South America: 15
103
+ - Oceania: 14
104
+
105
+ Average lengths and TTR values are reported in the paper.
106
+
107
+ ---
108
+
109
+ ## Intended uses
110
+
111
+ The MCWC is designed to support:
112
+
113
+ - multilingual machine translation
114
+ - legal text analysis and retrieval
115
+ - constitutional comparison and modelling
116
+ - multilingual topic modelling
117
+ - cross-lingual semantic similarity
118
+ - legal corpus linguistics
119
+ - training/testing MT systems for legal text
120
+
121
+ Users may also employ the dataset to study variation in legal language across jurisdictions and historical periods.
122
+
123
+ ---
124
+
125
+ ## Translation and evaluation
126
+
127
+ For missing Arabic/Spanish texts, English constitutions were translated using **Facebook’s Seamless-m4t-v2-large**.
128
+
129
+ Evaluation included:
130
+
131
+ - **BLEU = 0.68** on 500 manually inspected En–Ar and En–Es pairs
132
+ - **Human annotation** by two Arabic NLP experts
133
+ - Cohen’s κ = 0.30 (due to label imbalance)
134
+ - Krippendorff’s α ≈ 0.90 (robust reliability)
135
+
136
+ Fine-tuned Marian NMT models trained on the MCWC consistently improved translation quality across all six language pairs. These models are available on HuggingFace.
137
+
138
+ ---
139
+ ### Train / Validation / Test Splits
140
+
141
+ The original MCWC paper does not define an official train–validation–test split.
142
+ To support reproducibility and facilitate machine-learning experiments, we provide a recommended **80/10/10** split using a fixed random seed. This ensures consistent partitioning whilst keeping the dataset fully shuffled.
143
+
144
+ The split is applied over the complete CSV file (`MCWC.csv`) and does not use stratification, as constitutional texts vary considerably across countries and languages.
145
+
146
+ ```python
147
+ import pandas as pd
148
+ from sklearn.model_selection import train_test_split
149
+
150
+ # Load the full corpus
151
+ df = pd.read_csv("MCWC.csv")
152
+
153
+ # First split: train vs temporary (validation + test)
154
+ train_df, temp_df = train_test_split(
155
+ df,
156
+ test_size=0.2, # 20% goes to val+test
157
+ random_state=42,
158
+ shuffle=True
159
+ )
160
+
161
+ # Second split: create separate validation and test sets
162
+ val_df, test_df = train_test_split(
163
+ temp_df,
164
+ test_size=0.5, # half of 20% → 10% each
165
+ random_state=42,
166
+ shuffle=True
167
+ )
168
+
169
+ # Save the splits
170
+ train_df.to_csv("MCWC_train.csv", index=False)
171
+ val_df.to_csv("MCWC_val.csv", index=False)
172
+ test_df.to_csv("MCWC_test.csv", index=False)
173
+
174
+ print("Train:", len(train_df))
175
+ print("Validation:", len(val_df))
176
+ print("Test:", len(test_df))
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Ethical considerations and limitations
182
+
183
+ - Source texts originate from open datasets (CCP, Constitute Project) and governmental archives.
184
+ - This CSV is a *processed* and *aligned* derivative, not a redistribution of the original XML files.
185
+ - Translation quality varies depending on source material and MT system limitations.
186
+ - Some constitutions contain archaic, historical, or culturally-specific legal phrasing that may not translate literally.
187
+ - Differences in translation providers (HeinOnline, IDEA, OUP, etc.) may introduce stylistic or interpretative variance.
188
+
189
+ Users requiring original XML files should retrieve them directly from the Constitute Project.
190
+
191
+ ---
192
+
193
+ ## Citation
194
+
195
+ If you use this dataset, please cite:
196
+
197
+ **El-Haj, M. & Ezzini, S. (2024).**
198
+ *The Multilingual Corpus of World’s Constitutions (MCWC).*
199
+ OSACT Workshop @ LREC-COLING 2024.
200
+ https://aclanthology.org/2024.osact-1.7/
201
+
202
+ ---
203
+
204
+ ## Contact
205
+
206
+ For questions or collaboration:
207
+
208
+ **Mo El-Haj**
209
+ UCREL NLP Group
210
+ Lancaster University & VinUniversity
211
+ Email: m.el-haj@lancaster.ac.uk / elhaj.m@vinuni.edu.vn