diff --git a/nlp/ocr.py b/nlp/ocr.py index 924ec24..3ab859f 100644 --- a/nlp/ocr.py +++ b/nlp/ocr.py @@ -11,6 +11,6 @@ def ocr_recognize(file_path): result = reader.readtext(file_path) # Extract the recognized text from the result - recognized_text = ' '.join([text for text, _, _ in result]) + recognized_text = ' '.join([text[0] for text, _, _ in result if isinstance(text, list) and text]) logger.debug(f'recognized_text: {recognized_text}') return recognized_text \ No newline at end of file