Using the below code, I was able to get the fuzzy-ly matched results from a dictionary, find_desc_dict, and store it inside another dictionary called complete_dict.
for i, a in enumerate(recognized_keywords_search_desc):
complete_dict[i+1] = process.extract(search_desc_list[i], find_desc_dict, limit=10, scorer=fuzz.token_sort_ratio)
Here is an example as to clarify what the key-value pairs look like in complete_dict:
{1: [('some string', 72, 19), ('some other string', 72, 20), ('some string', 72, 19), ('some other string', 72, 20), ('some string', 72, 19), ('some other string', 72, 20), ('some string', 72, 19), ('some other string', 72, 20), ('some string', 72, 19), ('some other string', 72, 20), 2: [('some string', 89, 205), ('some other string', 71, 92), ('some string', 89, 205), ('some other string', 71, 92), ('some string', 89, 205), ('some other string', 71, 92), ('some string', 89, 205), ('some other string', 71, 92), ('some string', 89, 205), ('some other string', 71, 92)},
Basically the output structure of complete_dict is {key: [(string, ratio, index), (string, ratio, index), ... , (string, ratio, index)], key: [(string, ratio, index), (string, ratio, index), ... , (string, ratio, index)]} . I would like to learn how I can get just the indexes stored inside complete_dict.