utilities.py 文件源码

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

项目:aueb.twitter.sentiment 作者: nlpaueb 项目源码 文件源码
def loadGlove(d=200):
    start = time.time()

    f1 = 'resources/words.pkl'
    f2 = 'resources/embeddings.npy'

    if (os.path.isfile(f1) and os.path.isfile(f2)):
        with open(f1, 'rb') as input:
            w = pickle.load(input)

        e = np.load(f2)
        glove = GloveDictionary.Glove(words=w, emb=e)
    else:
    glove = GloveDictionary.Glove(d)
    saveGlove(glove)

    end=time.time()
    return glove

#save trained moleds
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号