def normalize(item):
    """ Normalizes strings in topics and labels. """
    if isinstance(item, str):
        item = item.lower()
        for k, v in {' ': '_', '_!': '!', '_’': '’'}.items():
            item = item.replace(k, v)
        return item
    else:
        return item