Datasets:
Ralph Peeters
commited on
Commit
·
e9332be
1
Parent(s):
33ef954
update loading script
Browse files- products-2017.py +2 -29
products-2017.py
CHANGED
@@ -13,16 +13,10 @@
|
|
13 |
# limitations under the License.
|
14 |
"""The WDC Product Data Corpus and Gold Standard for Large-Scale Product Matching - Version 2.0."""
|
15 |
|
16 |
-
|
17 |
-
import csv
|
18 |
import json
|
19 |
-
import os
|
20 |
|
21 |
import datasets
|
22 |
|
23 |
-
from pdb import set_trace
|
24 |
-
|
25 |
-
|
26 |
_CITATION = """\
|
27 |
@inproceedings{primpeli2019wdc,
|
28 |
title={The WDC training dataset and gold standard for large-scale product matching},
|
@@ -45,16 +39,6 @@ _HOMEPAGE = "http://webdatacommons.org/largescaleproductcorpus/v2/index.html"
|
|
45 |
|
46 |
_LICENSE = ""
|
47 |
|
48 |
-
# TODO: Add link to the official dataset URLs here
|
49 |
-
# The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
|
50 |
-
# This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
|
51 |
-
_URLS = {
|
52 |
-
"computers": "https://huggingface.co/datasets/wdc/products-2017/computers/",
|
53 |
-
"cameras": "https://huggingface.co/datasets/wdc/products-2017/cameras/",
|
54 |
-
"watches": "https://huggingface.co/datasets/wdc/products-2017/watches/",
|
55 |
-
"shoes": "https://huggingface.co/datasets/wdc/products-2017/shoes/"
|
56 |
-
}
|
57 |
-
|
58 |
_BASE_DATA_PAT_FORMAT_STR = "{category}/"
|
59 |
|
60 |
class Products2017Config(datasets.BuilderConfig):
|
@@ -68,9 +52,7 @@ class Products2017Config(datasets.BuilderConfig):
|
|
68 |
|
69 |
size = name.split('_')[1]
|
70 |
# Initialize the base class.
|
71 |
-
|
72 |
-
f"Dataset for category {name}"
|
73 |
-
)
|
74 |
super(Products2017Config, self).__init__(
|
75 |
name=name, **kwargs
|
76 |
)
|
@@ -88,17 +70,8 @@ class Products2017(datasets.GeneratorBasedBuilder):
|
|
88 |
|
89 |
VERSION = datasets.Version("2.1.0")
|
90 |
|
91 |
-
|
92 |
-
# If you don't want/need to define several sub-sets in your dataset,
|
93 |
-
# just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
|
94 |
-
|
95 |
-
# If you need to make complex sub-parts in the datasets with configurable options
|
96 |
-
# You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
|
97 |
-
# BUILDER_CONFIG_CLASS = MyBuilderConfig
|
98 |
|
99 |
-
# You will be able to load one or the other configurations in the following list with
|
100 |
-
# data = datasets.load_dataset('my_dataset', 'first_domain')
|
101 |
-
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
102 |
BUILDER_CONFIGS = [
|
103 |
Products2017Config(
|
104 |
name='computers_xlarge',
|
|
|
13 |
# limitations under the License.
|
14 |
"""The WDC Product Data Corpus and Gold Standard for Large-Scale Product Matching - Version 2.0."""
|
15 |
|
|
|
|
|
16 |
import json
|
|
|
17 |
|
18 |
import datasets
|
19 |
|
|
|
|
|
|
|
20 |
_CITATION = """\
|
21 |
@inproceedings{primpeli2019wdc,
|
22 |
title={The WDC training dataset and gold standard for large-scale product matching},
|
|
|
39 |
|
40 |
_LICENSE = ""
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
_BASE_DATA_PAT_FORMAT_STR = "{category}/"
|
43 |
|
44 |
class Products2017Config(datasets.BuilderConfig):
|
|
|
52 |
|
53 |
size = name.split('_')[1]
|
54 |
# Initialize the base class.
|
55 |
+
|
|
|
|
|
56 |
super(Products2017Config, self).__init__(
|
57 |
name=name, **kwargs
|
58 |
)
|
|
|
70 |
|
71 |
VERSION = datasets.Version("2.1.0")
|
72 |
|
73 |
+
BUILDER_CONFIG_CLASS = Products2017Config
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
|
|
|
|
|
|
75 |
BUILDER_CONFIGS = [
|
76 |
Products2017Config(
|
77 |
name='computers_xlarge',
|