Skip to content

Misleading description in 'fstmakecontextsyms.cc' file #4921

Description

@YY-Edwards
  • 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.

http://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""

Activity

  1. self-assigned this
    on Aug 28, 2024
  2. stale commented on Apr 26, 2025

    @stale

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugstaleStale bot on the loose

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions