Add CTC HLG decoding using OpenFst (#349)

This commit is contained in:
Fangjun Kuang
2023-10-08 11:32:39 +08:00
committed by GitHub
parent c12286fe5e
commit 407602445d
39 changed files with 964 additions and 56 deletions

View File

@@ -0,0 +1,23 @@
// sherpa-onnx/python/csrc/offline-ctc-fst-decoder-config.cc
//
// Copyright (c) 2023 Xiaomi Corporation
#include "sherpa-onnx/python/csrc/offline-ctc-fst-decoder-config.h"
#include <string>
#include "sherpa-onnx/csrc/offline-ctc-fst-decoder-config.h"
namespace sherpa_onnx {
void PybindOfflineCtcFstDecoderConfig(py::module *m) {
using PyClass = OfflineCtcFstDecoderConfig;
py::class_<PyClass>(*m, "OfflineCtcFstDecoderConfig")
.def(py::init<const std::string &, int32_t>(), py::arg("graph") = "",
py::arg("max_active") = 3000)
.def_readwrite("graph", &PyClass::graph)
.def_readwrite("max_active", &PyClass::max_active)
.def("__str__", &PyClass::ToString);
}
} // namespace sherpa_onnx