code: def _get_transformations(self, current_text, indices_to_modify):
      words = current_text.words
      location_idx = []
      if self.language == "en":
          model_name = "ner"
      elif self.language == "fra" or self.language == "french":
          model_name = "flair/ner-french"
      else:
          model_name = "flair/ner-multi-fast"
      for i in indices_to_modify:
          tag = current_text.ner_of_word_index(i, model_name)
          if "LOC" in tag.value and tag.score > self.confidence_score:
              location_idx.append(i)
  
      # Combine location idx and words to a list ([0] is idx, [1] is location name)
      # For example, [1,2] to [ [1,2] , ["New York"] ]
      location_idx = [
          list(group) for group in mit.consecutive_groups(location_idx)
      ]
      location_words = idx_to_words(location_idx, words)
  
      if self.consistent:
          location_to_indices = self._build_location_to_indicies_map(
              location_words, current_text
          )
  
      transformed_texts = []
      for location in location_words:
          idx = location[0]
          word = self._capitalize(location[1])
  
          # If doing consistent replacements, only replace the
          # word if it hasn't been replaced in a previous iteration
          if self.consistent and word not in location_to_indices:
              continue
  
          replacement_words = self._get_new_location(word)
          for r in replacement_words:
              if r == word:
                  continue
  
              if self.consistent:
                  indices_to_delete = []
                  if len(idx) > 1:
                      for i in location_to_indices[word]:
                          for j in range(1, len(idx)):
                              indices_to_delete.append(i + j)
  
                  transformed_texts.append(
                      current_text.replace_words_at_indices(
                          location_to_indices[word] + indices_to_delete,
                          ([r] * len(location_to_indices[word]))
                          + ([""] * len(indices_to_delete)),
                      )
                  )
              else:
                  # If the original location is more than a single word, keep only the starting word
                  # and replace the starting word with the new word
                  indices_to_delete = idx[1:]
                  transformed_texts.append(
                      current_text.replace_words_at_indices(
                          [idx[0]] + indices_to_delete,
                          [r] + [""] * len(indices_to_delete),
                      )
                  )
  
          if self.consistent:
              # Delete this word to mark it as replaced
              del location_to_indices[word]
  
      return transformed_texts
  
file_path: TextAttack/textattack/transformations/word_swaps/word_swap_change_location.py
imports: from collections import defaultdict
  import more_itertools
  import numpy
  from textattack.shared.data import NAMED_ENTITIES
  from .word_swap import WordSwap
label_desc: Use image node_id 2 for calling the WordSwapChangeLocation obj's underlying member method code with example usage: obj._get_transformations(current_text, indices_to_modify) and returns: transformed_texts