title: How to one-hot-encode sentences at the character level?
body: <p>I would like to convert a sentence to an array of one-hot vector.
  These vector would be the one-hot representation of the alphabet.
  It would look like the following:</p>
  
  <pre><code>"hello" # h=7, e=4 l=11 o=14
  </code></pre>
  
  <p>would become</p>
  
  <pre><code>[[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
   [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
  </code></pre>
  
  <p>Unfortunately OneHotEncoder from sklearn does not take as input string.</p>