External NLU Engines
Define Languages​
One use-case for a 3rd party NLU is to support more languages in addition to those handled by Digital Agent Native NLU. For Digital Agent to keep working correctly with an additional language (defining intents & content), you'll have to tell Digital Agent the new languages you want to support. To do so, open Digital.Agent.config.json
and set the additionalLanguages
property. Let's say we want to support Swedish and Norwegian, the configuration would look like the following:
{ "additionalLanguages": [ { "code": "sv", "name": "Swedish" }, { "code": "no", "name": "Norwegian" } ] }
Sync NLU Data to 3rd Party​
This function lets you use the Digital Agent NLU interface to define your intents, entities, and slots. Intents and entities are stored as JSON in BPFS (formerly ghost) on the local filesystem or in the database.
To sync data, we need to listen to any intents/entities changes and persist the data to our 3rd party NLU (please go through the listening to file changes tutorial for more information). This way, when one edits intents or entities in the NLU UI, we get notified. We can do this with a Digital Agent after bot mount hook. You can use the code editor module to create hooks easily.
Here you go; you can now still use the Digital Agent NLU UI to define your intents/entities and push training data to your NLU engine.
Use your 3rd Party NLU for Classification and Extraction​
We will use a similar strategy during prediction time. What we want to do is call our 3rd party NLU for each incoming user message. We will use a before incoming hook, executed when Digital Agent receives a user message. The code is not complex if you keep in mind that Digital Agent works with a precise data structure, so you'll need to map the response data of your NLU provider to the Digital Agent NLU data format. The hook will look like the following:
That's about it; you now have Digital Agent integrated with your 3rd party NLU.
Confluence Cloud Migration Alert: Please refer to known issues you may encounter in Confluence Cloud: https://eitdocs.atlassian.net/wiki/x/wDGwAQ