Skip to content

Why does my Bedrock Nova OCR still output “box” symbols instead of clean text in rebuilt PDFs?

0

Hi everyone,

I’m working on extracting readable text (Chinese/English) from PDFs that contain both digital and image-based text. I used AWS Bedrock with models including Claude 3.5 Sonnet, Haiku, Amazon Nova Lite, Pro, and Titan Embeddings V2, but even when OCR succeeds, my output (for example, in rebuilt.pdf) still contains random “box” characters (■■■■) instead of text in certain regions. Image

Here’s what I’ve already tried:

  • Extracted each PDF page into PNG (pypdfium2)
  • Sent each image to Nova Pro (amazon.nova-pro-v1:0) with a clean JSON payload like: { "messages": [{ "role": "user", "content": [ { "image": { "format": "png", "source": { "bytes": "<base64>" } } }, { "text": "OCR this image. Output only readable human text (Chinese/English). No boxes or coordinates." } ] }] }
  • Combined native PDF text (via pdfplumber) with Nova OCR text into .txt, .docx, and .rebuilt.pdf using reportlab.
  • Confirmed the model runs successfully (no API errors). However, some pages especially those with dense or stylized Chinese fonts still produce “box” symbols in the OCR output, even though the model detects the page.

Are “box” characters (■■■■) a known fallback for unrecognized Unicode during OCR via Nova or Claude? Does Nova Pro support multilingual (Chinese) OCR fully, or should I preprocess the images (grayscale, DPI adjustment)? Is there a recommended Bedrock model or preprocessing step for improving multilingual OCR quality? Should the ContentType or Accept headers differ when passing multilingual data? Would Textract (with correct IAM subscription) or Rekognition OCR yield better results for mixed-language pages?

AWS Region: us-east-1 Model: amazon.nova-pro-v1:0 Tools: boto3, pypdfium2, pdfplumber, reportlab Output: rebuilt.pdf stored in S3 under /out/www_guten_co_merged/

Thanks in advance.

asked a year ago436 views

3 Answers
0

Hi, thank you for the feedback. Here is the PDF link.

https://drive.google.com/file/d/16OU0sjhid7sbV_uNUVPQZoa9fiN0MJTc/view?usp=sharing

I think the issue might be the text is too small for it to be read. Thank you!

answered a year ago

  • Your link doesn't seem to work. To confirm your diagnosis, you can submit just an image to Nova with a zoomed cropping of the small chars. Best, DIdier

0

The "box" symbols (■■■■) in your OCR output are likely due to several factors when processing multilingual content, particularly Chinese characters.

When Amazon Nova or other foundation models encounter characters they cannot confidently recognize or that fall outside their training data, they may output placeholder symbols like boxes. This is especially common with:

  1. Complex or stylized Chinese fonts
  2. Low-resolution or low-contrast text
  3. Characters that might be rare or uncommon in the model's training data

For improving multilingual OCR quality with Amazon Nova Pro, consider these approaches:

Image preprocessing:

  • Increase contrast and resolution of your images before sending to the model
  • Convert images to grayscale to reduce complexity
  • Ensure proper DPI (300+ recommended for OCR)
  • Consider image denoising if the PDF contains artifacts

Prompt engineering:

  • Be more specific about the languages in your prompt, e.g., "OCR this image and extract all Chinese and English text"
  • You might try instructing the model to transliterate characters it's unsure about rather than using placeholder boxes

Alternative approaches:

  • Amazon Textract might provide better results for document-based OCR tasks, especially when combined with custom vocabulary features
  • For mixed-language documents, you could try processing the document twice - once optimized for English and once for Chinese - then merge the results

The issue isn't with your JSON payload structure or the basic approach, but rather with the inherent challenges of multilingual OCR, particularly with Chinese characters that have complex structures. Amazon Nova Pro does support multilingual OCR, but performance can vary based on font style, image quality, and character complexity.

For dense or stylized Chinese text, you might need to segment the document and process different regions with specialized approaches or consider using language-specific OCR solutions in combination with foundation models.
Sources
Using Amazon Nova for Multimodal RAG - Amazon Nova
Nova Lite Batch Inference Error: Document Format | AWS re:Post

answered a year ago

EXPERT

reviewed a year ago

0

Hi,

My personal experience is that you have to "reduce the complexity" for sophitiscated and large texts. Basically, you have to divide in chunks (pages or less) instead of giving the full PDF. In the case of Chinese characters, some preprocessing may help: contrast improvement, etc.

If possible (i.e. not confidential), could you share a couple ot those pdfs to allow more precise guidance ?

Best,

Didier

EXPERT

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.