0

So what I'm simply trying to do is save a Word2Vec model.

import nltk
from nltk.corpus import product_reviews_1 as review
import gensim

model = gensim.models.Word2Vec(review.sents())
model.save('review.embedding')

The code runs normally and there's this file review.embedding on my directory, but it has nothing but an error that says

the file is not UTF encoded and saving is disabled

Couldn't figure out what is wrong.

  • 1
    Isn't it this issue? https://stackoverflow.com/questions/61114350/error-blahfile-is-not-utf-8-encoded-saving-disabled – Jindřich Aug 11 '20 at 08:43
  • What do you mean that "it has nothing but an error that says `the file is not UTF encoded and saving is disabled`"? What did you use to try to view the file, and where was that text displayed? Is the file on disk just ~50 bytes, as it would be if it were just that text? Have you tried doing a `reloaded_model = Word2Vec.load('review.embedding')` & checking if that gives a working model? – gojomo Aug 11 '20 at 19:02

0 Answers0