Menu

Problem with pockesphinx and JSGF grammar

Help
2012-09-04
2012-09-22
  • André Schlichting

    Hi, I'm trying to compare the performance of two different acoustic models
    using pocketsphinx, one is a HTK model converted to sphinx format using https
    ://cmusphinx.svn.sourceforge.net/svnroot/cmusphinx/trunk/htk2s3conv
    . The other is
    a sphinx model trained with sphinxtrain.

    When I use pocketsphinx with sphinx acoustic model everything works fine and I
    have the expected results, but when I use the one from the converter i got the
    following error for some files:

    ERROR: "fsg_search.c", line 1099: Final state not reached in frame 957
    

    The frame changes for each file.

    I see that changing the grammar file I can reduce the number of errors for the
    HTK converted model but none of the models can recognize anything, but at
    least I have less errors.

    The grammar file I'm using is this:

    #JSGF V1.0;
    grammar num;
    public <num> = (<bloco> <bloco> <bloco> <bloco>);
    <unidade> =  UM | DOIS | TRES | QUATRO | CINCO | SEIS | SETE | OITO | NOVE;
    <unidade_zero_meia> = <unidade> | ZERO | MEIA;
    <dezena> = VINTE | TRINTA | QUARENTA | CINQUENTA | SESSENTA | SETENTA | OITENTA | NOVENTA;
    <teen> = DEZ | ONZE | DOZE | TREZE | CATORZE | QUINZE | DEZESSEIS | DEZESSETE | DEZOITO | DEZENOVE;
    <dezena_e> = VINTE E| TRINTA E | QUARENTA E| CINQUENTA E| SESSENTA E| SETENTA E| OITENTA E| NOVENTA E;
    <dezenas> = <teen> | <dezena> | (<dezena_e> <unidade>);
    <dois_digitos> = <dezenas> | (<unidade_zero_meia> <unidade_zero_meia>);
    <bloco_op1> = <dois_digitos> <dois_digitos>;
    <bloco> = <bloco_op1>;
    

    Any help?

     
  • André Schlichting

    The feature files used for HTK train and sphinxtrain are the same. For
    recognizing I use the same files also. I'm using pocketsphinx_batch.

    /home/andrelucas/ccred/sphinx/teste/sphinx_base/install/bin/pocketsphinx_batch \
        -hmm /home/andrelucas/ccred/sphinx/teste/sphinx_base/install/model_parameters/teste.cd_cont_5000 \
        -lw 10 \
        -feat cep \
        -beam 1e-80 \
        -wbeam 1e-40 \
        -dict /home/andrelucas/ccred/sphinx/teste/sphinx_base/install/etc/teste.dic \
        -jsgf /home/andrelucas/ccred/sphinx/teste/sphinx_base/install/teste.gram \
        -wip 0.2 \
        -ctl /home/andrelucas/ccred/sphinx/teste/sphinx_base/install/etc/teste_test.fileids \
        -ctloffset 0 \
        -ctlcount 1 \
        -cepdir /home/andrelucas/features/finite_state_NB \
        -cepext .prm \
        -hyp /home/andrelucas/ccred/sphinx/teste/sphinx_base/install/result/teste-1-144.match \
        -agc none \
        -varnorm no \
        -cmn current \
        -ncep 39 \
        -ceplen 39
    
    
    
    
    
    INFO: cmd_ln.c(691): Parsing command line:
    \
        -alpha 0.97 \
        -doublebw no \
        -nfilt 40 \
        -ncep 39 \
        -lowerf 133.33334 \
        -upperf 6855.4976 \
        -nfft 512 \
        -wlen 0.0256 \
        -transform legacy \
        -feat 1s_c \
        -samprate 16000 \
        -agc none \
        -cmn current \
        -varnorm no
    
     
  • Nickolay V. Shmyrev

    The feature files used for HTK train and sphinxtrain are the same.

    I would not be that sure. For example CMN value "current" means you apply mean
    normalization to all 39 coefficients including deltas and accelrators. It
    doesn't seem like the right way to go.

     
  • André Schlichting

    I uploaded the models i'm using, the configuration files and one feature file
    for testing.

    I started debugging the code with both models and the first thing is that i
    cant get best hypothesis with "ps_get_hyp" with htk model, after this,
    everything runs different for them.
    https://docs.google.com/open?id=0B5qlZjr4jX8JV2dod1VwWk9NSHM
    Any help? thx

     
  • Nickolay V. Shmyrev

    Any help? thx

    Please read the previous message

     
  • André Schlichting

    any of the options for cmn make the htk model work.
    i think this should not be the problem, i'm using my own feature files for
    decoding both models and only htk model is not working for fsgs grammar.

    I see that the same HTK model can decode when using a general language model.
    the results are very poor, but at least is something. I'm still trying to find
    out what's going on when using HTK model and finite state grammar.

    Thanks.

     
  • André Schlichting

    The lattice for HTK model might show something

    # getcwd: /this/is/bogus
    # -logbase 1.000100e+00
    #
    Frames 1174
    #
    Nodes 28 (NODEID WORD STARTFRAME FIRST-ENDFRAME LAST-ENDFRAME)
    0 </s> 1174 1174 1174 ; -1
    1 <s> 0 0 0 ; -1
    2 <sil> 776 865 1173 ; 85
    3 <sil> 776 865 1173 ; 75
    4 <sil> 776 865 1173 ; 46
    5 <sil> 776 865 1173 ; 44
    6 <sil> 776 865 1173 ; 42
    7 <sil> 776 865 1173 ; 16
    8 <sil> 776 865 1173 ; 12
    9 <sil> 776 865 1173 ; 10
    10 <sil> 776 865 1173 ; 8
    11 <sil> 776 865 1173 ; 6
    12 <sil> 776 865 1173 ; 4
    13 <sil> 776 865 1173 ; 2
    14 <sil> 776 865 1173 ; 0
    15 <sil> 0 2 864 ; 85
    16 <sil> 0 2 864 ; 75
    17 <sil> 0 2 864 ; 46
    18 <sil> 0 2 864 ; 44
    19 <sil> 0 2 864 ; 42
    20 <sil> 0 2 864 ; 16
    21 <sil> 0 2 864 ; 12
    22 <sil> 0 2 864 ; 10
    23 <sil> 0 2 864 ; 8
    24 <sil> 0 2 864 ; 6
    25 <sil> 0 2 864 ; 4
    26 <sil> 0 2 864 ; 2
    27 <sil> 0 2 864 ; 0
    #
    Initial 1
    Final 0
    #
    BestSegAscr 0 (NODEID ENDFRAME ASCORE)
    #
    Edges (FROM-NODEID TO-NODEID ASCORE)
    1 0 -15300608
    1 15 0
    1 16 0
    1 17 0
    1 18 0
    1 19 0
    1 20 0
    1 21 0
    1 22 0
    1 23 0
    1 24 0
    1 25 0
    1 26 0
    1 27 0
    2 0 -2033664
    3 0 -2033664
    4 0 -2033664
    5 0 -2033664
    6 0 -2033664
    7 0 -2033664
    8 0 -2033664
    9 0 -2033664
    10 0 -2033664
    11 0 -2033664
    12 0 -2033664
    13 0 -2033664
    14 0 -2033664
    15 0 -14770176
    15 2 -12206080
    16 0 -14770176
    16 3 -12206080
    17 0 -14770176
    17 4 -12206080
    18 0 -14770176
    18 4 -12206080
    18 5 -12206080
    19 0 -14770176
    19 4 -12206080
    19 5 -12206080
    19 2 -12206080
    19 3 -12206080
    19 6 -12206080
    20 0 -14770176
    20 7 -12206080
    21 0 -14770176
    21 7 -12206080
    21 8 -12206080
    22 0 -14770176
    22 7 -12206080
    22 8 -12206080
    22 9 -12206080
    23 0 -14770176
    23 7 -12206080
    23 8 -12206080
    23 9 -12206080
    23 4 -12206080
    23 5 -12206080
    23 6 -12206080
    23 2 -12206080
    23 3 -12206080
    23 10 -12206080
    24 0 -14770176
    24 7 -12206080
    24 8 -12206080
    24 9 -12206080
    24 10 -12206080
    24 4 -12206080
    24 5 -12206080
    24 6 -12206080
    24 2 -12206080
    24 3 -12206080
    24 11 -12206080
    25 0 -14770176
    25 7 -12206080
    25 8 -12206080
    25 9 -12206080
    25 10 -12206080
    25 11 -12206080
    25 4 -12206080
    25 5 -12206080
    25 6 -12206080
    25 2 -12206080
    25 3 -12206080
    25 12 -12206080
    26 0 -14770176
    26 7 -12206080
    26 8 -12206080
    26 9 -12206080
    26 10 -12206080
    26 11 -12206080
    26 12 -12206080
    26 4 -12206080
    26 5 -12206080
    26 6 -12206080
    26 2 -12206080
    26 3 -12206080
    26 13 -12206080
    27 0 -14770176
    27 7 -12206080
    27 8 -12206080
    27 9 -12206080
    27 10 -12206080
    27 11 -12206080
    27 12 -12206080
    27 13 -12206080
    27 4 -12206080
    27 5 -12206080
    27 6 -12206080
    27 2 -12206080
    27 3 -12206080
    27 14 -12206080
    End
    
     
  • Nickolay V. Shmyrev

    Andre, you can not use -cmn current with the vector of lenght 39. If you want
    CMUSphinx CMN, you need ot use vector size 13 and calculate features with
    1s_c_d_dd or you should normalize features in HTK and then you can use CMN
    none instead of current.

     
  • André Schlichting

    It's working now!
    I was debugging and figured out the difference was that the code was using the
    cmn option from feat.params file and not the one I was setting in the command
    line. I changed cmn for none in the file and worked.

    Thanks! :D

     

Log in to post a comment.