Cmu sphinx для windows

CMU Sphinx Downloads

Software

CMU Sphinx toolkit has a number of packages for different tasks and applications. It’s sometimes confusing what to choose. To cleanup, here is the list

  • Pocketsphinx — recognizer library written in C.
  • Sphinxtrain — acoustic model training tools
  • Sphinxbase — support library required by Pocketsphinx and Sphinxtrain
  • Sphinx4 — adjustable, modifiable recognizer written in Java

We recommend you to use the latest available releases:

If you want to try bleeding edge version, pull the latest code from Github. Then compile packages from the source code, but remember that there is no guarantee they will be stable.

Older releases and files could be found on SourceForge http://sourceforge.net/projects/cmusphinx/files/

We do not maintain distribution-specific packages yet, but help to update them is truely appreciated. Some distributions already include CMUSphinx packages:

Models

CMUSphinx assumes that you use the statistical models which describe language. There are many models trained for various acoustic conditions and various performance requirements. We collect the best models available at our download page. We hope you’ll be able to find the best model for your language there:

We are also planning to use bittorrent tracker to distribute the models but we are not there yet, if you are willing to help, please contact us

Cmu sphinx для windows

OPEN SOURCE SPEECH RECOGNITION TOOLKIT

Update on CMUSphinx Project

Dear users, you’ve might been asking yourself why there were not so many updates on CMUSphinx recently. Time goes really fast and many things change in ASR. Deep learning, huge NLP models like BERT, Tacotron and Wavenet/Waveglow/WaveRNN, Pytorch vs Tensorflow, huge datsets, chatbots and so on and so forth. Many new toolkits appear and some disappear — Eesen, Espresso, Kaldi, Wav2letter, NeMo. The whole area is thriving.

CMUSphinx team has been actively participating in all those activities, creating new models, applications, helping newcomers and showing the best way to implement speech recognition system. We are here to suggest you the easiest way to start such an exciting world of speech recognition. Lately we implemented a Kaldi on Android, providing much better accuracy for large vocabulary decoding, which was hard to imagine before.

If you are interested in learning more, check Alpha Cephei website, our Github and join us on Telegram and Reddit.

GSOC 2017 Project Overview — Computer Assisted Learning Including Speaking Skills

Hi everyone! My name’s Sahith Dambekodi and I’m a second year undergrad student at BITS Pilani K.K. Birla Goa Campus. I’m pursuing a major in Electrical and Electronics engineering. This is my blog for Google Summer of Code 2017!

Читайте также:  Защита windows 10 исключения

GSOC 2017 accepted projects announced

The list of accepted projects for Google Summer of Code 2017 has been announced today. Please check

There are two major parts, one is pronunciation evaluation, we have several sub-projects about it, another part is about deep neural networks in pocketsphinx. Hopefully, the accuracy of our decoders will improve significantly. An interesting project is dedicated to more tight ROS integration, hopefully using speech recognition in robots will be way easier soon.

Congratulations to accepted students! Great summer ahead, lots of fun it seems.

Telegram group

We are happy to see you in our Telegram group, join us for realtime discussions about CMUSphinx

Sphinx. Установка и настройка.

Поисковая машина Sphinx – это полнотекстовая поисковая система, которая бесплатна, быстра и масштабируема. Она предназначена для производительности и актуальности. Не имеет аналогов ни в одной традиционной базе данных.

Установка и настройка Sphinx на Linux

Чтобы установить Sphinx на сервер Ubuntu, введите:

Поисковая система Sphinx успешно установлена на сервер. После установки Sphinx нуждается в дополнительной настройке.

Настройка Sphinx

Конфигурации Sphinx должны храниться в файле sphinx.conf в каталоге /etc/sphinxsearch. Они состоят из трёх основных блоков: index, searchd и source. Описание каждого из них и общий вид конфигурационного файла можно найти ниже.

Для начала создайте конфигурационный файл:

Блок source

Блок source содержит описание источника данных для нашего индекса, параметров доступа к ним, атрибутов и правил их анализа.. Первый столбец sql_query должен содержать уникальный ID. Запрос SQL будет выполняться для каждого индекса, а затем передавать данные в индексный файл Sphinx.

Стоит отметить что раздел source конфигурации поддерживает наследование, и это весьма удобно, т.к. можно создать один source с настройками соединения с базой данных, и в остальных наследовать его, чтобы не дублировать одни и те же настройки.

Что еще интересного из настроек:

  • sql_query_range — запрос который должен возвращать минимальное и максимальное значение id индексируемых записей, парамаметр пригодится для ranged query.
  • sql_range_step — количество записей получаемых за одну итерацию в ranged query.

Распознавание речи с помощью CMU Sphinx

CMU Sphinx сейчас является крупнейшим проектом по распознаванию человеческой речи. В инструментарий входят следующие программы и библиотеки:

  • Pocketsphinx — небольшая программа, которая принимает на вход произвольные акустические модели, грамматики и словари, а также звуковой поток(либо звуковой файл, либо сам берет поток с микрофона). На выходе получается распознанный текст. Написана на C, работает быстро.
  • Sphinxbase — библиотека необходимая для работы Pocketsphinx
  • Sphinx4 — гибкая библиотека для распознавания, написана на Java.
  • Sphinxtrain — программа для обучения акустических моделей.

Для работы со CMU Sphinx важно запомнить несколько определений и понять их отличия.

  • Акустическая модель — отвечает за сопоставление звуку произнесенной фонемы. Акустическую модель для русского языка можно скачать на сайте проекта. Русская акустическая и языковая модели. А также словарь.
  • Словарь — это файл, в котором написаны сопоставлены лексемы и фонемы (слово и его транскрипция). Например, калькулятор (k ay ll k u ll ja t ay r). Он необходим для преобразования фонем, распознанных акустической моделью в лексемы.
  • Грамматика — это формальные правила, которые описывают простые правила построения предложений. Лексемы, полученные на предыдущем шаге пытаются сопоставиться с грамматикой и если удачно, то выводится результат.
  • Языковая модель — это статистическая модель языка. Она описывает вероятности слов и их комбинаций. Таким образом распознавание лексем — это максимизация правдоподобности распознанной фразы.
Читайте также:  Windows звук через spdif

Чем сложнее язык, чем обширней правила и размер словаря, тем хуже точность распознавания. Поэтому, для минимизации ошибки, имеет смысл создания упрощенных правил, которые будут описывать конкретную задачу.

Наш формальный язык

ок, компьютер сорок семь плюс двадцать один.

Начнем описывать формальную грамматику.

Приветствие или активация (символ | означает или, скобки используются в качестве группирующего оператора):
= (ок|окей)(компьютер|калькулятор);

Однозначные числа:
= (ноль|один|два|три|четыре|пять|шесть|семь|восемь|девять);

Двузначные числа(это числа от 10 до 19, а также 20,30,40,50,60,70,80,90 с опциональным однозначным):
= (десять|одинадцать|двенадцать|тринадцать|четырнадцать|пятнадцать|шестнадцать|семнадцать|восемнадцать|девятнадцать)|(двадцать|тридцать|сорок|пятьдесят|шестьдесят|семьдесят|восемьдесят|девяносто)[];

Трехзначные числа(100,200,300,400,500,600,700,800,900 плюс опциональное двузначное или однозначное):
= (сто|двести|триста|четыреста|пятьсот|шестьсот|девятьсот)[|];

Многозначные числа(n тысяч плюс опциональные двузначные или однозначные):
= [||](тысяча|тысяч|тысячи)[||];

На этом я решил остановиться, но не сложно добавить еще одно правило для миллиона, миллиарда и прочих больших чисел.
Общее правило для числа:
= |||;

Теперь опишем возможные операции:
= плюс | минус | умножить на | разделить на;

И собственно сам запрос, то что мы и хотим распознавать:
public = ;

Файл с грамматикой можно взять с гитхаба calc.jsgf.

Составление словаря

Теперь составим словарь всех возможных слов. В принципе, можно использовать готовый словарь для русского языка, который скачивается вместе с акустической моделью. Ведь все эти слова наверняка там есть, а грамматика просто не пропустит слово, которого в ней не описано. Однако чем меньше словарь — тем быстрее поиск по нему и зачем нам хранить в оперативке словарь на 500000 слов, когда мы используем лишь несколько десятков. Но если вам лень составлять свой, то можно просто подключить готовый, я уверен что он будет работать. Сначала запишем все слова, которые будут корректны для нашего языка. Вот возьмем прямо все слова что мы описали в грамматике и запишем их в файл по слову на строку. Получится что-то вроде этого.

Для того чтобы получить транскрипцию для этих слов можно воспользоваться проектом ru4sphinx. Скрипт dict2transcript.pl принимает на вход 2 аргумента(наш файл со списком слов и выходной файл, куда записать слова и их транскрипции).

Получившийся словарь имеет следующий вид:

И доступен для скачивания.

Проверка работы

Попробуем распознать несколько команд, воспользуется для этого pocketsphinx. Pocketsphinx_continuous принимает множество разных параметров я опишу лишь некоторые из них, они будут необходимы для запуска:

  • -hmm . Если вы скачивали модель по приведенной выше ссылке, то акустическая модель будет находится в папке zero_ru_cont_8k_v3/zero_ru.cd_cont_4000 .
  • -dict
  • -jsgf
  • -lm
  • -logfn . По умолчанию лог пишется в stdout.
  • -infile . Надо удостовериться что частота дискретизации файла совпадает с частотой дискретизации модели.
  • -inmic . Звук в реальном времени с микрофона.
  • -remove_noise . Фильтрация шумов. По умолчанию yes.

pocketsphinx_continuous -hmm zero_ru.cd_cont_4000 -dict calc_lang/vocabular.dict -jsgf calc_lang/calc.jsgf -inmic yes

Installing Sphinx¶

Overview¶

Sphinx is written in Python and supports Python 3.6+. It builds upon the shoulders of many third-party libraries such as Docutils and Jinja, which are installed when Sphinx is installed.

Linux¶

Debian/Ubuntu¶

Install either python3-sphinx using apt-get:

If it not already present, this will install Python for you.

RHEL, CentOS¶

Install python-sphinx using yum:

If it not already present, this will install Python for you.

Other distributions¶

Most Linux distributions have Sphinx in their package repositories. Usually the package is called python3-sphinx , python-sphinx or sphinx . Be aware that there are at least two other packages with sphinx in their name: a speech recognition toolkit (CMU Sphinx) and a full-text search database (Sphinx search).

Читайте также:  Uninstall tool для mac os

macOS¶

Sphinx can be installed using Homebrew, MacPorts, or as part of a Python distribution such as Anaconda.

Homebrew¶

For more information, refer to the package overview.

MacPorts¶

Install either python3x-sphinx using port:

To set up the executable paths, use the port select command:

For more information, refer to the package overview.

Anaconda¶

Windows¶

Sphinx can be install using Chocolatey or installed manually .

Chocolatey¶

You would need to install Chocolatey before running this.

For more information, refer to the chocolatey page.

Other Methods¶

Most Windows users do not have Python installed by default, so we begin with the installation of Python itself. To check if you already have Python installed, open the Command Prompt ( ⊞Win — r and type cmd). Once the command prompt is open, type python —version and press Enter. If Python is installed, you will see the version of Python printed to the screen. If you do not have Python installed, refer to the Hitchhikers Guide to Python’s Python on Windows installation guides. You must install Python 3.

Once Python is installed, you can install Sphinx using pip. Refer to the pip installation instructions below for more information.

Installation from PyPI¶

Sphinx packages are published on the Python Package Index. The preferred tool for installing packages from PyPI is pip. This tool is provided with all modern versions of Python.

On Linux or MacOS, you should open your terminal and run the following command.

On Windows, you should open Command Prompt ( ⊞Win — r and type cmd) and run the same command.

After installation, type sphinx-build —version on the command prompt. If everything worked fine, you will see the version number for the Sphinx package you just installed.

Installation from PyPI also allows you to install the latest development release. You will not generally need (or want) to do this, but it can be useful if you see a possible bug in the latest stable release. To do this, use the —pre flag.

Docker¶

Docker images for Sphinx are published on the Docker Hub. There are two kind of images:

Former one is used for standard usage of Sphinx, and latter one is mainly used for PDF builds using LaTeX. Please choose one for your purpose.

sphinxdoc/sphinx-latexpdf contains TeXLive packages. So the image is very large (over 2GB!).

When using docker images, please use docker run command to invoke sphinx commands. For example, you can use following command to create a Sphinx project:

And you can following command this to build HTML document:

For more details, please read README file of docker images.

Installation from source¶

You can install Sphinx directly from a clone of the Git repository. This can be done either by cloning the repo and installing from the local clone, on simply installing directly via git.

Оцените статью