-
Notifications
You must be signed in to change notification settings - Fork 642
Add new and complete version of FSD50K multi-label audio classification task #2285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
40f61c3
Added fsd50k dataset on huggingface
RahulSChand 5cfba55
added correct hf version of fsd50k dataset
RahulSChand 1073336
added correct hf version of fsd50k dataset
RahulSChand fadeb6d
removed extra imports
RahulSChand 4ef82bf
removed unecessary load_data fn
RahulSChand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from .eng.FSD50HF import * | ||
| from .eng.FSD2019Kaggle import * |
72 changes: 72 additions & 0 deletions
72
mteb/tasks/Audio/AudioMultilabelClassification/eng/FSD50HF.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import datasets | ||
|
|
||
| from mteb.abstasks.Audio.AbsTaskAudioMultilabelClassification import ( | ||
| AbsTaskAudioMultilabelClassification, | ||
| ) | ||
| from mteb.abstasks.TaskMetadata import TaskMetadata | ||
|
|
||
|
|
||
| class FSD50HFMultilingualClassification(AbsTaskAudioMultilabelClassification): | ||
| metadata = TaskMetadata( | ||
| name="FSD50HF", | ||
| description="Multilabel Audio Classification.", | ||
| reference="https://huggingface.co/datasets/Chand0320/fsd50k_hf", | ||
| dataset={ | ||
| "path": "Chand0320/fsd50k_hf", | ||
| "revision": "ca72d33100074e2933437e844028c941d8e8f065", | ||
| }, # this is actually used to download the data | ||
| type="AudioMultilabelClassification", | ||
| category="a2t", | ||
| eval_splits=["test"], | ||
| eval_langs=["eng-Latn"], | ||
| main_score="accuracy", | ||
| date=( | ||
| "2020-01-01", | ||
| "2020-01-30", | ||
| ), # Estimated date when this dataset was committed, what should be the second tuple? | ||
| domains=["Web"], # obtained from Freesound - online collaborative platform | ||
| task_subtypes=["Environment Sound Classification"], | ||
| license="cc-by-4.0", | ||
| annotations_creators="human-annotated", | ||
| dialect=[], | ||
| modalities=["audio"], | ||
| sample_creation="found", | ||
| bibtex_citation="""@dataset{eduardo_fonseca_2020_3612637, | ||
| author = {Eduardo Fonseca and | ||
| Manoj Plakal and | ||
| Frederic Font and | ||
| Daniel P. W. Ellis and | ||
| Xavier Serra}, | ||
| title = {FSDKaggle2019}, | ||
| month = jan, | ||
| year = 2020, | ||
| publisher = {Zenodo}, | ||
| version = {1.0}, | ||
| doi = {10.5281/zenodo.3612637}, | ||
| url = {https://doi.org/10.5281/zenodo.3612637}, | ||
| } | ||
| """, | ||
| descriptive_stats={ | ||
| "n_samples": {"test": 8961}, | ||
| }, | ||
| ) | ||
|
|
||
| audio_column_name: str = "audio" | ||
| label_column_name: str = "labels" | ||
| samples_per_label: int = 8 | ||
|
|
||
| def load_data(self, **kwargs): | ||
| """Load dataset from HuggingFace hub and convert it to the standard format.""" | ||
| if self.data_loaded: | ||
| return | ||
|
|
||
| self.dataset = {} | ||
| for lang in self.hf_subsets: | ||
| self.dataset[lang] = datasets.load_dataset( | ||
| name=lang, **self.metadata_dict["dataset"] | ||
| ) | ||
|
|
||
| self.dataset_transform() | ||
| self.data_loaded = True | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.