0

I am using qbo to extract data from a document using scoring, using a CompositeEngine that composes results from an AiScoreEngine (for LLM analysis) and a TextractEngine (leveraging AWS Textract's PDF knowledge). Users can then review the composite engine results to pick the best of LLM and Textract.

My score includes items along these lines:

  • Item: APN/Parcel ID
  • Prompt:
Extract the APN / PARCEL ID.

Rules:
- Labels: “APN”, “Parcel No.”, “Tax ID”.
- Preserve dashes/format.

However, the TextractEngine is not extracting data from my document. Why not?

1 Answer 1

0

The basic issue is that complex Prompt fields can confuse Textract.

Textract's Query features do not use an LLM, so your verbose Prompt is confusing Textract to the point that it actually returns no data.

Workaround 1

The qbo4.Document.Amazon.TextractService does provide a hook to "bridge" this gap: it will only use the first line of a prompt.

So, the simple workaround is to ensure the first line of your prompt is "simple. E.g., instead of:

  • Item: APN/Parcel ID
  • Prompt:
Extract the APN / PARCEL ID.

Rules:
- Labels: “APN”, “Parcel No.”, “Tax ID”.
- Preserve dashes/format.

Ensure LLM-intended words are not in the first sentence:

  • Item: Parcel
  • Prompt:
APN / PARCEL ID

Extract the APN / Parcel ID using these rules:
- Labels: “APN”, “Parcel No.”, “Tax ID”.
- Preserve dashes/format."

The qbo4.Document.TextractService will only use the first line of a prompt. Robust workaround:

Workaround 2

If the conflict between LLM prompting and Textract prompting proves too difficult, you can create different ScoreTemplates:

  • 1 using AIScoreEngine, and
  • the other using TextractEngine.

You lost the simplicity of a Composite engine composing the results of multiple engines with a single template, but you get precise prompting for each engine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.