Overview of Recognition Grammars

,

Speech recognition relies on predefined grammars that determine valid speech input. Custom grammars allow you to limit the recognized words and phrases to those that make sense in the context of your app. Grammars allow you to improve the accuracy of speech recognition by limiting the set of recognizable phrases.

There are three types of grammars that can be used with the Windows Phone SDK:

Image Ready-to-use grammars, which include a dictation grammar and a web search grammar; both of which rely on a Microsoft cloud service

Image List grammars, which are lists of phrases that are defined programmatically by you

Image XML grammars, which use a format defined by the Speech Recognition Grammar Specification (SRGS)

Dictation and Web Search Grammars

The ready-to-use grammars allow you to add speech recognition to your app without having to write a grammar. These grammars are not built-in per se; speech is sent to, and processed on, a Microsoft server. There are two ready-to-use grammars:

Image A free-text dictation grammar that is supposed to recognize most words and phrases in a given language. This grammar is optimized to recognize short phrases.

Image A web search grammar that is almost as general as the free-text dictation grammar but is optimized to recognize search phrases that people use when searching the web.

Both the ready-to-use grammars allow you to recognize free text; however, because they are large and operate via a cloud service, they do not offer the performance of a locally stored custom list grammar or SRGS grammar.

Phrase List Grammars

The simplest way to create your own custom grammar is by creating a phrase list grammar. Phrase list grammars (henceforth referred to as list grammars) are suited to simple recognition scenarios and are defined by creating an array of strings. Each string represents an individual spoken phrase that your app will accept. During speech recognition, the SpeechRecognizer attempts to match spoken input with any one of the strings in the array. If a match occurs, the operation is deemed successful.

SRGS Grammars

An SRGS grammar is defined as an XML file that conforms to the Speech Recognition Grammar Specification (SRGS). SRGS grammars provide more authoring capabilities than a list grammar does. In an SRGS grammar, phrases are composed using rules and semantic tags.

The type of grammar that you choose for your app depends on the complexity of the recognition required. List grammars are easy to define but do not offer the flexibility of XML grammars. The ready-to-use grammars, although being great for recognizing general speech, rely on a network connection and do not allow you to tailor the grammar for the context of your app. You may find that all three approaches will find a place in your app.

In the following sections you look at implementing each of the grammar types.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.8.90