This site is no longer updated.Go to new Conversational Cloud docs

Named entity dictionaries


.csv are named entity dictionaries.

Named entity dictionaries are used for bulk processing of multiple named entities via patterns.

A named entity is a word or a phrase that relates to a certain object or event and distinguishes that object or event among objects or events of similar type. These can be names of cities, countries, currencies.

Dictionaries are specified in files with the .csv extension. File line structure:

id; name; value

Here:

  • id is the unique string identifier of the entity.
  • name is the name of the entity; you can enumerate multiple synonyms inside an element. When you connect your dictionary to the script, these words become the elements of the pattern to which your bot will respond.
  • name is the name of the entity (string or json). Here you can add some information that relates to the entity in order to use it in your script later.

The name parameter enumerates all the synonyms; one of the json fields specifies the primary value.

For example, here is a part of a named entity list:

149;Ciaran;{"name": "Ciaran", "sex": "male"}
150;Carl;{"name": "Carl", "sex": "male"}
151;Claudius;{"name": "Claudius", "sex": "male"}
152;Claude;{"name": "Claude", "sex": "male"}
153;Constantine,Costya;{"name": "Constantine", "sex": "male"}
154;Clement;{"name": "Clement", "sex": "male"}

Including a dictionary

The require tag is used to include a dictionary. Specify the path to the file and the values of the name and var parameters:

require: dictionary/cities.csv
         name = City
         var = $City

name is used to create a named pattern that uses this dictionary; var is used to access the contents of the dictionary from script snippets.