0

我正在尝试获得我需要的拉丁语语音识别,. . . 不是单词识别,而是。. . 语音元音和辅音识别(因为拉丁语只有 40 个声音,但超过 40,000 个单词 x 60 平均结尾 = 250 万个单词形式)。问题是, 。. . Web Speech APIGoogle Cloud Speech都只是从听起来相似的完整单词开始(并且也从英语语法开始,因为那里没有 250 万单词的拉丁语法),所以我没有办法开始处理实际的语音,特别是词干(单词的前半部分),它区分每个单词,而不是(对我来说)无用的词尾告诉它在句子中的作用。理想情况下,我想要一个词干的语法,例如

  • “am-”( amo、 amare、amavi、amatus 等的缩写),
  • "vid-" ( video, videre ,vidi,visus等的缩写),
  • “laet-”(laetus、laeta、laetum 等的缩写)

  • 等等

但语音识别技术无法搜索到这一点。
那么我在哪里可以获得语音语音识别?

我更喜欢 jS、pHp 或 Node,最好是客户端,而不是流式传输。

到目前为止,这是我的代码,用于Web Speech API。关键是console.log()s 表明我试图深入研究每个返回的可能单词的属性:

speech.onresult = function(event) { 
    var interim_transcript = '';
    var final_transcript = '';

    for (var i = event.resultIndex; i < event.results.length; ++i) { 
        if (event.results[i].isFinal) { 
            final_transcript += event.results[i][0].transcript;

            // This console.log shows all 3 word-guess possibilities.
               console.log(event.results[i]);
                    //These console.logs show each individual possibility:
                     //console.log('Poss-1:'); console.log(event.results[i][0]);
                     //console.log('Poss-2:'); console.log(event.results[i][1]);
                     //console.log('Poss-3:'); console.log(event.results[i][2]);
            for (var a in event.results[i]) {
                for (var b in event.results[i][a]) {
                  /*This black-&-yellow console.log below shows me trying to dig into
                  each returned possibility's PROPERTIES, but alas, the only 
                  returned properties are 
                  (1) the transcript (i.e. the guessed word), 
                  (2) the confidence (i.e. the 0-to-1 likelihood of it being that word)
                  (3) the prototype 
                   */
                    console.log("%c Poss-"+a+" %c "+b+": "+event.results[i][a][b], 'background-color: black; color: yellow; font-size: 14px;', 'background-color: black; color: red; font-size: 14px;'); 
                }        
            }

      } 
    }
    if (action == "start") {
        transcription.value += final_transcript;
        interim_span.innerHTML = interim_transcript;                       
    }
};    
4

1 回答 1

0

您可以使用创建一个SpeechGrammarList. 另请参阅JSpeech 语法格式

MDN上的示例描述和代码

Web Speech API 的 SpeechGrammarList 接口表示 SpeechGrammar 对象的列表,其中包含我们希望识别服务识别的单词或单词模式。

语法是使用 JSpeech Grammar Format (JSGF) 定义的。将来也可能支持其他格式。

var grammar = '#JSGF V1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;'
var recognition = new SpeechRecognition();
var speechRecognitionList = new SpeechGrammarList();
speechRecognitionList.addFromString(grammar, 1);
recognition.grammars = speechRecognitionList;
于 2017-11-05T00:36:06.960 回答