Add emotion, event of SenseVoice. (#1257)

* Add emotion, event of SenseVoice.

* Fix tokens size check and update java api.

https://github.com/k2-fsa/sherpa-onnx/pull/1257
This commit is contained in:
Robin Zhong
2024-08-14 15:50:13 +08:00
committed by GitHub
parent f300ec0f98
commit 62c4d4ab62
10 changed files with 95 additions and 4 deletions

View File

@@ -32,6 +32,12 @@ static void PybindOfflineRecognitionResult(py::module *m) { // NOLINT
return py::str(PyUnicode_DecodeUTF8(self.text.c_str(),
self.text.size(), "ignore"));
})
.def_property_readonly("lang",
[](const PyClass &self) { return self.lang; })
.def_property_readonly("emotion",
[](const PyClass &self) { return self.emotion; })
.def_property_readonly("event",
[](const PyClass &self) { return self.event; })
.def_property_readonly("tokens",
[](const PyClass &self) { return self.tokens; })
.def_property_readonly("words",