What is the best way to compare strings in python script. Scenario is "check if text is present in an image" Thank you!! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the best way to compare strings in python script. Scenario is "check if text is present in an image" Thank you!!

We will have a rigid string variables. These variables are fetched from an Excel data sheet. Now we need to process the receipts. In this processing we check if those string variables are present in our receipts. However as we know the text extraction from receipts (images here .jpgs) is not that flexible and we might extract incomplete words. So I would like to compare correlation with this extracted text and the variables to check for. What could be the best feasible and reliable approach? Thank you in advance. Happy Programming.

20th Apr 2020, 4:06 AM
emptySwitch 511
emptySwitch 511 - avatar
1 Answer
0
If there are common words on the receipts that are commonly mistakes for other words you could create a dictionary that holds the word it is supposed to be and common incomplete forms of the word and then reference that dictionary to find what the value should be. I.e. {'grocery': [1 'grcy, 'grocy, 'grcry']}
20th Apr 2020, 4:40 AM
David Nierman
David Nierman - avatar