class_docstr: Use Cloud Translate API as a Generator.
  
  In order to use this generator, you must have Cloud Translation set up
  through a Google Cloud project as described at
  https://cloud.google.com/translate/docs/setup and have downloaded your
  application credentials file locally and set the
  GOOGLE_APPLICATION_CREDENTIALS environment variable to point to that file.
class_docstr_tok: ["Use","Cloud","Translate","API","as","a","Generator",".","In","order","to","use","this","generator",",","you","must","have","Cloud","Translation","set","up","through","a","Google","Cloud","project","as","described","at","https",":","\/\/cloud.google.com\/translate\/docs\/setup","and","have","downloaded","your","application","credentials","file","locally","and","set","the","GOOGLE_APPLICATION_CREDENTIALS","environment","variable","to","point","to","that","file","."]
code: def config_spec(self) -> types.Spec:
      return {
          FIELDS_TO_BACKTRANSLATE_KEY: types.MultiFieldMatcher(
              spec="input", types=["TextSegment"], select_all=True
          ),
      }
  
file_path: lit/lit_nlp/components/backtranslator.py
imports: from collections.abc import Sequence
  from typing import Optional
  from absl import logging
  from google.cloud import translate_v2
  from lit_nlp.api import components
  from lit_nlp.api import dataset
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.lib import utils
  import pandas
label_desc: Use image node_id 2 for calling the Backtranslator obj's underlying member method code with example usage: obj.config_spec() and returns: dict