Datasets:
License:
Upload mumospee_small.py with huggingface_hub
Browse files- mumospee_small.py +44 -2
mumospee_small.py
CHANGED
@@ -29,6 +29,42 @@ class MumospeeDatasetConfig(datasets.BuilderConfig):
|
|
29 |
|
30 |
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
33 |
"""Your custom dataset for Hugging Face based on the CSV metadata and audio URLs."""
|
34 |
|
@@ -39,7 +75,9 @@ class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
|
39 |
MumospeeDatasetConfig(
|
40 |
name="default",
|
41 |
version=datasets.Version("1.0.0"),
|
42 |
-
description=_DESCRIPTION
|
|
|
|
|
43 |
]
|
44 |
DEFAULT_CONFIG_NAME = "default"
|
45 |
|
@@ -49,7 +87,7 @@ class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
|
49 |
"path": datasets.Value("string"),
|
50 |
"url": datasets.Value("string"),
|
51 |
"type": datasets.Value("string"),
|
52 |
-
"duration": datasets.Value("
|
53 |
"language": datasets.Value("string"),
|
54 |
"transcript": datasets.Value("string"),
|
55 |
"tag": datasets.Value("string"),
|
@@ -61,6 +99,8 @@ class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
|
61 |
features=features,
|
62 |
license=_LICENSE,
|
63 |
)
|
|
|
|
|
64 |
|
65 |
def _split_generators(self, dl_manager):
|
66 |
"""Split the dataset into train, validation, and test."""
|
@@ -96,6 +136,8 @@ class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
|
96 |
# Filter by primary split
|
97 |
data_split = data[data["split"] == split]
|
98 |
|
|
|
|
|
99 |
if language:
|
100 |
data_split = data_split[data_split["language"] == language]
|
101 |
if tag:
|
|
|
29 |
|
30 |
|
31 |
|
32 |
+
# class SuperGlueConfig(datasets.BuilderConfig):
|
33 |
+
# """BuilderConfig for SuperGLUE."""
|
34 |
+
|
35 |
+
# def __init__(self, features, data_url, citation, url, label_classes=("False", "True"), **kwargs):
|
36 |
+
# """BuilderConfig for SuperGLUE.
|
37 |
+
|
38 |
+
# Args:
|
39 |
+
# features: *list[string]*, list of the features that will appear in the
|
40 |
+
# feature dict. Should not include "label".
|
41 |
+
# data_url: *string*, url to download the zip file from.
|
42 |
+
# citation: *string*, citation for the data set.
|
43 |
+
# url: *string*, url for information about the data set.
|
44 |
+
# label_classes: *list[string]*, the list of classes for the label if the
|
45 |
+
# label is present as a string. Non-string labels will be cast to either
|
46 |
+
# 'False' or 'True'.
|
47 |
+
# **kwargs: keyword arguments forwarded to super.
|
48 |
+
# """
|
49 |
+
# # Version history:
|
50 |
+
# # 1.0.2: Fixed non-nondeterminism in ReCoRD.
|
51 |
+
# # 1.0.1: Change from the pre-release trial version of SuperGLUE (v1.9) to
|
52 |
+
# # the full release (v2.0).
|
53 |
+
# # 1.0.0: S3 (new shuffling, sharding and slicing mechanism).
|
54 |
+
# # 0.0.2: Initial version.
|
55 |
+
# super().__init__(version=datasets.Version("1.0.2"), **kwargs)
|
56 |
+
# self.features = features
|
57 |
+
# self.label_classes = label_classes
|
58 |
+
# self.data_url = data_url
|
59 |
+
# self.citation = citation
|
60 |
+
# self.url = url
|
61 |
+
|
62 |
+
|
63 |
+
|
64 |
+
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
69 |
"""Your custom dataset for Hugging Face based on the CSV metadata and audio URLs."""
|
70 |
|
|
|
75 |
MumospeeDatasetConfig(
|
76 |
name="default",
|
77 |
version=datasets.Version("1.0.0"),
|
78 |
+
description=_DESCRIPTION,
|
79 |
+
language=_LANGUAGES,
|
80 |
+
tag=_TAGS)
|
81 |
]
|
82 |
DEFAULT_CONFIG_NAME = "default"
|
83 |
|
|
|
87 |
"path": datasets.Value("string"),
|
88 |
"url": datasets.Value("string"),
|
89 |
"type": datasets.Value("string"),
|
90 |
+
"duration": datasets.Value("string"),
|
91 |
"language": datasets.Value("string"),
|
92 |
"transcript": datasets.Value("string"),
|
93 |
"tag": datasets.Value("string"),
|
|
|
99 |
features=features,
|
100 |
license=_LICENSE,
|
101 |
)
|
102 |
+
|
103 |
+
|
104 |
|
105 |
def _split_generators(self, dl_manager):
|
106 |
"""Split the dataset into train, validation, and test."""
|
|
|
136 |
# Filter by primary split
|
137 |
data_split = data[data["split"] == split]
|
138 |
|
139 |
+
print(f"filepath is {filepath}, split is {split}, lang is {language}, tag is {tag}")
|
140 |
+
|
141 |
if language:
|
142 |
data_split = data_split[data_split["language"] == language]
|
143 |
if tag:
|