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.
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.
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:
Property | Type | Description |
---|---|---|
id | Number | Entity ID |
name | String | Entity name |
type | String | Entity type. Only the annotation type is currently supported |
enabled | Boolean | True when entity recognition is enabled |
noSpelling | Boolean | True when spelling correction is disabled |
noMorph | Boolean | True when word normalization is disabled |
fuzzySearch | Boolean | True when fuzzy/substring search is enabled |
client | Boolean | True when this is a client entity |
Dictionary records
The records
array contains objects with the following properties:
Property | Type | Description |
---|---|---|
id | Number | Record ID |
type | String | Record type: a pattern or a list of synonyms |
rule | Array of strings | Entity recognition rules |
value | String | Record 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.
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.