Skip to main content
Cohere
current

Search documentation

Type to search this documentation.

On this pageOverview

Language Detection

Language detection is a necessary first step for businesses that deal with multilingual user bases. Whether you are working with a single multi-lingual model or a multi-model environment, understanding the language of a request (e.g. query, input) is paramount to a good user experience.

Detect Language API identifies the language used in each of the provided texts. For each input, the API will come back with the following:

  • language_name - the full name of the language the input is in.
  • language_code - the ISO code of the language. For example, the language code for English is en.

Use a single multilingual model to handle both English and non-English queries. Identify the language of an incoming query and filter your results by matching languages for monolingual retrieval with a multilingual model - in addition, you can specify which languages you want to filter for in a cross-lingual retrieval setup.

Use multiple models for English and non-English embeddings. Identify a query in its respective language and route the request to different models depending on your setup. For example, if a query is in identified as English, route it to our default English embed model, if not, route it to our multilingual embed model.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu