Recognizer INTERPRET
The INTERPRET method from the client to the server takes as input an Interpret-Text header field containing the text for which the semantic interpretation is desired, and returns, via the INTERPRETATION-COMPLETE event, an interpretation result (in NLSML format) that is very similar to the one returned from a RECOGNIZE method invocation. Only portions of the result relevant to acoustic matching are excluded from the result. The Interpret-Text header field MUST be included in the INTERPRET request.
Recognizer grammar data is treated in the same way as it is when issuing a RECOGNIZE method call.
If a RECOGNIZE, or another INTERPRET operation is already in progress for the resource, the server will reject the request with a response having a status-code of 402 "Method not valid in this state", and a COMPLETE request state.
Note that although this method is only implemented in the MRCPv2 specification, LumenVox have extended support for this method to MRCPv1 clients, since this may be useful to some clients.
MRCPV1 INTERPRET Example:
C->S: INTERPRET 543257 MRCP/1.0 Interpret-Text:may I speak to Andre Roy Content-Type:application/grammar+xml Content-Id:request1@form-level.store Content-Length:104 <?xml version="1.0"?> <!-- the default grammar language is US English --> <grammar xml:lang="en-US" version="1.0"> <!-- single language attachment to tokens --> <rule id="yes"> <one-of> <item xml:lang="fr-CA">oui</item> <item xml:lang="en-US">yes</item> </one-of> </rule> <!-- single language attachment to a rule expansion --> <rule id="request"> may I speak to <one-of xml:lang="fr-CA"> <item>Michel Tremblay</item> <item>Andre Roy</item> </one-of> </rule> </grammar> S->C: MRCP/1.0 543257 200 IN-PROGRESS S->C: INTERPRETATION-COMPLETE 543257 COMPLETE MRCP/1.0 Completion-Cause:000 success Waveform-URL:http://web.media.com/session123/audio.wav Content-Type:application/x-nlsml Content-Length:276 <?xml version="1.0"?> <result grammar="session:request1@form-level.store"> <interpretation> <instance name="Person"> <Person> <Name> Andre Roy </Name> </Person> </instance> <input> may I speak to Andre Roy </input> </interpretation> </result> |
MRCPV2 INTERPRET Example:
C->S: MRCP/2.0 ... INTERPRET 543266 Channel-Identifier:32AECB23433801@speechrecog Interpret-Text:may I speak to Andre Roy Content-Type:application/srgs+xml Content-ID:<request1@form-level.store> Content-Length:... <?xml version="1.0"?> <!-- the default grammar language is US English --> <grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en-US" version="1.0" root="request"> <!-- single language attachment to tokens --> <rule id="yes"> <one-of> <item xml:lang="fr-CA">oui</item> <item xml:lang="en-US">yes</item> </one-of> </rule> <!-- single language attachment to a rule expansion --> <rule id="request"> may I speak to <one-of xml:lang="fr-CA"> <item>Michel Tremblay</item> <item>Andre Roy</item> </one-of> </rule> </grammar> S->C: MRCP/2.0 ... 543266 200 IN-PROGRESS Channel-Identifier:32AECB23433801@speechrecog S->C: MRCP/2.0 ... INTERPRETATION-COMPLETE 543266 200 COMPLETE Channel-Identifier:32AECB23433801@speechrecog Completion-Cause:000 success Content-Type:application/nlsml+xml Content-Length:... <?xml version="1.0"?> <result grammar="session:request1@form-level.store"> <interpretation> <instance name="Person"> <ex:Person> <ex:Name> Andre Roy </ex:Name> </ex:Person> </instance> <input> may I speak to Andre Roy </input> </interpretation> </result> |