Skip to content

Rule verbalization

Verena Blaschke edited this page Aug 17, 2022 · 4 revisions

This PDF contains pseudocode for the default verbalization of PSL rules. It essentially summarizes TalkingRuleOrConstraint.getUnequativeExplanation (and the methods that are called in this method), which is in turn called by TalkingLogicalRuleOrConstraint.getDefaultExplanation and TalkingArithmeticRuleOrConstraint.getDefaultExplanation.

The comments on edge cases where the score of the context atom cannot be pushed further in the direction of the pressure (larger than 100 % / lower than 0 %) are added by code in the psl-ragviewer package in FactWindow.setFacts. (This is done separately from the main verbalization methods since a context atom might be influenced by multiple ground rules, in which case it would be redundant to repeat this comment for every single rule.)

While these default explanations provide a good starting point for debugging a PSL program, we highly recommend extending the TalkingPredicate and Talking[Logical/Arithmetic][Rule/Constraint] classes. The examples.livesknows subpackage provides some simple sample classes and also comes with additional documentation.

Clone this wiki locally