Directionality
Detect language
Detect the dominant language, script and base direction of a string, with one segment per language. Built for short, code-switched input such as chat messages, search queries and voice transcripts: a brand, product name or acronym inside a Hebrew or Russian sentence ("PayPal", "iPhone", "API") does not change the dominant language, and Hebrew prefixes joined by a hyphen ("ה-API") are split correctly. Links and email addresses are ignored. Latin script is tagged en.
Quota. Deterministic, no model. Does not consume the character quota.
Limits. text up to 20,000 characters. Idempotent.
post/v1/detect
Request
- Base URL: https://hc.itsbaba.com
- URL: https://hc.itsbaba.com/v1/detect
- Auth: HTTP bearer
Request body
Example request
{
"text": "Можно оплатить через PayPal сегодня?"
}Response
Detection
Example response
{
"lang": "ru",
"script": "Cyrl",
"dir": "ltr",
"confidence": 0.941,
"segments": [
{
"text": "PayPal ",
"start": 21,
"end": 28,
"script": "Latn",
"lang": "en"
}
],
"languages": [
{
"lang": "ru",
"share": 0.941
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.