How to cluster some text using TensorFlow
I do not see many benefits of using TensorFlow here. TensorFlow (and PyTorch) are great tools if you need to compute gradients of a loss function and use it in an optimizer. Clustering does not give the kind of training that would allow you to train an RNN or a Transformer that would give you a reasonable representation.

In your case, I would try:


represent the by average word embedding of content words
represent the text using BERT


And then do use a clustering algorithm of your choice. You can indeed implement k-means or hierarchical clustering in TensorFlow.