Azure AI Solution | Designing and Implementing Microsoft Azure AI | AI-102 Exam Solution

LUIS Prebuilt Entity Type and Subtype Selection | AI-102 Exam Answer

Question

Review the JSON code snippet given below and complete it by selecting the entity type and subtype for a prebuilt entity in a LUIS application:

"documents": [{ "id": "1", "entities": [{ "name": "last week", "matches": [{ "entityTypeScore": 0.8, "text": "last week", "offset": 34, "length": 9 }], "type": "..........................", "subType": ".........................." }] }], 

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

Correct Answers: A and B

Here is the completed code for reference:

<pre>"documents": [{

"id": "1",

"entities": [{

"name": "last week",

"matches": [{

"entityTypeScore": 0.8,

"text": "last week",

"offset": 34,

"length": 9

}],

"type": "DateTime",

"subType": "DateRange"

}]

}],

</pre>Option A is correct.

Named entity recognition provides the ability to recognize and identify items in the text.

In this code snippet, the prebuilt entity type DateTime is used for categorization.

Option B is correct.

While not all entity types have subtypes, the “DateTime” entity type offers sub-type DateRange, apart from other subtypes, that is correct for this example.

Option C is incorrect because the event entity type is used with a historic, naturally occurring or a social event.

Option D is incorrect because location entity type is used for a location such as a landmark or a geographical feature.

Option E is incorrect because duration subentity type is measures in units such as seconds.

Reference:

To learn more about DateTime prebuilt entity type in LUIS applications, use the link given below:

The given JSON code snippet shows an array of documents with ID 1, and each document contains an array of entities. The "matches" property within the entities array describes the matching text, score, offset, and length of the identified entity.

Based on the available options, the "type" and "subType" fields need to be completed to indicate the prebuilt entity type and subtype respectively.

The prebuilt entity types in LUIS (Language Understanding Intelligent Service) refer to a set of commonly used entities such as date, time, number, currency, age, etc., that are already built into the system and can be easily identified by LUIS.

The available options for "type" and "subType" fields in the given JSON code are:

A. DateTime: This prebuilt entity type represents a date and/or time value. It can be used to extract a specific date and time value from the user input, such as "last week", "today", "tomorrow", "next Friday", etc.

B. DateRange: This prebuilt entity type represents a range of dates. It can be used to extract a start and end date from the user input, such as "from Monday to Friday", "between 10th March and 15th March", etc.

C. Event: This prebuilt entity type represents a specific event or activity. It can be used to extract the name of an event, such as "concert", "party", "conference", etc.

D. Location: This prebuilt entity type represents a physical location. It can be used to extract a specific location from the user input, such as "New York City", "Eiffel Tower", "Central Park", etc.

E. Duration: This prebuilt entity type represents a period of time. It can be used to extract a duration value from the user input, such as "2 hours", "3 days", "1 week", etc.

Given the matching text "last week", the most appropriate prebuilt entity type and subtype to use in this case is "DateTime" for the "type" field and "Date" for the "subType" field.

Therefore, the completed JSON code snippet would look like this:

<pre>"documents": [{ "id": "1", "entities": [{ "name": "last week", "matches": [{ "entityTypeScore": 0.8, "text": "last week", "offset": 34, "length": 9 }], "type": "DateTime", "subType": "Date" }] }]</pre>