Language Detection

Language detection can be called separately or as part of other functions.

Recognized languages

Our default mode distinguishes 31 languages:

ar - Arabic

el - Greek

he - Hebrew

pa - Panjabi

lt - Lithuanian

sk - Slovak

zh - Chinese

bg - Bulgarian

en - English

hi - Hindi

pl - Polish

nl - Dutch

sv - Swedish

cs - Czech

es - Spanish

hr - Croatian

it - Italian

no - Norwegian

tr - Turkish

da - Danish

fi - Finnish

hu - Hungarian

ja - Japanese

pt - Portuguese

uk - Ukrainian

de - German

fr - French

id - Indonesian

ko - Korean

ru - Russian

vi - Vietnamese

Priors

If you know your texts can be only in certain languages, you can specify a prior – a single language or a combination of several languages. Currently, the supported priors are:

cs,de

cs,en,sk

cs,de,es,fr,pl

de,en,es,fr

es,fr,pl

cs,en

cs,es,fr

cs,en,es,fr,pl

de,en,es,pl

fr,pl

cs,es

cs,es,pl

cs,de,en,es,fr,pl

de,en,fr,pl

en,zh

cs,fr

cs,fr,pl

de,en

de,es,fr,pl

cs,pl

cs,de,en,es

de,es

en,es

cs,sk

cs,de,en,fr

de,fr

en,fr

cs,de,en

cs,de,en,pl

de,pl

en,pl

cs,de,es

cs,de,en,sk

de,en,es

en,es,fr

cs,de,fr

cs,en,es,fr

de,en,fr

en,es,pl

cs,de,pl

cs,en,es,pl

de,en,pl

en,fr,pl

cs,en,es

cs,es,fr,pl

de,es,fr

en,es,fr,pl

cs,en,fr

cs,de,en,es,fr

de,es,pl

es,fr

cs,en,pl

cs,de,en,es,pl

de,fr,pl

es,pl

EU

Use the prior exactly as written above (the same order, no spaces) and pass it via the options parameter:

Sample call

curl -X POST https://api.geneea.com/v3/analysis \
-H 'Authorization: user_key <YOUR USER KEY>' \
-H 'Content-Type: application/json' \
-d '{
    "id": "1",
    "text": "The trip to Innsbruck was great.",
    "options": {"lang_prior":"en,fr"}',
    "analyses": ["language"]
}'

# On Windows, use \" instead of " and " instead of '
def callGeneea(input):
    url = 'https://api.geneea.com/v3/analysis'
    headers = {
        'content-type': 'application/json',
        'Authorization': 'user_key <your user key>'
    }

    return requests.post(url, json=input, headers=headers).json()

responseObj = callGeneea({
    "id": "1",
    "text": "The trip to Innsbruck was great.",
    "options": {"lang_prior":"en,fr"},
    "analyses": ["language"]
})

print(responseObj)

Customization

We can customize our language detection to your needs. Maybe your emails contain error messages in English, or product names sounding French, etc.