CMUSphinx PocketSphinx - 识别所有(或大量)单词 [英] CMUSphinx PocketSphinx - Recognize all (or large amount) of words

查看:28
本文介绍了CMUSphinx PocketSphinx - 识别所有(或大量)单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我尝试将 PocketSphinx 用于 Android 之前,我使用了 Google 的语音识别 API.我不需要设置搜索名称或字典文件.它只是识别被告知的每一个字.

Before I tried to used PocketSphinx for Android, I used Google's voice recognition API. I didn't need to set a search name or a dictionary file. It just recognized every word that was told.

现在,在 PocketSphinx 中,我需要这样做.但是我只能找到如何设置识别一个单词,或者设置字典(演示项目中可用的单词只有几个)识别器认为这些是唯一存在的单词,这意味着如果有人说类似的话,识别器认为它是字典中列出的单词.

Now, In PocketSphinx, I need to do it. But I can only find how to set recognition for one word, Or to set dictionary (The ones available in the demo project have only few words) that the recognizer think these are the only words exist, Which means that if someone says something similar, The recognizer thinks its the word that listed in the dictionary.

我只是想问,我怎么能设置几个搜索名称,或者我怎么能设置它来识别所有可用的词(甚至是大量的词)?也许有人有一个包含大量单词的字典文件?

I just want to ask, How could I set a few search names, Or how could I set it to recognize all the words available (or even a large amount of them)? Maybe someone has a dictionary file with a big number of words?

推荐答案

在我尝试将 PocketSphinx 用于 Android 之前,我使用了 Google 的语音识别 API.我不需要设置搜索名称或字典文件.它只是识别被告知的每一个字.

Before I tried to used PocketSphinx for Android, I used Google's voice recognition API. I didn't need to set a search name or a dictionary file. It just recognized every word that was told.

Google API 也可以识别大量但仍然有限的词.很长一段时间它都无法识别Spotify".Google 离线语音识别器使用了大约 50k 个单词,如其 出版物.

Google API recognizes a large but still limited set of words too. For a long time it failed to recognize "Spotify". Google offline speech recognizer uses about 50k words as described in their publication.

我只是想问,我怎么能设置几个搜索名称,或者我怎么能设置它来识别所有可用的词(甚至是大量的词)?也许有人有一个包含大量单词的字典文件?

I just want to ask, How could I set a few search names, Or how could I set it to recognize all the words available (or even a large amount of them)? Maybe someone has a dictionary file with a big number of words?

演示包括带有语言模型的大词汇语音识别(预测部分).有更大的英语语言模型可供下载,例如 En-US 通用语言模型.

Demo includes large vocabulary speech recognition with a language model (forecast part). There are bigger language model for the English language available for download, for example En-US generic language model.

运行识别的简单代码是这样的:

The simple code to run the recognition is like that:

 recognizer = defaultSetup()
   .setAcousticModel(new File(assetsDir, "en-us-ptm"))
   .setDictionary(new File(assetsDir, "cmudict-en-us.dict"))
   .getRecognizer();
  recognizer.addListener(this);

  // Create keyword-activation search.
  recognizer.addNgramSearch(NGRAM_SEARCH, new File(assetsDir, "en-us.lm.bin"););

  // Start the search
  recognizer.startListening(NGRAM_SEARCH);

然而,它们不容易安装到设备中并实时解码.如果您想使用大量词汇实时解码语音,您需要将音频流式传输到服务器.或者您需要将词汇和语言限制为通用英语的一小部分.您可以在教程中详细了解 CMUSphinx 中的语音识别.

However, they are not easy to fit into device and decode in realtime. If you want to decode speech in realtime with large vocabulary you need to stream audio to a server. Or you need to restrict the vocabulary and language to some small subset of generic English. You can learn more about speech recognition in CMUSphinx in tutorial.

这篇关于CMUSphinx PocketSphinx - 识别所有(或大量)单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆