Skip to content

Instantly share code, notes, and snippets.

@Yuktha-Majella
Created August 7, 2021 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yuktha-Majella/d053be5e8e08501593c2ae3e9b741432 to your computer and use it in GitHub Desktop.
Save Yuktha-Majella/d053be5e8e08501593c2ae3e9b741432 to your computer and use it in GitHub Desktop.
Creating a Word2Vec model in Gensim
from gensim.models.word2vec import Word2Vec
from multiprocessing import cpu_count
import gensim.downloader as api
dataset = api.load("text8")
words = [d for d in dataset]
data1 = words[:1000]
w2v_model = Word2Vec(data1, min_count = 0, workers=cpu_count())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment