ContextGem Jev Extraction
Extract document aspects and closed concept values with Jev, while retaining probabilities and thresholds.
Extract document aspects and closed concept values with Jev, while retaining probabilities and thresholds.
ContextGem's DocumentDecisionModel selects the typesafe/jev-latest provider through LiteLLM. It builds closed predicates for document aspects and Boolean concepts, plus choices for single-label concepts. It evaluates aspect predicates per paragraph, and concept questions against the relevant document text. The library applies thresholds and retains answer probabilities on extracted items.
Choose the required form of termination notice.
The repository example supplies a service agreement stating that either party may terminate for any reason with 30 days of written notice, governed by New York law. This chart shows the notice-form concept question against that document; paragraph-aspect predicates are evaluated separately.
Create a Document from the text, then declare the aspects and concepts to extract with their descriptions, labels, and classification settings.
Select typesafe/jev-latest and provide the TypeSafe API key through CONTEXTGEM_TYPESAFE_API_KEY.
DocumentDecisionModel.extract_all builds a predicate per paragraph for each aspect and questions for supported concepts, then submits the closed questions through the configured decision model.
The extraction uses probabilities and the decision threshold to include qualifying paragraphs and concept values. The returned items expose their probabilities.
Retrieve aspect and concept items by name from the returned document.
It separates paragraph selection from closed concept extraction and retains probabilities for each extracted item. The same document interface can use a decision model for closed questions and a language model for open-ended extraction.