Datasets:
parquet-converter
commited on
Commit
·
4140acc
1
Parent(s):
b02a20b
Update parquet files
Browse files- README.md +0 -60
- dataset_infos.json +0 -1
- kp20k.py +0 -138
- validation.json → raw/kp20k-test.parquet +2 -2
- train.json → raw/kp20k-train-00000-of-00002.parquet +2 -2
- test.json → raw/kp20k-train-00001-of-00002.parquet +2 -2
- raw/kp20k-validation.parquet +3 -0
README.md
DELETED
@@ -1,60 +0,0 @@
|
|
1 |
-
---
|
2 |
-
annotations_creators:
|
3 |
-
- unknown
|
4 |
-
language_creators:
|
5 |
-
- unknown
|
6 |
-
language:
|
7 |
-
- en
|
8 |
-
license:
|
9 |
-
- unknown
|
10 |
-
multilinguality:
|
11 |
-
- monolingual
|
12 |
-
task_categories:
|
13 |
-
- text-mining
|
14 |
-
- text-generation
|
15 |
-
task_ids:
|
16 |
-
- keyphrase-generation
|
17 |
-
- keyphrase-extraction
|
18 |
-
size_categories:
|
19 |
-
- 100K<n<1M
|
20 |
-
pretty_name: KP20k
|
21 |
-
---
|
22 |
-
|
23 |
-
# KP20k Benchmark Dataset for Keyphrase Generation
|
24 |
-
|
25 |
-
## About
|
26 |
-
|
27 |
-
KP20k is a dataset for benchmarking keyphrase extraction and generation models.
|
28 |
-
The data is composed of 570 809 abstracts and their associated titles from scientific articles.
|
29 |
-
|
30 |
-
Details about the dataset can be found in the original paper:
|
31 |
-
- Meng et al 2017.
|
32 |
-
[Deep keyphrase Generation](https://aclanthology.org/P17-1054.pdf)
|
33 |
-
Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, pages 582–592
|
34 |
-
|
35 |
-
Reference (indexer-assigned) keyphrases are also categorized under the PRMU (<u>P</u>resent-<u>R</u>eordered-<u>M</u>ixed-<u>U</u>nseen) scheme as proposed in the following paper:
|
36 |
-
- Florian Boudin and Ygor Gallina. 2021.
|
37 |
-
[Redefining Absent Keyphrases and their Effect on Retrieval Effectiveness](https://aclanthology.org/2021.naacl-main.330/).
|
38 |
-
In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 4185–4193, Online. Association for Computational Linguistics.
|
39 |
-
|
40 |
-
Text pre-processing (tokenization) is carried out using spacy (en_core_web_sm model) with a special rule to avoid splitting words with hyphens (e.g. graph-based is kept as one token). Stemming (Porter's stemmer implementation provided in nltk) is applied before reference keyphrases are matched against the source text.
|
41 |
-
|
42 |
-
## Content
|
43 |
-
|
44 |
-
The dataset is divided into the following three splits:
|
45 |
-
|
46 |
-
| Split | # documents | # keyphrases by document (average) | % Present | % Reordered | % Mixed | % Unseen |
|
47 |
-
| :--------- | ----------: | -----------: | --------: | ----------: | ------: | -------: |
|
48 |
-
| Train | 530 809 | 5.29 | 58.19 | 10.93 | 17.36 | 13.52 |
|
49 |
-
| Test | 20 000 | 5.28 | 58.40 | 10.84 | 17.20 | 13.56 |
|
50 |
-
| Validation | 20 000 | 5.27 | 58.20 | 10.94 | 17.26 | 13.61 |
|
51 |
-
|
52 |
-
|
53 |
-
The following data fields are available:
|
54 |
-
- **id**: unique identifier of the document. **NB** There were no ids in the original dataset. The ids were generated using the python module shortuuid (https://pypi.org/project/shortuuid/)
|
55 |
-
- **title**: title of the document.
|
56 |
-
- **abstract**: abstract of the document.
|
57 |
-
- **keyphrases**: list of reference keyphrases.
|
58 |
-
- **prmu**: list of <u>P</u>resent-<u>R</u>eordered-<u>M</u>ixed-<u>U</u>nseen categories for reference keyphrases.
|
59 |
-
|
60 |
-
**NB**: The present keyphrases (represented by the "P" label in the PRMU column) are sorted by their apparition order in the text (title + abstract).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset_infos.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"raw": {"description": "KP20k dataset for keyphrase extraction and generation in scientific paper.\n", "citation": "@InProceedings{meng-EtAl:2017:Long,\n author = {Meng, Rui and Zhao, Sanqiang and Han, Shuguang and He, Daqing and Brusilovsky, Peter and Chi, Yu},\n title = {Deep Keyphrase Generation},\n booktitle = {Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},\n month = {July},\n year = {2017},\n address = {Vancouver, Canada},\n publisher = {Association for Computational Linguistics},\n pages = {582--592},\n url = {http://aclweb.org/anthology/P17-1054}\n}\n", "homepage": "http://memray.me/uploads/acl17-keyphrase-generation.pdf", "license": "MIT LICENSE", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "title": {"dtype": "string", "id": null, "_type": "Value"}, "abstract": {"dtype": "string", "id": null, "_type": "Value"}, "keyphrases": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "prmu": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "kp20k", "config_name": "raw", "version": {"version_str": "0.0.1", "description": "", "major": 0, "minor": 0, "patch": 1}, "splits": {"train": {"name": "train", "num_bytes": 654745019, "num_examples": 530809, "dataset_name": "kp20k"}, "test": {"name": "test", "num_bytes": 24676939, "num_examples": 20000, "dataset_name": "kp20k"}, "validation": {"name": "validation", "num_bytes": 24658967, "num_examples": 20000, "dataset_name": "kp20k"}}, "download_checksums": {"test.json": {"num_bytes": 25256561, "checksum": "bde2d949cc8767c8ec4b3fbc6d25d1d218d1397cba58d130c33d17fd22af25cf"}, "train.json": {"num_bytes": 670114113, "checksum": "5ae4196410dc1e336de4b79e76800bb72c3669ce1888fab0ff46a431c7277c95"}, "validation.json": {"num_bytes": 25238622, "checksum": "a9dd61ed2547485a146b880e84042d002c3ed0fc668d9d0a08631f15e772f691"}}, "download_size": 720609296, "post_processing_size": null, "dataset_size": 704080925, "size_in_bytes": 1424690221}}
|
|
|
|
kp20k.py
DELETED
@@ -1,138 +0,0 @@
|
|
1 |
-
import csv
|
2 |
-
import json
|
3 |
-
import os
|
4 |
-
import datasets
|
5 |
-
|
6 |
-
|
7 |
-
_CITATION = """\
|
8 |
-
@InProceedings{meng-EtAl:2017:Long,
|
9 |
-
author = {Meng, Rui and Zhao, Sanqiang and Han, Shuguang and He, Daqing and Brusilovsky, Peter and Chi, Yu},
|
10 |
-
title = {Deep Keyphrase Generation},
|
11 |
-
booktitle = {Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
|
12 |
-
month = {July},
|
13 |
-
year = {2017},
|
14 |
-
address = {Vancouver, Canada},
|
15 |
-
publisher = {Association for Computational Linguistics},
|
16 |
-
pages = {582--592},
|
17 |
-
url = {http://aclweb.org/anthology/P17-1054}
|
18 |
-
}
|
19 |
-
"""
|
20 |
-
|
21 |
-
# You can copy an official description
|
22 |
-
_DESCRIPTION = """\
|
23 |
-
KP20k dataset for keyphrase extraction and generation in scientific paper.
|
24 |
-
"""
|
25 |
-
|
26 |
-
_HOMEPAGE = "http://memray.me/uploads/acl17-keyphrase-generation.pdf"
|
27 |
-
|
28 |
-
# License information from the original source page https://github.com/memray/seq2seq-keyphrase
|
29 |
-
_LICENSE = "MIT LICENSE"
|
30 |
-
|
31 |
-
# TODO: Add link to the official dataset URLs here
|
32 |
-
# The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
|
33 |
-
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
34 |
-
_URLS = {
|
35 |
-
"test": "test.json",
|
36 |
-
"train": "train.json",
|
37 |
-
"validation": "validation.json"
|
38 |
-
}
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
# TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
|
43 |
-
class KP20k(datasets.GeneratorBasedBuilder):
|
44 |
-
|
45 |
-
VERSION = datasets.Version("0.0.1","")
|
46 |
-
|
47 |
-
# This is an example of a dataset with multiple configurations.
|
48 |
-
# If you don't want/need to define several sub-sets in your dataset,
|
49 |
-
# just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
|
50 |
-
|
51 |
-
# If you need to make complex sub-parts in the datasets with configurable options
|
52 |
-
# You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
|
53 |
-
# BUILDER_CONFIG_CLASS = MyBuilderConfig
|
54 |
-
|
55 |
-
# You will be able to load one or the other configurations in the following list with
|
56 |
-
# data = datasets.load_dataset('my_dataset', 'first_domain')
|
57 |
-
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
58 |
-
BUILDER_CONFIGS = [
|
59 |
-
datasets.BuilderConfig(name="raw", version=VERSION, description="This part of my dataset covers the raw data"),
|
60 |
-
]
|
61 |
-
|
62 |
-
#DEFAULT_CONFIG_NAME = "raw" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
63 |
-
|
64 |
-
def _info(self):
|
65 |
-
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
66 |
-
print(self.config)
|
67 |
-
features = datasets.Features(
|
68 |
-
{
|
69 |
-
'id': datasets.Value(dtype="string"),
|
70 |
-
"title": datasets.Value("string"),
|
71 |
-
"abstract": datasets.Value("string"),
|
72 |
-
"keyphrases": datasets.features.Sequence(datasets.Value("string")),
|
73 |
-
"prmu": datasets.features.Sequence(datasets.Value("string")),
|
74 |
-
}
|
75 |
-
)
|
76 |
-
return datasets.DatasetInfo(
|
77 |
-
# This is the description that will appear on the datasets page.
|
78 |
-
description=_DESCRIPTION,
|
79 |
-
# This defines the different columns of the dataset and their types
|
80 |
-
features=features,
|
81 |
-
homepage=_HOMEPAGE,
|
82 |
-
# License for the dataset if available
|
83 |
-
license=_LICENSE,
|
84 |
-
# Citation for the dataset
|
85 |
-
citation=_CITATION,
|
86 |
-
)
|
87 |
-
|
88 |
-
def _split_generators(self, dl_manager):
|
89 |
-
# TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
|
90 |
-
# If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
|
91 |
-
|
92 |
-
# dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
|
93 |
-
# It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
|
94 |
-
# By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
|
95 |
-
urls = _URLS
|
96 |
-
data_dir = dl_manager.download_and_extract(urls)
|
97 |
-
return [
|
98 |
-
datasets.SplitGenerator(
|
99 |
-
name=datasets.Split.TRAIN,
|
100 |
-
# These kwargs will be passed to _generate_examples
|
101 |
-
gen_kwargs={
|
102 |
-
"filepath": os.path.join(data_dir["train"]),
|
103 |
-
"split": "train",
|
104 |
-
},
|
105 |
-
),
|
106 |
-
datasets.SplitGenerator(
|
107 |
-
name=datasets.Split.TEST,
|
108 |
-
# These kwargs will be passed to _generate_examples
|
109 |
-
gen_kwargs={
|
110 |
-
"filepath": os.path.join(data_dir["test"]),
|
111 |
-
"split": "test"
|
112 |
-
},
|
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["validation"]),
|
119 |
-
"split": "validation",
|
120 |
-
},
|
121 |
-
),
|
122 |
-
]
|
123 |
-
|
124 |
-
# method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
|
125 |
-
def _generate_examples(self, filepath, split):
|
126 |
-
# TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
127 |
-
# The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
|
128 |
-
with open(filepath, encoding="utf-8") as f:
|
129 |
-
for key, row in enumerate(f):
|
130 |
-
data = json.loads(row)
|
131 |
-
# Yields examples as (key, example) tuples
|
132 |
-
yield key, {
|
133 |
-
"id": data["id"],
|
134 |
-
"title": data["title"],
|
135 |
-
"abstract": data["abstract"],
|
136 |
-
"keyphrases": data["keyphrases"],
|
137 |
-
"prmu": data["prmu"],
|
138 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
validation.json → raw/kp20k-test.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c911da6fd7160c9d3c1c8632aa883e61634e395baa190f92a11e48ec885a4167
|
3 |
+
size 13861580
|
train.json → raw/kp20k-train-00000-of-00002.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:282c13be528f189de34fe841572258c59050fc05699bd74cddc7c478b5b4a3d3
|
3 |
+
size 281619031
|
test.json → raw/kp20k-train-00001-of-00002.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ba871d9057cb3d1375caef09e1193c1f30b814e76b1ac647784122b8635905b5
|
3 |
+
size 86662025
|
raw/kp20k-validation.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:598eed939f310ed55953a343aecda4cbfde2ec04a3b7698349d0586b3cd6ebc3
|
3 |
+
size 13840949
|