offline transducer: treat unk as blank (#1005)
Co-authored-by: chungyi.li <chungyi.li@ailabs.tw>
This commit is contained in:
@@ -19,12 +19,13 @@ class OfflineTransducerModifiedBeamSearchDecoder
|
||||
OfflineTransducerModifiedBeamSearchDecoder(OfflineTransducerModel *model,
|
||||
OfflineLM *lm,
|
||||
int32_t max_active_paths,
|
||||
float lm_scale,
|
||||
float lm_scale, int32_t unk_id,
|
||||
float blank_penalty)
|
||||
: model_(model),
|
||||
lm_(lm),
|
||||
max_active_paths_(max_active_paths),
|
||||
lm_scale_(lm_scale),
|
||||
unk_id_(unk_id),
|
||||
blank_penalty_(blank_penalty) {}
|
||||
|
||||
std::vector<OfflineTransducerDecoderResult> Decode(
|
||||
@@ -37,6 +38,7 @@ class OfflineTransducerModifiedBeamSearchDecoder
|
||||
|
||||
int32_t max_active_paths_;
|
||||
float lm_scale_; // used only when lm_ is not nullptr
|
||||
int32_t unk_id_;
|
||||
float blank_penalty_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user