prepro.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:sru 作者: taolei87 项目源码 文件源码
def flatten_json(file, proc_func):
    '''A multi-processing wrapper for loading SQuAD data file.'''
    with open(file) as f:
        data = json.load(f)['data']
    with ProcessPoolExecutor(max_workers=args.threads) as executor:
        rows = executor.map(proc_func, data)
    rows = sum(rows, [])
    return rows
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号