loader.py 文件源码

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

项目:Hotpot 作者: Liang-Qiu 项目源码 文件源码
def load_quora(dsfile):
    """ load a dataset in the quora csv format """
    s0 = []
    s1 = []
    labels = []
    with open(dsfile, encoding = 'utf8') as csvfile:
        f = csv.reader(csvfile)
        firstline = True
        for line in f:
            if firstline:
                firstline = False
                continue
            s0x = line[3]
            s1x = line[4]
            label = line[5]
            labels.append(float(label))
            s0.append(word_tokenize(s0x))
            s1.append(word_tokenize(s1x))
    return (s0, s1, np.array(labels))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号