Dela via


Semantic Interpretation Markup

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The following sections introduce semantic interpretation and describe 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 Speech Server 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 Speech Server 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 Speech Server.

Topic Description

Semantic Results Content

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 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.