Semantic Interpretation Markup

  Microsoft Speech Technologies Homepage

This topic introduces semantic interpretation (SI), and describes how to use semantic interpretation markup in a grammar in order 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 may recognize the utterance, "Heathrow Airport," and generate the airport code "LHR" as the semantic result. Scripts which are contained within tag elements that are inserted in the input grammar, generate the content of a semantic result. The Microsoft speech recognizer serializes the products of the scripts and generates the semantic result in the form of a Semantic Markup Language (SML) output. See SML Output Overview for more information.

The model and syntax of semantic interpretation that is implemented in the Microsoft Speech Application SDK Version 1.1 (SASDK) is based on the W3C working draft of Semantic Interpretation for Speech Recognition.

Semantic Interpretation Principles

The basic principles for the semantic interpretation mechanism in the SASDK 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. See Specifying the Content of Semantic Results for exceptions.
  • 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 the SASDK.

Specifying the Content of Semantic Results Describes how the semantic interpreter generates semantic results, scripting syntax, and grammar preparation.
Using the <tag> Element Describes where the tag element for semantic interpretation scripts is used, and illustrates several examples of tag use and semantic output.
Referencing Grammar Rule Variables Describes and illustrates the two different types of Rule Variable referencing.
Grammar Rule Name Referencing Describes how to reference the Rule Variable of the containing rule element, as well as 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.