Add inverse text normalization for non-streaming ASR (#1017)

This commit is contained in:
Fangjun Kuang
2024-06-17 14:28:53 +08:00
committed by GitHub
parent dd69a1b56b
commit b0f7ed3ee3
13 changed files with 380 additions and 19 deletions

View File

@@ -40,6 +40,12 @@ struct OfflineRecognizerConfig {
float blank_penalty = 0.0;
// If there are multiple rules, they are applied from left to right.
std::string rule_fsts;
// If there are multiple FST archives, they are applied from left to right.
std::string rule_fars;
// only greedy_search is implemented
// TODO(fangjun): Implement modified_beam_search
@@ -50,7 +56,8 @@ struct OfflineRecognizerConfig {
const OfflineCtcFstDecoderConfig &ctc_fst_decoder_config,
const std::string &decoding_method, int32_t max_active_paths,
const std::string &hotwords_file, float hotwords_score,
float blank_penalty)
float blank_penalty, const std::string &rule_fsts,
const std::string &rule_fars)
: feat_config(feat_config),
model_config(model_config),
lm_config(lm_config),
@@ -59,7 +66,9 @@ struct OfflineRecognizerConfig {
max_active_paths(max_active_paths),
hotwords_file(hotwords_file),
hotwords_score(hotwords_score),
blank_penalty(blank_penalty) {}
blank_penalty(blank_penalty),
rule_fsts(rule_fsts),
rule_fars(rule_fars) {}
void Register(ParseOptions *po);
bool Validate() const;