def METHOD_NAME(self, training_data: TrainingData) -> Resource:
    """Trains the synonym lookup table."""
    for key, value in list(training_data.entity_synonyms.items()):
        self._add_entities_if_synonyms(key, value)
    for example in training_data.entity_examples:
        for entity in example.get(ENTITIES, []):
            entity_val = example.get(TEXT)[entity["start"] : entity["end"]]
            self._add_entities_if_synonyms(entity_val, str(entity.get("value")))
    self._persist()
    return self._resource