Metadata-Version: 2.1
Name: asr-decoder
Version: 0.0.6
Summary: ASR Decoder
Home-page: https://github.com/pengzhendong/asr-decoder
Author: Zhendong Peng
Author-email: pzd17@tsinghua.org.cn
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering
Description-Content-Type: text/markdown
License-File: LICENSE

# asr-decoder

CTC decoder with hotwords for ASR models. Supports `ctc_greedy_search` and `ctc_prefix_bream_search` decoding methods.

## Usage

- ctc greedy search

``` python
from asr_decoder import CTCDecoder

decoder = CTCDecoder()
# ctc_probs: (sequence_length, vocab_size)
result = decoder.ctc_greedy_search(ctc_probs, is_last=True)
```

- ctc prefix beam search (with hotwords)

``` python
from asr_decoder import CTCDecoder

hotwords = ["停止"]
decoder = CTCDecoder(hotwords, symbol_table, bpemodel)
# ctc_probs: (sequence_length, vocab_size)
result = decoder.ctc_prefix_beam_search(ctc_probs, beam_size=3, is_last=True)
```


