Summary
This chapter has shown how to create and use grammars to check whether the user's input conforms to the words and phrases required by the app. Grammars are also used to extract a semantic representation from the user's input in terms of concepts relevant for the app. Two types of grammar were presented: a hand-crafted grammar designed by the developer to match the requirements of the app, and a statistical grammar learned from a large corpus of relevant data. Hand-crafted grammars are useful for input that is predictable and well-defined, whereas statistical grammars provide more robust performance and can handle a wider range of input that may be less well-formed.
In the chapters so far, the examples have assumed that the language used is English and that the interface is speech-only. Chapter 7, Multilingual and Multimodal Dialogs, will look at how to build apps that make use of languages other than English and other modalities in addition to speech.