Skip to main content

Entity export and import

In new projects, you can reuse entities created in other projects by using the export and import features.

For each entity, you can also import records as files following the same format as named entity dictionaries.

Export

To export all entities from the project, navigate to Entities and click above the list of entities. A JSON file will be downloaded, which can be used for importing entities to a new project.

tip
You can also export the entire project by clicking  → Download next to the project name. In the downloaded archive, the nlu.json file contains NLU data, including entities and their settings.

Import

To import entities, navigate to the Entities section and click Import on the top panel. Select the necessary file and what should be done with existing entities and entities having duplicate names. Click Import again.

tip
The file contains an array of entities with all their basic and additional settings, as well as the whole contents of their dictionaries.

File structure

Every object in the array contains two properties: entity with the entity settings, and records with its dictionary records.

Entities

The entity object contains the following properties describing the entity settings:

PropertyTypeDescription
idNumberEntity ID
nameStringEntity name
typeStringEntity type. Only the annotation type is currently supported
enabledBooleanTrue when entity recognition is enabled
noSpellingBooleanTrue when spelling correction is disabled
noMorphBooleanTrue when word normalization is disabled
fuzzySearchBooleanTrue when fuzzy/substring search is enabled
clientBooleanTrue when this is a client entity

Dictionary records

The records array contains objects with the following properties:

PropertyTypeDescription
idNumberRecord ID
typeStringRecord type: a pattern or a list of synonyms
ruleArray of stringsEntity recognition rules
valueStringRecord data

File example

The imported file must be in JSON format. The following example illustrates a valid file:

[
{
"entity": {
"name": "City",
"type": "annotation",
"id": 45002,
"enabled": true,
"noSpelling": true,
"noMorph": false,
"fuzzySearch": false,
"client": false
},
"records": [
{
"type": "pattern",
"rule": [
"(New York [City]/NYC)"
],
"value": "{\n \"name\": \"New York\"\n}",
"id": 1798875
},
{
"type": "synonyms",
"rule": [
"Los Angeles",
"LA"
],
"value": "{\n \"name\": \"Los Angeles\"\n}",
"id": 1798874
}
]
}
]

Import as CSV

Records for a single entity can also be imported as a CSV dictionary. In the Dictionary section of the required entity, press Import dictionary and upload the file.

tip
The imported files should have the same format as named entity dictionaries which can be directly imported into the script.

This is an example of a valid dictionary:

1;New York City, NYC;{"name": "New York"}
2;Los Angeles, LA;{"name": "Los Angeles"}

When imported, words from the second column and separated by a comma will be converted to entity synonyms. Objects from the third column will be saved as record data.