Skip to content

Misleading description in 'fstmakecontextsyms.cc' file #4921

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

Open
YY-Edwards opened this issue Jun 28, 2024 · 1 comment
Open

Misleading description in 'fstmakecontextsyms.cc' file #4921

YY-Edwards opened this issue Jun 28, 2024 · 1 comment
Assignees
Labels
bug stale Stale bot on the loose

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
@kkm000 kkm000 self-assigned this Aug 28, 2024
Copy link

stale bot commented Apr 26, 2025

This issue has been automatically marked as stale by a bot solely because it has not had recent activity. Please add any comment (simply 'ping' is enough) to prevent the issue from being closed for 60 more days if you believe it should be kept open.

@stale stale bot added the stale Stale bot on the loose label Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale Stale bot on the loose
Projects
None yet
Development

No branches or pull requests

2 participants