title: How to use Elmo word embedding with the original pre-trained model (5.5B) in interactive mode
body: <p>I am trying to learn how to use Elmo embeddings via this tutorial:</p>
  
  <p><a href="https://github.com/allenai/allennlp/blob/master/tutorials/how_to/elmo.md" rel="nofollow noreferrer">https://github.com/allenai/allennlp/blob/master/tutorials/how_to/elmo.md</a></p>
  
  <p>I am specifically trying to use the interactive mode as described like this:</p>
  
  <pre><code>$ ipython
  &gt; from allennlp.commands.elmo import ElmoEmbedder
  &gt; elmo = ElmoEmbedder()
  &gt; tokens = ["I", "ate", "an", "apple", "for", "breakfast"]
  &gt; vectors = elmo.embed_sentence(tokens)
  
  &gt; assert(len(vectors) == 3) # one for each layer in the ELMo output
  &gt; assert(len(vectors[0]) == len(tokens)) # the vector elements 
  correspond with the input tokens
  
  &gt; import scipy
  &gt; vectors2 = elmo.embed_sentence(["I", "ate", "a", "carrot", "for", 
  "breakfast"])
  &gt; scipy.spatial.distance.cosine(vectors[2][3], vectors2[2][3]) # cosine 
  distance between "apple" and "carrot" in the last layer
  0.18020617961883545
  </code></pre>
  
  <p>My overall question is how do I make sure to use the pre-trained elmo model on the original 5.5B set (described here: <a href="https://allennlp.org/elmo" rel="nofollow noreferrer">https://allennlp.org/elmo</a>)?</p>
  
  <p>I don't quite understand why we have to call "assert" or why we use the [2][3] indexing on the vector output. </p>
  
  <p>My ultimate purpose is to average the all the word embeddings in order to get a sentence embedding, so I want to make sure I do it right! </p>
  
  <p>Thanks for your patience as I am pretty new in all this.</p>