Using custom AI models to help your organization route your cases to different teams? Within AI Models in Power Apps you have the option now to create your own Custom Model, how cool is that?! In this blog I would like to use the AI builder Entity Extraction custom model. This allows you to let the AI model recognize data in (unstructured) text and transform that into custom or pre-defined categories. One of the benefits is that the model can be trained based on existing (own) data.
The business scenario I am using is for a company called Scheper Contoso, which is a global company segmented into three business units:
– PC and Equipment
– Entertainment (XBox, PlayStation and games etc.)
– Wearables (mainly focussing on smartwatches)
In our business case we receive questions from the web, Whatsapp and mail which are translated into Cases in D365 Service. Each of the business units have their own teams that will take care of these service requests.

Custom AI Model for entity extraction
First we need to create the Custom Model, this can be done by going to make.powerapps.com and navigate to AI Hub > AI Models

Here you will find all kinds of prebuild models as well as the option to create some custom models. In our case will find the custom model Entity Extraction. When selected you will see an example of how the model works with the custom categories that it can extract.

There are four steps in the process of creating your own custom model:
1. Identify for which table and column needs to be analyzed by the model.
Since in our case it is about routing cases, the Case table will be selected with the Description column
2. Select Language
One important note to make here is that not all languages are supported yet.
3. Review and refine
This is where you can also create your custom categories that you can use as entity tags
By default it is doing a first attempt to enable categories as well as tagging them in the data

For our needs we have removed the standard categories Event, Number and Organization which will also cause the data tags to be removed from the datasets. We decided to create the following three Categories which are in line with our business units of Scheper Contose company:
1. PC and Equipment
2. Entertainment
3. Wearables

After all three Categories have been created we will analyse the data and start tagging the data with the different entities. This exercise is as simple as selecting the text you want to tag, select from the dropdown of available entities which one it is.

4. Train the model
The model needs to be trained and once finished you can Publish the model, this is an important step in order to be able to use this model.

PowerAutomate Flow on Case Creation
Now I have created a PowerAutomate flow that will be triggered as soon as a case is created.
Next step would be to include our custom AI Model for entity extraction and you can search for the AI Builder components and find: Extract entities from text with one of your custom models

The following parameters need to be set:
1. Language
2. The custom AI Model for Entity Extraction.
Bear in mind that if you dropdown remains empty, please check if your model is published.
3. The field that you would like to pass to your model to be analyzed, in our situation that will be Case Description

In order for the customer service agents to see what has been extracted we are adding the results of the AI Model into a custom table linked to the Case.
This will show:
1. Entity that is recognized, so in our example Entertainment, Wearables and Laptop and Equipment.
2. Value that is extracted from the data, in our case Case Description
3. Confidence score
Finally, the case will be assigned to the Customer Service Team of the related Business Unit for further processing.

Case Management
On the case form there is now an AI Keyword Model section which is showing the keywords, values and scores. In our case the highest score will get the case, but you can imagine that there are other criteria or logic to assign the case to an user or team
