<p>So, after lots of Googling around, I figured out that I, in fact, can't use clustering techniques because I lack feature variables on which I can cluster the words. If I make a table where I note how often each word exists with other words (in fact cartesian product) is in fact adjacency matrix and clustering doesn't work well on it.</p>

<p>So, the solution I was looking for is graph community detection. I used igraph library (or the python's python-ipgraph wrapper) to find the clusters and it runs very well and fast.</p>

<p>More informations:</p>

<ul>
<li>similar question: <a href="https://stats.stackexchange.com/questions/142297/finding-natural-groups-clusters-in-an-undirected-graph-over-several-undirect">https://stats.stackexchange.com/questions/142297/finding-natural-groups-clusters-in-an-undirected-graph-over-several-undirect</a></li>
<li>Community detection in graphs paper: <a href="https://arxiv.org/pdf/0906.0612.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/0906.0612.pdf</a></li>
<li>Basic descrption of various algorithms: <a href="https://stackoverflow.com/questions/9471906/what-are-the-differences-between-community-detection-algorithms-in-igraph">What are the differences between community detection algorithms in igraph?</a></li>
</ul>
List of lists of words clustering
<p>Let's say I have a list of lists of words, for example</p>

<pre><code>[['apple','banana'],
 ['apple','orange'],
 ['banana','orange'],
 ['rice','potatoes','orange'],
 ['potatoes','rice']]
</code></pre>

<p>The set is much bigger. I want to cluster the words that words usually existing together will have the same cluster. So in this case the clusters will be <code>['apple', 'banana', 'orange']</code> and <code>['rice','potatoes']</code>.<br>
What is the best approach to archive this kind of clustering?</p>