Skip to content

Instantly share code, notes, and snippets.

@Yuktha-Majella
Created August 7, 2021 16:10
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/0e4d9e1d4545cb8ff935ba6225cbae3e to your computer and use it in GitHub Desktop.
Save Yuktha-Majella/0e4d9e1d4545cb8ff935ba6225cbae3e to your computer and use it in GitHub Desktop.
Save and Load dictionary and BOW in Gensim
# Save the Dictionary and BOW
g_dict1.save('/content/drive/MyDrive/gensim_tutorial/g_dict1.dict')
corpora.MmCorpus.serialize('/content/drive/MyDrive/gensim_tutorial/g_bow1.mm', g_bow)
# Load the Dictionary and BOW
g_dict_load = corpora.Dictionary.load('/content/drive/MyDrive/gensim_tutorial/g_dict1.dict')
g_bow_load = corpora.MmCorpus('/content/drive/MyDrive/gensim_tutorial/g_bow1.mm')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment