flashlight / wav2letter

Facebook AI Research's Automatic Speech Recognition Toolkit
https://github.com/facebookresearch/wav2letter/wiki
Other
6.37k stars 1.01k forks source link

Not recognising first short word #742

Open omprakashsonie opened 4 years ago

omprakashsonie commented 4 years ago

I am using CTC-Transformer architecture for English and Hindi speech.

For example it is missing:

Dataset: About 35k of English/Hindi short sentences Using word piece 5k

Configuration: --am=/w2l-libri-local/sota-livai/am_transformer_seq2seq_livai-10july12pm/120/001_model_last.bin --tokensdir=/w2l-libri-local/sota-livai/am --tokens=livai-train-all-unigram-5000.tokens --lexicon=/w2l-libri-local/sota-livai/am/livai-train+dev-unigram-5000-nbest10.lexicon --lm=/w2l-libri-local/sota-livai/decoder/ngram_models/grocery_3gram-lm.binary --datadir=/w2l-libri-local/sota-livai/lists --test=test-grocery-s2r-clean-en-2k.lst --uselexicon=true --sclite=sclite_livai_decode_transformer_ctc_ngram_other-dev29-75iter_model_dev-other-11july --decodertype=wrd --lmtype=kenlm --silscore=0 --beamsize=500 --beamsizetoken=100 --beamthreshold=100 --nthread_decoder=4 --smearing=max --show --showletters --lmweight=0.6 --wordscore=1.4710204244326

tlikhomanenko commented 4 years ago

Am I understand that it missing words with upper-case? or do you have all lower-cased words?

omprakashsonie commented 4 years ago

Thanks a lot Tatiana, It is in Hindi langauge, I have provided few examples:

for I: I is equal to अाई (first word, marked in bold) |T|: अाई नीड टू बाय मेक अप कलर किक काजल पेंसिल |P|: नीड टू बाय मी काजल पेंसिल |t|: अ ा ई न ी ड ट ू ब ा य म े क अ प क ल र क ि क क ा ज ल प े ं स ि ल |p|: न ी ड ट ू ब ा य म ी क ा ज ल प े ं स ि ल

|T|: अाई वान्ट टू रिमूव दी आइटम नंबर सेकंड फ्रॉम माई कार्ट |P|: वांट टू रिमूव दी आइटम नंबर सेकंड फ्रॉम माई कार्ट |t|: अ ा ई व ा न ् ट ट ू र ि म ू व द ी आ इ ट म न ं ब र स े क ं ड फ ् र ॉ म म ा ई क ा र ् ट |p|: व ा ं ट ट ू र ि म ू व द ी आ इ ट म न ं ब र स े क ं ड फ ् र ॉ म म ा ई _ क ा र ् ट

for: Add Add = ऐड (first word marked bold)

|T|: ऐड क्रीमी चीज चिप्स इंटू माई कार्ट |P|: क्रीमी चीज चिप्स इंटू टू माई कार्ट |t|: ऐ ड क ् र ी म ी च ी ज च ि प ् स इ ं ट ू म ा ई क ा र ् ट |p|: क ् र ी म ी च ी ज च ि प ् स इ ं ट ू ट ू म ा ई क ा र ् ट

for show: show = शो (first word marked bold) |T|: शो मी ऑल बेबी सोप |P|: मी मी ऑल बेबी सोप |t|: श ो म ी ऑ ल ब े ब ी स ो प |p|: म ी ऑ ल ब े ब ी _ स ो प

Kindly let me know if you need more inputs.

tlikhomanenko commented 4 years ago

Could you post head of your tokens set and lexicon?

lunixbochs commented 4 years ago

FWIW I've found wav2letter models perform better with short inputs if you train them on short inputs. My high-performing english models have been trained on hundreds of thousands of clips of single word length.

If you're dropping words from longer clips, that's often the language model's fault, or your training data alignment might be poor. Try with both Test and Decoder, and maybe a ZeroLM decode (--lm='')

tlikhomanenko commented 4 years ago

Yep, so at first you can check Viterbi only with Test to see if the acoustic model itself have this problem. One thing is you are using lexicon-based decoder, but I guess it should be lexicon free. So here could be the problem of first word generation due to lexicon. Do you have this problem only with short words or for every first word in each sample?

omprakashsonie commented 4 years ago

Hi Tatiana, It is not for all short words. It is not for 1st word in each sample. See below correct predictions.

|T|: दस किलो मधुर शुगर |P|: दस किलो मधुर शुगर |t|: द स क ि ल ो म ध ु र श ु ग र |p|: द स क ि ल ो म ध ु र श ु ग र WER: 0%

|T|: बीस के जी का आटा |P|: बीस के जी का आटा |t|: ब ी स क े ज ी क ा आ ट ा |p|: ब ी स क े ज ी क ा आ ट ा WER: 0%

Here are tokens and lexicon: head train-all-unigram-5000.tokens _टू _अ ाई _के _है _ऐड _का _ऑफ _मी _कार्ट

tail train-all-unigram-5000.tokens ाऊ ृ ः ऋ ऱ ऍ औ ऐ ऑ ॉ

head train-unigram-5000-nbest10.lexicon अ अ अ अ अंकल _अ ंकल अंकल _अ ंक ल अंकल अ ं क ल अंकल अ ंकल अंकल अ ंक ल अंकल अ ं क ल अंकित _अ ंक ित अंकित _अ ं क ित

omprakashsonie commented 4 years ago

Thanks a lot Ryan. Will try your suggestions.