xiaojuan0920
commited on
Commit
•
6ffaaa6
1
Parent(s):
29a2bc5
Update cskg_2.py
Browse files
cskg_2.py
CHANGED
@@ -57,7 +57,7 @@ _LICENSE = "Creative Commons Attribution-ShareAlike 4.0 International License"
|
|
57 |
# }
|
58 |
|
59 |
# TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
|
60 |
-
class
|
61 |
"""a commonsense knowledge graph"""
|
62 |
|
63 |
VERSION = datasets.Version("1.1.0")
|
@@ -74,15 +74,15 @@ class CSKG(datasets.GeneratorBasedBuilder):
|
|
74 |
# data = datasets.load_dataset('my_dataset', 'first_domain')
|
75 |
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
76 |
BUILDER_CONFIGS = [
|
77 |
-
datasets.BuilderConfig(name="
|
78 |
# datasets.BuilderConfig(name="second_domain", version=VERSION, description="This part of my dataset covers a second domain"),
|
79 |
]
|
80 |
|
81 |
-
DEFAULT_CONFIG_NAME = "
|
82 |
|
83 |
def _info(self):
|
84 |
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
85 |
-
if self.config.name == "
|
86 |
features = datasets.Features(
|
87 |
{
|
88 |
|
@@ -171,7 +171,7 @@ class CSKG(datasets.GeneratorBasedBuilder):
|
|
171 |
for id_, row in enumerate(f):
|
172 |
if id_ == 0:
|
173 |
continue
|
174 |
-
if self.config.name == "
|
175 |
row = row.split(b"\t")
|
176 |
|
177 |
# Yields examples as (key, example) tuples
|
|
|
57 |
# }
|
58 |
|
59 |
# TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
|
60 |
+
class cskg_2(datasets.GeneratorBasedBuilder):
|
61 |
"""a commonsense knowledge graph"""
|
62 |
|
63 |
VERSION = datasets.Version("1.1.0")
|
|
|
74 |
# data = datasets.load_dataset('my_dataset', 'first_domain')
|
75 |
# data = datasets.load_dataset('my_dataset', 'second_domain')
|
76 |
BUILDER_CONFIGS = [
|
77 |
+
datasets.BuilderConfig(name="cskg_2", version=VERSION, description="The relationships defined by cskg"),
|
78 |
# datasets.BuilderConfig(name="second_domain", version=VERSION, description="This part of my dataset covers a second domain"),
|
79 |
]
|
80 |
|
81 |
+
DEFAULT_CONFIG_NAME = "cskg_2" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
82 |
|
83 |
def _info(self):
|
84 |
# TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
85 |
+
if self.config.name == "cskg_2": # This is the name of the configuration selected in BUILDER_CONFIGS above
|
86 |
features = datasets.Features(
|
87 |
{
|
88 |
|
|
|
171 |
for id_, row in enumerate(f):
|
172 |
if id_ == 0:
|
173 |
continue
|
174 |
+
if self.config.name == "cskg_2":
|
175 |
row = row.split(b"\t")
|
176 |
|
177 |
# Yields examples as (key, example) tuples
|