Datasets:
License:
Upload mumospee_small.py with huggingface_hub
Browse files- mumospee_small.py +7 -43
mumospee_small.py
CHANGED
@@ -29,44 +29,6 @@ class MumospeeDatasetConfig(datasets.BuilderConfig):
|
|
29 |
self.tag = tag
|
30 |
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
# class SuperGlueConfig(datasets.BuilderConfig):
|
35 |
-
# """BuilderConfig for SuperGLUE."""
|
36 |
-
|
37 |
-
# def __init__(self, features, data_url, citation, url, label_classes=("False", "True"), **kwargs):
|
38 |
-
# """BuilderConfig for SuperGLUE.
|
39 |
-
|
40 |
-
# Args:
|
41 |
-
# features: *list[string]*, list of the features that will appear in the
|
42 |
-
# feature dict. Should not include "label".
|
43 |
-
# data_url: *string*, url to download the zip file from.
|
44 |
-
# citation: *string*, citation for the data set.
|
45 |
-
# url: *string*, url for information about the data set.
|
46 |
-
# label_classes: *list[string]*, the list of classes for the label if the
|
47 |
-
# label is present as a string. Non-string labels will be cast to either
|
48 |
-
# 'False' or 'True'.
|
49 |
-
# **kwargs: keyword arguments forwarded to super.
|
50 |
-
# """
|
51 |
-
# # Version history:
|
52 |
-
# # 1.0.2: Fixed non-nondeterminism in ReCoRD.
|
53 |
-
# # 1.0.1: Change from the pre-release trial version of SuperGLUE (v1.9) to
|
54 |
-
# # the full release (v2.0).
|
55 |
-
# # 1.0.0: S3 (new shuffling, sharding and slicing mechanism).
|
56 |
-
# # 0.0.2: Initial version.
|
57 |
-
# super().__init__(version=datasets.Version("1.0.2"), **kwargs)
|
58 |
-
# self.features = features
|
59 |
-
# self.label_classes = label_classes
|
60 |
-
# self.data_url = data_url
|
61 |
-
# self.citation = citation
|
62 |
-
# self.url = url
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
71 |
"""Your custom dataset for Hugging Face based on the CSV metadata and audio URLs."""
|
72 |
|
@@ -117,15 +79,15 @@ class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
|
117 |
return [
|
118 |
datasets.SplitGenerator(
|
119 |
name=datasets.Split.TRAIN,
|
120 |
-
gen_kwargs={"filepath": csv_path
|
121 |
),
|
122 |
datasets.SplitGenerator(
|
123 |
name=datasets.Split.VALIDATION,
|
124 |
-
gen_kwargs={"filepath": csv_path
|
125 |
),
|
126 |
datasets.SplitGenerator(
|
127 |
name=datasets.Split.TEST,
|
128 |
-
gen_kwargs={"filepath": csv_path
|
129 |
),
|
130 |
]
|
131 |
|
@@ -139,13 +101,15 @@ class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
|
139 |
data = pd.read_csv(filepath)
|
140 |
# Filter by primary split
|
141 |
split=self.config.split
|
142 |
-
|
143 |
|
144 |
language=self.config.language
|
145 |
-
tag=self.config.
|
146 |
|
147 |
print(f"filepath is {filepath}, split is {split}, lang is {self.config.language}, tag is {self.config.tag}")
|
148 |
|
|
|
|
|
149 |
if language:
|
150 |
data_split = data_split[data_split["language"] == language]
|
151 |
if tag:
|
|
|
29 |
self.tag = tag
|
30 |
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
class MumospeeDataset(datasets.GeneratorBasedBuilder):
|
33 |
"""Your custom dataset for Hugging Face based on the CSV metadata and audio URLs."""
|
34 |
|
|
|
79 |
return [
|
80 |
datasets.SplitGenerator(
|
81 |
name=datasets.Split.TRAIN,
|
82 |
+
gen_kwargs={"filepath": csv_path}
|
83 |
),
|
84 |
datasets.SplitGenerator(
|
85 |
name=datasets.Split.VALIDATION,
|
86 |
+
gen_kwargs={"filepath": csv_path}
|
87 |
),
|
88 |
datasets.SplitGenerator(
|
89 |
name=datasets.Split.TEST,
|
90 |
+
gen_kwargs={"filepath": csv_path}
|
91 |
),
|
92 |
]
|
93 |
|
|
|
101 |
data = pd.read_csv(filepath)
|
102 |
# Filter by primary split
|
103 |
split=self.config.split
|
104 |
+
|
105 |
|
106 |
language=self.config.language
|
107 |
+
tag=self.config.tag
|
108 |
|
109 |
print(f"filepath is {filepath}, split is {split}, lang is {self.config.language}, tag is {self.config.tag}")
|
110 |
|
111 |
+
|
112 |
+
data_split = data[data["split"] == split]
|
113 |
if language:
|
114 |
data_split = data_split[data_split["language"] == language]
|
115 |
if tag:
|