Elamur Research

From unstructured text to structured reasoning: a hybrid knowledge graph for Indonesian sentencing analysis

Paper · 2026 · Hairurahman Hairurahman, Arif Perdana, Derry Wijaya et al.

Summary

A court judgment can explain who did what, which evidence the court relied on, and why a particular law applied. Comparing those details across many judgments is harder than finding them in a single decision. Indonesian criminal judgments often combine recognizable headings and verdict formulas with long factual narratives that quote indictments, repeat testimony, and vary in wording and format. Hairurahman and colleagues build a knowledge graph from these documents so that facts, evidence, statutory provisions, and outcomes can be compared through explicit relationships. The authors believe it is the first such graph built from Indonesian court decisions.

The study uses 9,109 narcotics and corruption decisions. Seven legal practitioners annotated 200 of them, identifying useful factual sentences and labeling passages that describe conduct, evidence, quantities, statutory articles, and other details. The system uses text patterns to read the more standardized header, verdict, and closing sections. In the facts section, an Indonesian-language classifier called IndoBERT screens sentences for relevance. LegalBERT, adapted from English legal texts to the annotated Indonesian examples, then identifies the passages to extract. The system connects these items through named relations, so a reader can follow a path from a defendant to an alleged or established act, from the act to supporting evidence, and from the act to a provision cited in the case.

Filtering raised the reported F1 score for narrative extraction from 67% to 84.39%. F1 combines precision, which measures how often extractions are correct, with recall, which measures how frequently the system finds what it should. The average narrative extraction F1 was 86.1% for corruption and 82.3% for narcotics. In a separate prediction task, a classifier given the graph as a sequence of triples reached 85.0% test accuracy when assigning judgments to sentence-length bands. The corresponding IndoBERT full-text baseline reached 28.1%, while the filtered narrative reached 64.2%. Full-text classifiers performed far better on their training data than on later decisions, a pattern consistent with overfitting.

The prediction experiment shows that a compact, legally organized record carries a strong signal about sentencing in these cases. It does not establish that the classifier can recommend a fair sentence or reconstruct a court’s reasoning in full. The graph omits details such as remorse, cooperation, and some aspects of intent, all of which can matter to the outcome. The data also cover a selected set of finalized, digitized first-instance decisions. Because the source documents include verdicts and the graph schema can record them, the evaluation leaves an important practical question open: how well would prediction work using only information available before sentencing?

Deep dive: From unstructured text to structured reasoning: a hybrid knowledge graph for Indonesian sentencing analysis

A hybrid knowledge graph turns Indonesian criminal judgments into structured records and tests how well they predict sentencing severity. · about 35 minutes to read

The problem and its context

Why similar cases are hard to find and compare

The paper situates its work in Indonesia’s civil-law tradition, in which legislation provides the principal authority for deciding cases. Written statutes still have to be applied to particular events. Judicial decisions show how courts move from a record of what allegedly happened to findings about conduct, evidence, and liability. The authors discuss Supreme Court cassation decisions as part of that interpretive process. Their own empirical study uses finalized first-instance criminal judgments, the records in which they seek to connect factual narratives to outcomes.

A case number or date can often be found by looking in a predictable place. A question about the grounds for a sentence requires a different kind of reading. Consider a judgment that records a defendant’s conduct, gives a quantity, includes a witness’s account, and cites a provision. The relevant issue is how those items fit together. The quantity has to be assigned to the right act. The testimony has to be understood as support for a particular assertion. The cited provision has to be identified as governing the conduct at issue. A search for the individual terms can locate documents that mention them without resolving any of those relationships. The distinction matters for information retrieval and search aimed at finding cases that are comparable on legal grounds.

The physical organization of the documents adds difficulty. The Supreme Court’s SEMA No. 1 of 2022 set out templates, but the paper describes uneven adherence. Headers and closings can contain useful recurring language even when the formatting varies. The fakta, or facts section, is much less predictable. Its length depends on the case and how the judgment was written, and it can contain repeated passages from the indictment, detailed witness accounts, and lists of exhibits. Some decisions also contain typographical inconsistencies or repeated verdict text. The authors point out that repetition may serve a procedural or evidentiary purpose in the official document. The extraction task calls for deciding which of those passages contributes information about the case.

There is also a difference between variation in format and variation in meaning. A date in prose and a date in a standard numeric format express the same kind of fact. Moving from one to the other can break a rule that expects a specific pattern. Narrative variation is harder. An event may be described with different words, and similar words can do different jobs in a witness’s statement, a prosecutor’s account, and a court’s findings. Dutch-derived legal terms, Arabic expressions, and regional language in testimony can occur within the same decision. The task involves recognizing what a passage is doing as well as recognizing the words it contains.

In some judgments, the connection the researchers want to recover is itself only implicit. A court may cite an article with little explanation of how the established facts satisfy its elements. Organizing the document around acts and statutes helps a reader inspect the available material, but the text may still leave the inferential step open. This makes knowledge representation and reasoning part of the research problem. A representation has to make room for relationships that matter in law while remaining accountable to what a judgment actually says.

The authors connect this problem to sentencing disparities. A collection of outcomes can show that punishments vary. Assessing whether the variation is justified requires comparing the circumstances that could account for it. A measured quantity helps characterize a narcotics case. In a corruption case, an official’s authority and relationship to an alleged benefit may matter more. The same sentence length can therefore arise from quite different fact patterns. The paper’s proposal is to make those patterns easier to examine across cases by recording comparable features and naming the relationships between them.

What earlier systems could recover

In the paper’s account of early legal AI, expert systems such as HYPO and CATO represented legal arguments through the features of prior cases. Their structured inputs made aspects of legal comparison and argumentation explicit. The cost was the effort needed to identify and encode the relevant knowledge by hand. The move towards statistical natural language processing made it possible to process larger collections. The paper describes earlier work that used word frequencies to find relevant legal material and used templates to extract information from judgments. Frequency tells a system which expressions recur. It says less about which claim a witness supports or how a court connects the claim to a rule.

Within Indonesian legal information extraction, the paper cites Solihin and Budi’s use of regular expressions to identify items such as case numbers, names, and verdicts. The reported precision for structured sections was 92%. Free-form narratives exposed the limits of rules when the same information appeared in different phrasings and layouts. The authors also cite Nuranti and Yulianti’s use of conditional random fields for named entity recognition. That earlier work reached 78% F1 for identifying items including statutory references and party names. Finding a person’s name and determining the legal role that person plays in a particular account are separate tasks. The paper uses prior work on segmenting legal documents, including the Corpus for Automatic Structuring of Legal Documents, to place extraction in the context of identifying what each part of a judgment is for.

Another line of work adapted neural techniques to legal language or learned to predict outcomes from large collections of cases. The authors cite English-language LEGAL-BERT as evidence that prior training on legal documents can improve performance on a legal extraction task. They discuss Legal Judgment Prediction via Topological Learning as an example of outcome prediction on a much larger Chinese corpus. The paper reports 70–80% accuracy for that earlier work across tasks that included charge classification and sentence prediction. Those results come from a different jurisdiction and task setup. The connection to the Indonesian study is the question of what useful signals can be learned and how much structure has to be built into the input.

Hybrid approaches already existed in legal document processing. The authors describe German work that combined rules and active learning to classify statutory norms, and Vietnamese work that combined a bidirectional recurrent network with a conditional random field to find legal references. Their discussion also covers a study that applied separate techniques to rulings from the European Court of Human Rights, one for extracting metadata and the other for identifying arguments. The Indonesian study adopts the same general division of labor and extends the evaluation downstream. It asks whether the resulting representation remains useful when the task changes from identifying text to distinguishing sentencing outcomes.

The paper also addresses generative systems as a possible extraction route. It cites work reporting strong performance on fields such as dates and case numbers, alongside weaker performance on tasks involving reasoning or precedent. The concern is especially serious when an extracted item will be treated as a fact about a real court case. Large Legal Fictions is part of the evidence the paper cites on plausible but unsupported legal outputs. The authors also raise practical concerns about sending court material to external services and about verifying where an extracted assertion came from. Those considerations explain why they favor local processing and explicit extraction rules for this study.

Legal graphs supplied a further precedent. Some earlier systems encoded obligations, permissions, and prohibitions. Others represented the participants and outcomes of legal cases or helped users navigate connections between judgments. The paper highlights prior work using graphs to retrieve relevant provisions through paths connecting facts to legal rules. The challenge here is how to acquire those links from judgments with uneven formatting and variable descriptions of events. The graph design and the extraction procedure have to be considered together. An expressive schema is of limited use if the information needed to fill it cannot be recovered consistently from the documents.

The method, step by step

Start from the judgment’s existing sections

Indo-Law is the starting point for the main study and includes 22,630 first-instance criminal rulings from Jakarta, Yogyakarta, and the provinces of West, Central, and East Java. The records come from the Indonesian Supreme Court’s public repository. They had attained permanent legal force, known as inkracht, and were collected with corresponding PDFs available online. Indo-Law already organizes the decisions in XML. Separate fields hold parts of the judgment such as the header, defendant identity, detention history, case facts, legal reasoning, verdict, and closing. This gives the main pipeline access to document sections before it attempts to find the fields or narrative passages inside them.

The researchers narrowed the corpus by offense and by completeness. They selected narcotics and corruption, drawing their motivation partly from the national money-laundering risk assessment, which also identified tax evasion as a high-risk predicate offense. Narcotics and corruption supplied different kinds of information for the extraction procedure to handle. Narcotics cases can make material quantities and classifications central. Corruption cases may rely on a person’s office, authority, and relationship to an act or benefit. The authors retained 9,109 decisions after filtering for the target scope and removing records with incomplete material or unsuitable dispositions, including procedural dismissals and appellate affirmations. The facts and verdict were important to that screening.

A separate collection of 702 original PDFs was used to develop a document segmentation procedure. Those documents correspond to Indo-Law records. Some original links could no longer be used after changes to the repository. The PDF work is supplementary. It addresses how to produce the section fields that were already available in the curated XML used for the main analysis. The paper identifies Indo-Law as the source collection and reports that the study dataset is publicly available through Figshare.

From court judgment to sentence band

The steps in order.

From court judgment to sentence bandStep 1: Read the judgment’s sections1. Read the judgment’s sectionsStep 2: Extract institutional facts with text patterns2. Extract institutional facts with text patternsStep 3: Screen factual sentences for legal relevance3. Screen factual sentences for legal relevanceStep 4: Identify entities in retained passages4. Identify entities in retained passagesStep 5: Connect entities using legal relation types5. Connect entities using legal relation typesStep 6: Serialize triples in document order6. Serialize triples in document orderStep 7: Classify the recorded sentence into a severity band7. Classify the recorded sentence into a severity band

Use text patterns for recurring institutional facts

The rule-based branch covers the kepala putusan or header, the amar putusan or verdict, and the penutup or closing. Each section offers a different combination of repeated phrases and expected fields. The header supplies the court location and case number. The verdict supplies the statement of the outcome, the defendant’s name, offense information, and a list of evidence where present. The closing gives the date and identifies people holding procedural roles, including judges, the prosecutor, and the clerk.

The rules are written as regular expressions, which describe recognizable patterns in text. A rule for a verdict can look for alternative terms that signal the start of a disposition and for later words that indicate a boundary. The choice of several possible markers follows from the variation the authors saw in real decisions. A rigid rule keyed to a single standard phrase would miss judgments that use another expression to introduce the same part of the document. The rules draw on the court’s prescribed template and the position of the relevant fields.

The attraction of a rule is that a reviewer can inspect why it captured a span. An unexpected heading, a typo, or a date written in prose can still leave a field missing or incorrectly bounded. The paper evaluates structured extraction using strict text matching, including character-level agreement for identifiers. That is important for a case number, which is used to anchor the other records for a decision. A slightly altered number can point to the wrong case. The rules themselves do not require labeled examples for training, although assessing their outputs requires a reference.

The facts section is handled at sentence and entity level. The authors recruited seven legal practitioners from an Indonesian financial intelligence institution. They had criminal-law experience and used a shared annotation guide with examples and legal definitions. Using Doccano and Ngrok, they annotated 100 judgments for each offense type, for a total of 200. Two practitioners independently reviewed each document, and disagreements were flagged for expert adjudication. The resulting reference data reflect both the written instructions and the judgments made when applying them.

The labeling guide distinguishes the conduct described in a document from its characterization under law. In the authors’ example, giving money to an official is a description of an act. Calling the conduct active bribery characterizes the act legally. The distinction matters because the graph is meant to carry both items and show how they relate. If the extraction procedure treats the legal characterization as the whole factual record, it loses the underlying conduct that a reader would need to compare with another case.

The definition of evidence also asks for more than a mention of an exhibit. Annotators looked for testimony, objects, or documents that the text identifies as supporting a factual finding. An exhibit label on its own can mark a document location without explaining the material’s evidentiary role. The relevance labels apply the same distinction at sentence level. A sentence could qualify because it contains specific conduct, ties evidence to a fact, applies a statute to an established event, or explains a circumstance that affects punishment. Routine procedural language, detention chronology without substantive explanation, unused procedural citations, and repeated indictment passages without judicial comment could be labeled irrelevant.

For entity extraction, the annotated judgments were split 70/15/15 for training, validation, and testing, with the offense categories balanced across splits. Training supplies examples for learning the labels. Validation serves to choose among settings, and testing evaluates the chosen procedure on held-out material. The paper reports a different split for sentence prediction over the larger corpus. Keeping the two evaluations distinct matters because the extraction test asks whether the system can locate and name spans, while the prediction test asks whether a document-level representation is useful for classifying an outcome.

Screen sentences before looking for entities

IndoBERT is adapted to flag relevant sentences in the facts section. Each sentence receives a binary decision about whether to send it to the next stage. That screen is consequential because a span extractor cannot recover facts from a discarded sentence. The paper therefore emphasizes recall at this stage. Letting a small amount of boilerplate through adds noise. Rejecting a sentence that links a statement to an act can remove part of the eventual reasoning path.

The labels were heavily imbalanced. The paper lists 1,154 relevant and 60,737 irrelevant sentences. In that setting, overall accuracy can look high while the classifier routinely fails on the sentences the pipeline actually needs. The authors used the Synthetic Minority Oversampling Technique, or SMOTE, on the training data to increase the representation of the minority category. They report results both with and without oversampling. Their description names the oversampling procedure and the classifier, while leaving the representation on which synthetic examples were generated unspecified.

The filter encodes a particular use of the document. Its definition of relevance comes from the kinds of facts the authors want to extract for legal analysis. A sentence can be valid and necessary in the formal record and still fall outside that definition. Equally, a passage that the filter retains may contain several kinds of information. Screening narrows where the extractor looks. The next stage still has to decide which pieces of those sentences are statutory articles, units, descriptions of acts, and other entities.

The narrative extractor uses fine-tuning to adapt LegalBERT, which received its prior training on English legal material, to the annotated Indonesian cases. Separate extractors were trained for corruption and narcotics. This lets the shared legal categories coexist with categories specific to a domain. Drug classification is useful in narcotics judgments, for example, while a corruption label or a defendant’s position can carry more information in corruption judgments. The authors use IndoBERT for filtering and PDF segmentation. LegalBERT’s role in the main pipeline is to assign entity labels to passages in the relevant narrative.

The paper’s rationale for cross-language transfer is that some legal expressions share organizational features even when their words differ. Citations have recognizable forms, the legal status of evidence is often described through recurring constructions, and narratives group activities with their participants and other properties. Indonesian annotations are needed to adapt the extractor to how those features actually appear in this collection. The study reports an advantage for LegalBERT over IndoBERT on this extraction task, which supports the choice within the tested setting.

During training, the authors varied the amount of text surrounding a target span. In the paper’s notation, the tested settings were:

c ∈ {3, 5, 10}

Here c is the number of tokens on each side of the entity, and ∈ means that the tested value comes from the set enclosed in braces. A token is a unit into which the input text is divided for processing. The selected value was 5, with context taken before and after the span. The model was trained with the AdamW optimizer at a learning rate of 2e-5. The learning rate controls the scale of the parameter updates during fine-tuning.

An extracted span and its type can be evaluated separately in principle. The study’s matching rules also differ by the nature of the entity. It requires an exact match for objective items such as statutory citations and quantities, where changing a numeral or reference can change the fact being recorded. For interpretive spans such as acts and indictments, the paper uses partial matching at a token overlap threshold of 0.8. Two readers may agree on the conduct and select slightly different words around it. The relaxed criterion accommodates that boundary difference. The paper specifies the threshold without giving a formula for the denominator of the overlap measure.

Turn each decision into linked statements

In the graph, an entity is something that can participate in a statement, such as a decision, a court, an act, an exhibit, or a statutory article. Each statement is represented as a triple:

(head, relation, tail)

The head is the originating entity, relation names the directed link, and tail is the entity at the other end. Parentheses group the fields, and commas delimit them. A case number can be the head of a statement whose relation identifies the court district and whose tail is the extracted location. This form allows several distinct statements to share the same case identifier.

For structured fields, roles and relationships largely come from their positions in the judgment. The system can connect a case to its date, location, or prosecutor because the corresponding text was identified in a section with a known purpose. The structured schema also links the case to its verdict, and the verdict to its defendant, offense, and evidence fields. The paper’s prose describes institutional relations in terms such as issuance by a court and documentation by a clerk. Its structured triple table expresses several of those facts through links from the case number. In either form, the institutional branch gives the factual material a jurisdiction, a date, and a decision to which it belongs.

The narrative branch puts the criminal act at the center of many relationships. A performs_action relation associates an actor with conduct. subject_to_article connects the conduct to a legal provision, and proven_by connects it to supporting material. quantified_as supplies a measure, while classified_as relates the conduct to a drug or corruption category. The schema also uses known_as for a position profile. These are named links with different meanings. A measure answers how much was involved. A statute answers which legal provision applies. The link to evidence identifies what the narrative treats as support for the conduct.

The authors ground the schema in legality, proof, and sentencing proportionality. Legality motivates storing a link between conduct and the provision that governs it. The standard of proof motivates keeping the evidentiary support for a factual claim visible. Proportionality motivates recording circumstances that help describe offense gravity. In the paper’s illustrative narcotics episode, the conduct is a transfer of methamphetamine. The graph records 500 grams as the quantity, identifies surveillance and an undercover purchase as evidence, and attaches Article 114(2) of Law 35/2009 to the act. A reader can inspect the evidentiary and statutory links separately. The authors intentionally route both through the conduct, so that a piece of evidence supports a factual proposition and the provision governs the conduct expressed by that proposition.

The conceptual schema explains which kinds of relationships make sense. A separate procedure decides which extracted mentions actually get connected. It starts with the case number as an anchor and orders the spans by their character offsets in the document. If the next entity is a criminal act, the procedure establishes a performs_action link from the case anchor and uses that act as the head for following items. A later act starts a new episode. If an entity is encountered before any act has been established, the case number remains the head. The conceptual examples show a defendant linked to an act, while the sequential procedure described in the paper uses the case number as its initial head. This distinction helps explain how the graph schema and the rules that populate it fit together.

The label assigned to an entity then helps determine its relation. A statutory article or indictment uses subject_to_article. A drug classification uses classified_as. Measures and evidence receive their respective quantity and support links. The procedure keeps using the active head until it encounters another act or reaches the document’s end. This gives the pipeline a way to construct edges from entity labels and their order without a separately reported, trained relation classifier. Its simplifying assumption is that related items tend to occur in an identifiable narrative episode. The resulting edge is inspectable even when the assumption needs to be checked against the judgment.

Serialize the graph for the prediction task

The prediction experiment converts each decision’s graph into an ordered sequence of triples. The sequence follows the order of the document, so nearby pieces of a factual episode can appear together while the relation names remain explicit. The classifier receives tokens representing the fields and relations. For example, a trafficking act can appear alongside the corresponding quantity, drug classification, and article. The input has some of the document’s narrative order in a much smaller form.

The task is text classification into sentence-length bands. The paper uses the observed sentence distribution to define thresholds it calls quartiles:

(Q1, Q2, Q3) = (480, 1080, 1800)

Q1, Q2, and Q3 denote the successive reported cutoffs, measured in days. The equals sign assigns the values on the right to the corresponding labels on the left. The boundaries separate mild, moderate, heavy, and very heavy sentences. Exact day ranges are given separately in the paper’s punishment table, whose endpoint conventions are clearer than those in the prose.

Both a bidirectional long short-term memory classifier with attention, called Bi-LSTM, and a BERT classifier were used with the graph sequences. The recurrent architecture processes input in both directions and uses attention to emphasize parts of that input. The BERT setup uses a classification head to turn its encoded input into scores for the punishment bands. The same types of classifiers were evaluated with full-text input. That comparison assesses what happens when the representation changes while the classifier family stays the same. It does not require a graph traversal during prediction. The structure reaches the classifier through the serialized triples and their relation names.

Recover sections from raw PDFs in the supplementary pipeline

For the PDF experiment, the authors converted the downloaded files to text with pdfminer.high_level. They removed watermarks, headers, footers, and unnecessary punctuation, and excluded records with missing values. The next task was segmentation. Its output was a section label for a chunk of text, before any attempt to identify a case number, statutory reference, or act within the chunk.

The chunking settings reflected how the sections tended to be written. The best setting reported in the appendix used (10,10,40,10) lines for the header, verdict, facts section, and closing, respectively. A short chunk can cover an institutional section. A longer one provides room for events, witnesses, and evidentiary material to occur together in a factual passage. The authors used semantic similarity to the matching Indo-Law fields to assign labels to chunks, aggregated chunks with the same label, and used those labels for training. The selected setting used an 80% similarity threshold. Fine-tuning used IndoBERT with AdamW and a learning rate of 1 × 10⁻⁵. This procedure addresses the preparation of future PDF inputs. The main sentencing and extraction results were obtained using the curated XML sections.

Experiments and results

The sentencing test used judgments from later years

The sentence prediction dataset contains the 9,109 retained cases. The paper’s punishment table assigns 723 decisions to mild sentences of 0–479 days, 916 to moderate sentences of 480–1079 days, 4882 to heavy sentences of 1080–1799 days, and 2588 to very heavy sentences of 1800–8000 days. The paper calls the cutoffs quartiles, but the resulting bins are plainly unequal in size. The table gives the usable endpoint conventions. Some of the paper’s prose descriptions overlap at the boundaries or describe the highest band as above 1800 days.

The authors divided the data by time. The training set contains 7,287 decisions from 2015 through 2019, representing 80% of the corpus. Validation uses 911 decisions from 2020, or 10%. The held-out test set contains 911 decisions from 2021 to 2022, also 10%. Case IDs are unique to a split. The authors report maintaining the split proportions across narcotics and corruption and checking that the provinces were proportionally represented. They give the result of that distribution check as:

χ² = 2.34, p = 0.67

χ² is the chi-square statistic for the provincial balance check. p is the associated probability, under the distribution assumed by the test, of obtaining a statistic at least as extreme as the one observed. Each equals sign gives a reported value, and the comma separates the two results. The check addresses provincial representation across the time split. It does not provide a test on a withheld province or control for the identities of individual judges.

The full-text classifiers received a concatenation of the header, facts, verdict, and closing. The graph condition gave the same classifier families a sequence of extracted triples. The paper’s principal comparison names IndoBERT-base as the BERT classifier. Its architecture table also lists bert-base-uncased and a 128-token input limit for a BERT setup. The paper does not reconcile those details with its references elsewhere to much longer documents. The comparative results can be read from the prediction table, while the exact handling of long inputs is less clear.

Graph sequences improved results for both classifiers

Test accuracy is the share of held-out cases assigned to the correct band. The paper also reports precision, recall, and F1, which can expose aspects of classification performance that overall accuracy hides when class frequencies differ. Precision asks how frequently a predicted label is correct. Recall asks how many of the cases with a label are recovered. F1 combines those quantities and is sensitive to weakness in either of them. The reported aggregate scores do not provide a separate account of how well each punishment band was recovered.

Sentence-length classification on held-out Indo-Law decisions

Both classifiers are more accurate when they receive triples.

Sentence-length classification on held-out Indo-Law decisionsBi-LSTM on full text: 26.3Bi-LSTM on full text26.3Bi-LSTM on graph triples: 82.7Bi-LSTM on graph triples82.7IndoBERT on full text: 28.1IndoBERT on full text28.1IndoBERT on graph triples (this paper): 85.0IndoBERT on graph triples (this paper)85.0
The numbers
System or settingaccuracy %
Bi-LSTM on full text26.3
Bi-LSTM on graph triples82.7
IndoBERT on full text28.1
IndoBERT on graph triples (this paper)85.0

For Bi-LSTM, the paper gives training accuracy of 0.952 on full text and 0.884 on the graph representation. The respective test F1 scores were 0.241 and 0.819. For the BERT classifier, training accuracy was 0.968 on full text and 0.892 on graph triples. The corresponding test F1 scores were 0.265 and 0.844. The paper reports a test accuracy improvement of 56.4% points for Bi-LSTM and 56.9% points for IndoBERT. Both families were better at fitting the training examples when presented with full text, yet the compact inputs performed much better on later judgments.

The authors read the train-to-test decline as overfitting. A learner can make successful predictions on familiar decisions by exploiting features that fail to generalize, such as wording associated with a court, repeated formulas, or stylistic details correlated with particular offenses. In a chronological evaluation, the decline can also reflect differences between the earlier and later records. The comparison establishes that the graph representation was much more effective on the held-out decisions under this setup. It does not by itself identify what information the classifier used or which changes across years contributed to the full-text results.

Extraction quality varied with the kind of information

For the rule-based branch, the paper reports average precision of 0.924, recall of 0.913, and F1 of 0.919 across the structured entity types in its results table. The evaluation covers the 9,109 retained cases. Case number extraction had an F1 of 0.975 and decision date extraction an F1 of 0.948. Verdict statements came in at 0.905, judge names at 0.886, and defendant names at 0.88. The recurring formats thus supported particularly dependable identification of case numbers. Names and the edges of formulaic statements presented more variation.

The relevance filter is a case where accuracy alone obscures the most important difference. The result without oversampling was 0.9812 accuracy, but its recall for relevant text was 0.3894. Precision was 0.4327 and F1 was 0.4101 in that setting. With SMOTE, the paper reports 0.9965 accuracy, 0.993 precision, and a recall of 1, with F1 of 0.9965. Finding the relevant sentences was what preserved the input needed for extraction. A strong overall accuracy score without that coverage would leave the graph thin in precisely the material the researchers wanted it to contain.

The effect carried through to the next stage. Extracting entities directly from raw narrative gave 67% F1. With relevance filtering, overall entity extraction reached 84.39% F1. The paper reports this gain as 17.39% points. This is separate from the accuracy of the relevance filter itself. The filter scores concern which sentences are retained. Extraction F1 concerns whether the desired legal spans are identified in the narrative.

Narrative entity extraction F1 on the annotated Indo-Law cases

Screening sentences for legal relevance improves extraction.

Narrative entity extraction F1 on the annotated Indo-Law casesUnfiltered narrative: 67Unfiltered narrative67Relevance-filtered narrative (this paper): 84.39Relevance-filtered narrative (thispaper)84.39
The numbers
System or settingF1 %
Unfiltered narrative67
Relevance-filtered narrative (this paper)84.39

For extraction from the filtered facts, the average F1 was 86.1% in corruption and 82.3% in narcotics. The authors give 84.2% as the cross-domain average and explain the difference from the overall 84.39% as a consequence of micro-averaged weighting across entity types. The domain results are useful for comparing the two offense settings. The combined score summarizes performance under the paper’s aggregation convention. These values describe extraction from the facts section and should be read separately from the rule-based scores for institutional fields.

Some of the category-level differences are larger than the difference between the offenses. In corruption, statutory articles reached an F1 of 93.8%, while evidence reached 0.894 and indictments 0.798. The position profile result for narcotics was 61.3%. The authors associate that weakness with the uncertain relevance of occupations to many drug cases. An occupation can be easy to read as text and still be difficult to label consistently as a legally pertinent role. The same category may carry a clearer function when an alleged corruption offense depends on the defendant’s authority.

PDF results were weaker for the facts section

The supplementary segmentation experiment also found a gap between factual narrative and institutional sections. Its results table reports test F1 of 90,20% for the header, 94,81% for the verdict, and 90,17% for the closing, alongside 56,55% for the facts section. The narrative account in the appendix gives a different set of values under the F1 label, including 69.1% for the facts section. These figures are not reconciled in the paper. Both presentations place the facts section below the others. That finding is consistent with the practical difficulty of locating a long, variable narrative and identifying where it ends and legal reasoning begins.

This evaluation concerns locating sections in PDFs. The experiment on annotated XML begins after that operation has already been performed. The distinction matters for any attempt to use the approach on unseen raw files. A segmentation error can send testimony to the wrong branch or leave material out of the extractor’s input, and the headline extraction and prediction scores do not quantify the effect of those upstream PDF errors.

What the ablations show

Filtering and graph construction each improved prediction

The paper compares successive versions of the sentence prediction input. The first is the full-text baseline. The second provides a filtered narrative with procedural and repetitive text removed. The third provides the flattened knowledge graph. This comparison asks how much can be gained by shortening and selecting the text before replacing free prose with named entities and relations.

IndoBERT test accuracy across Indo-Law sentencing input stages

Filtering improves accuracy, and the graph sequence improves it further.

IndoBERT test accuracy across Indo-Law sentencing input stagesRaw full text: 28.1Raw full text28.1Filtered narrative: 64.2Filtered narrative64.2Knowledge graph triples (this paper): 85.0Knowledge graph triples (this paper)85.0
The numbers
System or settingaccuracy %
Raw full text28.1
Filtered narrative64.2
Knowledge graph triples (this paper)85.0

The paper reports a 36.1%-point gain between the full text and the filtered narrative. Test F1 for the filtered condition was 0.618. The transition from filtered narrative to triples brought an additional 20.8%-point gain in accuracy. Filtering therefore accounts for a large part of the comparison with raw text, and the final representation supplied a further benefit. This matters for how to interpret the graph result. Reading the full text and reading a carefully selected narrative are already different prediction problems in practice, even when the target is the same.

The authors attribute the second gain to explicit modeling of legal relationships. That interpretation is plausible, but the transition also changes what material survives, how densely it is written, and where it occurs in the classifier’s input. The comparison measures the joint effect of those changes. A controlled comparison with the same extracted items and the same input budget would be needed to assign the entire improvement to the relation labels. The paper offers an additional removal experiment that goes some way towards testing their contribution directly.

Removing relations and entities reduced accuracy

The authors report that removing all relation types reduced sentence prediction accuracy by 11.7%. Removing evidence nodes produced a reduction of 8.3%, removing quantity nodes produced a reduction of 6.2%, and removing statutory articles produced a reduction of 4.1%. These are the paper’s reported reductions. The discussion does not supply the resulting absolute scores or a detailed protocol for rebuilding the inputs after each removal.

Within that comparison, stripping out relation types had the largest reported cost. Their labels tell a sequence classifier whether a phrase is attached as evidence, a quantity, or a provision. Removing the label can leave the words present while making their role more difficult to infer. Removing a node deletes a different kind of signal. A quantity node provides a measured characteristic of conduct, whereas an evidence node can tell a reader what material was cited in support of it. Both the identity of an item and its relation to the rest of the episode seem to matter to prediction. The reductions do not measure what would happen to a real sentence if one of those facts changed.

The context-window comparison concerns extraction rather than sentencing. The authors found that c = 3 provided too little local context for some entities whose qualifiers occurred farther away. The c = 10 setting admitted material from nearby clauses and reduced precision. The chosen c = 5 gave the best balance among the settings tested. The paper describes the pattern without giving a full score for each window. It also reports that LegalBERT outperformed IndoBERT by 6–8% across the extraction domains. These observations support the chosen settings in this pipeline. They leave open which aspects of legal pretraining, input processing, or adaptation were responsible for the comparison.

Repeated training and changes in wording tested stability

The random-seed analysis asks whether the graph score depends on a lucky training run. Across the reported runs, the graph-based IndoBERT condition averaged 84.6% ± 0.4% test accuracy and 84.1% ± 0.3% test F1. The full-text condition averaged 27.5% ± 1.2% test accuracy and 25.9% ± 1.4% test F1. The separation persisted across runs, and the graph results showed less variation in the reported measures. The experiments changed random initialization or training randomness under the existing evaluation design. They do not show how the results would vary with another time split or a new jurisdiction.

The paper also reports a test on unseen phrasings. The full-text condition reached 31.2% accuracy and the graph condition reached 83.7%. The authors explain the result through cases in which different phrases can yield the same triple. If the actor, act, and associated properties are extracted consistently, the classifier sees a similar representation even when the wording changes. The paper provides limited detail on how the phrasing examples were assembled, so the comparison indicates robustness in the reported test rather than a general guarantee about paraphrases or other languages.

The authors examined what the full-text IndoBERT classifier attended to. According to their report, judge names drew 23% of the attention, formulaic phrases drew 18%, location markers drew 15%, and section headings drew 12%. They also describe difficulty with cases containing denials of knowledge and with narratives where negation was separated from the relevant conduct by extensive intervening text. These observations suggest ways in which a long-text input can distract the learner from legally important distinctions. Attention measurements show where the mechanism assigned weight. To establish that a particular wording or name drove a decision would require changing that feature and evaluating the effect.

Disagreements and errors show what each stage loses

The annotation analysis measures how consistently practitioners applied the guide before adjudication. The paper reports aggregate agreement of κ = 0.83 for entity spans, 0.87 for entity types, and 0.79 for relevance labels. Here κ is the agreement statistic, which accounts for agreement expected by chance. Reported average pairwise agreement was 0.8302 in corruption and 0.8709 in narcotics. These domain figures should be read on their own terms. They describe human labeling consistency, which involves a different comparison from the classifier’s match against the adjudicated reference.

Case numbers had an agreement score of 0.98 in both domains and statutory articles scored 0.94. For criminal acts, agreement was 0.52 in corruption and 0.58 in narcotics. Type of corruption reached 0.47. A standardized citation gives the annotator a relatively well-bounded span. Defining a criminal act can require a judgment about where an episode starts and ends or whether a passage describes one act or several. Categorizing a payment can depend on timing, authority, and the way intent is understood. The results make that variability visible. They cannot establish that every disagreement represented a defensible legal interpretation, since boundary selection and application of the guidelines can also contribute.

The rule-based error analysis examined 728 failed extractions. The largest group, 412 cases or 57%, involved markers missing from the rules. Typographical problems accounted for 203 cases, or 28%. The remaining 113 cases, or 15%, departed from the standard formatting severely enough to require human review. This separates errors that might be addressed with a broader set of known expressions from errors that require better text recovery or a reader who can recognize the document structure without the expected markers.

For sentence prediction, the authors reviewed 136 misclassified judgments. In 42 cases, or 31%, the court gave a lighter sentence in circumstances involving leniency for remorse or cooperation. The authors identified procedural complications in 38 cases, or 28%. Ambiguous characterization of conduct accounted for 29 cases, or 21%, and unfamiliar fact patterns for 27 cases, or 20%. These are explanations assigned in an error review, rather than results of intervening on a particular feature. They show where a representation centered on acts, evidence, statutes, and quantities can lack information needed to explain an individual outcome.

Limitations

Limits identified by the authors

The authors frame the dataset as a collection of finalized, digitized decisions from a limited set of provinces. For 2015 to 2022, they estimate coverage of roughly 1.3% of nationwide narcotics decisions and 22.5% of corruption decisions. Courts with more consistent publication and documentation contribute more usable records. The requirement that decisions have permanent legal force and the exclusion of incomplete records further shape what can enter the study. The authors say 13,521 initially retrieved records were filtered out and characterize the resulting collection as weighted towards major urban courts. Stability within the sampled provinces provides some support for the method within that setting. Broader claims would require broader coverage.

The offense restriction matters as much as the geographic restriction. The chosen schema can express the quantity of a drug and the role of a public official. Another offense might require categories or distinctions that these cases rarely use. The paper proposes expansion to additional offenses and integration with a statutory graph so that the recorded facts and outcomes can be compared more systematically with elements and punishment provisions in the law. It also recognizes that the temporal split lacks an explicit control for judge identity because panel information is inconsistent or redacted in some records. The authors suggest evaluating generalization across judges when fuller metadata become available.

The graph deliberately leaves much of the judgment in prose. Witness credibility, competing accounts of intent, remorse, victim impact, and procedural context receive limited representation. Some of these details matter most in the exceptional cases where a compact description of the conduct gives a misleading impression of the likely sentence. The authors discuss confidence-based referral for human review as a way to handle uncertainty, especially where annotators themselves vary in interpreting the text. The paper offers this as a design direction. Its experiments do not assess whether a particular referral procedure would reliably identify consequential errors.

The authors also distinguish historical prediction from legal and ethical evaluation. A classifier trained against recorded decisions can learn their disparities. A graph can make it easier to assemble cases with comparable facts and inspect their outcomes, but judgments about fairness require attention to evidence, case composition, and legal standards. The paper discusses disparity audits, contestability, and human oversight as part of any institutional use. Its reported accuracy measures agreement with historical sentence categories. It gives no direct measure of fair treatment or of whether an individual penalty was proportionate.

The study does not directly compare the pipeline with contemporary generative systems. The concerns that motivated the architecture include factual reliability, traceability, privacy, and cost. An empirical comparison on those dimensions would need systems tested on the same materials, with the same target fields and a protocol for checking whether outputs are supported. The paper identifies that comparison as future work. Its findings apply to the reported text, filtered narrative, and graph conditions under the tested classifier families.

Further limits of the experimental setup

The largest unresolved issue for prospective sentence prediction is what the inputs reveal about the outcome. The full-text input includes the verdict, the rule-based branch extracts a verdict statement, and the structured schema links the case number to that statement. The prediction procedure then describes serializing a decision’s graph. It does not explicitly say that the sentence duration, verdict text, or all outcome-bearing phrases were excluded from the representation used for prediction. If the triple sequence contains the recorded penalty or a close proxy, it may be easier to recover the correct band from the serialized graph than from a long text in which the same information is buried.

A chronological split and unique case IDs help prevent the same decision from appearing in training and testing. They cannot address information already present in the test input. The distinction is between classifying completed decisions and forecasting outcomes from a record available before judgment. The former can be useful for organizing an archive. The latter requires the evaluation to specify what was available at the prediction time and to exclude outcome fields from the inputs. The paper does not report a result under that condition. The punishment bands are also described as derived from the 9,109 decisions rather than fixed on the training period alone, which leaves their behavior under a strictly prospective setup open.

The graph serializes legal relationships, but the classifier consumes them as text. There is no reported comparison with a predictor given exactly the same extracted mentions and the same sequence length while varying only how they are linked. The edge-removal comparison supports the importance of relations within the authors’ representation, while leaving questions about input ordering and information budgets. This is particularly relevant because the architecture table lists a 128-token BERT limit and the discussion describes decisions extending far beyond it. A compact sequence can bring more pertinent content within a fixed input length. The paper does not document enough about truncation or long-document processing to determine how much of the comparison that accounts for.

There is also a gap between validating entity spans and validating graph edges. The annotated holdout and the extraction metrics indicate how reliably the procedure finds items such as a statute, an exhibit, or a quantity. The narrative linking rules rely on order and an active criminal-act head. A quantity or piece of testimony may be correctly identified yet attached to the wrong act when a decision revisits earlier events or recounts several people’s conduct in the same passage. The paper does not report a dedicated held-out measure of relation correctness. Sentence prediction gives evidence about the aggregate utility of the representation while leaving the accuracy of individual links unresolved.

That distinction bears on interpretability. The graph lets a reader inspect the extracted material and see which links were supplied to a classifier. It does not establish which links caused a prediction. A proven_by edge is also a claim about evidentiary support within the represented case. Reading the source remains important if the judgment quotes a disputed account, describes an allegation, or weighs conflicting testimony. The paper’s schema makes a path legible, but verifying the path still requires knowing whose account is being represented and what the court accepted.

Some reported performance cannot be fully assessed from aggregates. The sentencing classes are unevenly populated, and the paper gives one test accuracy and one F1 score per main setting. Those scores leave unresolved how the classifiers performed on each band, especially the less frequent ones. For relevance filtering, the paper describes oversampling the training data. It gives less detail about the construction and prevalence of the evaluation set and about how the synthetic examples were produced. The reported perfect recall applies to the evaluated setting, with no corresponding result for a new court or collection. In a workflow where a rejected sentence can remove an entire aspect of the case, that is a consequential distinction.

Finally, the raw PDF and curated XML evaluations establish different things. The PDF experiment shows a route towards recovering the document sections, with the facts section remaining the hardest to identify and with unreconciled appendix metrics. The strongest narrative extraction and sentencing results rely on sections already available in Indo-Law. An end-to-end evaluation from raw PDFs through graph construction and sentence classification would be needed to measure how segmentation, extraction, and linking errors accumulate. The paper also mentions potential uses such as finding analogous cases and reviewing consistency, but sentence-length classification is the downstream task for which it reports a benchmark.

What came after

No subsequent study is documented as building on this work.

Cite

Cite as Hairurahman Hairurahman, Arif Perdana, Derry Wijaya and Saru Arifin. 2026. From unstructured text to structured reasoning: a hybrid knowledge graph for Indonesian sentencing analysis. Artificial Intelligence and Law (Springer).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1007/s10506-026-09507-8

@article{hairurahman2026unstructured,
  title = {{From unstructured text to structured reasoning: a hybrid knowledge graph for Indonesian sentencing analysis}},
  author = {Hairurahman Hairurahman, Arif Perdana, Derry Wijaya and Saru Arifin},
  journal = {Artificial Intelligence and Law (Springer)},
  year = {2026},
  doi = {10.1007/s10506-026-09507-8},
  url = {https://doi.org/10.1007/s10506-026-09507-8}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/hairurahman-2026-unstructured-text-structured-reasoning/