Quickstart: Use the Content Moderator client library

Marcian Bondoc 26 Reputation points
2022-10-02T08:57:28.453+00:00

Hello,

I am here for some guidance or confirmation regarding a microsoft azure cognitive service.

I have tried to play around with Content Moderator as suggested here --> https://learn.microsoft.com/en-us/azure/cognitive-services/content-moderator/try-text-api.

I want to mention that I have created a resource with free pricing option.

Then I wanted to test the api and I got the following response:
{
"OriginalText": "Romania este o tara deosebita.\nRahat de caine.\nRomania este o tara deosebita.",
"NormalizedText": "Romania este o tara deosebita.\nRahat caine.\nRomania este o tara deosebita.",
"AutoCorrectedText": "Romania este o tara deosebita.\nRahat de câine.\nRomania este o tara deosebita.",
"Misrepresentation": null,
"Language": "ron",
"Terms": null,
"Status": {
"Code": 3000,
"Description": "OK",
"Exception": null
},
"TrackingId": "c3be4ab6-8510-429c-abe9-b85f9f03b914"
}

The input text is in Romanian, my language.

However if the text is in english the response is more detailed:

{
"OriginalText": "Romania is a beautifull country!\nDog shit!\nRomania is a great country.",
"NormalizedText": "Romania beautifull country!\nDog shit!\nRomania great country.",
"AutoCorrectedText": "Romania is a beautiful country!\nDog shit!\nRomania is a great country.",
"Misrepresentation": null,
"Classification": {
"ReviewRecommended": false,
"Category1": {
"Score": 0.034762948751449585
},
"Category2": {
"Score": 0.2228672057390213
},
"Category3": {
"Score": 0.47950810194015503
}
},
"Language": "eng",
"Terms": [{
"Index": 30,
"OriginalIndex": 33,
"ListId": 0,
"Term": "dog shit"
}, {
"Index": 34,
"OriginalIndex": 37,
"ListId": 0,
"Term": "shit"
}, {
"Index": 34,
"OriginalIndex": 37,
"ListId": 0,
"Term": "shit!"
}],
"Status": {
"Code": 3000,
"Description": "OK",
"Exception": null
},
"TrackingId": "b8f4b82b-c33a-4751-8205-f86f225bf6bf"
}

I have been aware of this:

"For the language parameter, assign eng or leave it empty to see the machine-assisted classification response (preview feature). This feature supports English only.

For profanity terms detection, use the ISO 639-3 code of the supported languages listed in this article, or leave it empty."

But does it mean that the service can detect classification and terms for other languages or not? And if it can, how?

Can you give me an example in another language if it works out for you? And show the details you have inputed?

Thanks,

Marcian.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,305 questions
{count} votes