From 494cc5766fe2f0f2782b66bf1e2988673ce7f749 Mon Sep 17 00:00:00 2001 From: Untone Date: Sat, 28 Sep 2024 11:23:10 +0300 Subject: [PATCH] normalized-log-fix9 --- nlp/ocr.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nlp/ocr.py b/nlp/ocr.py index c4596b2..03ec27e 100644 --- a/nlp/ocr.py +++ b/nlp/ocr.py @@ -9,10 +9,10 @@ reader = easyocr.Reader(['ru']) # Specify the languages you want to support def ocr_recognize(file_path): # Use EasyOCR to detect text in the photo result = reader.readtext(file_path) - logger.debug(result) + logger.debug("OCR Result: %s", result) - # Extract the recognized text from the result - recognized_text = ' '.join([text[0] for text in result if isinstance(text, tuple) and len(text) > 0]) + # Extract recognized text + recognized_text = ' '.join([text[1] for text in result if isinstance(text, tuple) and len(text) > 1]) - logger.debug(f'recognized_text: {recognized_text}') + logger.debug(f'Recognized Text: {recognized_text}') return recognized_text \ No newline at end of file