def _get_record_entities(passage):
    """Returns the unique set of entities."""
    text = passage['text']
    entities = set()
    for entity in passage['entities']:
        entities.add(text[entity['start']:entity['end'] + 1])
    return sorted(entities)
