Text language detection
Detect the ISO language code and script of raw text strings to automate language routing, content moderation, and translation pipelines.
What it does
- Multi-script Identification: Resolves language from Unicode scripts across all 22 official Indic writing systems and Latin.
- Intra-script Disambiguation: Differentiates languages sharing identical scripts (e.g., distinguishing Marathi from Hindi in Devanagari, or Assamese from Bengali).
- Code-mixing Tolerance: Accurately identifies the matrix language in sentences mixing English and regional vocabulary.
1-Minute Quick Call
Identify the language of a raw text string immediately:
curl --location 'https://dhruva-api.bhashini.gov.in/services/inference/pipeline' \
--header 'Accept: */*' \
--header 'Authorization: <YOUR_INFERENCE_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"pipelineTasks": [
{
"taskType": "txt-lang-detection",
"config": {
"serviceId": "bhashini/indic-lang-detection-all"
}
}
],
"inputData": {
"input": [
{ "source": "നമസ്കാരം, സുഖമാണോ?" }
]
}
}'Shared Script Nuances
| Script Family | Shared Languages | Disambiguation Method |
|---|---|---|
| Devanagari | Hindi, Marathi, Sanskrit, Nepali, Konkani, Bodo, Maithili, Dogri | Vocabulary frequency and morphological suffixes (e.g. Marathi ळ, Sanskrit visarga) |
| Bengali-Assamese | Bengali, Assamese | Distinct characters (e.g. Assamese ৰ, ৱ) |
| Perso-Arabic | Urdu, Kashmiri, Sindhi | Specialized diacritics and nastaliq ligatures |
| Latin (Romanized) | Hinglish, Tanglish, Romanized Indic | Phonetic transliteration heuristics |
Try it out
Text Language Detection
Request
bhashini/indic-lang-detection-all
Add an inference API key to run.
curl
Response
Send a request to see the live response here.
Common Use Cases
- Multilingual Helpdesk Routing: Direct incoming citizen grievances or chat queries to the appropriate regional language queue.
- E-Commerce Search Normalization: Detect user search language to trigger the matching regional catalog index.
- Pre-Translation Auto-Detection: Pass unstructured text directly to an automated pipeline without requiring the user to specify source language.
Developer Guides & References
- Text to Text — translate once the language is detected.
- Model catalog — view the translation pair matrix.
- API reference — request/response payloads.