[go: nahoru, domu]

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

Misleading description in 'fstmakecontextsyms.cc' file #4921

Open
YY-Edwards opened this issue Jun 28, 2024 · 0 comments
Open

Misleading description in 'fstmakecontextsyms.cc' file #4921

YY-Edwards opened this issue Jun 28, 2024 · 0 comments
Labels

Comments

@YY-Edwards
Copy link
  • I think following cmd is incorrect as the 'fstmakecontextfst' needs a phone list that includes disambiguation symbols.

  • But this filter rule will remove all disambiguation symbols(&0, &1) and subsequential-symbol("#$")

(echo " 0"; echo "a 1"; echo "b 2"; echo "#0 3"; echo "#1 4"; echo "#$ 5" ) > phones.txt
( echo 3; echo 4 ) > disambig.list
fstmakecontextfst --read-disambig-syms=disambig.list <(grep -v '#' phones.txt) 5 ilabels.int > C.fst

  • And in "fstmakecontextfst.cc", it adds 'loop_fst' , a loop for each phone and disambiguation symbol.

https://github.com/kaldi-asr/kaldi/blob/master/src/fstbin/fstmakecontextfst.cc#L113
The code is :

// 'loop_fst' will be an acceptor FST with single (initial and final) state, with
// a loop for each phone and disambiguation symbol.
StdVectorFst loop_fst;
loop_fst.AddState(); // Add state zero.
loop_fst.SetStart(0);
loop_fst.SetFinal(0, TropicalWeight::One());
for (size_t i = 0; i < phone_syms.size(); i++) {
int32 sym = phone_syms[i];
loop_fst.AddArc(0, StdArc(sym, sym, TropicalWeight::One(), 0));
}

  • Which means variable 'phone_syms' should includes phone and disambiguation symbols.
  • So grep -v "#\\$" phones.txt should work, Or change the example to "echo "$ 5""
@YY-Edwards YY-Edwards added the bug label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant