Teneo Developers
Table of Contents
Was this page helpful?

Share to

Bulk Import

Currently the Bulk Import functionality is only available inTeneo Studio Desktop

The Bulk import feature of Teneo Studio allows users to create Language Objects, Entities or Question and Answers (Q&A) pairs outside Teneo Studio in csv file format and later import these into a solution.

This page describes the file format as well as the rules for Bulk Import; to learn how to perform a bulk import in Teneo Studio, please see here

Format

The Bulk Import works with the csv (comma delimited) file format; these files can be created with Excel or any other compatible editor.
The supported encoding is UTF-8 and UTF-8-BOM.

Rules

For each document type (i.e. Language Objects, Entities, Question and Answer pairs) there are different rules or specifications which applies to the csv file however, some general rules are shared among the documents:

  • Fields are separated by commas (,) or semicolon (;)
  • Start tags are prefixed with the number sign (#)
  • New line / carriage returns / extra delimiters are ignored
  • New lines starting with #ignore allows to omits the entire line during bulk import in Studio providing the option to write headers / comments in the csv file

In the below tabs, please find the rules per document type; the Details section further below provides detailed information of each tag and field.

In the csv file for Language Object creation, each line in the file represents a new Language Object and should be preceded with the #language_object tag (indicating the beginning of the Language Object). The tag can be followed by the fields shown in the below tables.

TagField 1Field 2Field 3Field 4Field 5Field 6
#language_object *name *alias **description **syntax *positive examplesnegative examples

* Mandatory fields with mandatory values These fields must exist in the file and contain values
** Mandatory fields with optional values These fields must exist in the file but the values can be left empty

Optional tags *
#folderfolder name
#nlu_variablesNLU variables nameNLU variables value
#variables **variables namevariables value

* Optional tags should be added to the same line as the #language_object tag they belong to
** Language Object Variables are deprecated as of Teneo Platform 7.0 and users are encouraged to use NLU Variables instead

To create a new Language Object, the user needs to - at least - give the new Language Object a name and write its TLML syntax and at the same time the fields for alias and description must exist in the file (although the user can choose to leave them empty). This means that the import of a Language Object in its simplest form, only providing a name and a TLML syntax, will look similar to the below:

#ignore,Language Object name,Description,Positive examples,TLML Syntax #language_object,HAPPY.ADJ.LEX, , ,happy/happier/happiest

Or, the same, but in a table:

#ignoreLanguage Object nameDescriptionPositive examplesTLML Syntax
#language_objectHAPPY.ADJ.LEXhappy/happier/happiest

For more examples, please see the Examples sections further below.

Quotes

For Language Objects and Q&A pairs, when creating the csv file in a text editor or similar, the usage of quotes needs a special treatment, where double quotes ("") must be escaped with an extra set of double quotes and, in addition, the entire field must be double quoted.

Example TLML Syntax

"Anderson>>""&"">>(co/company)"

TLML syntax with quotes

String NLU Variable values

"""New York"""

For string NLU Variable values, Groovy also permits single quotes and they can be added to the csv file without having to be escaped.

'New York'

Both of the above examples of quotes are displayed in Teneo Studio as visualized in the below image.

Variable example

Details

This section describes in more details the tags and fields for each of the document types.

Tags and fieldsNecessityDescription
#language_objectMandatoryIndicates the beginning of a new Language Object
nameMandatoryName of the Language Object * Must be written in capital letters * Must be unique (both within the file and within the solution to which it is imported)* Must not contain spaces, reserved characters, etc.
aliasMandatory field, optional valueAlias of the Language Object * Must be written in capital letters * Must be unique (both within the file and within the solution to which it is imported)
descriptionMandatory field, optional valueDescription of the Language Object
syntaxMandatoryTLML syntax of the Language Object
positive examplesOptional field/value, fixed placementPositive examples of the Language Object * Positive examples must always be written in field 5 (see above table)* Separate examples with a slash (/)
negative examplesOptional field/value, fixed placementNegative examples of the Language Object * Negative examples must always be written in field 6 (see above table) * Separate examples with a slash (/)
#nlu_variablesOptionalIndicates that at least the following two fields contain a name and a value of an NLU variable
NLU variables nameMandatory when the #nlu_variables tag is addedName of the NLU variable
NLU variables valueMandatory when the #nlu_variables tag is addedValue of the NLU variable
#variables *OptionalIndicates that at least the following two fields contain a name and a value of a Language Object variable
variables nameMandatory when the #variables tag is addedName of the Language Object variable
variables valueMandatory when the #variables tag is addedValue of the Language Object variable
#folderOptionalThe folder name is relative to the selected folder in Teneo Studio upon Bulk Import
folder nameOptionalSpecify a folder path by separating each folder with slash (/)

* Language Object Variables are deprecated as of Teneo Platform 7.0 and users are encouraged to use NLU Variables instead

Examples

In the below tabs, please find examples for each of the documents types on how the files for bulk import can be set up. The information in the code blocks can be copied/pasted into an editor which can then be saved in .csv format and bulk imported into Studio. Please, the below examples are only created as examples to help understand how to set up the csv files for bulk import.

If copying/pasting into Excel, select the data and then go to Data and click Text to Columns, in the Convert Text to Columns Wizard leave the setting at Delimited click Next, choose Comma and click Next again and last click "Finish", the data is now available in the appropriate fields and can be edited/updated as wanted. Remember to save the file again in the csv (comma delimited) format before performing the bulk import.

Below please find in the code block an example of a bulk import of four Language Objects.

The first line of the file contains the #ignore tag allowing to specify headers in the following fields, followed by the tags and values in the next lines/fields. There are four Language Objects to import: AIRPORTS.DENMARK.LIST, COPENHAGEN_AIRPORT.NN.SYN, ODENSE_AIRPORT.NN.SYN and BILLUND_AIRPORT.NN.SYN, each contain a description as well as a TLML syntax, and the three latter contains examples of NLU Variables.

#ignore,Language Object name,Alias,Description,TLML syntax,Positive examples,Negative examples,NLU variables,variable name,variable value,,, #language_object,AIRPORTS_DENMARK.LIST,,List of main airports in Denmark,%COPENHAGEN_AIRPORT.NN.SYN / %ODENSE_AIRPORT.NN.SYN / %BILLUND_AIRPORT.NN.SYN,Kastrup/Aalborg airport/ODE/Copenhagen airport,,,,,,, #ignore,,,,,,,,,,,, #language_object,COPENHAGEN_AIRPORT.NN.SYN,,Copenhagen/Kastrup airport,CPH/(copenhagen>>airport)/(kastrup>>airport)/(Copenhagen>>airport>>kastrup),,,#nlu_variables,sCity,"""Copenhagen""",#nlu_variables,airportCode,"""CPH""" #language_object,ODENSE_AIRPORT.NN.SYN,,Odense/Hans Christian Andersen airport,ODE/(odense>>airport)/(hans>>christian>>andersen>>airport),,,#nlu_variables,sCity,"""Odense""",#nlu_variables,airportCode,"""ODE""" #language_object,BILLUND_AIRPORT.NN.SYN,,Billund airport,BLL/(billund>>airport),,,#nlu_variables,sCity,"""Billund""",#nlu_variables,airportCode,"""BLL"""