-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d6494d
commit c907a8d
Showing
122 changed files
with
2,427 additions
and
2,359 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,64 @@ | ||
# https://yaml.org/type/float.html | ||
data: | ||
train_manifest: data/manifest.train | ||
dev_manifest: data/manifest.dev | ||
test_manifest: data/manifest.test | ||
min_input_len: 0.0 | ||
max_input_len: 27.0 # second | ||
min_output_len: 0.0 | ||
max_output_len: .inf | ||
min_output_input_ratio: 0.00 | ||
max_output_input_ratio: .inf | ||
########################################### | ||
# Data # | ||
########################################### | ||
train_manifest: data/manifest.train | ||
dev_manifest: data/manifest.dev | ||
test_manifest: data/manifest.test | ||
min_input_len: 0.0 | ||
max_input_len: 27.0 # second | ||
min_output_len: 0.0 | ||
max_output_len: .inf | ||
min_output_input_ratio: 0.00 | ||
max_output_input_ratio: .inf | ||
|
||
collator: | ||
batch_size: 64 # one gpu | ||
mean_std_filepath: data/mean_std.json | ||
unit_type: char | ||
vocab_filepath: data/lang_char/vocab.txt | ||
augmentation_config: conf/augmentation.json | ||
random_seed: 0 | ||
spm_model_prefix: | ||
spectrum_type: linear | ||
feat_dim: | ||
delta_delta: False | ||
stride_ms: 10.0 | ||
window_ms: 20.0 | ||
n_fft: None | ||
max_freq: None | ||
target_sample_rate: 16000 | ||
use_dB_normalization: True | ||
target_dB: -20 | ||
dither: 1.0 | ||
keep_transcription_text: False | ||
sortagrad: True | ||
shuffle_method: batch_shuffle | ||
num_workers: 2 | ||
########################################### | ||
# Dataloader # | ||
########################################### | ||
batch_size: 64 # one gpu | ||
mean_std_filepath: data/mean_std.json | ||
unit_type: char | ||
vocab_filepath: data/lang_char/vocab.txt | ||
augmentation_config: conf/augmentation.json | ||
random_seed: 0 | ||
spm_model_prefix: | ||
spectrum_type: linear | ||
feat_dim: | ||
delta_delta: False | ||
stride_ms: 10.0 | ||
window_ms: 20.0 | ||
n_fft: None | ||
max_freq: None | ||
target_sample_rate: 16000 | ||
use_dB_normalization: True | ||
target_dB: -20 | ||
dither: 1.0 | ||
keep_transcription_text: False | ||
sortagrad: True | ||
shuffle_method: batch_shuffle | ||
num_workers: 2 | ||
|
||
model: | ||
num_conv_layers: 2 | ||
num_rnn_layers: 3 | ||
rnn_layer_size: 1024 | ||
use_gru: True | ||
share_rnn_weights: False | ||
blank_id: 0 | ||
ctc_grad_norm_type: instance | ||
############################################ | ||
# Network Architecture # | ||
############################################ | ||
num_conv_layers: 2 | ||
num_rnn_layers: 3 | ||
rnn_layer_size: 1024 | ||
use_gru: True | ||
share_rnn_weights: False | ||
blank_id: 0 | ||
ctc_grad_norm_type: instance | ||
|
||
training: | ||
n_epoch: 80 | ||
accum_grad: 1 | ||
lr: 2e-3 | ||
lr_decay: 0.83 | ||
weight_decay: 1e-06 | ||
global_grad_clip: 3.0 | ||
log_interval: 100 | ||
checkpoint: | ||
kbest_n: 50 | ||
latest_n: 5 | ||
|
||
decoding: | ||
batch_size: 128 | ||
error_rate_type: cer | ||
decoding_method: ctc_beam_search | ||
lang_model_path: data/lm/zh_giga.no_cna_cmn.prune01244.klm | ||
alpha: 1.9 | ||
beta: 5.0 | ||
beam_size: 300 | ||
cutoff_prob: 0.99 | ||
cutoff_top_n: 40 | ||
num_proc_bsearch: 10 | ||
########################################### | ||
# Training # | ||
########################################### | ||
n_epoch: 80 | ||
accum_grad: 1 | ||
lr: 2e-3 | ||
lr_decay: 0.83 | ||
weight_decay: 1e-06 | ||
global_grad_clip: 3.0 | ||
log_interval: 100 | ||
checkpoint: | ||
kbest_n: 50 | ||
latest_n: 5 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,68 @@ | ||
# https://yaml.org/type/float.html | ||
data: | ||
train_manifest: data/manifest.train | ||
dev_manifest: data/manifest.dev | ||
test_manifest: data/manifest.test | ||
min_input_len: 0.0 | ||
max_input_len: 27.0 # second | ||
min_output_len: 0.0 | ||
max_output_len: .inf | ||
min_output_input_ratio: 0.00 | ||
max_output_input_ratio: .inf | ||
########################################### | ||
# Data # | ||
########################################### | ||
train_manifest: data/manifest.train | ||
dev_manifest: data/manifest.dev | ||
test_manifest: data/manifest.test | ||
min_input_len: 0.0 | ||
max_input_len: 27.0 # second | ||
min_output_len: 0.0 | ||
max_output_len: .inf | ||
min_output_input_ratio: 0.00 | ||
max_output_input_ratio: .inf | ||
|
||
collator: | ||
batch_size: 64 # one gpu | ||
mean_std_filepath: data/mean_std.json | ||
unit_type: char | ||
vocab_filepath: data/lang_char/vocab.txt | ||
augmentation_config: conf/augmentation.json | ||
random_seed: 0 | ||
spm_model_prefix: | ||
spectrum_type: linear #linear, mfcc, fbank | ||
feat_dim: | ||
delta_delta: False | ||
stride_ms: 10.0 | ||
window_ms: 20.0 | ||
n_fft: None | ||
max_freq: None | ||
target_sample_rate: 16000 | ||
use_dB_normalization: True | ||
target_dB: -20 | ||
dither: 1.0 | ||
keep_transcription_text: False | ||
sortagrad: True | ||
shuffle_method: batch_shuffle | ||
num_workers: 0 | ||
########################################### | ||
# Dataloader # | ||
########################################### | ||
batch_size: 64 # one gpu | ||
mean_std_filepath: data/mean_std.json | ||
unit_type: char | ||
vocab_filepath: data/lang_char/vocab.txt | ||
augmentation_config: conf/augmentation.json | ||
random_seed: 0 | ||
spm_model_prefix: | ||
spectrum_type: linear #linear, mfcc, fbank | ||
feat_dim: | ||
delta_delta: False | ||
stride_ms: 10.0 | ||
window_ms: 20.0 | ||
n_fft: None | ||
max_freq: None | ||
target_sample_rate: 16000 | ||
use_dB_normalization: True | ||
target_dB: -20 | ||
dither: 1.0 | ||
keep_transcription_text: False | ||
sortagrad: True | ||
shuffle_method: batch_shuffle | ||
num_workers: 0 | ||
|
||
model: | ||
num_conv_layers: 2 | ||
num_rnn_layers: 5 | ||
rnn_layer_size: 1024 | ||
rnn_direction: forward # [forward, bidirect] | ||
num_fc_layers: 0 | ||
fc_layers_size_list: -1, | ||
use_gru: False | ||
blank_id: 0 | ||
############################################ | ||
# Network Architecture # | ||
############################################ | ||
num_conv_layers: 2 | ||
num_rnn_layers: 5 | ||
rnn_layer_size: 1024 | ||
rnn_direction: forward # [forward, bidirect] | ||
num_fc_layers: 0 | ||
fc_layers_size_list: -1, | ||
use_gru: False | ||
blank_id: 0 | ||
|
||
|
||
training: | ||
n_epoch: 65 | ||
accum_grad: 1 | ||
lr: 5e-4 | ||
lr_decay: 0.93 | ||
weight_decay: 1e-06 | ||
global_grad_clip: 3.0 | ||
log_interval: 100 | ||
checkpoint: | ||
kbest_n: 50 | ||
latest_n: 5 | ||
########################################### | ||
# Training # | ||
########################################### | ||
n_epoch: 65 | ||
accum_grad: 1 | ||
lr: 5e-4 | ||
lr_decay: 0.93 | ||
weight_decay: 1e-06 | ||
global_grad_clip: 3.0 | ||
log_interval: 100 | ||
checkpoint: | ||
kbest_n: 50 | ||
latest_n: 5 | ||
|
||
|
||
decoding: | ||
batch_size: 32 | ||
error_rate_type: cer | ||
decoding_method: ctc_beam_search | ||
lang_model_path: data/lm/zh_giga.no_cna_cmn.prune01244.klm | ||
alpha: 2.2 #1.9 | ||
beta: 4.3 | ||
beam_size: 300 | ||
cutoff_prob: 0.99 | ||
cutoff_top_n: 40 | ||
num_proc_bsearch: 10 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
chunk_batch_size: 32 | ||
error_rate_type: cer | ||
decoding_method: ctc_beam_search | ||
lang_model_path: data/lm/zh_giga.no_cna_cmn.prune01244.klm | ||
alpha: 2.2 #1.9 | ||
beta: 4.3 | ||
beam_size: 300 | ||
cutoff_prob: 0.99 | ||
cutoff_top_n: 40 | ||
num_proc_bsearch: 10 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
decode_batch_size: 128 | ||
error_rate_type: cer | ||
decoding_method: ctc_beam_search | ||
lang_model_path: data/lm/zh_giga.no_cna_cmn.prune01244.klm | ||
alpha: 1.9 | ||
beta: 5.0 | ||
beam_size: 300 | ||
cutoff_prob: 0.99 | ||
cutoff_top_n: 40 | ||
num_proc_bsearch: 10 |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
if [ $# != 4 ];then | ||
echo "usage: ${0} config_path ckpt_path_prefix model_type audio_file" | ||
exit -1 | ||
fi | ||
|
||
ngpu=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}') | ||
echo "using $ngpu gpus..." | ||
|
||
config_path=$1 | ||
ckpt_prefix=$2 | ||
model_type=$3 | ||
audio_file=$4 | ||
|
||
mkdir -p data | ||
wget -nc https://paddlespeech.bj.bcebos.com/datasets/single_wav/zh/demo_01_03.wav -P data/ | ||
if [ $? -ne 0 ]; then | ||
exit 1 | ||
fi | ||
|
||
if [ ! -f ${audio_file} ]; then | ||
echo "Plase input the right audio_file path" | ||
exit 1 | ||
fi | ||
|
||
# download language model | ||
bash local/download_lm_ch.sh | ||
if [ $? -ne 0 ]; then | ||
exit 1 | ||
fi | ||
|
||
python3 -u ${BIN_DIR}/test_hub.py \ | ||
--nproc ${ngpu} \ | ||
--config ${config_path} \ | ||
--result_file ${ckpt_prefix}.rsl \ | ||
--checkpoint_path ${ckpt_prefix} \ | ||
--model_type ${model_type} \ | ||
--audio_file ${audio_file} | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Failed in evaluation!" | ||
exit 1 | ||
fi | ||
|
||
|
||
exit 0 |
Oops, something went wrong.