#90
Monthly Rank
#217
Lifetime Rank
Share
20 September 2026
D

Document Classification with Open Legal Ontology using Jev

Twenty questions, for contracts.

Matt RobertsGitHubWebsite
Open Source

Gallery

About the Project

A command-line tool that works out what type of agreement a document is, by walking FOLIO's open legal ontology rather than guessing from a fixed list. Starting at the Agreements node, it asks the TypeSafe Jev model a single multiple-choice question at each level of the hierarchy: which of these child types fits? It keeps several candidate paths open as it descends, so an uncertain decision near the top can be corrected further down. The result is a FOLIO label and its stable IRI, plus the full path taken to reach it. No training data, no labelled examples, and no bespoke taxonomy to maintain — swap in a different branch of FOLIO, or add your own nodes, and it classifies against that instead.

Practice Areas

Key Features

Classifies to an open standard. Output is a FOLIO IRI, not a free-text label, so results are interoperable with any other system using the ontology.

Recursive traversal with a beam. One question per level over that node's children only; the default beam of three paths means an early wrong turn is recoverable.

Shows its working. Every run returns the full path from Document Types down to the chosen leaf, plus a normalised path score, so you can see where a classification became uncertain.

Help Needed

Benchmarking against traditional classification approaches and LLMs

About the Creator

MR
Matt Roberts