0 / 0
Language detection
Last updated: Jul 22, 2024
Language detection

The Watson Natural Language Processing Language Detection identifies the language of input text.

Block name lang-detect_izumo_multi_stock

Supported languages

The Language Detection block is able to detect the following languages:

af, ar, bs, ca, cs, da, de, el, en, es, fi, fr, he, hi, hr, it, ja, ko, nb, nl, nn, pl, pt, ro, ru, sk, sr, sv, tr, zh_cn, zh_tw

Capabilities

Use this block to detect the language of an input text.

Dependencies on other blocks

None

Code sample

# Load the language detection model
lang_detection_model = watson_nlp.load('lang-detect_izumo_multi_stock')

# Run it on input text
detected_lang = lang_detection_model.run('IBM announced new advances in quantum computing')

# Retrieve language ISO code
print(detected_lang.to_iso_format())

Output of the code sample:

EN

Parent topic: Watson Natural Language Processing task catalog

Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more