for tag, count in baseq.join(Tag.file_paths).group_by(Tag.id).all():
        tags[tag]['file_paths'] = count