feat: back next questions with explicit graph unknowns
This commit is contained in:
@@ -498,6 +498,16 @@ function buildBroadInvestigationQuestion(graph) {
|
||||
return `What changed during that period that could help explain why ${central}?`;
|
||||
}
|
||||
|
||||
function isRelationshipExplanationUnknown(node, graph) {
|
||||
const text = normaliseText(`${node?.label || ""} ${node?.description || ""}`);
|
||||
return (
|
||||
collectObservationNodes(graph).length >= 2 &&
|
||||
/\b(explain|explanation|divergence|moved differently|difference between|change or event|what changed|why the observations)/.test(
|
||||
text,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export function formulateTieResolutionQuestion({ graph }) {
|
||||
const comparability = assessComparability(graph);
|
||||
if (comparability.comparabilityStatus === "uncertain") {
|
||||
@@ -909,7 +919,9 @@ export function formulateQuestion({ node, graph, context = {} }) {
|
||||
|
||||
let question = investigationStrategy
|
||||
? buildQuestionFromStrategy(investigationStrategy)
|
||||
: buildNeutralClarificationQuestion(extractMeaning(node));
|
||||
: isRelationshipExplanationUnknown(node, graph)
|
||||
? buildBroadInvestigationQuestion(graph)
|
||||
: buildNeutralClarificationQuestion(extractMeaning(node));
|
||||
|
||||
question = sanitizeQuestionText(question);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user