Skip to content

restructure submodule#90

Closed
naxingyu wants to merge 1 commit intodanpovey:pybind11from
naxingyu:add-feat-pybind
Closed

restructure submodule#90
naxingyu wants to merge 1 commit intodanpovey:pybind11from
naxingyu:add-feat-pybind

Conversation

@naxingyu
Copy link

as discussed in #87

@naxingyu
Copy link
Author

test pass, not touching c++, safe to merge. @danpovey

@csukuangfj
Copy link

@naxingyu
please have a look at this pullrequest: #88

I reused table.py (https://github.com/mobvoi/kaldi/blob/fangjun-pybind11/src/pybind/util/table.py) from pykaldi.

Current reader/writer in Pybind may be all removed and use
this file https://github.com/mobvoi/kaldi/blob/fangjun-pybind11/src/pybind/util/kaldi_table_pybind.h
instead.

An example for SequentialNnetChainExampleReader can be found at
https://github.com/mobvoi/kaldi/blob/e6610bb666c191f79df327db536f67729fe6c93b/src/pybind/nnet3/nnet_chain_example_pybind.cc#L92-L103

    // (fangjun): we follow the PyKaldi style to prepend a underline before the
    // registered classes and the user in general should not use them directly;
    // instead, they should use the corresponding python classes that are more
    // easier to use.
    pybind_sequential_table_reader<KaldiObjectHolder<PyClass>>(
        m, "_SequentialNnetChainExampleReader");

    pybind_random_access_table_reader<KaldiObjectHolder<PyClass>>(
        m, "_RandomAccessNnetChainExampleReader");

    pybind_table_writer<KaldiObjectHolder<PyClass>>(m,
                                                    "_NnetChainExampleWriter");

https://github.com/mobvoi/kaldi/blob/fangjun-pybind11/src/pybind/util/table.py#L29

and
https://github.com/mobvoi/kaldi/blob/fangjun-pybind11/src/pybind/util/table.py#L158

@csukuangfj
Copy link

I think it makes no sense to create a reader without passing a filename and
the default constructor can be simply removed.

@naxingyu
Copy link
Author

I see. That's a really huge PR. I can close this one.

@naxingyu naxingyu closed this Dec 19, 2019
@naxingyu naxingyu deleted the add-feat-pybind branch December 19, 2019 16:18
@csukuangfj
Copy link

csukuangfj commented Dec 19, 2019

I hope that Dan will merge it soon.

We can use SequentialNnetChainExampleReader now in python
and supervision fsts can also be manipulated in Python.

LF-MMI training will soon be available in kaldi pybind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants