From 422d30584dfd7d72b62a4feb1094cd87fd7684ca Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 2 Apr 2018 22:13:17 +0200 Subject: first setup of chat crawler & word2vec model --- scripts/most_similar.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 scripts/most_similar.py (limited to 'scripts/most_similar.py') diff --git a/scripts/most_similar.py b/scripts/most_similar.py new file mode 100644 index 0000000..ad780a7 --- /dev/null +++ b/scripts/most_similar.py @@ -0,0 +1,12 @@ +#!/usr/bin/python3 + +import gensim + +import config + +# load model +model = gensim.models.Word2Vec.load(config.model) +wv = model.wv +del model + +print(wv.most_similar_cosmul(positive=["lol"])) -- cgit v1.3.1