You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PaddleSpeech/models/swig_decoders
Yibing Liu 7d0458c7f7
adapt to the new folder structure of DS2
8 years ago
..
README.md adapt to the new folder structure of DS2 8 years ago
__init__.py adapt to the new folder structure of DS2 8 years ago
_init_paths.py adapt to the new folder structure of DS2 8 years ago
ctc_decoders.cpp adapt to the new folder structure of DS2 8 years ago
ctc_decoders.h adapt to the new folder structure of DS2 8 years ago
decoder_utils.cpp adapt to the new folder structure of DS2 8 years ago
decoder_utils.h adapt to the new folder structure of DS2 8 years ago
decoders.i adapt to the new folder structure of DS2 8 years ago
path_trie.cpp adapt to the new folder structure of DS2 8 years ago
path_trie.h adapt to the new folder structure of DS2 8 years ago
scorer.cpp adapt to the new folder structure of DS2 8 years ago
scorer.h adapt to the new folder structure of DS2 8 years ago
setup.py adapt to the new folder structure of DS2 8 years ago

README.md

The decoders for deployment developed in C++ are a better alternative for the prototype decoders in Pytthon, with more powerful performance in both speed and accuracy.

Installation

The build depends on several open-sourced projects, first clone or download them to current directory (i.e., deep_speech_2/deploy)

  • KenLM: Faster and Smaller Language Model Queries
git clone https://github.com/kpu/kenlm.git
  • OpenFst: A library for finite-state transducers
wget http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.6.3.tar.gz
tar -xzvf openfst-1.6.3.tar.gz
git clone https://github.com/progschj/ThreadPool.git
  • SWIG: A tool that provides the Python interface for the decoders, please make sure it being installed.

Then run the setup

python setup.py install --num_processes 4
cd ..

Usage

The decoders for deployment share almost the same interface with the prototye decoders in Python. After the installation succeeds, these decoders are very convenient for call in Python, and a complete example in deploy.py can be refered.

For GPU deployment

CUDA_VISIBLE_DEVICES=0 python deploy.py

For CPU deployment

python deploy.py --use_gpu=False

More help for arguments

python deploy.py --help