Commit
·
f782401
1
Parent(s):
1b1bbfd
updated data loader to include update from pile of law
Browse files- .gitattributes +1 -0
- Multi_Legal_Pile.py +207 -66
- README.md +46 -51
.gitattributes
CHANGED
|
@@ -77,3 +77,4 @@ data/fr/caselaw/switzerland_entscheidsuche.jsonl.xz filter=lfs diff=lfs merge=lf
|
|
| 77 |
data/it/caselaw/switzerland_entscheidsuche.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
| 78 |
data/en/legislation/uk_uk_lex.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
| 79 |
data/hu/legislation/hungary_marcell.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 77 |
data/it/caselaw/switzerland_entscheidsuche.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
| 78 |
data/en/legislation/uk_uk_lex.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
| 79 |
data/hu/legislation/hungary_marcell.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
| 80 |
+
data/pt/caselaw/brazil_creta.jsonl.xz filter=lfs diff=lfs merge=lfs -text
|
Multi_Legal_Pile.py
CHANGED
|
@@ -14,6 +14,7 @@ datasets.logging.set_verbosity_info()
|
|
| 14 |
logger = datasets.logging.get_logger(__name__)
|
| 15 |
|
| 16 |
_DESCRIPTION = """
|
|
|
|
| 17 |
"""
|
| 18 |
|
| 19 |
_CITATION = """
|
|
@@ -21,58 +22,77 @@ _CITATION = """
|
|
| 21 |
|
| 22 |
_URL = "https://huggingface.co/datasets/joelito/Multi_Legal_Pile"
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
_DATA_NAME = {
|
| 26 |
"bg": {
|
| 27 |
-
|
| 28 |
},
|
| 29 |
"cs": {
|
| 30 |
-
|
| 31 |
},
|
| 32 |
"da": {
|
| 33 |
-
|
| 34 |
-
|
| 35 |
},
|
| 36 |
"de": {
|
| 37 |
-
|
| 38 |
-
|
| 39 |
},
|
| 40 |
"en": {
|
| 41 |
-
|
| 42 |
},
|
| 43 |
"fr": {
|
| 44 |
-
|
| 45 |
-
|
| 46 |
},
|
| 47 |
"hu": {
|
| 48 |
-
|
| 49 |
},
|
| 50 |
"it": {
|
| 51 |
-
|
| 52 |
-
|
| 53 |
},
|
| 54 |
"nl": {
|
| 55 |
-
|
| 56 |
},
|
| 57 |
"pl": {
|
| 58 |
-
|
| 59 |
},
|
| 60 |
"pt": {
|
| 61 |
-
|
| 62 |
},
|
| 63 |
"ro": {
|
| 64 |
-
|
| 65 |
},
|
| 66 |
"sk": {
|
| 67 |
-
|
| 68 |
},
|
| 69 |
"sl": {
|
| 70 |
-
|
| 71 |
},
|
| 72 |
}
|
| 73 |
|
|
|
|
| 74 |
_PILE_OF_LAW_NAMES = {
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
"courtlistener_opinions": {
|
| 77 |
"train": [
|
| 78 |
"train.courtlisteneropinions.0",
|
|
@@ -85,40 +105,119 @@ _PILE_OF_LAW_NAMES = {
|
|
| 85 |
"train.courtlisteneropinions.7",
|
| 86 |
"train.courtlisteneropinions.8",
|
| 87 |
"train.courtlisteneropinions.9",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
],
|
| 89 |
"validation": [
|
| 90 |
"validation.courtlisteneropinions.0",
|
| 91 |
"validation.courtlisteneropinions.1",
|
| 92 |
"validation.courtlisteneropinions.2",
|
| 93 |
-
"validation.courtlisteneropinions.3"
|
|
|
|
|
|
|
| 94 |
]
|
| 95 |
},
|
| 96 |
-
"
|
| 97 |
-
"train": [
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
]
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
]
|
| 107 |
},
|
| 108 |
"scotus_filings": {
|
| 109 |
"train": ["train.scotus_docket_entries"],
|
| 110 |
"validation": ["validation.scotus_docket_entries"]
|
| 111 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
"echr": {
|
| 113 |
"train": ["train.echr"],
|
| 114 |
"validation": ["validation.echr"]
|
| 115 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
"canadian_decisions": {
|
| 117 |
"train": ["train.canadian_decisions"],
|
| 118 |
"validation": ["validation.canadian_decisions"]
|
| 119 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
},
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
"atticus_contracts": {
|
| 123 |
"train": [
|
| 124 |
"train.atticus_contracts.0",
|
|
@@ -132,6 +231,10 @@ _PILE_OF_LAW_NAMES = {
|
|
| 132 |
"validation.atticus_contracts.1"
|
| 133 |
]
|
| 134 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
"edgar": {
|
| 136 |
"train": ["train.edgar"],
|
| 137 |
"validation": ["validation.edgar"]
|
|
@@ -140,51 +243,86 @@ _PILE_OF_LAW_NAMES = {
|
|
| 140 |
"train": ["train.cfpb_cc"],
|
| 141 |
"validation": ["validation.cfpb_cc"]
|
| 142 |
},
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
"train": ["train.uscode"],
|
| 147 |
-
"validation": ["validation.uscode"]
|
| 148 |
-
},
|
| 149 |
-
"state_codes": {
|
| 150 |
-
"train": ["train.state_code"],
|
| 151 |
-
"validation": ["validation.state_code"]
|
| 152 |
},
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
},
|
| 157 |
-
"
|
| 158 |
-
"train": ["train.
|
| 159 |
-
"validation": ["validation.
|
| 160 |
},
|
| 161 |
-
"
|
| 162 |
-
"train": [
|
| 163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
},
|
| 165 |
-
"
|
| 166 |
-
"train": ["train.
|
| 167 |
-
"validation": ["validation.
|
| 168 |
},
|
| 169 |
-
},
|
| 170 |
-
"other": { # analyses
|
| 171 |
"oig": {
|
| 172 |
"train": ["train.oig"],
|
| 173 |
"validation": ["validation.oig"]
|
| 174 |
},
|
| 175 |
"olc_memos": {
|
| 176 |
-
"train": ["train.
|
| 177 |
-
"validation": ["validation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
},
|
| 180 |
}
|
| 181 |
|
| 182 |
_LANGUAGES = ["bg", "cs", "da", "de", "el", "en", "es", "et", "fi", "fr", "ga", "hr",
|
| 183 |
"hu", "it", "lt", "lv", "mt", "nl", "pl", "pt", "ro", "sk", "sl", "sv"]
|
| 184 |
|
| 185 |
-
_TYPES = [
|
| 186 |
|
| 187 |
-
|
| 188 |
"France", "Germany", "Greece", "Hungary", "Ireland", "Italy", "Latvia", "Lithuania", "Luxembourg",
|
| 189 |
"Malta", "Netherlands", "Poland", "Portugal", "Romania", "Slovakia", "Slovenia", "Spain", "Sweden",
|
| 190 |
"EU", "Switzerland", "UK", "US", "Canada", "N/A"]
|
|
@@ -198,7 +336,7 @@ class MultiLegalPileConfig(datasets.BuilderConfig):
|
|
| 198 |
Args:
|
| 199 |
name: combination of language and type with _
|
| 200 |
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
|
| 201 |
-
type: One of caselaw,contracts,legislation,other or all
|
| 202 |
**kwargs: keyword arguments forwarded to super.
|
| 203 |
"""
|
| 204 |
super(MultiLegalPileConfig, self).__init__(**kwargs)
|
|
@@ -211,8 +349,11 @@ class MultiLegalPileConfig(datasets.BuilderConfig):
|
|
| 211 |
class MultiLegalPile(datasets.GeneratorBasedBuilder):
|
| 212 |
"""MultiLegalPile: A Corpus Covering Large-Scale Multilingual Legal Data"""
|
| 213 |
BUILDER_CONFIG_CLASS = MultiLegalPileConfig
|
|
|
|
| 214 |
|
| 215 |
-
BUILDER_CONFIGS = [MultiLegalPileConfig(f"{language}_{type}"
|
|
|
|
|
|
|
| 216 |
for type in _TYPES + ["all"]
|
| 217 |
for language in _LANGUAGES + ["all"]]
|
| 218 |
|
|
@@ -223,7 +364,7 @@ class MultiLegalPile(datasets.GeneratorBasedBuilder):
|
|
| 223 |
{
|
| 224 |
"language": datasets.Value("string"), # one of _LANGUAGES
|
| 225 |
"type": datasets.Value("string"), # one of _TYPES
|
| 226 |
-
"jurisdiction": datasets.Value("string"), # one of
|
| 227 |
"text": datasets.Value("string"),
|
| 228 |
}
|
| 229 |
),
|
|
@@ -267,7 +408,7 @@ class MultiLegalPile(datasets.GeneratorBasedBuilder):
|
|
| 267 |
data_infos.append(info.copy())
|
| 268 |
|
| 269 |
# add mc4_legal data
|
| 270 |
-
if type == '
|
| 271 |
info["jurisdiction"] = "N/A"
|
| 272 |
if language in ["de", "en", "es"]: # here we need to chunk because the files are too large
|
| 273 |
for idx in [0, 1]:
|
|
@@ -285,9 +426,9 @@ class MultiLegalPile(datasets.GeneratorBasedBuilder):
|
|
| 285 |
for name, train_val_files in _PILE_OF_LAW_NAMES[type].items():
|
| 286 |
if name == 'canadian_decisions':
|
| 287 |
info["jurisdiction"] = "Canada"
|
| 288 |
-
elif name in ['echr']:
|
| 289 |
info["jurisdiction"] = "EU"
|
| 290 |
-
elif name in ['constitutions']:
|
| 291 |
info["jurisdiction"] = "N/A"
|
| 292 |
for split in ["train", "validation"]:
|
| 293 |
for file_name in train_val_files[split]:
|
|
|
|
| 14 |
logger = datasets.logging.get_logger(__name__)
|
| 15 |
|
| 16 |
_DESCRIPTION = """
|
| 17 |
+
Multi Legal Pile is a dataset of legal documents in the 24 EU languages.
|
| 18 |
"""
|
| 19 |
|
| 20 |
_CITATION = """
|
|
|
|
| 22 |
|
| 23 |
_URL = "https://huggingface.co/datasets/joelito/Multi_Legal_Pile"
|
| 24 |
|
| 25 |
+
CASELAW = "caselaw"
|
| 26 |
+
LEGISLATION = "legislation"
|
| 27 |
+
CONTRACTS = "contracts"
|
| 28 |
+
OTHER = "other"
|
| 29 |
+
MC4_LEGAL = "mc4_legal"
|
| 30 |
+
|
| 31 |
+
# Native MultiLegalPile
|
| 32 |
_DATA_NAME = {
|
| 33 |
"bg": {
|
| 34 |
+
LEGISLATION: ["bulgaria_marcell"],
|
| 35 |
},
|
| 36 |
"cs": {
|
| 37 |
+
CASELAW: ["czechia_constitutional_court", "czechia_supreme_administrative_court", "czechia_supreme_court"],
|
| 38 |
},
|
| 39 |
"da": {
|
| 40 |
+
CASELAW: ["denmark_ddsc"],
|
| 41 |
+
LEGISLATION: ["denmark_ddsc"],
|
| 42 |
},
|
| 43 |
"de": {
|
| 44 |
+
CASELAW: ["germany_openlegaldata", "switzerland_entscheidsuche"],
|
| 45 |
+
LEGISLATION: ["germany_openlegaldata", "switzerland_lexfind"],
|
| 46 |
},
|
| 47 |
"en": {
|
| 48 |
+
LEGISLATION: ["switzerland_lexfind", "uk_uk_lex"],
|
| 49 |
},
|
| 50 |
"fr": {
|
| 51 |
+
CASELAW: ["belgium_jurportal", "france_cass", "luxembourg_judoc", "switzerland_entscheidsuche"],
|
| 52 |
+
LEGISLATION: ["belgium_ejustice", "switzerland_lexfind"],
|
| 53 |
},
|
| 54 |
"hu": {
|
| 55 |
+
LEGISLATION: ["hungary_marcell"],
|
| 56 |
},
|
| 57 |
"it": {
|
| 58 |
+
CASELAW: ["switzerland_entscheidsuche"],
|
| 59 |
+
LEGISLATION: ["switzerland_lexfind"],
|
| 60 |
},
|
| 61 |
"nl": {
|
| 62 |
+
LEGISLATION: ["belgium_ejustice"],
|
| 63 |
},
|
| 64 |
"pl": {
|
| 65 |
+
LEGISLATION: ["poland_marcell"],
|
| 66 |
},
|
| 67 |
"pt": {
|
| 68 |
+
CASELAW: ["brazil_rulingbr", "brazil_creta"],
|
| 69 |
},
|
| 70 |
"ro": {
|
| 71 |
+
LEGISLATION: ["romania_marcell"],
|
| 72 |
},
|
| 73 |
"sk": {
|
| 74 |
+
LEGISLATION: ["slovakia_marcell"],
|
| 75 |
},
|
| 76 |
"sl": {
|
| 77 |
+
LEGISLATION: ["slovenia_marcell"],
|
| 78 |
},
|
| 79 |
}
|
| 80 |
|
| 81 |
+
# PileOfLaw
|
| 82 |
_PILE_OF_LAW_NAMES = {
|
| 83 |
+
CASELAW: {
|
| 84 |
+
"courtlistener_docket_entry_documents": {
|
| 85 |
+
"train": [
|
| 86 |
+
"train.courtlistenerdocketentries.0",
|
| 87 |
+
"train.courtlistenerdocketentries.1",
|
| 88 |
+
"train.courtlistenerdocketentries.2",
|
| 89 |
+
"train.courtlistenerdocketentries.3"
|
| 90 |
+
],
|
| 91 |
+
"validation": [
|
| 92 |
+
"validation.courtlistenerdocketentries.0",
|
| 93 |
+
"validation.courtlistenerdocketentries.1"
|
| 94 |
+
]
|
| 95 |
+
},
|
| 96 |
"courtlistener_opinions": {
|
| 97 |
"train": [
|
| 98 |
"train.courtlisteneropinions.0",
|
|
|
|
| 105 |
"train.courtlisteneropinions.7",
|
| 106 |
"train.courtlisteneropinions.8",
|
| 107 |
"train.courtlisteneropinions.9",
|
| 108 |
+
"train.courtlisteneropinions.10",
|
| 109 |
+
"train.courtlisteneropinions.11",
|
| 110 |
+
"train.courtlisteneropinions.12",
|
| 111 |
+
"train.courtlisteneropinions.13",
|
| 112 |
+
"train.courtlisteneropinions.14",
|
| 113 |
+
"train.courtlisteneropinions.15"
|
| 114 |
+
|
| 115 |
],
|
| 116 |
"validation": [
|
| 117 |
"validation.courtlisteneropinions.0",
|
| 118 |
"validation.courtlisteneropinions.1",
|
| 119 |
"validation.courtlisteneropinions.2",
|
| 120 |
+
"validation.courtlisteneropinions.3",
|
| 121 |
+
"validation.courtlisteneropinions.4",
|
| 122 |
+
"validation.courtlisteneropinions.5"
|
| 123 |
]
|
| 124 |
},
|
| 125 |
+
"bva_opinions": {
|
| 126 |
+
"train": ["train.bva"],
|
| 127 |
+
"validation": ["validation.bva"]
|
| 128 |
+
},
|
| 129 |
+
"nlrb_decisions": {
|
| 130 |
+
"train": ["train.nlrb_decisions"],
|
| 131 |
+
"validation": ["validation.nlrb_decisions"]
|
| 132 |
+
},
|
| 133 |
+
"scotus_oral_arguments": {
|
| 134 |
+
"train": ["train.scotus_oral"],
|
| 135 |
+
"validation": ["validation.scotus_oral"]
|
| 136 |
},
|
| 137 |
"scotus_filings": {
|
| 138 |
"train": ["train.scotus_docket_entries"],
|
| 139 |
"validation": ["validation.scotus_docket_entries"]
|
| 140 |
},
|
| 141 |
+
"ftc_advisory_opinions": {
|
| 142 |
+
"train": ["train.ftc_advisory_opinions"],
|
| 143 |
+
"validation": ["validation.ftc_advisory_opinions"]
|
| 144 |
+
},
|
| 145 |
"echr": {
|
| 146 |
"train": ["train.echr"],
|
| 147 |
"validation": ["validation.echr"]
|
| 148 |
},
|
| 149 |
+
"tax_rulings": {
|
| 150 |
+
"train": ["train.taxrulings"],
|
| 151 |
+
"validation": ["validation.taxrulings"]
|
| 152 |
+
},
|
| 153 |
"canadian_decisions": {
|
| 154 |
"train": ["train.canadian_decisions"],
|
| 155 |
"validation": ["validation.canadian_decisions"]
|
| 156 |
},
|
| 157 |
+
"eoir": {
|
| 158 |
+
"train": ["train.eoir"],
|
| 159 |
+
"validation": ["validation.eoir"]
|
| 160 |
+
},
|
| 161 |
+
"dol_ecab": {
|
| 162 |
+
"train": ["train.dol_ecab"],
|
| 163 |
+
"validation": ["validation.dol_ecab"]
|
| 164 |
+
},
|
| 165 |
+
"icj-pcij": {
|
| 166 |
+
"train": ["train.ijc"],
|
| 167 |
+
"validation": ["validation.ijc"]
|
| 168 |
+
},
|
| 169 |
+
"hhs_alj_opinions": {
|
| 170 |
+
"train": ["train.hhs_alj"],
|
| 171 |
+
"validation": ["validation.hhs_alj"]
|
| 172 |
+
},
|
| 173 |
+
"sec_administrative_proceedings": {
|
| 174 |
+
"train": ["train.sec"],
|
| 175 |
+
"validation": ["validation.sec"]
|
| 176 |
+
},
|
| 177 |
},
|
| 178 |
+
LEGISLATION: {
|
| 179 |
+
"federal_register": {
|
| 180 |
+
"train": ["train.federal_register"],
|
| 181 |
+
"validation": ["validation.federal_register"]
|
| 182 |
+
},
|
| 183 |
+
"us_bills": {
|
| 184 |
+
"train": ["train.us_bills"],
|
| 185 |
+
"validation": ["validation.us_bills"]
|
| 186 |
+
},
|
| 187 |
+
"cfr": {
|
| 188 |
+
"train": ["train.cfr"],
|
| 189 |
+
"validation": ["validation.cfr"]
|
| 190 |
+
},
|
| 191 |
+
"state_codes": {
|
| 192 |
+
"train": ["train.state_code"],
|
| 193 |
+
"validation": ["validation.state_code"]
|
| 194 |
+
},
|
| 195 |
+
"constitutions": {
|
| 196 |
+
"train": ["train.constitutions"],
|
| 197 |
+
"validation": ["validation.constitutions"]
|
| 198 |
+
},
|
| 199 |
+
"uscode": {
|
| 200 |
+
"train": ["train.uscode"],
|
| 201 |
+
"validation": ["validation.uscode"]
|
| 202 |
+
},
|
| 203 |
+
"founding_docs": {
|
| 204 |
+
"train": ["train.founding_docs"],
|
| 205 |
+
"validation": ["validation.founding_docs"]
|
| 206 |
+
},
|
| 207 |
+
"eurlex": {
|
| 208 |
+
"train": ["train.eurlex"],
|
| 209 |
+
"validation": ["validation.eurlex"]
|
| 210 |
+
},
|
| 211 |
+
"fre": {
|
| 212 |
+
"train": ["train.fre"],
|
| 213 |
+
"validation": ["validation.fre"]
|
| 214 |
+
},
|
| 215 |
+
"frcp": {
|
| 216 |
+
"train": ["train.frcp"],
|
| 217 |
+
"validation": ["validation.frcp"]
|
| 218 |
+
},
|
| 219 |
+
},
|
| 220 |
+
CONTRACTS: {
|
| 221 |
"atticus_contracts": {
|
| 222 |
"train": [
|
| 223 |
"train.atticus_contracts.0",
|
|
|
|
| 231 |
"validation.atticus_contracts.1"
|
| 232 |
]
|
| 233 |
},
|
| 234 |
+
"tos": {
|
| 235 |
+
"train": ["train.tos"],
|
| 236 |
+
"validation": ["validation.tos"]
|
| 237 |
+
},
|
| 238 |
"edgar": {
|
| 239 |
"train": ["train.edgar"],
|
| 240 |
"validation": ["validation.edgar"]
|
|
|
|
| 243 |
"train": ["train.cfpb_cc"],
|
| 244 |
"validation": ["validation.cfpb_cc"]
|
| 245 |
},
|
| 246 |
+
"resource_contracts": {
|
| 247 |
+
"train": ["train.resource_contracts"],
|
| 248 |
+
"validation": ["validation.resource_contracts"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
},
|
| 250 |
+
},
|
| 251 |
+
OTHER: {
|
| 252 |
+
"r_legaladvice":
|
| 253 |
+
{
|
| 254 |
+
"train": ["train.r_legaldvice"],
|
| 255 |
+
"validation": ["validation.r_legaldvice"]
|
| 256 |
+
},
|
| 257 |
+
"cc_casebooks": {
|
| 258 |
+
"train": ["train.cc_casebooks"],
|
| 259 |
+
"validation": ["validation.cc_casebooks"]
|
| 260 |
},
|
| 261 |
+
"euro_parl": {
|
| 262 |
+
"train": ["train.euro_parl"],
|
| 263 |
+
"validation": ["validation.euro_parl"]
|
| 264 |
},
|
| 265 |
+
"exam_outlines": {
|
| 266 |
+
"train": [
|
| 267 |
+
"train.examoutlines",
|
| 268 |
+
],
|
| 269 |
+
"validation": [
|
| 270 |
+
"validation.examoutlines",
|
| 271 |
+
]
|
| 272 |
},
|
| 273 |
+
"congressional_hearings": {
|
| 274 |
+
"train": ["train.congressional_hearings"],
|
| 275 |
+
"validation": ["validation.congressional_hearings"]
|
| 276 |
},
|
|
|
|
|
|
|
| 277 |
"oig": {
|
| 278 |
"train": ["train.oig"],
|
| 279 |
"validation": ["validation.oig"]
|
| 280 |
},
|
| 281 |
"olc_memos": {
|
| 282 |
+
"train": ["train.olc_memos"],
|
| 283 |
+
"validation": ["validation.olc_memos"]
|
| 284 |
+
},
|
| 285 |
+
"un_debates": {
|
| 286 |
+
"train": ["train.undebates"],
|
| 287 |
+
"validation": ["validation.undebates"]
|
| 288 |
+
},
|
| 289 |
+
"uspto_office_actions": {
|
| 290 |
+
"train": ["train.uspto_oab"],
|
| 291 |
+
"validation": ["validation.uspto_oab"]
|
| 292 |
+
},
|
| 293 |
+
"ed_policy_guidance": {
|
| 294 |
+
"train": ["train.ed_policy_guidance"],
|
| 295 |
+
"validation": ["validation.ed_policy_guidance"]
|
| 296 |
+
},
|
| 297 |
+
"acus_reports": {
|
| 298 |
+
"train": ["train.acus_reports"],
|
| 299 |
+
"validation": ["validation.acus_reports"]
|
| 300 |
+
},
|
| 301 |
+
"fmshrc_bluebooks": {
|
| 302 |
+
"train": ["train.fmshrc"],
|
| 303 |
+
"validation": ["validation.fmshrc"]
|
| 304 |
+
},
|
| 305 |
+
"medicaid_policy_guidance": {
|
| 306 |
+
"train": ["train.medicaid_policy_guidance"],
|
| 307 |
+
"validation": ["validation.medicaid_policy_guidance"]
|
| 308 |
+
},
|
| 309 |
+
"irs_legal_advice_memos": {
|
| 310 |
+
"train": ["train.irs_legal_advice_memos"],
|
| 311 |
+
"validation": ["validation.irs_legal_advice_memos"]
|
| 312 |
},
|
| 313 |
+
"doj_guidance_documents": {
|
| 314 |
+
"train": ["train.doj_guidance"],
|
| 315 |
+
"validation": ["validation.doj_guidance"]
|
| 316 |
+
}
|
| 317 |
},
|
| 318 |
}
|
| 319 |
|
| 320 |
_LANGUAGES = ["bg", "cs", "da", "de", "el", "en", "es", "et", "fi", "fr", "ga", "hr",
|
| 321 |
"hu", "it", "lt", "lv", "mt", "nl", "pl", "pt", "ro", "sk", "sl", "sv"]
|
| 322 |
|
| 323 |
+
_TYPES = [CASELAW, CONTRACTS, LEGISLATION, OTHER, MC4_LEGAL]
|
| 324 |
|
| 325 |
+
_JURISDICTIONS = ["Austria", "Belgium", "Brazil", "Bulgaria", "Croatia", "Czechia", "Denmark", "Estonia", "Finland",
|
| 326 |
"France", "Germany", "Greece", "Hungary", "Ireland", "Italy", "Latvia", "Lithuania", "Luxembourg",
|
| 327 |
"Malta", "Netherlands", "Poland", "Portugal", "Romania", "Slovakia", "Slovenia", "Spain", "Sweden",
|
| 328 |
"EU", "Switzerland", "UK", "US", "Canada", "N/A"]
|
|
|
|
| 336 |
Args:
|
| 337 |
name: combination of language and type with _
|
| 338 |
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
|
| 339 |
+
type: One of caselaw,contracts,legislation,other,mc4_legal or all
|
| 340 |
**kwargs: keyword arguments forwarded to super.
|
| 341 |
"""
|
| 342 |
super(MultiLegalPileConfig, self).__init__(**kwargs)
|
|
|
|
| 349 |
class MultiLegalPile(datasets.GeneratorBasedBuilder):
|
| 350 |
"""MultiLegalPile: A Corpus Covering Large-Scale Multilingual Legal Data"""
|
| 351 |
BUILDER_CONFIG_CLASS = MultiLegalPileConfig
|
| 352 |
+
VERSION = datasets.Version("2.0.0", "")
|
| 353 |
|
| 354 |
+
BUILDER_CONFIGS = [MultiLegalPileConfig(f"{language}_{type}",
|
| 355 |
+
version=VERSION,
|
| 356 |
+
description=f"MultiLegalPile for language {language} and type {type}")
|
| 357 |
for type in _TYPES + ["all"]
|
| 358 |
for language in _LANGUAGES + ["all"]]
|
| 359 |
|
|
|
|
| 364 |
{
|
| 365 |
"language": datasets.Value("string"), # one of _LANGUAGES
|
| 366 |
"type": datasets.Value("string"), # one of _TYPES
|
| 367 |
+
"jurisdiction": datasets.Value("string"), # one of _JURISDICTIONS
|
| 368 |
"text": datasets.Value("string"),
|
| 369 |
}
|
| 370 |
),
|
|
|
|
| 408 |
data_infos.append(info.copy())
|
| 409 |
|
| 410 |
# add mc4_legal data
|
| 411 |
+
if type == 'mc4_legal':
|
| 412 |
info["jurisdiction"] = "N/A"
|
| 413 |
if language in ["de", "en", "es"]: # here we need to chunk because the files are too large
|
| 414 |
for idx in [0, 1]:
|
|
|
|
| 426 |
for name, train_val_files in _PILE_OF_LAW_NAMES[type].items():
|
| 427 |
if name == 'canadian_decisions':
|
| 428 |
info["jurisdiction"] = "Canada"
|
| 429 |
+
elif name in ['echr', 'eurlex', 'euro_parl']:
|
| 430 |
info["jurisdiction"] = "EU"
|
| 431 |
+
elif name in ['constitutions', 'icj-pcij', 'r_legaladvice', 'un_debates', 'tos']:
|
| 432 |
info["jurisdiction"] = "N/A"
|
| 433 |
for split in ["train", "validation"]:
|
| 434 |
for file_name in train_val_files[split]:
|
README.md
CHANGED
|
@@ -1,44 +1,45 @@
|
|
| 1 |
---
|
| 2 |
annotations_creators:
|
|
|
|
| 3 |
- other
|
| 4 |
-
language_creators:
|
| 5 |
- found
|
| 6 |
-
language:
|
| 7 |
-
- bg
|
| 8 |
-
- cs
|
| 9 |
-
- da
|
| 10 |
-
- de
|
| 11 |
-
- el
|
| 12 |
- en
|
| 13 |
-
- es
|
| 14 |
-
- et
|
| 15 |
-
- fi
|
| 16 |
-
- fr
|
| 17 |
- ga
|
| 18 |
-
- hr
|
| 19 |
-
- hu
|
| 20 |
-
- it
|
| 21 |
-
- lt
|
| 22 |
-
- lv
|
| 23 |
- mt
|
| 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 |
---
|
|
@@ -74,15 +75,15 @@ task_categories:
|
|
| 74 |
## Dataset Description
|
| 75 |
|
| 76 |
- **Homepage:**
|
| 77 |
-
- **Repository:**
|
| 78 |
-
- **Paper:**
|
| 79 |
- **Leaderboard:**
|
| 80 |
- **Point of Contact:** [Joel Niklaus](mailto:[email protected])
|
| 81 |
|
| 82 |
### Dataset Summary
|
| 83 |
|
| 84 |
The Multi_Legal_Pile is a large-scale multilingual legal dataset suited for pretraining language models.
|
| 85 |
-
It spans over 24 languages and
|
| 86 |
|
| 87 |
### Supported Tasks and Leaderboards
|
| 88 |
|
|
@@ -96,21 +97,25 @@ ro, sk, sl, sv
|
|
| 96 |
## Dataset Structure
|
| 97 |
|
| 98 |
It is structured in the following format:
|
| 99 |
-
|
| 100 |
|
| 101 |
-
|
| 102 |
|
| 103 |
- caselaw
|
| 104 |
- contracts
|
| 105 |
- legislation
|
| 106 |
- other
|
|
|
|
| 107 |
|
|
|
|
|
|
|
| 108 |
|
| 109 |
Use the dataset like this:
|
|
|
|
| 110 |
```python
|
| 111 |
from datasets import load_dataset
|
| 112 |
|
| 113 |
-
config = 'en_contracts'
|
| 114 |
dataset = load_dataset('joelito/Multi_Legal_Pile', config, split='train', streaming=True)
|
| 115 |
```
|
| 116 |
|
|
@@ -122,17 +127,16 @@ all_legislation').
|
|
| 122 |
|
| 123 |
The file format is jsonl.xz and there is one split available ("train").
|
| 124 |
|
|
|
|
| 125 |
|
| 126 |
-
|
| 127 |
-
- Native Multi Legal Pile (30GB)
|
| 128 |
- Eurlex Resources (179GB)
|
| 129 |
- MC4 Legal (133GB)
|
| 130 |
-
- Pile of Law (
|
| 131 |
-
|
| 132 |
|
| 133 |
#### Native Multilingual Legal Pile data
|
| 134 |
|
| 135 |
-
| Language | Text Type |
|
| 136 |
|:---------|:------------|:-------------|:-----------------------------------|----------:|-------:|----------:|---------------:|-----|--------:|
|
| 137 |
| bg | legislation | Bulgaria | MARCELL | 588 | xxx | xxx | xxx | | |
|
| 138 |
| cs | caselaw | Czechia | CzCDC Constitutional Court | 713 | xxx | xxx | xxx | | |
|
|
@@ -158,10 +162,11 @@ The complete dataset (564GB) consists of four large subsets:
|
|
| 158 |
| nl | legislation | Belgium | ejustice | 178 | xxx | xxx | xxx | | |
|
| 159 |
| pl | legislation | Poland | MARCELL | 264 | xxx | xxx | xxx | | |
|
| 160 |
| pt | caselaw | Brazil | RulingBR | 173 | xxx | xxx | xxx | | |
|
|
|
|
| 161 |
| ro | legislation | Romania | MARCELL | 2704 | xxx | xxx | xxx | | |
|
| 162 |
| sk | legislation | Slovakia | MARCELL | 192 | xxx | xxx | xxx | | |
|
| 163 |
| sl | legislation | Slovenia | MARCELL | 753 | xxx | xxx | xxx | | |
|
| 164 |
-
| total | all | all | all |
|
| 165 |
|
| 166 |
#### Eurlex Resources
|
| 167 |
|
|
@@ -175,15 +180,6 @@ See [MC4 Legal](https://huggingface.co/datasets/joelito/mc4_legal#data-instances
|
|
| 175 |
|
| 176 |
See [Pile-of-Law](https://huggingface.co/datasets/pile-of-law/pile-of-law#data-instances) for more information.
|
| 177 |
|
| 178 |
-
For simplicity and with respect to balancing off data across different jurisdictions and languages,
|
| 179 |
-
we disregard many US resources that are either very specialized (e.g., tax rulings),
|
| 180 |
-
outdated/historical (e.g., founding letters),
|
| 181 |
-
very small (less than 20MB),
|
| 182 |
-
not legal language in the strict sense (conversations),
|
| 183 |
-
or the information overlaps with other sources (e.g. study materials or eurlex).
|
| 184 |
-
If you are interested in a US-based (US-biased) model, refer to the "Pile of (US) Law" by Henderson et al. (2022).
|
| 185 |
-
Analyses are put into the "other" category because in mc4_legal we also likely have similar text.
|
| 186 |
-
|
| 187 |
| Language | Type | Jurisdiction | Source | Size (MB) | Tokens | Documents | Tokens/Document | Part of Multi_Legal_Pile |
|
| 188 |
|:-----------|:------------|:---------------|:-------------------------------------|------------:|------------:|------------:|------------------:|:---------------------------|
|
| 189 |
| en | all | all | all | 503712 | 50547777921 | 9872444 | 5120 | yes |
|
|
@@ -246,7 +242,6 @@ Analyses are put into the "other" category because in mc4_legal we also likely h
|
|
| 246 |
|
| 247 |
[More Information Needed]
|
| 248 |
|
| 249 |
-
|
| 250 |
### Annotations
|
| 251 |
|
| 252 |
#### Annotation process
|
|
|
|
| 1 |
---
|
| 2 |
annotations_creators:
|
| 3 |
+
|
| 4 |
- other
|
| 5 |
+
language_creators:
|
| 6 |
- found
|
| 7 |
+
language:
|
| 8 |
+
- bg
|
| 9 |
+
- cs
|
| 10 |
+
- da
|
| 11 |
+
- de
|
| 12 |
+
- el
|
| 13 |
- en
|
| 14 |
+
- es
|
| 15 |
+
- et
|
| 16 |
+
- fi
|
| 17 |
+
- fr
|
| 18 |
- ga
|
| 19 |
+
- hr
|
| 20 |
+
- hu
|
| 21 |
+
- it
|
| 22 |
+
- lt
|
| 23 |
+
- lv
|
| 24 |
- mt
|
| 25 |
+
- nl
|
| 26 |
+
- pl
|
| 27 |
+
- pt
|
| 28 |
+
- ro
|
| 29 |
+
- sk
|
| 30 |
+
- sl
|
| 31 |
- sv
|
| 32 |
+
license:
|
| 33 |
- cc-by-4.0
|
| 34 |
+
multilinguality:
|
| 35 |
- multilingual
|
| 36 |
+
paperswithcode_id: null
|
| 37 |
+
pretty_name: "MultiLegalPile: A Large-Scale Multilingual Corpus for the Legal Domain"
|
| 38 |
+
size_categories:
|
| 39 |
- 10M<n<100M
|
| 40 |
+
source_datasets:
|
| 41 |
- original
|
| 42 |
+
task_categories:
|
| 43 |
- fill-mask
|
| 44 |
|
| 45 |
---
|
|
|
|
| 75 |
## Dataset Description
|
| 76 |
|
| 77 |
- **Homepage:**
|
| 78 |
+
- **Repository:**
|
| 79 |
+
- **Paper:**
|
| 80 |
- **Leaderboard:**
|
| 81 |
- **Point of Contact:** [Joel Niklaus](mailto:[email protected])
|
| 82 |
|
| 83 |
### Dataset Summary
|
| 84 |
|
| 85 |
The Multi_Legal_Pile is a large-scale multilingual legal dataset suited for pretraining language models.
|
| 86 |
+
It spans over 24 languages and five legal text types.
|
| 87 |
|
| 88 |
### Supported Tasks and Leaderboards
|
| 89 |
|
|
|
|
| 97 |
## Dataset Structure
|
| 98 |
|
| 99 |
It is structured in the following format:
|
| 100 |
+
type -> language -> jurisdiction.jsonl.xz
|
| 101 |
|
| 102 |
+
type is one of the following:
|
| 103 |
|
| 104 |
- caselaw
|
| 105 |
- contracts
|
| 106 |
- legislation
|
| 107 |
- other
|
| 108 |
+
- mc4_legal
|
| 109 |
|
| 110 |
+
`mc4_legal` is a subset of the other type but is listed separately so it can be easily excluded since it is less
|
| 111 |
+
permissively licensed than the other types.
|
| 112 |
|
| 113 |
Use the dataset like this:
|
| 114 |
+
|
| 115 |
```python
|
| 116 |
from datasets import load_dataset
|
| 117 |
|
| 118 |
+
config = 'en_contracts' # {language}_{type}
|
| 119 |
dataset = load_dataset('joelito/Multi_Legal_Pile', config, split='train', streaming=True)
|
| 120 |
```
|
| 121 |
|
|
|
|
| 127 |
|
| 128 |
The file format is jsonl.xz and there is one split available ("train").
|
| 129 |
|
| 130 |
+
The complete dataset (653GB) consists of four large subsets:
|
| 131 |
|
| 132 |
+
- Native Multi Legal Pile (49GB)
|
|
|
|
| 133 |
- Eurlex Resources (179GB)
|
| 134 |
- MC4 Legal (133GB)
|
| 135 |
+
- Pile of Law (292GB)
|
|
|
|
| 136 |
|
| 137 |
#### Native Multilingual Legal Pile data
|
| 138 |
|
| 139 |
+
| Language | Text Type | Jurisdiction | Source | Size (MB) | Tokens | Documents | Words/Document | URL | License |
|
| 140 |
|:---------|:------------|:-------------|:-----------------------------------|----------:|-------:|----------:|---------------:|-----|--------:|
|
| 141 |
| bg | legislation | Bulgaria | MARCELL | 588 | xxx | xxx | xxx | | |
|
| 142 |
| cs | caselaw | Czechia | CzCDC Constitutional Court | 713 | xxx | xxx | xxx | | |
|
|
|
|
| 162 |
| nl | legislation | Belgium | ejustice | 178 | xxx | xxx | xxx | | |
|
| 163 |
| pl | legislation | Poland | MARCELL | 264 | xxx | xxx | xxx | | |
|
| 164 |
| pt | caselaw | Brazil | RulingBR | 173 | xxx | xxx | xxx | | |
|
| 165 |
+
| pt | caselaw | Brazil | CRETA | 19000 | xxx | xxx | xxx | | |
|
| 166 |
| ro | legislation | Romania | MARCELL | 2704 | xxx | xxx | xxx | | |
|
| 167 |
| sk | legislation | Slovakia | MARCELL | 192 | xxx | xxx | xxx | | |
|
| 168 |
| sl | legislation | Slovenia | MARCELL | 753 | xxx | xxx | xxx | | |
|
| 169 |
+
| total | all | all | all | 48759 | xxx | xxx | xxx | | |
|
| 170 |
|
| 171 |
#### Eurlex Resources
|
| 172 |
|
|
|
|
| 180 |
|
| 181 |
See [Pile-of-Law](https://huggingface.co/datasets/pile-of-law/pile-of-law#data-instances) for more information.
|
| 182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
| Language | Type | Jurisdiction | Source | Size (MB) | Tokens | Documents | Tokens/Document | Part of Multi_Legal_Pile |
|
| 184 |
|:-----------|:------------|:---------------|:-------------------------------------|------------:|------------:|------------:|------------------:|:---------------------------|
|
| 185 |
| en | all | all | all | 503712 | 50547777921 | 9872444 | 5120 | yes |
|
|
|
|
| 242 |
|
| 243 |
[More Information Needed]
|
| 244 |
|
|
|
|
| 245 |
### Annotations
|
| 246 |
|
| 247 |
#### Annotation process
|