Menu

s3_align final state not reached

Help
2011-09-18
2012-09-22
  • Pranav Jawale

    Pranav Jawale - 2011-09-18

    Hello,

    I'm separately force-aligning individual words from the hypothesis given by
    s3_decode for an utterance (by first cutting as per word boundaries). But even
    for some of the "correctly" recognized words, s3_align gives the error
    "Final state not reached"

    Is this because of the initial and final 3 frames allotted to <sil> by
    s3_align? Even with insert_sil = 0, the aligner still forcefully aligns first
    3 and last 3 frames as SIL.
    Thanks.</sil>

     
  • Nickolay V. Shmyrev

    Insert_sil controls silence phones between words, not boundaries

    first silence is inserted in the sources

     /* Create node(s) for <s> before any transcript word */
        word_end =
            append_transcript_word(dict->startwid, &phead, nextw, 0,
                                   insert_sil)
    
     
  • Pranav Jawale

    Pranav Jawale - 2011-09-18

    Hi,

    Is there a workaround for this?

    I commented line in your post and also following lines

        /*word_end =
            append_transcript_word(dict->finishwid, word_end, BAD_S3WID,
                                   insert_sil, 0);
    
    
    
    
       /* Dag must begin and end at shead and stail, respectively */
        assert(shead.succlist);
        assert(stail.predlist);
        assert(!shead.predlist);
        assert(!stail.succlist);
    

    But it crashes during running. My understanding of aligner code is not that
    good.

    Thanks.

     
  • Nickolay V. Shmyrev

    Hello

    I don't think it's easy. The rpobelm is context dependency. You need to
    understand which triphone to put on the boundary and sil exactly helps to
    avoid the question. Assertions should be easy to fix but the problem is to
    make everything right.

    I would like to point you to ps_alignment API from pocketsphinx, it should be
    easier to deal with.

     
  • Nickolay V. Shmyrev

    Hello

    This is a patch to do that in s3_align

    Index: s3_align.c
    ===================================================================
    --- s3_align.c  (revision 11220)
    +++ s3_align.c  (working copy)
    @@ -822,6 +822,8 @@
         int32 k, oov;
         pnode_t *word_end, *node;
         char *wd, delim, *wdcopy = NULL;
    +    
    +    insert_sil = FALSE;
    
         /* Initialize dummy head and tail entries of sent hmm */
         phead.wid = BAD_S3WID;
    @@ -878,10 +880,7 @@
                 nextw = dict_basewid(dict, nextw);
         }
    
    -    /* Create node(s) for <s> before any transcript word */
    -    word_end =
    -        append_transcript_word(dict->startwid, &phead, nextw, 0,
    -                               insert_sil);
    +    word_end = &phead;
    
         /* Append each word in transcription to partial sent HMM created so far */
         while (k >= 0) {
    @@ -913,10 +912,7 @@
         if (oov)
             return -1;
    
    -    /* Append phone HMMs for </s> at the end; link to tail node */
    -    word_end =
    -        append_transcript_word(dict->finishwid, word_end, BAD_S3WID,
    -                               insert_sil, 0);
    +
         for (node = word_end; node; node = node->next)
             link_pnodes(node, &ptail);
    
     
  • Pranav Jawale

    Pranav Jawale - 2011-09-26

    Hey,

    Thanks a lot, it works!

     

Log in to post a comment.