I am trying to add custom term in text moderation service of azure for zho_chs language. but returning zho_chs is invalide code

Viewed 87

I Given "OriginalText" as input to detect offensive terms and it detected the language as zho_chs. below text is response from API

{
  "OriginalText": "some profanity in zho_chs\r\n",
  "NormalizedText": "some profanity in zho_chs\r\n",
  "Misrepresentation": null,
  "Language": "**zho_chs**",
  "Terms": null,
  "Status": {
    "Code": 3000,
    "Description": "OK",
    "Exception": null
  },
  "TrackingId": <my trackingID>
}

But Now I am trying to add the custom term to be detected for language zho_chs below is the response from custom term adding. except zho_chs we are able to add for spa,fra,jpn,eng,deu. only having problem with zho_chs.

The language code is invalid: zho_chs.

1 Answers

Azure Language Detection supported Chinese Simplified language code is zh_chs and not zho_chs

As per this, zho is ISO 639-2 Language Code while Azure Language Detection conform to ISO 639-1 Language Code identifiers.

You can refer to Languages supported by Language Detection

The Language Detection feature can detect a wide range of languages, variants, dialects, and some regional/cultural languages, and return detected languages with their name and code. The returned language code parameters conform to BCP-47 standard with most of them conforming to ISO-639-1 identifiers.

Note: Languages are added as new model versions are released. The current model version for Language Detection is 2021-01-05.

Related