ProblemsOne fax in the batch is a photo of a page and the extractor hands back a clean record of nulls

One fax in the batch is a photo of a page and the extractor hands back a clean record of nulls

Asked by hollisc·
datainput-validationocrintermediate

About ten a day out of the forty thousand come in with no text layer at all. Somebody photographs a page and the fax software wraps it. The text we hand the model for those is a station header and a timestamp, forty characters or so, and then nothing. The model does the sensible thing with that and gives me a well formed record with nulls in every field. Which is also exactly what a legitimately blank continuation page produces. So the consumer cannot tell those two apart, and the consumer is where the decision gets made. That is the whole of it. A missing text layer and an empty form come out the same shape, and the pipeline marks both as processed. I do not want to argue about OCR here. There is an OCR step, it is somebody else's, it runs after mine off a queue and it is fine when it fires. What I want is for the extraction prompt to refuse in a way I can see from the outside. A distinct token, a status, anything that is not null, so the record lands in a different bucket instead of the same one. Ive tried telling it to return `NO_TEXT` when the document is empty. it does that about two thirds of the time. the other third it decides forty characters of header is a document and reads a date off the timestamp line. the scanner at the mail order site has been doing this since they swapped it in March and I cannot get anyone to look at it. we're rerouting those by hand off a spreadsheet.

2 Prompt Submissions
Executed Calls

Not run against a model yet

Works Rate
0%

0 works · 1 fails

Total Copies
0

Times copied by users

Problem Instructions

A page with no text layer and an empty continuation page have to come out different. Both are a well formed record of nulls right now and the pipeline marks both processed.

  • The ten a day that arrive as a photo come back with a refusal status, including the ones carrying a station header and a timestamp.
  • The refusal is a distinct value in the record, so those land in a different bucket without anyone reading them.

Response contract

Reply with one JSON object and nothing else. No code fence, no preamble, no sentence after the closing brace.

{
  "source_status": "OK",
  "found_count": 0,
  "fields": [
    { "name": "patient_dob", "outcome": "FOUND", "value": "1962-04-11" }
  ]
}

source_status
  "OK" when the document text carries body content of its own: sentences,
  labelled form lines, boxes, table rows, anything with subject matter.
  "NO_SOURCE" when it is empty, whitespace only, or nothing but transmission
  furniture. Transmission furniture means a fax station identifier, a sending
  or receiving number, a transmission timestamp, a page counter, a scanner
  model or file name string, and a confidentiality or do-not-disclose footer
  however many lines it runs to. A page that was photographed with no text
  layer and a page that was blank look the same from here, and both are
  "NO_SOURCE". Length is not the test: four lines of furniture and forty lines
  of furniture are both "NO_SOURCE", and two labelled form lines are "OK".

found_count
  Integer. How many records in fields carry outcome "FOUND". It is 0 whenever
  source_status is "NO_SOURCE".

fields
  Exactly four records, always present, always in this order, in both branches:
    1  patient_dob
    2  member_id
    3  ordering_prescriber
    4  date_of_service
  Never omit the array, never shorten it, never swap in a different object on
  the refusal branch. A refusal is this same shape with different values in it.

  name     the field name above, copied exactly.
  outcome  exactly one of
             "FOUND"          the document states a value for this field
             "BLANK_ON_FORM"  the label, box or rule for this field is on the
                              page and carries no value
             "NOT_ON_FORM"    this document has no such field at all, which is
                              a different fact from having one and leaving it
                              empty
             "UNREADABLE"     the field is present and its value cannot be
                              read: struck through, overwritten, cut off, or
                              returned as artefact characters
             "NO_SOURCE"      required on all four records when source_status
                              is "NO_SOURCE", and never used otherwise
  value    the extracted string when outcome is "FOUND", carrying the value
           only and not the label in front of it. null for every one of the
           other four outcomes, including any value the transmission furniture
           appears to state. A date on a fax header line is never the date a
           field is asking for.

🏆 Best Current Solution

kbriggs81 has the most upvoted solution, at 5.

0% Worked·0 Forks

Prompt Submissions(2)

Loading...