Detect Language

Estimated reading: 3 minutes 17 views

This activity analyzes the provided input text and determines its primary language and returns the detected language as output.

How It Works

The activity analyzes the input text and determines the language based on linguistic patterns and vocabulary usage.

Note:

a. When multiple languages are present in the input, the activity does not return all detected languages. Instead, it identifies the most frequently used language and provides it as the output.
b.
The detection is based on the majority of words and their linguistic characteristics in the input text.

Example:

Input:

“Address of the employee is No.12, rue de la Mémoire, Venise, Italie.”

Processing:

a. The text includes both English and French elements.
b. The majority of the words are in English, so the detected language is determined as English.

Technical Reference

Configuration

Each activity requires a connection with GEN AI activities. Once you select the respective project name where Gen AI activities has been integrated, the activity will automatically retrieve the available connections for that project.

Below are the properties available after the project has been integrated:

Harmony Gen AI: This parameter indicates the account name associated with integration.

Model Type: Specifies to choose the list of models available for GEN AI integration. By default, it will be chosen as “Default – Llama 3.1” model.

Input

Text: Specifies the input text for language detection. It accepts values either as a string enclosed in double quotes or as a string variable.

Test: This option enables you to test the provided input and view the output simultaneously. Selecting this option opens the Co-Pilot assistant, allowing you to test and integrate the output seamlessly.

Output

Detected Language: Returns the detected language as a string variable.

Object: Provides the output as a custom class object containing details from the GEN AI API call, including confidence score, tokens used, and other parameters.

How to view the output?

The Detect Language activity generates a specific data type that includes details such as account information, confidence score, and token usage. To access and retrieve this data, follow these steps

1.In your workflow, drag and drop the Write Log activity from the Activities panel.
2. In the Write Log activity’s “Input” property, enter the variable name that holds the activity’s output. For example, if the output is stored in a variable named “Test”, you would enter “Test”.
3. Press “CTRL + Spacebar” to open the IntelliSense menu, which displays a list of available parameters and properties for the specified variable.
4. Choose the desired parameter from the list to include it in your output. For instance, to view the Account ID, you might select Test.ID.
5. Execute your workflow.

The specified parameters will be printed to the Output panel, allowing you to verify the details of the created account.

Share this Doc

Detect Language

Or copy link

CONTENTS