Translate
  • 30 May 2024
  • 2 Minutes to read
  • Contributors
  • PDF

Translate

  • PDF

Article summary

A node that translates any input event with a Text attribute.

Parameters:

name
description
default
IgnoreSslErrorsIgnore any SSL certificate errors for the Http callsfalse
SourceLanguageLanguage of the source text.tr-TR
TargetLanguageLanguage of the target texten-US
KeyApi key for the translate serviceempty

Inputs

Audio:
none

Events:

namedescriptionknown nodes that generate this event
Any event that has Data.TextAny Text based event such as: SR Milestone, SR Partial etc.SR Http, SR Websocket, Translate etc.
Language ChangeCustomized Language Change event that specifies if the Target, or Source language needs to be changed.Language Identifier, Text Language Identifier
Language Change notes

The language change event that exits Language Identifier or Text Language Identifier can be customized to specify Target or Source language change by utilizing custom nodes. Premade scripts can be acquired from the customs page.

Outputs

Audio:
none

Events:

name
description
TranslationContains the translated text in Data.Text field.

Remarks :

Requirements
The node needs an Google Translate Cloud Api key to perform. To learn more about setting up an API Key, you can refer to the Google Cloud Translation page. Keep in mind that we are utilizing the REST endpoint, and make sure you keep your API Key safe.

Project Structure
The node expects events that have the Text field. Which means the node can be used with any and all SR nodes.
A minimum viable project that utilizes Translate node can be built as such:
image.png

With this project, one can use both Speech recognition and have the text translated to any desired language simultaneously.

Taking this a step further, we can construct a project such as:
image.png

Which recognizes a speech, translates the text into another language, and uses TTS to create simultaneous audio outputs.

Keep This in Mind

Keep in mind that the SR node needs a model in Source Language, and TTS node needs Voice fitting the Target Language in this particular case.

Finally, here's a project that manipulates the Translation event so that it is punctuated, filtered, normalized before returning the output.
image.png

Keep This in Mind

Also, keep in mind that the SR node needs to fit the Source Language, and Punctuation, Profanity Filter, Normalizer nodes need to fit the Target Language.

Detailed Workflow
Utilizes Http calls to Google Translate Api with the provided Api key. Raises a Translation event for every response.

Supported flow types: Stream, Batch


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.