def groupby_tags(item_list, tags_list):
    r
    groupid_to_items = defaultdict(list)
    for tags, item in zip(tags_list, item_list):
        for tag in tags:
            groupid_to_items[tag].append(item)
    return groupid_to_items