分享GoogleNews-vectors-negative300数据集

分享的文件是GoogleNews-vectors-negative300.bin,是Google已经预训练完成的模型,可以直接拿来用,国内由于某些原因下载受阻,故在此以网盘形式分享。

链接:https://pan.baidu.com/s/1tNFqf_aKUzM9s0svs5FKCw
提取码:o9jq
复制这段内容后打开百度网盘手机App,操作更方便哦

另:也可以复制以下链接到迅雷下载会快一些:

https://s3.amazonaws.com/dl4j-distribution/GoogleNews-vectors-negative300.bin.gz

使用实例:

from gensim.models import KeyedVectors
import time  #用于计算运行时间

start = time.process_time()

# 从目录中导入该模型文件
g_w2v_model_file = './data/model/GoogleNews-vectors-negative300.bin'

# 设置参数为只使用前100000个单词,用于减少模型运算时间
w2v_model = KeyedVectors.load_word2vec_format(g_w2v_model_file,
                                              limit=100000,
                                              binary=True)

# 计算单词的相似度
print(w2v_model.similarity('woman', 'man'))

# 计算和“beautiful”最相似的5个单词
print(w2v_model.most_similar('beautiful', topn=5))

end = time.process_time()
print(end-start)

作者: 公子小白

SOS团团员,非外星人、未来人、超能力者。。。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注