Skip to content

Instantly share code, notes, and snippets.

@brinnaebent
Created April 12, 2023 21:03
Show Gist options
  • Save brinnaebent/3e567d48a1fff8dd75583c6a7bb1315b to your computer and use it in GitHub Desktop.
Save brinnaebent/3e567d48a1fff8dd75583c6a7bb1315b to your computer and use it in GitHub Desktop.
def format_ocr_response(response):
output_string = str()
for item in response["Blocks"]:
if item["BlockType"] == "LINE":
output_string = output_string + item["Text"]
output_string = output_string + '\n'
return output_string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment