Language Detector
Language Detector identifies which language a text is written in. It receives one or more records, reads the text of each one and adds a field with the detected language. You can then decide what to do with each record based on its language.
When to use it
- Sort customer emails by language and send them to the right team.
- Choose which language to reply in before passing a message to an agent.
- Tag reviews or comments by language to analyze them per market.
- Filter out documents that are not in the language you expect.
Configuration
| Field | What it does |
|---|---|
| Data or Text | The records whose language you want to detect. Connect it to the output of the previous component. Accepts one or more records. |
Advanced options
| Field | What it does |
|---|---|
| Input Key with the text to detect | Name of the field in each record that holds the text to analyze. Default: text. |
| Output Key to store the detected language | Name of the new field where the detected language is stored. Default: language. |
Output
- Language: the language of all the text received, as a two-letter code (
es,en,fr…). - Data: the same records that came in, each with a new field (by default
language) holding the detected language as a two-letter code (es,en,fr…), or empty if it cannot be told. Connect it to a component that decides what to do based on the language, such as Switch.
Example
You receive reviews for your online store from several countries. You connect the list of reviews to Language Detector, which adds the language field to each one. Then a Switch using the language key sends Spanish reviews to an agent that replies in Spanish and English reviews to another that replies in English.
Good practices
- Make sure the field set in Input Key with the text to detect exists in your records. If it doesn’t, the component has no text to analyze.
- Very short texts, of one or two words, may give an unreliable language.