George commited on
Commit
e4f734f
1 Parent(s): b7ea7da

upl data and basic codes

Browse files
Files changed (5) hide show
  1. .gitignore +2 -0
  2. CMITE.py +116 -0
  3. README.md +2 -3
  4. data/instruments.zip +3 -0
  5. data/scoring.csv +38 -0
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ rename.sh
2
+ test.py
CMITE.py ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import datasets
3
+ import pandas as pd
4
+ from datasets.tasks import AudioClassification
5
+
6
+
7
+ # Once upload a new piano brand, please register its name here
8
+ _NAMES = ['instrument' + str(i) for i in range(1, 38)]
9
+
10
+ _DBNAME = os.path.basename(__file__).split('.')[0]
11
+
12
+ _HOMEPAGE = "https://huggingface.co/datasets/ccmusic-database/" + _DBNAME
13
+
14
+ _CITATION = """\
15
+ @dataset{zhaorui_liu_2021_5676893,
16
+ author = {Zhaorui Liu, Monan Zhou, Shenyang Xu and Zijin Li},
17
+ title = {{Music Data Sharing Platform for Computational Musicology Research (CCMUSIC DATASET)}},
18
+ month = nov,
19
+ year = 2021,
20
+ publisher = {Zenodo},
21
+ version = {1.1},
22
+ doi = {10.5281/zenodo.5676893},
23
+ url = {https://doi.org/10.5281/zenodo.5676893}
24
+ }
25
+ """
26
+
27
+ _DESCRIPTION = """\
28
+ This database contains subjective timbre evaluation scores of 16 subjective timbre evaluation terms
29
+ (such as bright, dark, raspy) on 37 Chinese national terms given by 14 participants in a subjective evaluation experiment.
30
+ Furthermore, 10 reports on spectrum analysis of 10 instruments are also included.
31
+ """
32
+
33
+ _URL = _HOMEPAGE + "/resolve/main/data/instruments.zip"
34
+
35
+ _CSV = _HOMEPAGE + "/resolve/main/data/scoring.csv"
36
+
37
+
38
+ class CMITE(datasets.GeneratorBasedBuilder):
39
+ def _info(self):
40
+ return datasets.DatasetInfo(
41
+ features=datasets.Features(
42
+ {
43
+ "audio": datasets.Audio(sampling_rate=44_100),
44
+ "instrument_id": datasets.features.ClassLabel(names=_NAMES),
45
+ "Chinese_name": datasets.Value("string"),
46
+ "slim": datasets.Value("float64"),
47
+ "bright": datasets.Value("float64"),
48
+ "dim": datasets.Value("float64"),
49
+ "sharp": datasets.Value("float64"),
50
+ "thick": datasets.Value("float64"),
51
+ "thin": datasets.Value("float64"),
52
+ "solid": datasets.Value("float64"),
53
+ "clear": datasets.Value("float64"),
54
+ "dry": datasets.Value("float64"),
55
+ "plump": datasets.Value("float64"),
56
+ "rough": datasets.Value("float64"),
57
+ "pure": datasets.Value("float64"),
58
+ "hoarse": datasets.Value("float64"),
59
+ "harmonious": datasets.Value("float64"),
60
+ "soft": datasets.Value("float64"),
61
+ "turbid": datasets.Value("float64"),
62
+ }
63
+ ),
64
+ supervised_keys=("audio", "instrument_id"),
65
+ homepage=_HOMEPAGE,
66
+ license="mit",
67
+ citation=_CITATION,
68
+ description=_DESCRIPTION,
69
+ task_templates=[
70
+ AudioClassification(
71
+ task="audio-classification",
72
+ audio_column="audio",
73
+ label_column="instrument_id",
74
+ )
75
+ ],
76
+ )
77
+
78
+ def _split_generators(self, dl_manager):
79
+ data_files = dl_manager.download_and_extract(_URL)
80
+ return [
81
+ datasets.SplitGenerator(
82
+ name=datasets.Split.TRAIN,
83
+ gen_kwargs={
84
+ "files": dl_manager.iter_files([data_files]),
85
+ "labels": dl_manager.download(_CSV),
86
+ },
87
+ ),
88
+ ]
89
+
90
+ def _generate_examples(self, files, labels):
91
+ ins_eval = pd.read_csv(labels, index_col='instrument_id')
92
+ for _, path in enumerate(files):
93
+ file_name = os.path.basename(path)
94
+ if file_name.endswith(".wav"):
95
+ i = int(file_name.split('.wav')[0])
96
+ yield i, {
97
+ "audio": path,
98
+ "instrument_id": "instrument" + str(i),
99
+ "Chinese_name": ins_eval.iloc[i]['Chinese_name'],
100
+ "slim": ins_eval.iloc[i]['slim'],
101
+ "bright": ins_eval.iloc[i]['bright'],
102
+ "dim": ins_eval.iloc[i]['dim'],
103
+ "sharp": ins_eval.iloc[i]['sharp'],
104
+ "thick": ins_eval.iloc[i]['thick'],
105
+ "thin": ins_eval.iloc[i]['thin'],
106
+ "solid": ins_eval.iloc[i]['solid'],
107
+ "clear": ins_eval.iloc[i]['clear'],
108
+ "dry": ins_eval.iloc[i]['dry'],
109
+ "plump": ins_eval.iloc[i]['plump'],
110
+ "rough": ins_eval.iloc[i]['rough'],
111
+ "pure": ins_eval.iloc[i]['pure'],
112
+ "hoarse": ins_eval.iloc[i]['hoarse'],
113
+ "harmonious": ins_eval.iloc[i]['harmonious'],
114
+ "soft": ins_eval.iloc[i]['soft'],
115
+ "turbid": ins_eval.iloc[i]['turbid'],
116
+ }
README.md CHANGED
@@ -12,7 +12,7 @@ pretty_name: Chinese Musical Instruments Timbre Evaluation Database
12
  size_categories:
13
  - n<1K
14
  ---
15
- # Dataset Card for Dataset Name
16
 
17
  ## Dataset Description
18
 
@@ -23,8 +23,7 @@ size_categories:
23
  - **Point of Contact:**
24
 
25
  ### Dataset Summary
26
-
27
- This dataset card aims to be a base template for new datasets. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/datasetcard_template.md?plain=1).
28
 
29
  ### Supported Tasks and Leaderboards
30
 
 
12
  size_categories:
13
  - n<1K
14
  ---
15
+ # Dataset Card for Chinese Musical Instruments Timbre Evaluation Database
16
 
17
  ## Dataset Description
18
 
 
23
  - **Point of Contact:**
24
 
25
  ### Dataset Summary
26
+ This database contains subjective timbre evaluation scores of 16 subjective timbre evaluation terms (such as bright, dark, raspy) on 37 Chinese national terms given by 14 participants in a subjective evaluation experiment. Furthermore, 10 reports on spectrum analysis of 10 instruments are also included.
 
27
 
28
  ### Supported Tasks and Leaderboards
29
 
data/instruments.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5c26b74de97bdfefb2643fdb150daa13e3eef07bcae4b4c79d3b70d5da4fa8ed
3
+ size 35185210
data/scoring.csv ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ instrument_id,Chinese_name,slim,bright,dim,sharp,thick,thin,solid,clear,dry,plump,rough,pure,hoarse,harmonious,soft,turbid
2
+ 1,�ߺ�,6.470588235,6.676470588,3.411764706,7.176470588,2.764705882,6.588235294,3.176470588,6.088235294,6.823529412,3.205882353,5.617647059,4.676470588,5.617647059,4.647058824,3.441176471,4.323529412
3
+ 2,����,5.970588235,6.176470588,3.823529412,5.970588235,3.441176471,5.588235294,4.117647059,5.441176471,5.264705882,4.264705882,4.382352941,4.882352941,4.911764706,6.176470588,5.205882353,4.323529412
4
+ 3,�к�,4.411764706,4.941176471,4.852941176,4.882352941,5.058823529,4.588235294,5.088235294,4.882352941,5.294117647,5.205882353,5.117647059,5.029411765,4.941176471,5.852941176,4.882352941,4.441176471
5
+ 4,���,2.647058824,2.970588235,6.764705882,2.617647059,7.588235294,2.588235294,7.558823529,2.705882353,3.235294118,7.352941176,4.735294118,5.647058824,4.117647059,7.088235294,7.176470588,6.147058824
6
+ 5,�������,1.676470588,1.470588235,8.088235294,1.794117647,8.764705882,1.558823529,8.647058824,1.117647059,4.205882353,7.294117647,6.941176471,3,6.794117647,3.617647059,3.323529412,8
7
+ 6,����,7.588235294,7.676470588,2.205882353,8.058823529,1.970588235,7.205882353,2.705882353,7.882352941,5.823529412,3.852941176,3.323529412,6.235294118,3.823529412,5,3.676470588,2.441176471
8
+ 7,���,7.441176471,7.529411765,2.264705882,8.323529412,2.088235294,7.205882353,2.411764706,7.558823529,6.529411765,2.941176471,5.735294118,4.705882353,6.264705882,3.941176471,2.823529412,3.294117647
9
+ 8,���,8.323529412,8.588235294,1.5,8.411764706,1.411764706,7.970588235,1.529411765,8.735294118,5.147058824,3.117647059,3.029411765,6.705882353,3.382352941,5.647058824,2.970588235,1.911764706
10
+ 9,����,6.264705882,6.878787879,2.970588235,6.294117647,3.176470588,6.029411765,3.382352941,6.911764706,4.294117647,4.147058824,2.764705882,6.617647059,3.441176471,7.058823529,5.294117647,2.558823529
11
+ 10,�µ�,4.764705882,4.647058824,5.272727273,4.176470588,4.852941176,4.735294118,4.558823529,4.705882353,4,4.911764706,4.558823529,5.264705882,5.029411765,5.882352941,6.205882353,5.235294118
12
+ 11,���,5.058823529,5.735294118,4.205882353,4.588235294,4.411764706,4.941176471,4.441176471,5.411764706,3.382352941,5.235294118,3.823529412,6.029411765,3.852941176,6.588235294,6.176470588,4.676470588
13
+ 12,������,5.617647059,6.117647059,3.96969697,5.882352941,4.235294118,5.941176471,3.970588235,5.147058824,4.970588235,4.5,4.470588235,5.529411765,4.441176471,5.176470588,4.764705882,4.352941176
14
+ 13,������,3.794117647,3.617647059,6.176470588,3.852941176,6.323529412,4.117647059,6.029411765,3.205882353,4.058823529,5.5,4.441176471,5.03030303,3.941176471,5.382352941,5.735294118,5.647058824
15
+ 14,������,2.882352941,3.029411765,6.588235294,2.970588235,6.764705882,3.529411765,6.676470588,2.705882353,3.764705882,6.176470588,5,4.088235294,4.558823529,5.470588235,4.705882353,6.441176471
16
+ 15,��������,7.176470588,7.588235294,2.794117647,7.735294118,2.441176471,7.264705882,2.941176471,7.352941176,6.441176471,4.333333333,4.705882353,5.242424242,5.323529412,3.941176471,2.794117647,3.235294118
17
+ 16,��������,4.352941176,5.911764706,4.352941176,6.117647059,3.970588235,6.205882353,4.588235294,5.029411765,7.029411765,4.558823529,5.588235294,4.705882353,5.882352941,3.617647059,2.764705882,4.117647059
18
+ 17,����������,3.794117647,4.852941176,5.558823529,5.352941176,4.735294118,5.852941176,4.941176471,3.705882353,7.529411765,4.411764706,6.294117647,4.088235294,6.5,2.676470588,2.470588235,5.058823529
19
+ 18,�ߺ�,4.845371972,5.543691675,6.411764706,4.411764706,6.147058824,4.294117647,6.529411765,2.676470588,6.941176471,5.205882353,6.676470588,3.794117647,6.352941176,3.029411765,2.205882353,6.205882353
20
+ 19,������,5.941176471,6,4.470588235,7.235294118,3.5,6.352941176,3.470588235,5.323529412,7.676470588,3.529411765,6.911764706,2.794117647,7.382352941,2.147058824,2.147058824,5.323529412
21
+ 20,������,4.794117647,5.382352941,4.852941176,5.029411765,5.088235294,4.764705882,5,4.5,4.5,5.382352941,5.176470588,4.852941176,4.970588235,5.058823529,5.264705882,4.823529412
22
+ 21,������,3.088235294,3.176470588,6.176470588,3.764705882,7.029411765,3.529411765,7.235294118,2.735294118,4.176470588,6.617647059,5.882352941,4.411764706,6,5.117647059,4.441176471,6.794117647
23
+ 22,��������,2.176470588,2.235294118,7.147058824,3.235294118,7.911764706,2.941176471,7.941176471,2.058823529,4.352941176,6.705882353,6.911764706,3.029411765,6.382352941,4.205882353,3.470588235,7.617647059
24
+ 23,���� ,5.181818182,5.558823529,3.882352941,4.264705882,4.470588235,4.411764706,4.735294118,6.088235294,2.735294118,5.794117647,3.058823529,6.794117647,3.470588235,6.970588235,5.735294118,3.588235294
25
+ 24,��,4.647058824,3.323529412,6.529411765,3.205882353,5.147058824,4.911764706,4.323529412,3.382352941,4.676470588,4.5,5.794117647,4.176470588,6.823529412,4.470588235,6.264705882,6.5
26
+ 25,��,4.882352941,4.382352941,5.676470588,3.5,5.205882353,4.529411765,4.705882353,4.058823529,3.794117647,5.352941176,3.941176471,5.911764706,4.411764706,6.794117647,7.147058824,5.235294118
27
+ 26,����,6.882352941,7.323529412,3,6.352941176,3.382352941,6.029411765,3.088235294,7.5,4,5.235294118,3.441176471,5.941176471,3.058823529,6.363636364,4.882352941,3.058823529
28
+ 27,��,6.882352941,7.382352941,2.911764706,6.264705882,3.117647059,6.176470588,2.970588235,7.647058824,3.647058824,5.088235294,3.264705882,6.147058824,3.294117647,6.588235294,5,2.794117647
29
+ 28,����,7,6.941176471,3.323529412,5.794117647,3.264705882,6.352941176,2.705882353,7.205882353,4.323529412,4.235294118,4.117647059,5.235294118,4.176470588,5.705882353,4.411764706,3.352941176
30
+ 29,����,5.794117647,6.5,3.176470588,5.058823529,4.235294118,4.647058824,4.147058824,6.529411765,2.852941176,5.676470588,3.617647059,5.323529412,3.176470588,6.647058824,5.205882353,5.147058824
31
+ 30,����,4.470588235,5.264705882,4.941176471,3.794117647,6.147058824,3.588235294,6.088235294,5.294117647,2.882352941,6.647058824,4.147058824,5.676470588,3.176470588,6.529411765,5.617647059,5.352941176
32
+ 31,����,3.088235294,4.088235294,5.823529412,2.588235294,7.382352941,2.676470588,7.5,3.705882353,2.029411765,7.705882353,3.411764706,6.764705882,2.411764706,7.529411765,6.911764706,5.529411765
33
+ 32,����,5.764705882,6.441176471,3.529411765,5.176470588,4.176470588,5.382352941,4.205882353,6.558823529,3.617647059,5.852941176,3.529411765,5.941176471,3.176470588,6.294117647,5.212121212,3.764705882
34
+ 33,����,3.764705882,4,5.735294118,3.882352941,6.205882353,4.147058824,6.088235294,4.088235294,4.235294118,6.352941176,5.382352941,4.5,4.852941176,4.735294118,5.121212121,5.764705882
35
+ 34,����,5.088235294,5.441176471,4.294117647,3.470588235,5.941176471,3.382352941,5.941176471,5.235294118,2.617647059,7.088235294,3.205882353,6.941176471,2.205882353,7.647058824,7.294117647,4.5
36
+ 35,����,5.352941176,4.823529412,4.676470588,4.676470588,3.705882353,6.264705882,3.647058824,5.411764706,6.117647059,3.676470588,6.470588235,3.352941176,5.676470588,4.382352941,3.5,5
37
+ 36,����,6.441176471,6.735294118,3.441176471,6.382352941,2.764705882,7.205882353,2.588235294,7.382352941,5.176470588,2.794117647,4.764705882,5.882352941,4.235294118,4.029411765,4.029411765,4.264705882
38
+ 37,����,5.205882353,4.882352941,5,4.794117647,4.705882353,5.5,4.205882353,5.852941176,4.676470588,3.882352941,5,5.794117647,4.588235294,4.647058824,5.088235294,5.941176471