Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pac
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tools
pac
Commits
42a5b7ab
Commit
42a5b7ab
authored
Jun 11, 2026
by
luoqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: 时间语义对齐 persona-design-v2 正式模型 — 注册表 timeSemantics 五值 + 标签表加列
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
parent
3c8123c1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
29 deletions
+31
-29
docs/algorithm/persona-implementation.md
+31
-29
No files found.
docs/algorithm/persona-implementation.md
View file @
42a5b7ab
...
...
@@ -21,42 +21,44 @@
## 16 个标签(全部规则路径,无 LLM)
| key | 中文 | 数据源 | data 结构要点 |
|---|---|---|---|
| rfm | 价值分群 | payment/recharge/refund/encounter | 八象限 segment;M 用
**租户级分位数**
(缓存 30min) |
| lifecycle_stage | 生命周期 | 末诊时间 + 就诊频次 | stage 7 档 + daysFromLastVisit |
| age_bracket | 年龄段 | birthDate | 9 档(婴幼儿~老年) |
| gender | 性别 | patient.gender | — |
| acquisition_channel | 获客渠道 | profile(取值随宿主) | channel/sub |
| family_structure | 家庭构成 | 亲属关系 | 单身/两口/多口/多代 |
| referral_champion | 转介绍达人 | referralCount/Amount | family / social |
| entitlement_status | 权益身份 | 结算卡券名 | labels
[
](保险/私行/储值/儿牙/医保) |
| treatment_history | 治疗史 | treatment_record.category | labels
[
](种植/正畸/修复/牙周) |
| potential_treatment | 潜在治疗 | diagnosis/recommendation gap |
**复用召回 clinical-gap 选择器,但去掉时间冷静门**
(画像=常态属性,召回才讲时机) |
| urgency_level | 急迫等级 | 潜在治疗 gaps + 末诊 | critical/high/medium/low |
| contraindication | 禁忌 | birthDate(v1 仅年龄禁忌) | labels
[
] |
| time_preference | 时间偏好 | 近 2 年预约分布 | labels
[
] + distribution |
| discount_anchor | 折扣锚点 | payment.discount_cents | 最低折扣率 + 日期 |
| special_attention | 特别关注 | 爽约率 + profile 免打扰 | labels
[
] + noShowRate |
| treatment_sensitivity | 治疗敏感 | 病历备注关键词匹配 | labels
[
](恐惧/晕针/晕血/密闭) |
| key | 中文 | 数据源 |
时间语义 |
data 结构要点 |
|---|---|---|---|
---|
| rfm | 价值分群 | payment/recharge/refund/encounter |
mixed(R=snapshot,F/M=lifetime) |
八象限 segment;M 用
**租户级分位数**
(缓存 30min) |
| lifecycle_stage | 生命周期 | 末诊时间 + 就诊频次 |
mixed(末诊 window + 近1年消费 vs 历史年均 trend) |
stage 7 档 + daysFromLastVisit |
| age_bracket | 年龄段 | birthDate |
snapshot |
9 档(婴幼儿~老年) |
| gender | 性别 | patient.gender |
snapshot |
— |
| acquisition_channel | 获客渠道 | profile(取值随宿主) |
snapshot(初诊来源,一经判定不改) |
channel/sub |
| family_structure | 家庭构成 | 亲属关系 |
snapshot |
单身/两口/多口/多代 |
| referral_champion | 转介绍达人 | referralCount/Amount |
snapshot |
family / social |
| entitlement_status | 权益身份 | 结算卡券名 | l
ifetime | l
abels
[
](保险/私行/储值/儿牙/医保) |
| treatment_history | 治疗史 | treatment_record.category | l
ifetime | l
abels
[
](种植/正畸/修复/牙周) |
| potential_treatment | 潜在治疗 | diagnosis/recommendation gap |
snapshot(常态 gap,随新诊断/治疗重算) |
**复用召回 clinical-gap 选择器,但去掉时间冷静门**
(画像=常态属性,召回才讲时机) |
| urgency_level | 急迫等级 | 潜在治疗 gaps + 末诊 |
snapshot |
critical/high/medium/low |
| contraindication | 禁忌 | birthDate(v1 仅年龄禁忌) |
snapshot(validUntil=到龄自动解除) |
labels
[
] |
| time_preference | 时间偏好 | 近 2 年预约分布 |
window(2y) |
labels
[
] + distribution |
| discount_anchor | 折扣锚点 | payment.discount_cents |
lifetime |
最低折扣率 + 日期 |
| special_attention | 特别关注 | 爽约率 + profile 免打扰 |
window(1y)+ 当前标注 |
labels
[
] + noShowRate |
| treatment_sensitivity | 治疗敏感 | 病历备注关键词匹配 | l
ifetime | l
abels
[
](恐惧/晕针/晕血/密闭) |
每个 feature 落库:
`key + description(自包含中文)+ data(结构化 JSON)+ evidence{factIds}`
。
`score`
列预留,目前全空。
## 时间语义
## 时间语义
模型
**总基准**
:所有标签以
**重算时刻**
为"现在"评估(非事件发生时点);历史某天的画像靠版本流还原(查当天未被 supersede 的版本)。
画像 = 对全历史的
**压缩当前态**
;每标签在注册表(
`persona-feature-specs.ts`
)声明
`timeSemantics`
,逐标签取值见上表:
四类时间口径:
| 口径 | 含义 | 标签 |
| 取值 | 含义 | 例 |
|---|---|---|
|
**静态/当前快照**
| 与时间无关,或按"现在"取当前态 | 性别 · 获客渠道(首次,不变)· 年龄段(birthDate→今)· 家庭构成(当前关系边)· 禁忌(当前年龄,
`validUntil`
=到龄自动解除日) |
|
**全史累计**
| lifetime 不设窗 | RFM 的 F(累计就诊)/M(累计净消费)· 转介绍达人 · 权益身份 · 治疗史 · 折扣锚点(全史最低折扣+发生日)· 治疗敏感(全史病历备注) |
|
**滚动窗口**
| 只看近 N 天,随时间自动进出 | 时间偏好
**近 2 年**
(730d,用 planned_for)· 特别关注
**近 1 年**
(爽约/迟到率)· 生命周期的"近 1 年消费 vs 历史年均"(成长/成熟分界) |
|
**距今天数切档**
| 末诊距今多少天落档 | RFM 的 R(≤540=5 / ≤730=4 / ≤1095=3 / ≤1460=2 / >1460=1)· 生命周期(首诊≤180 新客;末诊 180–540 待激活;>540 沉睡;>730 流失)· RFM 风险分(无临床 ≥180d 起算) |
特例:
**潜在治疗/急迫等级**
是"当前未闭合 gap"语义——诊断后未启动治疗就一直在(
`daysSince`
记录悬置天数,只增不减),直到治疗事实进来才消失;
**不设上界**
(缺牙 3 年仍是潜在种植),与召回侧的冷静期/黄金窗口径不同(见上表"画像≠召回")。
|
`snapshot`
| 当前态,随事实变化重算;历史读版本流 | 年龄段 / 潜在治疗(常态 gap)/ 禁忌(validUntil 到龄解除) |
|
`window`
| 近 N 期滚动窗 | 时间偏好 2y / 特别关注 1y |
|
`lifetime`
| 全史累计,不设窗 | 治疗史 / 权益 / 折扣锚点 / 治疗敏感 |
|
`trend`
| 趋势对比(当前只作 mixed 的成分) | 生命周期"近1年消费 vs 历史年均" |
|
`mixed`
| 复合 | RFM(R=snapshot,F/M=lifetime)/ 生命周期 |
补充:
-
**评估基准**
= 重算时刻;历史某天的画像查当天未被 supersede 的版本(版本流)。
-
**TZ**
:PAC 全 UTC 存储(DW 北京时间摄入时转换);算"星期/时段"等本地概念时 +8(试点硬编北京,多宿主应读 host TZ — follow-up)。
-
关键切档值:R 档 540/730/1095/1460 天;生命周期 首诊≤180 新客、末诊 180–540 待激活、>540 沉睡、>730 流失。
## 刷新策略(三条触发路径)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment