title: How to cluster similar sentences using BERT
body: <p>For ElMo, FastText and Word2Vec, I'm averaging the word embeddings within a sentence and using HDBSCAN/KMeans clustering to group similar sentences.</p>
  
  <p>A good example of the implementation can be seen in this short article: <a href="http://ai.intelligentonlinetools.com/ml/text-clustering-word-embedding-machine-learning/" rel="noreferrer">http://ai.intelligentonlinetools.com/ml/text-clustering-word-embedding-machine-learning/</a></p>
  
  <p>I would like to do the same thing using BERT (using the BERT python package from hugging face), however I am rather unfamiliar with how to extract the raw word/sentence vectors in order to input them into a clustering algorithm. I know that BERT can output sentence representations - so how would I actually extract the raw vectors from a sentence?</p>
  
  <p>Any information would be helpful.</p>