Warning: session_start(): open(/var/lib/php/sessions/sess_ndpk2vvs9m82i2mak5lc5rst7j, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static L gazelle_getChildren(GazelleTree tree) {
if (tree == null) null;
if (tree.children != null) ret tree.children;
// make rule engine etc.
if (tree.ctx == null) {
new GazelleEvalContext ctx;
tree.ctx = ctx;
ctx.engine = new RuleEngine2;
ctx.engine.addRules2(dm_allRulesFromRulesModuleWithCommentsAndIDs());
// gather data for predictor
MultiMap statementsByRule = ai_gazelle_indexStatementsByRule(dm_gazelle_statementsFromAppliedRules());
ctx.dataByRule = mapValues ai_gazelle_analyzeStatementsForRule(multiMapToMap(statementsByRule));
}
GazelleEvalContext ctx = tree.ctx;
new L children;
SS inputMap = litmap(standard := tree.line);
LS history = concatLists(tlft(dialogHistory), tree.history());
for (int i = 0; i < l(history); i++)
inputMap.put("dialog-" + (l(history)-i), history.get(i));
L l = sortByMethodDesc qualitySum(ai_ruleEngine2_rulesForInput_5_allConditions(tree.ctx.engine, inputMap, debug := false));
print("Got rules: " + l(l));
for (RuleEngine2_MatchedRule r : l) {
if (r.relativeQuality() < qualityCutOff) continue;
S line = r.applyMappingTo(r.rule.out);
GazelleTree child = new(line);
child.parent = tree;
child.ctx = tree.ctx;
child.mr = r;
ai_gazelle_analyzeStatementsForRule_Data data = ctx.dataByRule.get(r.rule.globalID);
child.prediction = data == null ? null : ai_gazelle_predictor1_onData(r, data);
children.add(child);
}
sortByCalculatedFieldDesc(children, func(GazelleTree c) -> int { ai_goodBadToInt(c.prediction) });
ret tree.children = children;
}