CNN-yelp-challenge-2016-sentiment-classification icon indicating copy to clipboard operation
CNN-yelp-challenge-2016-sentiment-classification copied to clipboard

ValueError: too many values to unpack

Open rakashi opened this issue 7 years ago • 1 comments

Hi Sir,

I am running the code to train multi class and im getting the error too many values to unpack using the yelp dataset.

(reviews_words_index, labels) = pickle.load(open("review_sents_1859888.pkl", 'rb')) ValueError: too many values to unpack.

rakashi avatar Aug 28 '17 04:08 rakashi

Hello Rakashi, This file (review_sents_1859888.pkl) only contains the matrix representation of the words (refer to this IPython notebook: https://github.com/haoopeng/CNN-yelp-challenge-2016-sentiment-classification/blob/master/word2vec_model.ipynb).

I guess you got this error when running train_multi_class.ipynb. Then the code should be: (reviews_words_index, labels) = pickle.load(open("399850by50reviews_words_index.pkl", 'rb')) Also remember to save the pickle file first with this line: pickle.dump((reviews_words_index, labels), open("399850by50reviews_words_index.pkl", 'wb'))

haoopeng avatar Sep 13 '17 20:09 haoopeng