Support customize scores for hotwords (#926)

* Support customize scores for hotwords

* Skip blank lines
This commit is contained in:
Wei Kang
2024-05-31 12:34:30 +08:00
committed by GitHub
parent a689249f88
commit a38881817c
6 changed files with 103 additions and 35 deletions

View File

@@ -29,7 +29,8 @@ namespace sherpa_onnx {
bool EncodeHotwords(std::istream &is, const std::string &modeling_unit,
const SymbolTable &symbol_table,
const ssentencepiece::Ssentencepiece *bpe_encoder_,
std::vector<std::vector<int32_t>> *hotwords_id);
std::vector<std::vector<int32_t>> *hotwords_id,
std::vector<float> *boost_scores);
/* Encode the keywords in an input stream to be tokens ids.
*