Answers for "find a word or approximate word in another dataframe sentences in python"

0

find a word or approximate word in another dataframe sentences in python

import pandas as pd 
from fuzzywuzzy import fuzz 
from fuzzywuzzy import process
def checker(wrong_options,correct_options):
    names_array=[]
    ratio_array=[]    
    for wrong_option in wrong_options:
        if wrong_option in correct_options:
           names_array.append(wrong_option)
           ratio_array.append(‘100’)
        else:   
            x=process.
extractOne(wrong_option,correct_options,scorer=fuzz.token_set_ratio)
            names_array.append(x[0])
            ratio_array.append(x[1])
     return names_array,ratio_array
Posted by: Guest on October-16-2021

Code answers related to "find a word or approximate word in another dataframe sentences in python"

Python Answers by Framework

Browse Popular Code Answers by Language