All Projects → Danesprite → pyjsgf

Danesprite / pyjsgf

Licence: MIT license
JSpeech Grammar Format (JSGF) compiler, matcher and parser package for Python.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pyjsgf

deepspeech.mxnet
A MXNet implementation of Baidu's DeepSpeech architecture
Stars: ✭ 82 (+105%)
Mutual labels:  speech-recognition
NLP Toolkit
Library of state-of-the-art models (PyTorch) for NLP tasks
Stars: ✭ 92 (+130%)
Mutual labels:  speech-recognition
quran-align
Word-accurate timestamps for Qur'anic audio.
Stars: ✭ 139 (+247.5%)
Mutual labels:  speech-recognition
Deep-learning-And-Paper
【仅作为交流学习使用】机器智能--相关书目及经典论文包括AutoML、情感分类、语音识别、声纹识别、语音合成实验代码等
Stars: ✭ 62 (+55%)
Mutual labels:  speech-recognition
formulas-python
Ritchie CLI formulas in Python 🐍
Stars: ✭ 17 (-57.5%)
Mutual labels:  speech-recognition
Speech-Recognition
End-to-end Automatic Speech Recognition for Madarian and English in Tensorflow
Stars: ✭ 21 (-47.5%)
Mutual labels:  speech-recognition
TinyCog
Small Robot, Toy Robot platform
Stars: ✭ 29 (-27.5%)
Mutual labels:  speech-recognition
Rus-SpeechRecognition-LSTM-CTC-VoxForge
Распознавание речи русского языка используя Tensorflow, обучаясь на базе Voxforge
Stars: ✭ 50 (+25%)
Mutual labels:  speech-recognition
speech-to-text-code-pattern
React app using the Watson Speech to Text service to transform voice audio into written text.
Stars: ✭ 37 (-7.5%)
Mutual labels:  speech-recognition
speech to text
how to use the Google Cloud Speech API to transcribe audio/video files.
Stars: ✭ 35 (-12.5%)
Mutual labels:  speech-recognition
A chronology of deep learning
Tracing back and exposing in chronological order the main ideas in the field of deep learning, to help everyone better understand the current intense research in AI.
Stars: ✭ 47 (+17.5%)
Mutual labels:  speech-recognition
soxan
Wav2Vec for speech recognition, classification, and audio classification
Stars: ✭ 113 (+182.5%)
Mutual labels:  speech-recognition
vosk-asterisk
Speech Recognition in Asterisk with Vosk Server
Stars: ✭ 52 (+30%)
Mutual labels:  speech-recognition
revai-node-sdk
Node.js SDK for the Rev AI API
Stars: ✭ 21 (-47.5%)
Mutual labels:  speech-recognition
vosk-model-ru-adaptation
No description or website provided.
Stars: ✭ 19 (-52.5%)
Mutual labels:  speech-recognition
deep avsr
A PyTorch implementation of the Deep Audio-Visual Speech Recognition paper.
Stars: ✭ 104 (+160%)
Mutual labels:  speech-recognition
UniSpeech
UniSpeech - Large Scale Self-Supervised Learning for Speech
Stars: ✭ 224 (+460%)
Mutual labels:  speech-recognition
mixup
speechpro.com/
Stars: ✭ 23 (-42.5%)
Mutual labels:  speech-recognition
lightning-asr
Modular and extensible speech recognition library leveraging pytorch-lightning and hydra.
Stars: ✭ 36 (-10%)
Mutual labels:  speech-recognition
pocketsphinx
Updated ROS bindings to pocketsphinx
Stars: ✭ 36 (-10%)
Mutual labels:  speech-recognition

pyjsgf

Build Status Docs Status

JSpeech Grammar Format (JSGF) compiler, matcher and parser package for Python.

JSGF is a format used to textually represent grammars for speech recognition engines. You can read the JSGF specification here.

pyjsgf can be used to construct JSGF rules and grammars, compile them into strings or files, and find grammar rules that match speech hypothesis strings. Matching speech strings to tags is also supported. There are also parsers for grammars, rules and rule expansions.

pyjsgf has been written and tested for Python 2.7 and Python 3.5.

The documentation for this project is on readthedocs.org.

Installation

To install pyjsgf, run the following:

$ pip install pyjsgf

If you are installing in order to develop pyjsgf, clone/download the repository, move to the root directory and run:

$ pip install -e .

Usage Example

The following is a usage example for how to create a JSGF grammar with one rule, compile it and find matching rules given the speech string "hello world":

from jsgf import PublicRule, Literal, Grammar

# Create a public rule with the name 'hello' and a Literal expansion 'hello world'.
rule = PublicRule("hello", Literal("hello world"))

# Create a grammar and add the new rule to it.
grammar = Grammar()
grammar.add_rule(rule)

# Compile the grammar using compile()
# compile_to_file(file_path) may be used to write a compiled grammar to
# a file instead.
# Compilation is not required for finding matching rules.
print(grammar.compile())

# Find rules in the grammar that match 'hello world'.
matching = grammar.find_matching_rules("hello world")
print("Matching: %s" % matching[0])

Running the above code would output:

#JSGF V1.0;
grammar default;
public <hello> = hello world;

Matching: PublicRule(name='hello', expansion=Literal('hello world'))

The first line of the grammar can be changed using the jsgf_version, charset_name, and language_name members of the Grammar class.

There are some usage examples in pyjsgf/examples which may help you get started.

Multilingual support

Due to Python's Unicode support, pyjsgf can be used with Unicode characters for grammar, import and rule names, as well as rule literals. If you need this, it is better to use Python 3 or above where all strings are Unicode strings by default.

If you must use Python 2.x, you'll need to define Unicode strings as either u"text" or unicode(text, encoding), which is a little cumbersome. If you want to define Unicode strings in a source code file, you'll need to define the source code file encoding.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].