AI-102 Practice Question: Implement natural language processing solutions
Exhibit
Refer to the exhibit.
$endpoint = "https://mytextanalytics.cognitiveservices.azure.com/"
$key = "myKey"
$headers = @{
"Ocp-Apim-Subscription-Key" = $key
"Content-Type" = "application/json"
}
$body = @{
"documents" = @(
@{
"id" = "1"
"text" = "The product is excellent and very useful."
"language" = "en"
}
)
} | ConvertTo-Json
$uri = "$endpoint/text/analytics/v3.1/sentiment"
$response = Invoke-RestMethod -Uri $uri -Method Post -Headers $headers -Body $bodyYou run the PowerShell script above to call the Text Analytics API. The response shows a sentiment label of 'positive' with a score of 0.99. However, you expected 'negative' because the word 'excellent' was meant to be sarcastic. What is the most likely reason for this result?
⚠ Common exam trap
A common mix-up: candidates assume the API can infer sarcasm or implied sentiment, when in fact the model performs only literal, surface-level sentiment analysis based on word choice and phrase patterns.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The model does not detect sarcasm and interprets the text literally.
The Text Analytics API performs sentiment analysis using a machine learning model that evaluates the literal wording of the text. It does not have built-in capability to detect sarcasm, irony, or implied meaning. Therefore, the word 'excellent' is interpreted as positive regardless of the intended sarcastic tone, resulting in a high positive score.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The score threshold for negative sentiment is too high.
Why it's wrong here
The score is near 1.0, strongly positive.
- ✗
The language parameter is set incorrectly.
Why it's wrong here
Language is correctly set to English.
- ✗
The API version does not support sentiment analysis.
Why it's wrong here
Version 3.1 supports sentiment analysis.
- ✓
The model does not detect sarcasm and interprets the text literally.
Why this is correct
Sarcasm detection is not a built-in feature.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AI-102 question from scratch — 945 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AI-102 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-102 exam.