Datasets:

Multilinguality:
multilingual
Size Categories:
10K<n<100K
Language Creators:
found
Annotations Creators:
found
Source Datasets:
original
ArXiv:
License:
multi_eurlex / multi_eurlex.py
albertvillanova's picture
Fix bug with all_levels EUROVOC labels (#5)
fed4e40
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""MultiEURLEX - A multi-lingual and multi-label legal document classification dataset."""
import json
import datasets
_HOMEPAGE = "https://github.io/iliaschalkidis"
_DESCRIPTION = """\
MultiEURLEX comprises 65k EU laws in 23 official EU languages (some low-ish resource).
Each EU law has been annotated with EUROVOC concepts (labels) by the Publication Office of EU.
As with the English EURLEX, the goal is to predict the relevant EUROVOC concepts (labels);
this is multi-label classification task (given the text, predict multiple labels).
"""
_CITATION = """\
@InProceedings{chalkidis-etal-2021-multieurlex,
author = {Chalkidis, Ilias
and Fergadiotis, Manos
and Androutsopoulos, Ion},
title = {MultiEURLEX -- A multi-lingual and multi-label legal document
classification dataset for zero-shot cross-lingual transfer},
booktitle = {Proceedings of the 2021 Conference on Empirical Methods
in Natural Language Processing},
year = {2021},
publisher = {Association for Computational Linguistics},
location = {Punta Cana, Dominican Republic},
}"""
# Source data: "https://zenodo.org/record/5363165/files/multi_eurlex.tar.gz"
DATA_URL = "data/multi_eurlex.tar.gz"
_LANGUAGES = [
"en",
"da",
"de",
"nl",
"sv",
"bg",
"cs",
"hr",
"pl",
"sk",
"sl",
"es",
"fr",
"it",
"pt",
"ro",
"et",
"fi",
"hu",
"lt",
"lv",
"el",
"mt",
]
_CONCEPTS = {
"level_1": [
"100149",
"100160",
"100148",
"100147",
"100152",
"100143",
"100156",
"100158",
"100154",
"100153",
"100142",
"100145",
"100150",
"100162",
"100159",
"100144",
"100151",
"100157",
"100161",
"100146",
"100155",
],
"level_2": [
"100215",
"100211",
"100213",
"100214",
"100209",
"100208",
"100216",
"100210",
"100212",
"100270",
"100273",
"100269",
"100272",
"100276",
"100274",
"100271",
"100268",
"100275",
"100203",
"100201",
"100202",
"100207",
"100205",
"100204",
"100199",
"100206",
"100200",
"100198",
"100192",
"100193",
"100191",
"100196",
"100197",
"100195",
"100194",
"100230",
"100231",
"100229",
"100227",
"100228",
"100226",
"100173",
"100170",
"100172",
"100171",
"100250",
"100245",
"100251",
"100246",
"100248",
"100249",
"100252",
"100247",
"100260",
"100262",
"100261",
"100237",
"100241",
"100238",
"100239",
"100240",
"100234",
"100236",
"100232",
"100235",
"100233",
"100164",
"100166",
"100169",
"100167",
"100165",
"100163",
"100168",
"100178",
"100181",
"100179",
"100184",
"100183",
"100180",
"100182",
"100222",
"100217",
"100219",
"100223",
"100218",
"100220",
"100221",
"100288",
"100285",
"100287",
"100289",
"100286",
"100264",
"100263",
"100265",
"100267",
"100266",
"100177",
"100174",
"100176",
"100175",
"100225",
"100224",
"100256",
"100255",
"100258",
"100253",
"100254",
"100257",
"100259",
"100278",
"100280",
"100284",
"100277",
"100279",
"100282",
"100281",
"100283",
"100190",
"100186",
"100185",
"100188",
"100189",
"100187",
"100244",
"100243",
"100242",
],
"level_3": [
"1754",
"5881",
"c_4ee83dea",
"2479",
"1268",
"181",
"1415",
"2789",
"85",
"3487",
"1820",
"4305",
"2688",
"317",
"3257",
"2459",
"108",
"1004",
"4050",
"1909",
"1916",
"4184",
"3307",
"540",
"965",
"2398",
"4619",
"2496",
"490",
"1690",
"2475",
"1687",
"1221",
"385",
"3300",
"52",
"3318",
"2690",
"4706",
"1700",
"2517",
"1882",
"1417",
"3820",
"4414",
"3879",
"4565",
"3798",
"3809",
"3810",
"1362",
"1401",
"1400",
"3895",
"1398",
"5359",
"1390",
"1386",
"1845",
"1410",
"1834",
"5615",
"1718",
"5614",
"2720",
"2507",
"3587",
"4303",
"1418",
"1388",
"3151",
"1804",
"1630",
"1000",
"1488",
"2489",
"2639",
"1039",
"2656",
"2632",
"929",
"394",
"2698",
"1012",
"2448",
"1018",
"424",
"2510",
"4602",
"2486",
"1809",
"1325",
"1326",
"1321",
"2504",
"1021",
"1310",
"8469",
"285",
"1452",
"2495",
"2149",
"4370",
"1016",
"6332",
"4671",
"3239",
"1850",
"4380",
"3156",
"2520",
"5842",
"2519",
"2292",
"2128",
"614",
"c_4c7717f3",
"2487",
"2449",
"2450",
"1786",
"1810",
"524",
"2488",
"87",
"5268",
"13",
"474",
"4291",
"138",
"3193",
"139",
"3584",
"11",
"3185",
"1155",
"54",
"2474",
"802",
"539",
"3581",
"4413",
"1164",
"1154",
"813",
"5985",
"445",
"4189",
"4703",
"4300",
"69",
"2469",
"3582",
"554",
"3451",
"2628",
"2647",
"3423",
"2464",
"1346",
"3461",
"3474",
"3467",
"2189",
"3476",
"2500",
"4697",
"6722",
"3450",
"99",
"3074",
"2460",
"3489",
"2734",
"2723",
"5877",
"711",
"1277",
"2711",
"2443",
"2442",
"1063",
"651",
"2505",
"2972",
"2477",
"2493",
"4363",
"4412",
"4630",
"2014",
"5962",
"1372",
"2320",
"3544",
"1652",
"5913",
"2476",
"3605",
"2551",
"4358",
"2814",
"937",
"962",
"2707",
"2481",
"2817",
"4185",
"2914",
"2478",
"3797",
"4418",
"3641",
"3632",
"3689",
"4415",
"3160",
"2494",
"3101",
"3131",
"4505",
"3092",
"1954",
"2181",
"2015",
"3098",
"4539",
"4522",
"2512",
"4515",
"2184",
"82",
"4543",
"2178",
"557",
"3209",
"5974",
"1627",
"1074",
"4299",
"2468",
"3522",
"1163",
"2491",
"3273",
"5275",
"1737",
"1802",
"4276",
"2180",
"2258",
"4436",
"41",
"3232",
"2242",
"53",
"2246",
"2166",
"77",
"6034",
"3062",
"517",
"2702",
"2703",
"4157",
"1748",
"695",
"4750",
"558",
"2186",
"4367",
"1953",
"883",
"2370",
"1282",
"2573",
"3025",
"1453",
"2152",
"2001",
"4045",
"4179",
"4704",
"5789",
"3935",
"4222",
"5371",
"2701",
"1538",
"5400",
"3929",
"523",
"584",
"7347",
"3901",
"538",
"3900",
"3908",
"3899",
"6922",
"565",
"567",
"4010",
"566",
"1432",
"3513",
"3878",
"3954",
"573",
"2351",
"5923",
"2472",
"1422",
"4486",
"2467",
"668",
"3683",
"3278",
"4705",
"2175",
"4554",
"1426",
"4488",
"1405",
"3028",
"5922",
"873",
"778",
"2059",
"795",
"784",
"4150",
"494",
"486",
"4366",
"1370",
"4361",
"2473",