Datasets:
vladsaveliev
commited on
Commit
·
449bc9b
1
Parent(s):
b5233e4
Fix script
Browse files- README.md +14 -0
- guitar_tab.py +5 -6
README.md
CHANGED
|
@@ -8,6 +8,20 @@ tags:
|
|
| 8 |
- tablature
|
| 9 |
size_categories:
|
| 10 |
- 10K<n<100K
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
# Dataset Card for Dataset Name
|
|
|
|
| 8 |
- tablature
|
| 9 |
size_categories:
|
| 10 |
- 10K<n<100K
|
| 11 |
+
dataset_info:
|
| 12 |
+
features:
|
| 13 |
+
- name: text
|
| 14 |
+
dtype: string
|
| 15 |
+
- name: title
|
| 16 |
+
dtype: string
|
| 17 |
+
- name: instrument
|
| 18 |
+
dtype: string
|
| 19 |
+
splits:
|
| 20 |
+
- name: train
|
| 21 |
+
num_bytes: 14089286
|
| 22 |
+
num_examples: 3287
|
| 23 |
+
download_size: 1899258
|
| 24 |
+
dataset_size: 14089286
|
| 25 |
---
|
| 26 |
|
| 27 |
# Dataset Card for Dataset Name
|
guitar_tab.py
CHANGED
|
@@ -21,7 +21,6 @@ class Builder(datasets.GeneratorBasedBuilder):
|
|
| 21 |
{
|
| 22 |
"text": datasets.Value("string"),
|
| 23 |
"title": datasets.Value("string"),
|
| 24 |
-
"artist": datasets.Value("string"),
|
| 25 |
"instrument": datasets.Value("string"),
|
| 26 |
}
|
| 27 |
),
|
|
@@ -47,13 +46,13 @@ class Builder(datasets.GeneratorBasedBuilder):
|
|
| 47 |
for fileidx, filepath in enumerate(filepaths):
|
| 48 |
with Path(filepath).open("r") as f:
|
| 49 |
text = f.read()
|
|
|
|
|
|
|
| 50 |
meta = {
|
| 51 |
-
|
| 52 |
-
for l in text.split(".").split("\n")
|
| 53 |
-
if l.strip()
|
| 54 |
}
|
| 55 |
yield fileidx, {
|
| 56 |
"text": text,
|
| 57 |
-
"title": filepath.stem,
|
| 58 |
-
"instrument": meta.get("instrument"),
|
| 59 |
}
|
|
|
|
| 21 |
{
|
| 22 |
"text": datasets.Value("string"),
|
| 23 |
"title": datasets.Value("string"),
|
|
|
|
| 24 |
"instrument": datasets.Value("string"),
|
| 25 |
}
|
| 26 |
),
|
|
|
|
| 46 |
for fileidx, filepath in enumerate(filepaths):
|
| 47 |
with Path(filepath).open("r") as f:
|
| 48 |
text = f.read()
|
| 49 |
+
header_lines = text.split(".")[0].split("\n")
|
| 50 |
+
header_lines = [l.strip() for l in header_lines if l.strip()]
|
| 51 |
meta = {
|
| 52 |
+
k.lstrip("\\"): v for k, v in (l.split(" ", 1) for l in header_lines)
|
|
|
|
|
|
|
| 53 |
}
|
| 54 |
yield fileidx, {
|
| 55 |
"text": text,
|
| 56 |
+
"title": filepath.stem,
|
| 57 |
+
"instrument": meta.get("instrument"),
|
| 58 |
}
|