<s> from gensim . models . doc2vec import Doc2Vec <EOL> from gensim . models . doc2vec import LabeledSentence <EOL> from regression import BaseBowRegressor <EOL> import nltk <EOL> reviews_texts , _ , _ , _ , _ = BaseBowRegressor . get_reviews_data ( range ( <NUM_LIT:1> , <NUM_LIT> ) ) <EOL> sentences = [ ] <EOL> print "<STR_LIT>" <EOL> for i , review in enumerate ( reviews_texts ) : <EOL> tokens = nltk . word_tokenize ( review ) <EOL> tokens = [ token . lower ( ) for token in tokens ] <EOL> sentences . append ( LabeledSentence ( words = tokens , labels = [ "<STR_LIT>" + str ( i ) ] ) ) <EOL> print "<STR_LIT>" <EOL> model = Doc2Vec ( sentences , size = <NUM_LIT:100> , window = <NUM_LIT:8> , min_count = <NUM_LIT:5> , workers = <NUM_LIT:4> ) </s>
