class_docstr: Maps entities to their synonyms if they appear in the training data.
class_docstr_tok: ["Maps","entities","to","their","synonyms","if","they","appear","in","the","training","data","."]
docstr: Creates the mapper.
  
  Args:
      config: The mapper's config.
      model_storage: Storage which the component can use to persist and load
          itself.
      resource: Resource locator for this component which can be used to persist
          and load itself from the `model_storage`.
      synonyms: A dictionary of previously known synonyms.
docstr_tok: ["Creates","the","mapper",".","Args",":","config",":","The","mapper","'s","config",".","model_storage",":","Storage","which","the","component","can","use","to","persist","and","load","itself",".","resource",":","Resource","locator","for","this","component","which","can","be","used","to","persist","and","load","itself","from","the","`","model_storage","`",".","synonyms",":","A","dictionary","of","previously","known","synonyms","."]
code: def __init__(
      self,
      config: Optional[Dict[Text, Any]],
      model_storage: ModelStorage,
      resource: Resource,
      synonyms: Optional[Dict[Text, Any]] = None,
  ) -> None:
      """Creates the mapper.
  
      Args:
          config: The mapper's config.
          model_storage: Storage which the component can use to persist and load
              itself.
          resource: Resource locator for this component which can be used to persist
              and load itself from the `model_storage`.
          synonyms: A dictionary of previously known synonyms.
      """
      self._config = config
      self._model_storage = model_storage
      self._resource = resource
  
      self.synonyms = synonyms if synonyms else {}
  
imports: from __future__ import annotations
  import os
  from typing import Any, Dict, List, Optional, Text
  import logging
  from rasa.engine.graph import GraphComponent, ExecutionContext
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.shared.constants import DOCS_URL_TRAINING_DATA
  from rasa.shared.nlu.constants import ENTITIES, TEXT
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.utils import write_json_to_file
  from rasa.nlu.extractors.extractor import EntityExtractorMixin
  import rasa.utils.io
  import rasa.shared.utils.io
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
label_desc: Use image node_id 1 to create a new EntitySynonymMapper object from inherited base classes: GraphComponent, EntityExtractorMixin with example: obj = EntitySynonymMapper(config, model_storage, resource, synonyms)