0

I am currently trying to compare each element of one list with every element of another list. This has a time complexity of N*N which is a hindrance to the performance.

The loops are as follows:

#fin_textt is a list which contains strings

for i in (range(len(fin_textt))):
    for j in range(i+1,len(fin_textt)):
        if(fuzz.ratio(fin_textt[i],fin_textt[j])<90):
            continue
        else:
            dup.append((fin_textt[i],fin_textt[j]))#all reviews which are very similar and have a value 90 and above

The time taken to give an output when the above code is run on a 10k dataset is awfully large. Please help me optimize this and boost the performance.

moonface16
  • 5
  • 1
  • 3

0 Answers0