class_docstr: A type of sentence level transformation that takes in a text input,
  translates it into target language and translates it back to source
  language.
  
  letters_to_insert (string): letters allowed for insertion into words
  (used by some char-based transformations)
  
  src_lang (string): source language
  target_lang (string): target language, for the list of supported language check bottom of this page
  src_model: translation model from huggingface that translates from source language to target language
  target_model: translation model from huggingface that translates from target language to source language
  chained_back_translation: run back translation in a chain for more perturbation (for example, en-es-en-fr-en)
  
  Example::
  
      >>> from textattack.transformations.sentence_transformations import BackTranslation
      >>> from textattack.constraints.pre_transformation import RepeatModification, StopwordModification
      >>> from textattack.augmentation import Augmenter
  
      >>> transformation = BackTranslation()
      >>> constraints = [RepeatModification(), StopwordModification()]
      >>> augmenter = Augmenter(transformation = transformation, constraints = constraints)
      >>> s = 'What on earth are you doing here.'
  
      >>> augmenter.augment(s)
code: def __init__(
      self,
      src_lang="en",
      target_lang="es",
      src_model="Helsinki-NLP/opus-mt-ROMANCE-en",
      target_model="Helsinki-NLP/opus-mt-en-ROMANCE",
      chained_back_translation=0,
  ):
      self.src_lang = src_lang
      self.target_lang = target_lang
      self.target_model = MarianMTModel.from_pretrained(target_model)
      self.target_tokenizer = MarianTokenizer.from_pretrained(
          target_model
      )
      self.src_model = MarianMTModel.from_pretrained(src_model)
      self.src_tokenizer = MarianTokenizer.from_pretrained(src_model)
      self.chained_back_translation = chained_back_translation
  
file_path: TextAttack/textattack/transformations/sentence_transformations/back_translation.py
imports: import random
  from transformers import MarianMTModel, MarianTokenizer
  from textattack.shared import AttackedText
  from .sentence_transformation import SentenceTransformation
label_desc: Use image node_id 1 to create a new BackTranslation object from inherited base classes: SentenceTransformation with example: obj = BackTranslation(src_lang, target_lang, src_model, target_model, chained_back_translation)