refine answer meaning derivation for negation and qualification
This commit is contained in:
+56
-12
@@ -2745,6 +2745,46 @@ function proposalResolutionSummary(proposal) {
|
||||
return { resolved, proposalText };
|
||||
}
|
||||
|
||||
function mentionsHardConstraint(text) {
|
||||
return (
|
||||
text.includes("hard constraint") ||
|
||||
text.includes("non-negotiable") ||
|
||||
text.includes("dont want any increase in risk") ||
|
||||
text.includes("do not want any increase in risk")
|
||||
);
|
||||
}
|
||||
|
||||
function mentionsNegatedHardConstraint(text) {
|
||||
return (
|
||||
text.includes("rather than a hard constraint") ||
|
||||
text.includes("not a hard constraint") ||
|
||||
text.includes("not an absolute constraint") ||
|
||||
text.includes("preference rather than a hard constraint")
|
||||
);
|
||||
}
|
||||
|
||||
function hasDefaultPreferenceSignal(text) {
|
||||
return (
|
||||
text.includes("preference") ||
|
||||
text.includes("normally") ||
|
||||
text.includes("default preference") ||
|
||||
text.includes("would usually") ||
|
||||
text.includes("tend to")
|
||||
);
|
||||
}
|
||||
|
||||
function hasExceptionOrOverrideSignal(text) {
|
||||
return (
|
||||
text.includes(" but ") ||
|
||||
text.includes(" if ") ||
|
||||
text.includes("override") ||
|
||||
text.includes("overridden") ||
|
||||
text.includes("willing to accept") ||
|
||||
text.includes("willingness to accept") ||
|
||||
text.includes("accept some risk")
|
||||
);
|
||||
}
|
||||
|
||||
function deriveAnswerMeaningProfile(userSupportedMeaning) {
|
||||
const meaningText = normaliseSemanticText(userSupportedMeaning);
|
||||
|
||||
@@ -2761,25 +2801,29 @@ function deriveAnswerMeaningProfile(userSupportedMeaning) {
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
meaningText.includes("hard constraint") ||
|
||||
meaningText.includes("non-negotiable") ||
|
||||
meaningText.includes("dont want any increase in risk") ||
|
||||
meaningText.includes("do not want any increase in risk")
|
||||
) {
|
||||
return {
|
||||
category: "explicit_hard_constraint",
|
||||
resolutionGuidance: "must_resolve",
|
||||
};
|
||||
}
|
||||
const negatedHardConstraint = mentionsNegatedHardConstraint(meaningText);
|
||||
const affirmativeHardConstraint =
|
||||
mentionsHardConstraint(meaningText) && !negatedHardConstraint;
|
||||
const conditionalPreferenceStructure =
|
||||
(hasDefaultPreferenceSignal(meaningText) &&
|
||||
hasExceptionOrOverrideSignal(meaningText)) ||
|
||||
(negatedHardConstraint && hasExceptionOrOverrideSignal(meaningText)) ||
|
||||
hasConditionalQualification(meaningText);
|
||||
|
||||
if (hasConditionalQualification(meaningText)) {
|
||||
if (conditionalPreferenceStructure) {
|
||||
return {
|
||||
category: "conditional_tradeoff",
|
||||
resolutionGuidance: "may_resolve",
|
||||
};
|
||||
}
|
||||
|
||||
if (affirmativeHardConstraint) {
|
||||
return {
|
||||
category: "explicit_hard_constraint",
|
||||
resolutionGuidance: "must_resolve",
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
meaningText.includes("matters more") ||
|
||||
meaningText.includes("more important") ||
|
||||
|
||||
Reference in New Issue
Block a user