You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cannot suceed in getting custom model with "category" param #28
There is no code sample on category model virtually nowhere (but quite a bunch of resources go into training category models)
Based on this github's example, code:
import os, requests, uuid, json
# If you encounter any issues with the base_url or path, make sure
# that you are using the latest endpoint: https://docs.microsoft.com/azure/cognitive-services/translator/reference/v3-0-translate
path = '/translate?api-version=3.0'
params = '&to=et&allowFallback=false&category=fb67ae7d-c962-47dc-ae06-21b6086316c2-INTERNT'
constructed_url = endpoint + path + params
headers = {
'Ocp-Apim-Subscription-Key': key,
'Ocp-Apim-Subscription-Region': region,
'Content-type': 'application/json',
'X-ClientTraceId': str(uuid.uuid4())
}
# You can pass more than one object in body.
body = [{
'text' : 'Hello World!'
}]
request = requests.post(constructed_url, headers=headers, json=body)
response = request.json()
print(json.dumps(response, sort_keys=True, indent=4, ensure_ascii=False, separators=(',', ': ')))
Error:
{
"error": {
"code": 400079,
"message": "The custom system requested for translation between from and to language does not exist."
}
}
This model is dictionary, but full models give same error
Activity