AI-102 • Practice Test 38
Free AI-102 practice test — 15 questions with explanations. Set 38. No signup required.
You 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?
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 $body