admin commited on
Commit
7dc547f
1 Parent(s): a78bf79
Files changed (2) hide show
  1. README.md +1 -1
  2. music_genre.py +3 -11
README.md CHANGED
@@ -147,7 +147,7 @@ Multilingual
147
 
148
  ## Maintenance
149
  ```bash
150
- GIT_LFS_SKIP_SMUDGE=1 git clone git@hf.co:datasets/ccmusic-database/music_genre
151
  cd music_genre
152
  ```
153
 
 
147
 
148
  ## Maintenance
149
  ```bash
150
+ git clone git@hf.co:datasets/ccmusic-database/music_genre
151
  cd music_genre
152
  ```
153
 
music_genre.py CHANGED
@@ -39,11 +39,9 @@ _NAMES_3 = {
39
  22: "Acoustic_pop",
40
  }
41
 
42
- _DBNAME = os.path.basename(__file__).split(".")[0]
43
 
44
- _HOMEPAGE = f"https://www.modelscope.cn/datasets/ccmusic-database/{_DBNAME}"
45
-
46
- _DOMAIN = f"https://www.modelscope.cn/api/v1/datasets/ccmusic-database/{_DBNAME}/repo?Revision=master&FilePath=data"
47
 
48
  _CITATION = """\
49
  @dataset{zhaorui_liu_2021_5676893,
@@ -59,7 +57,6 @@ _CITATION = """\
59
 
60
  _DESCRIPTION = """\
61
  The raw dataset comprises approximately 1,700 musical pieces in .mp3 format, sourced from the NetEase music. The lengths of these pieces range from 270 to 300 seconds. All are sampled at the rate of 48,000 Hz. As the website providing the audio music includes style labels for the downloaded music, there are no specific annotators involved. Validation is achieved concurrently with the downloading process. They are categorized into a total of 16 genres.
62
-
63
  For the pre-processed version, audio is cut into an 11.4-second segment, resulting in 36,375 files, which are then transformed into Mel, CQT and Chroma. In the end, the data entry has six columns: the first three columns represent the Mel, CQT, and Chroma spectrogram slices in .jpg format, respectively, while the last three columns contain the labels for the three levels. The first level comprises two categories, the second level consists of nine categories, and the third level encompasses 16 categories. The entire dataset is shuffled and split into training, validation, and test sets in a ratio of 8:1:1. This dataset can be used for genre classification.
64
  """
65
 
@@ -71,11 +68,6 @@ _URLS = {
71
 
72
 
73
  class music_genre(datasets.GeneratorBasedBuilder):
74
- # BUILDER_CONFIGS = [
75
- # datasets.BuilderConfig(name="default"),
76
- # datasets.BuilderConfig(name="eval"),
77
- # ]
78
-
79
  def _info(self):
80
  return datasets.DatasetInfo(
81
  features=(
@@ -165,7 +157,6 @@ class music_genre(datasets.GeneratorBasedBuilder):
165
  data_count = len(dataset)
166
  p80 = int(data_count * 0.8)
167
  p90 = int(data_count * 0.9)
168
-
169
  return [
170
  datasets.SplitGenerator(
171
  name=datasets.Split.TRAIN,
@@ -196,6 +187,7 @@ class music_genre(datasets.GeneratorBasedBuilder):
196
 
197
  if depth <= len(labs):
198
  return int(labs[depth - 1].split("_")[0])
 
199
  else:
200
  return int(labs[-1].split("_")[0])
201
 
 
39
  22: "Acoustic_pop",
40
  }
41
 
42
+ _HOMEPAGE = f"https://www.modelscope.cn/datasets/ccmusic-database/{os.path.basename(__file__)[:-3]}"
43
 
44
+ _DOMAIN = f"{_HOMEPAGE}/resolve/master/data"
 
 
45
 
46
  _CITATION = """\
47
  @dataset{zhaorui_liu_2021_5676893,
 
57
 
58
  _DESCRIPTION = """\
59
  The raw dataset comprises approximately 1,700 musical pieces in .mp3 format, sourced from the NetEase music. The lengths of these pieces range from 270 to 300 seconds. All are sampled at the rate of 48,000 Hz. As the website providing the audio music includes style labels for the downloaded music, there are no specific annotators involved. Validation is achieved concurrently with the downloading process. They are categorized into a total of 16 genres.
 
60
  For the pre-processed version, audio is cut into an 11.4-second segment, resulting in 36,375 files, which are then transformed into Mel, CQT and Chroma. In the end, the data entry has six columns: the first three columns represent the Mel, CQT, and Chroma spectrogram slices in .jpg format, respectively, while the last three columns contain the labels for the three levels. The first level comprises two categories, the second level consists of nine categories, and the third level encompasses 16 categories. The entire dataset is shuffled and split into training, validation, and test sets in a ratio of 8:1:1. This dataset can be used for genre classification.
61
  """
62
 
 
68
 
69
 
70
  class music_genre(datasets.GeneratorBasedBuilder):
 
 
 
 
 
71
  def _info(self):
72
  return datasets.DatasetInfo(
73
  features=(
 
157
  data_count = len(dataset)
158
  p80 = int(data_count * 0.8)
159
  p90 = int(data_count * 0.9)
 
160
  return [
161
  datasets.SplitGenerator(
162
  name=datasets.Split.TRAIN,
 
187
 
188
  if depth <= len(labs):
189
  return int(labs[depth - 1].split("_")[0])
190
+
191
  else:
192
  return int(labs[-1].split("_")[0])
193