Datasets:
Tasks:
Audio Classification
Formats:
parquet
Sub-tasks:
keyword-spotting
Languages:
English
Size:
100K - 1M
ArXiv:
License:
Upload exploration.ipynb with huggingface_hub
Browse files- exploration.ipynb +25 -166
exploration.ipynb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
-
"execution_count":
|
| 6 |
"id": "4991385a-1cc9-4cd7-b144-36dc0478fafe",
|
| 7 |
"metadata": {},
|
| 8 |
"outputs": [],
|
|
@@ -12,216 +12,75 @@
|
|
| 12 |
},
|
| 13 |
{
|
| 14 |
"cell_type": "code",
|
| 15 |
-
"execution_count":
|
| 16 |
"id": "a32c61a3-b0f8-430b-9c4d-ff27a1a7942e",
|
| 17 |
"metadata": {},
|
| 18 |
"outputs": [],
|
| 19 |
"source": [
|
| 20 |
"import datasets\n",
|
| 21 |
-
"from renumics import spotlight"
|
|
|
|
|
|
|
| 22 |
]
|
| 23 |
},
|
| 24 |
{
|
| 25 |
"cell_type": "code",
|
| 26 |
-
"execution_count":
|
| 27 |
"id": "fada8bfa-c2ea-441a-9d07-f67fa8047138",
|
| 28 |
"metadata": {},
|
| 29 |
"outputs": [],
|
| 30 |
"source": [
|
| 31 |
-
"dataset = datasets.load_dataset(\"renumics/speech_commands_enrichment_only\"
|
| 32 |
-
"raw_dataset = datasets.load_dataset(\"speech_commands\", 'v0.01')"
|
| 33 |
]
|
| 34 |
},
|
| 35 |
{
|
| 36 |
"cell_type": "code",
|
| 37 |
-
"execution_count":
|
| 38 |
"id": "7e486382-31cd-4b69-8a9e-fe3d7ac94b41",
|
| 39 |
"metadata": {},
|
| 40 |
-
"outputs": [
|
| 41 |
-
{
|
| 42 |
-
"data": {
|
| 43 |
-
"text/plain": [
|
| 44 |
-
"DatasetDict({\n",
|
| 45 |
-
" train: Dataset({\n",
|
| 46 |
-
" features: ['label_string', 'probability', 'probability_vector', 'prediction', 'prediction_string', 'embedding_reduced', '__index_level_0__'],\n",
|
| 47 |
-
" num_rows: 51093\n",
|
| 48 |
-
" })\n",
|
| 49 |
-
" validation: Dataset({\n",
|
| 50 |
-
" features: ['label_string', 'probability', 'probability_vector', 'prediction', 'prediction_string', 'embedding_reduced', '__index_level_0__'],\n",
|
| 51 |
-
" num_rows: 6799\n",
|
| 52 |
-
" })\n",
|
| 53 |
-
" test: Dataset({\n",
|
| 54 |
-
" features: ['label_string', 'probability', 'probability_vector', 'prediction', 'prediction_string', 'embedding_reduced', '__index_level_0__'],\n",
|
| 55 |
-
" num_rows: 3081\n",
|
| 56 |
-
" })\n",
|
| 57 |
-
"})"
|
| 58 |
-
]
|
| 59 |
-
},
|
| 60 |
-
"execution_count": 4,
|
| 61 |
-
"metadata": {},
|
| 62 |
-
"output_type": "execute_result"
|
| 63 |
-
}
|
| 64 |
-
],
|
| 65 |
"source": [
|
| 66 |
"dataset"
|
| 67 |
]
|
| 68 |
},
|
| 69 |
{
|
| 70 |
"cell_type": "code",
|
| 71 |
-
"execution_count":
|
| 72 |
-
"id": "9594c54a-c024-4492-af7b-f1c25bb4de6b",
|
| 73 |
-
"metadata": {},
|
| 74 |
-
"outputs": [
|
| 75 |
-
{
|
| 76 |
-
"data": {
|
| 77 |
-
"text/plain": [
|
| 78 |
-
"DatasetDict({\n",
|
| 79 |
-
" train: Dataset({\n",
|
| 80 |
-
" features: ['file', 'audio', 'label', 'is_unknown', 'speaker_id', 'utterance_id'],\n",
|
| 81 |
-
" num_rows: 51093\n",
|
| 82 |
-
" })\n",
|
| 83 |
-
" validation: Dataset({\n",
|
| 84 |
-
" features: ['file', 'audio', 'label', 'is_unknown', 'speaker_id', 'utterance_id'],\n",
|
| 85 |
-
" num_rows: 6799\n",
|
| 86 |
-
" })\n",
|
| 87 |
-
" test: Dataset({\n",
|
| 88 |
-
" features: ['file', 'audio', 'label', 'is_unknown', 'speaker_id', 'utterance_id'],\n",
|
| 89 |
-
" num_rows: 3081\n",
|
| 90 |
-
" })\n",
|
| 91 |
-
"})"
|
| 92 |
-
]
|
| 93 |
-
},
|
| 94 |
-
"execution_count": 5,
|
| 95 |
-
"metadata": {},
|
| 96 |
-
"output_type": "execute_result"
|
| 97 |
-
}
|
| 98 |
-
],
|
| 99 |
-
"source": [
|
| 100 |
-
"raw_dataset"
|
| 101 |
-
]
|
| 102 |
-
},
|
| 103 |
-
{
|
| 104 |
-
"cell_type": "code",
|
| 105 |
-
"execution_count": 6,
|
| 106 |
"id": "ddda31eb-fdab-4ed3-81cc-88506ae0d7d5",
|
| 107 |
"metadata": {},
|
| 108 |
"outputs": [],
|
| 109 |
"source": [
|
| 110 |
-
"
|
| 111 |
-
"raw_dataset_joined = datasets.concatenate_datasets([raw_dataset[\"train\"].sort(\"file\"), raw_dataset[\"validation\"].sort(\"file\"), \n",
|
| 112 |
-
" raw_dataset[\"test\"].sort(\"file\")])"
|
| 113 |
]
|
| 114 |
},
|
| 115 |
{
|
| 116 |
"cell_type": "code",
|
| 117 |
-
"execution_count":
|
| 118 |
"id": "2b8918a3-5037-4062-b9cd-40b4a8a4d6c0",
|
| 119 |
"metadata": {},
|
| 120 |
-
"outputs": [
|
| 121 |
-
{
|
| 122 |
-
"data": {
|
| 123 |
-
"text/plain": [
|
| 124 |
-
"Dataset({\n",
|
| 125 |
-
" features: ['label_string', 'probability', 'probability_vector', 'prediction', 'prediction_string', 'embedding_reduced', '__index_level_0__'],\n",
|
| 126 |
-
" num_rows: 60973\n",
|
| 127 |
-
"})"
|
| 128 |
-
]
|
| 129 |
-
},
|
| 130 |
-
"execution_count": 7,
|
| 131 |
-
"metadata": {},
|
| 132 |
-
"output_type": "execute_result"
|
| 133 |
-
}
|
| 134 |
-
],
|
| 135 |
-
"source": [
|
| 136 |
-
"joined_dataset_enrichment"
|
| 137 |
-
]
|
| 138 |
-
},
|
| 139 |
-
{
|
| 140 |
-
"cell_type": "code",
|
| 141 |
-
"execution_count": 8,
|
| 142 |
-
"id": "fa6ca118-3df0-4b6b-a036-4c70544500e3",
|
| 143 |
-
"metadata": {},
|
| 144 |
-
"outputs": [
|
| 145 |
-
{
|
| 146 |
-
"data": {
|
| 147 |
-
"text/plain": [
|
| 148 |
-
"Dataset({\n",
|
| 149 |
-
" features: ['file', 'audio', 'label', 'is_unknown', 'speaker_id', 'utterance_id'],\n",
|
| 150 |
-
" num_rows: 60973\n",
|
| 151 |
-
"})"
|
| 152 |
-
]
|
| 153 |
-
},
|
| 154 |
-
"execution_count": 8,
|
| 155 |
-
"metadata": {},
|
| 156 |
-
"output_type": "execute_result"
|
| 157 |
-
}
|
| 158 |
-
],
|
| 159 |
-
"source": [
|
| 160 |
-
"#raw_dataset_joined = raw_dataset_joined.sort(\"file\")\n",
|
| 161 |
-
"raw_dataset_joined"
|
| 162 |
-
]
|
| 163 |
-
},
|
| 164 |
-
{
|
| 165 |
-
"cell_type": "code",
|
| 166 |
-
"execution_count": 9,
|
| 167 |
-
"id": "0a56d781-5b5c-4deb-aa4f-c9a1a96ac650",
|
| 168 |
-
"metadata": {},
|
| 169 |
"outputs": [],
|
| 170 |
"source": [
|
| 171 |
-
"
|
| 172 |
]
|
| 173 |
},
|
| 174 |
{
|
| 175 |
"cell_type": "code",
|
| 176 |
-
"execution_count":
|
| 177 |
-
"id": "cb487431-8bc6-483a-bf25-a917278b6781",
|
| 178 |
-
"metadata": {},
|
| 179 |
-
"outputs": [
|
| 180 |
-
{
|
| 181 |
-
"data": {
|
| 182 |
-
"text/plain": [
|
| 183 |
-
"Dataset({\n",
|
| 184 |
-
" features: ['file', 'audio', 'label', 'is_unknown', 'speaker_id', 'utterance_id', 'label_string', 'probability', 'probability_vector', 'prediction', 'prediction_string', 'embedding_reduced', '__index_level_0__'],\n",
|
| 185 |
-
" num_rows: 60973\n",
|
| 186 |
-
"})"
|
| 187 |
-
]
|
| 188 |
-
},
|
| 189 |
-
"execution_count": 10,
|
| 190 |
-
"metadata": {},
|
| 191 |
-
"output_type": "execute_result"
|
| 192 |
-
}
|
| 193 |
-
],
|
| 194 |
-
"source": [
|
| 195 |
-
"complete_dataset"
|
| 196 |
-
]
|
| 197 |
-
},
|
| 198 |
-
{
|
| 199 |
-
"cell_type": "code",
|
| 200 |
-
"execution_count": 13,
|
| 201 |
"id": "a11fefeb-9fd1-4500-9b9f-3275207b1cde",
|
| 202 |
"metadata": {},
|
| 203 |
-
"outputs": [
|
| 204 |
-
{
|
| 205 |
-
"ename": "TypeError",
|
| 206 |
-
"evalue": "'module' object is not callable",
|
| 207 |
-
"output_type": "error",
|
| 208 |
-
"traceback": [
|
| 209 |
-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
| 210 |
-
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
|
| 211 |
-
"Cell \u001b[0;32mIn[13], line 4\u001b[0m\n\u001b[1;32m 1\u001b[0m spotlight\u001b[38;5;241m.\u001b[39mshow(\n\u001b[1;32m 2\u001b[0m complete_dataset,\n\u001b[1;32m 3\u001b[0m \u001b[38;5;66;03m#layout= layout.parse(\"spotlight-layout.json\"),\u001b[39;00m\n\u001b[0;32m----> 4\u001b[0m layout\u001b[38;5;241m=\u001b[39m\u001b[43mspotlight\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlayouts\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmodel_debug\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m,\n\u001b[1;32m 5\u001b[0m port\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m7860\u001b[39m, \n\u001b[1;32m 6\u001b[0m host\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m0.0.0.0\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 7\u001b[0m allow_filebrowsing\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m \n\u001b[1;32m 8\u001b[0m )\n",
|
| 212 |
-
"\u001b[0;31mTypeError\u001b[0m: 'module' object is not callable"
|
| 213 |
-
]
|
| 214 |
-
}
|
| 215 |
-
],
|
| 216 |
"source": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
"spotlight.show(\n",
|
| 218 |
-
"
|
| 219 |
-
"
|
| 220 |
-
"
|
| 221 |
-
"
|
| 222 |
-
" host=\"0.0.0.0\",\n",
|
| 223 |
-
" allow_filebrowsing=False \n",
|
| 224 |
-
" )"
|
| 225 |
]
|
| 226 |
},
|
| 227 |
{
|
|
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
+
"execution_count": null,
|
| 6 |
"id": "4991385a-1cc9-4cd7-b144-36dc0478fafe",
|
| 7 |
"metadata": {},
|
| 8 |
"outputs": [],
|
|
|
|
| 12 |
},
|
| 13 |
{
|
| 14 |
"cell_type": "code",
|
| 15 |
+
"execution_count": null,
|
| 16 |
"id": "a32c61a3-b0f8-430b-9c4d-ff27a1a7942e",
|
| 17 |
"metadata": {},
|
| 18 |
"outputs": [],
|
| 19 |
"source": [
|
| 20 |
"import datasets\n",
|
| 21 |
+
"from renumics import spotlight\n",
|
| 22 |
+
"\n",
|
| 23 |
+
"from renumics.spotlight.layouts import debug_classification"
|
| 24 |
]
|
| 25 |
},
|
| 26 |
{
|
| 27 |
"cell_type": "code",
|
| 28 |
+
"execution_count": null,
|
| 29 |
"id": "fada8bfa-c2ea-441a-9d07-f67fa8047138",
|
| 30 |
"metadata": {},
|
| 31 |
"outputs": [],
|
| 32 |
"source": [
|
| 33 |
+
"dataset = datasets.load_dataset(\"renumics/speech_commands_enrichment_only\", \"raw_and_enrichment_combined\")"
|
|
|
|
| 34 |
]
|
| 35 |
},
|
| 36 |
{
|
| 37 |
"cell_type": "code",
|
| 38 |
+
"execution_count": null,
|
| 39 |
"id": "7e486382-31cd-4b69-8a9e-fe3d7ac94b41",
|
| 40 |
"metadata": {},
|
| 41 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
"source": [
|
| 43 |
"dataset"
|
| 44 |
]
|
| 45 |
},
|
| 46 |
{
|
| 47 |
"cell_type": "code",
|
| 48 |
+
"execution_count": null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
"id": "ddda31eb-fdab-4ed3-81cc-88506ae0d7d5",
|
| 50 |
"metadata": {},
|
| 51 |
"outputs": [],
|
| 52 |
"source": [
|
| 53 |
+
"joined_dataset = datasets.concatenate_datasets([dataset[\"train\"], dataset[\"validation\"], dataset[\"test\"]])"
|
|
|
|
|
|
|
| 54 |
]
|
| 55 |
},
|
| 56 |
{
|
| 57 |
"cell_type": "code",
|
| 58 |
+
"execution_count": null,
|
| 59 |
"id": "2b8918a3-5037-4062-b9cd-40b4a8a4d6c0",
|
| 60 |
"metadata": {},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
"outputs": [],
|
| 62 |
"source": [
|
| 63 |
+
"joined_dataset"
|
| 64 |
]
|
| 65 |
},
|
| 66 |
{
|
| 67 |
"cell_type": "code",
|
| 68 |
+
"execution_count": null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
"id": "a11fefeb-9fd1-4500-9b9f-3275207b1cde",
|
| 70 |
"metadata": {},
|
| 71 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
"source": [
|
| 73 |
+
"layout = debug_classification(label='label_string', prediction='prediction', embedding='embedding_reduced', \n",
|
| 74 |
+
" features=[\"label\", \"prediction\", \"probability\"], inspect={'audio': spotlight.Audio})\n",
|
| 75 |
+
"dtypes = {\n",
|
| 76 |
+
" \"audio\": spotlight.Audio,\n",
|
| 77 |
+
" \"embedding_reduced\": spotlight.Embedding\n",
|
| 78 |
+
"}\n",
|
| 79 |
"spotlight.show(\n",
|
| 80 |
+
" joined_dataset,\n",
|
| 81 |
+
" dtype=dtypes,\n",
|
| 82 |
+
" layout= layout\n",
|
| 83 |
+
")\n"
|
|
|
|
|
|
|
|
|
|
| 84 |
]
|
| 85 |
},
|
| 86 |
{
|