vladsaveliev commited on
Commit
63e7ca3
1 Parent(s): 21a1331

Add instrument_number and instrument_name

Browse files
Files changed (2) hide show
  1. README.md +34 -3
  2. guitar_tab.py +8 -5
README.md CHANGED
@@ -9,6 +9,7 @@ tags:
9
  size_categories:
10
  - 10K<n<100K
11
  dataset_info:
 
12
  features:
13
  - name: file
14
  dtype: string
@@ -20,8 +21,38 @@ dataset_info:
20
  dtype: string
21
  - name: track_number
22
  dtype: int32
23
- - name: instrument
24
  dtype: string
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  - name: tempo
26
  dtype: int32
27
  - name: tuning
@@ -30,10 +61,10 @@ dataset_info:
30
  dtype: int32
31
  splits:
32
  - name: train
33
- num_bytes: 950852122
34
  num_examples: 188297
35
  download_size: 75369951
36
- dataset_size: 950852122
37
  ---
38
 
39
  # Dataset Card for Dataset Name
 
9
  size_categories:
10
  - 10K<n<100K
11
  dataset_info:
12
+ - config_name: default
13
  features:
14
  - name: file
15
  dtype: string
 
21
  dtype: string
22
  - name: track_number
23
  dtype: int32
24
+ - name: instrument_name
25
  dtype: string
26
+ - name: instrument_number
27
+ dtype: int32
28
+ - name: tempo
29
+ dtype: int32
30
+ - name: tuning
31
+ dtype: string
32
+ - name: frets
33
+ dtype: int32
34
+ splits:
35
+ - name: train
36
+ num_bytes: 951605310
37
+ num_examples: 188297
38
+ download_size: 75369951
39
+ dataset_size: 951605310
40
+ - config_name: all
41
+ features:
42
+ - name: file
43
+ dtype: string
44
+ - name: text
45
+ dtype: string
46
+ - name: title
47
+ dtype: string
48
+ - name: track_name
49
+ dtype: string
50
+ - name: track_number
51
+ dtype: int32
52
+ - name: instrument_name
53
+ dtype: string
54
+ - name: instrument_number
55
+ dtype: int32
56
  - name: tempo
57
  dtype: int32
58
  - name: tuning
 
61
  dtype: int32
62
  splits:
63
  - name: train
64
+ num_bytes: 951605310
65
  num_examples: 188297
66
  download_size: 75369951
67
+ dataset_size: 951605310
68
  ---
69
 
70
  # Dataset Card for Dataset Name
guitar_tab.py CHANGED
@@ -144,7 +144,7 @@ INSTRUMENT_MAP = {
144
 
145
 
146
  class Builder(datasets.GeneratorBasedBuilder):
147
- VERSION = datasets.Version("1.2.3")
148
 
149
  def _info(self):
150
  return datasets.DatasetInfo(
@@ -156,7 +156,8 @@ class Builder(datasets.GeneratorBasedBuilder):
156
  "title": datasets.Value("string"),
157
  "track_name": datasets.Value("string"),
158
  "track_number": datasets.Value("int32"),
159
- "instrument": datasets.Value("string"),
 
160
  "tempo": datasets.Value("int32"),
161
  "tuning": datasets.Value("string"),
162
  "frets": datasets.Value("int32"),
@@ -183,7 +184,7 @@ class Builder(datasets.GeneratorBasedBuilder):
183
  datasets.SplitGenerator(
184
  name=datasets.Split.TRAIN,
185
  gen_kwargs={
186
- "filepaths": [p for p in paths],
187
  },
188
  ),
189
  ]
@@ -207,7 +208,8 @@ def _parse_examples(tex):
207
  "title": None,
208
  "track_name": None,
209
  "track_number": None,
210
- "instrument": None,
 
211
  "tempo": None,
212
  "tuning": None,
213
  "frets": None,
@@ -216,7 +218,8 @@ def _parse_examples(tex):
216
 
217
  def _parse_track_header(k, v):
218
  if k == "instrument":
219
- tracks[-1][k] = INSTRUMENT_MAP.get(int(v), "unknown")
 
220
  elif k == "tuning":
221
  tracks[-1][k] = v.split(" ")
222
  elif k == "frets":
 
144
 
145
 
146
  class Builder(datasets.GeneratorBasedBuilder):
147
+ VERSION = datasets.Version("1.3.1")
148
 
149
  def _info(self):
150
  return datasets.DatasetInfo(
 
156
  "title": datasets.Value("string"),
157
  "track_name": datasets.Value("string"),
158
  "track_number": datasets.Value("int32"),
159
+ "instrument_name": datasets.Value("string"),
160
+ "instrument_number": datasets.Value("int32"),
161
  "tempo": datasets.Value("int32"),
162
  "tuning": datasets.Value("string"),
163
  "frets": datasets.Value("int32"),
 
184
  datasets.SplitGenerator(
185
  name=datasets.Split.TRAIN,
186
  gen_kwargs={
187
+ "filepaths": paths,
188
  },
189
  ),
190
  ]
 
208
  "title": None,
209
  "track_name": None,
210
  "track_number": None,
211
+ "instrument_name": None,
212
+ "instrument_number": None,
213
  "tempo": None,
214
  "tuning": None,
215
  "frets": None,
 
218
 
219
  def _parse_track_header(k, v):
220
  if k == "instrument":
221
+ tracks[-1]["instrument_name"] = INSTRUMENT_MAP.get(int(v), "unknown")
222
+ tracks[-1]["instrument_number"] = int(v)
223
  elif k == "tuning":
224
  tracks[-1][k] = v.split(" ")
225
  elif k == "frets":