def map_category_id(category_map):
    """ Assign an ID to each category """
    category_id = {}
    id_category = {}
    counter = 0
    for category in category_map:
        category_id[category['name']] = counter
        id_category[counter] = category['name']
        counter += 1
    return category_id, id_category