Datasets:

Modalities:
Tabular
Formats:
csv
ArXiv:
Tags:
music
Libraries:
Datasets
pandas
License:
Search is not available for this dataset
id
int64
2
155k
CLAP-log-likelihood
float64
-16.12
-0.01
142,090
-0.012294
98,597
-0.015572
124,735
-0.015678
125,656
-0.015715
98,588
-0.016477
98,599
-0.017891
149,133
-0.018413
131,785
-0.018823
18,087
-0.019531
98,583
-0.019657
18,089
-0.019767
125,107
-0.019818
50,466
-0.019871
139,318
-0.019993
79,616
-0.020024
98,581
-0.020372
98,600
-0.020399
98,589
-0.020706
124,743
-0.020736
74,865
-0.020793
98,573
-0.02082
98,596
-0.020874
141,370
-0.020897
47,170
-0.021313
98,591
-0.021381
131,429
-0.021614
97,037
-0.021646
82,993
-0.022055
83,011
-0.022055
74,851
-0.022211
124,736
-0.022234
149,137
-0.022236
58,209
-0.022347
125,650
-0.022387
98,575
-0.022394
73,424
-0.022397
149,131
-0.02246
15,871
-0.022796
50,388
-0.023197
98,574
-0.023314
125,652
-0.023367
124,738
-0.023509
11,869
-0.023642
50,461
-0.02365
47,167
-0.023825
109,665
-0.023871
125,655
-0.023926
47,173
-0.024104
134,033
-0.024134
135,993
-0.02423
15,867
-0.024306
98,579
-0.024547
18,086
-0.024637
9,998
-0.024728
142,088
-0.024855
111,934
-0.024973
142,092
-0.025335
47,172
-0.025436
38,777
-0.025495
102,182
-0.025597
149,119
-0.02566
11,837
-0.025673
124,744
-0.025687
131,432
-0.025706
153,772
-0.025747
125,649
-0.025793
18,099
-0.025854
47,171
-0.026029
127,493
-0.026196
44,277
-0.026332
151,358
-0.026401
153,909
-0.026422
50,389
-0.026434
150,164
-0.026559
60,352
-0.026561
108,498
-0.026565
137,285
-0.026597
11,831
-0.026667
149,124
-0.026766
97,445
-0.026783
149,121
-0.02681
134,771
-0.026821
151,359
-0.026829
86,511
-0.026867
20,999
-0.026883
95,780
-0.027158
15,869
-0.027199
96,093
-0.027211
52,667
-0.027301
107,104
-0.027397
18,202
-0.02747
98,576
-0.027506
151,690
-0.027538
35,888
-0.027583
91,360
-0.027664
15,864
-0.027668
141,909
-0.027806
142,093
-0.027806
46,594
-0.02781
107,105
-0.027821

What is FMA-rank?

FMA is a music dataset from the Free Music Archive, containing over 8000 hours of Creative Commons-licensed music from 107k tracks across 16k artists and 15k albums. It was created in 2017 by Defferrard et al. in collaboration with Free Music Archive.

FMA contains a lot of good music, and a lot of bad music, so the question is: can we rank the samples in FMA?

FMA-rank is a CLAP-based statistical ranking of each sample in FMA. We calculate the log-likelihood of each sample in FMA belonging to an estimated gaussian in the CLAP latent space, using these values we can rank and filter FMA. In log-likelihood, higher values are better.

Quickstart

Download any FMA split from the official github https://github.com/mdeff/fma. Extract the FMA folder from the downloaded zip and set the path to the folder in fma_root_dir. Run the following code snippet to load and filter the FMA samples according to the given percentages. The code snippet will return a HF audio dataset.

from datasets import load_dataset, Dataset, Audio
import os

# provide location of fma folder
fma_root_dir = "/path/to/fma/folder"

# provide percentage of fma dataset to use
# for whole dataset, use start_percentage=0 and end_percentage=100
# for worst 20% of dataset, use start_percentage=0 and end_percentage=20
# for best 20% of dataset, use the following values:
start_percentage = 80
end_percentage = 100

# load fma_rank.csv from huggingface and sort from lowest to highest
csv_loaded = load_dataset("disco-eth/FMA-rank")
fma_item_list = csv_loaded["train"]
fma_sorted_list = sorted(fma_item_list, key=lambda d: d['CLAP-log-likelihood'])

def parse_fma_audio_folder(fma_root_dir):
    valid_fma_ids = []
    subfolders = os.listdir(fma_root_dir)
    for subfolder in subfolders:
        subfolder_path = os.path.join(fma_root_dir, subfolder)
        if os.path.isdir(subfolder_path):
            music_files = os.listdir(subfolder_path)
            for music_file in music_files:
                if ".mp3" not in music_file:
                    continue
                else:
                    fma_id = music_file.split('.')[0]
                    valid_fma_ids.append(fma_id)
    return valid_fma_ids

# select the existing files according to the provided fma folder
valid_fma_ids = parse_fma_audio_folder(fma_root_dir)
df_dict = {"id":[], "score": [], "audio": []}
for fma_item in fma_sorted_list:
    this_id = f"{fma_item['id']:06d}"
    if this_id in valid_fma_ids:
        df_dict["id"].append(this_id)
        df_dict["score"].append(fma_item["CLAP-log-likelihood"])
        df_dict["audio"].append(os.path.join(fma_root_dir, this_id[:3] , this_id+".mp3"))

# filter the fma dataset according to the percentage defined above
i_start = int(start_percentage * len(df_dict["id"]) / 100)
i_end = int(end_percentage * len(df_dict["id"]) / 100)
df_dict_filtered = {
    "id": df_dict["id"][i_start:i_end],
    "score": df_dict["score"][i_start:i_end],
    "audio": df_dict["audio"][i_start:i_end],
}

# get final dataset
audio_dataset = Dataset.from_dict(df_dict_filtered).cast_column("audio", Audio())

"""
Dataset({
    features: ['id', 'score', 'audio'],
    num_rows: 1599
})
"""
Downloads last month
44
Edit dataset card