STAYCHARTED BLOG · LOGISTICS · DOCUMENT CLASSIFICATION
Logistics document classification: sort BOLs, PODs, invoices and customs papers with AI trained on your own documents
Sort bills of lading, proofs of delivery, invoices and customs papers by type with AI trained on your own documents. Steps from extracted text to your TMS.
Why it's harder than it looks
A broker, carrier or 3PL receives thousands of documents a week, and very few arrive labeled:
- By email, often several in one PDF, with a subject line like "docs for load 48812".
- From drivers, as phone photos of a signed paper taken in a cab.
- From portals and EDI, where the type is known but the format differs per partner.
- In different languages, for cross-border freight.
Every carrier's bill of lading looks different. Templates and keyword rules ("if it contains 'Bill of Lading'…") work for the big partners and break on the long tail, which is where a person ends up opening each file.
Where classification fits
Classification is one step in a pipeline. StayCharted does that step: it reads text and returns a document type with a confidence.
- Capture. The document arrives by email, upload, scan or portal.
- Text extraction. OCR or document capture turns it into text. Your TMS or document-management system may already do this; services such as Azure AI Document Intelligence, Amazon Textract and Google Document AI do too.
- Classification (StayCharted). The text, plus the file name, sender and subject, goes to your model. It answers with a document type and a confidence.
- Route and file. Your TMS, WMS or DMS files it against the shipment, sends invoices to AP, PODs to billing and customs papers to the broker desk. Answers below the cutoff go to a person.
StayCharted doesn't extract text, split PDFs or match a document to a shipment. It's the "what is this?" step, trained on your own documents' history.
What to send the model
| Field | Why it helps |
|---|---|
| The first page's text | The title block and headings usually say what the document is. The model reads the beginning of the text, so put the first page first |
| File name | "POD_48812_signed.pdf" is a strong hint, when partners name files consistently |
| Sender or email domain | A factoring company sends different documents than a shipper |
| Email subject | "Invoice 2291 – load 48812" |
| The type your team filed it as | The answer the model learns |
Only send fields you'll have for new documents at the moment you classify them.
The document types to start with
A typical first set for a broker or carrier. Use your own names, the ones your TMS already uses:
| Document type | Often confused with |
|---|---|
| Bill of lading (BOL) | Proof of delivery |
| Proof of delivery (POD) | Bill of lading |
| Carrier freight invoice | Rate confirmation |
| Rate confirmation | Carrier freight invoice |
| Commercial invoice | Packing list |
| Packing list | Commercial invoice |
| Customs entry / declaration | Commercial invoice |
| Lumper or accessorial receipt | Carrier freight invoice |
| Damage or claim report | (often an email, not a form) |
| Other: for a person | Anything new |
Ten types that cover most of your volume beat thirty where half are rare. Leave the rare ones to "Other" and a person.
How to classify logistics documents with AI: 9 steps
1. Pick one document stream
The AP mailbox, driver uploads or a customs inbox. One stream has one mix of document types and one way of arriving, so the first model is easier to check.
2. Export documents your team has already filed
You likely have the labels already: the document-type field in your TMS, or the folder the file was saved in. Export three to six months, one row per document, with the first page's text, the file name, the sender and the type it was filed as. A spreadsheet or CSV is fine.
3. One document per row
Split combined PDFs before you export, so each row is one document. If a row holds an invoice and a POD together, the model is being asked to give one answer for two documents.
4. Upload, and let the checks run
Upload the file to StayCharted, then choose the text columns and the document-type column. Before training it checks:
- duplicates, such as the same POD sent twice;
- the same text filed under two types;
- types with too few examples;
- detected personal and sensitive values, such as phone numbers and supported account-number patterns, which it can mask before training. Names and other sensitive free text still need manual review and removal; the checks do not detect every sensitive value.
5. Train, and compare two models
- A Classifier Model learns the words that go with each type. It's quick, and strong when documents carry clear titles.
- An AI Classifier Model reads meaning and handles many languages, so a Spanish carta porte and an English BOL can learn from each other's patterns.
Train both and keep the one with fewer mistakes on the types that matter most to you. On Business, a Dedicated AI Model trains an AI on your own documents, for messy OCR text and subtle differences.
6. Read the mistakes by type
The report shows how often the model was right on documents it never trained on, type by type, and lists the mistakes. Most will be between the pairs in the table above. Read a few: often the OCR text was empty or unreadable, which is a capture problem, not a model problem.
7. Set a review cutoff
Choose a confidence below which a person checks the answer. Those documents go to the Review Queue on Essentials and Business, with the model's top suggestions and similar documents your team already filed beside each one. Start strict, then relax it once you've seen how the confident answers hold up.
8. Connect it
- From your capture tool or TMS: call the model through the API with each document's text as it arrives, and use the answer to route it. On Essentials and Business.
- Without a developer: use a Make scenario (see the Make guide) to send each new email's text and attachment name to the model.
- In batches: export the day's documents to a spreadsheet, fill the document-type column, and import it back.
9. Retrain on what reviewers correct
Reviewed documents become training examples for the next version. Retrain when a new large partner starts sending documents, or when you add a document type.
BOL or POD? When the text isn't enough
A proof of delivery is often the same bill of lading, signed at delivery. The printed text is identical; the difference is a signature, a stamp or a handwritten note. A text model can only separate them if the extracted text shows it, for example "Received in good condition" with a date, or OCR of the signature block.
If your PODs are signed BOLs:
- Use the context: the file name, sender and email subject often say "POD" when the document doesn't.
- Send them to review: let BOL-vs-POD answers below the cutoff go to a person. It's a quick look, not a full re-key.
- Or classify the photo: a picture model can learn to tell a signed page from an unsigned one, if you have examples of both. See how to train an image classifier without code.
What it doesn't do
- It doesn't OCR. It classifies text you've already extracted.
- It doesn't pull out fields. It doesn't read the load number, weights or the consignee; your capture tool does that.
- It doesn't split PDFs or match documents to shipments. Your TMS or DMS does.
- It doesn't prove delivery or approve an invoice. A document type is a routing suggestion. Your team and your rules decide what happens next.
Common questions
What is logistics document classification?
Deciding what each incoming freight document is, such as a bill of lading, proof of delivery, invoice or customs entry, so it can be filed and routed without someone opening it.
Can AI tell a bill of lading from a proof of delivery?
Often, from the text, file name and sender. When a POD is a signed copy of the BOL with the same printed text, send those answers to a person, or classify the photo with a picture model trained on signed and unsigned examples.
Does StayCharted read scanned documents?
This text workflow needs OCR or document capture first; many TMS and document-management systems already produce the text. A separate picture model can classify the page image, but it does not extract text or fields.
Can it handle documents in several languages?
Yes. The AI Classifier Model reads many languages, so documents in Spanish, French or German can be classified with the same model.
Is there a document classification API?
Yes. Once a model is published, your software can send each document's text and get the type and a confidence back. See the API reference.
How many documents do I need?
Start with about 20 filed documents per type, and more for types that look alike. Test on documents the model hasn't seen. See how many examples to train an AI classifier.