data

  • Output field: Returns structured data.

Description

This element is designed to transfer structured data from brain to application, for example, intent recognition data. The data are firstly converted to an associative array with element attribute name/value as array key/value. BrainShop provides a set of default data and developers can define their own data.

  <data>
    <field1>value1</field1>
    <field2>value2</field2>
    ...
  </data>

Parameters

field

The field name, mapped to the array key.

value

The field value, mapped to the array value. Multiple values are separated with comma.

Examples

Example 1. Device control data

  • Cell
    • I feel hot
    • I'm turning air conditioner on for you. <data><intent>ac.on</intent></data>
  • Log
    • I feel hot.
    •           {
                  "cnt": "I'm turning air conditioner on for you.",
                  "intent": "ac.on"
                }
             

Notes

  • Although you can define any data to return, it's a good practice to use ones defined by system firstly. Doing so you may ensure your custom cells can be utilized by all devices or applications without compatibility issue.