fix:更新算法
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
>
|
||||
> **共用基礎**:
|
||||
>
|
||||
> * 用戶畫像:U(mom_stage one-hot、emotion_score、context one-hot、need one-hot)
|
||||
> * 用戶畫像:U(mom_stage one-hot;emotion/context/need 允许缺失/跳过;含 `profile_confidence/profile_answered`)
|
||||
> * 文案畫像:Cᵢ(stage、emotion_score、context/need suitability、personalization_power、risk_flags;建議含 content_id/author_id/template_id/review_confidence)
|
||||
> * 推薦骨架:Hard Filter → Soft Scoring → Rerank(多樣性/新鮮度/疲勞)
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
1. **Candidate Generation(候選集生成)**
|
||||
|
||||
* 依 U 取一個「候選池」:匹配 need/context/stage 的內容 + 一部分通用內容
|
||||
* V1.2:若問卷允許跳過導致 `U.need/U.context/U.emotion_score` 缺失,候選池需自動提高通用安全內容占比,并视为至少进入 L1(限制 `personalization_power≤0.5`)
|
||||
2. **Hard Filter(硬性過濾)**
|
||||
|
||||
* 依 risk_flags 與產品規則剔除高風險內容
|
||||
@@ -93,10 +94,37 @@ S_{core} + S_{personal} + S_{fresh} - P_{fatigue} - P_{repeat} - P_{risk} - P_{u
|
||||
S_{core} = w_{need}S_{need} + w_{emotion}S_{emotion} + w_{stage}S_{stage} + w_{context}S_{context}
|
||||
]
|
||||
|
||||
* `S_need = Cᵢ.need_suitability[U.need]`
|
||||
* `S_context = Cᵢ.context_suitability[U.context]`
|
||||
* `S_need = Cᵢ.need_suitability[U.need]`(若 U.need 缺失,见 V1.2)
|
||||
* `S_context = Cᵢ.context_suitability[U.context]`(若 U.context 缺失,见 V1.2)
|
||||
* `S_stage`:general=1;命中=1;unknown對非unknown=0.7;其餘=0
|
||||
* `S_emotion`:若文案 general→0.8;否則 `1-|U.emotion_score-Cᵢ.emotion_score|`
|
||||
* `S_emotion`:若文案 general→0.8;否則 `1-|U.emotion_score-Cᵢ.emotion_score|`(若 U.emotion_score 缺失,见 V1.2)
|
||||
|
||||
### V1.2:当问卷允许跳过题目时的打分约定(工程必读)
|
||||
|
||||
> 目标:用户画像字段不全时仍能产出排序;并在不确定时自动降个性化/降风险。
|
||||
|
||||
判定缺失:
|
||||
|
||||
* `U.need` 为空对象 `{}` 或不存在 → 视为缺失
|
||||
* `U.context` 为空对象 `{}` 或不存在 → 视为缺失
|
||||
* `U.emotion_score` 为 `null`/不存在 → 视为缺失
|
||||
|
||||
缺失时的保守计算:
|
||||
|
||||
* `S_need`:
|
||||
* 若 `U.need` 缺失 → `S_need = 0.5`
|
||||
* 否则 → `S_need = Cᵢ.need_suitability[U.need]`
|
||||
* `S_context`:
|
||||
* 若 `U.context` 缺失 → `S_context = 0.5`
|
||||
* 否则 → `S_context = Cᵢ.context_suitability[U.context]`
|
||||
* `S_emotion`:
|
||||
* 若 `U.emotion_score` 缺失 → `S_emotion = 0.8`
|
||||
* 否则按原定义计算(文案 general 仍为 0.8)
|
||||
|
||||
额外约束(与回退梯度一致,6A):
|
||||
|
||||
* 若 `conf_U` 偏低或字段缺失明显:必须启用 `P_uncertainty`
|
||||
* 若进入回退梯度(`fallback_level_final>0`):按 L1/L2/L3 限制 `personalization_power` 上限(见 3.1)
|
||||
|
||||
個性化加成:
|
||||
[
|
||||
@@ -125,7 +153,7 @@ P_{uncertainty} = \beta \cdot (1-\text{conf}_U) \cdot (1-\text{conf}_{Cᵢ}) \cd
|
||||
* `U.stage.unknown=1` → 禁推 `unsafe_for_stage_unknown`
|
||||
* `U.stage.parenting=1` → 禁推 `unsafe_for_stage_parenting`
|
||||
* `U.emotion_score≤0.2` → 禁推 `unsafe_for_emotion_low`
|
||||
* `U.context.health=1` → 禁推 `block_health_medical`(僅擋「醫療/診斷/嚴重暗示」)
|
||||
* `Cᵢ.risk_flags` 含 `block_health_medical` → **全场景禁推(Hard Filter)**(仅挡「医疗/诊断/严重暗示」)
|
||||
|
||||
> `soft_health_sensitive` 不做 Hard Filter,改由 Soft Penalty(見 Push 的 P_risk)
|
||||
|
||||
@@ -218,6 +246,11 @@ P_{uncertainty} = \beta \cdot (1-\text{conf}_U) \cdot (1-\text{conf}_{Cᵢ}) \cd
|
||||
>
|
||||
> * `personalization_power` 上限降為 `≤0.5`(L1)或 `0`(L2/L3)
|
||||
> * 若候選不足,優先回退到「通用安全句庫」,而不是擴大高個性化內容
|
||||
>
|
||||
> V1.2(支持问卷跳过)补充:
|
||||
>
|
||||
> * 若 `profile_answered.need=false` 或 `U.need` 缺失:不得按“need 强命中”召回,候选池应提高通用安全句占比,并至少按 L1 降个性化
|
||||
> * 若 `profile_answered.emotion=false` 或 `U.emotion_score` 缺失:Push 应偏向 `Cᵢ.emotion_score` 为 `general` 或 0.4–0.8 的稳定内容,并启用 `P_uncertainty`
|
||||
|
||||
## 5.3 Push 打分權重(建議)
|
||||
|
||||
@@ -313,7 +346,7 @@ V1.1 補充(工程預設):
|
||||
|
||||
* Feed:MMR `λ=0.7`
|
||||
* Push:啟用 `P_uncertainty`(或併入 `P_risk`);`fallback_level>=1` 時 `personalization_power` 上限降為 `≤0.5`
|
||||
* Health:Hard Filter 僅擋 `block_health_medical`;`soft_health_sensitive` 走 Soft Penalty
|
||||
* Health:`block_health_medical` 全场景 Hard Filter;`soft_health_sensitive` 走 Soft Penalty
|
||||
|
||||
> 一句話:
|
||||
> **同一套 U×Cᵢ 打分,按場景調候選池、權重與重排約束。**
|
||||
|
||||
@@ -214,7 +214,7 @@ C_i.review_confidence // 0–1;AI/人工對標註結果的置信度(缺
|
||||
* `block_health_medical`(Hard Block)
|
||||
|
||||
* 具「醫療/診斷/嚴重暗示」:疾病確診、用藥、治療方案、醫囑、手術、急重症、危險警示等
|
||||
* 這類內容在 **Health 情境** 下特別容易翻車,建議 Hard Filter
|
||||
* 这类内容属于高风险:**建议全场景(Feed/Push/Widget)Hard Filter**,不依赖用户是否选择 `context: health`
|
||||
|
||||
* `soft_health_sensitive`(Soft Penalty)
|
||||
|
||||
@@ -234,6 +234,10 @@ C_i.review_confidence // 0–1;AI/人工對標註結果的置信度(缺
|
||||
|
||||
> AI Reviewer 若不確定,寧可標記 flag
|
||||
|
||||
### 置信度缺省值(工程约定,V1.2)
|
||||
|
||||
* 若数据源未提供 `C_i.review_confidence`:推荐系统侧默认按 `0.7` 处理(用于 `P_uncertainty`),并建议后续补齐可观测与标注流程
|
||||
|
||||
---
|
||||
|
||||
## 九、AI Reviewer 打分流程(強烈建議)
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
* `profile_source`:`questionnaire`(後續可擴展 `behavior` / `mixed`)
|
||||
* `profile_generated_at`:ISO8601 時間戳
|
||||
* `profile_confidence`(= `conf_U`):`0–1`
|
||||
* `profile_answered`:各題是否作答(用于区分“跳过” vs “明确选择”)
|
||||
* `stage/emotion/context/need`:`true/false`
|
||||
|
||||
`profile_confidence` 建議規則(V1.1 默認,可調參):
|
||||
|
||||
@@ -42,6 +44,36 @@
|
||||
* 7–30 天:線性衰減到 `0.7`
|
||||
* 30 天以上:`conf_U = 0.5`(除非用戶重新做問卷或有行為信號更新)
|
||||
|
||||
#### V1.2:支持“可跳过题目”的画像输出与置信度(工程必读)
|
||||
|
||||
> 前提:问卷允许用户跳过任意题目(包括 mom_stage / emotion / context / need)。
|
||||
> 目标:保证任何情况下都能生成“可计算的 U”,并在不确定时自动降个性化/降风险。
|
||||
|
||||
**V1.2 输出原则:**
|
||||
|
||||
* **mom_stage 跳过**:按安全策略处理为 `unknown`(即 `U.stage.unknown=1`),同时 `profile_answered.stage=false`
|
||||
* **emotion 跳过**:`U.emotion_score` 置为缺省(建议直接不输出该字段或输出 `null`),同时 `profile_answered.emotion=false`
|
||||
* **context 跳过**:`U.context` 输出为空对象 `{}`,同时 `profile_answered.context=false`
|
||||
* **need 跳过**:`U.need` 输出为空对象 `{}`,同时 `profile_answered.need=false`
|
||||
|
||||
> 说明:
|
||||
>
|
||||
> * 之所以“mom_stage 跳过也当作 unknown”,是为了在 Push 等高风险场景优先保证不冒犯(unknown 语义:不希望被母职身份定义)。
|
||||
> * emotion/context/need 跳过不强行填默认值,避免制造“伪精确画像”;改由推荐算法在打分时走“通用值 + 不确定性惩罚”(见「个性化推荐算法规则」V1.2 补充)。
|
||||
|
||||
**V1.2 `conf_U` 计算(在 V1.1 时间衰减基础上叠加“作答完整度”):**
|
||||
|
||||
定义:
|
||||
|
||||
* `conf_time`:按 V1.1 时间衰减得到(0–1)
|
||||
* `answered_count = Σ I[profile_answered.* = true]`,总题数 `total_questions = 4`
|
||||
* `completion = answered_count / total_questions`
|
||||
* `completion_factor = 0.5 + 0.5 * completion`(答得越少越不确定,但仍保留基础信息)
|
||||
|
||||
则:
|
||||
|
||||
* `conf_U = clamp(conf_time * completion_factor, 0.2, 1.0)`
|
||||
|
||||
> Push 推送時若 `conf_U` 偏低,推薦系統需啟用 `P_uncertainty` 並限制 `personalization_power` 上限(見「個性化推薦算法規則」V1.1)。
|
||||
|
||||
---
|
||||
@@ -70,6 +102,7 @@
|
||||
>
|
||||
> * `mom_stage` 是「身份 / 階段」,不是強度,不做連續軸線
|
||||
> * `unknown` 的語義是:**不希望被母職身份定義**(不是「沒有孩子」)
|
||||
> * 若该题被跳过:按安全策略输出 `unknown`,同时 `profile_answered.stage=false`
|
||||
|
||||
### 推送原則(高層)
|
||||
|
||||
@@ -96,7 +129,7 @@
|
||||
| Calm | emotion: calm | 0.8 |
|
||||
| Joyful | emotion: joyful | 1.0 |
|
||||
|
||||
生成:`U.emotion_score ∈ [0,1]`
|
||||
生成:`U.emotion_score ∈ [0,1]`;若该题跳过则输出 `null`(或不输出该字段),并通过 `profile_answered.emotion=false` 表示“未作答”
|
||||
|
||||
### 語義說明
|
||||
|
||||
@@ -126,6 +159,8 @@
|
||||
| ----------------------------------------------------- | ----- |
|
||||
| U.ctx.family / work / relationship / friends / health | 1 或 0 |
|
||||
|
||||
> 若该题被跳过:`U.context` 输出为空对象 `{}`,同时 `profile_answered.context=false`
|
||||
|
||||
### 語義說明
|
||||
|
||||
* context **不是情緒**,而是情緒的「觸發場景」
|
||||
@@ -153,6 +188,8 @@
|
||||
| ------------------------------------------------------------------------------------------ | ----- |
|
||||
| U.need.emotional_support / parenting_pressure / self_worth / anxiety_relief / rest_balance | 1 或 0 |
|
||||
|
||||
> 若该题被跳过:`U.need` 输出为空对象 `{}`,同时 `profile_answered.need=false`
|
||||
|
||||
### 語義說明
|
||||
|
||||
* `need` 是 **推薦權重最高的維度**
|
||||
@@ -164,11 +201,12 @@
|
||||
|
||||
以下規則在推薦時 **優先於任何分數計算**:
|
||||
|
||||
### 核心禁推規則(V1)
|
||||
### 核心禁推規則(V1.2)
|
||||
|
||||
1. **mom_stage = unknown**
|
||||
|
||||
* ❌ 禁推:`need: parenting_pressure`(強指向)
|
||||
* ❌ 禁推:**高个性化**育儿压力内容(避免“把她当妈妈/正在育儿”对话)
|
||||
* 判定条件(与推荐算法一致,V1.2):`Cᵢ.need_suitability[parenting_pressure]=1` 且 `Cᵢ.personalization_power=1`
|
||||
|
||||
2. **mom_stage = parenting**
|
||||
|
||||
@@ -192,6 +230,12 @@
|
||||
"profile_source": "questionnaire",
|
||||
"profile_generated_at": "2026-01-30T00:00:00Z",
|
||||
"profile_confidence": 1.0,
|
||||
"profile_answered": {
|
||||
"stage": true,
|
||||
"emotion": true,
|
||||
"context": true,
|
||||
"need": true
|
||||
},
|
||||
"stage": {
|
||||
"expecting": 0,
|
||||
"parenting": 1,
|
||||
@@ -207,6 +251,31 @@
|
||||
}
|
||||
```
|
||||
|
||||
### 跳过题目时的输出示例(V1.2)
|
||||
|
||||
> 示例:用户跳过 emotion / context / need;mom_stage 也跳过。
|
||||
|
||||
```json
|
||||
{
|
||||
"profile_version": "v1.2",
|
||||
"profile_source": "questionnaire",
|
||||
"profile_generated_at": "2026-01-30T00:00:00Z",
|
||||
"profile_confidence": 0.5,
|
||||
"profile_answered": {
|
||||
"stage": false,
|
||||
"emotion": false,
|
||||
"context": false,
|
||||
"need": false
|
||||
},
|
||||
"stage": {
|
||||
"unknown": 1
|
||||
},
|
||||
"emotion_score": null,
|
||||
"context": {},
|
||||
"need": {}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 八、設計總結(給產品/工程/AI Reviewer)
|
||||
|
||||
Reference in New Issue
Block a user