title: Use tf-idf with FastText vectors
body: <p>I'm interested in using tf-idf with FastText library, but have found a logical way to handle the ngrams. I have used tf-idf with SpaCy vectors already for what I have found several examples like these ones: </p>
  
  <ul>
  <li><p><a href="http://dsgeek.com/2018/02/19/tfidf_vectors.html" rel="noreferrer">http://dsgeek.com/2018/02/19/tfidf_vectors.html</a></p></li>
  <li><p><a href="https://www.aclweb.org/anthology/P16-1089" rel="noreferrer">https://www.aclweb.org/anthology/P16-1089</a></p></li>
  <li><a href="http://nadbordrozd.github.io/blog/2016/05/20/text-classification-with-word2vec/" rel="noreferrer">http://nadbordrozd.github.io/blog/2016/05/20/text-classification-with-word2vec/</a></li>
  </ul>
  
  <p>But for FastText library is not that clear to me, since it has a granularity that isn't that intuitive, E.G.</p>
  
  <p>For a general word2vec aproach I will have one vector for each word, I can count the term frequency of that vector and divide its value accordingly. </p>
  
  <p>But for fastText same word will have several n-grams, </p>
  
  <p>"Listen to the latest news summary" will have n-grams generated by a sliding windows like: </p>
  
  <p>lis ist ste ten tot het... </p>
  
  <p>These n-grams are handled internally by the model so when I try: </p>
  
  <pre class="lang-py prettyprint-override"><code>model["Listen to the latest news summary"] 
  </code></pre>
  
  <p>I get the final vector directly, hence what I have though is to split the  text into n-grams before feeding the model like:</p>
  
  <pre class="lang-py prettyprint-override"><code>model['lis']
  model['ist']
  model['ten']
  </code></pre>
  
  <p>And make the tf-idf from there, but that seems like an inefficient approach both, is there a standar way to apply tf-idf to vector n-grams like these. </p>