Updated readme
Browse files72 unmodified lines737475767778794 unmodified lines8485868788899091921 unmodified line9495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321332 unmodified lines13613713813914014114214314 unmodified lines15815916016116216312 unmodified lines17617717817918018172 unmodified lines### Explore DatasetThe enrichments allow you to quickly gain insights into the dataset. The open source data curation tool Renumics Spotlight enables that with just a few lines of code:4 unmodified linesdataset = datasets.load_dataset("renumics/dcase23-task2-enriched", "dev", split="all", streaming=False)```Install Spotlight via [pip](https://packaging.python.org/en/latest/key_projects/#pip):```jupyterpython!pip install renumics-spotlight```Start exploring with a simple view that leverages embeddings to identify relevant data segments:1 unmodified linefrom renumics import spotlightdf = dataset.to_pandas()spotlight.show(df, dtype={'path': spotlight.Audio, "embeddings_ast-finetuned-audioset-10-10-0.4593": spotlight.Embedding})```You can use the UI to interactively configure the view on the data. Depending on the concrete taks (e.g. model comparison, debugging, outlier detection) you might want to leverage different enrichments and metadata.This example shows a view that is suitable to compare the results of two different ML models:```jupyterpythonfrom renumics import spotlightdf = dataset.to_pandas()# spotlight.show(df, dtype={'path': spotlight.Audio, "embeddings_ast-finetuned-audioset-10-10-0.4593": spotlight.Embedding}, layout=ds_builder.config.get_layout(config="standard"))# todo```## Using custom model results and enrichmentsWhen developing your custom model you want to use different kinds of information from you model (e.g. embedding, anomaly scores etc.) to gain further insights into the dataset and the model behvior.Suppose you have your model's embeddings for each datapoint as a 2D-Numpy array and your anomaly score as a 1D-Numpy array. Then you can add this information to the dataset:```jupyterpythonfrom renumics import spotlight#todo```Depending on your concrete task you might want to use different enrichments. For a good overview on great open source tooling for uncertainty quantification, explainability and outlier detection, you can take a look at our [curated list for open source data-centric AI tooling](https://github.com/Renumics/awesome-open-data-centric-ai) on Github.You can also save your view configuration in Spotlight in a JSON configuration file by clicking on the respective icon:[//]: # (todo: create new image -> Spotlight widgets use column "audio" as key in this picture.)We have also set up a Github repo with interactive notebooks that highlight different enrichment possibilities and curation templates. We encourage you to submit a pull request to share your enrichment code and interaction layouts.## Dataset Structure2 unmodified linesFor each instance, there is a Audio for the audio, a string for the path, an integer for the section, a string for the d1p (parameter), a string for the d1v (value),a ClassLabel for the label and a ClassLabel for the class.[//]: # (todo: add new data fields)```{'audio': {'array': array([ 0. , 0.00024414, -0.00024414, ..., -0.00024414,0. , 0. ], dtype=float32),14 unmodified lines'ast-finetuned-audioset-10-10-0.4593-embeddings': [0.8152204155921936,1.5862374305725098, ...,1.7154160737991333]}```12 unmodified lines- `class`: an integer as class label.- `label`: an integer whose value may be either _0_, indicating that the audio sample is _normal_, _1_, indicating that the audio sample contains an _anomaly_.- `ast-finetuned-audioset-10-10-0.4593-embeddings`: an `datasets.Sequence(Value("float32"))` representing audio embeddings that are generated with an [Audio Spectrogram Transformer](https://huggingface.co/docs/transformers/model_doc/audio-spectrogram-transformer#transformers.ASTFeatureExtractor).### Data Splits72 unmodified lines737475767778794 unmodified lines8485868788899091921 unmodified line9495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291302 unmodified lines13313413513613713814 unmodified lines15315415515615715815916016116212 unmodified lines17517617717817918018118218318418572 unmodified lines### Explore DatasetThe enrichments allow you to quickly gain insights into the dataset. The open source data curation tool Renumics Spotlight enables that with just a few lines of code:4 unmodified linesdataset = datasets.load_dataset("renumics/dcase23-task2-enriched", "dev", split="all", streaming=False)```Install soundfile and Spotlight via [pip](https://packaging.python.org/en/latest/key_projects/#pip):```jupyterpython!pip install renumics-spotlight soundfile```Start exploring with a simple view that leverages embeddings to identify relevant data segments:1 unmodified linefrom renumics import spotlightdf = dataset.to_pandas()simple_layout = load_dataset_builder("renumics/dcase23-task2-enriched", "dev").get_layout(config="simple")spotlight.show(df, dtype={'path': spotlight.Audio, "embeddings_ast-finetuned-audioset-10-10-0.4593": spotlight.Embedding}, layout=simple_layout)```You can use the UI to interactively configure the view on the data. Depending on the concrete taks (e.g. model comparison, debugging, outlier detection) you might want to leverage different enrichments and metadata.In this example we focus on the valve class. We specifically look at normal data points that have high anomaly scores in both models. This is one example on how to find difficult example or edge cases:```jupyterpythonfrom renumics import spotlightextended_layout = load_dataset_builder("renumics/dcase23-task2-enriched", "dev").get_layout(config="extended")spotlight.show(df, dtype={'path': spotlight.Audio, "embeddings_ast-finetuned-audioset-10-10-0.4593": spotlight.Embedding}, layout=extended_layout)```## Using custom model results and enrichmentsWhen developing your custom model you want to use different kinds of information from you model (e.g. embedding, anomaly scores etc.) to gain further insights into the dataset and the model behvior.Suppose you have your model's embeddings for each datapoint as a 2D-Numpy array called `embeddings` and your anomaly score as a 1D-Numpy array called `anomaly_scores`. Then you can add this information to the dataset:```jupyterpythondf['my_model_embedding'] = embeddingsdf['anomaly_score'] = anomaly_score```Depending on your concrete task you might want to use different enrichments. For a good overview on great open source tooling for uncertainty quantification, explainability and outlier detection, you can take a look at our [curated list for open source data-centric AI tooling](https://github.com/Renumics/awesome-open-data-centric-ai) on Github.You can also save your view configuration in Spotlight in a JSON configuration file by clicking on the respective icon:For more information how to configure the Spotlight UI please refer to the [documentation](https://spotlight.renumics.com).## Dataset Structure2 unmodified linesFor each instance, there is a Audio for the audio, a string for the path, an integer for the section, a string for the d1p (parameter), a string for the d1v (value),a ClassLabel for the label and a ClassLabel for the class.```{'audio': {'array': array([ 0. , 0.00024414, -0.00024414, ..., -0.00024414,0. , 0. ], dtype=float32),14 unmodified lines'ast-finetuned-audioset-10-10-0.4593-embeddings': [0.8152204155921936,1.5862374305725098, ...,1.7154160737991333]'anomaly_score_dcase2023_task2_baseline_ae': 8.284389'prediction_dcase2023_task2_baseline_ae': 0'prediction_correct_dcase2023_task2_baseline_ae': 1'anomaly_score_embedding_lof': 0.191043}```12 unmodified lines- `class`: an integer as class label.- `label`: an integer whose value may be either _0_, indicating that the audio sample is _normal_, _1_, indicating that the audio sample contains an _anomaly_.- `ast-finetuned-audioset-10-10-0.4593-embeddings`: an `datasets.Sequence(Value("float32"))` representing audio embeddings that are generated with an [Audio Spectrogram Transformer](https://huggingface.co/docs/transformers/model_doc/audio-spectrogram-transformer#transformers.ASTFeatureExtractor).- `anomaly_score_dcase2023_task2_baseline_ae`: a float representation of the anomaly score according to the baseline implementation- `prediction_dcase2023_task2_baseline_ae`: an integer whose value may be either _0_, indicating that the audio sample is considered _normal_ by the baseline algorithm, _1_, indicating that the audio sample contains an _anomaly_.- `prediction_correct_dcase2023_task2_baseline_ae`: an integer whose value may be either _0_, indicating that the baseline prediction is wrong or _1_, indicating that prediction is correct.- `anomaly_score_embedding_lof`: a float representation of the anomaly score computed with the PyOD implementation of the Local Outlier Factor algorithm on the pre-computed embedding.### Data Splits
README.md+21-17