docstr: Transformation that changes recognized locations of a sentence to
  another location that is given in the location map.
  
  :param n: Number of new locations to generate
  :param confidence_score: Location will only be changed if it's above the confidence score
  :param consistent:  Whether to change all instances of the same location to the same new location
  
  >>> from textattack.transformations import WordSwapChangeLocation
  >>> from textattack.augmentation import Augmenter
  
  >>> transformation = WordSwapChangeLocation()
  >>> augmenter = Augmenter(transformation=transformation)
  >>> s = 'I am in Dallas.'
  >>> augmenter.augment(s)
docstr_tok: ["Transformation","that","changes","recognized","locations","of","a","sentence","to","another","location","that","is","given","in","the","location","map",".",":","param","n",":","Number","of","new","locations","to","generate",":","param","confidence_score",":","Location","will","only","be","changed","if","it","'s","above","the","confidence","score",":","param","consistent",":","Whether","to","change","all","instances","of","the","same","location","to","the","same","new","location",">",">",">","from","textattack.transformations","import","WordSwapChangeLocation",">",">",">","from","textattack.augmentation","import","Augmenter",">",">",">","transformation","=","WordSwapChangeLocation","(",")",">",">",">","augmenter","=","Augmenter","(","transformation=transformation",")",">",">",">","s","=","'","I","am","in","Dallas",".","'",">",">",">","augmenter.augment","(","s",")"]
code: def __init__(
      self,
      n=3,
      confidence_score=0.7,
      language="en",
      consistent=False,
      **kwargs,
  ):
      """Transformation that changes recognized locations of a sentence to
      another location that is given in the location map.
  
      :param n: Number of new locations to generate
      :param confidence_score: Location will only be changed if it's above the confidence score
      :param consistent:  Whether to change all instances of the same location to the same new location
  
      >>> from textattack.transformations import WordSwapChangeLocation
      >>> from textattack.augmentation import Augmenter
  
      >>> transformation = WordSwapChangeLocation()
      >>> augmenter = Augmenter(transformation=transformation)
      >>> s = 'I am in Dallas.'
      >>> augmenter.augment(s)
      """
      super().__init__(**kwargs)
      self.n = n
      self.confidence_score = confidence_score
      self.language = language
      self.consistent = consistent
  
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 1 to create a new WordSwapChangeLocation object from inherited base classes: WordSwap with example: obj = WordSwapChangeLocation(n, confidence_score, language, consistent)