Datasets:
Update SourceData.py
Browse files- SourceData.py +1 -14
SourceData.py
CHANGED
@@ -86,7 +86,7 @@ class SourceData(datasets.GeneratorBasedBuilder):
|
|
86 |
datasets.BuilderConfig(name="ROLES_MULTI", version=self.config.version, description="Dataset to train roles. ROLES_GP and ROLES_SM at once."),
|
87 |
]
|
88 |
|
89 |
-
if self.config.name
|
90 |
features = datasets.Features(
|
91 |
{
|
92 |
"words": datasets.Sequence(feature=datasets.Value("string")),
|
@@ -160,19 +160,6 @@ class SourceData(datasets.GeneratorBasedBuilder):
|
|
160 |
"tag_mask": datasets.Sequence(feature=datasets.Value("int8")),
|
161 |
}
|
162 |
)
|
163 |
-
else:
|
164 |
-
features = datasets.Features(
|
165 |
-
{
|
166 |
-
"words": datasets.Sequence(feature=datasets.Value("string")),
|
167 |
-
"labels": datasets.Sequence(
|
168 |
-
feature=datasets.ClassLabel(num_classes=len(self._NER_LABEL_NAMES),
|
169 |
-
names=self._NER_LABEL_NAMES)
|
170 |
-
),
|
171 |
-
# "is_category": datasets.Sequence(feature=datasets.Value("int8")),
|
172 |
-
"tag_mask": datasets.Sequence(feature=datasets.Value("int8")),
|
173 |
-
"text": datasets.Value("string"),
|
174 |
-
}
|
175 |
-
)
|
176 |
|
177 |
return datasets.DatasetInfo(
|
178 |
description=self._DESCRIPTION,
|
|
|
86 |
datasets.BuilderConfig(name="ROLES_MULTI", version=self.config.version, description="Dataset to train roles. ROLES_GP and ROLES_SM at once."),
|
87 |
]
|
88 |
|
89 |
+
if self.config.name in ["NER", "default"]:
|
90 |
features = datasets.Features(
|
91 |
{
|
92 |
"words": datasets.Sequence(feature=datasets.Value("string")),
|
|
|
160 |
"tag_mask": datasets.Sequence(feature=datasets.Value("int8")),
|
161 |
}
|
162 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
|
164 |
return datasets.DatasetInfo(
|
165 |
description=self._DESCRIPTION,
|