Language Detection API Quick Guide
This is a brief introduction to Intento Language detection REST API, the full REST API documentation is available by the link: https://github.com/intento/intento-api/blob/master/ai.text.detect-language.md
Language Detection Calls
To detect the language of a text, send a POST request to Intento API at https://api.inten.to/ai/text/detect-language. Specify the source text and the desired provider in the JSON body of the request as in the following example:
curl -XPOST -H 'apikey: <YOUR_API_KEY>' 'https://api.inten.to/ai/text/detect-language' -d ' { "context": { "text": "Hello, I would like to take a class at your University.", }, "service": { "provider": "ai.text.detect-language.microsoft.text_analytics_api.2-1" } }'
Please replace <YOUR_API_KEY> with your Production Key that is available at https://console.inten.to/dashboard.
The response contains detect-language results:
{ "results": [ [ { "language": "en", "confidence": 1 } ] ], "meta": {}, "service": { "provider": { "id": "ai.text.detect-language.microsoft.text_analytics_api.2-1", "name": "Microsoft Text Analytics API" } } }
The detect-language intent supports bulk requests for providers with such capability (right now only ai.text.detect-language.microsoft.text_analytics_api.2-1):
curl -XPOST -H "Trace: true" -H "apikey: <YOUR_API_KEY>" "https://api.inten.to/ai/text/detect-language" -d ' { "context": { "text": ["Hallo Welt!", "Hello world"] }, "service": { "provider" : "ai.text.detect-language.microsoft.text_analytics_api.2-1" } }'
Each segment's language is detected separately:
{ "results": [ [ { "language": "de", "confidence": 1.0 } ], [ { "language": "en", "confidence": 1.0 } ] ], "meta": {}, "service": { "provider": { "id": "ai.text.detect-language.microsoft.text_analytics_api.2-1", "name": "Microsoft Text Analytics API" } } }
Getting Available Providers
To get a list of available Dictionary providers, send a GET request to https://api.inten.to/ai/text/detect-language.
curl -H 'apikey: <YOUR_API_KEY>' 'https://api.inten.to/ai/text/detect-language'
The response contains a list of the providers available for the given constraints with information on using custom models, etc:
[ { "id": "ai.text.detect-language.microsoft.text_analytics_api.2-1", "vendor": "Microsoft", "description": "Text Analytics API", "production": true, "integrated": true, "billable": true, "own_auth": true, "stock_model": true, "custom_model": false }, { "id": "ai.text.detect-language.google.translate_api.v3", "vendor": "Google Cloud", "description": "Advanced Translation API", "production": true, "integrated": true, "billable": true, "own_auth": true, "stock_model": true, "custom_model": false } ]