class_docstr: Wrapper class for machine translation.
code: def preprocess(self, ex: JsonDict) -> JsonDict:
      input_kw = {
          "source_language": self.LANGCODE_TO_NAME[
              ex["source_language"]
          ],
          "target_language": self.LANGCODE_TO_NAME[
              ex["target_language"]
          ],
          "source": ex["source"],
      }
      ret = {"input_text": self.INPUT_TEMPLATE.format(**input_kw)}
      if "target" in ex:
          ret["target_text"] = ex["target"]
      return ret
  
imports: import re
  import attr
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.examples.models import model_utils
  from lit_nlp.lib import file_cache
  from lit_nlp.lib import utils
  import tensorflow
  import tensorflow_text
  import transformers
  from rouge_score import rouge_scorer
label_desc: Use image node_id 2 for calling the TranslationWrapper obj's underlying member method code with example usage: obj.preprocess(ex) and returns: ret