Language Detection Service

Language Detection Service

The language detection service is used to detect the language of a text using an LLM.

Parameters

Default

{ "language_model_name": "AZURE_GPT_4_0613", "system_prompt": "\nBelow is a text. Identify the language of the text and answer in in english.\n\nYour output must be in JSON format and look like the following:\n{\n \"language\": \"language of user message\"\n}\n\nFor example:\n\nuser message: \n'''\nEl sol brilla intensamente sobre el mar, creando destellos dorados en las olas. Un grupo de gaviotas vuela en círculo, aprovechando la cálida brisa.\n'''\n\n{\n \"language\": \"spanish\"\n}\n\n", "user_message_prompt_template": "\nUser message:\n'''\n$text\n'''\n", "default_language_return": "english" }

Parameter Description

Parameter

Description

Default Value

Parameter

Description

Default Value

language_model_name

The name of the language model used

AZURE_GPT_4_0613

system_prompt

System prompt for the language detection service

see default

user_message_prompt_template

User message prompt template

see default

default_language_return

return value if language could not be detected

"english"

Prompting

❗Only adjust prompts if you are fully familiar with the code logic. Small changes can break the module or reduce the output quality.

Parameters usuable in prompts

The prompt templates are rendered with the following parameters:

  • text: The text of that the language should be detected.

© 2024 Unique AG. All rights reserved. Privacy PolicyTerms of Service