joelniklaus
commited on
Commit
•
d35cbd8
1
Parent(s):
f885dee
added first version of the Multi_Legal_Pile
Browse files- .gitattributes +23 -0
- Multi_Legal_Pile.py +396 -0
- README.md +194 -0
- data/bg/legislation/bulgaria_marcell.jsonl.xz +3 -0
- data/cs/caselaw/czechia_constitutional_court.jsonl.xz +3 -0
- data/cs/caselaw/czechia_supreme_administrative_court.jsonl.xz +3 -0
- data/cs/caselaw/czechia_supreme_court.jsonl.xz +3 -0
- data/da/caselaw/denmark_ddsc.jsonl.xz +3 -0
- data/da/legislation/denmark_ddsc.jsonl.xz +3 -0
- data/de/caselaw/germany_openlegaldata.jsonl.xz +3 -0
- data/de/legislation/germany_openlegaldata.jsonl.xz +3 -0
- data/de/legislation/switzerland_lexfind.jsonl.xz +3 -0
- data/en/legislation/switzerland_lexfind.jsonl.xz +3 -0
- data/fr/caselaw/belgium_jurportal.jsonl.xz +3 -0
- data/fr/caselaw/france_cass.jsonl.xz +3 -0
- data/fr/caselaw/luxembourg_judoc.jsonl.xz +3 -0
- data/fr/legislation/belgium_ejustice.jsonl.xz +3 -0
- data/fr/legislation/switzerland_lexfind.jsonl.xz +3 -0
- data/hu/caselaw/hungary_marcell.jsonl.xz +3 -0
- data/it/legislation/switzerland_lexfind.jsonl.xz +3 -0
- data/nl/legislation/belgium_ejustice.jsonl.xz +3 -0
- data/pl/legislation/poland_marcell.jsonl.xz +3 -0
- data/pt/caselaw/brazil_rulingbr.jsonl.xz +3 -0
- data/ro/legislation/romania_marcell.jsonl.xz +3 -0
- data/sk/legislation/slovakia_marcell.jsonl.xz +3 -0
- data/sl/legislation/slovenia_marcell.jsonl.xz +3 -0
.gitattributes
CHANGED
@@ -49,3 +49,26 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
49 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
50 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
51 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
50 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
51 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
52 |
+
data/da/legislation/denmark_ddsc.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
53 |
+
data/fr/caselaw/belgium_jurportal.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
54 |
+
data/fr/caselaw/france_cass.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
55 |
+
data/fr/legislation/belgium_ejustice.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
56 |
+
data/fr/legislation/switzerland_lexfind.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
57 |
+
data/hu/caselaw/hungary_marcell.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
58 |
+
data/bg/legislation/bulgaria_marcell.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
59 |
+
data/cs/caselaw/czechia_supreme_court.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
60 |
+
data/nl/legislation/belgium_ejustice.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
61 |
+
data/ro/legislation/romania_marcell.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
62 |
+
data/de/legislation/switzerland_lexfind.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
63 |
+
data/fr/caselaw/luxembourg_judoc.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
64 |
+
data/de/legislation/germany_openlegaldata.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
65 |
+
data/en/legislation/switzerland_lexfind.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
66 |
+
data/it/legislation/switzerland_lexfind.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
67 |
+
data/pl/legislation/poland_marcell.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
68 |
+
data/sk/legislation/slovakia_marcell.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
69 |
+
data/da/caselaw/denmark_ddsc.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
70 |
+
data/de/caselaw/germany_openlegaldata.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
71 |
+
data/pt/caselaw/brazil_rulingbr.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
72 |
+
data/sl/legislation/slovenia_marcell.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
73 |
+
data/cs/caselaw/czechia_constitutional_court.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
74 |
+
data/cs/caselaw/czechia_supreme_administrative_court.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
Multi_Legal_Pile.py
ADDED
@@ -0,0 +1,396 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
2 |
+
|
3 |
+
import json
|
4 |
+
|
5 |
+
import datasets
|
6 |
+
from huggingface_hub.file_download import hf_hub_url
|
7 |
+
|
8 |
+
try:
|
9 |
+
import lzma as xz
|
10 |
+
except ImportError:
|
11 |
+
import pylzma as xz
|
12 |
+
|
13 |
+
datasets.logging.set_verbosity_info()
|
14 |
+
logger = datasets.logging.get_logger(__name__)
|
15 |
+
|
16 |
+
_DESCRIPTION = """
|
17 |
+
"""
|
18 |
+
|
19 |
+
_CITATION = """
|
20 |
+
"""
|
21 |
+
|
22 |
+
_URL = "https://huggingface.co/datasets/joelito/Multi_Legal_Pile"
|
23 |
+
|
24 |
+
# Specific Data
|
25 |
+
_DATA_NAME = {
|
26 |
+
"bg": {
|
27 |
+
"legislation": ["bulgaria_marcell"],
|
28 |
+
},
|
29 |
+
"cs": {
|
30 |
+
"caselaw": ["czechia_constitutional_court", "czechia_supreme_administrative_court", "czechia_supreme_court"],
|
31 |
+
},
|
32 |
+
"da": {
|
33 |
+
"caselaw": ["denmark_ddsc"],
|
34 |
+
"legislation": ["denmark_ddsc"],
|
35 |
+
},
|
36 |
+
"de": {
|
37 |
+
"caselaw": ["germany_openlegaldata"],
|
38 |
+
"legislation": ["germany_openlegaldata", "switzerland_lexfind"],
|
39 |
+
},
|
40 |
+
"en": {
|
41 |
+
"legislation": ["switzerland_lexfind"],
|
42 |
+
},
|
43 |
+
"fr": {
|
44 |
+
"caselaw": ["belgium_jurportal", "france_cass", "luxembourg_judoc"],
|
45 |
+
"legislation": ["belgium_ejustice", "switzerland_lexfind"],
|
46 |
+
},
|
47 |
+
"hu": {
|
48 |
+
"caselaw": ["hungary_marcell"],
|
49 |
+
},
|
50 |
+
"it": {
|
51 |
+
"legislation": ["switzerland_lexfind"],
|
52 |
+
},
|
53 |
+
"nl": {
|
54 |
+
"legislation": ["belgium_ejustice"],
|
55 |
+
},
|
56 |
+
"pl": {
|
57 |
+
"legislation": ["poland_marcell"],
|
58 |
+
},
|
59 |
+
"pt": {
|
60 |
+
"caselaw": ["barzil_ruling_br"],
|
61 |
+
},
|
62 |
+
"ro": {
|
63 |
+
"legislation": ["romania_marcell"],
|
64 |
+
},
|
65 |
+
"sk": {
|
66 |
+
"legislation": ["slovakia_marcell"],
|
67 |
+
},
|
68 |
+
"sl": {
|
69 |
+
"legislation": ["slovenia_marcell"],
|
70 |
+
},
|
71 |
+
}
|
72 |
+
|
73 |
+
_PILE_OF_LAW_NAMES = {
|
74 |
+
"caselaw": {
|
75 |
+
"courtlistener_docket_entry_documents": {
|
76 |
+
"train": [
|
77 |
+
"train.courtlistenerdocketentries.0",
|
78 |
+
"train.courtlistenerdocketentries.1",
|
79 |
+
"train.courtlistenerdocketentries.2",
|
80 |
+
"train.courtlistenerdocketentries.3"
|
81 |
+
],
|
82 |
+
"validation": [
|
83 |
+
"validation.courtlistenerdocketentries.0",
|
84 |
+
"validation.courtlistenerdocketentries.1"
|
85 |
+
]
|
86 |
+
},
|
87 |
+
"courtlistener_opinions": {
|
88 |
+
"train": [
|
89 |
+
"train.courtlisteneropinions.0",
|
90 |
+
"train.courtlisteneropinions.1",
|
91 |
+
"train.courtlisteneropinions.2",
|
92 |
+
"train.courtlisteneropinions.3",
|
93 |
+
"train.courtlisteneropinions.4",
|
94 |
+
"train.courtlisteneropinions.5",
|
95 |
+
"train.courtlisteneropinions.6",
|
96 |
+
"train.courtlisteneropinions.7",
|
97 |
+
"train.courtlisteneropinions.8",
|
98 |
+
"train.courtlisteneropinions.9",
|
99 |
+
],
|
100 |
+
"validation": [
|
101 |
+
"validation.courtlisteneropinions.0",
|
102 |
+
"validation.courtlisteneropinions.1",
|
103 |
+
"validation.courtlisteneropinions.2",
|
104 |
+
"validation.courtlisteneropinions.3"
|
105 |
+
]
|
106 |
+
},
|
107 |
+
"ftc_advisory_opinions": {
|
108 |
+
"train": ["train.ftc_advisory_opinions"],
|
109 |
+
"validation": ["validation.ftc_advisory_opinions"]
|
110 |
+
},
|
111 |
+
"eoir": {
|
112 |
+
"train": ["train.eoir"],
|
113 |
+
"validation": ["validation.eoir"]
|
114 |
+
},
|
115 |
+
"bva_opinions": {
|
116 |
+
"train": ["train.bva"],
|
117 |
+
"validation": ["validation.bva"]
|
118 |
+
},
|
119 |
+
"tax_rulings": {
|
120 |
+
"train": ["train.taxrulings"],
|
121 |
+
"validation": ["validation.taxrulings"]
|
122 |
+
},
|
123 |
+
"scotus_filings": {
|
124 |
+
"train": ["train.scotus_docket_entries"],
|
125 |
+
"validation": ["validation.scotus_docket_entries"]
|
126 |
+
},
|
127 |
+
"nlrb_decisions": {
|
128 |
+
"train": ["train.nlrb_decisions"],
|
129 |
+
"validation": ["validation.nlrb_decisions"]
|
130 |
+
},
|
131 |
+
"dol_ecab": {
|
132 |
+
"train": ["train.dol_ecab"],
|
133 |
+
"validation": ["validation.dol_ecab"]
|
134 |
+
},
|
135 |
+
"echr": {
|
136 |
+
"train": ["train.echr"],
|
137 |
+
"validation": ["validation.echr"]
|
138 |
+
},
|
139 |
+
"canadian_decisions": {
|
140 |
+
"train": ["train.canadian_decisions"],
|
141 |
+
"validation": ["validation.canadian_decisions"]
|
142 |
+
},
|
143 |
+
},
|
144 |
+
"contracts": {
|
145 |
+
"atticus_contracts": {
|
146 |
+
"train": [
|
147 |
+
"train.atticus_contracts.0",
|
148 |
+
"train.atticus_contracts.1",
|
149 |
+
"train.atticus_contracts.2",
|
150 |
+
"train.atticus_contracts.3",
|
151 |
+
"train.atticus_contracts.4"
|
152 |
+
],
|
153 |
+
"validation": [
|
154 |
+
"validation.atticus_contracts.0",
|
155 |
+
"validation.atticus_contracts.1"
|
156 |
+
]
|
157 |
+
},
|
158 |
+
"edgar": {
|
159 |
+
"train": ["train.edgar"],
|
160 |
+
"validation": ["validation.edgar"]
|
161 |
+
},
|
162 |
+
"cfpb_creditcard_contracts": {
|
163 |
+
"train": ["train.cfpb_cc"],
|
164 |
+
"validation": ["validation.cfpb_cc"]
|
165 |
+
},
|
166 |
+
"tos": {
|
167 |
+
"train": ["train.tos"],
|
168 |
+
"validation": ["validation.tos"]
|
169 |
+
},
|
170 |
+
},
|
171 |
+
"legislation": {
|
172 |
+
"state_codes": {
|
173 |
+
"train": ["train.state_code"],
|
174 |
+
"validation": ["validation.state_code"]
|
175 |
+
},
|
176 |
+
"federal_register": {
|
177 |
+
"train": ["train.federal_register"],
|
178 |
+
"validation": ["validation.federal_register"]
|
179 |
+
},
|
180 |
+
"us_bills": {
|
181 |
+
"train": ["train.us_bills"],
|
182 |
+
"validation": ["validation.us_bills"]
|
183 |
+
},
|
184 |
+
"uscode": {
|
185 |
+
"train": ["train.uscode"],
|
186 |
+
"validation": ["validation.uscode"]
|
187 |
+
},
|
188 |
+
"founding_docs": {
|
189 |
+
"train": ["train.founding_docs"],
|
190 |
+
"validation": ["validation.founding_docs"]
|
191 |
+
},
|
192 |
+
"constitutions": {
|
193 |
+
"train": ["train.constitutions"],
|
194 |
+
"validation": ["validation.constitutions"]
|
195 |
+
},
|
196 |
+
"cfr": {
|
197 |
+
"train": ["train.cfr"],
|
198 |
+
"validation": ["validation.cfr"]
|
199 |
+
},
|
200 |
+
"fre": {
|
201 |
+
"train": ["train.fre"],
|
202 |
+
"validation": ["validation.fre"]
|
203 |
+
},
|
204 |
+
"frcp": {
|
205 |
+
"train": ["train.frcp"],
|
206 |
+
"validation": ["validation.frcp"]
|
207 |
+
},
|
208 |
+
},
|
209 |
+
"analyses": {
|
210 |
+
"oig": {
|
211 |
+
"train": ["train.oig"],
|
212 |
+
"validation": ["validation.oig"]
|
213 |
+
},
|
214 |
+
"olc_memos": {
|
215 |
+
"train": ["train.olcmemos"],
|
216 |
+
"validation": ["validation.olcmemos"]
|
217 |
+
},
|
218 |
+
},
|
219 |
+
"conversations": {
|
220 |
+
"r_legaladvice": {
|
221 |
+
"train": ["train.r_legaldvice"],
|
222 |
+
"validation": ["validation.r_legaldvice"]
|
223 |
+
},
|
224 |
+
"euro_parl": {
|
225 |
+
"train": ["train.euro_parl"],
|
226 |
+
"validation": ["validation.euro_parl"]
|
227 |
+
},
|
228 |
+
"un_debates": {
|
229 |
+
"train": ["train.undebates"],
|
230 |
+
"validation": ["validation.undebates"]
|
231 |
+
},
|
232 |
+
"congressional_hearings": {
|
233 |
+
"train": ["train.congressional_hearings"],
|
234 |
+
"validation": ["validation.congressional_hearings"]
|
235 |
+
},
|
236 |
+
"scotus_oral_arguments": {
|
237 |
+
"train": ["train.scotus_oral"],
|
238 |
+
"validation": ["validation.scotus_oral"]
|
239 |
+
},
|
240 |
+
},
|
241 |
+
"study_materials": {
|
242 |
+
"bar_exam_outlines": {
|
243 |
+
"train": [
|
244 |
+
"train.stanfordbarexamoutlines",
|
245 |
+
"train.shajnfeldbarexamoutlines",
|
246 |
+
],
|
247 |
+
"validation": [
|
248 |
+
"validation.stanfordbarexamoutlines",
|
249 |
+
"validation.shajnfeldbarexamoutlines",
|
250 |
+
]
|
251 |
+
},
|
252 |
+
"cc_casebooks": {
|
253 |
+
"train": ["train.cc_casebooks"],
|
254 |
+
"validation": ["validation.cc_casebooks"]
|
255 |
+
},
|
256 |
+
},
|
257 |
+
}
|
258 |
+
|
259 |
+
_LANGUAGES = ["bg", "cs", "da", "de", "el", "en", "es", "et", "fi", "fr", "ga",
|
260 |
+
"hr", "hu", "it", "lt", "lv", "mt", "nl", "pl", "pt", "ro", "sk", "sl", "sv"]
|
261 |
+
|
262 |
+
# the pile-of-law additionally contains "conversations", "analyses", "study_materials"
|
263 |
+
# TODO maybe include those additional types as well: https://arxiv.org/pdf/2207.00220.pdf appendix E
|
264 |
+
_TYPES = ["caselaw", "contracts", "legislation", "other"]
|
265 |
+
|
266 |
+
_JURISDICTONS = ["Austria", "Belgium", "Bulgaria", "Croatia", "Czechia", "Denmark", "Estonia", "Finland",
|
267 |
+
"France", "Germany", "Greece", "Hungary", "Ireland", "Italy", "Latvia", "Lithuania", "Luxembourg",
|
268 |
+
"Malta", "Netherlands", "Poland", "Portugal", "Romania", "Slovakia", "Slovenia", "Spain", "Sweden",
|
269 |
+
"EU", "Switzerland", "UK", "US", "Canada", "N/A"]
|
270 |
+
|
271 |
+
|
272 |
+
class MultiLegalPileConfig(datasets.BuilderConfig):
|
273 |
+
"""BuilderConfig for MultiLegalPile."""
|
274 |
+
|
275 |
+
def __init__(self, name: str, **kwargs):
|
276 |
+
"""BuilderConfig for MultiLegalPile.
|
277 |
+
Args:
|
278 |
+
name: combination of language and type with _
|
279 |
+
language: One of bg,cs,da,de,el,en,es,et,fi,fr,ga,hr,hu,it,lt,lv,mt,nl,pl,pt,ro,sk,sl,sv or all
|
280 |
+
type: One of caselaw,contracts,legislation,other or all
|
281 |
+
**kwargs: keyword arguments forwarded to super.
|
282 |
+
"""
|
283 |
+
super(MultiLegalPileConfig, self).__init__(**kwargs)
|
284 |
+
self.name = name
|
285 |
+
self.language = name.split("_")[0]
|
286 |
+
self.type = name.split("_")[1]
|
287 |
+
|
288 |
+
|
289 |
+
class MultiLegalPile(datasets.GeneratorBasedBuilder):
|
290 |
+
"""MultiLegalPile: A Corpus Covering Large-Scale Multilingual Legal Data"""
|
291 |
+
|
292 |
+
BUILDER_CONFIGS = [MultiLegalPileConfig(f"{language}_{type}")
|
293 |
+
for type in _TYPES + ["all"]
|
294 |
+
for language in _LANGUAGES + ["all"]]
|
295 |
+
|
296 |
+
def _info(self):
|
297 |
+
return datasets.DatasetInfo(
|
298 |
+
description=_DESCRIPTION,
|
299 |
+
features=datasets.Features(
|
300 |
+
{
|
301 |
+
"language": datasets.Value("string"), # one of _LANGUAGES
|
302 |
+
"type": datasets.Value("string"), # one of _TYPES
|
303 |
+
"jurisdiction": datasets.Value("string"), # one of _JURISDICTONS
|
304 |
+
"text": datasets.Value("string"),
|
305 |
+
}
|
306 |
+
),
|
307 |
+
supervised_keys=None,
|
308 |
+
homepage=_URL,
|
309 |
+
citation=_CITATION,
|
310 |
+
)
|
311 |
+
|
312 |
+
def _split_generators(self, dl_manager):
|
313 |
+
def download_url(dataset, file_name):
|
314 |
+
url = hf_hub_url(repo_id=dataset, filename=f"data/{file_name}.jsonl.xz", repo_type="dataset")
|
315 |
+
return dl_manager.download(url)
|
316 |
+
|
317 |
+
data_infos = []
|
318 |
+
languages = _LANGUAGES if self.config.language == "all" else [self.config.language]
|
319 |
+
types = _TYPES if self.config.type == "all" else [self.config.type]
|
320 |
+
|
321 |
+
for language in languages:
|
322 |
+
for type in types:
|
323 |
+
info = {"language": language, "type": type}
|
324 |
+
# add native MultiLegalPile data
|
325 |
+
if language in _DATA_NAME and type in _DATA_NAME[language]: # if we actually have something there
|
326 |
+
for data_name in _DATA_NAME[language][type]:
|
327 |
+
info["filepath"] = download_url("Multi_Legal_Pile", data_name)
|
328 |
+
data_infos.append(info.copy())
|
329 |
+
|
330 |
+
# add eurlex_resources data
|
331 |
+
info["jurisdiction"] = "EU"
|
332 |
+
if type == 'caselaw':
|
333 |
+
info["filepath"] = download_url("joelito/eurlex_resources", f"{language}/caselaw")
|
334 |
+
data_infos.append(info.copy())
|
335 |
+
elif type == 'legislation':
|
336 |
+
for resource_type in ["decision", "directive", "regulation", "recommendation", "proposal"]:
|
337 |
+
info["filepath"] = download_url("joelito/eurlex_resources", f"{language}/{resource_type}")
|
338 |
+
data_infos.append(info.copy())
|
339 |
+
elif type == 'contracts':
|
340 |
+
# international agreements
|
341 |
+
info["filepath"] = download_url("joelito/eurlex_resources", f"{language}/intagr")
|
342 |
+
data_infos.append(info.copy())
|
343 |
+
|
344 |
+
# add mc4_legal data
|
345 |
+
if type == 'other':
|
346 |
+
info["jurisdiction"] = "N/A"
|
347 |
+
if language in ["de", "en", "es"]: # here we need to chunk because the files are too large
|
348 |
+
for idx in [0, 1]:
|
349 |
+
info["filepath"] = download_url("joelito/mc4_legal", f"{language}_{idx}")
|
350 |
+
data_infos.append(info.copy())
|
351 |
+
elif language in ["hr"]:
|
352 |
+
pass # nothing there for Croatian
|
353 |
+
else:
|
354 |
+
info["filepath"] = download_url("joelito/mc4_legal", f"{language}")
|
355 |
+
data_infos.append(info.copy())
|
356 |
+
|
357 |
+
# add pile-of-law data
|
358 |
+
if language == 'en':
|
359 |
+
info["jurisdiction"] = "US"
|
360 |
+
for name, train_val_files in _PILE_OF_LAW_NAMES[type].items():
|
361 |
+
if name == 'canadian_decisions':
|
362 |
+
info["jurisdiction"] = "Canada"
|
363 |
+
elif name in ['echr', 'euro_parl']:
|
364 |
+
info["jurisdiction"] = "EU"
|
365 |
+
elif name in ['un_debates', 'constitutions',
|
366 |
+
# these are maybe also mostly from the US
|
367 |
+
'r_legaladvice', 'cc_casebooks', 'bar_exam_outlines']:
|
368 |
+
info["jurisdiction"] = "N/A"
|
369 |
+
for split in ["train", "val"]:
|
370 |
+
for file_name in train_val_files[split]:
|
371 |
+
info["filepath"] = download_url("pile-of-law/pile-of-law", file_name)
|
372 |
+
data_infos.append(info.copy())
|
373 |
+
|
374 |
+
return [datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"data_infos": data_infos})]
|
375 |
+
|
376 |
+
def _generate_examples(self, data_infos):
|
377 |
+
"""This function returns the examples in the raw (text) form by iterating on all the files."""
|
378 |
+
id_ = 0
|
379 |
+
for data_info in data_infos:
|
380 |
+
logger.info("Generating examples from = %s", data_info["filepath"])
|
381 |
+
try:
|
382 |
+
with xz.open(open(data_info["filepath"], "rb"), "rt", encoding="utf-8") as f:
|
383 |
+
for line in f:
|
384 |
+
if line:
|
385 |
+
example = json.loads(line)
|
386 |
+
if example is not None and isinstance(example, dict):
|
387 |
+
yield id_, {
|
388 |
+
# uses the default values for language, type and jurisdiction if it is not set
|
389 |
+
"language": example.get("language", data_info["language"]),
|
390 |
+
"type": example.get("type", data_info["type"]),
|
391 |
+
"jurisdiction": example.get("jurisdiction", data_info["jurisdiction"]),
|
392 |
+
"text": example.get("text", ""),
|
393 |
+
}
|
394 |
+
id_ += 1
|
395 |
+
except:
|
396 |
+
print("Error reading file:", data_info["filepath"])
|
README.md
ADDED
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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24 |
+
- nl
|
25 |
+
- pl
|
26 |
+
- pt
|
27 |
+
- ro
|
28 |
+
- sk
|
29 |
+
- sl
|
30 |
+
- sv
|
31 |
+
license:
|
32 |
+
- cc-by-4.0
|
33 |
+
multilinguality:
|
34 |
+
- multilingual
|
35 |
+
paperswithcode_id: null
|
36 |
+
pretty_name: "MultiLegalPile: A Large-Scale Multilingual Corpus for the Legal Domain"
|
37 |
+
size_categories:
|
38 |
+
- 10M<n<100M
|
39 |
+
source_datasets:
|
40 |
+
- original
|
41 |
+
task_categories:
|
42 |
+
- fill-mask
|
43 |
+
|
44 |
+
---
|
45 |
+
|
46 |
+
# Dataset Card for MultiLegalPile: A Large-Scale Multilingual Corpus for the Legal Domain
|
47 |
+
|
48 |
+
## Table of Contents
|
49 |
+
|
50 |
+
- [Table of Contents](#table-of-contents)
|
51 |
+
- [Dataset Description](#dataset-description)
|
52 |
+
- [Dataset Summary](#dataset-summary)
|
53 |
+
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
54 |
+
- [Languages](#languages)
|
55 |
+
- [Dataset Structure](#dataset-structure)
|
56 |
+
- [Data Instances](#data-instances)
|
57 |
+
- [Data Fields](#data-fields)
|
58 |
+
- [Data Splits](#data-splits)
|
59 |
+
- [Dataset Creation](#dataset-creation)
|
60 |
+
- [Curation Rationale](#curation-rationale)
|
61 |
+
- [Source Data](#source-data)
|
62 |
+
- [Annotations](#annotations)
|
63 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
64 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
65 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
66 |
+
- [Discussion of Biases](#discussion-of-biases)
|
67 |
+
- [Other Known Limitations](#other-known-limitations)
|
68 |
+
- [Additional Information](#additional-information)
|
69 |
+
- [Dataset Curators](#dataset-curators)
|
70 |
+
- [Licensing Information](#licensing-information)
|
71 |
+
- [Citation Information](#citation-information)
|
72 |
+
- [Contributions](#contributions)
|
73 |
+
|
74 |
+
## Dataset Description
|
75 |
+
|
76 |
+
- **Homepage:**
|
77 |
+
- **Repository:**
|
78 |
+
- **Paper:**
|
79 |
+
- **Leaderboard:**
|
80 |
+
- **Point of Contact:** [Joel Niklaus](mailto:joel.niklaus.2@bfh.ch)
|
81 |
+
|
82 |
+
### Dataset Summary
|
83 |
+
|
84 |
+
|
85 |
+
### Supported Tasks and Leaderboards
|
86 |
+
|
87 |
+
The dataset supports the tasks of fill-mask.
|
88 |
+
|
89 |
+
|
90 |
+
|
91 |
+
### Languages
|
92 |
+
|
93 |
+
The following languages are supported: bg, cs, da, de, el, en, es, et, fi, fr, ga, hr, hu, it, lt, lv, mt, nl, pl, pt, ro, sk, sl, sv
|
94 |
+
|
95 |
+
## Dataset Structure
|
96 |
+
|
97 |
+
It is structured in the following format:
|
98 |
+
text_type -> language -> jurisdiction.jsonl.xz
|
99 |
+
|
100 |
+
text_type is one of the following:
|
101 |
+
- analyses
|
102 |
+
- caselaw
|
103 |
+
- contracts
|
104 |
+
- conversations
|
105 |
+
- legislation
|
106 |
+
- other
|
107 |
+
|
108 |
+
### Data Instances
|
109 |
+
|
110 |
+
The file format is jsonl.xz and there is one split available ("train").
|
111 |
+
|
112 |
+
|
113 |
+
# TODO fill this in
|
114 |
+
|
115 |
+
| Source | Type | Size | Words | Documents | Words/Document | URL | License |
|
116 |
+
|---------:|--------------|-----:|-------:|----------:|---------------:|----------------------------------------------------|------------------------------------------------:|
|
117 |
+
| MARCELL | Legislation | xxx | xxx | xxx | xxx | [NCC](https://huggingface.co/datasets/NbAiLab/NCC) | [NLOD 2.0](https://data.norge.no/nlod/en/2.0/) |
|
118 |
+
| CASS | | xxx | xxx | xxx | xxx | | |
|
119 |
+
|
120 |
+
|
121 |
+
|
122 |
+
|
123 |
+
### Data Fields
|
124 |
+
|
125 |
+
[More Information Needed]
|
126 |
+
|
127 |
+
### Data Splits
|
128 |
+
|
129 |
+
[More Information Needed]
|
130 |
+
|
131 |
+
## Dataset Creation
|
132 |
+
|
133 |
+
### Curation Rationale
|
134 |
+
|
135 |
+
[More Information Needed]
|
136 |
+
|
137 |
+
### Source Data
|
138 |
+
|
139 |
+
#### Initial Data Collection and Normalization
|
140 |
+
|
141 |
+
[More Information Needed]
|
142 |
+
|
143 |
+
#### Who are the source language producers?
|
144 |
+
|
145 |
+
[More Information Needed]
|
146 |
+
|
147 |
+
|
148 |
+
### Annotations
|
149 |
+
|
150 |
+
#### Annotation process
|
151 |
+
|
152 |
+
[More Information Needed]
|
153 |
+
|
154 |
+
#### Who are the annotators?
|
155 |
+
|
156 |
+
[More Information Needed]
|
157 |
+
|
158 |
+
### Personal and Sensitive Information
|
159 |
+
|
160 |
+
[More Information Needed]
|
161 |
+
|
162 |
+
## Considerations for Using the Data
|
163 |
+
|
164 |
+
### Social Impact of Dataset
|
165 |
+
|
166 |
+
[More Information Needed]
|
167 |
+
|
168 |
+
### Discussion of Biases
|
169 |
+
|
170 |
+
[More Information Needed]
|
171 |
+
|
172 |
+
### Other Known Limitations
|
173 |
+
|
174 |
+
[More Information Needed]
|
175 |
+
|
176 |
+
## Additional Information
|
177 |
+
|
178 |
+
### Dataset Curators
|
179 |
+
|
180 |
+
[More Information Needed]
|
181 |
+
|
182 |
+
### Licensing Information
|
183 |
+
|
184 |
+
[More Information Needed]
|
185 |
+
|
186 |
+
### Citation Information
|
187 |
+
|
188 |
+
```
|
189 |
+
TODO add citation
|
190 |
+
```
|
191 |
+
|
192 |
+
### Contributions
|
193 |
+
|
194 |
+
Thanks to [@JoelNiklaus](https://github.com/joelniklaus) for adding this dataset.
|
data/bg/legislation/bulgaria_marcell.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d400c7e1effe775cbbbcec81434fe08277168e7ee4ca7ab01c653d3e5afcc1dd
|
3 |
+
size 62971316
|
data/cs/caselaw/czechia_constitutional_court.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f05006aa17dbe84bb9785e8e187ca15de023ee2ef63593f468bb57e94e45f318
|
3 |
+
size 109742140
|
data/cs/caselaw/czechia_supreme_administrative_court.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b9b7cf7e15d43ab9b08f3abc4b5b2c8379d71e09326d7595cc0575240bba4a66
|
3 |
+
size 185068856
|
data/cs/caselaw/czechia_supreme_court.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:67a03c6b41fe90eeebb0c75909713d5d6b2029af73bcefd9034fadd4046741b5
|
3 |
+
size 256829420
|
data/da/caselaw/denmark_ddsc.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f105da224d1ab90a215d9de64df888a054efc59830caf875d8a45b06d2b7c54f
|
3 |
+
size 38814204
|
data/da/legislation/denmark_ddsc.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9b290aaac87ae0bb175af262f9b35200faf6dbe92c081a6fe7096b32f1d1ce63
|
3 |
+
size 270969168
|
data/de/caselaw/germany_openlegaldata.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d4f17ff5cfb7f95cbf5f3db7e233083e4763a0666036209be0ced90d5470c356
|
3 |
+
size 825567176
|
data/de/legislation/germany_openlegaldata.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b24e3f3b912e4f1d19a27ae64ef4f04af7ab8e9c548980a8ea8e18f3dedb20e6
|
3 |
+
size 14633464
|
data/de/legislation/switzerland_lexfind.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d057aa211bf00f5a4124d9f58a4ffb5ed541cccaeffd1d8c3029a2f6016baf06
|
3 |
+
size 45620436
|
data/en/legislation/switzerland_lexfind.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7605e2cd3676e74e9fadbbb8778079151f4fbeefb6eab0ef2bca3927322283ee
|
3 |
+
size 1459992
|
data/fr/caselaw/belgium_jurportal.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:156ce2c6806561605e83e7baaaf135959670e937092ab401d2bb49612f4965f7
|
3 |
+
size 15360144
|
data/fr/caselaw/france_cass.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:15e30cb7881a19371fe527c073fa83835fbcd388470d3b2814dd09e7fe56d354
|
3 |
+
size 40620268
|
data/fr/caselaw/luxembourg_judoc.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dc2e5fdf22791d656a6edec48cc3bff5bde6da61164dd80431b84d35a71d8cf8
|
3 |
+
size 44499496
|
data/fr/legislation/belgium_ejustice.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:219599179d42684d121ce49da0a6a5627289063de281d657ab5261d6d19e457d
|
3 |
+
size 22874460
|
data/fr/legislation/switzerland_lexfind.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:06540f858c39c65789968130b4c9c85ead17235217bc10bfc511d50d542711e3
|
3 |
+
size 29787524
|
data/hu/caselaw/hungary_marcell.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a638909e33a4de4ae4cfc448fd857cdb2ada2d2bf9e4d7e99ab694b7cf20446b
|
3 |
+
size 40793724
|
data/it/legislation/switzerland_lexfind.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5e7bca9cf4b369b213a29e36965a0a6b321fe45cfd99c8e63edf4566c7bebaee
|
3 |
+
size 21298788
|
data/nl/legislation/belgium_ejustice.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f803e1443bc12a8e9fd8176c567f7d880f2f4f45c059d97ff73c56838504e587
|
3 |
+
size 23722944
|
data/pl/legislation/poland_marcell.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5146dfc5de173f304d2624957420a3c074157a759c2cad9283d0f4d9b509f248
|
3 |
+
size 38203328
|
data/pt/caselaw/brazil_rulingbr.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:41d1d13c6394fcde43977f3fa281beba295bff7e8e796723611f8fba50c49e19
|
3 |
+
size 25611264
|
data/ro/legislation/romania_marcell.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d2bf72356bf686b659cbd652873fa4867c49e51a3689028e0d9ac08ea2cb6395
|
3 |
+
size 333851436
|
data/sk/legislation/slovakia_marcell.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1032f255b61384d41470c9f7b4af82064794891164824e2b6f577c8e7185f3cc
|
3 |
+
size 29558536
|
data/sl/legislation/slovenia_marcell.jsonl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:95b5fb31dd0a3db1321e837db8c4af13d7289bd472f63d186d7500ee2bfc00cb
|
3 |
+
size 128458296
|