This lab is a simplified version of the Language Translator lab, showcasing only the 'identification' part of the Language Translator service.
The Language Identification functionality allows you to quickly identify the language that text is written in. For the up-to-date list of identifiable languages, visit the documentation here.
To get the Language Translator service credentials on IBM Cloud automatically filled-in by Node-RED, you should connect the Language Translator service to the Node-RED application in IBM Cloud.
Please refer to the Node-RED setup lab for instructions.
In this exercise, you will create a simple flow which will input random text, the Translator service will identify the language and output the result in the debug window. The complete flow will look like this:
Add an inject node, language identify node and a debug node to the canvas and link them together.
Edit the inject node and change the payload to a string. Enter some text into the field, for example: What language is this?.
The Language Identification node does not need any configuration.
Single click the Language Identification node and view the info tab. Here you will see that the output for the identified language with the highest confidence level is msg.lang
To get the correct output in the debug tab, set the debug node output to msg.lang.
Deploy the application, initiate the inject node and view the result in the debug tab.
In this result with the text What language is this?, the service is 78% confident it is English.
Try entering text in a different language in the Inject node to view different results.
The complete flow is available here.
To find more information on the Watson Language Translator underlying service, visit these webpages:





