I have certain keywords and their search volumes from Google.  There is some contamination in this data and I want to identify it and keep it out. The reason for this contamination is that Google groups similar words together when giving these search volumes. This is called 'close variant' grouping.

I want to detect and group such variants in a large database and I need your help for this.

For example:

large water bottle - 20k search volume
water bottle large - 20k search volume
large water bottles - 20k search volume
water bottles but large - 20k search volume

However, in millions of records, there can be tens of thousands of words with the same search volume value. if I group them according to NLTK distances, I cannot group together examples like 'water bottles but large'.

The only similarities between them are that their names are semantically similar and their search volumes are exactly the same. I have 10 million such words. I want to group the ones like in this example and match them under a single group.

How can I write a code to do this, can you guide me?