chenmengzheAAA
2023-09-14 30c40c643c19f6e2ac8679fa76d09d0f9ceccc65
funasr/runtime/onnxruntime/src/vocab.h
@@ -5,12 +5,14 @@
#include <stdint.h>
#include <string>
#include <vector>
#include <map>
using namespace std;
namespace funasr {
class Vocab {
  private:
    vector<string> vocab;
    std::map<string, int> token_id;
    bool IsEnglish(string ch);
    void LoadVocabFromYaml(const char* filename);
@@ -21,6 +23,7 @@
    bool IsChinese(string ch);
    void Vector2String(vector<int> in, std::vector<std::string> &preds);
    string Vector2StringV2(vector<int> in);
    int GetIdByToken(const std::string &token);
};
} // namespace funasr