Upload xsid.py with huggingface_hub
Browse files2 unmodified lines3456786789101118 unmodified lines303132333334353695 unmodified lines13213313413513513613713813914014114214314414214314414514614614714814915015114915015115215315315415515611 unmodified lines16816917017117117217317317417517666 unmodified lines24324424524624624724824920 unmodified lines2702712722732732742752762 unmodified lines
import datasets
from nusacrowd.utils import schemasfrom nusacrowd.utils.configs import NusantaraConfigfrom nusacrowd.utils.constants import Tasksfrom seacrowd.utils import schemasfrom seacrowd.utils.configs import SEACrowdConfigfrom seacrowd.utils.constants import Tasks
_CITATION = """\@inproceedings{van-der-goot-etal-2020-cross,18 unmodified lines}_SUPPORTED_TASKS = [Tasks.INTENT_CLASSIFICATION, Tasks.POS_TAGGING]_SOURCE_VERSION = "0.3.0"_NUSANTARA_VERSION = "1.0.0"_SEACROWD_VERSION = "2024.06.20"
INTENT_LIST = [ "AddToPlaylist",95 unmodified lines """xSID datasets contains datasets to detect the intent from the text"""
BUILDER_CONFIGS = [ NusantaraConfig( SEACrowdConfig( name="xsid_source", version=datasets.Version(_SOURCE_VERSION), description="xSID source schema", schema="source", subset_id="xsid", ), NusantaraConfig( name="xsid_nusantara_text", version=datasets.Version(_NUSANTARA_VERSION), SEACrowdConfig( name="xsid_seacrowd_text", version=datasets.Version(_SEACROWD_VERSION), description="xSID Nusantara intent classification schema", schema="nusantara_text", schema="seacrowd_text", subset_id="xsid", ), NusantaraConfig( name="xsid_nusantara_seq_label", version=datasets.Version(_NUSANTARA_VERSION), SEACrowdConfig( name="xsid_seacrowd_seq_label", version=datasets.Version(_SEACROWD_VERSION), description="xSID Nusantara pos tagging schema", schema="nusantara_seq_label", schema="seacrowd_seq_label", subset_id="xsid", ), ]11 unmodified lines "tokens": datasets.Sequence(datasets.Value("string")), } ) elif self.config.schema == "nusantara_text": elif self.config.schema == "seacrowd_text": features = schemas.text_features(label_names=INTENT_LIST) elif self.config.schema == "nusantara_seq_label": elif self.config.schema == "seacrowd_seq_label": features = schemas.seq_label_features(label_names=TAG_LIST) else: raise ValueError(f"Invalid config schema: {self.config.schema}")66 unmodified lines } yield id, ex
elif self.config.name == "xsid_nusantara_text": elif self.config.name == "xsid_seacrowd_text": with open(filepath, "r") as file: data = file.read().strip("\n").split("\n\n")
20 unmodified lines } yield id, ex
elif self.config.name == "xsid_nusantara_seq_label": elif self.config.name == "xsid_seacrowd_seq_label": with open(filepath, "r") as file: data = file.read().strip("\n").split("\n\n")
xsid.py+17-17