Support getting word IDs for CTC HLG decoding. (#978)

This commit is contained in:
Fangjun Kuang
2024-06-06 14:22:39 +08:00
committed by GitHub
parent 69347ffc8f
commit 1a43d1e37f
13 changed files with 60 additions and 13 deletions

View File

@@ -339,6 +339,20 @@ std::string OfflineRecognitionResult::AsJsonString() const {
}
sep = ", ";
}
os << "], ";
sep = "";
os << "\""
<< "words"
<< "\""
<< ": ";
os << "[";
for (int32_t w : words) {
os << sep << w;
sep = ", ";
}
os << "]";
os << "}";