MCPcopy Create free account
hub / github.com/binbinjiang/CVT-SLR / DecoderState

Class DecoderState

ctcdecode/ctcdecode/__init__.py:253–272  ·  view source on GitHub ↗

Class using for maintain different chunks of data in one beam algorithm corresponding to one unique source. Note: after using State you should delete it, so dont reuse it Args: decoder (OnlineCTCBeamDecoder) - decoder you will use for decoding.

Source from the content-addressed store, hash-verified

251
252
253class DecoderState:
254 """
255 Class using for maintain different chunks of data in one beam algorithm corresponding to one unique source.
256 Note: after using State you should delete it, so dont reuse it
257 Args:
258 decoder (OnlineCTCBeamDecoder) - decoder you will use for decoding.
259 """
260 def __init__(self, decoder):
261 self.state = ctc_decode.paddle_get_decoder_state(
262 decoder._labels,
263 decoder._beam_width,
264 decoder._cutoff_prob,
265 decoder._cutoff_top_n,
266 decoder._blank_id,
267 decoder._log_probs,
268 decoder._scorer,
269 )
270
271 def __del__(self):
272 ctc_decode.paddle_release_state(self.state)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected