Datasets:
Tasks:
Text Retrieval
Modalities:
Text
Formats:
parquet
Sub-tasks:
document-retrieval
Languages:
English
Size:
10K - 100K
ArXiv:
License:
Convert dataset to Parquet
#3
by
albertvillanova
HF staff
- opened
- README.md +33 -13
- eu2uk/test-00000-of-00001.parquet +3 -0
- eu2uk/train-00000-of-00001.parquet +3 -0
- eu2uk/uk_corpus-00000-of-00002.parquet +3 -0
- eu2uk/uk_corpus-00001-of-00002.parquet +3 -0
- eu2uk/validation-00000-of-00001.parquet +3 -0
- eu_regulatory_ir.py +0 -149
- uk2eu/eu_corpus-00000-of-00001.parquet +3 -0
- uk2eu/test-00000-of-00001.parquet +3 -0
- uk2eu/train-00000-of-00001.parquet +3 -0
- uk2eu/validation-00000-of-00001.parquet +3 -0
README.md
CHANGED
@@ -17,7 +17,6 @@ task_categories:
|
|
17 |
- text-retrieval
|
18 |
task_ids:
|
19 |
- document-retrieval
|
20 |
-
paperswithcode_id: null
|
21 |
pretty_name: the RegIR datasets
|
22 |
tags:
|
23 |
- document-to-document-retrieval
|
@@ -34,19 +33,19 @@ dataset_info:
|
|
34 |
sequence: string
|
35 |
splits:
|
36 |
- name: train
|
37 |
-
num_bytes:
|
38 |
num_examples: 1400
|
39 |
- name: test
|
40 |
-
num_bytes:
|
41 |
num_examples: 300
|
42 |
- name: validation
|
43 |
-
num_bytes:
|
44 |
num_examples: 300
|
45 |
- name: uk_corpus
|
46 |
-
num_bytes:
|
47 |
num_examples: 52515
|
48 |
-
download_size:
|
49 |
-
dataset_size:
|
50 |
- config_name: uk2eu
|
51 |
features:
|
52 |
- name: document_id
|
@@ -59,19 +58,40 @@ dataset_info:
|
|
59 |
sequence: string
|
60 |
splits:
|
61 |
- name: train
|
62 |
-
num_bytes:
|
63 |
num_examples: 1500
|
64 |
- name: test
|
65 |
-
num_bytes:
|
66 |
num_examples: 300
|
67 |
- name: validation
|
68 |
-
num_bytes:
|
69 |
num_examples: 300
|
70 |
- name: eu_corpus
|
71 |
-
num_bytes:
|
72 |
num_examples: 3930
|
73 |
-
download_size:
|
74 |
-
dataset_size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
---
|
76 |
|
77 |
# Dataset Card for the RegIR datasets
|
|
|
17 |
- text-retrieval
|
18 |
task_ids:
|
19 |
- document-retrieval
|
|
|
20 |
pretty_name: the RegIR datasets
|
21 |
tags:
|
22 |
- document-to-document-retrieval
|
|
|
33 |
sequence: string
|
34 |
splits:
|
35 |
- name: train
|
36 |
+
num_bytes: 20665018
|
37 |
num_examples: 1400
|
38 |
- name: test
|
39 |
+
num_bytes: 8844125
|
40 |
num_examples: 300
|
41 |
- name: validation
|
42 |
+
num_bytes: 5852794
|
43 |
num_examples: 300
|
44 |
- name: uk_corpus
|
45 |
+
num_bytes: 502468239
|
46 |
num_examples: 52515
|
47 |
+
download_size: 204749702
|
48 |
+
dataset_size: 537830176
|
49 |
- config_name: uk2eu
|
50 |
features:
|
51 |
- name: document_id
|
|
|
58 |
sequence: string
|
59 |
splits:
|
60 |
- name: train
|
61 |
+
num_bytes: 55144635
|
62 |
num_examples: 1500
|
63 |
- name: test
|
64 |
+
num_bytes: 14810440
|
65 |
num_examples: 300
|
66 |
- name: validation
|
67 |
+
num_bytes: 15175624
|
68 |
num_examples: 300
|
69 |
- name: eu_corpus
|
70 |
+
num_bytes: 57212402
|
71 |
num_examples: 3930
|
72 |
+
download_size: 55184031
|
73 |
+
dataset_size: 142343101
|
74 |
+
configs:
|
75 |
+
- config_name: eu2uk
|
76 |
+
data_files:
|
77 |
+
- split: train
|
78 |
+
path: eu2uk/train-*
|
79 |
+
- split: test
|
80 |
+
path: eu2uk/test-*
|
81 |
+
- split: validation
|
82 |
+
path: eu2uk/validation-*
|
83 |
+
- split: uk_corpus
|
84 |
+
path: eu2uk/uk_corpus-*
|
85 |
+
- config_name: uk2eu
|
86 |
+
data_files:
|
87 |
+
- split: train
|
88 |
+
path: uk2eu/train-*
|
89 |
+
- split: test
|
90 |
+
path: uk2eu/test-*
|
91 |
+
- split: validation
|
92 |
+
path: uk2eu/validation-*
|
93 |
+
- split: eu_corpus
|
94 |
+
path: uk2eu/eu_corpus-*
|
95 |
---
|
96 |
|
97 |
# Dataset Card for the RegIR datasets
|
eu2uk/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a6273c8545cec3fd11f200ba4ac0f4e6f86a83acd94a26c6f8d4d6f509d9ffdf
|
3 |
+
size 3389699
|
eu2uk/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:73b02d197688c0c87ad8ad70b67d07fd08548d65e32e3beb3dd1b873a82165fd
|
3 |
+
size 8309671
|
eu2uk/uk_corpus-00000-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1ed234112761ac5cabbc1f93655f7761d4dbb97cf35cb5d5dc30528df9dd9d99
|
3 |
+
size 84788615
|
eu2uk/uk_corpus-00001-of-00002.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e3c6e606f3facd502615f05e4db0b05d1fd5072355734b0364c520010af8e17a
|
3 |
+
size 105978371
|
eu2uk/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ff071c6e47810fd7a01cc5e34d7aff2d2aaf7be133e64f60614c5855124d41e1
|
3 |
+
size 2283346
|
eu_regulatory_ir.py
DELETED
@@ -1,149 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
3 |
-
#
|
4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
# you may not use this file except in compliance with the License.
|
6 |
-
# You may obtain a copy of the License at
|
7 |
-
#
|
8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
#
|
10 |
-
# Unless required by applicable law or agreed to in writing, software
|
11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
# See the License for the specific language governing permissions and
|
14 |
-
# limitations under the License.
|
15 |
-
"""EURegIR: Regulatory Compliance IR (EU/UK)"""
|
16 |
-
|
17 |
-
|
18 |
-
import json
|
19 |
-
import os
|
20 |
-
|
21 |
-
import datasets
|
22 |
-
|
23 |
-
|
24 |
-
_CITATION = """\
|
25 |
-
@inproceedings{chalkidis-etal-2021-regir,
|
26 |
-
title = "Regulatory Compliance through Doc2Doc Information Retrieval: A case study in EU/UK legislation where text similarity has limitations",
|
27 |
-
author = "Chalkidis, Ilias and Fergadiotis, Emmanouil and Manginas, Nikos and Katakalou, Eva, and Malakasiotis, Prodromos",
|
28 |
-
booktitle = "Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics (EACL 2021)",
|
29 |
-
year = "2021",
|
30 |
-
address = "Online",
|
31 |
-
publisher = "Association for Computational Linguistics",
|
32 |
-
url = "https://arxiv.org/abs/2101.10726",
|
33 |
-
}
|
34 |
-
"""
|
35 |
-
|
36 |
-
_DESCRIPTION = """\
|
37 |
-
EURegIR: Regulatory Compliance IR (EU/UK)
|
38 |
-
"""
|
39 |
-
|
40 |
-
_HOMEPAGE = "https://archive.org/details/eacl2021_regir_dataset"
|
41 |
-
|
42 |
-
_LICENSE = "CC BY-SA (Creative Commons / Attribution-ShareAlike)"
|
43 |
-
|
44 |
-
_URLs = {
|
45 |
-
"eu2uk": "https://archive.org/download/eacl2021_regir_datasets/eu2uk.zip",
|
46 |
-
"uk2eu": "https://archive.org/download/eacl2021_regir_datasets/uk2eu.zip",
|
47 |
-
}
|
48 |
-
|
49 |
-
|
50 |
-
class EuRegulatoryIr(datasets.GeneratorBasedBuilder):
|
51 |
-
"""EURegIR: Regulatory Compliance IR (EU/UK)"""
|
52 |
-
|
53 |
-
VERSION = datasets.Version("1.1.0")
|
54 |
-
|
55 |
-
BUILDER_CONFIGS = [
|
56 |
-
datasets.BuilderConfig(name="eu2uk", version=VERSION, description="EURegIR: Regulatory Compliance IR (EU2UK)"),
|
57 |
-
datasets.BuilderConfig(name="uk2eu", version=VERSION, description="EURegIR: Regulatory Compliance IR (UK2EU)"),
|
58 |
-
]
|
59 |
-
|
60 |
-
def _info(self):
|
61 |
-
if self.config.name == "eu2uk":
|
62 |
-
features = datasets.Features(
|
63 |
-
{
|
64 |
-
"document_id": datasets.Value("string"),
|
65 |
-
"publication_year": datasets.Value("string"),
|
66 |
-
"text": datasets.Value("string"),
|
67 |
-
"relevant_documents": datasets.features.Sequence(datasets.Value("string")),
|
68 |
-
}
|
69 |
-
)
|
70 |
-
else:
|
71 |
-
features = datasets.Features(
|
72 |
-
{
|
73 |
-
"document_id": datasets.Value("string"),
|
74 |
-
"publication_year": datasets.Value("string"),
|
75 |
-
"text": datasets.Value("string"),
|
76 |
-
"relevant_documents": datasets.features.Sequence(datasets.Value("string")),
|
77 |
-
}
|
78 |
-
)
|
79 |
-
return datasets.DatasetInfo(
|
80 |
-
# This is the description that will appear on the datasets page.
|
81 |
-
description=_DESCRIPTION,
|
82 |
-
# This defines the different columns of the dataset and their types
|
83 |
-
features=features, # Here we define them above because they are different between the two configurations
|
84 |
-
# If there's a common (input, target) tuple from the features,
|
85 |
-
# specify them here. They'll be used if as_supervised=True in
|
86 |
-
# builder.as_dataset.
|
87 |
-
supervised_keys=None,
|
88 |
-
# Homepage of the dataset for documentation
|
89 |
-
homepage=_HOMEPAGE,
|
90 |
-
# License for the dataset if available
|
91 |
-
license=_LICENSE,
|
92 |
-
# Citation for the dataset
|
93 |
-
citation=_CITATION,
|
94 |
-
)
|
95 |
-
|
96 |
-
def _split_generators(self, dl_manager):
|
97 |
-
"""Returns SplitGenerators."""
|
98 |
-
my_urls = _URLs[self.config.name]
|
99 |
-
data_dir = dl_manager.download_and_extract(my_urls)
|
100 |
-
return [
|
101 |
-
datasets.SplitGenerator(
|
102 |
-
name=datasets.Split.TRAIN,
|
103 |
-
# These kwargs will be passed to _generate_examples
|
104 |
-
gen_kwargs={
|
105 |
-
"filepath": os.path.join(data_dir, "train.jsonl"),
|
106 |
-
"split": "train",
|
107 |
-
},
|
108 |
-
),
|
109 |
-
datasets.SplitGenerator(
|
110 |
-
name=datasets.Split.TEST,
|
111 |
-
# These kwargs will be passed to _generate_examples
|
112 |
-
gen_kwargs={"filepath": os.path.join(data_dir, "test.jsonl"), "split": "test"},
|
113 |
-
),
|
114 |
-
datasets.SplitGenerator(
|
115 |
-
name=datasets.Split.VALIDATION,
|
116 |
-
# These kwargs will be passed to _generate_examples
|
117 |
-
gen_kwargs={
|
118 |
-
"filepath": os.path.join(data_dir, "dev.jsonl"),
|
119 |
-
"split": "dev",
|
120 |
-
},
|
121 |
-
),
|
122 |
-
datasets.SplitGenerator(
|
123 |
-
name=f"{self.config.name.split('2')[1]}_corpus",
|
124 |
-
# These kwargs will be passed to _generate_examples
|
125 |
-
gen_kwargs={
|
126 |
-
"filepath": os.path.join(data_dir, "corpus.jsonl"),
|
127 |
-
"split": f"{self.config.name.split('2')[1]}_corpus",
|
128 |
-
},
|
129 |
-
),
|
130 |
-
]
|
131 |
-
|
132 |
-
def _generate_examples(
|
133 |
-
self, filepath, split # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
134 |
-
):
|
135 |
-
"""Yields examples as (key, example) tuples."""
|
136 |
-
# This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
137 |
-
# The `key` is here for legacy reason (tfds) and is not important in itself.
|
138 |
-
|
139 |
-
with open(filepath, encoding="utf-8") as f:
|
140 |
-
for id_, row in enumerate(f):
|
141 |
-
data = json.loads(row)
|
142 |
-
yield id_, {
|
143 |
-
"document_id": data["document_id"],
|
144 |
-
"text": data["text"],
|
145 |
-
"publication_year": data["publication_year"],
|
146 |
-
"relevant_documents": data["relevant_documents"]
|
147 |
-
if split != f"{self.config.name.split('2')[1]}_corpus"
|
148 |
-
else [],
|
149 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uk2eu/eu_corpus-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:845d6e7a5a40e749b565cd74261480e9588fb9a55b29e8a4d86d7f80b697e6da
|
3 |
+
size 23079955
|
uk2eu/test-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:736f1d6510e4e0cf2e086d2d5d04b32d987a89896c2b6812b5ad8d974397c3d3
|
3 |
+
size 5478078
|
uk2eu/train-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9d7de62dc9c4adeff7031cd9d0dac0d53c2ae19977dbd3f3e2a90d23090fd5be
|
3 |
+
size 21019155
|
uk2eu/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8be0684637a6270f4f053f64b185a91e0870194fdf8199ec300d317f70736850
|
3 |
+
size 5606843
|