class_docstr: Swap entities with other entities of the same category.
class_docstr_tok: ["Swap","entities","with","other","entities","of","the","same","category","."]
docstr: :param dict entity_res: dic of categories and their entities.
docstr_tok: [":","param","dict","entity_res",":","dic","of","categories","and","their","entities","."]
code: def __init__(
      self,
      trans_min=1,
      trans_max=10,
      trans_p=0.1,
      stop_words=None,
      **kwargs,
  ):
      r"""
      :param dict entity_res: dic of categories and their entities.
      """
      super().__init__(
          trans_min=trans_min,
          trans_max=trans_max,
          trans_p=trans_p,
          stop_words=stop_words,
      )
      name_path = download_if_needed(CN_NAME_PATH)
      loc_path = download_if_needed(CN_LOC_PATH)
      org_path = download_if_needed(CN_ORG_PATH)
      self.entities_dic = {
          "PERSON": json_loader(name_path)["name"],
          "LOCATION": json_loader(loc_path),
          "ORGANIZATION": json_loader(org_path),
      }
  
file_path: textflint/textflint/generation/transformation/UTCN/cn_swap_named_ent.py
imports: from ..transformation import Transformation
  from ....common.settings import CN_CORENLP_ENTITY_MAP, CN_NAME_PATH, CN_LOC_PATH, CN_ORG_PATH
  from ....common.utils.load import json_loader
  from ....common.utils.list_op import trade_off_sub_words
  from ....common.utils.install import download_if_needed
label_desc: Use image node_id 1 to create a new CnSwapNamedEnt object from inherited base classes: Transformation with example: obj = CnSwapNamedEnt(trans_min, trans_max, trans_p, stop_words)