Skip to content

Commit

Permalink
Attempted fix for newlines.
Browse files Browse the repository at this point in the history
  • Loading branch information
vladd-bit committed Jan 29, 2025
1 parent 977cd5c commit b68013d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ocr_service/processor/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def _process(self, stream: bytes, file_name: str) -> str:
doc_metadata["pages"] = image_count
doc_metadata["confidence"] = round(sum([page["confidence"] for page in tess_data]) / image_count, 4)

output_text = output_text.translate({'\\n': '\n', '\\t': '\t'})
output_text = output_text.translate({'\\n': '', '\\t': '', '\n\n': '\n'})
except Exception:
raise Exception("Failed to convert/generate image content: " + str(traceback.format_exc()))

Expand Down

0 comments on commit b68013d

Please sign in to comment.