Is there any way to find a specific word in OCR result

Viewed 32

I am using paddleocr. I want to find a word/words in the OCR Result. For example the ocr output is "ilovepythonalot" And I want to find the word "love" using

if Chose1 in ocrresult: #Chose1='love'
    print('true')
else:
    print('false')

the result is only giving out "false" Is there any way that i can fix it?

1 Answers

Looking at the documentation, paddleocr likely outputs a list of strings, so you might want to merge them into one text first:

if Chose1 in ' '.join(ocrresult): #Chose1='love'
    print('true')
else:
    print('false')
Related