Skip to content

kaiyux/CTC-decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CTC-Decoder

A cpp reimplementation

This repo is a cpp reimplementation for Awni Hannun's version of CTC decoder. It runs 4.5x faster in my MacBook Pro & No extra dependency is needed.

Usage

Firstly

mkdir cmake-build-release
cd cmake-build-release

/path/to/cmake -DCMAKE_BUILD_TYPE=Release -G "CodeBlocks - Unix Makefiles" /path/to/CTC-decoder

/path/to/cmake --build /path/to/CTC-decoder/cmake-build-release --target ctcdecoder -- -j 4

Then scripts in Python

import sys
sys.path.append('/path/to/cmake-build-release')
import ctcdecoder

probs = np.random.rand(time_len, output_dim)
probs = probs / np.sum(probs, axis=1, keepdims=True)
probs = np.log(probs)
labels, score = ctcdecoder.decode(probs, 10, 0)

About

A cpp reimplementation for CTC decoder

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published