efficient method for sentence similarity I have a file with about 25000 rows. I want to find sentences that are near duplicates   (sentences which have difference of just one or two words/symbols or ones which are just paraphrasing of another).
To accomplish this, I'm using a very naive solution by comparing every row to every other row using the model bert-base-cased-finetuned-mrpc. Now the thing is that this is obviously very inefficient as it comparing for $25000^2$ pairs, and the task won't complete on my device.
Is there a way I can first find sentences which are candidates for being near duplicate, and then put the pairs into the model, or is there another approach which is efficient? I'm new to this, so any suggestions are appreciated.

When I’ve faced the problem of comparing many strings in the past, I’ve simplified it by only comparing texts where the first $k$ characters match. Even if $k$ is 1 or 2, you can dramatically reduce the number of comparisons you need make. This might not be appropriate in every setting, but it worked for me.
Using Levenshtein distance is great for detecting a small number of different symbols between texts, but obviously fails at finding paraphrasing.
