Language identification
POST /v1/language-idPOST /v1/language-id/batchbilled per textIdentifies 608 languages and holds up on short, messy user input. Powered by lid-neural-608 and lid-lite-608.
r = call("/v1/language-id", {"text": "Mo fẹ́ lọ sí ọjà"})print(r["language"], r["confidence"]) # yor 0.97Request
Section titled “Request”| Field | Default | Notes |
|---|---|---|
text |
required | Up to 8,000 characters. |
model |
lid-neural-608 |
lid-neural-608 is the most accurate; lid-lite-608 (fastText) is the fastest. |
mode |
traffic |
traffic is for user input, chat and routing: on short text it leans towards the languages people actually use. coverage treats every language equally, for building corpora. |
top_k |
3 |
1 to 25 runner-up languages in top. |
Response
Section titled “Response”{ "language": "yor", "script": "Latn", "label": "yor_Latn", "language_name": "Yoruba", "confidence": 0.97, "top": [{"label": "yor_Latn", "language": "yor", "score": 0.97}, {"label": "ibo_Latn", "language": "ibo", "score": 0.01}], "warnings": [], "model": "lid-neural-608", "mode": "traffic", "usage": {"texts": 1}}languageis ISO 639-3, andlabeladds the script (yor_Latn,srp_Cyrl).zxx_Zxxxmeans no language was found: the text is code, numbers or symbols. A warning says so.language_nameis filled in for the 25 question-generation languages, and is the code otherwise.
POST /v1/language-id/batch with "texts": [...] (up to 256) returns {"results": [...]} in the same order.
