Router and gateway
Two steps between your documents and the model you use. The router decides how each page is read. The gateway decides what the model gets to see.
Ask for early accessRouter
One PDF holds different kinds of page. Some carry their text, some are scans, some are tables that plain text scrambles. The router looks at each page, picks the cheapest way to read it that loses nothing, and writes down why.
contract.pdf
- Page 1 · Typed clausestext layerA usable text layer, and nothing on the page that plain text loses.
- Page 2 · Price tablevisionA table with merged header cells. As plain text, its columns run together.
- Page 3 · Signed scanvisionNo text layer. With vision turned off, it goes to local OCR instead.
Gateway
A filter in front of the model or tool you already use. It doesn't choose the model. It decides which parts of the text reach it, with three checks reading the same text at once. If they can't agree, the value is covered.
- Rules
- Patterns with checksums: tax numbers, IBANs, cards, health numbers. Fast, and exact when they match.
- Veil
- Our model, for what a pattern can't describe: a name, an address, a person mentioned in a sentence.
- Veil Judge
- Decides who a value belongs to. A person's name is covered. A company's name stays, so the text still makes sense.
Contrato entre João Pereira, NIF 213 456 789, e Atlântico Logística, S.A., com sede em Lisboa.
Contrato entre João Pereiraname, NIF 213 456 789tax no., e Atlântico Logística, S.A., com sede em Lisboa.