Elamur Research

Ontology-guided Knowledge Graph Construction from Maintenance Short Texts

Paper · 2024 · Zeno van Cauter and Nikolay Yakovets

Summary

A maintenance note may tell a reader what needs replacing without putting the affected part, the equipment it belongs to, and the required action into separate fields. Those distinctions matter when the notes are used to build a searchable knowledge graph. The paper studies whether a system can recover such facts from short, normalized maintenance records without being fine-tuned on a maintenance corpus. The authors give it an ontology, which supplies the vocabulary of permitted relations, and examples chosen for their similarity to the note being processed. The system returns triples, each of which names a relation and the two pieces of text it connects. The researchers then check the triples against expert-corrected annotations in the MaintIE benchmark.

On the held-out portion of the authors’ MaintIE split, Llama-3-70B-Instruct achieved an F1 score of 0.69 with 20 similar examples in each prompt. F1 combines precision, the share of returned facts that are correct, with recall, the share of annotated facts that are recovered. With 150 examples per prompt, the score reached 0.77, the value previously reported for a fine-tuned REBEL system on MaintIE’s loose relation extraction task. The authors use that published result as a comparison because both tasks assess the relation and the spans it connects. The strongest result belonged to a particular instruction-tuned release. Other Llama releases responded differently to instruction tuning and to longer sets of demonstrations.

An allowed relation name was typically the easiest part of the output to get right. A system could still write a different form of a word in the note, reuse a word found in a demonstration, or connect two expressions incorrectly. The study counts an endpoint as hallucinated when it fails an exact check against the note. For Llama-3-70B-Instruct at 20 examples, the reported subject and relation hallucination rates were 0.00 and the object rate was 0.01. For releases with more such errors, a filter that checks relation names and endpoint text frequently improved precision and F1. At 20 examples, filtering raised Llama-3-8B-Instruct’s F1 from 0.53 to 0.61.

The results support using retrieved examples to draft annotations for expert review. The evidence comes from coarse-grained, normalized work-order notes already known to contain annotated triples. The experiments measure how well a system extracts those triples, including which errors a simple check can catch. The proposed benefit for maintenance teams is that they could begin reviewing machine-generated drafts while their labeled collection is still growing. The paper leaves the effect on reviewers’ workload to be measured in practice.

Deep dive: Ontology-guided Knowledge Graph Construction from Maintenance Short Texts

Ontology-guided extraction turns short maintenance notes into graph facts, with examples and filtering that help control errors. · about 30 minutes to read

The problem and its context

From a work order to a set of facts

Maintenance work orders contain information about equipment, its parts, and the work it requires. A short note compresses these details into wording that a technician can read together. A graph needs to represent them separately. An equipment item and one of its parts can be linked by a part relation, for instance, while a separate relation records which part participates in an action. Once represented as edges between nodes, such facts can be used in tasks such as search. Getting the edges from the text is an application of information extraction.

A relation has a direction. The phrase referring to the whole belongs in a different position from the phrase referring to the part. Swapping the two produces a different claim, even when both terms came from the same note. The extraction problem therefore involves identifying pieces of the text, deciding whether there is a relation between them, choosing the appropriate relation, and placing the pieces in the right positions. An answer can get most of those decisions right and still produce a triple that cannot be used as the intended graph edge.

The authors situate their work alongside general-purpose graphs such as DBPedia, YAGO, and Wikidata, and graphs built for settings that include medicine and railway safety. They also point to earlier efforts to organize industrial maintenance knowledge with graphs. Their concern is the step that turns records into structured facts. A large graph may require substantial expert effort to build, and the notes from a particular industry can be difficult for systems developed on general-purpose text. The cost of annotation and the amount of available domain data constrain what can be learned through supervised training.

Why the maintenance setting changes the extraction problem

The paper describes two differences between industrial maintenance records and the material used in much earlier extraction research. One is vocabulary. A specialized term can depend on the equipment involved or the way work is recorded. The other is what the task asks a system to distinguish. A corpus designed for maintenance can label actions, states, parts, and their relationships at the level needed for that domain. Success on a general-domain benchmark offers limited evidence about those decisions. The paper mentions ACE, TacRED, and the CoNLL-2003 shared task as examples of the more general resources that had received considerable attention.

MaintIE gives the authors a way to study the domain on its own terms. Its maintenance short texts come from work orders and have undergone lexical normalization, which puts the wording into a more consistent form. The paper identifies MaintNorm as the work behind this treatment of industrial short text. The result is a collection of concise records that still carry maintenance-specific meanings. Normalization matters both to the difficulty of the task and to its measurement. With less variation in how a term is written, the evaluator can insist that the output preserve the wording of the particular note. In maintenance, a change between singular and plural can alter the number of components the resulting fact describes.

MaintIE also supplies annotations that specify how parts of a note are related. Creating such annotations requires decisions about the text spans and about which distinctions the schema should represent. The paper describes one version produced through intensive expert annotation and another produced by correcting automatic suggestions. The latter already illustrates a way of sharing the effort. A system makes an initial pass, and an expert corrects it. The question here is whether the initial pass can be made with labeled examples at inference time, while the pool of reviewed annotations is still being assembled.

Two ways to tell an extractor what to look for

A supervised system such as SpERT learns extraction from labeled data before it is used on new records. The authors contrast this with an extractor that sees labeled demonstrations in its prompt. The distinction concerns when the examples are needed and how they influence the system. In supervised fine-tuning, the labeled examples are used to update an existing system for the task. In in-context learning, the examples are part of the input for the current prediction, and a different note can receive a different selection. The paper draws on the broader account of this technique in the survey on in-context learning.

An ontology also tells an extractor what to look for. In this application it gives names to the concepts and relations used to describe maintenance records. A relation vocabulary gives the output a common interpretation across notes. For instance, a part relation consistently represents a connection from a whole to a part. Text2KGBench had previously used an ontology in prompts to guide extraction from text. Van Cauter and Yakovets adopt that setup for MaintIE and expand the use of demonstrations. They ask whether examples selected for the individual note can teach the expected pattern of extraction while the ontology supplies the available relation names.

The authors see a reason to combine these approaches when the domain or its labels change. Altering the ontology in a prompt changes what the extractor is asked to do on its next input. Replacing or expanding the demonstration pool similarly changes the examples available for that input. In contrast, a supervised system can need further training when the labels it was trained to predict change. Inference-time changes also bring a different responsibility. The generator can return text freely, so a relation named in its answer still needs checking. A relation classifier that chooses among a fixed set of labels has this constraint built into its output.

The particular goal of the study is to turn each short text into labeled, directional triples. A triple can serve as an edge in a graph derived from the work orders. The experiments thus focus on a component of graph construction whose output can be compared directly with annotated data. This choice makes it possible to measure the quality of the connection expressed by each triple, as well as whether the output follows the ontology and stays close to the note.

The method, step by step

What the extractor receives and returns

Consider the example in which a work-order note records a need to replace cabin lights. An annotator can represent the lights as part of the cabin. The annotated triples also connect the requirement to the lights through the agent relation and to the replacement action through the patient relation. In this example, the span for the requirement is the word require, and the span for the action is replacing. A reader might express the same situation in a full sentence. For the extractor, the requested answer is a set of explicit links among words in the maintenance note.

The paper describes the output convention using the following notation.

relation(subject, object)

relation denotes the label of the edge. subject is the first endpoint in the direction specified by that label, and object is the second. The parentheses delimit the two arguments, and the comma separates them. In the cabin example, hasPart connects the cabin as subject to the lights as object. The first and second positions describe the role each span plays in the relation, which can differ from its grammatical role in a sentence. Extracting a word simply because it looks like the sentence subject would miss that distinction.

This representation gives the evaluator several ways to inspect a returned fact. It can ask whether the relation is allowed, whether each endpoint appears in the source note, and whether the directed combination matches an annotated triple. The tests have different purposes. A permitted label and two visible endpoints establish that an output follows basic instructions. The reference annotation measures whether those pieces express a fact assigned to the note in MaintIE.

Ontology-guided extraction from a maintenance note

The steps in order.

Ontology-guided extraction from a maintenance noteStep 1: Prepare the annotated MaintIE splits1. Prepare the annotated MaintIE splitsStep 2: Retrieve similar examples for the target note2. Retrieve similar examples for the target noteStep 3: Assemble instructions, ontology, demonstrations, and target text3. Assemble instructions, ontology, demonstrations, and target textStep 4: Generate candidate triples4. Generate candidate triplesStep 5: Parse triples from the response5. Parse triples from the responseStep 6: Optionally filter unsupported relations and endpoints6. Optionally filter unsupported relations and endpointsStep 7: Score predictions against the held-out annotations7. Score predictions against the held-out annotations

Prepare the examples and hold out the targets

MaintIE offers fine-grained and coarse-grained annotations. The fine-grained version distinguishes 224 entity classes and was created through expert annotation. In the coarse-grained version, a fine-tuned SpERT system first proposed annotations and experts corrected them. Both versions use 6 relation types, so the authors chose the version with more examples, the coarse-grained collection of 7.000 records compared with 1.067 in the fine-grained collection. The experiment evaluates extraction within that broader supply of records and its simpler category scheme.

Before making the data split, the authors removed every record that had no annotated triple. This follows Text2KGBench’s practice and the scope of its evaluation procedure, which assesses texts with reference triples. The exclusion removed 272 records, reported as 3.9% of the coarse-grained collection. The authors report 6.728 remaining records and a 75/25 train-test split. The train portion contains 5.046 examples, and the held-out test portion contains 1.682 examples.

Here the train portion serves as a searchable collection of labeled examples. For a test note, its text is available as the extraction target, while its reference triples are reserved for evaluation. The system sees labeled triples for the selected demonstrations drawn from the train portion. This is how the procedure gives the generator examples of the task and keeps the answer to the current test item separate. The size of that searchable pool and the number of examples shown in an individual prompt are distinct quantities.

This distinction also explains the form of supervision involved. The maintenance corpus is used to illustrate the extraction task and to measure it. The authors keep the Llama system’s parameters fixed during this process. Some of the labels in the pool originated with suggestions from a fine-tuned SpERT system before expert correction. That is part of how MaintIE was produced. It is separate from the procedure by which the Llama extractor uses the finished annotations.

Select demonstrations for the target note

For each test record, the authors use sentence-transformers and all-mpnet-base-v2 to retrieve similar notes from the train portion. The retrieval component represents each short text as a vector that can be compared with the representation of the target. The study describes the selection in terms of semantic similarity. The paper cites Sentence-BERT in connection with this retrieval machinery. The text of the target is used to find relevant demonstrations, whose annotated triples then illustrate how the terms and relations are used.

A demonstration teaches more than the expected punctuation. It also shows which expressions the annotation treats as the endpoints of a fact and which relation applies to them. If a target concerns a component and a required action, nearby examples can show how such wording was represented in the dataset. The generator is expected to infer the pattern and apply it to the target’s own terms. This arrangement also explains a later source of errors. The context contains real maintenance terms from other records, which belong in those demonstrations but may be inappropriate in the answer to the target.

The authors test the following demonstration counts.

k ∈ {1, 2, 3, 5, 10, 20, 50, 100, 150}

k is the number of labeled examples included for a target note. The symbol ∈ means that k takes one of the tested values in braces. Each value refers to the number placed in an individual prompt, not to the total number of annotated notes in the searchable split. Text2KGBench’s single-demonstration setup corresponds to k = 1, where the equals sign specifies the exact count. Llama-2 could be tested up to 50 demonstrations under this protocol. At 100 and 150, the prompt exceeded its context length, the amount of text the system can take as input.

The work-order notes are short enough that the longer contexts can hold many annotated examples. This makes the paper’s question about demonstration count practical to test. A longer context can expose more instances of a useful relation, more annotation patterns, and more words from other records. The experiment tracks the combined outcome of those changes. The retrieved examples are selected for each target, so moving to a larger k changes which examples that target can draw on as well as how many appear.

Put the ontology and the examples in the same prompt

The prompt has four parts in substance. It gives the extraction instruction, supplies the ontology, includes the selected examples, and presents the target note. The instruction establishes that the answer should consist of triples. The ontology identifies the vocabulary that the answer may use, and the examples show that vocabulary applied to annotated maintenance text. The target is the record from which the new facts are to be extracted. Reading it in the same context as other records requires the generator to keep their roles separate.

The relation vocabulary covers containment, part membership, agents, patients, properties, and type membership. The authors express these using labels such as contains, hasAgent, hasPatient, hasProperty, and isA, along with the part relation used in the cabin example. The relation names are meaningful to a reader, but their intended use in MaintIE becomes clearer in the demonstrations. In the cabin example, knowing that hasPatient is permitted tells the system little by itself about the pairing of require with replacing. Their annotated appearance gives a concrete instance of how this relation is used.

Compared with Text2KGBench, the authors supply several examples when the chosen count calls for them and omit rules specifying which entity types can participate in each relation. The ontology in the prompt therefore guides the relation vocabulary without explicitly enumerating the valid endpoint types for every edge. The authors give a practical reason for this choice. Those rules consume prompt space, and the space can grow with the number of entity types, particularly for the fine-grained schema. The demonstrations leave room to show actual uses of the relations while the ontology sets the vocabulary.

The omission also sets the scope of an ontology check in this experiment. If a response uses isA, the label itself can pass. Assessing whether the particular subject and object stand in a type relation requires more evidence. Full conformance to a richer set of ontology rules would involve checking the types of those endpoints and any restrictions on their combination. That is a different screen from the one measured in this paper.

Generate a response and recover the triples

The authors test Llama-2-7B and Llama-2-70B from the Llama 2 family. They also test Llama-3-8B and Llama-3-70B, each alongside its instruction-tuned counterpart. Instruction tuning is prior training intended to make a release respond to instructions. It happens before this maintenance experiment. Comparing these releases helps test how well each responds to the same style of ontology-guided prompt, including its request to output only the facts in the specified format.

The generator returns text, which the evaluator scans using regular expressions. A regular expression is a pattern for recognizing strings, in this case a relation followed by arguments in the expected arrangement. Matched expressions are extracted as candidate triples. Their relation, subject, and object are then available for evaluation. This parsing step turns a generated response into the narrower object that the benchmark can score.

A structured-looking match does not establish that the generator intended to offer a fact. The authors found responses that included explanations and even Python code. A fragment of that material can resemble a relation with two arguments and be captured by the same pattern. The parser thus participates in the observed behavior. It can identify a triple in an answer containing extra prose, and it can also extract something from that prose that fails the ontology or source-text checks. Conversely, an answer that produces no parseable triples offers no facts for the evaluator to match.

The released materials identified by the authors include the code, prompts, and data. Their repository is named MaintIE2KGBench. The evaluation procedure connects the MaintIE notes and annotations to the Text2KGBench approach while adapting its rules for the narrower vocabulary of the maintenance records.

Adjust token prediction when producing the answer

Some early responses kept repeating tokens until the output limit. Others continued into explanations or code when the instruction called for triples. The authors investigated whether adjustments to the scores used to choose the next token could improve the answers. These scores are called logits. The frequency and presence penalties offered by the implementation affect the treatment of tokens that have already appeared, changing the tendency to repeat them or to diversify the response.

The experiment explores the following available range for the penalties.

[−2, 2]

The square brackets mean that the lower setting, −2, and the upper setting, 2, are included in the range. The comma separates the two bounds. The authors vary both frequency and presence penalties using Llama-3-8B, which they selected for computational reasons. The penalty experiment uses 10 in-context examples. With relation conformance already high in many runs, they examine the average of the subject and object hallucination rates when judging the effect on grounding in the note.

After the preliminary investigation, the authors settled on 0 for the frequency penalty and −1 for the presence penalty in all remaining experiments. These settings are part of the generation procedure, alongside the prompt. They affect how the extractor produces its response; the annotation pool and the ontology still determine the evidence and vocabulary it is given. That difference matters when comparing token prediction adjustments with the separate post-processing filter.

Evaluate candidates, with or without a filter

After parsing, the main fact extraction evaluation matches each candidate against the reference triples for the note. The relation label and both arguments must agree exactly and in the proper order. Precision measures how much of the predicted set matches the references, recall measures how much of the reference set the predictions cover, and F1 summarizes the balance between the two. A record for which the system returns nothing contributes no recovered reference facts even though it produces no words that could violate the ontology.

The second measurement, ontology conformance, checks the relation labels used in the candidates. The hallucination measurements make separate checks for subjects, relations, and objects. A subject or object is flagged when its text fails to match the target note. A relation is flagged when it is outside the ontology. The term hallucination in the paper therefore has a specific operational meaning. It marks identifiable failures to follow the evidence or the allowed labels.

The difference from Text2KGBench is especially important for endpoints. That benchmark uses stemming to match some forms of a word by a shared stem, accommodating linguistic variation in material drawn from Wikidata and DBpedia. In the MaintIE experiment, filter in the note does not license filters as an endpoint. By using exact matching, the authors preserve surface distinctions that can matter to an equipment description. Stemming reappears later in their error analysis as a way to identify possible sources of mismatches. It does not relax the main score.

The optional filter uses the same straightforward tests. It discards a candidate when either endpoint is absent from the source string or when its relation is outside the supplied set. It leaves the surviving triple in place, with the original relation and argument order. Filtering can remove predictions that fail conditions for a reference match. It cannot supply any missing fact, repair a reversed edge, or decide by itself whether an allowed label correctly describes two spans. By reporting scores before and after the filter, the authors estimate how much of the error can be reduced through those validity checks.

Experiments and results

Reading the comparison on MaintIE

The main experiments measure triple extraction over the 1.682 held-out records, with demonstrations drawn from the 5.046-record train split. The performance curves vary the demonstration count, and the paper gives a detailed comparison at 20 examples. Its discussion also compares the strongest run with REBEL’s published MaintIE result. SpERT serves two other roles. It helped pre-annotate the coarse-grained dataset, and the authors discuss its approach as an example of a supervised extractor with a restricted relation output. The paper gives the numeric external comparison for REBEL.

REBEL’s 0.77 F1 came from MaintIE’s loose relation extraction task under supervised fine-tuning with curriculum learning. In that task, the relation label and the spans involved are the basis for agreement. The authors choose this comparator because their own extraction experiment also evaluates triples without separately scoring entity class recognition. In the Llama runs, however, the system is prompted with demonstrations and scored on the authors’ held-out split. The reported REBEL number comes from the earlier MaintIE study. The comparison puts the scores in context while preserving the distinction between the evaluation setups.

MaintIE fact extraction F1 for prompted systems and the published REBEL comparator

The strongest prompted setting reaches the published comparator score with the longer demonstration context.

MaintIE fact extraction F1 for prompted systems and the published REBEL comparatorREBEL, published MaintIE result: 0.77REBEL, published MaintIE result0.77Llama-3-8B, 20 examples: 0.63Llama-3-8B, 20 examples0.63Llama-3-8B-Instruct, 20 examples: 0.53Llama-3-8B-Instruct, 20 examples0.53Llama-3-70B-Instruct, 20 examples: 0.69Llama-3-70B-Instruct, 20 examples0.69Llama-3-70B-Instruct, 150 examples (this paper): 0.77Llama-3-70B-Instruct, 150 examples (thispaper)0.77
The numbers
System or settingF1
REBEL, published MaintIE result0.77
Llama-3-8B, 20 examples0.63
Llama-3-8B-Instruct, 20 examples0.53
Llama-3-70B-Instruct, 20 examples0.69
Llama-3-70B-Instruct, 150 examples (this paper)0.77

At 20 demonstrations, Llama-3-70B-Instruct reached 0.67 precision, 0.74 recall, and 0.69 F1 on the authors’ test set before filtering. The recall value reflects the portion of the annotated triples it recovered, and the precision value reflects the portion of its returns that matched the annotation. With 150 demonstrations it reached the reported 0.77 F1. The equality of the F1 values makes the latter result a direct numeric point of comparison with the published REBEL score. The prompt-based result at 20 examples concerns a shorter context and remains below that comparator.

What changes across the releases

The size and release comparisons show why the authors distinguish between configurations. At 20 demonstrations, Llama-3-8B scored 0.62 precision and 0.70 recall, yielding a reported F1 of 0.63. Llama-3-8B-Instruct had the same reported recall of 0.70, with 0.48 precision and 0.53 F1. The equal recall figures indicate similar coverage at the reported precision of the measurement. The lower precision for the instruction-tuned release indicates that a smaller share of its candidate facts matched the reference set. The aggregate scores do not establish that the releases recovered exactly the same facts.

The direction reverses in the Llama-3-70B comparison. At 20 demonstrations, the release without instruction tuning recorded precision, recall, and F1 of 0.04 each. Its instruction-tuned counterpart produced the strongest scores in the prompt-based comparison. The authors attribute the low performance of Llama-3-70B to many empty generations. A larger release can therefore perform poorly even with the same ontology, retrieval method, and instructions. In this case it often failed to generate the material that the parser needed to score a candidate fact.

For Llama-2-7b-hf, the paper reports 0.31 precision, 0.26 recall, and 0.27 F1 at 20 examples. The curves also include Llama-2-70B, although the detailed row for the 20-example comparison reported in the paper is for Llama-2-7b-hf. The Llama-2 context limit prevents a comparison with the 100- and 150-example settings. The strongest system’s final result consequently cannot be treated as evidence about how either Llama-2 release would have reacted to the same number of demonstrations.

The performance curves show how success depends on demonstration count. Llama-3-70B-Instruct improves as more examples are supplied and reaches its strongest reported F1 at 150. For both Llama-3-8B releases, moving to 150 examples reduces fact extraction performance relative to a shorter setting. This distinction matters in a study motivated by the cost of annotation. Using examples at inference makes the count adjustable, but the useful amount of context depends on the system receiving it.

Why conformance and hallucination get separate scores

In the unfiltered 20-example comparison, Llama-3-70B-Instruct has ontology conformance of 1.00, subject hallucination of 0.00, relation hallucination of 0.00, and object hallucination of 0.01. Its 0.69 F1 can coexist with these rates because exact triple extraction is a stricter test of meaning and coverage. The system can pass the checks for ontology vocabulary and endpoint text while missing a reference fact or producing a different connection among acceptable words.

Llama-3-8B illustrates a different combination. It also has 1.00 ontology conformance at 20 examples, while its subject and object hallucination rates are both 0.03. For Llama-3-8B-Instruct, the table gives 0.98 ontology conformance and a relation hallucination rate of 0.02. Its subject and object hallucination rates are 0.08 and 0.09, respectively. In that setting, grounding the arguments in the target note posed a more visible difficulty than staying within the inventory of relations. The difference helps explain why an endpoint check can be useful even when almost all the relation labels already conform.

The nontuned Llama-3-70B has rates of 0.00 for all three hallucination measures in the 20-example table. The authors caution that many empty answers left few candidate facts to violate the checks. Its 0.04 F1 gives the necessary context for its apparently clean output. A score describing violations in generated triples has a different interpretation when the extractor frequently returns no triples. Reading it with recall shows whether low hallucination accompanies useful extraction.

Across the curves, ontology conformance generally stays near 1. Exceptions that the authors identify include declines for Llama-2-7B and Llama-3-8B-Instruct as the number of examples increases. The authors observe stronger adherence overall than in the Text2KGBench comparison they discuss. MaintIE’s single, modest relation vocabulary and its normalized records are relevant conditions for interpreting that observation. The study does not vary those conditions to establish which accounts for the higher conformance.

When filtering changes the result

The authors compare unfiltered and filtered extraction at 20 examples. Llama-3-8B-Instruct shows the clearest improvement among the configurations in that comparison. Precision rises from 0.48 to 0.58, recall changes from 0.70 to 0.69, and F1 rises from 0.53 to 0.61. The paper reports both recall values, so the practical result is an improvement in the balance of precision and recall with a slightly lower measured coverage in that row.

For Llama-3-8B, precision moves from 0.62 to 0.64 and F1 from 0.63 to 0.65, with the reported recall remaining 0.70. Llama-2-7b-hf has a smaller change: its precision rises from 0.31 to 0.32 and its F1 from 0.27 to 0.28, while recall stays at 0.26. The strongest release, Llama-3-70B-Instruct, moves from 0.67 to 0.68 precision and remains at 0.74 recall and 0.69 F1. Filtering leaves the reported Llama-3-70B scores at 0.04 for each fact extraction metric. These outcomes match the different opportunities for filtering: some releases produce many candidates that fail a basic check, while others emit few such candidates or few triples at all.

Taken together, the results distinguish between two sources of the useful output. A stronger prompt response can recover more of the facts and follow the ontology without help. Post-processing can make a noisier response easier to use by removing certain bad candidates. The filtered settings remain dependent on the extractor for the facts they recover. The best reported filtered F1 for Llama-3-8B-Instruct at 20 examples, 0.61, is still below the 0.69 already obtained by Llama-3-70B-Instruct at that count.

What the ablations show

The amount of evidence in the prompt

The paper’s controlled comparisons vary demonstration count, generation penalties, and the application of the output filter. It also compares Llama releases and inspects a set of their errors. Each comparison answers a different question about how the pipeline behaves. The demonstration-count experiment is the closest test of the benefit of adding more labeled context to the same extraction task. It retains the retrieval strategy, the ontology, and the general prompt design while changing the number of demonstrations.

For Llama-3-70B-Instruct, more examples accompany rising fact extraction performance and falling endpoint hallucination over the reported curve. In that case, the longer context appears compatible with better grounding. For Llama-3-8B and Llama-3-8B-Instruct, endpoint hallucination remains more evident as the count rises. The instruction-tuned smaller release first shows an increase and then a stabilization in hallucination. Both smaller releases lose extraction performance at the longest reported demonstration setting. A longer prompt can therefore supply more instruction through examples while imposing a different difficulty on each release.

The controlled variable here is the number of retrieved demonstrations. Their contents change along with that number. The experiment shows how the retrieval-based setup behaves as more examples are included. A separate comparison with randomly chosen examples would be needed to isolate the contribution of semantic retrieval from the contribution of seeing labeled demonstrations. Similarly, a prompted run without the ontology would be needed to isolate its contribution to conformance. The paper’s strongest claims concern the combined system it actually tests.

Instruction tuning supplies another comparison, with the strongest positive association appearing for Llama-3-70B. The smaller Llama-3 comparison shows that the same release distinction can coincide with lower precision and poorer conformance. In the large pair, the base release’s difficulty producing usable output is a substantial part of the observed gap. In the smaller pair, both versions recover many reference facts, and the precision difference points to the quality of their additional predictions. The comparisons thus connect instruction following to observable output behavior in this prompt, while the direction of the effect depends on the release.

The two penalties interact

The penalty sweep holds the demonstration count at 10 and uses Llama-3-8B. It compares extraction and endpoint hallucination as the frequency and presence settings change. The heat maps place a band of stronger extraction performance along an off-diagonal direction. An area with weaker extraction also has greater hallucination. A reading of the two axes together is more informative than assuming either setting has the same effect at every value of the other.

The authors interpret the presence-penalty behavior in light of how the task is defined. A generator encouraged to diversify its output can produce a term that is absent from the note, which fails the exact endpoint check. A term from a demonstration may be close enough in meaning to fit the surrounding output but still belong to a different work order. This offers an explanation for why encouraging diversity can be counterproductive in extraction where reusing the target wording is expected. The sweep shows that measured behavior changes with the settings; the error analysis supplies evidence about where some of the offending words might have come from.

The authors select a run for closer examination in which the frequency and presence penalties are set to 0 and 2, respectively. In that condition, Llama-3-8B’s subject and object hallucination rates are 0.22 and 0.21, respectively. Those figures characterize the selected high-hallucination setting. They are separate from the rates in the main 20-example table, which was produced with the different penalty settings adopted after preliminary experiments. The deliberate choice of a more error-prone run makes more failures available for checking and narrows what its error distribution can establish about other conditions.

Where an out-of-text word may have come from

The inspection focuses on endpoint errors and uses a restricted procedure for tracing possible origins. The authors limit the subject analysis to single-word subjects to make stemming tractable. They use an ordered set of checks. First, they look for the candidate endpoint’s stem in the stemmed target note. Next, they check whether the endpoint occurs in a demonstration. Finally, they check for a stem match in the demonstrations. The order reflects the authors’ assumption about which explanation is more probable when more than one check can apply.

A shared stem can identify a mismatch involving a verb form or the number of a noun. An exact match in a demonstration offers different evidence: the questionable term was present in the prompt, attached to another note. A stem match there extends that comparison to related forms. These checks turn some apparently invented terms into more specific observations about what was available in the input. The inspection finds substantial overlap between hallucinated endpoints and terms in the demonstrations, including cases involving subject errors and cases where both endpoints were affected.

The same word can support more than one explanation. The paper gives a case in which the source contains replaced, the extracted subject is replace, and a demonstration includes replace. The predicted form can be understood as a change to the target verb or as reuse of the demonstration wording. Presence in the prompt supplies a potential source. It does not identify which text the generator relied on or whether the same form would have been produced with a different context. The analysis makes the plausible sources visible without assigning causes the experiment cannot distinguish.

The manual inspection also finds relation errors with other mechanisms. Some outputs use an ontology concept as if it were an edge label. Others form a plausible-looking label by taking a concept such as Process or State and turning it into hasProcess or hasState. An output of that kind may look internally sensible while failing the experiment’s vocabulary check. The code fragments captured by the parser point to an additional route to bad triples. A response can contain material that happens to match the parser’s pattern even when the fragment serves a different purpose in the generated text.

How much the simple validity checks can recover

Filtering isolates a different part of the pipeline because it can be applied to the same generated candidates. Every retained candidate has passed the same checks for a permitted relation and endpoints in the source. When precision improves, the change follows from removing candidates that fail those checks. This makes the before-and-after comparison more directly attributable to the post-processing step than the demonstration inspection is to a particular source of a hallucination.

MaintIE test F1 before and after filtering at 20 examples

Filtering helps the smaller instruction-tuned release most among the settings shown.

MaintIE test F1 before and after filtering at 20 examplesLlama-3-8B-Instruct, unfiltered: 0.53Llama-3-8B-Instruct, unfiltered0.53Llama-3-8B-Instruct, filtered: 0.61Llama-3-8B-Instruct, filtered0.61Llama-3-8B, unfiltered: 0.63Llama-3-8B, unfiltered0.63Llama-3-8B, filtered: 0.65Llama-3-8B, filtered0.65Llama-3-70B-Instruct, unfiltered: 0.69Llama-3-70B-Instruct, unfiltered0.69Llama-3-70B-Instruct, filtered (this paper): 0.69Llama-3-70B-Instruct, filtered (thispaper)0.69
The numbers
System or settingF1
Llama-3-8B-Instruct, unfiltered0.53
Llama-3-8B-Instruct, filtered0.61
Llama-3-8B, unfiltered0.63
Llama-3-8B, filtered0.65
Llama-3-70B-Instruct, unfiltered0.69
Llama-3-70B-Instruct, filtered (this paper)0.69

The larger change for Llama-3-8B-Instruct is consistent with the pattern of its unfiltered errors. With more invalid endpoints and some invalid labels, there are more candidates for the checks to remove. Llama-3-70B-Instruct has little opportunity to benefit from the same operation at 20 examples because its measured hallucination rates are already low. The identical reported F1 before and after pruning shows the practical consequence at the precision with which the table reports the scores.

The filter is strongest where the task itself makes an output easy to check. A label outside the relation set violates the request. An endpoint absent from this normalized note violates the extraction convention. Other mistakes are harder. An allowed relation connecting two present terms can still assign the wrong role to a part or link an action to the wrong span. An extraction that omits an annotated relation passes no candidate to the filter for that fact. The remaining distance between the filtered scores and full agreement with the annotations arises from the limits of these checks as well as from the extractor’s performance.

Limitations

Limits identified by the authors

The authors point to prompt space as a constraint on carrying a richer ontology into the experiment. Rules describing which entity types may participate in which relations were omitted for this reason. The fine-grained MaintIE version has 224 entity classes and the same 6 relations, so the set of meaningful restrictions could occupy much more space. The reported conformance scores concern relation membership in the prompt’s vocabulary. The authors leave the handling of more extensive constraints for future work.

The context window also limits the number of demonstrations. For Llama-2, the 100- and 150-example conditions could not be run. The maintenance notes are short enough for other releases to use those counts here, which is an important property of the task. A domain in which each example needs a long description or where the ontology itself is much larger would change how much material fits. The longest-context result belongs to this combination of short records, prompt design, and the tested release.

The authors also limit the error investigation explicitly. They focus on selected endpoint hallucinations and use simple stemming and overlap checks to examine what may have caused them. Multiword subjects pose difficulties for that procedure. Further, the inspected setting was chosen because it produced relatively many hallucinations. The authors leave a broader inspection framework for future work and state that the exact reason for the observed reuse of context terms is unclear. The analysis supports an association between some wrong words and demonstrations that contain them. A causal account would require an experiment that changes the suspected source while controlling the rest of the prompt.

The paper acknowledges that the close comparison with the supervised benchmark depends on the strongest instruction-tuned release. The smaller releases yield different extraction and hallucination behavior. Filtering makes some of them more viable in this benchmark, but its effect depends on the kinds of errors they produce. Empty generations create another limit on how the scores should be read. The authors explicitly treat low hallucination for the nontuned Llama-3-70B cautiously because its lack of output also limits its opportunities to make such errors.

Limits visible in the experiment design

The system is evaluated on normalized coarse-grained MaintIE notes that already have reference triples. The 272 excluded records are precisely the notes on which a correct output could be empty under the annotation. The study therefore estimates extraction quality among records expected to yield facts. Estimating behavior across the original work-order collection would additionally require measuring how frequently the system invents a triple on a record with none. That matters for graph construction because unnecessary edges could accumulate even if the extractor works well on the subset containing facts.

The decision to use exact endpoint matching gives the measurement a well-defined basis in the note. It can also count small changes in form, including an inflection that a human reader might understand, together with unrelated words imported from a demonstration. The error inspection separates some of these cases. The headline rates still represent violations of the exact evidence rule, and their meaning depends on that rule. A domain in which an extractor is expected to normalize names or resolve references would need a measure appropriate to those operations. Conversely, a setting in which component count matters may have a good reason to preserve the paper’s strictness about singular and plural.

The paper’s supervision claim is also best read at the level of the individual prediction. The result with 20 examples uses that number in the prompt, selected from the 5.046-example train portion. It shows what an extractor can do with a small context of relevant labeled examples when a much larger pool is available for retrieval. The experiment does not simulate beginning annotation with a pool that contains only the same number of examples as fit in the prompt. A small project starting with very few reviewed notes might have less coverage of maintenance terms and relations, and the paper gives no measured curve for changing the size of the searchable pool.

The published REBEL comparison connects tasks with similar requirements for relations and spans. It provides a point of reference, while matching F1 values alone leave open the effect of evaluation splits and other protocol choices. The two approaches also place their demands on different parts of the process. REBEL was fine-tuned with labeled data beforehand. The prompted extractor needs retrieval and enough inference context to show the examples. The study reports extraction scores and discusses these differences. It gives no measured comparison of the time, compute, or expert effort required to reach the same extraction quality.

Finally, the output assessed here is a set of triples for each note. A graph assembled from many notes would need to reconcile which mentions denote the same equipment or component and how repeated facts should be consolidated. The paper’s test gives evidence for the extraction stage that would feed such a graph. Its proposed human review process likewise follows from an ability to draft candidate facts, rather than from a measured change in annotator speed or agreement. A follow-up study of that workflow could test how much correction these candidate triples require, including cases where a candidate looks valid because it passes the automatic filter.

What came after

TextMineX (2026) cites the maintenance study and uses ontology guidance in a pipeline for humanitarian mine action. Its scope includes data and an evaluation framework as well as the pipeline itself. The connection is the use of a domain ontology to guide extraction in a specialized setting and the treatment of evaluation as part of building that pipeline. The application shifts from maintenance work orders to humanitarian mine action, where the data and evaluation belong to a different domain.

The citation establishes a connection between the papers. The later work’s scope supports describing it as another application of ontology-guided extraction, with its own data and evaluation framework. Whether it adopted the maintenance study’s demonstration retrieval, token penalties, or exact-match filter is unspecified. Those choices were tested for normalized MaintIE records, while the shared idea is to let domain categories guide what the system is asked to extract and what the evaluation can check.

Cite

Cite as Zeno van Cauter and Nikolay Yakovets. 2024. Ontology-guided Knowledge Graph Construction from Maintenance Short Texts. Proceedings of the 1st Workshop on Knowledge Graphs and Large Language Models (KaLLM 2024).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2024.kallm-1.8

@inproceedings{cauter2024ontology,
  title = {{Ontology-guided Knowledge Graph Construction from Maintenance Short Texts}},
  author = {Zeno {van Cauter} and Nikolay Yakovets},
  booktitle = {Proceedings of the 1st Workshop on Knowledge Graphs and Large Language Models (KaLLM 2024)},
  year = {2024},
  doi = {10.18653/v1/2024.kallm-1.8},
  url = {https://doi.org/10.18653/v1/2024.kallm-1.8}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/cauter-2024-ontology-guided-knowledge-graph-construction/