You might wanna use this asset when you need to insert multiple entries at a dictionary. This my be used at the Synonyms Processor or at the following Recognizers: Regex, Advanced Regex, Simple Regex, Fragmented Regex, Best Bets, Entities, FAQ and Intent.
Steps to use the Importer:
Columns: fill the other fields with the name of the columns that matches the element you want to map to it
CSV: stands for "comma separated values" format of excel files, but it allows several separators delimited by a drop down (if the separator you require doesn't figures into the dropdown list, contact SAGA team).
It requires the name of the columns at the first row and the following rows should follow this pattern, as it's illustrated in the following image:
At any of those formats, "confidence" and "fields" fields are optional, if "confidence" is not included or doesn't have a value, 1 is automatically assigned to it. If "fields" is not included it stays blank.
You can use any name you want at the tags of any of the file formats as long as they are standardized in the file(s) you're going to upload. For example if you want to import 4 XML files make sure that they all have the same parent tags and child tags.
You can use the importer without the SAGA UI, there is an endpoint available to do imports (the same one that the UI uses, but on UI is more convenient to see all the options). However, if by any means, you need to do an import outside the UI, we've got you covered, you can call the SAGA API to do imports directly to a tag and to an specific recognizer (if the recognizer has the ability to import entries).
To do this, you need to make a POST request to the endpoint /saga/api/v2/importer/upload with the following body:
Body of the import request (must be a form-data body):
files => The file with the entries you want to import (Remember the 5 extension types we support)
config => The configuration of the current import
This is a dictionary-like object with all the info needed regarding the file extension you are using and the mapping of the values inside the file you want to import and the values inside the tag/recognizer.
Example:
{"fileExtension":".json","id":"id","display":"display","patterns":"patterns","fields":"","confAdjust":""}
model => The model type you are using, depends on the type of recognizer you are trying to import to, it could be one out of these values:
tagId => The ID of the tag you want to import entries into.
Example image using Postman: