| """TODO(wikitext): Add a description here.""" |
|
|
|
|
| import os |
|
|
| import datasets |
|
|
|
|
| _CITATION = """\ |
| @misc{ |
| } |
| """ |
|
|
| _DESCRIPTION = """\ |
| The WikiText language modeling dataset is a collection of over 100 million tokens extracted from the set of verified |
| Good and Featured articles on Wikipedia. The dataset is available under the Creative Commons Attribution-ShareAlike |
| License. |
| """ |
| _HOMEPAGE = "https://blog.einstein.ai/the-wikitext-long-term-dependency-language-modeling-dataset/" |
| _LICENSE = "Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)" |
| _DATA_URL = "https://huggingface.co/datasets/alescontrela/mdm_data/blob/main" |
|
|
|
|
| class MDMDataConfig(datasets.BuilderConfig): |
| """BuilderConfig for GLUE.""" |
|
|
| def __init__(self, data_url, **kwargs): |
| """BuilderConfig for Wikitext |
| Args: |
| data_url: `string`, url to the dataset (word or raw level) |
| **kwargs: keyword arguments forwarded to super. |
| """ |
| super(MDMDataConfig, self).__init__( |
| version=datasets.Version( |
| "1.0.0", |
| ), |
| **kwargs, |
| ) |
| self.data_url = data_url |
|
|
|
|
| class MDMData(datasets.GeneratorBasedBuilder): |
| """TODO(wikitext_103): Short description of my dataset.""" |
|
|
| |
| VERSION = datasets.Version("0.1.0") |
| BUILDER_CONFIGS = [ |
| MDMDataConfig( |
| name="MDM Data", |
| data_url=_DATA_URL + "/" + "HumanML3D.zip", |
| description="Text to motion dataset.", |
| ), |
| ] |
|
|
| def _info(self): |
| |
| return datasets.DatasetInfo( |
| |
| description=_DESCRIPTION, |
| |
| features=datasets.Features( |
| { |
| "text": datasets.Value("string") |
| |
| } |
| ), |
| |
| |
| |
| supervised_keys=None, |
| homepage=_HOMEPAGE, |
| license=_LICENSE, |
| citation=_CITATION, |
| ) |
|
|
| def _split_generators(self, dl_manager): |
| """Returns SplitGenerators.""" |
| |
| |
| |
| data_file = dl_manager.download_and_extract(self.config.data_url) |
| data_dir = os.path.join(data_file, "HumanML3D.zip") |
| print(data_file, data_dir) |
| return [] |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
|
|
| def _generate_examples(self, data_file, split): |
|
|
| """Yields examples.""" |
| |
| with open(data_file, encoding="utf-8") as f: |
| for idx, row in enumerate(f): |
| if row.strip(): |
| yield idx, {"text": row} |
| else: |
| yield idx, {"text": ""} |