Code Monkey home page Code Monkey logo

pykaldi's People

Contributors

cdfox avatar jurcicek avatar ondrejklejch avatar oplatek avatar ticcky avatar tuetschek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pykaldi's Issues

online_decode non_deterministacly changes WER

This is probably cause by loosing frames in
pykaldi-feat-input.cc in :40

void GetNextFeatures(); // called when we need more features. Guarantees
// to get at least one more frame, or set finished_ = true.

this does not hold!

it reuses old values!

Disable the --run-cmn option for utils(or steps)

List of the affected files should corresponds to files changed at
c044cbc commit.

Now the scripts does not use apply cmvn.
Reason: Pykaldi does not support cmvn
Solution: Implement online cmvn for pykaldi and train cmvn for it.

python 3 support

Problems CI:

ERROR: test_setup (pykaldi.decoders_test.TestPyGmmLatgenWrappeNotInit)

Traceback (most recent call last):
File "/home/travis/build/UFAL-DSG/pykaldi/src/pykaldi/pykaldi/decoders_test.py", line 39, in test_setup
self.assertFalse(self.d.setup(args))
File "decoders.pyx", line 95, in pykaldi.decoders.PyGmmLatgenWrapper.setup (pykaldi/decoders.cpp:2486)

TypeError: expected bytes, str found

FAIL: test_frame_in_assert (pykaldi.decoders_test.TestPyGmmLatgenWrappeNotInit)

Traceback (most recent call last):
File "/home/travis/build/UFAL-DSG/pykaldi/src/pykaldi/pykaldi/decoders_test.py", line 51, in test_frame_in_assert
self.d.frame_in(wav)
nose.proxy.AssertionError: AssertionError not raised
'AssertionError not raised' = <unittest.case._AssertRaisesContext object at 0x2ada9614a350>.test_case._formatMessage(<unittest.case._AssertRaisesContext object at 0x2ada9614a350>.'AssertionError not raised', 'AssertionError not raised')

raise <unittest.case._AssertRaisesContext object at 0x2ada9614a350>.test_case.failureException('AssertionError not raised')

FAIL: test_expand_prefix (pykaldi.utils_test.TestExpandPref)

Traceback (most recent call last):
File "/home/travis/build/UFAL-DSG/pykaldi/src/pykaldi/pykaldi/utils_test.py", line 53, in test_expand_prefix
self.assertTrue(gold['y'] == test['y'], 'prefix expansion fails')
nose.proxy.AssertionError: AssertionError: False is not true : prefix expansion fails
-------------------- >> begin captured stdout << ---------------------
{'prefixdir': b'myownpath', 'mypath': b'myownpath/origin', 'innerdic': {'a': b'myownpath/origin', 'b': [b'arg1', b'arg2']}, 'y': b'myownpath/origin/file', 'x': b'1', 'innerlist': [b'myownpath/origin/file2', b'arg3']}
test vs gold
{'prefixdir': 'myownpath', 'mypath': 'myownpath/origin', 'innerdic': {'a': 'myownpath/origin', 'b': ['arg1', 'arg2']}, 'y': 'myownpath/origin/file', 'x': '1', 'innerlist': ['myownpath/origin/file2', 'arg3']}
--------------------- >> end captured stdout << ----------------------
'False is not true : prefix expansion fails' = self._formatMessage('False is not true : prefix expansion fails', "%s is not true" % safe_repr(False))

raise self.failureException('False is not true : prefix expansion fails')


Ran 9 tests in 0.177s
FAILED (SKIP=1, errors=1, failures=2)

distribute python extension with shared library without setting LD_LIBRARY_PATH

Problem:
pykaldi/src/pykaldi/setup.py now requires libpykaldi.so (which is build into
pykaldi/src/pykaldi/pykaldi) in LD_LIBRARY_PATH or in system library paths.

I now distribute libpykaldi.so with the pykaldi installation side by side with decoders.so.
I just do not know how to specify decoders.so that it should look for libpykaldi.so
in the same directory.

Bad solution: static linking -> too complex to extract building parameters from Makefile to setup.py
Possible solutions: dlopen, how ld --rpath parameters works?, ..

Models downloaded from vystadial server causes 100% WER

The testing scripts in src/pykaldi/pykaldi/binutils return 100% on the downloaded sample
with downloaded models.

Expected WER ~50%... HCLG uses bigram LM, hard to decode Czech language.
Possible cause: different mfcc settings.

decoders fails in alex

./applications/call_logs/2013-12-20-23-17-15.635138-CET-4f5fd09fa792b678/vad-2013-12-20-23-17-28.462396.wav
saved in work/pykaldi/vad-2013-12-20-23-17-28.462396.wav
transcription "chci jet"

ERROR (PyGmmLatgenWrapper:ProcessNonemitting():lattice-faster-decoder.cc:658) Error, no surviving tokens: frame is 83
2013-12-20-23-17-28.503487-CET  ASR-3      : EXCEPTION
    Uncaught exception in ASR process.
    Traceback (most recent call last):
      File "/ha/work/people/oplatek/alex-dsg/alex/components/hub/asr.py", line 221, in run
        self.read_audio_write_asr_hypotheses()
      File "/ha/work/people/oplatek/alex-dsg/alex/components/hub/asr.py", line 125, in read_audio_write_asr_hypotheses
        self.asr.rec_in(data_rec)
      File "/ha/work/people/oplatek/alex-dsg/alex/components/asr/kaldi.py", line 61, in rec_in
        dec_t = self.decoder.decode(max_frames=self.max_dec_frames)
      File "decoders.pyx", line 44, in pykaldi.decoders.PyGmmLatgenWrapper.decode (pykaldi/decoders.cpp:1361)
    RuntimeError: ERROR (PyGmmLatgenWrapper:ProcessNonemitting():lattice-faster-decoder.cc:658) Error, no surviving tokens: frame is 83

    [stack trace: ]
    kaldi::KaldiGetStackTrace()
    kaldi::KaldiErrorMessage::~KaldiErrorMessage()
    kaldi::LatticeFasterDecoder::ProcessNonemitting(int)
    kaldi::PykaldiLatticeFasterDecoder::Decode(kaldi::DecodableInterface*, unsigned long)
    kaldi::GmmLatgenWrapper::Decode(unsigned long)
    .
    .
    .
    python(PyRun_FileExFlags+0xe1) [0x4246a1]
    python(PyRun_SimpleFileExFlags+0x1ce) [0x42492e]
    python(Py_Main+0x536) [0x425cb6]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fc571f0876d]
    python() [0x41bb31]




Process ASR-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/ha/work/people/oplatek/alex-dsg/alex/components/hub/asr.py", line 221, in run
    self.read_audio_write_asr_hypotheses()
  File "/ha/work/people/oplatek/alex-dsg/alex/components/hub/asr.py", line 125, in read_audio_write_asr_hypotheses
    self.asr.rec_in(data_rec)
  File "/ha/work/people/oplatek/alex-dsg/alex/components/asr/kaldi.py", line 61, in rec_in
    dec_t = self.decoder.decode(max_frames=self.max_dec_frames)
  File "decoders.pyx", line 44, in pykaldi.decoders.PyGmmLatgenWrapper.decode (pykaldi/decoders.cpp:1361)
RuntimeError: ERROR (PyGmmLatgenWrapper:ProcessNonemitting():lattice-faster-decoder.cc:658) Error, no surviving tokens: frame is 83

[stack trace: ]
kaldi::KaldiGetStackTrace()
kaldi::KaldiErrorMessage::~KaldiErrorMessage()
kaldi::LatticeFasterDecoder::ProcessNonemitting(int)
kaldi::PykaldiLatticeFasterDecoder::Decode(kaldi::DecodableInterface*, unsigned long)
kaldi::GmmLatgenWrapper::Decode(unsigned long)
.
.
.
python(PyRun_FileExFlags+0xe1) [0x4246a1]
python(PyRun_SimpleFileExFlags+0x1ce) [0x42492e]
python(Py_Main+0x536) [0x425cb6]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7fc571f0876d]
python() [0x41bb31]

pykaldi/binutils/decoding_pipeline_utils.py not workig for Python 2.6.6

tar --keep-newer-files -xf online-data.tar.bz2 > /dev/null 2> /dev/null
mkdir -p work
rm -f work/input.scp  # reset the file do not append
for f in online-data/audio/*.wav; do \
                bf=`basename $f`; bf=${bf%.wav}; echo $bf $f >>
work/input.scp; \
                echo $bf $bf >> work/spk2utt; \
                grep $bf online-data/audio/trans.txt | cut -d' ' -f 2-
> $f.trn; \
        done
python decoding_pipeline_example.py
configs/decoding_pipeline_voxforge_config.json
Traceback (most recent call last):
  File "decoding_pipeline_example.py", line 2, in <module>
    from decoding_pipeline_utils import parse_config_from_arguments,
make_dir, build_reference, wst2dict, int_to_txt, compact_hyp,
PyKaldiError
  File "/export/a09/dpovey/kaldi-ondra/src/python-kaldi-decoding/pykaldi/binutils/decoding_pipeline_utils.py",
line 2, in <module>
    from ordereddefaultdict import DefaultOrderedDict
  File "/export/a09/dpovey/kaldi-ondra/src/python-kaldi-decoding/pykaldi/binutils/ordereddefaultdict.py",
line 6, in <module>
    from collections import OrderedDict, Callable
ImportError: cannot import name OrderedDict
make: *** [run_pipeline_example] Error 1

Refactor

  • Find appropriete name for the decoder (keeping dec-wrap so far)
  • Refactor C++ code ->headers and directory names must fit (done)
  • Rename Classes -> Pykaldi to something else
  • move some parts of pykaldi/binutils to egs directory - TODO

Set up minimal version of required packages

Setting up minimal version of required packages would allow
obscure bugs.
Suggested packages:
setuptools>=?
cython>=20.0.1
pyyaml>=?
pystache>=?
?distribute?>=? For which python version which version if any
nose>=?

the docker run command fails

Terminal output:

sudo docker run ufaldsg/pykaldi /bin/bash -c "cd online_demo; make gmm-latgen-faster; make online-recogniser; make pyonline-recogniser"
mkdir -p decode
mkdir -p dirname data/vystadial-sample-en.tar.gz
wget http://vystadial.ms.mff.cuni.cz/download/pykaldi/egs/vystadial/online_demo//data/vystadial-sample-en.tar.gz -O data/vystadial-sample-en.tar.gz
--2020-02-03 12:19:02-- http://vystadial.ms.mff.cuni.cz/download/pykaldi/egs/vystadial/online_demo//data/vystadial-sample-en.tar.gz
Resolving vystadial.ms.mff.cuni.cz (vystadial.ms.mff.cuni.cz)... 195.113.20.160
Connecting to vystadial.ms.mff.cuni.cz (vystadial.ms.mff.cuni.cz)|195.113.20.160|:80... ^[[Zfailed: Connection timed out.
Retrying.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.