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.
| 251 | |
| 252 | |
| 253 | class 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) |
nothing calls this directly
no outgoing calls
no test coverage detected