treat unk as blank (#299)

This commit is contained in:
Fangjun Kuang
2023-09-07 15:12:29 +08:00
committed by GitHub
parent ffeff3b8a3
commit a12ebfab22
5 changed files with 29 additions and 12 deletions

View File

@@ -14,8 +14,9 @@ namespace sherpa_onnx {
class OnlineTransducerGreedySearchDecoder : public OnlineTransducerDecoder {
public:
explicit OnlineTransducerGreedySearchDecoder(OnlineTransducerModel *model)
: model_(model) {}
OnlineTransducerGreedySearchDecoder(OnlineTransducerModel *model,
int32_t unk_id)
: model_(model), unk_id_(unk_id) {}
OnlineTransducerDecoderResult GetEmptyResult() const override;
@@ -26,6 +27,7 @@ class OnlineTransducerGreedySearchDecoder : public OnlineTransducerDecoder {
private:
OnlineTransducerModel *model_; // Not owned
int32_t unk_id_;
};
} // namespace sherpa_onnx