Introduction:
What comes in your mind first when you think of the Entity Extraction AI model?
You might relate this with entities of Model Driven apps. However, this is not something related to it.
Entity here does not demonstrate the entities we see in Model Driven Apps in Dynamics CRM but they are nouns like color, number, city, language, etc. So here, we are talking about the AI model, which extracts the entities like color, person, city, country, etc. from unstructured text, which we can use as per our business needs.
For Example, below is the message received from a customer, “Hi, I am Sam from Canada. I have few questions on the application form. Could you please connect me with a French-speaking person from your team?”
Output of above text:
Entity | Entity Type |
Sam | Person |
Canada | Country |
French | Language |
With help of the Entity Extraction AI model, we could identify the key elements from the unstructured text and could classify them into predefined categories. Microsoft has added the Entity Extraction AI Model into its Dynamics 365 AI Builder capabilities.
There are two separate things that we should understand when we talk about the Entity Extraction AI Model.
We can leverage the potential of Entity Extraction AI Model in AI Builder using the below two ways,
In this blog, we will see how we can use Prebuilt Entity Extraction AI model with the help of a use case and in the next blog of this series; we will see the Custom Entity Extraction AI Model, which is in preview.
Prebuilt AI Models in AI Builder are models that let you add intelligence to applications and flows without gathering data and then building, training, and publishing your own models.
The prebuilt model is ready to use out of the box and comes with some predefined entity types.
Scenario:
Consider you run a retail store with a customer service department with several outlets nationwide; you go through a number of mentions in the reviews from your clients. Say, you got the below message from the customer on your social media platform,
“Hey could you help me out? I bought expensive blood glucose test strips in hurry but they were the wrong ones. So I went back to exchange to the Boston store but they wouldn’t let me return an unopened box.”
It would be good if we were able to apply intelligence and assign this case to the appropriate team based on the city.
We can use Prebuilt Entity Extraction AI model to achieve this.
Below are the steps to use the standard Entity Extraction Model in Power Automate Flow.
Here, we will use Twitter as a social media platform to analyze the customer messages and assign it to the appropriate team.
Step 1:
Sign in to Power Automate, navigate to Templates and search for Twitter and select the template shown in the below image. We will create our Power Automate flow from the existing template. You can also create Power Automate Flow inside the solution.
Step 2:
Sign In to your accounts and click on Continue. These accounts will be required to run our template flow.
Step 3:
Input a text in the Search text input box for the tweets you want to pass in our flow. We will give the organization’s hashtag to get the tweets related to it.
Step 4:
Delete all the predefined steps in the flow, which were created by the template. Add our new step and select AI Builder action.
Step 5:
Choose the “Extract entities from text with the standard model” from the list of options in AI Builder.
Step 6:
Select the language of input that you will use to add the data for extraction.
After selecting the language, add Tweet text from dynamic values, this will be our input data.
Step 7:
We are classifying the tweets based on city but there can be other entities as well in the same tweet. So, we need to add a condition that accepts only the City entity. For that, we will need to add Apply to each control in the next step, which will loop all the entities in the tweet and a condition to check if the entity type is City.
Add entities, they are an array of objects of the extracted entities. Then, click on Add an action and select Condition.
Step 8:
Add the condition where Entity type (City, Organization, Language, etc.) is equal to City.
This will accept only the City entity and reject the others.
This will classify the tweets and then you can proceed further with your business requirements like shown in the next step.
Step 9:
For example, we want to create a task record for tweets related to Boston. Hence, we can add a condition where we can check if the entity value is Boston. If yes, create / update the records as per the business requirements.
Step 10:
Finally, run the flow and check the extracted output.
Full Output:
[
{
“@odata.type”: “#Microsoft.Dynamics.CRM.expando”,
“type”: “Number”,
“startIndex”: 1,
“length”: 2,
“value”: “24”,
“score”: 0.8
},
{
“@odata.type”: “#Microsoft.Dynamics.CRM.expando”,
“type”: “City”,
“startIndex”: 150,
“length”: 6,
“value”: “Boston”,
“score”: 0.9
}
]
Following the above steps, we can use Prebuilt Entity Extraction AI model to achieve our business needs. If you know any other use case where we can use Entity Extraction AI model, feel free to share it with us in the comments. We would love to hear from you!
Conclusion
We have learned how to use the Prebuilt Entity Extraction AI Model in Power Automate Flow. In the next blog, we will see Custom Entity Extractions AI Model (Preview).