雾聪
2023-10-10 4984724f6a580fdefc4dcec430e69fd75635d25b
funasr/runtime/onnxruntime/src/vocab.cpp
@@ -75,6 +75,21 @@
    return false;
}
string Vocab::WordFormat(std::string word)
{
    if(word == "i"){
        return "I";
    }else if(word == "i'm"){
        return "I'm";
    }else if(word == "i've"){
        return "I've";
    }else if(word == "i'll"){
        return "I'll";
    }else{
        return word;
    }
}
string Vocab::Vector2StringV2(vector<int> in, std::string language)
{
    int i;
@@ -94,6 +109,7 @@
            size_t found = word.find(unicodeChar);
            if(found != std::string::npos){
                if (combine != ""){
                    combine = WordFormat(combine);
                    if (words.size() != 0){
                        combine = " " + combine;
                    }
@@ -164,6 +180,7 @@
    }
    if (language == "en-bpe" and combine != ""){
        combine = WordFormat(combine);
        if (words.size() != 0){
            combine = " " + combine;
        }