Introduction

Data source is a feature built for those cases where the bot needs to respond from a tabular set of values pertaining to objects and their attributes. This becomes a very handy feature which gets your bot set up in just a few minutes if all you have is an Excel file with data pertaining to a list of objects, each in a row and their corresponding values for various attributes in the columns. This works on top of the entities and intent feature to auto-generate these for you based on the data to quickly get started with the bot.


Creating a data source 

Creating a data source is a set of steps to upload and validate the information. The first step is to upload a file which has the tabular data. Supported file formats are .xls, ,xlsx and .csv. A sample file is also attached for reference. Although this functionality is meant to support generic data inputs, some structure is expected.


Download a sample data source here.


Once the data sheet is uploaded, an entity is created internally of type “Custom Values” to track the various values of the objects which are defined. All the first column entries are treated as the different custom values of the entity. 


After the file is uploaded, it is per-processed and the entity values and entity names are retrieved and shown to the user for their validation. The first cell is taken as the entity name. All the different elements of the first column are taken as the entity values. The user can change the entity name which is retrieved or continue with the same. Here, they can also assign a name to the data source. 


Generation of entity and intents from the data source

Once the files are processed and handled the following things happen –

  • As mentioned above, a new entity is created with the values of the first column.
  • Multiple intents are created, each associated with each column/attribute.
  • The entity extracted becomes a mandatory entity for these generated intents.
  • The column name becomes the default variation for these intents. User can always add more variations to these sets.
  • The responses for these intents are also generated and set as the reference value associated for the particular cell. This is done by the dynamic identifier for the values. An example being – {{context.CourseName.Start_Date}}. Here CourseName is the entity name and Start_Date would refer to the value in the Start Date column of the excel.
  • These intents are associated with the data source and the life cycles are tied to each other. So, if a data source is deleted, the corresponding linked intents are also cleaned up.