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

Cosmetic and other minor fixes for segmentation #1784

Merged
merged 70 commits into from Aug 3, 2017
Merged
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
58fcd61
long_utts: Minor fix
vimalmanohar May 18, 2017
df90bba
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar May 19, 2017
ff4ac04
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar May 20, 2017
29ced2a
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar May 21, 2017
0f69bbd
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar May 22, 2017
143877b
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar May 23, 2017
acf4c14
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar May 24, 2017
f887582
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar May 25, 2017
a5d4ca8
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar May 26, 2017
ea930eb
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar May 27, 2017
8f05cdf
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar May 28, 2017
1eb41ee
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar May 30, 2017
79e15ad
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar May 31, 2017
61e94b2
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar Jun 1, 2017
d45ecb9
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar Jun 2, 2017
7b01bb0
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar Jun 3, 2017
e1de4e4
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar Jun 8, 2017
41952cd
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar Jun 9, 2017
6ad6533
asr_sad: Squashing commits
vimalmanohar Jun 9, 2017
a1b07a2
asr_sad: Making some changes based on comments
vimalmanohar Jun 10, 2017
85345ad
asr_sad: Fixing some more issues
vimalmanohar Jun 10, 2017
7df4513
sad_asr: Fixed frame skip
vimalmanohar Jun 10, 2017
bbd9632
asr_sad: Removing some old files
vimalmanohar Jun 10, 2017
8bf583e
asr_sad: Fixed bug
vimalmanohar Jun 10, 2017
2e2b3d1
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar Jun 11, 2017
51c32f7
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar Jun 14, 2017
a5ed583
sad: Fixing resolve_ctm_overlaps
vimalmanohar Jun 14, 2017
232397e
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar Jun 15, 2017
1414f6f
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar Jun 16, 2017
c65ef65
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar Jun 17, 2017
ff0e9cd
asr_sad: Modifying graph
vimalmanohar Jun 17, 2017
20cf238
Merge branch 'master' of github.com:kaldi-asr/kaldi
vimalmanohar Jun 20, 2017
0b29422
asr-sad: Get targets from phone arcs
vimalmanohar Jun 20, 2017
6c534ac
sad: Merge with master
vimalmanohar Jun 20, 2017
2776f0a
sad: Partial changes based on comments
vimalmanohar Jun 21, 2017
1c28dac
sad: cleaning up some scripts
vimalmanohar Jun 21, 2017
87ecd3e
asr_sad: Add merge_targets_dirs.sh
vimalmanohar Jun 21, 2017
cac64b6
Merge branch 'master' of github.com:kaldi-asr/kaldi into asr_sad
vimalmanohar Jun 21, 2017
90f96a1
asr_sad: Removing references to smart_open
vimalmanohar Jun 21, 2017
18a075e
asr_sad: Minor bug fixes
vimalmanohar Jun 21, 2017
cd76251
asr_sad: Converting back to smart_open
vimalmanohar Jun 21, 2017
d488b63
Various bug fixes
vimalmanohar Jun 23, 2017
5ea809d
asr_sad: Temporary fix to deal with numpy array
vimalmanohar Jun 23, 2017
2b29410
asr_sad: Address various comments
vimalmanohar Jun 23, 2017
15f1064
asr_sad: Add some comments
vimalmanohar Jun 23, 2017
0cee1b6
asr_sad: Bug fix and fix obvious standards violation
vimalmanohar Jun 26, 2017
446f462
asr_sad: temporary fix to merge_targets.py
vimalmanohar Jun 28, 2017
811ff7a
asr_sad: Removing scp2ark option
vimalmanohar Jun 29, 2017
7ee8f05
Bug fixes and missing files added
vimalmanohar Jun 30, 2017
d898add
sad: Addressing comments
vimalmanohar Jul 10, 2017
787b964
sad: Addressed all comments
vimalmanohar Jul 10, 2017
c24261e
sad: Fixed bug in merge-targets.py
vimalmanohar Jul 11, 2017
a1f3d5d
sad: Minor fix in renorm layer
vimalmanohar Jul 11, 2017
d8f5997
Merging from master
vimalmanohar Jul 11, 2017
ff41174
sad: Minor fixes
vimalmanohar Jul 11, 2017
c4a6aa3
sad: Forcing features to be plp
vimalmanohar Jul 11, 2017
dc5b545
sad : Minor fixes
vimalmanohar Jul 13, 2017
be46861
sad: Fixing changes based on comments
vimalmanohar Jul 14, 2017
4d0555d
sad: Fixed bugs
vimalmanohar Jul 14, 2017
1160429
sad: Add more checks
vimalmanohar Jul 14, 2017
c6e10a6
sad: Creating prepare_targets script in steps
vimalmanohar Jul 16, 2017
450a385
Merging golden master
vimalmanohar Jul 16, 2017
2f5bf5d
sad: Minor fixes
vimalmanohar Jul 19, 2017
1918c9d
asr_sad: minor bug fixes
vimalmanohar Jul 20, 2017
29f88ee
asr_sad: Minor bug fix in resolving ctm overlaps
vimalmanohar Jul 25, 2017
e8c0949
asr_sad: Adding recipe for switchboard
vimalmanohar Jul 25, 2017
759640f
asr_sad: Changes based on comments
vimalmanohar Jul 31, 2017
bec03e7
Removing segmentation related changes
vimalmanohar Jul 31, 2017
4abdf3e
asr_sad_prepare: Addressed all the comments.
vimalmanohar Aug 1, 2017
c7f4c7a
asr_sad_prepare: Minor changes
vimalmanohar Aug 2, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions egs/aspire/s5/local/multi_condition/get_ctm.sh
Expand Up @@ -7,8 +7,7 @@ decode_mbr=true
filter_ctm_command=cp
glm=
stm=
window=10
overlap=5
resolve_overlaps=true
[ -f ./path.sh ] && . ./path.sh
. parse_options.sh || exit 1;

Expand Down Expand Up @@ -61,11 +60,16 @@ lattice-align-words-lexicon --output-error-lats=true --output-if-empty=true --ma
$lang/phones/align_lexicon.int $model ark:- ark:- | \
lattice-to-ctm-conf $frame_shift_opt --decode-mbr=$decode_mbr ark:- $decode_dir/score_$LMWT/penalty_$wip/ctm.overlapping || exit 1;

ctm=$decode_dir/score_$LMWT/penalty_$wip/ctm.overlapping
# combine the segment-wise ctm files, while resolving overlaps
python local/multi_condition/resolve_ctm_overlaps.py --overlap $overlap --window-length $window $data_dir/utt2spk $decode_dir/score_$LMWT/penalty_$wip/ctm.overlapping $decode_dir/score_$LMWT/penalty_$wip/ctm.merged || exit 1;
merged_ctm=$decode_dir/score_$LMWT/penalty_$wip/ctm.merged
if $resolve_overlaps; then
utils/ctm/resolve_ctm_overlaps.py $data_dir/segments \
$decode_dir/score_$LMWT/penalty_$wip/ctm.overlapping \
$decode_dir/score_$LMWT/penalty_$wip/ctm.merged || exit 1;
ctm=$decode_dir/score_$LMWT/penalty_$wip/ctm.merged
fi

cat $merged_ctm | utils/int2sym.pl -f 5 $lang/words.txt | \
cat $ctm | utils/int2sym.pl -f 5 $lang/words.txt | \
utils/convert_ctm.pl $data_dir/segments $data_dir/reco2file_and_channel | \
sort -k1,1 -k2,2 -k3,3nb > $decode_dir/score_$LMWT/penalty_$wip/ctm || exit 1;
# Remove some stuff we don't want to score, from the ctm.
Expand Down
100 changes: 0 additions & 100 deletions egs/aspire/s5/local/multi_condition/resolve_ctm_overlaps.py

This file was deleted.

9 changes: 4 additions & 5 deletions egs/aspire/s5/local/score_aspire.sh
Expand Up @@ -14,10 +14,9 @@ word_ins_penalties=0.0,0.25,0.5,0.75,1.0
default_wip=0.0
ctm_beam=6
decode_mbr=true
window=30
overlap=5
cmd=run.pl
stage=1
resolve_overlaps=true
tune_hyper=true # if true:
# if the data set is "dev_aspire" we check for the
# best lmwt and word_insertion_penalty,
Expand Down Expand Up @@ -89,7 +88,7 @@ if $tune_hyper ; then
# or use the default values

if [ $stage -le 1 ]; then
if [ "$act_data_set" == "dev_aspire" ]; then
if [[ "$act_data_set" =~ "dev_aspire" ]]; then
wip_string=$(echo $word_ins_penalties | sed 's/,/ /g')
temp_wips=($wip_string)
$cmd WIP=1:${#temp_wips[@]} $decode_dir/scoring/log/score.wip.WIP.log \
Expand All @@ -98,8 +97,8 @@ if $tune_hyper ; then
echo \$wip \&\& \
$cmd LMWT=$min_lmwt:$max_lmwt $decode_dir/scoring/log/score.LMWT.\$wip.log \
local/multi_condition/get_ctm.sh --filter-ctm-command "$filter_ctm_command" \
--window $window --overlap $overlap \
--beam $ctm_beam --decode-mbr $decode_mbr \
--resolve-overlaps $resolve_overlaps \
--glm data/${act_data_set}/glm --stm data/${act_data_set}/stm \
LMWT \$wip $lang data/${segmented_data_set}_hires $model $decode_dir || exit 1;

Expand All @@ -124,7 +123,7 @@ wipfile.close()
fi


if [ "$act_data_set" == "test_aspire" ] || [ "$act_data_set" == "eval_aspire" ]; then
if [[ "$act_data_set" =~ "test_aspire" ]] || [[ "$act_data_set" =~ "eval_aspire" ]]; then
# check for the best values from dev_aspire decodes
dev_decode_dir=$(echo $decode_dir|sed "s/test_aspire/dev_aspire_whole/g; s/eval_aspire/dev_aspire_whole/g")
if [ -f $dev_decode_dir/scoring/bestLMWT ]; then
Expand Down
1 change: 1 addition & 0 deletions egs/aspire/s5/path.sh
Expand Up @@ -2,4 +2,5 @@ export KALDI_ROOT=`pwd`/../../..
export PATH=$PWD/utils/:$KALDI_ROOT/tools/openfst/bin:$PWD:$PATH
[ ! -f $KALDI_ROOT/tools/config/common_path.sh ] && echo >&2 "The standard file $KALDI_ROOT/tools/config/common_path.sh is not present -> Exit!" && exit 1
. $KALDI_ROOT/tools/config/common_path.sh
export PATH=$KALDI_ROOT/tools/sctk/bin:$PATH
export LC_ALL=C
4 changes: 2 additions & 2 deletions egs/babel/s5d/cmd.sh
Expand Up @@ -7,8 +7,8 @@

#a) JHU cluster options
export train_cmd="queue.pl -l arch=*64"
export decode_cmd="queue.pl -l arch=*64,mem_free=2G,ram_free=2G"
export mkgraph_cmd="queue.pl -l arch=*64,ram_free=4G,mem_free=4G"
export decode_cmd="queue.pl --mem 4G"
export mkgraph_cmd="queue.pl --mem 4G"

#export cuda_cmd="..."

Expand Down
2 changes: 1 addition & 1 deletion egs/babel/s5d/conf/common.limitedLP
Expand Up @@ -38,7 +38,7 @@ use_pitch=true
lmwt_plp_extra_opts=( --min-lmwt 8 --max-lmwt 12 )
lmwt_bnf_extra_opts=( --min-lmwt 15 --max-lmwt 22 )
lmwt_dnn_extra_opts=( --min-lmwt 10 --max-lmwt 15 )

lmwt_chain_extra_opts=( --min-lmwt 8 --max-lmwt 12 )
dnn_beam=16.0
dnn_lat_beam=8.5

Expand Down
25 changes: 23 additions & 2 deletions egs/babel/s5d/local/lattice_to_ctm.sh
Expand Up @@ -10,6 +10,13 @@ word_ins_penalty=0.5
min_lmwt=7
max_lmwt=17
model=
resolve_overlaps=false # If true, the words decoded in the regions where
# two segments A and B are overlapping are resolved
# such that only words before the mid-point of the
# overlapping region are taken to be hypothesized for
# segment A, and only words after the mid-point of
# the overlapping region are taken to be
# hypothesized for segment B.

#end configuration section.

Expand Down Expand Up @@ -43,10 +50,22 @@ for f in $lang/words.txt $model $data/segments $data/reco2file_and_channel $dir/
[ ! -f $f ] && echo "$0: expecting file $f to exist" && exit 1;
done

if [ -f $dir/../frame_subsampling_factor ]; then
factor=$(cat $dir/../frame_subsampling_factor) || exit 1
frame_shift_opt="--frame-shift=0.0$factor"
echo "$0: $dir/../frame_subsampling_factor exists, using $frame_shift_opt"
fi

name=`basename $data`; # e.g. eval2000

mkdir -p $dir/scoring/log

resolve_overlaps_cmd="cat"

if $resolve_overlaps; then
resolve_overlaps_cmd="utils/ctm/resolve_ctm_overlaps.py $data/segments - -"
fi

if [ $stage -le 0 ]; then
if [ ! -f $lang/phones/word_boundary.int ] ; then
$cmd LMWT=$min_lmwt:$max_lmwt $dir/scoring/log/get_ctm.LMWT.log \
Expand All @@ -56,8 +75,9 @@ if [ $stage -le 0 ]; then
lattice-add-penalty --word-ins-penalty=$word_ins_penalty ark:- ark:- \| \
lattice-prune --beam=$beam ark:- ark:- \| \
lattice-align-words-lexicon $lang/phones/align_lexicon.int $model ark:- ark:- \| \
lattice-to-ctm-conf --decode-mbr=$decode_mbr ark:- - \| \
lattice-to-ctm-conf $frame_shift_opt --decode-mbr=$decode_mbr ark:- - \| \
utils/int2sym.pl -f 5 $lang/words.txt \| tee $dir/score_LMWT/$name.utt.ctm \| \
$resolve_overlaps_cmd \| \
utils/convert_ctm.pl $data/segments $data/reco2file_and_channel \
'>' $dir/score_LMWT/$name.ctm || exit 1;
else
Expand All @@ -68,8 +88,9 @@ if [ $stage -le 0 ]; then
lattice-add-penalty --word-ins-penalty=$word_ins_penalty ark:- ark:- \| \
lattice-prune --beam=$beam ark:- ark:- \| \
lattice-align-words $lang/phones/word_boundary.int $model ark:- ark:- \| \
lattice-to-ctm-conf --decode-mbr=$decode_mbr ark:- - \| \
lattice-to-ctm-conf $frame_shift_opt --decode-mbr=$decode_mbr ark:- - \| \
utils/int2sym.pl -f 5 $lang/words.txt \| tee $dir/score_LMWT/$name.utt.ctm \| \
$resolve_overlaps_cmd \| \
utils/convert_ctm.pl $data/segments $data/reco2file_and_channel \
'>' $dir/score_LMWT/$name.ctm || exit 1;
fi
Expand Down
6 changes: 5 additions & 1 deletion egs/babel/s5d/local/run_kws_stt_task2.sh
Expand Up @@ -32,6 +32,10 @@ extra_kws=false
cmd=run.pl
max_states=150000
wip=0.5 #Word insertion penalty
resolve_overlaps=false # Set this to true, if there are overlapping segments
# as input and the words in the CTM in the
# overlapping regions must be resolved to one
# of the segments.
#End of options

if [ $(basename $0) == score.sh ]; then
Expand All @@ -56,7 +60,7 @@ decode_dir=$3;
if ! $skip_stt ; then
if [ ! -f $decode_dir/.score.done ] && [ ! -f $decode_dir/.done.score ]; then
local/lattice_to_ctm.sh --cmd "$cmd" --word-ins-penalty $wip \
--min-lmwt ${min_lmwt} --max-lmwt ${max_lmwt} \
--min-lmwt ${min_lmwt} --max-lmwt ${max_lmwt} --resolve-overlaps $resolve_overlaps \
$data_dir $lang_dir $decode_dir

if ! $skip_scoring ; then
Expand Down
5 changes: 2 additions & 3 deletions egs/babel/s5d/path.sh
@@ -1,7 +1,6 @@
export KALDI_ROOT=/export/a09/jtrmal/kaldi/
export KALDI_ROOT=../../..
. $KALDI_ROOT/tools/env.sh
. /export/a09/jtrmal/kaldi-current/tools/env.sh
. /export/babel/data/software/env.sh
. /export/babel/data/software/env.sh
export PATH=$PWD/utils/:$KALDI_ROOT/tools/sph2pipe_v2.5/:$KALDI_ROOT/src/bin:$KALDI_ROOT/tools/openfst/bin:$KALDI_ROOT/src/fstbin/:$KALDI_ROOT/src/gmmbin/:$KALDI_ROOT/src/featbin/:$KALDI_ROOT/src/lm/:$KALDI_ROOT/src/sgmmbin/:$KALDI_ROOT/src/sgmm2bin/:$KALDI_ROOT/src/fgmmbin/:$KALDI_ROOT/src/latbin/:$KALDI_ROOT/src/nnet3bin:$KALDI_ROOT/src/nnetbin:$KALDI_ROOT/src/nnet2bin/:$KALDI_ROOT/src/online2bin:$KALDI_ROOT/src/ivectorbin:$KALDI_ROOT/src/kwsbin:$PWD:$PATH
export LC_ALL=C

8 changes: 7 additions & 1 deletion egs/babel/s5d/run-4-anydecode.sh
Expand Up @@ -232,13 +232,17 @@ if [ ! -f $dataset_dir/.done ] ; then
elif [ "$dataset_segments" == "train" ] ||\
[ "$dataset_segments" == "pem" ]; then
. ./local/datasets/supervised_pem.sh || exit 1
elif [[ $dataset_segments =~ seg* ]]; then
echo "Using ${dataset_dir} directly"
else
echo "Unknown type of the dataset: \"$dataset_segments\"!";
echo "Valid dataset types are: seg, uem, pem";
exit 1
fi
elif [ "$dataset_kind" == "unsupervised" ] ; then
if [ "$dataset_segments" == "seg" ] ; then
if [ "$dataset_segments" == "seg" ]; then
. ./local/datasets/unsupervised_seg.sh
elif [[ $dataset_segments =~ *seg* ]]; then
. ./local/datasets/unsupervised_seg.sh
elif [ "$dataset_segments" == "uem" ] ; then
. ./local/datasets/unsupervised_uem.sh
Expand All @@ -251,6 +255,8 @@ if [ ! -f $dataset_dir/.done ] ; then
echo "does not really make any sense!"
exit 1
#. ./local/datasets/unsupervised_pem.sh
elif [[ $dataset_segments =~ seg* ]]; then
echo "Using ${dataset_dir} directly"
else
echo "Unknown type of the dataset: \"$dataset_segments\"!";
echo "Valid dataset types are: seg, uem, pem";
Expand Down
5 changes: 1 addition & 4 deletions egs/swbd/s5c/local/score_sclite.sh
Expand Up @@ -38,10 +38,7 @@ for f in $data/stm $data/glm $lang/words.txt $lang/phones/word_boundary.int \
[ ! -f $f ] && echo "$0: expecting file $f to exist" && exit 1;
done

if [ -f $dir/../frame_shift ]; then
frame_shift_opt="--frame-shift=$(cat $dir/../frame_shift)"
echo "$0: $dir/../frame_shift exists, using $frame_shift_opt"
elif [ -f $dir/../frame_subsampling_factor ]; then
if [ -f $dir/../frame_subsampling_factor ]; then
factor=$(cat $dir/../frame_subsampling_factor) || exit 1
frame_shift_opt="--frame-shift=0.0$factor"
echo "$0: $dir/../frame_subsampling_factor exists, using $frame_shift_opt"
Expand Down
8 changes: 4 additions & 4 deletions egs/wsj/s5/steps/compute_cmvn_stats.sh
Expand Up @@ -91,18 +91,18 @@ if $fake; then
! cat $data/spk2utt | awk -v dim=$dim '{print $1, "["; for (n=0; n < dim; n++) { printf("0 "); } print "1";
for (n=0; n < dim; n++) { printf("1 "); } print "0 ]";}' | \
copy-matrix ark:- ark,scp:$cmvndir/cmvn_$name.ark,$cmvndir/cmvn_$name.scp && \
echo "Error creating fake CMVN stats" && exit 1;
echo "Error creating fake CMVN stats. See $logdir/cmvn_$name.log." && exit 1;
elif $two_channel; then
! compute-cmvn-stats-two-channel $data/reco2file_and_channel scp:$data/feats.scp \
ark,scp:$cmvndir/cmvn_$name.ark,$cmvndir/cmvn_$name.scp \
2> $logdir/cmvn_$name.log && echo "Error computing CMVN stats (using two-channel method)" && exit 1;
2> $logdir/cmvn_$name.log && echo "Error computing CMVN stats (using two-channel method). See $logdir/cmvn_$name.log." && exit 1;
elif [ ! -z "$fake_dims" ]; then
! compute-cmvn-stats --spk2utt=ark:$data/spk2utt scp:$data/feats.scp ark:- | \
modify-cmvn-stats "$fake_dims" ark:- ark,scp:$cmvndir/cmvn_$name.ark,$cmvndir/cmvn_$name.scp && \
echo "Error computing (partially fake) CMVN stats" && exit 1;
echo "Error computing (partially fake) CMVN stats. See $logdir/cmvn_$name.log" && exit 1;
else
! compute-cmvn-stats --spk2utt=ark:$data/spk2utt scp:$data/feats.scp ark,scp:$cmvndir/cmvn_$name.ark,$cmvndir/cmvn_$name.scp \
2> $logdir/cmvn_$name.log && echo "Error computing CMVN stats" && exit 1;
2> $logdir/cmvn_$name.log && echo "Error computing CMVN stats. See $logdir/cmvn_$name.log" && exit 1;
fi

cp $cmvndir/cmvn_$name.scp $data/cmvn.scp || exit 1;
Expand Down
24 changes: 22 additions & 2 deletions egs/wsj/s5/steps/decode_nolats.sh
Expand Up @@ -23,7 +23,7 @@ max_active=7000
beam=13.0
lattice_beam=6.0
acwt=0.083333 # note: only really affects pruning (scoring is on lattices).
write_alignments=false
write_alignments=false # The output directory is treated like an alignment directory
write_words=true
# End configuration section.

Expand Down Expand Up @@ -85,9 +85,29 @@ splice_opts=`cat $srcdir/splice_opts 2>/dev/null`
cmvn_opts=`cat $srcdir/cmvn_opts 2>/dev/null`
delta_opts=`cat $srcdir/delta_opts 2>/dev/null`

utils/lang/check_phones_compatible.sh $graphdir/phones.txt $srcdir/phones.txt || exit 1;

if $write_alignments; then
# Copy model and options that are generally expected in an alignment
# directory.
cp $graphdir/phones.txt $dir || exit 1;

cp $srcdir/{tree,final.mdl} $dir || exit 1;
cp $srcdir/final.alimdl $dir 2>/dev/null
cp $srcdir/final.occs $dir;
cp $srcdir/splice_opts $dir 2>/dev/null # frame-splicing options.
cp $srcdir/cmvn_opts $dir 2>/dev/null # cmn/cmvn option.
cp $srcdir/delta_opts $dir 2>/dev/null
fi

case $feat_type in
delta) feats="ark,s,cs:apply-cmvn $cmvn_opts --utt2spk=ark:$sdata/JOB/utt2spk scp:$sdata/JOB/cmvn.scp scp:$sdata/JOB/feats.scp ark:- | add-deltas $delta_opts ark:- ark:- |";;
lda) feats="ark,s,cs:apply-cmvn $cmvn_opts --utt2spk=ark:$sdata/JOB/utt2spk scp:$sdata/JOB/cmvn.scp scp:$sdata/JOB/feats.scp ark:- | splice-feats $splice_opts ark:- ark:- | transform-feats $srcdir/final.mat ark:- ark:- |";;
lda) feats="ark,s,cs:apply-cmvn $cmvn_opts --utt2spk=ark:$sdata/JOB/utt2spk scp:$sdata/JOB/cmvn.scp scp:$sdata/JOB/feats.scp ark:- | splice-feats $splice_opts ark:- ark:- | transform-feats $srcdir/final.mat ark:- ark:- |"
if $write_alignments; then
cp $srcdir/final.mat $dir
cp $srcdir/full.mat $dir 2>/dev/null
fi
;;
*) echo "Invalid feature type $feat_type" && exit 1;
esac
if [ ! -z "$transform_dir" ]; then # add transforms to features...
Expand Down