Skip to content

Commit

Permalink
update test script - change label checking to an implicit empty value…
Browse files Browse the repository at this point in the history
… checking, change indo_nli to indonli, add jsonlines requirements
  • Loading branch information
SamuelCahyawijaya committed Jul 15, 2022
1 parent 755865a commit 09bfa88
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}
"""

_DATASETNAME = "indo_nli"
_DATASETNAME = "indonli"

_DESCRIPTION = """\
This dataset is designed for Natural Language Inference NLP task. It is designed to provide a challenging test-bed
Expand Down Expand Up @@ -100,22 +100,22 @@ class IndoNli(datasets.GeneratorBasedBuilder):

BUILDER_CONFIGS = [
NusantaraConfig(
name="indo_nli_source",
name="indonli_source",
version=SOURCE_VERSION,
description="indo_nli source schema",
description="indonli source schema",
schema="source",
subset_id="indo_nli",
subset_id="indonli",
),
NusantaraConfig(
name="indo_nli_nusantara_pairs",
name="indonli_nusantara_pairs",
version=NUSANTARA_VERSION,
description="indo_nli Nusantara schema",
description="indonli Nusantara schema",
schema="nusantara_pairs",
subset_id="indo_nli",
subset_id="indonli",
),
]

DEFAULT_CONFIG_NAME = "indo_nli_source"
DEFAULT_CONFIG_NAME = "indonli_source"
labels = ["c", "e", "n"]

def _info(self) -> datasets.DatasetInfo:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ aiohttp==3.8.1
pre-commit==2.19.0
soundfile
librosa
jsonlines>=3.1.0
2 changes: 1 addition & 1 deletion tests/test_nusantara.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def get_feature_statistics(self, features: Features, schema: str) -> Dict:
for feature_name, feature in features.items():
if example.get(feature_name, None) is not None:
if isinstance(feature, datasets.ClassLabel) or isinstance(feature, datasets.Value):
if example[feature_name]:
if example[feature_name] is not None:
counter[feature_name] += 1
else:
counter[feature_name] += len(example[feature_name])
Expand Down

0 comments on commit 09bfa88

Please sign in to comment.