def METHOD_NAME(cls,
         model_dir=None,  # type: Optional[Text]
         model_metadata=None,  # type: Optional[Metadata]
         cached_component=None,  # type: Optional[EntitySynonymMapper]
         **kwargs  # type: **Any
         ):
    # type: (...) -> EntitySynonymMapper
    meta = model_metadata.for_component(cls.name)
    file_name = meta.get("synonyms_file", ENTITY_SYNONYMS_FILE_NAME)
    entity_synonyms_file = os.path.join(model_dir, file_name)
    if os.path.isfile(entity_synonyms_file):
        synonyms = utils.read_json_file(entity_synonyms_file)
    else:
        synonyms = None
        warnings.warn("Failed to load synonyms file from '{}'"
                      "".format(entity_synonyms_file))
    return EntitySynonymMapper(meta, synonyms)