title: How to predict with Word2Vec?
body: <p>I'm doing arabic dialect text classification and I've used Word2Vec to train the model, I got this so far:</p>
  
  <pre><code> def read_input(input_file):
  
      with open (input_file, 'rb') as f:
          for i, line in enumerate (f): 
              yield gensim.utils.simple_preprocess (line)
  
  documents = list (read_input (data_file))
  logging.info ("Done reading data file")
  
  model = gensim.models.Word2Vec (documents, size=150, window=10, min_count=2, workers=10)
  model.train(documents,total_examples=len(documents),epochs=10)
  </code></pre>
  
  <p>What do I do now to predict a new text if it's of any of the 5 dialects I have?<br>
  Also, I looked around and found this code: </p>
  
  <pre><code># load the pre-trained word-embedding vectors 
  embeddings_index = {}
  for i, line in enumerate(open('w2vmodel.vec',encoding='utf-8')):
      values = line.split()
      embeddings_index[values[0]] = numpy.asarray(values[1:], dtype='float32')
  
  # create a tokenizer 
  token = text.Tokenizer()
  token.fit_on_texts(trainDF['text'])
  word_index = token.word_index
  
  # convert text to sequence of tokens and pad them to ensure equal length vectors 
  train_seq_x = sequence.pad_sequences(token.texts_to_sequences(train_x), maxlen=70)
  valid_seq_x = sequence.pad_sequences(token.texts_to_sequences(valid_x), maxlen=70)
  
  # create token-embedding mapping
  embedding_matrix = numpy.zeros((len(word_index) + 1, 300))
  for word, i in word_index.items():
      embedding_vector = embeddings_index.get(word)
      if embedding_vector is not None:
          embedding_matrix[i] = embedding_vector
  </code></pre>
  
  <p>But it gives me this error when I run it and load my trained word2vec model:</p>
  
  <pre><code>ValueError: could not convert string to float: '\x00\x00\x00callbacksq\x04)X\x04\x00\x00\x00loadq\x05cgensim.utils'
  </code></pre>
  
  <h2>Note:</h2>
  
  <p>Actually, there's another code that I didn't post here, I wanted to use word2vec with neural networks, I have the code for neural network, but I don't know how to make the features I got from word2vec to be as an input to the neural net and with labels as output. Is it possible to connect word2vec to a deep neural net and how?</p>