Menu

Pocket-sphinx text alignment problem for words having alternative pronunciation

Help
2018-04-28
2018-04-28
  • nayan kalita

    nayan kalita - 2018-04-28

    Hi All,

    I am using pocketsphinx, ps_alignment to align a text and to get phoneme level timings . For some word, i have multiple alternative pronounciation in the dictionary.

    AND AE N D
    AND(2) AH N D
    THEMSELVES DH EH M S EH L V Z
    THEMSELVES(2) DH AH M S EH L V Z

    I am using following code for text alignment ,

    .....
           al = ps_alignment_init(d2p);
            ps_alignment_add_word(al, dict_wordid(dict, "<s>"),0);
            for(i = 0; i < nwords; i++)
            {   
                ps_alignment_add_word(al, dict_wordid(dict, words[i]),0);
    
            }
            ps_alignment_add_word(al, dict_wordid(dict, "</s>"),0);
            ps_alignment_populate(al);      
            search = state_align_search_init("state_align",config, acmod, al);
            ....
    
         acmod_start_utt(acmod);
        ps_search_start(search);
        while (!feof(rawfh)) {
            nread = fread(buf, sizeof(*buf), 2048, rawfh);
            bptr = buf;
            while ((nfr = acmod_process_raw(acmod, &bptr, &nread, FALSE)) > 0) {
                while (acmod->n_feat_frame > 0) {
                    ps_search_step(search, acmod->output_frame);
                    acmod_advance(acmod);
                }
            }
        }
        ps_search_finish(search);
            ...
    

    It is always aligned to the first pronunciation of the word for all words. How I can solve this problem?

     
    • Nickolay V. Shmyrev

      First decode to figure out exact pronunciation then align to get time boundaries.

       
  • nayan kalita

    nayan kalita - 2018-04-28

    Hi Nickolay,

    Thanks for your suggestion.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.