word2vec sim
This commit is contained in:
parent
8b98f143ed
commit
d900c7e01d
1 changed files with 11 additions and 0 deletions
11
wordvec.py
Normal file
11
wordvec.py
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import gensim.downloader as api
|
||||||
|
wv = api.load('word2vec-google-news-300')
|
||||||
|
|
||||||
|
# Affichage de quelques mots du vocabulaire
|
||||||
|
# for index, word in enumerate(wv.index_to_key):
|
||||||
|
# if index == 10:
|
||||||
|
# break
|
||||||
|
# print(f"word #{index}/{len(wv.index_to_key)} is {word}")
|
||||||
|
|
||||||
|
print(wv.most_similar(positive=['car'], topn=5))
|
||||||
|
print(wv.most_similar(positive=['voiture'], topn=5))
|
Loading…
Reference in a new issue