How to import pre-existing NLP model (intents and entities) into BLiP September 19, 2022 12:37 Updated Index: Blip Watson Dialogflow LUIS Conclusion To import intentions and entities from providers into Blip, it is currently necessary to manually change files exported by providers so that they follow the Blip format. The export and import format of both Blip and providers will be described below. Following the described formats it is possible to transfer content from one platform to another. Blip The CSV format used by Blip to import / export Intentions uses the "tab" separator and keeps two pieces of information on each line of the file, the name of an intention accompanied by a phrase that exemplifies it. Example: sep= Name of Intention 1 Exemplo phrase A Name of Intention 1 Exemplo phrase B Name of Intention 2 Exemplo phrase C In the case of Entities, each line stores, separated by a comma, the name of an entity, its value, and all synonyms of a given value. The synonyms are separated by ‘/’. Example: sep=, Name of Entity 1, Valor A, Synonym 1/ Synonym 2/ Synonym 3/ Synonym 4 Name of Entity 1, Valor B, Synonym 1/ Synonym 2/ Synonym 3/ Synonym 4 Name of Entity 2, Valor A, Synonym 1/ Synonym 2/ Synonym 3/ Synonym 4 Name of Entity 2, Valor B, Synonym 1/ Synonym 2/ Synonym 3/ Synonym 4 Watson In the case of Watson, the intentions and entities are stored in a CSV like those of Blip. The Watson Intentions are stored with one example per line, with the Intent name at the end of the line. The example and the name of the Intent are separated by a comma. Example 1, Name of Intention 1 Example 2, Name of Intention 1 Example 1, Name of Intention 2 Example 2, Name of Intention 2 Example 3, Name of Intention 2 Entities are saved with one value per line. The entity's name, value and synonyms are saved, all separated by commas. Name of Entity 1, Value A, Synonym 1, Synonym 2 Name of Entity 1, Value B, Synonym 1, Synonym 2 Name of Entity 2, Value A, Synonym 1, Synonym 2 Dialogflow Dialogflow exports your intentions and entities in Json format. A folder for intentions and a folder for entities are generated. Each intention is divided into two files, a json that defines the intention and follows the format below: { "id": "ID of Intention", "name": "Name of Intention", "auto": true, "contexts": [], "responses": [ { "resetContexts": false, "affectedContexts": [], "parameters": [], "messages": [ { "type": 0, "lang": "pt-br", "speech": [] } ], "defaultResponsePlatforms": {}, "speech": [] } ], "priority": 500000, "webhookUsed": false, "webhookForSlotFilling": false, "fallbackIntent": false, "events": []} In a second file we have the example sentences for the intention. It follows this format: [ { "id": "ID of example 1", "data": [ { "text": "Example 1 of Intention", "userDefined": false } ], "isTemplate": false, "count": 0, "updated": 0 }, { "id": "ID of example 2", "data": [ { "text": "Example 2 of Intention", "userDefined": false } ], "isTemplate": false, "count": 0, "updated": 0 }] Entities follow a format similar to that of intentions. One file is generated to define the entity and another to list the values and synonyms related to that entity. The file that defines the entity follows the following format: { "id": "ID of Entity", "name": "Entity name", "isOverridable": true, "isEnum": false, "isRegexp": false, "automatedExpansion": false, "allowFuzzyExtraction": false} And the file that describes the values and synonyms follows this format: [ { "value": "Value 1", "synonyms": [ "Value 1", "synonym 1", "synonym 2" ] }, { "value": "Value 2", "synonyms": [ "Valor 2", "synonym 1", "synonym 2" ] }] LUIS In the case of LUIS, it is not possible to export intents and entities automatically. Therefore, it is not possible to automatically migrate a LUIS model into Blip. To perform the migration, copy and paste the information from your LUIS model into Blip. 😉 Conclusion In order to migrate the intentions and entities of a provider to Blip, it is necessary to understand the export / import format used by the provider and also by Blip. In general, the job consists of using the file exported by the provider and changing its formatting to follow the format accepted by Blip. After completing the conversion process, simply import the files containing your intentions and entities in the Blip. To import the prepared files, access the Portal, choose the bot and select the Artificial Intelligence module. Select the Intentions (or Entities) menu, on the left side menu, click the more options button, select Import intentions (or Import entities) and upload the file Blip-intentions.csv (or Blip-entities.csv). For more information, visit the discussion on the subject in our community or the videos on our channel. 😃 Related articles How to import/export a knowledge base How to configure Dialogflow as your AI provider Creating entities and intents How to use Content Assistant How to use test files to analyze my AI model