Commit
·
1ec3c61
0
Parent(s):
Update files from the datasets library (from 1.0.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.0.0
- .gitattributes +27 -0
- dataset_infos.json +1 -0
- dummy/WOS5736/6.0.0/dummy_data.zip +3 -0
- web_of_science.py +131 -0
.gitattributes
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
dataset_infos.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"WOS5736": {"description": "Copyright (c) 2017 Kamran Kowsari\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this dataset and associated documentation files (the \"Dataset\"), to deal\nin the dataset without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Dataset, and to permit persons to whom the dataset is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Dataset.\n\nIf you use this dataset please cite: Referenced paper: HDLTex: Hierarchical Deep Learning for Text Classification\n\nDescription of Dataset:\n\nHere is three datasets which include WOS-11967 , WOS-46985, and WOS-5736\nEach folder contains:\n-X.txt\n-Y.txt\n-YL1.txt\n-YL2.txt\n\nX is input data that include text sequences\nY is target value\nYL1 is target value of level one (parent label)\nYL2 is target value of level one (child label)\nWeb of Science Dataset WOS-5736\n -This dataset contains 5,736 documents with 11 categories which include 3 parents categories.", "citation": "@inproceedings{kowsari2017HDLTex,\ntitle={HDLTex: Hierarchical Deep Learning for Text Classification},\nauthor={Kowsari, Kamran and Brown, Donald E and Heidarysafa, Mojtaba and Jafari Meimandi, Kiana and and Gerber, Matthew S and Barnes, Laura E},\nbooktitle={Machine Learning and Applications (ICMLA), 2017 16th IEEE International Conference on},\nyear={2017},\norganization={IEEE}\n}\n", "homepage": "https://data.mendeley.com/datasets/9rw3vkcfy4/6", "license": "", "features": {"input_data": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"dtype": "int32", "id": null, "_type": "Value"}, "label_level_1": {"dtype": "int32", "id": null, "_type": "Value"}, "label_level_2": {"dtype": "int32", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "web_of_science", "config_name": "WOS5736", "version": {"version_str": "6.0.0", "description": "", "datasets_version_to_prepare": null, "major": 6, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 8055118, "num_examples": 5736, "dataset_name": "web_of_science"}}, "download_checksums": {"https://data.mendeley.com/datasets/9rw3vkcfy4/6/files/c9ea673d-5542-44c0-ab7b-f1311f7d61df/WebOfScience.zip?dl=1": {"num_bytes": 60222421, "checksum": "b787d484bff88b0dcdb3fa291d06ec9d2f025dc2a67ce1045d0c688cd96ccf8a"}}, "download_size": 60222421, "dataset_size": 8055118, "size_in_bytes": 68277539}, "WOS11967": {"description": "Copyright (c) 2017 Kamran Kowsari\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this dataset and associated documentation files (the \"Dataset\"), to deal\nin the dataset without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Dataset, and to permit persons to whom the dataset is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Dataset.\n\nIf you use this dataset please cite: Referenced paper: HDLTex: Hierarchical Deep Learning for Text Classification\n\nDescription of Dataset:\n\nHere is three datasets which include WOS-11967 , WOS-46985, and WOS-5736\nEach folder contains:\n-X.txt\n-Y.txt\n-YL1.txt\n-YL2.txt\n\nX is input data that include text sequences\nY is target value\nYL1 is target value of level one (parent label)\nYL2 is target value of level one (child label)\nWeb of Science Dataset WOS-11967\n -This dataset contains 11,967 documents with 35 categories which include 7 parents categories.", "citation": "@inproceedings{kowsari2017HDLTex,\ntitle={HDLTex: Hierarchical Deep Learning for Text Classification},\nauthor={Kowsari, Kamran and Brown, Donald E and Heidarysafa, Mojtaba and Jafari Meimandi, Kiana and and Gerber, Matthew S and Barnes, Laura E},\nbooktitle={Machine Learning and Applications (ICMLA), 2017 16th IEEE International Conference on},\nyear={2017},\norganization={IEEE}\n}\n", "homepage": "https://data.mendeley.com/datasets/9rw3vkcfy4/6", "license": "", "features": {"input_data": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"dtype": "int32", "id": null, "_type": "Value"}, "label_level_1": {"dtype": "int32", "id": null, "_type": "Value"}, "label_level_2": {"dtype": "int32", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "web_of_science", "config_name": "WOS11967", "version": {"version_str": "6.0.0", "description": "", "datasets_version_to_prepare": null, "major": 6, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 16255871, "num_examples": 11967, "dataset_name": "web_of_science"}}, "download_checksums": {"https://data.mendeley.com/datasets/9rw3vkcfy4/6/files/c9ea673d-5542-44c0-ab7b-f1311f7d61df/WebOfScience.zip?dl=1": {"num_bytes": 60222421, "checksum": "b787d484bff88b0dcdb3fa291d06ec9d2f025dc2a67ce1045d0c688cd96ccf8a"}}, "download_size": 60222421, "dataset_size": 16255871, "size_in_bytes": 76478292}, "WOS46985": {"description": "Copyright (c) 2017 Kamran Kowsari\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this dataset and associated documentation files (the \"Dataset\"), to deal\nin the dataset without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Dataset, and to permit persons to whom the dataset is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Dataset.\n\nIf you use this dataset please cite: Referenced paper: HDLTex: Hierarchical Deep Learning for Text Classification\n\nDescription of Dataset:\n\nHere is three datasets which include WOS-11967 , WOS-46985, and WOS-5736\nEach folder contains:\n-X.txt\n-Y.txt\n-YL1.txt\n-YL2.txt\n\nX is input data that include text sequences\nY is target value\nYL1 is target value of level one (parent label)\nYL2 is target value of level one (child label)\n\n Web of Science Dataset WOS-46985\n -This dataset contains 46,985 documents with 134 categories which include 7 parents categories.", "citation": "@inproceedings{kowsari2017HDLTex,\ntitle={HDLTex: Hierarchical Deep Learning for Text Classification},\nauthor={Kowsari, Kamran and Brown, Donald E and Heidarysafa, Mojtaba and Jafari Meimandi, Kiana and and Gerber, Matthew S and Barnes, Laura E},\nbooktitle={Machine Learning and Applications (ICMLA), 2017 16th IEEE International Conference on},\nyear={2017},\norganization={IEEE}\n}\n", "homepage": "https://data.mendeley.com/datasets/9rw3vkcfy4/6", "license": "", "features": {"input_data": {"dtype": "string", "id": null, "_type": "Value"}, "label": {"dtype": "int32", "id": null, "_type": "Value"}, "label_level_1": {"dtype": "int32", "id": null, "_type": "Value"}, "label_level_2": {"dtype": "int32", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "web_of_science", "config_name": "WOS46985", "version": {"version_str": "6.0.0", "description": "", "datasets_version_to_prepare": null, "major": 6, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 65501096, "num_examples": 46985, "dataset_name": "web_of_science"}}, "download_checksums": {"https://data.mendeley.com/datasets/9rw3vkcfy4/6/files/c9ea673d-5542-44c0-ab7b-f1311f7d61df/WebOfScience.zip?dl=1": {"num_bytes": 60222421, "checksum": "b787d484bff88b0dcdb3fa291d06ec9d2f025dc2a67ce1045d0c688cd96ccf8a"}}, "download_size": 60222421, "dataset_size": 65501096, "size_in_bytes": 125723517}}
|
dummy/WOS5736/6.0.0/dummy_data.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a7a3c4d0d31861a9297db8bc69ae0d5716fade5168c8b2caa92dfe7cd4d0e0dd
|
| 3 |
+
size 2030
|
web_of_science.py
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# coding=utf-8
|
| 2 |
+
# Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
|
| 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 |
+
|
| 16 |
+
# Lint as: python3
|
| 17 |
+
"""Web of science"""
|
| 18 |
+
|
| 19 |
+
from __future__ import absolute_import, division, print_function
|
| 20 |
+
|
| 21 |
+
import os
|
| 22 |
+
|
| 23 |
+
import datasets
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
_CITATION = """\
|
| 27 |
+
@inproceedings{kowsari2017HDLTex,
|
| 28 |
+
title={HDLTex: Hierarchical Deep Learning for Text Classification},
|
| 29 |
+
author={Kowsari, Kamran and Brown, Donald E and Heidarysafa, Mojtaba and Jafari Meimandi, Kiana and and Gerber, Matthew S and Barnes, Laura E},
|
| 30 |
+
booktitle={Machine Learning and Applications (ICMLA), 2017 16th IEEE International Conference on},
|
| 31 |
+
year={2017},
|
| 32 |
+
organization={IEEE}
|
| 33 |
+
}
|
| 34 |
+
"""
|
| 35 |
+
|
| 36 |
+
_DESCRIPTION = """\
|
| 37 |
+
The Web Of Science (WOS) dataset is a collection of data of published papers
|
| 38 |
+
available from the Web of Science. WOS has been released in three versions: WOS-46985, WOS-11967 and WOS-5736. WOS-46985 is the
|
| 39 |
+
full dataset. WOS-11967 and WOS-5736 are two subsets of WOS-46985.
|
| 40 |
+
|
| 41 |
+
"""
|
| 42 |
+
|
| 43 |
+
_DATA_URL = (
|
| 44 |
+
"https://data.mendeley.com/datasets/9rw3vkcfy4/6/files/c9ea673d-5542-44c0-ab7b-f1311f7d61df/WebOfScience.zip?dl=1"
|
| 45 |
+
)
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
class WebOfScienceConfig(datasets.BuilderConfig):
|
| 49 |
+
"""BuilderConfig for WebOfScience."""
|
| 50 |
+
|
| 51 |
+
def __init__(self, **kwargs):
|
| 52 |
+
"""BuilderConfig for WebOfScience.
|
| 53 |
+
|
| 54 |
+
Args:
|
| 55 |
+
**kwargs: keyword arguments forwarded to super.
|
| 56 |
+
"""
|
| 57 |
+
super(WebOfScienceConfig, self).__init__(version=datasets.Version("6.0.0", ""), **kwargs)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
class WebOfScience(datasets.GeneratorBasedBuilder):
|
| 61 |
+
"""Web of Science"""
|
| 62 |
+
|
| 63 |
+
BUILDER_CONFIGS = [
|
| 64 |
+
WebOfScienceConfig(
|
| 65 |
+
name="WOS5736",
|
| 66 |
+
description="""Web of Science Dataset WOS-5736: This dataset contains 5,736 documents with 11 categories which include 3 parents categories.""",
|
| 67 |
+
),
|
| 68 |
+
WebOfScienceConfig(
|
| 69 |
+
name="WOS11967",
|
| 70 |
+
description="""Web of Science Dataset WOS-11967: This dataset contains 11,967 documents with 35 categories which include 7 parents categories.""",
|
| 71 |
+
),
|
| 72 |
+
WebOfScienceConfig(
|
| 73 |
+
name="WOS46985",
|
| 74 |
+
description="""Web of Science Dataset WOS-46985: This dataset contains 46,985 documents with 134 categories which include 7 parents categories.""",
|
| 75 |
+
),
|
| 76 |
+
]
|
| 77 |
+
|
| 78 |
+
def _info(self):
|
| 79 |
+
return datasets.DatasetInfo(
|
| 80 |
+
description=_DESCRIPTION + self.config.description,
|
| 81 |
+
features=datasets.Features(
|
| 82 |
+
{
|
| 83 |
+
"input_data": datasets.Value("string"),
|
| 84 |
+
"label": datasets.Value("int32"),
|
| 85 |
+
"label_level_1": datasets.Value("int32"),
|
| 86 |
+
"label_level_2": datasets.Value("int32"),
|
| 87 |
+
}
|
| 88 |
+
),
|
| 89 |
+
# No default supervised_keys (as we have to pass both premise
|
| 90 |
+
# and hypothesis as input).
|
| 91 |
+
supervised_keys=None,
|
| 92 |
+
homepage="https://data.mendeley.com/datasets/9rw3vkcfy4/6",
|
| 93 |
+
citation=_CITATION,
|
| 94 |
+
)
|
| 95 |
+
|
| 96 |
+
def _split_generators(self, dl_manager):
|
| 97 |
+
"""Returns SplitGenerators."""
|
| 98 |
+
|
| 99 |
+
# dl_manager is a datasets.download.DownloadManager that can be used to
|
| 100 |
+
|
| 101 |
+
dl_path = dl_manager.download_and_extract(_DATA_URL)
|
| 102 |
+
return [
|
| 103 |
+
datasets.SplitGenerator(
|
| 104 |
+
name=datasets.Split.TRAIN,
|
| 105 |
+
# These kwargs will be passed to _generate_examples
|
| 106 |
+
gen_kwargs={
|
| 107 |
+
"input_file": os.path.join(dl_path, self.config.name, "X.txt"),
|
| 108 |
+
"label_file": os.path.join(dl_path, self.config.name, "Y.txt"),
|
| 109 |
+
"label_level_1_file": os.path.join(dl_path, self.config.name, "YL1.txt"),
|
| 110 |
+
"label_level_2_file": os.path.join(dl_path, self.config.name, "YL2.txt"),
|
| 111 |
+
},
|
| 112 |
+
)
|
| 113 |
+
]
|
| 114 |
+
|
| 115 |
+
def _generate_examples(self, input_file, label_file, label_level_1_file, label_level_2_file):
|
| 116 |
+
"""Yields examples."""
|
| 117 |
+
with open(input_file, encoding="utf-8") as f:
|
| 118 |
+
input_data = f.readlines()
|
| 119 |
+
with open(label_file, encoding="utf-8") as f:
|
| 120 |
+
label_data = f.readlines()
|
| 121 |
+
with open(label_level_1_file, encoding="utf-8") as f:
|
| 122 |
+
label_level_1_data = f.readlines()
|
| 123 |
+
with open(label_level_2_file, encoding="utf-8") as f:
|
| 124 |
+
label_level_2_data = f.readlines()
|
| 125 |
+
for i in range(len(input_data)):
|
| 126 |
+
yield i, {
|
| 127 |
+
"input_data": input_data[i],
|
| 128 |
+
"label": label_data[i],
|
| 129 |
+
"label_level_1": label_level_1_data[i],
|
| 130 |
+
"label_level_2": label_level_2_data[i],
|
| 131 |
+
}
|