feat(admin-brand): add question expansion service and related functionality
- Implemented QuestionExpansionService for generating and materializing questions based on combinations and AI distillation. - Added question metadata classification logic to infer intent and layer of questions. - Created API handlers for question expansion operations including combination preview, AI distillation, metadata classification, and materialization. - Introduced database migrations to support new question-related fields and constraints in brand_questions and brand_keywords tables. - Added caching mechanism for AI distillation results to improve performance. - Defined JSON schemas for question distillation responses to ensure data integrity.
This commit is contained in:
@@ -204,6 +204,10 @@ const zhCN = {
|
||||
title: "品牌词库",
|
||||
description: "围绕品牌维护关键词、问题集和竞品信息。",
|
||||
},
|
||||
brandQuestionCreate: {
|
||||
title: "新建问题",
|
||||
description: "用拓词工具、AI 扩展或手动录入创建品牌问题集。",
|
||||
},
|
||||
tracking: {
|
||||
title: "数据详情",
|
||||
description: "围绕插件采样快照查看品牌表现、平台矩阵、高频问题和引用归因。",
|
||||
@@ -1163,15 +1167,20 @@ const zhCN = {
|
||||
},
|
||||
},
|
||||
brands: {
|
||||
title: "品牌词库",
|
||||
description: "通过品牌名称和品牌相关信息维护关键词、问题集和竞品资产。",
|
||||
eyebrow: "Brand Management",
|
||||
title: "品牌管理",
|
||||
description: "通过品牌名称和品牌相关信息维护问题集和竞品资产。",
|
||||
railTitle: "品牌库",
|
||||
selectBrand: "选择品牌后即可继续维护关键词和问题集。",
|
||||
selectBrand: "选择品牌后即可继续维护问题集。",
|
||||
newBrand: "新建品牌",
|
||||
editBrand: "编辑品牌",
|
||||
deleteBrand: "删除品牌",
|
||||
guide: {
|
||||
title: "品牌管理说明",
|
||||
body: "管理品牌、问题集和竞品库,用于后续 AI 平台监测与 GEO 分析。",
|
||||
},
|
||||
tabs: {
|
||||
keywords: "关键词",
|
||||
questions: "问题集",
|
||||
competitors: "竞品库",
|
||||
},
|
||||
quota: {
|
||||
@@ -1181,12 +1190,13 @@ const zhCN = {
|
||||
brandsHint: "免费版默认 1 个,付费版默认 2 个。",
|
||||
keywords: "关键词总量",
|
||||
keywordsHint: "当前用户可绑定的关键词总数。",
|
||||
questions: "每个关键词问题数",
|
||||
questionsHint: "单个关键词下最多可维护的问题数。",
|
||||
questions: "账号问题额度",
|
||||
questionsHint: "所有品牌共用当前账号的问题额度。",
|
||||
},
|
||||
meta: {
|
||||
keywordCount: "{count} 个关键词",
|
||||
questionCount: "{count} 个问题",
|
||||
competitorCount: "{count} 个竞品",
|
||||
brandKeywordCount: "当前品牌已绑定 {count} 个关键词",
|
||||
globalKeywordUsage: "总关键词已用 {used} / {total}",
|
||||
keywordQuestionUsage: "问题 {used} / {total}",
|
||||
@@ -1198,6 +1208,7 @@ const zhCN = {
|
||||
versions: "版本记录",
|
||||
},
|
||||
actions: {
|
||||
addBrand: "添加品牌",
|
||||
newKeyword: "新建关键词",
|
||||
newQuestion: "新建问题",
|
||||
newCompetitor: "新建竞品",
|
||||
@@ -1205,8 +1216,10 @@ const zhCN = {
|
||||
},
|
||||
empty: {
|
||||
brands: "还没有品牌数据,先创建一个品牌。",
|
||||
questions: "当前关键词下暂无问题集。",
|
||||
questions: "当前品牌下暂无问题。",
|
||||
competitors: "当前品牌下暂无竞品数据。",
|
||||
brandDescription: "暂无品牌描述",
|
||||
competitorDescription: "暂无竞品描述",
|
||||
},
|
||||
form: {
|
||||
brandName: "品牌名称",
|
||||
@@ -1237,7 +1250,85 @@ const zhCN = {
|
||||
chooseKeyword: "请先选择关键词",
|
||||
brandLimitReached: "当前套餐最多可绑定 {limit} 个品牌公司",
|
||||
keywordLimitReached: "当前账号最多可绑定 {limit} 个关键词",
|
||||
questionLimitReached: "当前关键词下最多可维护 {limit} 个问题",
|
||||
questionLimitReached: "当前账号最多可维护 {limit} 个问题",
|
||||
},
|
||||
questions: {
|
||||
create: "新建问题",
|
||||
createSingle: "新增单条问题",
|
||||
expand: "批量扩展问题",
|
||||
usage: "问题 {used} / {total}",
|
||||
remaining: "还可保存 {count} 条",
|
||||
generate: "生成候选",
|
||||
emptyCandidates: "还没有候选,先从上方生成或粘贴问题。",
|
||||
table: {
|
||||
question: "问题集",
|
||||
},
|
||||
modal: {
|
||||
title: "新建问题",
|
||||
currentBrand: "当前品牌",
|
||||
methods: {
|
||||
single: "单条新增",
|
||||
combination: "拓词工具",
|
||||
aiDistill: "AI 扩展",
|
||||
manualBatch: "手动批量",
|
||||
},
|
||||
preview: "候选预览",
|
||||
summary: "共 {total} 条候选 · 已选择 {selected} 条 · 过短 {tooShort} 条 · 重复 {duplicate} 条",
|
||||
save: "保存问题 ({count})",
|
||||
},
|
||||
combination: {
|
||||
region: "1.地域词",
|
||||
prefix: "2.前缀词",
|
||||
core: "3.核心词(必填)",
|
||||
industry: "4.行业词(必填)",
|
||||
suffix: "5.后缀词",
|
||||
defaultWord: "默认词",
|
||||
estimate: "预计生成 {count} 条候选",
|
||||
coreRequired: "核心不能为空",
|
||||
industryRequired: "行业不能为空",
|
||||
},
|
||||
ai: {
|
||||
note: "AI 扩展会消耗 1 个 AI 点;生成失败时系统会自动退还。",
|
||||
seedTopic: "扩展主题",
|
||||
generate: "AI 生成候选",
|
||||
},
|
||||
batch: {
|
||||
label: "每行一个问题",
|
||||
},
|
||||
badges: {
|
||||
duplicate: "重复",
|
||||
tooShort: "过短",
|
||||
},
|
||||
messages: {
|
||||
partialSaved: "已保存 {created} 条,跳过 {skipped} 条",
|
||||
limitReached: "当前账号最多可维护 {limit} 个问题,所有品牌共用该额度",
|
||||
truncated: "候选超过上限,已截断为 500 条。",
|
||||
cacheHit: "已使用最近一次 AI 扩展结果。",
|
||||
aiCharged: "本次 AI 扩展已消耗 {count} 个 AI 点。",
|
||||
},
|
||||
errors: {
|
||||
emptyInput: "请先输入问题内容",
|
||||
noSelection: "请至少选择 1 条候选",
|
||||
noValidQuestions: "没有可保存的问题,请调整候选后重试",
|
||||
invalidCandidate: "该候选暂不可选择,请先处理过短、重复或非问题文本",
|
||||
},
|
||||
page: {
|
||||
title: "新建问题",
|
||||
subtitle: "按向导生成候选,确认后一次性保存到当前品牌的问题集。",
|
||||
steps: {
|
||||
configure: "配置生成方式",
|
||||
preview: "确认候选",
|
||||
},
|
||||
methodTitle: "选择创建方式",
|
||||
methodHint: "候选保存前都是临时内容,你可以先生成、再筛选和编辑。",
|
||||
methods: {
|
||||
combination: "按图示词列批量拓展问题候选。",
|
||||
ai: "让 AI 围绕主题生成问题候选。",
|
||||
batch: "从表格或文档中批量粘贴问题。",
|
||||
},
|
||||
expansionHint: "每行一个词;空列会按默认词跳过,核心词和行业词必填。",
|
||||
batchHint: "每行一个问题,保存前可以逐条编辑和勾选。",
|
||||
},
|
||||
},
|
||||
},
|
||||
custom: {
|
||||
|
||||
Reference in New Issue
Block a user