Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow segmentation with nnet3 chain models #2845

Merged
merged 1 commit into from
Nov 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions egs/wsj/s5/steps/cleanup/clean_and_segment_data_nnet3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ graph_opts=
beam=15.0
lattice_beam=1.0

acwt=0.1 # Just a default value, used for adaptation and beam-pruning..
post_decode_acwt=1.0 # can be used in 'chain' systems to scale acoustics by 10 so the
# regular scoring script works.

# Contexts must ideally match training
extra_left_context=0 # Set to some large value, typically 40 for LSTM (must match training)
extra_right_context=0
Expand All @@ -36,7 +40,7 @@ frames_per_chunk=150
# i-vector options
extractor= # i-Vector extractor. If provided, will extract i-vectors.
# Required if the network was trained with i-vector extractor.
use_vad= # Use energy-based VAD for i-vector extraction
use_vad=false # Use energy-based VAD for i-vector extraction

segmentation_opts=

Expand Down Expand Up @@ -119,25 +123,26 @@ fi

online_ivector_dir=
if [ ! -z "$extractor" ]; then
online_ivector_dir=$dir/ivectors_$(basename $data_uniform_seg)
online_ivector_dir=$dir/ivectors_$(basename $data)

if [ $stage -le 2 ]; then
# Compute energy-based VAD
if $use_vad; then
steps/compute_vad_decision.sh $data_uniform_seg \
$data_uniform_seg/log $data_uniform_seg/data
steps/compute_vad_decision.sh $data \
$data/log $data/data
fi

steps/online/nnet2/extract_ivectors_online.sh \
--nj $nj --cmd "$cmd --mem 4G" --use-vad $use_vad \
$data_uniform_seg $extractor $online_ivector_dir
$data $extractor $online_ivector_dir
fi
fi

if [ $stage -le 3 ]; then
echo "$0: Decoding with biased language models..."

steps/cleanup/decode_segmentation_nnet3.sh \
--acwt $acwt --post-decode-acwt $post_decode_acwt \
--beam $beam --lattice-beam $lattice_beam --nj $nj --cmd "$cmd --mem 4G" \
--skip-scoring true --allow-partial false \
--extra-left-context $extra_left_context \
Expand All @@ -154,7 +159,7 @@ fi

frame_shift_opt=
if [ -f $srcdir/frame_subsampling_factor ]; then
frame_shift_opt="--frame-shift=0.0$(cat $srcdir/frame_subsampling_factor)"
frame_shift_opt="--frame-shift 0.0$(cat $srcdir/frame_subsampling_factor)"
fi

if [ $stage -le 4 ]; then
Expand Down
9 changes: 7 additions & 2 deletions egs/wsj/s5/steps/cleanup/segment_long_utterances_nnet3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ beam=15.0
lattice_beam=1.0
lmwt=10

acwt=0.1 # Just a default value, used for adaptation and beam-pruning..
post_decode_acwt=1.0 # can be used in 'chain' systems to scale acoustics by 10 so the
# regular scoring script works.

# Contexts must ideally match training
extra_left_context=0 # Set to some large value, typically 40 for LSTM (must match training)
extra_right_context=0
Expand All @@ -53,7 +57,7 @@ frames_per_chunk=150
# i-vector options
extractor= # i-Vector extractor. If provided, will extract i-vectors.
# Required if the network was trained with i-vector extractor.
use_vad= # Use energy-based VAD for i-vector extraction
use_vad=false # Use energy-based VAD for i-vector extraction

# TF-IDF similarity search options
max_words=1000
Expand Down Expand Up @@ -263,6 +267,7 @@ if [ $stage -le 5 ]; then
echo "$0: Decoding with biased language models..."

steps/cleanup/decode_segmentation_nnet3.sh \
--acwt $acwt --post-decode-acwt $post_decode_acwt \
--beam $beam --lattice-beam $lattice_beam --nj $nj --cmd "$cmd --mem 4G" \
--skip-scoring true --allow-partial false \
--extra-left-context $extra_left_context \
Expand All @@ -276,7 +281,7 @@ fi

frame_shift_opt=
if [ -f $srcdir/frame_subsampling_factor ]; then
frame_shift_opt="--frame-shift=0.0$(cat $srcdir/frame_subsampling_factor)"
frame_shift_opt="--frame-shift 0.0$(cat $srcdir/frame_subsampling_factor)"
fi

if [ $stage -le 6 ]; then
Expand Down