feat(recall): add diffusion stage and improve retrieval metrics
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
// 硬约束:name1 永不进入词典
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
|
||||
import { getStateAtoms } from '../storage/state-store.js';
|
||||
|
||||
/**
|
||||
* 标准化字符串(用于实体匹配)
|
||||
* @param {string} s
|
||||
@@ -69,6 +71,14 @@ export function buildEntityLexicon(store, context) {
|
||||
add(f.s);
|
||||
}
|
||||
|
||||
// 5. L0 atoms 的 who(新角色在 L2 总结前即可进入词典)
|
||||
const atoms = getStateAtoms();
|
||||
for (const atom of atoms) {
|
||||
for (const name of (atom.who || [])) {
|
||||
add(name);
|
||||
}
|
||||
}
|
||||
|
||||
// ★ 硬约束:删除 name1
|
||||
if (context?.name1) {
|
||||
lexicon.delete(normalize(context.name1));
|
||||
@@ -112,6 +122,14 @@ export function buildDisplayNameMap(store, context) {
|
||||
if (!f.retracted) register(f.s);
|
||||
}
|
||||
|
||||
// 5. L0 atoms 的 who
|
||||
const atoms = getStateAtoms();
|
||||
for (const atom of atoms) {
|
||||
for (const name of (atom.who || [])) {
|
||||
register(name);
|
||||
}
|
||||
}
|
||||
|
||||
// ★ 硬约束:删除 name1
|
||||
if (context?.name1) {
|
||||
map.delete(normalize(context.name1));
|
||||
|
||||
Reference in New Issue
Block a user