word2vec_training.py 文件源码

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

项目:stance-conditional 作者: sheffieldnlp 项目源码 文件源码
def trainPhrasesModel(tweets):
    """
    Train phrases model, experimental, not used
    :param tweets: list of tokenised tweets
    :return:
    """
    print("Learning multiword expressions")
    bigram = Phrases(tweets)
    bigram.save("../out/phrase_all.model")

    print("Sanity checking multiword expressions")
    test = "i like donald trump , go hillary clinton , i like jesus , jesus , legalisation abortion "
    sent = test.split(" ")
    print(bigram[sent])
    return bigram[tweets]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号