thread-master/docs/product/scout-topic-quality/tasks/T040-topic-signature.md

57 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# T040 — 話題簽章與必要概念群
> Status: `done`
> Milestone: `M4`
> Est. change: `~180 lines`
## Goal
完成後,所有候選都以原始 intent 的必要實體與概念群判定,泛用搜尋錨點不能單獨使結果入選。
## Depends on
- T001、T034
## Inputs
- 讀取 / 依賴:
- 檔案:`apps/backend/internal/module/scout/usecase/activity_terms.go`、`service.go`
- 既有能力 / APInormalizeSignal、searchAnchors、selected scan terms
- Spec 段落§4 流程 C、§9 #3/#4
## Outputs
### 程式變更(預期路徑)
| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/backend/internal/module/scout/usecase/topic_signature.go` | add | 從 intentterms 建立必要實體、概念群、alias 與 match 結果。 |
| `apps/backend/internal/module/scout/usecase/topic_signature_test.go` | add | 覆蓋作品名、多詞意圖、錨點、CJK 與英文大小寫。 |
### 行為變更
- 候選需命中每個必要概念群;「推薦/分享/工程師」等泛詞不能取代明確主題。
### API / 契約(若有)
- Match 結果提供命中核心,供 match_reason 使用;不暴露內部 tokenization。
## Out of scope
- 不做 embedding、個人化或 provider ranking。
## Acceptance
- [x] 外包後端與鬼滅案例阻擋同字不同題內容。
- [x] 指令:
```bash
cd apps/backend && go test ./internal/module/scout/usecase -run TopicSignature -count=1
```
驗收結果:新增 TopicSignatureTopicConcept 必要概念群、核/別名匹配與 anchor 排除多概念、作品名、拆詞、CJK 與英文大小寫案例通過。
## Notes
優先重用目前 normalize 與 intent-aware terms不建立平行規則。