新功能:个性化推荐算法

This commit is contained in:
吕新雨
2026-02-02 16:47:37 +08:00
parent 936094211b
commit 6dc4e2b943
119 changed files with 7427 additions and 357 deletions

View File

@@ -20,6 +20,7 @@
- `scene`: `feed | push | widget`
- `user_profile`: 客户端问卷画像V1.2;字段允许缺失)
- `locale`:客户端语言(由请求携带并透传至推荐模块;**当前仅支持 EN/TC**,例如 `en` / `en-US` / `tc` / `zh-TW` / `zh-HK`
- `fallback_level`: `0|1|2|3`
- `limit`: 候选条数上限(由引擎配置)
- (可选)排除集合:`exclude_content_ids`(用于 DB 层先排一部分,减少传输;类型为 `List[int]`,与 MySQL 自增 `content_id` 对齐)
@@ -29,7 +30,9 @@
- `List[ContentProfile]`(稳定字段契约):
- `content_id``int`MySQL 自增主键)
- `text`文案文本
- `text``locale` 输出的文案文本(**不允许语言回退**
- `locale=en*`:必须从 `contents.text_en` 产出;若该 content 无 `text_en`,则该 content 不可返回(在候选/按 ID 获取时过滤)
- `locale=tc/zh-TW/zh-HK`:必须从 `contents.text_tc` 产出;若无 `text_tc`,则该 content 不可返回
- `stage``general | expecting | parenting | unknown`
- `emotion_score``float | None`(约定:`None` 表示 general
- `context_suitability``Dict[str, float]`(见 4.1 的 key 集合;值为 `0/0.5/1`