Semantic Interpretation Markup
This section introduces semantic interpretation and describes how to use semantic interpretation markup in a grammar to customize the semantic values that the speech recognizer returns as the result of a successful recognition.
What Is Semantic Interpretation?
Semantic interpretation is the process by which a semantic interpreter generates a semantic result based on an utterance that matches a path through a grammar. A semantic result typically contains information that is more useful to the application than the text of the utterance. For example, a grammar for specifying an airport can recognize the utterance, "Heathrow Airport," and generate the airport code "LHR" as the semantic result. Scripts that are contained within tag elements and inserted in the input grammar generate the content of a semantic result. The speech recognizer serializes the products of the scripts and generates the semantic result in the form of a Semantic Markup Language (SML) output. For more information, see SML Output Overview.
The model and syntax of semantic interpretation that is implemented in the Microsoft recognition engines is based on Semantic Interpretation for Speech Recognition (SISR) Version 1.0.
Semantic Interpretation Principles
The basic principles for the semantic interpretation mechanism in the Microsoft speech recognition engines are:
Scripts that associate values with grammar rules generate semantic information.
Script expressions contained in the semantic interpretation tag element follow the syntax of ECMA-327. Not all features are supported. For exceptions, see Semantic Results Content.
The parse order of the rules in the grammar determines the order in which expressions are evaluated.
The semantic result (in the form of an SML output) consists of the semantic information associated with the root rule.
Semantic Interpretation Markup Reference
The following topics describe the implementation of semantic interpretation in Microsoft speech recognition engines.
-
Describes two models and syntax for authoring semantic scripts in XML-format SRGS grammars.
-
Describes how the semantic interpreter generates semantic results, scripting syntax, and grammar preparation.
-
Describes and illustrates the use of the tag element for semantic interpretation scripts and includes examples that show the semantic output that the contents of tag elements generate.
Referencing Grammar Rule Variables
Describes and illustrates the two different types of Rule Variable referencing.
-
Describes how to reference the Rule Variable of the containing rule element and how to create child and grandchild properties of the Rule Variable.
Grammar Rule Reference Referencing
Describes how to reference the Rule Variable of rule elements outside of the containing rule.
Complete Example Grammars with SI Markup
Presents two example grammars that contain scripts for semantic interpretation.
-
Presents a grammar of moderate complexity that contains several rules and uses semantic scripts extensively.