|
| 1 | +#!/usr/bin/env python3 |
| 2 | +# Copyright 2021 Xiaomi Corp. (authors: Fangjun Kuang) |
| 3 | +# |
| 4 | +# See ../../../../LICENSE for clarification regarding multiple authors |
| 5 | +# |
| 6 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +# you may not use this file except in compliance with the License. |
| 8 | +# You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, software |
| 13 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +# See the License for the specific language governing permissions and |
| 16 | +# limitations under the License. |
| 17 | + |
| 18 | +""" |
| 19 | +This file displays duration statistics of utterances in a manifest. |
| 20 | +You can use the displayed value to choose minimum/maximum duration |
| 21 | +to remove short and long utterances during the training. |
| 22 | +
|
| 23 | +See the function `remove_short_and_long_utt()` in transducer/train.py |
| 24 | +for usage. |
| 25 | +""" |
| 26 | + |
| 27 | + |
| 28 | +from lhotse import load_manifest |
| 29 | + |
| 30 | + |
| 31 | +def main(): |
| 32 | + path = "./data/fbank/cuts_train-clean-100.json.gz" |
| 33 | + path = "./data/fbank/cuts_train-clean-360.json.gz" |
| 34 | + path = "./data/fbank/cuts_train-other-500.json.gz" |
| 35 | + path = "./data/fbank/cuts_dev-clean.json.gz" |
| 36 | + path = "./data/fbank/cuts_dev-other.json.gz" |
| 37 | + path = "./data/fbank/cuts_test-clean.json.gz" |
| 38 | + path = "./data/fbank/cuts_test-other.json.gz" |
| 39 | + |
| 40 | + cuts = load_manifest(path) |
| 41 | + cuts.describe() |
| 42 | + |
| 43 | + |
| 44 | +if __name__ == "__main__": |
| 45 | + main() |
| 46 | + |
| 47 | +""" |
| 48 | +## train-clean-100 |
| 49 | +Cuts count: 85617 |
| 50 | +Total duration (hours): 303.8 |
| 51 | +Speech duration (hours): 303.8 (100.0%) |
| 52 | +*** |
| 53 | +Duration statistics (seconds): |
| 54 | +mean 12.8 |
| 55 | +std 3.8 |
| 56 | +min 1.3 |
| 57 | +0.1% 1.9 |
| 58 | +0.5% 2.2 |
| 59 | +1% 2.5 |
| 60 | +5% 4.2 |
| 61 | +10% 6.4 |
| 62 | +25% 11.4 |
| 63 | +50% 13.8 |
| 64 | +75% 15.3 |
| 65 | +90% 16.7 |
| 66 | +95% 17.3 |
| 67 | +99% 18.1 |
| 68 | +99.5% 18.4 |
| 69 | +99.9% 18.8 |
| 70 | +max 27.2 |
| 71 | +
|
| 72 | +## train-clean-360 |
| 73 | +Cuts count: 312042 |
| 74 | +Total duration (hours): 1098.2 |
| 75 | +Speech duration (hours): 1098.2 (100.0%) |
| 76 | +*** |
| 77 | +Duration statistics (seconds): |
| 78 | +mean 12.7 |
| 79 | +std 3.8 |
| 80 | +min 1.0 |
| 81 | +0.1% 1.8 |
| 82 | +0.5% 2.2 |
| 83 | +1% 2.5 |
| 84 | +5% 4.2 |
| 85 | +10% 6.2 |
| 86 | +25% 11.2 |
| 87 | +50% 13.7 |
| 88 | +75% 15.3 |
| 89 | +90% 16.6 |
| 90 | +95% 17.3 |
| 91 | +99% 18.1 |
| 92 | +99.5% 18.4 |
| 93 | +99.9% 18.8 |
| 94 | +max 33.0 |
| 95 | +
|
| 96 | +## train-other 500 |
| 97 | +Cuts count: 446064 |
| 98 | +Total duration (hours): 1500.6 |
| 99 | +Speech duration (hours): 1500.6 (100.0%) |
| 100 | +*** |
| 101 | +Duration statistics (seconds): |
| 102 | +mean 12.1 |
| 103 | +std 4.2 |
| 104 | +min 0.8 |
| 105 | +0.1% 1.7 |
| 106 | +0.5% 2.1 |
| 107 | +1% 2.3 |
| 108 | +5% 3.5 |
| 109 | +10% 5.0 |
| 110 | +25% 9.8 |
| 111 | +50% 13.4 |
| 112 | +75% 15.1 |
| 113 | +90% 16.5 |
| 114 | +95% 17.2 |
| 115 | +99% 18.1 |
| 116 | +99.5% 18.4 |
| 117 | +99.9% 18.9 |
| 118 | +max 31.0 |
| 119 | +
|
| 120 | +## dev-clean |
| 121 | +Cuts count: 2703 |
| 122 | +Total duration (hours): 5.4 |
| 123 | +Speech duration (hours): 5.4 (100.0%) |
| 124 | +*** |
| 125 | +Duration statistics (seconds): |
| 126 | +mean 7.2 |
| 127 | +std 4.7 |
| 128 | +min 1.4 |
| 129 | +0.1% 1.6 |
| 130 | +0.5% 1.8 |
| 131 | +1% 1.9 |
| 132 | +5% 2.4 |
| 133 | +10% 2.7 |
| 134 | +25% 3.8 |
| 135 | +50% 5.9 |
| 136 | +75% 9.3 |
| 137 | +90% 13.3 |
| 138 | +95% 16.4 |
| 139 | +99% 23.8 |
| 140 | +99.5% 28.5 |
| 141 | +99.9% 32.3 |
| 142 | +max 32.6 |
| 143 | +
|
| 144 | +## dev-other |
| 145 | +Cuts count: 2864 |
| 146 | +Total duration (hours): 5.1 |
| 147 | +Speech duration (hours): 5.1 (100.0%) |
| 148 | +*** |
| 149 | +Duration statistics (seconds): |
| 150 | +mean 6.4 |
| 151 | +std 4.3 |
| 152 | +min 1.1 |
| 153 | +0.1% 1.3 |
| 154 | +0.5% 1.7 |
| 155 | +1% 1.8 |
| 156 | +5% 2.2 |
| 157 | +10% 2.6 |
| 158 | +25% 3.5 |
| 159 | +50% 5.3 |
| 160 | +75% 7.9 |
| 161 | +90% 12.0 |
| 162 | +95% 15.0 |
| 163 | +99% 22.2 |
| 164 | +99.5% 27.1 |
| 165 | +99.9% 32.4 |
| 166 | +max 35.2 |
| 167 | +
|
| 168 | +## test-clean |
| 169 | +Cuts count: 2620 |
| 170 | +Total duration (hours): 5.4 |
| 171 | +Speech duration (hours): 5.4 (100.0%) |
| 172 | +*** |
| 173 | +Duration statistics (seconds): |
| 174 | +mean 7.4 |
| 175 | +std 5.2 |
| 176 | +min 1.3 |
| 177 | +0.1% 1.6 |
| 178 | +0.5% 1.8 |
| 179 | +1% 2.0 |
| 180 | +5% 2.3 |
| 181 | +10% 2.7 |
| 182 | +25% 3.7 |
| 183 | +50% 5.8 |
| 184 | +75% 9.6 |
| 185 | +90% 14.6 |
| 186 | +95% 17.8 |
| 187 | +99% 25.5 |
| 188 | +99.5% 28.4 |
| 189 | +99.9% 32.8 |
| 190 | +max 35.0 |
| 191 | +
|
| 192 | +## test-other |
| 193 | +Cuts count: 2939 |
| 194 | +Total duration (hours): 5.3 |
| 195 | +Speech duration (hours): 5.3 (100.0%) |
| 196 | +*** |
| 197 | +Duration statistics (seconds): |
| 198 | +mean 6.5 |
| 199 | +std 4.4 |
| 200 | +min 1.2 |
| 201 | +0.1% 1.5 |
| 202 | +0.5% 1.8 |
| 203 | +1% 1.9 |
| 204 | +5% 2.3 |
| 205 | +10% 2.6 |
| 206 | +25% 3.4 |
| 207 | +50% 5.2 |
| 208 | +75% 8.2 |
| 209 | +90% 12.6 |
| 210 | +95% 15.8 |
| 211 | +99% 21.4 |
| 212 | +99.5% 23.8 |
| 213 | +99.9% 33.5 |
| 214 | +max 34.5 |
| 215 | +""" |
0 commit comments