title: list of numpy arrays instead of one hot vector
body: <p>for neuronal network i need to convert labels to one hot array.
  I have 3 labels that appear in a list like :</p>
  
  <pre><code>labels = ["Synonym", "Antonym", "Not relevant", "Synonym", "Antonym"]
  </code></pre>
  
  <p>There are 3 different labels and I want first to refer them to numbers 1,2 and 3 and then build one hot vector from them, like for example for label 3 --> 0 0 1 The function that I have make list of arrays and that doesnt work than for training. </p>
  
  <pre><code>def label_to_onehot(labels):
      mapping = {label: i for i, label in enumerate(set(labels))}
  
  one_hot = []
  for label in labels:
      entry = [0] * len(mapping)
      entry[mapping[label]] = 1
      one_hot.append(entry)
  return one_hot
  </code></pre>
  
  <p>That is what i get:    </p>
  
  <blockquote>
    <p>ValueError: Error when checking model target: the list of Numpy arrays that you are passing to your model is not the size the model
    expected. Expected to see 1 array(s), but instead got the following
    list of 165757 arrays: [array([[0],
           [0],
           [1]]), array([[1],
           [0],
           [0]]), array([[0],
           [1],</p>
  </blockquote>