Jev knowledge base·verified Sep 22, 2026

jev structured extraction

Use Jev for bounded candidate selection inside an extraction pipeline while parsers or generative models produce and validate arbitrary values.

the short answer

Jev cannot generate arbitrary strings, dates or identifiers. For extraction, first produce candidates with deterministic parsing, retrieval or a generative structured-output model; validate and normalize them in code; then use Jev Choice or Noul to select or verify a bounded candidate. Include not-stated handling, preserve source spans and evaluate extraction and selection as separate stages.

Native Jev capability
Bounded selection and semantic verification
Not native
Arbitrary value generation
Candidate sources
Parser, retrieval, dictionary or generative model
Exact validation
Code
Required escape
Not stated / no valid candidate

Extraction Contains Generation and Judgment

Finding an arbitrary company name, address or contract clause can require producing text that was not enumerated in advance. Jev is not trained for generation. TypeSafe’s jaggedness guidance recommends generating or finding possible options first and letting Jev select among them.

This decomposition makes errors diagnosable. Candidate recall asks whether the correct value was found; selection accuracy asks whether Jev chose it; validation asks whether the value conforms to syntax and business rules. A single end-to-end accuracy number hides which component needs work.

01DetectRegex, parser, retrieval or generative extraction proposes source-linked candidates.
02NormalizeCode validates formats, deduplicates and converts exact values.
03SelectJev Choice picks among candidates or Noul verifies one condition.
04GateNo-match and probability bands route uncertainty to review.
05PersistStore selected value, source span, versions and outcome.
Bounded extraction separates candidate recall from semantic selection.

Choose Candidate Generation from the Field Type

spaCy’s entity recognizer is one example of a component that proposes text spans; JSON Schema is one way to validate the structure of generated candidates. Neither determines which candidate fulfills the business meaning. Jev can perform that bounded semantic selection after candidates exist.

Prefer the least flexible generator that reaches adequate recall. A date parser is easier to test than an LLM for ISO dates; a controlled vocabulary is safer than extracting a new category name. The alternatives guide compares these components by output contract.

Field typeCandidate generatorWhy
Known enumApplication schema or database lookupEvery legal value is already enumerable
Date, amount or identifierParser, regex or typed librarySyntax and normalization are deterministic
Named entity in proseNER, span search or structured LLMThe value must first be located in source text
Value from a large catalogKeyword/vector retrieval with permission filtersThe complete answer space is too large for one Choice
Novel summary or clause rewriteGenerative modelThe required output is new text, not selection

Contract Termination Date Without Asking Jev to Calculate Dates

After selection, code parses the chosen text into a real date and performs ordering, duration or window arithmetic. Jev 1.13 reads dates as text and TypeSafe advises exact date comparisons in code. The source span travels with the candidate so a reviewer can verify the result.

{
  "state": {
    "question": "Which stated date is the contract termination date?",
    "candidates": {
      "c1": {"text": "September 1, 2026", "source_span": "section 2"},
      "c2": {"text": "December 31, 2026", "source_span": "section 9"},
      "not_stated": {"text": "No candidate is identified as termination"}
    }
  },
  "questions": {
    "termination_date_candidate": {
      "type": "choice",
      "instructions": "Which candidate is explicitly identified as the contract termination date?",
      "criteria": {"c1": null, "c2": null, "not_stated": null}
    }
  }
}

Carry Provenance Through Normalization and Deduplication

This is an application-owned candidate record. Deduplicate by normalized meaning while retaining every source span; otherwise repeated mentions can crowd the Choice and make one date appear more supported simply because it occurs more often. Never discard the raw text needed to verify the normalization.

Candidate IDs should be opaque and stable. Do not embed the preferred answer into an ID such as correct_termination_date. Labels, field names and candidate descriptions are part of Jev’s evidence and can leak the answer.

{
  "candidate_id": "c2",
  "raw_text": "December 31, 2026",
  "normalized_value": "2026-12-31",
  "document_id": "contract-77",
  "span": {"start": 1842, "end": 1859},
  "generator": {"kind": "date_parser", "version": "v3"},
  "validation": {"schema": "date", "status": "valid"},
  "aliases": ["December 31st, 2026"]
}

Selection Cannot Recover a Missing Candidate

Report end-to-end exact match and the stage metrics. Improving selection cannot compensate for poor candidate recall. Conversely, a high-recall generator that floods Jev with near-duplicates increases ambiguity, tokens and latency.

FailureOwnerMetric
Correct value never proposedCandidate generatorCandidate recall
Malformed or impossible value survivesNormalizer/validatorValidation failure rate
Jev chooses wrong present valueSelection question/modelConditional selection accuracy
No value exists but one is forcedTaxonomy/no-match designFalse extraction rate
Correct value selected but wrong action followsApplication policyEnd-to-end task outcome

Handle Zero, One and Many Values Explicitly

A Choice encodes mutual competition. It is the wrong shape when every listed regulation, diagnosis code or contract party can independently apply. Multiple Nouls avoid forced exclusivity, but their probabilities do not form one normalized distribution and each label needs evaluation.

Document truthQuestion designApplication result
No value statedExplicit not-stated candidate or separate presence NoulMissing by source, not extraction failure
Exactly one valueChoice among deduplicated candidatesSelected value plus source spans
Several values allowedOne Noul per candidate or repeated selection with removalArray of independently accepted values
Conflicting valuesPreserve each candidate and its contextConflict state requiring rule or review
Candidate list truncatedDo not run a forced final selectionUnscorable or retry candidate retrieval

Use the Smallest Bounded Representation

Do not encode thousands of arbitrary candidates in one Choice because the API permits a large list. Candidate-set size changes probability semantics and can exceed useful context. Filter deterministically and benchmark shortlist recall.

  • Enumerations: Choice over valid canonical values plus not-stated.
  • Multi-label entities: one Noul per validated candidate when several can apply.
  • Ordered qualitative attributes: Score with explicit rubric levels.
  • Dates and numbers: extract components, parse and calculate in code.
  • Long documents: retrieve source passages before candidate generation and selection.

Validate Syntax, Source Support and Business Meaning Separately

Do not ask one model call to certify all six layers. Separating them makes failures reproducible and keeps exact rules out of probabilistic inference. A Jev result can identify semantic role; it cannot turn an invalid value into a valid one or grant access to the source document.

LayerExample checkMechanism
Syntax2026-02-30 is not a dateTyped parser or JSON Schema format validation
Normalization$1,200.00 becomes decimal 1200.00 USDLocale-aware deterministic code
Source supportSelected value occurs at the recorded spanOffset or token-span verification
Semantic roleThe date is termination, not signatureJev Choice/Noul or reviewed classifier
Business ruleTermination falls inside a notice windowDate arithmetic and policy code
AuthorizationCaller may access and act on this contractIdentity and access-control system

Preserve Provenance and Treat Source Text as Untrusted

Each candidate needs a stable source document, span and extraction-method reference. Never let a selected string become a database key, URL, command or account identifier without deterministic validation and authorization. Adversarial document text can steer Jev 1.13, so model selection is not a trust conversion.

For personal, legal or financial records, minimize fields and apply the deployment’s retention and access policies. The state guide covers trust separation, while the relevant domain use cases describe human-review boundaries.

Document Text Can Attack the Selector

A contract, email or webpage can contain instructions addressed to an AI system. Those strings are evidence, not trusted application instructions. Keep the extraction criterion outside the document, label source boundaries clearly and never let selected text become a command, URL or identifier without deterministic validation. OWASP’s prompt-injection guidance treats external content as untrusted even when it arrives through retrieval.

Test candidates whose surrounding text says “ignore previous instructions,” visually hides a different value, repeats one option many times or places conflicting values in appendices. TypeSafe documents adversarial steering and long irrelevant state as Jev 1.13 weaknesses; the limitations guide turns them into regression cases.

Evaluate Stages and Slices

Report candidate recall, conditional selection accuracy and end-to-end exact match with separate denominators. For 100 fields, a generator that contains the truth in 90 candidate sets and a selector correct on 81 of those has 90% candidate recall, 90% conditional selection accuracy and 81% end-to-end accuracy. Reporting only 90% selection accuracy hides the missing candidates.

Measure source-span precision and not-stated false positives as first-class outcomes. A plausible value copied from the wrong clause can pass normalized-value checks while failing provenance. Use the evaluator scorecard for uncertainty and release gates.

  1. Freeze documents, source annotations and a held-out split.
  2. Measure candidate recall before Jev sees the list.
  3. Measure conditional selection and not-stated calibration when the truth is present or absent.
  4. Measure end-to-end exact match, source-span correctness, review coverage, latency and cost.
  5. Slice by document type, length, language, number of candidates and adversarial content.

Monitor the Extraction Pipeline by Stage

A shift in final accuracy can originate in document layout, OCR, the candidate generator, normalization, Jev, thresholding or reviewer practice. Version each stage and preserve the intermediate artifacts so drift monitoring can locate the change.

  • Documents with zero, one, many, conflicting or truncated candidates.
  • Candidate count, deduplication rate and source-span validation failures.
  • Jev answer distributions, no-match rate and review-band coverage.
  • End-to-end corrections by field type, document type, language and generator version.
  • Latency and cost for parsing, retrieval or generation, Jev selection and human review.

FAQ

Can Jev return a name not in the candidates?

No. Jev’s native interface returns bounded typed decisions. Use a parser or generative model to propose arbitrary text first.

How do I handle a missing value?

Include a clear not-stated/no-valid-candidate option or separate fit Noul, then route uncertainty rather than forcing a value.

Should Jev parse dates?

It may select among text candidates, but TypeSafe recommends parsing and comparing exact dates in code.

What is the most important extraction metric?

End-to-end correctness matters, but candidate recall and conditional selection accuracy reveal which pipeline stage fails.

Sources

Checked against the sources below on September 22, 2026. Model versions, prices and limits change.

  1. TypeSafe AI docs: Jev 1.13 jaggedness
  2. TypeSafe AI docs: How to build with System One
  3. TypeSafe AI docs: Primitives
  4. TypeSafe AI docs: State
  5. TypeSafe AI docs: HTTP API reference
  6. JSON Schema: Understanding JSON Schema
  7. spaCy: EntityRecognizer API
  8. OWASP: Prompt Injection