Business document type

Identify what kind of business document arrived: invoice, credit note, receipt, purchase order, contract, or personal records.

F@f

Limits to keep in mind

Classifies the document type only. It never interprets contract terms, assesses legal meaning, or makes decisions about the person a record describes.

Problem

Scanned and attached documents arrive in one inbox and need to reach different teams. Opening each file to see what it is takes most of the processing time.

Goal

Route documents by type, and hand contracts and personal records to the people responsible for them without interpreting their content.

Input / state

Text extracted from the document by OCR or a parser, and the file name.

file_name
Attachment file name.
extracted_text
The first page or so of text extracted from the document.

Decision question

ChoiceQuestion key document_type

What type of document is this?

Options

  • invoiceA request for payment for goods or services.
  • credit_noteA document reducing an amount owed, issued against an invoice.
  • receiptProof that a payment was made, for example for expenses.
  • purchase_orderAn order placed with a supplier.
  • contract_or_legalA contract, agreement, terms, notice or other legal document.
  • personal_recordsDocuments about an individual, such as payslips, ID documents, medical or employment records.

Allowed outcomes

Decided in your code from the answer and its confidence. Thresholds are yours to set and test.

  • InvoiceChoice is invoice and confidence meets your threshold.
  • Credit noteChoice is credit_note and confidence meets your threshold.
  • ReceiptChoice is receipt and confidence meets your threshold.
  • Purchase orderChoice is purchase_order and confidence meets your threshold.
  • Hand to legalChoice is contract_or_legal and confidence meets your threshold.
  • Restricted handlingChoice is personal_records and confidence meets your threshold.
  • Document reviewConfidence is below your threshold: probability is spread across options.

Example scenarios

Predefined demonstrations. No model is called; the outcome shown is an illustrative judgment.

Example state

{
  "file_name": "INV-2291.pdf",
  "extracted_text": "INVOICE  INV-2291  Bill to: Acme Ltd  Total due: 1,240.00  Due date: 30 days"
}

Outcome

Illustrative
Invoice

Choice is invoice and confidence meets your threshold.

Why

Requests payment.

Using it well

  • Extract fields such as totals and dates with a document parser. This question names the type only.
  • Personal records shouldn't stay in a shared inbox. Move them to restricted storage as soon as they're identified.

Request definition

POST https://api.typesafe.ai/v1/systemone
{
  "model": "jev-latest",
  "state": {
    "file_name": "<file_name>",
    "extracted_text": "<extracted_text>"
  },
  "questions": {
    "document_type": {
      "type": "choice",
      "instructions": "What type of document is this?",
      "criteria": {
        "invoice": "A request for payment for goods or services.",
        "credit_note": "A document reducing an amount owed, issued against an invoice.",
        "receipt": "Proof that a payment was made, for example for expenses.",
        "purchase_order": "An order placed with a supplier.",
        "contract_or_legal": "A contract, agreement, terms, notice or other legal document.",
        "personal_records": "Documents about an individual, such as payslips, ID documents, medical or employment records."
      }
    }
  }
}

Request shape from the System One API reference; a Kev server accepts the same body. Replace the placeholder state with your data. Requests need your own API key or server.

Version History

v1Current Versionabout 8 hours ago@f

Initial version

Comments (0)