Menu

python, pocketsphinx and lm switching

Help
2011-11-17
2012-09-22
  • Scott Silliman

    Scott Silliman - 2011-11-17

    Hi,

    I'm using pocketsphinx 0.7 with python and I'm able to get the lmset via:
    lmSet = decoder.get_lmset() and I've read a previous thread which mentioned
    tests/unit/test_lm_read.c as an example.

    Looking at this code, it's very clear how to do this in C, but I looked at
    both the pocketsphinx and sphinxbase python modules and couldn't find any
    functions/methods which allow adding a lm to the lmset, selecting one from the
    set, or updating the lmset.

    Is this due to python bindings not giving full coverage to the lmset stuff, or
    am I looking in the wrong place?

    -Scott

     
  • Nickolay V. Shmyrev

    Is this due to python bindings not giving full coverage to the lmset stuff,
    or am I looking in the wrong place?

    This part is missing in bindings, not implemented yet. Patch is welcome. It
    might be easier to implement python bindings through swig, not through pyx.

     
  • Scott Silliman

    Scott Silliman - 2011-11-17

    thanks for the quick reply!

    I just noticed that at least some of the required C functions were included in
    the .pxd files but weren't used in the .pyx files. Any particular reason why
    swig might be easier?

    -Scott

     
  • Nickolay V. Shmyrev

    Any particular reason why swig might be easier?

    Swig is preferred because it can be used for Java bindings which we need for
    Android ;) But we don't have Python swig infrastructure yet.

     
  • Scott Silliman

    Scott Silliman - 2011-11-18

    I've added the necessary code to both the pocketsphinx and sphinxbase cython
    bindings yesterday, and it seemed to work. I just need to do some more testing
    before I send you some patches. I have some experience with swig, although not
    recently, but I needed to get this stuff working asap for my job, which is why
    I went the cython route.

     
  • Nickolay V. Shmyrev

    This thing has been committed. Thanks a lot!

     

Log in to post a comment.