如何在 Ruby 应用程序中使用 CMU Sphinx 语音识别? [英] How to use CMU Sphinx speech recognition with Ruby application?

查看:53
本文介绍了如何在 Ruby 应用程序中使用 CMU Sphinx 语音识别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找如何在 Ruby (Rails) 应用程序中使用 CMU Sphinx.我需要非常简单的任务 - 我有一个 mp3 文件,我想把它转录成文本.

I'm searching for how to use CMU Sphinx with Ruby (Rails) application. I need very simple task - I have an mp3 file and I want get it transcribed into text.

如何实现这种最简单的方法?我不知道 C/C++,我的任务也不是为了它学习 C/C++ :)

How can I implement this easiest way? I dont' know C/C++ and my task isn't so big to learn C/C++ for it :)

感谢您的帮助!

推荐答案

CMUSphinx 提供了多个可用于利用语音识别功能的界面.其中一些可能更适合您,一些不太适合:

CMUSphinx provides several interfaces you can use to leverage speech recognition features. Some of them might be more suitable for you, some less:

  1. 使用命令行工具并将它们作为来自 Rails 应用程序的外部二进制文件执行以获得所需的结果.要执行的工具是pocketsphinx_continuous.有关如何从 Rails 调用二进制文件的更多信息,请参阅问题:如何在heroku上执行二进制文件?

  1. Use command-line tools and execute them as an external binaries from Rails application to obtain the required results. The tool to execute is pocketsphinx_continuous. For more information on how to invoke binaries from Rails see the question: how to execute binary on heroku?

您可以使用 JVM 从 JRuby 调用 Sphinx4 框架,请参阅如何从 JRuby:http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4#writing_scripts

You can invoke Sphinx4 framework from JRuby using JVM, see for example on how to use Sphinx4 from JRuby: http://cmusphinx.sourceforge.net/wiki/tutorialsphinx4#writing_scripts

您可以使用 SWIG 实现 Pocketsphinx 绑定.简单的部分是 Python 的 swig 包装器已经作为 Pocketsphinx 的一部分存在,您只需要使用 SWIG 来生成 Ruby 包装器:https://sourceforge.net/p/cmusphinx/code/11643/tree/trunk/pocketsphinx/swig/

You can implement the pocketsphinx bindings using SWIG. The easy part is that the swig wrappers for Python already exist as a part of the pocketsphinx, you just need to use SWIG to generate Ruby wrappers: https://sourceforge.net/p/cmusphinx/code/11643/tree/trunk/pocketsphinx/swig/

最后,您可以使用 Java REST 框架实现 REST 网络,以使用 CMUSphinx 工具将音频转换为文本,并从您的 Ruby 代码调用该服务.有关更多信息,请参阅如何使用 Rails 中的 REST通过这种方式,您可以使您的系统真正具有可扩展性.

Finally, you can implement a REST web using Java REST frameworks to convert audio to text using CMUSphinx tools and invoke the sevice from your Ruby code. For more information see information how to use REST from Rails This way your can make your system really scalable.

这篇关于如何在 Ruby 应用程序中使用 CMU Sphinx 语音识别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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