Partilhar via


Management of Speech QA Controls

  Microsoft Speech Technologies Homepage

Answers and Confirms

The QA control collects data from the user and places it in SemanticItem controls for semantic processing.

A typical QA contains a DialogPrompt control that asks the user for information, and an Answer control corresponding to each data item that the author expects the user to say. The Speech Platform performs recognition of the user's response and returns an SML item in which the elements of recognized text are organized semantically. Each Answer control specifies a particular semantic element of the results and a SemanticItem control to store and process that element.

The State property of the SemanticItem control indicates the semantic state of the Answer control. Values of Answer.SemanticItem.State are Empty, NeedsConfirmation, and Confirmed.

The Answer controls are grouped in collections within the QA control. The Answers collection contains Answer controls that collect data elements that respond directly to the QA prompt. The optional ExtraAnswers collection contains Answer controls that collect extra data elements that the user might say. The Confirms collection contains Answer controls that collect sensitive data elements that must be explicitly confirmed by the user.

The process of explicitly confirming data usually requires a different style of prompt message than the process of collecting data. For this reason, QA controls are designed either to collect or to confirm data. QA controls that collect data contain Answer controls in the Answers and ExtraAnswers collections, and those that confirm data contain Answer controls in a Confirms collection.

Activation Conditions

RunSpeech activates QA controls containing only Answers, or Answers and Confirms under the following conditions:

  • The ClientActivationFunction either is not present or returns True, AND
  • All the items specified in the Answers collection are empty.

RunSpeech activates QA controls containing only Confirms under the following conditions:

  • The ClientActivationFunction either is not present or returns True, AND
  • At least one Answer in the Confirms collection needs confirmation.

Control Behavior When Activated

  1. RunSpeech creates an associative array containing an element for each Answer object in the Answers, ExtraAnswers and Confirms collections of the QA. This associative array is later passed as a parameter to client-side functions such as PromptSelectFunction and GrammarSelectFunction.
  2. RunSpeech increments the execution count value of the control.
  3. RunSpeech starts the DialogPrompt control.
  4. If BargeIn is False, wait until the DialogPrompt completes; otherwise proceed.
  5. If the control contains a Reco object, start it.
  6. If the control contains a DTMF object, start it.
  7. If the control has Answer controls in the Answers or ExtraAnswers collections, RunSpeech processes the Answer controls semantically. See Semantic Processing of the Answers Collection.
  8. If the control has Answer controls in the Confirms collection, RunSpeech processes them semantically. See Semantic Processing of the Confirms Collection.