Update offline-ctc-greedy-search-decoder.cc (#917)

Bug fixes.
Z_O_O will be decoded as ZO instead of ZOO.
To fix this, prev_id should update every time.
This commit is contained in:
Dadoou
2024-05-24 22:31:56 +08:00
committed by GitHub
parent 86ccb86006
commit 4fc0a1dc64

View File

@@ -42,8 +42,8 @@ std::vector<OfflineCtcDecoderResult> OfflineCtcGreedySearchDecoder::Decode(
if (y != blank_id_ && y != prev_id) {
r.tokens.push_back(y);
r.timestamps.push_back(t);
prev_id = y;
}
prev_id = y;
} // for (int32_t t = 0; ...)
ans.push_back(std::move(r));