diff --git a/nlp/ocr.py b/nlp/ocr.py index 435db3d..8372be7 100644 --- a/nlp/ocr.py +++ b/nlp/ocr.py @@ -11,11 +11,11 @@ def ocr_recognize(file_path): # Use EasyOCR to detect text in the photo results = reader.readtext(file_path) - for result in results: - [_coords, ocr_text, ocr_accuracy] = result - logger.debug("OCR Result: %s", ocr_text) - if ocr_accuracy.item() > 0.5: - sum_text += " " + ocr_text + result = result[-1] + [_coords, ocr_text, ocr_accuracy] = result + logger.debug("OCR Result: %s", ocr_text) + if ocr_accuracy.item() > 0.5: + sum_text += " " + ocr_text logger.debug(f'Recognized Text: {sum_text}')