ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 41 - MLS-C01 discussion

Report
Export

A company that runs an online library is implementing a chatbot using Amazon Lex to provide book recommendations based on category. This intent is fulfilled by an AWS Lambda function that queries an Amazon DynamoDB table for a list of book titles, given a particular category. For testing, there are only three categories implemented as the custom slot types: 'comedy,' 'adventure,'' and 'documentary.''

A machine learning (ML) specialist notices that sometimes the request cannot be fulfilled because Amazon Lex cannot understand the category spoken by users with utterances such as 'funny,' 'fun,' and 'humor.' The ML specialist needs to fix the problem without changing the Lambda code or data in DynamoDB.

How should the ML specialist fix the problem?

A.
Add the unrecognized words in the enumeration values list as new values in the slot type.
Answers
A.
Add the unrecognized words in the enumeration values list as new values in the slot type.
B.
Create a new custom slot type, add the unrecognized words to this slot type as enumeration values, and use this slot type for the slot.
Answers
B.
Create a new custom slot type, add the unrecognized words to this slot type as enumeration values, and use this slot type for the slot.
C.
Use the AMAZON.SearchQuery built-in slot types for custom searches in the database.
Answers
C.
Use the AMAZON.SearchQuery built-in slot types for custom searches in the database.
D.
Add the unrecognized words as synonyms in the custom slot type.
Answers
D.
Add the unrecognized words as synonyms in the custom slot type.
Suggested answer: D

Explanation:

The best way to fix the problem without changing the Lambda code or data in DynamoDB is to add the unrecognized words as synonyms in the custom slot type. This way, Amazon Lex can resolve the synonyms to the corresponding slot values and pass them to the Lambda function. For example, if the slot type has a value ''comedy'' with synonyms ''funny'', ''fun'', and ''humor'', then any of these words entered by the user will be resolved to ''comedy'' and the Lambda function can query the DynamoDB table for the book titles in that category. Adding synonyms to the custom slot type can be done easily using the Amazon Lex console or API, and does not require any code changes.

The other options are not correct because:

Option A: Adding the unrecognized words in the enumeration values list as new values in the slot type would not fix the problem, because the Lambda function and the DynamoDB table are not aware of these new values. The Lambda function would not be able to query the DynamoDB table for the book titles in the new categories, and the request would still fail. Moreover, adding new values to the slot type would increase the complexity and maintenance of the chatbot, as the Lambda function and the DynamoDB table would have to be updated accordingly.

Option B: Creating a new custom slot type, adding the unrecognized words to this slot type as enumeration values, and using this slot type for the slot would also not fix the problem, for the same reasons as option A. The Lambda function and the DynamoDB table would not be able to handle the new slot type and its values, and the request would still fail. Furthermore, creating a new slot type would require more effort and time than adding synonyms to the existing slot type.

Option C: Using the AMAZON.SearchQuery built-in slot types for custom searches in the database is not a suitable approach for this use case. The AMAZON.SearchQuery slot type is used to capture free-form user input that corresponds to a search query. However, this slot type does not perform any validation or resolution of the user input, and passes the raw input to the Lambda function. This means that the Lambda function would have to handle the logic of parsing and matching the user input to the DynamoDB table, which would require changing the Lambda code and adding more complexity to the solution.

References:

Custom slot type - Amazon Lex

Using Synonyms - Amazon Lex

Built-in Slot Types - Amazon Lex

asked 16/09/2024
Marcelo I Sotelo S
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first