[MRCPv2 protocol introduction] Generic Result Structure

MRCPv2 is the abbreviation of Media Resource Control Protocol Version 2 (MRCPv2). This article translates RFC6787 section 6.3. Generic Result Structure

6.3. Generic Result Structure General result structure

The resulting data from the server's recognizer and verifier resources is carried as typed media entities in the MRCPv2 message body of various events. Natural Language Semantic Markup Language (NLSML), an XML markup based on an earlier W3C draft, is the default standard for returning results to clients. Therefore, all servers implementing these resource types must support the media type "application/nlsml+xml" . The Extensible Multimodal Annotation (EMMA) [W3C.REC-emma-20090210] format can also be used to return results. This can be done by negotiating the format with SDP ( a=resultformat:application/emma+xml ) or SIP ( Allow/Accept ) at session establishment . For example, with SIP, if the client wants the result in EMMA, the MRCPv2 server can route the request to another server that supports EMMA by checking the SIP header fields instead of checking SDP.

MRCPv2 uses this representation to transfer content between clients and servers that generate and consume tags. MRCPv2 exclusively uses NSLML to transfer identification, registration and authentication results between corresponding resources on the MRCPv2 server and MRCPv2 clients. The details of this result format are fully described in Section 6.3.1.

Content-Type:application/nlsml+xml
   Content-Length:...

   <?xml version="1.0"?>
   <result xmlns="urn:ietf:params:xml:ns:mrcpv2"
           xmlns:ex="http://www.example.com/example"
           grammar="http://theYesNoGrammar">
       <interpretation>
           <instance>
                   <ex:response>yes</ex:response>
           </instance>
           <input>OK</input>
       </interpretation>
   </result>

6.3.1. Natural Language Semantics Markup Language

Natural Language Semantic Markup Language ( NLSML ) is an XML data structure whose elements and attributes are designed to carry result information from recognizer (including registration) and validator resources. The canonical definition of NLSML is the RelaxNG schema
in Section 16.1. Note that the elements and attributes of this format are defined in the MRCPv2 namespace . In the resulting structure, they must be prefixed with the namespace prefix declared in the result, or must be a child element of an element identified as belonging to the corresponding namespace. See [W3C.REC-xml-names11-20040204] for details on how to use XML namespaces. Section 2 of [W3C.REC-xml-names11-20040204] provides details on how to declare namespaces and namespace prefixes.

The root element of NLSML is <result> . Optional sub-elements are <interpretation> , <enrollment-result> and <verification-result> , at least one of which must be present. A single <result> may contain any or all optional child elements. Details of the <result> and <interpretation> elements and their child elements and attributes can be found in Section 9.6. Details of the <enrollment-result> element and its child elements can be found in Section 9.7. Details of the <verification-result> element and its child elements can be found in Section 11.5.2.

Guess you like

Origin blog.csdn.net/mimiduck/article/details/128266033