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

@@ -304,6 +304,19 @@ const OfflineRecognitionResult &OfflineStream::GetResult() const {
std::string OfflineRecognitionResult::AsJsonString() const {
std::ostringstream os;
os << "{";
os << "\"lang\""
<< ": ";
os << std::quoted(lang) << ", ";
os << "\"emotion\""
<< ": ";
os << std::quoted(emotion) << ", ";
os << "\"event\""
<< ": ";
os << std::quoted(event) << ", ";
os << "\"text\""
<< ": ";
os << std::quoted(text) << ", ";