sander-wood
commited on
Commit
•
feb3cdd
1
Parent(s):
391ba08
Update README.md
Browse files
README.md
CHANGED
@@ -16,25 +16,29 @@ tags:
|
|
16 |
|
17 |
In [CLaMP: Contrastive Language-Music Pre-training for Cross-Modal Symbolic Music Information Retrieval](https://ai-muzic.github.io/clamp/), we introduce WikiMusicText (WikiMT), a new dataset for the evaluation of semantic search and music classification. It includes 1010 lead sheets in ABC notation sourced from Wikifonia.org, each accompanied by a title, artist, genre, and description. The title and artist information is extracted from the score, whereas the genre labels are obtained by matching keywords from the Wikipedia entries and assigned to one of the 8 classes (Jazz, Country, Folk, R&B, Pop, Rock, Dance, and Latin) that loosely mimic the GTZAN genres. The description is obtained by utilizing BART-large to summarize and clean the corresponding Wikipedia entry. Additionally, the natural language information within the ABC notation is removed.
|
18 |
|
19 |
-
WikiMT is a unique resource to support the evaluation of semantic search and music classification. However, it is important to acknowledge that the dataset was curated from publicly available sources, and there may be limitations concerning the accuracy and completeness of the genre and description information. Further research is needed to explore the potential biases and limitations of the dataset and to develop strategies to address them.
|
20 |
|
21 |
-
|
22 |
|
23 |
-
|
24 |
|
25 |
-
|
26 |
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
|
31 |
-
```python
|
32 |
-
Enter the Wikifonia URL: [Paste your URL here]
|
33 |
-
```
|
34 |
|
35 |
-
|
36 |
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
```python
|
40 |
import subprocess
|
@@ -81,7 +85,7 @@ def filter(lines):
|
|
81 |
def load_music(filename):
|
82 |
# Convert the file to ABC notation
|
83 |
p = subprocess.Popen(
|
84 |
-
f'cmd /u /c python
|
85 |
stdout=subprocess.PIPE,
|
86 |
stderr=subprocess.PIPE,
|
87 |
shell=True
|
@@ -120,9 +124,6 @@ def download_and_extract(url):
|
|
120 |
else:
|
121 |
print("Failed to download the file. HTTP response code:", response.status_code)
|
122 |
|
123 |
-
# Special thanks to Wim Vree for xml2abc.py
|
124 |
-
download_and_extract("https://wim.vree.org/svgParse/xml2abc.py-145.zip")
|
125 |
-
|
126 |
# Download the Wikifonia dataset
|
127 |
wikifonia_url = input("Enter the Wikifonia URL: ")
|
128 |
download_and_extract(wikifonia_url)
|
@@ -145,6 +146,9 @@ with open("wikimusictext.jsonl", "w", encoding="utf-8") as f:
|
|
145 |
f.write(json.dumps(song, ensure_ascii=False)+"\n")
|
146 |
```
|
147 |
|
|
|
|
|
|
|
148 |
## Copyright Disclaimer
|
149 |
WikiMT was curated from publicly available sources, and all rights to the original content and data remain with their respective copyright holders. The dataset is made available for research and educational purposes, and any use, distribution, or modification of the dataset should comply with the terms and conditions set forth by the original data providers.
|
150 |
|
|
|
16 |
|
17 |
In [CLaMP: Contrastive Language-Music Pre-training for Cross-Modal Symbolic Music Information Retrieval](https://ai-muzic.github.io/clamp/), we introduce WikiMusicText (WikiMT), a new dataset for the evaluation of semantic search and music classification. It includes 1010 lead sheets in ABC notation sourced from Wikifonia.org, each accompanied by a title, artist, genre, and description. The title and artist information is extracted from the score, whereas the genre labels are obtained by matching keywords from the Wikipedia entries and assigned to one of the 8 classes (Jazz, Country, Folk, R&B, Pop, Rock, Dance, and Latin) that loosely mimic the GTZAN genres. The description is obtained by utilizing BART-large to summarize and clean the corresponding Wikipedia entry. Additionally, the natural language information within the ABC notation is removed.
|
18 |
|
19 |
+
WikiMT is a unique resource to support the evaluation of semantic search and music classification. However, it is important to acknowledge that the dataset was curated from publicly available sources, and there may be limitations concerning the accuracy and completeness of the genre and description information. Further research is needed to explore the potential biases and limitations of the dataset and to develop strategies to address them.
|
20 |
|
21 |
+
Certainly, let's maintain a more concise and to-the-point style in GitHub readme fashion:
|
22 |
|
23 |
+
Apologies for the oversight. Here's the revised section that includes the "provided code":
|
24 |
|
25 |
+
## How to Obtain ABC Notation Music Scores
|
26 |
|
27 |
+
To access ABC notation music scores from the WikiMT dataset, follow these steps:
|
28 |
|
29 |
+
1. **Download WikiMT Metadata:** Get the metadata file for WikiMT [here](https://huggingface.co/datasets/sander-wood/wikimusictext/resolve/main/wikimusictext.jsonl). This file has important dataset information.
|
|
|
|
|
|
|
|
|
30 |
|
31 |
+
2. **Get the `xml2abc.py` Script:** Download the `xml2abc.py` script from [this link](https://wim.vree.org/svgParse/xml2abc.html) and save it in your local directory.
|
32 |
|
33 |
+
3. **Find Wikifonia MusicXML Data Link:** Locate a download link for the Wikifonia dataset in MusicXML format (with .mxl extension). You can search the internet or Wikifonia-related websites for it.
|
34 |
+
|
35 |
+
4. **Run the Provided Code:** After acquiring the WikiMT metadata, the `xml2abc.py` script, and the Wikifonia MusicXML data link, execute the provided Python code below. It'll prompt you for the Wikifonia data URL, like this:
|
36 |
+
|
37 |
+
```python
|
38 |
+
Enter the Wikifonia URL: [Paste your URL here]
|
39 |
+
```
|
40 |
+
|
41 |
+
Paste your URL pointing to the Wikifonia.zip file and press Enter. The code will take care of downloading, processing, and extracting the music content, making it ready for your research or applications.
|
42 |
|
43 |
```python
|
44 |
import subprocess
|
|
|
85 |
def load_music(filename):
|
86 |
# Convert the file to ABC notation
|
87 |
p = subprocess.Popen(
|
88 |
+
f'cmd /u /c python xml2abc.py -m 2 -c 6 -x "{filename}"',
|
89 |
stdout=subprocess.PIPE,
|
90 |
stderr=subprocess.PIPE,
|
91 |
shell=True
|
|
|
124 |
else:
|
125 |
print("Failed to download the file. HTTP response code:", response.status_code)
|
126 |
|
|
|
|
|
|
|
127 |
# Download the Wikifonia dataset
|
128 |
wikifonia_url = input("Enter the Wikifonia URL: ")
|
129 |
download_and_extract(wikifonia_url)
|
|
|
146 |
f.write(json.dumps(song, ensure_ascii=False)+"\n")
|
147 |
```
|
148 |
|
149 |
+
By following these steps and running the provided code, you can efficiently access ABC notation music scores from the WikiMT dataset. Just ensure you have the metadata, the `xml2abc.py` script, and the correct download link before starting. Enjoy your musical journey!
|
150 |
+
|
151 |
+
|
152 |
## Copyright Disclaimer
|
153 |
WikiMT was curated from publicly available sources, and all rights to the original content and data remain with their respective copyright holders. The dataset is made available for research and educational purposes, and any use, distribution, or modification of the dataset should comply with the terms and conditions set forth by the original data providers.
|
154 |
|