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]
word2vec_training.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录