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

Iam #2658

Merged
merged 38 commits into from
Sep 12, 2018
Merged

Iam #2658

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a3a18e2
adding changes for language modelling
aarora8 Aug 30, 2018
91508b5
adding modifications for augmentation, topology, shearing, run.sh
aarora8 Aug 31, 2018
5f273d6
fixing bugs
aarora8 Aug 31, 2018
2645f14
fixing bug
aarora8 Aug 31, 2018
6ebfdb2
adding parameter tuning
aarora8 Sep 1, 2018
b532978
cosmetic fixes and updating results
aarora8 Sep 1, 2018
f383334
cosmetic fixes
aarora8 Sep 1, 2018
44c9e58
adding results
aarora8 Sep 1, 2018
2d11672
removing local/prepare_lang and adding gen_topo in run.sh
aarora8 Sep 1, 2018
4fc6705
fixing bugs
aarora8 Sep 1, 2018
8877530
updating result
aarora8 Sep 2, 2018
59e2c8b
updating documentation, results and parameter tuning
aarora8 Sep 2, 2018
5fc0d17
fixing chain scripts
aarora8 Sep 2, 2018
1138ee3
updating parameters
aarora8 Sep 2, 2018
b3532ce
updating parameters and results
aarora8 Sep 3, 2018
9b67d9d
adding overwrite option and punctuation topology
aarora8 Sep 3, 2018
89c9ec7
adding overwrite option
aarora8 Sep 4, 2018
c05cd4d
adding aachen splits
aarora8 Sep 4, 2018
5dfe8fc
fixing bugs
aarora8 Sep 4, 2018
d7448df
modification from review
aarora8 Sep 5, 2018
d7d5c22
updating parameter and result
aarora8 Sep 6, 2018
43e9af9
updating parameter and result
aarora8 Sep 6, 2018
17c506b
adding data preprocessing in test and val
aarora8 Sep 7, 2018
d640742
updating results
aarora8 Sep 7, 2018
7dfd0b5
Merge branch 'master' of https://github.com/kaldi-asr/kaldi into iam_4
aarora8 Sep 7, 2018
94a80ad
replacing prepend words with common prepend words
aarora8 Sep 7, 2018
711c3c9
updating remove_test_utterances_from_lob for aachen split
aarora8 Sep 7, 2018
5f2d960
removing data/val/text from train_lm
aarora8 Sep 7, 2018
7f2ad0b
cosmetic fixes in unk arc decoding
aarora8 Sep 7, 2018
8f2ac25
adding val data for decoding
aarora8 Sep 7, 2018
b8e71b2
modification from the review
aarora8 Sep 10, 2018
e9a75f6
modification from review
aarora8 Sep 10, 2018
ae674ed
modification from review
aarora8 Sep 10, 2018
7651f37
modification for downloading aachen splits
aarora8 Sep 10, 2018
417d97c
fixing bug in rescoring
aarora8 Sep 11, 2018
6a86531
hardcoding for removing only remaining long utterence
aarora8 Sep 12, 2018
ba07ff0
fix in hardcoding
aarora8 Sep 12, 2018
5398412
modification from review
aarora8 Sep 12, 2018
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
Prev Previous commit
Next Next commit
adding overwrite option
  • Loading branch information
aarora8 committed Sep 4, 2018
commit 89c9ec79ff7dce369d1c5e1c030ef225bae053e2
44 changes: 26 additions & 18 deletions egs/iam/v2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ wellington_database=/export/corpora5/Wellington/WWC/
./local/check_tools.sh

if [ $stage -le 0 ]; then
if [ -f data/train/text ] && ! $overwrite; then
echo "Not processing, probably script have run from wrong stage"
echo "Exiting with status 1 to avoid data corruption"
exit 1;
fi
fi

if [ $stage -le 1 ]; then
echo "$0: Preparing data..."
local/prepare_data.sh --download-dir "$iam_database" \
--wellington-dir "$wellington_database" \
Expand All @@ -39,8 +47,8 @@ if [ $stage -le 0 ]; then
fi
mkdir -p data/{train,test}/data

if [ $stage -le 1 ]; then
echo "$(date) stage 1: getting allowed image widths for e2e training..."
if [ $stage -le 2 ]; then
echo "$(date) stage 2: getting allowed image widths for e2e training..."
image/get_image2num_frames.py --feat-dim 40 data/train # This will be needed for the next command
# The next command creates a "allowed_lengths.txt" file in data/train
# which will be used by local/make_features.py to enforce the images to
Expand All @@ -54,15 +62,15 @@ if [ $stage -le 1 ]; then
image/fix_data_dir.sh data/train
fi

if [ $stage -le 2 ]; then
if [ $stage -le 3 ]; then
for set in train; do
echo "$(date) stage 2: Performing augmentation, it will double training data"
echo "$(date) stage 3: Performing augmentation, it will double training data"
local/augment_data.sh --nj $nj --cmd "$cmd" --feat-dim 40 data/${set} data/${set}_aug data
steps/compute_cmvn_stats.sh data/${set}_aug || exit 1;
done
fi

if [ $stage -le 2 ]; then
if [ $stage -le 4 ]; then
echo "$0: Preparing BPE..."
# getting non-silence phones.
cut -d' ' -f2- data/train/text | \
Expand Down Expand Up @@ -96,12 +104,12 @@ END
done
fi

if [ $stage -le 3 ]; then
if [ $stage -le 5 ]; then
echo "$0: Estimating a language model for decoding..."
local/train_lm.sh
fi

if [ $stage -le 4 ]; then
if [ $stage -le 6 ]; then
echo "$0: Preparing dictionary and lang..."
local/prepare_dict.sh
# This recipe uses byte-pair encoding, the silences are part of the words' pronunciations.
Expand All @@ -119,34 +127,34 @@ if [ $stage -le 4 ]; then
data/lang data/lang_rescore_6g
fi

if [ $stage -le 5 ]; then
if [ $stage -le 7 ]; then
steps/train_mono.sh --nj $nj --cmd $cmd --totgauss 10000 data/train_aug \
data/lang exp/mono
fi

if [ $stage -le 6 ] && $decode_gmm; then
if [ $stage -le 8 ] && $decode_gmm; then
utils/mkgraph.sh --mono data/lang_test exp/mono exp/mono/graph

steps/decode.sh --nj $nj --cmd $cmd exp/mono/graph data/test \
exp/mono/decode_test
fi

if [ $stage -le 7 ]; then
if [ $stage -le 9 ]; then
steps/align_si.sh --nj $nj --cmd $cmd data/train_aug data/lang \
exp/mono exp/mono_ali

steps/train_deltas.sh --cmd $cmd 500 20000 data/train_aug data/lang \
exp/mono_ali exp/tri
fi

if [ $stage -le 8 ] && $decode_gmm; then
if [ $stage -le 10 ] && $decode_gmm; then
utils/mkgraph.sh data/lang exp/tri exp/tri/graph

steps/decode.sh --nj $nj --cmd $cmd exp/tri/graph data/test \
exp/tri/decode_test
fi

if [ $stage -le 9 ]; then
if [ $stage -le 11 ]; then
steps/align_si.sh --nj $nj --cmd $cmd data/train_aug data/lang \
exp/tri exp/tri_ali

Expand All @@ -155,38 +163,38 @@ if [ $stage -le 9 ]; then
data/train_aug data/lang exp/tri_ali exp/tri2
fi

if [ $stage -le 10 ] && $decode_gmm; then
if [ $stage -le 12 ] && $decode_gmm; then
utils/mkgraph.sh data/lang exp/tri2 exp/tri2/graph

steps/decode.sh --nj $nj --cmd $cmd exp/tri2/graph \
data/test exp/tri2/decode_test
fi

if [ $stage -le 11 ]; then
if [ $stage -le 13 ]; then
steps/align_fmllr.sh --nj $nj --cmd $cmd --use-graphs true \
data/train_aug data/lang exp/tri2 exp/tri2_ali

steps/train_sat.sh --cmd $cmd 500 20000 \
data/train_aug data/lang exp/tri2_ali exp/tri3
fi

if [ $stage -le 12 ] && $decode_gmm; then
if [ $stage -le 14 ] && $decode_gmm; then
utils/mkgraph.sh data/lang exp/tri3 exp/tri3/graph

steps/decode_fmllr.sh --nj $nj --cmd $cmd exp/tri3/graph \
data/test exp/tri3/decode_test
fi

if [ $stage -le 13 ]; then
if [ $stage -le 15 ]; then
steps/align_fmllr.sh --nj $nj --cmd $cmd --use-graphs true \
data/train_aug data/lang exp/tri3 exp/tri3_ali
fi

if [ $stage -le 14 ]; then
if [ $stage -le 16 ]; then
local/chain/run_cnn.sh --train_set train_aug
fi

if [ $stage -le 15 ]; then
if [ $stage -le 17 ]; then
local/chain/run_cnn_chainali.sh --train_set train_aug \
--chain-model-dir exp/chain/cnn_1a --stage 2
fi
28 changes: 18 additions & 10 deletions egs/iam/v2/run_end2end.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ wellington_database=/export/corpora5/Wellington/WWC/
./local/check_tools.sh

if [ $stage -le 0 ]; then
if [ -f data/train/text ] && ! $overwrite; then
echo "Not processing, probably script have run from wrong stage"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget $0. Also I'm not sure how this will help if someone calls this script from stage 1, maybe you meant to put this check in stage 1 (before echo "$0: Preparing data...")?

echo "Exiting with status 1 to avoid data corruption"
exit 1;
fi
fi

if [ $stage -le 1 ]; then
echo "$0: Preparing data..."
local/prepare_data.sh --download-dir "$iam_database" \
--wellington-dir "$wellington_database" \
Expand All @@ -36,8 +44,8 @@ if [ $stage -le 0 ]; then
fi

mkdir -p data/{train,test}/data
if [ $stage -le 1 ]; then
echo "$(date) stage 1: getting allowed image widths for e2e training..."
if [ $stage -le 2 ]; then
echo "$(date) stage 2: getting allowed image widths for e2e training..."
image/get_image2num_frames.py --feat-dim 40 data/train # This will be needed for the next command
# The next command creates a "allowed_lengths.txt" file in data/train
# which will be used by local/make_features.py to enforce the images to
Expand All @@ -51,15 +59,15 @@ if [ $stage -le 1 ]; then
image/fix_data_dir.sh data/train
fi

if [ $stage -le 2 ]; then
if [ $stage -le 3 ]; then
for set in train; do
echo "$(date) stage 2: Performing augmentation, it will double training data"
echo "$(date) stage 3: Performing augmentation, it will double training data"
local/augment_data.sh --nj $nj --cmd "$cmd" --feat-dim 40 data/${set} data/${set}_aug data
steps/compute_cmvn_stats.sh data/${set}_aug || exit 1;
done
fi

if [ $stage -le 2 ]; then
if [ $stage -le 4 ]; then
echo "$0: Preparing BPE..."
# getting non-silence phones.
cut -d' ' -f2- data/train/text | \
Expand Down Expand Up @@ -93,12 +101,12 @@ END
done
fi

if [ $stage -le 3 ]; then
if [ $stage -le 5 ]; then
echo "$0: Estimating a language model for decoding..."
local/train_lm.sh
fi

if [ $stage -le 4 ]; then
if [ $stage -le 6 ]; then
echo "$0: Preparing dictionary and lang..."
local/prepare_dict.sh
# This recipe uses byte-pair encoding, the silences are part of the words' pronunciations.
Expand All @@ -116,20 +124,20 @@ if [ $stage -le 4 ]; then
data/lang data/lang_rescore_6g
fi

if [ $stage -le 5 ]; then
if [ $stage -le 7 ]; then
echo "$0: Calling the flat-start chain recipe..."
local/chain/run_e2e_cnn.sh --train_set train_aug
fi

if [ $stage -le 6 ]; then
if [ $stage -le 8 ]; then
echo "$0: Aligning the training data using the e2e chain model..."
steps/nnet3/align.sh --nj 50 --cmd "$cmd" \
--use-gpu false \
--scale-opts '--transition-scale=1.0 --self-loop-scale=1.0 --acoustic-scale=1.0' \
data/train_aug data/lang exp/chain/e2e_cnn_1a exp/chain/e2e_ali_train
fi

if [ $stage -le 7 ]; then
if [ $stage -le 9 ]; then
echo "$0: Building a tree and training a regular chain model using the e2e alignments..."
local/chain/run_cnn_e2eali.sh --train_set train_aug
fi