ufal-dsg / pykaldi Goto Github PK
View Code? Open in Web Editor NEWPython wrapper for Kaldi decoders (Kaldi https://sourceforge.net/projects/kaldi/)
License: Other
Python wrapper for Kaldi decoders (Kaldi https://sourceforge.net/projects/kaldi/)
License: Other
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!
Use our servers instead of S3.
See
http://docs.travis-ci.com/user/deployment/custom/#stq=&stp=0
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.
Gives bad lattice -> pyonline-recogniser works ok,
probably due to bad conversion on input.
Problems CI:
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)
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')
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)
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?, ..
It is not mine code, so I should ask Kaldi team about that.
It seams that make kwsbin fails only for the first time.
decoded from scratch again the same utterance.
Asks for the same frames in the pipeline.
The script data_split.sh assumes the WORK variable is defined, but considering this is an independent script, it should be self-contained and get this variable passed in as a command-line argument.
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.
The bug spotted at master: 0daf30a
./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]
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
https://travis-ci.org/UFAL-DSG/pykaldi/builds/19695465#L1775
I can not reproduce it on ubuntu 12.04 at my local workstation
pykaldi/binutils
to egs
directory - TODOSetting 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>=?
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.