Git Product home page Git Product logo

pydecoder's Introduction

very simple python wrapper for kaldi-decoder in nnet3 setup.

TODO

  • Add nnet2/nnet3 online-decoder wrappers using Cython
  • Add tools parsing BNF description into a text file in the AT&T FSM format

Requirements

  • python2.7
  • openfst 1.6.1 (official supported)
  • Cython 0.26
  • numpy

Prepare

  1. directory conf is generated by steps/online/prepare_online_decoding.sh
  2. kaldi-command parameters should be configured in corresponding file, for example, add decoding configure in conf/online.conf
# decode config
--min-active=200 
--max-active=7000 
--beam=11.0 
--lattice-beam=6.0 
--acoustic-scale=0.1
--frames-per-chunk=20 
--extra-left-context-initial=0
  1. resources needed by pydecoder listed here:
├── conf
│   ├── ivector_extractor.conf
│   ├── mfcc.conf
│   ├── online_cmvn.conf
│   ├── online.conf
│   ├── online_pitch.conf
│   └── splice.conf
├── final.mdl
├── HCLG.fst
├── ivector_extractor
│   ├── final.dubm
│   ├── final.ie
│   ├── final.mat
│   ├── global_cmvn.stats
│   ├── online_cmvn.conf
│   └── splice_opts
└── words.txt

Example

import pydecoder
# import ...
# args setting...
# config the decoder
decoder = pydecoder.PyOnlineNnet3Decoder(args.config, args.model, args.graph)
# decode whole file
decoder.decode_wavefile(args.wave)
# and get result sequence
print decoder.get_decode_sequence(args.words)

more see decoder_test

pydecoder's People

Contributors

funcwj avatar

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.