CoEDL / elpis

🙊 software for creating speech recognition models.
https://elpis.readthedocs.io/en/latest/
Apache License 2.0
152 stars 33 forks source link

Read state objects #63

Closed benfoley closed 5 years ago

benfoley commented 5 years ago

This reads existing state objects when KaldiInterface is used, so that the CLI can be aware of previous dataset, pron_dicts and models, and we can load existing models to do a transcription with CLI.

Current behaviour is that running cli/demo.py on the command results in the creation of dataset, pron_dict, model and transcription objects and corresponding files as expected. Attempting to use the KaldiInterface to then create a new transcription and load an existing model fails because it seems that the interface.json config file is recreated each each time, however the object directories themselves are not recreated. So, although the state object dirs are still there, the interface has been cleared of reference to them. See the examples/cli/demo_transcribe.py for an example of the use case.

With the changes to the interface.py file here, if the state path exists we read the directory structure and write the objects back into the interface.json file, rebuilding the state.

But is there a better way to do it, to prevent the interface.json config file from being recreated each time the python interface is used?

benfoley commented 5 years ago

Found a better way.. see #64