Syoy commited on
Commit
7a5b9d8
1 Parent(s): 21f22ca

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -6
README.md CHANGED
@@ -79,20 +79,21 @@ Once a year, the [DCASE community](https://dcase.community/) publishes a [challe
79
  The 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:
80
 
81
  Install datasets and Spotlight via [pip](https://packaging.python.org/en/latest/key_projects/#pip):
82
- ```jupyterpython
83
  !pip install renumics-spotlight datasets[audio]
84
  ```
85
  > **_Notice:_** On Linux, non-Python dependency on libsndfile package must be installed manually. See [Datasets - Installation](https://huggingface.co/docs/datasets/installation#audio) for more information.
86
 
87
  Load the dataset from huggingface in your notebook:
88
- ```jupyterpython
89
  import datasets
90
 
91
  dataset = datasets.load_dataset("renumics/dcase23-task2-enriched", "dev", split="all", streaming=False)
92
  ```
93
 
94
  Start exploring with a simple view that leverages embeddings to identify relevant data segments:
95
- ```jupyterpython
 
96
  from renumics import spotlight
97
 
98
  df = dataset.to_pandas()
@@ -104,7 +105,7 @@ You can use the UI to interactively configure the view on the data. Depending on
104
  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:
105
 
106
 
107
- ```jupyterpython
108
  from renumics import spotlight
109
 
110
  extended_layout = datasets.load_dataset_builder("renumics/dcase23-task2-enriched", "dev").config.get_layout(config="extended")
@@ -118,7 +119,7 @@ spotlight.show(df, dtype={'path': spotlight.Audio, "embeddings_ast-finetuned-aud
118
  When 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.
119
 
120
  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:
121
- ```jupyterpython
122
  df['my_model_embedding'] = embeddings
123
  df['anomaly_score'] = anomaly_scores
124
  ```
@@ -137,7 +138,7 @@ For more information how to configure the Spotlight UI please refer to the [docu
137
  For 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),
138
  a ClassLabel for the label and a ClassLabel for the class.
139
 
140
- ```
141
  {'audio': {'array': array([ 0. , 0.00024414, -0.00024414, ..., -0.00024414,
142
  0. , 0. ], dtype=float32),
143
  'path': 'train/fan_section_01_source_train_normal_0592_f-n_A.wav',
 
79
  The 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:
80
 
81
  Install datasets and Spotlight via [pip](https://packaging.python.org/en/latest/key_projects/#pip):
82
+ ```python
83
  !pip install renumics-spotlight datasets[audio]
84
  ```
85
  > **_Notice:_** On Linux, non-Python dependency on libsndfile package must be installed manually. See [Datasets - Installation](https://huggingface.co/docs/datasets/installation#audio) for more information.
86
 
87
  Load the dataset from huggingface in your notebook:
88
+ ```python
89
  import datasets
90
 
91
  dataset = datasets.load_dataset("renumics/dcase23-task2-enriched", "dev", split="all", streaming=False)
92
  ```
93
 
94
  Start exploring with a simple view that leverages embeddings to identify relevant data segments:
95
+
96
+ ```python
97
  from renumics import spotlight
98
 
99
  df = dataset.to_pandas()
 
105
  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:
106
 
107
 
108
+ ```python
109
  from renumics import spotlight
110
 
111
  extended_layout = datasets.load_dataset_builder("renumics/dcase23-task2-enriched", "dev").config.get_layout(config="extended")
 
119
  When 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.
120
 
121
  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:
122
+ ```python
123
  df['my_model_embedding'] = embeddings
124
  df['anomaly_score'] = anomaly_scores
125
  ```
 
138
  For 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),
139
  a ClassLabel for the label and a ClassLabel for the class.
140
 
141
+ ```python
142
  {'audio': {'array': array([ 0. , 0.00024414, -0.00024414, ..., -0.00024414,
143
  0. , 0. ], dtype=float32),
144
  'path': 'train/fan_section_01_source_train_normal_0592_f-n_A.wav',