From adcc48f6d2ad4c19cfd5586b9566137c401357ed Mon Sep 17 00:00:00 2001
From: Yabin Li <wucong.lyb@alibaba-inc.com>
Date: 星期日, 20 八月 2023 22:12:36 +0800
Subject: [PATCH] Update SDK_advanced_guide_online_zh.md
---
funasr/runtime/onnxruntime/src/vocab.cpp | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/funasr/runtime/onnxruntime/src/vocab.cpp b/funasr/runtime/onnxruntime/src/vocab.cpp
index 65af8b6..dc40978 100644
--- a/funasr/runtime/onnxruntime/src/vocab.cpp
+++ b/funasr/runtime/onnxruntime/src/vocab.cpp
@@ -34,14 +34,12 @@
}
}
-string Vocab::Vector2String(vector<int> in)
+void Vocab::Vector2String(vector<int> in, std::vector<std::string> &preds)
{
- int i;
- stringstream ss;
for (auto it = in.begin(); it != in.end(); it++) {
- ss << vocab[*it];
+ string word = vocab[*it];
+ preds.emplace_back(word);
}
- return ss.str();
}
int Str2Int(string str)
@@ -110,17 +108,16 @@
else {
// pre word is chinese
if (!is_pre_english) {
- word[0] = word[0] - 32;
+ // word[0] = word[0] - 32;
words.push_back(word);
pre_english_len = word.size();
-
}
// pre word is english word
else {
// single letter turn to upper case
- if (word.size() == 1) {
- word[0] = word[0] - 32;
- }
+ // if (word.size() == 1) {
+ // word[0] = word[0] - 32;
+ // }
if (pre_english_len > 1) {
words.push_back(" ");
--
Gitblit v1.9.1