Как установить pocketsphinx python

pocketsphinx 0.1.15

pip install pocketsphinx Copy PIP instructions

Released: Jun 3, 2018

Python interface to CMU Sphinxbase and Pocketsphinx libraries

Navigation

Project links

Statistics

View statistics for this project via Libraries.io, or by using our public dataset on Google BigQuery

License: BSD License (BSD)

Tags sphinxbase, pocketsphinx

Maintainers

Classifiers

Project description

Pocketsphinx Python

Pocketsphinx is a part of the CMU Sphinx Open Source Toolkit For Speech Recognition.

This package provides a python interface to CMU Sphinxbase and Pocketsphinx libraries created with SWIG and Setuptools.

Supported platforms

Installation

More binary distributions for manual installation are available here.

Usage

LiveSpeech

It’s an iterator class for continuous recognition or keyword search from a microphone.

An example of a keyword search:

With your model and dictionary:

AudioFile

It’s an iterator class for continuous recognition or keyword search from a file.

An example of a keyword search:

With your model and dictionary:

Convert frame into time coordinates:

Pocketsphinx

A more comprehensive example:

Default config

If you don’t pass any argument while creating an instance of the Pocketsphinx, AudioFile or LiveSpeech class, it will use next default values:

If you want to disable default language model or dictionary, you can change the value of the corresponding options to False:

Verbose

Send output to stdout:

Send output to file:

Compatibility

Parent classes are still available:

Install development version

Install requirements

Mac OS X requirements:

Install with pip

Install with distutils

Projects using pocketsphinx-python

License

Project details

Project links

Statistics

View statistics for this project via Libraries.io, or by using our public dataset on Google BigQuery

License: BSD License (BSD)

Tags sphinxbase, pocketsphinx

Maintainers

Classifiers

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Как установить pocketsphinx python. Смотреть фото Как установить pocketsphinx python. Смотреть картинку Как установить pocketsphinx python. Картинка про Как установить pocketsphinx python. Фото Как установить pocketsphinx python

Download files

Download the file for your platform. If you’re not sure which to choose, learn more about installing packages.

Источник

pocketsphinx2 0.1.17

pip install pocketsphinx2 Copy PIP instructions

Released: Apr 22, 2020

Python interface to CMU Sphinxbase and Pocketsphinx libraries (fixed MacOS and Linux (Ubuntu 18.04) installation problem.If you wanna install, the original packaget maybe the right choose, if you have problems with original packaget, then try out this one

Navigation

Project links

Statistics

View statistics for this project via Libraries.io, or by using our public dataset on Google BigQuery

License: BSD License (BSD)

Tags sphinxbase, pocketsphinx

Maintainers

Classifiers

Project description

Pocketsphinx Python

Pocketsphinx is a part of the CMU Sphinx Open Source Toolkit For Speech Recognition.

This package provides a python interface to CMU Sphinxbase and Pocketsphinx libraries created with SWIG and Setuptools.

Supported platforms

Installation

More binary distributions for manual installation are available here.

Usage

LiveSpeech

It’s an iterator class for continuous recognition or keyword search from a microphone.

An example of a keyword search:

With your model and dictionary:

AudioFile

It’s an iterator class for continuous recognition or keyword search from a file.

An example of a keyword search:

With your model and dictionary:

Convert frame into time coordinates:

Pocketsphinx

A more comprehensive example:

Default config

If you don’t pass any argument while creating an instance of the Pocketsphinx, AudioFile or LiveSpeech class, it will use next default values:

If you want to disable default language model or dictionary, you can change the value of the corresponding options to False:

Источник

Распознавание речи на python с помощью pocketsphinx или как я пытался сделать голосового ассистента

Это туториал по использованию библиотеки pocketsphinx на Python. Надеюсь он поможет вам
побыстрее разобраться с этой библиотекой и не наступать на мои грабли.

Началось все с того, что захотел я сделать себе голосового ассистента на python. Изначально для распознавания решено было использовать библиотеку speech_recognition. Как оказалось, я не один такой. Для распознавания я использовал Google Speech Recognition, так как он единственный не требовал никаких ключей, паролей и т.д. Для синтеза речи был взят gTTS. В общем получился почти клон этого ассистента, из-за чего я не мог успокоиться.

Правда, успокоиться я не мог не только из-за этого: ответа приходилось ждать долго (запись заканчивалась не сразу, отправка речи на сервер для распознавания и текста для синтеза занимала немало времени), речь не всегда распознавалась правильно, дальше полуметра от микрофона приходилось кричать, говорить нужно было четко, синтезированная гуглом речь звучала ужасно, не было активационной фразы, то есть звуки постоянно записывались и передавались на сервер.

Первым усовершенствованием был синтез речи при помощи yandex speechkit cloud:

Затем настала очередь распознавания. Меня сразу заинтересовала надпись «CMU Sphinx (works offline)» на странице библиотеки. Я не буду рассказывать об основных понятиях pocketsphinx, т.к. до меня это сделал chubakur(за что ему большое спасибо) в этом посте.

Установка Pocketsphinx

Сразу скажу, так просто pocketsphinx установить не получится(по крайней мере у меня не получилось), поэтому pip install pocketsphinx не сработает, упадет с ошибкой, будет ругаться на wheel. Установка через pip будет работать только если у вас стоит swig. В противном случае чтобы установить pocketsphinx нужно перейти вот сюда и скачать установщик(msi). Обратите внимание: установщик есть только для версии 3.5!

Распознавание речи при помощи pocketsphinx

Pocketsphinx может распознавать речь как с микрофона, так и из файла. Также он может искать горячие фразы(у меня не очень получилось, почему-то код, который должен выполняться когда находится горячее слово выполняется несколько раз, хотя произносил его я только один). От облачных решений pocketsphinx отличается тем, что работает оффлайн и может работать по ограниченному словарю, вследствие чего повышается точность. Если интересно, на странице библиотеки есть примеры. Обратите внимание на пункт «Default config».

Русская языковая и акустическая модель

Этот код должен распознавать почти любые произнесенные вами фразы. Согласитесь, точность отвратительная. Но это можно исправить. И увеличить скорость создания LiveSpeech тоже можно.

Создаем свой словарь

Некоторые транскрипции может быть нужно подправить.

Использование pocketsphinx через speech_recognition

Использовать pocketsphinx через speech_recognition имеет смысл только если вы распознаете английскую речь. В speech_recognition нельзя указать пустую языковую модель и использовать jsgf, а следовательно для распознавания каждого фрагмента придется ждать 2 минуты. Проверенно.

Угробив несколько вечеров я понял, что потратил время впустую. В словаре из двух слов(да и нет) сфинкс умудряется ошибаться, причем часто. Отъедает 30-40% celeron’а, а с языковой моделью еще и жирный кусок памяти. А Яндекс почти любую речь распознает безошибочно, при том не ест память и процессор. Так что думайте сами, стоит ли за это браться вообще.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *