GoogleTranslateTransformer
allows you to translate text and HTML with the Google Cloud Translation API.
To use it, you should have the google-cloud-translate
python package installed, and a Google Cloud project with the Translation API enabled. This transformer uses the Advanced edition (v3).
GoogleTranslateTransformer
, you can include the following parameters to configure the requests.
project_id
: Google Cloud Project ID.location
: (Optional) Translate model location.
global
model_id
: (Optional) Translate model ID to use.glossary_id
: (Optional) Translate glossary ID to use.api_endpoint
: (Optional) Regional endpoint to use.page_content
translated into the target language.
You can provide the following keyword parameters to the transform_documents()
method:
target_language_code
: ISO 639 language code of the output document.
source_language_code
: (Optional) ISO 639 language code of the input document.
mime_type
: (Optional) Media Type of the input text.
text/plain
(Default), text/html
.