Created
November 12, 2020 15:28
-
-
Save hbredin/caa5468b2b9f22a3ec6f650bfce060e5 to your computer and use it in GitHub Desktop.
Visual explanation of speech turn segmentation pipeline (and the role of gap_max_duration hyper-parameter)
This file contains 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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"This notebook explains the role of \"gap_min_duration\" hyper-parameters in the `SpeechTurnSegmentation` pipeline." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 42, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from pyannote.core import Segment, Timeline, Annotation" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"This is a sample output of voice activity detection sub-pipeline:" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 43, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAABH0AAABjCAYAAAAGhXxMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKw0lEQVR4nO3da6xlZ1kH8P9jp/IBiRSG1BHQMcT0A6hIJ9R6y0SklkpaIY2WGC1eolUx8sF4TeykxgQQTJREjUqTqoj1Vm0MLTSRqF9KmGmKpUBtNdPYC21qTUsDEWofP5zV4eSw98yenn3OPufdv18yOfvsdcmzs59513r/Z6+1q7sDAAAAwFi+YtUFAAAAALB8Qh8AAACAAQl9AAAAAAYk9AEAAAAYkNAHAAAAYEAHtrPxwYMH+/Dhw0sqBQAAAIATJ0481t0v2e5+thX6HD58OMePH99uDQAAAABMqur+ZezH5V0AAAAAAxL6AAAAAAxI6AMAAAAwIKEPAAAAwICEPgAAAAADEvoAA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gBgCXxlOwAAAMCAfNIHAAAAYEBCHwAAAIABCX0AAAAABiT0AQAAABiQ0AcAAABgQEIfAAAAgAEJfQAAAAAG9P9HMKq+LepL8AAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<Timeline(uri=None, segments=[<Segment(0, 5)>, <Segment(6, 11)>, <Segment(13, 16)>, <Segment(18, 20)>])>" | |
] | |
}, | |
"execution_count": 43, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"vad = Timeline([Segment(0, 5), Segment(6, 11), Segment(13, 16), Segment(18, 20)])\n", | |
"vad" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"This is a sample output of speaker change detection sub-pipeline:" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 44, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAABH0AAABjCAYAAAAGhXxMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKnUlEQVR4nO3dXaxlZ1kH8P9jp3KBRApD6gjoGGJ6ASrSCbV+dSJSSyUtkEZLjBY/olUxcmH8TLSpMQEEEyVRo9KkCmIVrTaGFppI1JsSZprBUqC2mmnsdGhTa1oaiFD7eHFWy8lh7zN7ej72Oe/+/ZLJ2Wevd+08O/PkXe/6n73Wru4OAAAAAGP5qmUXAAAAAMD2E/oAAAAADEjoAwAAADAgoQ8AAADAgIQ+AAAAAAM6sJWdDx482IcPH96mUgAAAAA4fvz4I939oq2+zpZCn8OHD+fYsWNbrQEAAACASVXdvx2v4/IuAAAAgAEJfQAAAAAGJPQBAAAAGJDQBwAAAGBAQh8AAACAAQl9AAAAAAYk9AEAAAAYkNAHAAAAYEBCHwAAAIABCX0AAAAABiT0AQAAABiQ0Ac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", | |
"text/plain": [ | |
"<Timeline(uri=None, segments=[<Segment(0, 2)>, <Segment(2, 7)>, <Segment(7, 17)>, <Segment(17, 20)>])>" | |
] | |
}, | |
"execution_count": 44, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"scd = Timeline([Segment(0, 2), Segment(2, 7), Segment(7, 17), Segment(17, 20)])\n", | |
"scd" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Note how the model is *not* trained to detect non-speech/speaker changes." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 45, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"gap_max_duration = 1.5" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Since the gap between first and second `vad` segments is shorter than `gap_max_duration` and since `scd` did not detect any speaker change between those two segments, we expect the following speech turn segmentation:" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 46, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAABH0AAACsCAYAAADmO9AtAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPx0lEQVR4nO3de4xtZ1kH4N9rW9BwkUsvQKkcJYKGO224CVJBChTSFtJoURQUwkVRSURFTOwUQwQEIpcoCDQpl9J6AxqBliZUJGoJ5zStpUChYAk9KW24BGhAoO3rH7NPmQyzz5lzZp+zZr55nmQye++19sq7st/51lq/2Wut6u4AAAAAMJafmLoAAAAAABZP6AMAAAAwIKEPAAAAwICEPgAAAAADEvoAAAAADEjoAwAAADAgoQ8AAADAgIQ+AAAAAAMS+gAAAAAMSOgDAAAAMKAhQp+qOq2quqp+YepaFqmqbqmqy6vqiqq6rKoeM3VNi1JV96iq86rqi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1XZIzk7w6yT9W1fOSfDnLF9BMVZ2Q5EXd/fzu/kZV/VWWD9CS5JXdfSAXbWULmdMvf57k9kkunm2XLp3dlfZeSd7R3SdnznZrglXgEJnTKydW1UOzfNrFtZltl1b2yrzjp0O/BhxKa/VLd78za1yP0Niy7c07bj4o+y77vGU7AAAAAFuPCzkDAAAADEjoAwAAADAgoQ8AAADAgIQ+AAAAAAMS+gAAAAAMSOgDAGxJVXX3qrp89vPVqto9e3xTVf3d1PUBAEzNLdsBgC2vqpaS3NTdr5u6FgCAzcI3fQCAoVTViVX1b7PHS1V1TlV9oqq+XFXPrKrXVtWVVXVhVR0xm+/4qvp4Ve2qqouq6p7TrgUAwMYJfQCA0d03yROSnJLkPUku6e4HJflekqfNgp83Jzm9u49PcnaSV01VLADAohw+dQEAAAfZR7r7h1V1ZZLDklw4e/3KJDuS3D/JA5NcXFWZzXP9BHUCACyU0AcAGN33k6S7b62qH/aPLmh4a5b3hSrJVd396KkKBAA4GJzeBQBsd1cnOaqqHp0kVXVEVT1g4poAADZM6AMAbGvd/YMkpyd5TVVdkeTyJI+ZtCgAgAVwy3YAAACAAfmmDwAAAMCAhD4AAAAAAxL6AAAAAAxI6AMAAAAwIKEPAAAAwICEPgAAAAADEvoAAAAADEjoAwAAADCg/wf8JIfX8v7P7QAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<pyannote.core.annotation.Annotation at 0x1167b7a60>" | |
] | |
}, | |
"execution_count": 46, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"speech_turns = Annotation()\n", | |
"speech_turns[Segment(0, 2)] = 'A'\n", | |
"speech_turns[Segment(2, 5)] = 'B'\n", | |
"speech_turns[Segment(6, 7)] = 'B' # same label as previous segment\n", | |
"speech_turns[Segment(7, 11)] = 'C'\n", | |
"speech_turns[Segment(13, 16)] = 'D'\n", | |
"speech_turns[Segment(18, 20)] = 'E'\n", | |
"speech_turns" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Let's go step by step.\n", | |
"\n", | |
"We start by computing `vad` support with filled short gaps:" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 47, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAABH0AAABjCAYAAAAGhXxMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKpUlEQVR4nO3da6xlZ1kH8P9jp/IBiRSG1BHQMcT0A6hIJ9R6y0SklkpaIY0OMVq8RKti5IPxmthJjQkgmCiJGpUmVRHrrdoYWmgiUb+UMNMUS4HaaqaxF9rUmpYJRKh9/HBWy8lh7zN75lz2Oe/+/ZLJ2WevS56d/cy73vU/e61d3R0AAAAAxvIVyy4AAAAAgO0n9AEAAAAYkNAHAAAAYEBCHwAAAIABCX0AAAAABnRgKxsfPHiwDx8+vE2lAAAAAHDy5MnHu/slW93PlkKfw4cP58SJE1utAQAAAIBJVT2wHftxeRcAAADAgIQ+AAAAAAMS+gAAAAAMSOgDAAAAMCChDwAAAMCAhD4AAAAAAxL6AAAAAAxI6AMAAAAwIKEPAAAAwICEPgAAAAADEvoAAAAADEjoAwAAADAgoQ8AAADAgIQ+AAAAAAMS+gAAAAAMSOgDAAAAMCChDwAAAMCAhD4AAAAAAxL6AAAAAAxI6AMAAAAwIKEPAAAAwICEPgAAAAADEvoAAAAADGhLoc/DDz+8XXUAALAFx48fX3YJnCPvHXuZ/ty/vHckSXX3uW9c1VvZHgCA7VFVMS/bn7x37GX6c//y3u1vVXWyu49sdT8u7wIAAAAY0IGt7qCqtqMOAABYWebUwE4wtrDl0MfHxQAAls/Efn8zp2avMrbsb8aW/Wu7/u9t6fKuQ4cObUsRAABszXXXXbfsEjhH3jv2Mv25f3nvSLZ4I+cjR470iRMntrEcA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J/lckh9bUq0s2TQJen2Sn1733PpeMbassKr6QJKjSQ5W1YNJrkvyjiR/VVU/keSBrN1AM1V1JMm13f2T3f1EVf1m1k7QkuT67j6Xm7ayj8zpl19N8rwkt0/HpTumb6X92iR/0t1XZM5xawkvgV0yp1eOVtWrs3bZxalMx6X1vTLv/Gn3XwG7aVa/dPf7MuN+hMaWlTfvvHlH5i5n/Mp2AAAAAPYfN3IGAAAAGJDQBwAAAGBAQh8AAACAAQl9AAAAAAYk9AEAAAAYkNAHANiXqurFVXXX9O8zVfXQ9Ph0Vf3+susDAFg2X9kOAOx7VXU8yenufveyawEA2Ct80gcAGEpVHa2qf5weH6+qG6vqX6vqgap6c1W9q6rurqrbqur8ab2Lq+qfq+pkVX2oqg4t91UAAGyd0AcAGN0rknxPkiuT/HmSj3T3NyX5fJLvn4Kf9ya5ursvTnJDkt9aVrEAANvlwLILAADYYbd29xer6u4k5yW5bXr+7iSHk1yU5FVJbq+qTOs8soQ6AQC2ldAHABjd/yZJdz9TVV/sL93Q8JmszYUqyT3dfemyCgQA2Aku7wIAVt29SV5SVZcmSVWdX1WvXHJNAABbJvQBAFZad38hydVJ3llVH09yV5JvX2pRAADbwFe2AwAAAAzIJ30AAAAABiT0AQAAABiQ0AcAAABgQEIfAAAAgAEJfQAAAAAGJPQBAAAAGJDQBwAAAGBA/w92U5vBtWN5tQAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<Timeline(uri=None, segments=[<Segment(0, 11)>, <Segment(13, 16)>, <Segment(18, 20)>])>" | |
] | |
}, | |
"execution_count": 47, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"vad_support = vad.support(collar=gap_max_duration)\n", | |
"vad_support" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"We then split resulting speech regions at speaker change points detected by `scd`:" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 48, | |
"metadata": {}, | |
"outputs": [ | |
{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nrq+ryJJcledykRQEALIBHtgMAAAAMyJk+AAAAAAMS+gAAAAAMSOgDAAAAMCChDwAAAMCAhD4AAAAAAxL6AAAAAAxI6AMAAAAwIKEPAAAAwID+H1NsePvPzfEHAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<pyannote.core.annotation.Annotation at 0x1166b4fa0>" | |
] | |
}, | |
"execution_count": 48, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"scd_support = scd.crop(vad_support).to_annotation(generator=\"string\")\n", | |
"scd_support" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Finally, we go back to the original `vad` because we incorrectly filled short gaps:" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 50, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAABH0AAACsCAYAAADmO9AtAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPx0lEQVR4nO3de4xtZ1kH4N9rW9BwkUsvQKkcJYKGO224CVJBChTSFtJoURQUwkVRSURFTOwUQwQEIpcoCDQpl9J6AxqBliZUJGoJ5zStpUChYAk9KW24BGhAoO3rH7NPmQyzz5lzZp+zZr55nmQye++19sq7st/51lq/2Wut6u4AAAAAMJafmLoAAAAAABZP6AMAAAAwIKEPAAAAwICEPgAAAAADEvoAAAAADEjoAwAAADAgoQ8AAADAgIQ+AAAAAAMS+gAAAAAMSOgDAAAAMKAhQp+qOq2quqp+YepaFqmqbqmqy6vqiqq6rKoeM3VNi1JV96iq86rqi1W1q6o+XFX3m7quRVjxuV01++z+uKpG+Vvbs257fl4+dU0AAACsrbp76ho2rKrOT3KvJB/r7jOnrmdRquqm7r7j7PGTk7yiux8/cVkbVlWV5L+SnNPdb5299pAk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tZltl1b2yrzjp0O/BhxKa/VLd78za1yP0Niy7c07bj4o+y77vGU7AAAAAFuPCzkDAAAADEjoAwAAADAgoQ8AAADAgIQ+AAAAAAMS+gAAAAAMSOgDAGxJVXX3qrp89vPVqto9e3xTVf3d1PUBAEzNLdsBgC2vqpaS3NTdr5u6FgCAzcI3fQCAoVTViVX1b7PHS1V1TlV9oqq+XFXPrKrXVtWVVXVhVR0xm+/4qvp4Ve2qqouq6p7TrgUAwMYJfQCA0d03yROSnJLkPUku6e4HJflekqfNgp83Jzm9u49PcnaSV01VLADAohw+dQEAAAfZR7r7h1V1ZZLDklw4e/3KJDuS3D/JA5NcXFWZzXP9BHUCACyU0AcAGN33k6S7b62qH/aPLmh4a5b3hSrJVd396KkKBAA4GJzeBQBsd1cnOaqqHp0kVXVEVT1g4poAADZM6AMAbGvd/YMkpyd5TVVdkeTyJI+ZtCgAgAVwy3YAAACAAfmmDwAAAMCAhD4AAAAAAxL6AAAAAAxI6AMAAAAwIKEPAAAAwICEPgAAAAADEvoAAAAADEjoAwAAADCg/wf8JIfX8v7P7QAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<pyannote.core.annotation.Annotation at 0x116869a60>" | |
] | |
}, | |
"execution_count": 50, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"speech_turns = scd_support.crop(vad)\n", | |
"speech_turns" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.8.5" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment