Add RNN LM rescore for offline ASR with modified_beam_search (#125)

This commit is contained in:
Fangjun Kuang
2023-04-23 17:15:18 +08:00
committed by GitHub
parent d49a597431
commit 86017f9833
32 changed files with 842 additions and 52 deletions

View File

@@ -9,6 +9,7 @@
#include <vector>
#include "onnxruntime_cxx_api.h" // NOLINT
#include "sherpa-onnx/csrc/hypothesis.h"
#include "sherpa-onnx/csrc/offline-model-config.h"
namespace sherpa_onnx {
@@ -79,13 +80,16 @@ class OfflineTransducerModel {
*
* @param results Current decoded results.
* @param end_index We only use results[0:end_index] to build
* the decoder_input.
* the decoder_input. results[end_index] is not used.
* @return Return a tensor of shape (results.size(), ContextSize())
*/
Ort::Value BuildDecoderInput(
const std::vector<OfflineTransducerDecoderResult> &results,
int32_t end_index) const;
Ort::Value BuildDecoderInput(const std::vector<Hypothesis> &results,
int32_t end_index) const;
private:
class Impl;
std::unique_ptr<Impl> impl_;