Prebuilt entities to recognize common data types
LUIS includes a set of prebuilt entities for recognizing common types of information, like dates, times, numbers, measurements, and currency.
Add a prebuilt entity
Open your app by clicking its name on My Apps page, and then click Entities in the left side.
On the Entities page, click Add prebuilt entity.
In Add prebuilt entities dialog box, select the datetimeV2 prebuilt entity.
Publish the app
The easiest way to view the value of a prebuilt entity is to query from the published endpoint.
In the top toolbar, select Publish. Publish to Production.
When the green success notification appears, select the Refer to the list of endpoints link to see the endpoints.
Select an endpoint. A new browser tab opens to that endpoint. Keep the browser tab open and continue to the Test section.
After the entity is added, you do not need to train the app.
Test the new intent at the endpoint by added a value for the q parameter. Use the following table for suggested utterances for q:
|Test utterance||Entity value|
|Book a flight tomorrow||2018-10-19|
|cancel the appointment on March 3||LUIS returned the most recent March 3 in the past (2018-03-03) and March 3 in the future (2019-03-03) because the utterance didn't specify a year.|
|Schedule a meeting at 10am||10:00:00|
Marking entities containing a prebuilt entity token
If you have text, such as
HH-1234, that you want to mark as a custom entity and you have Prebuilt Number added to the model, you won't be able to mark the custom entity in the LUIS portal. You can mark it with the API.
In order to mark this type of token, where part of it is already marked with a prebuilt entity, remove the prebuilt entity from the LUIS app. You don't need to train the app. Then mark the token with your own custom entity. Then add the prebuilt entity back to the LUIS app.
For another example, consider the utterance as a list of class preferences:
I want first year spanish, second year calculus, and fourth year english lit. If the LUIS app has the Prebuild Ordinal added,
fourth will already be marked with ordinals. If you want to capture the ordinal and the class, you can create a composite entity and wrap it around the Prebuilt Ordinal and the custom entity for class name.