Samples node
The samples consist of phrases or sentences that are used to train your NLU model. Samples are labeled with intents and annotated with entities.
Sample XML meta
<samples>
<sample intentref="str" description="str" count="int" excluded="bool">
token1 token2 token3
<annotation conceptref="str">
token4 <annotation conceptref="str">token5</annotation>
</annotation>
token6
</sample>
</samples>
Samples node specification
The samples node is defined as follows:
- The
samplesnode contains zero-manysamplenodes. - Each
samplenode contains zero-manyannotationnodes. - Each
annotationnode specifies an annotation for the sample. It has the requiredconceptrefattribute, which specifies the entity for the annotation. - The
annotationnode can be nested if the ontologyconcepthas the appropriaterelationsdefined.
Each sample node has the following attributes:
| Attribute | Required? | Description |
|---|---|---|
| description | Optional | Description of the sample. |
| count | Optional | Relative frequency of this sample being spoken in your application. |
| intentref | Optional | The intent it expresses or is part of. |
| excluded | Optional | Specifies whether the sample should included in the training set when building a model. Default value is false; that is, sample is included. |
| fullyVerified | Optional | Specifies whether the sample has been assigned an intent and annotation is complete and verified as correct. Default value is false; that is, sample is not annotation-assigned. See Verify samples for details. |
| protected | Optional | Used to identify data that is confidential and should not be exposed. Default value is false. Do not set this field to true, otherwise you will not be able to access the data. |
| sourceref | Optional | Source of the sample. For example: DTV_Domain. |
Samples node example
This example shows numerous samples, all with annotations and annotated with the single intent: the SEARCH use case.
<sample intentref="SEARCH" count="1">I'd like to find<annotation conceptref="SEARCH_QUERY">good coffee places nearby</annotation>on<annotation conceptref="SEARCH_ENGINE">bing</annotation>
</sample>
<sample intentref="SEARCH" count="1">look up<annotation conceptref="SEARCH_QUERY">Edward Snowden</annotation>on<annotation conceptref="SEARCH_ENGINE">duckduckgo</annotation>
</sample>
<sample intentref="SEARCH" count="1">
<annotation conceptref="SEARCH_ENGINE">google</annotation>
<annotation conceptref="SEARCH_QUERY">how long does a sequoia live</annotation>?
</sample>
Sample schema
<xs:element name='samples'>
<xs:annotation>
<xs:documentation>Samples: Training set data that is used to train on; data has weights, intent classifications, and may be excluded.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs='0' maxOccurs='unbounded' ref='sample'/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name='sample'>
<xs:annotation>
<xs:documentation>Sample: A specific instance of an utterance in the training set. The utterance may have annotations.</xs:documentation>
</xs:annotation>
<xs:complexType mixed='true'>
<xs:sequence>
<xs:element minOccurs='0' maxOccurs='unbounded' ref='annotation'/>
</xs:sequence>
<xs:attribute name='description' use='optional' type='xs:string'/>
<xs:attribute name='count' use='optional' type='xs:integer'/>
<xs:attribute name='intentref' use='optional' type='xs:NCName'/>
<xs:attribute name='excluded' use='optional' type='xs:boolean' default='false'/>
<xs:attribute name='fullyVerified' use='optional' type='xs:boolean' default='false'/>
<xs:attribute name='protected' use='optional' type='xs:boolean' default='false'/>
<xs:attribute name='sourceref' use='optional' type='xs:NCName'/>
</xs:complexType>
</xs:element>
<xs:element name='annotation'>
<xs:annotation>
<xs:documentation>Sample Annotation: Annotations are used to tag entities present within utterances.</xs:documentation>
</xs:annotation>
<xs:complexType mixed='true'>
<xs:sequence>
<xs:element minOccurs='0' maxOccurs='unbounded' ref='annotation'/>
</xs:sequence>
<xs:attribute name='conceptref' use='required' type='xs:NCName'/>
</xs:complexType>
</xs:element>
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.