offline transducer: treat unk as blank (#1005)
Co-authored-by: chungyi.li <chungyi.li@ailabs.tw>
This commit is contained in:
@@ -131,8 +131,9 @@ OfflineTransducerModifiedBeamSearchDecoder::Decode(
|
||||
|
||||
float context_score = 0;
|
||||
auto context_state = new_hyp.context_state;
|
||||
if (new_token != 0) {
|
||||
// blank id is fixed to 0
|
||||
// blank is hardcoded to 0
|
||||
// also, it treats unk as blank
|
||||
if (new_token != 0 && new_token != unk_id_) {
|
||||
new_hyp.ys.push_back(new_token);
|
||||
new_hyp.timestamps.push_back(t);
|
||||
if (context_graphs[i] != nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user