{ "name": "review-keyword-cloud", "displayName": "评论关键词云", "description": "从评论语料生成关键词云,结合ASIN反查关键词,每个关键词带情感标签,构建VOC关键词库", "category": "review-analysis", "version": "1.3.0", "type": "orchestration", "parameters": { "reviewCorpus": { "type": "object", "required": true, "description": "review-batch-collection 输出的评论语料" }, "asins": { "type": "array", "items": { "type": "string" }, "required": false, "description": "ASIN列表,用于调用反查关键词补充" }, "domain": { "type": "integer", "required": false, "default": 1, "description": "Amazon站点" }, "topN": { "type": "integer", "required": false, "default": 50, "description": "返回Top N关键词" }, "language": { "type": "string", "required": false, "default": "en", "description": "语言" } }, "pipeline": [ { "step": 1, "name": "评论文本分词+高频短语提取", "type": "compute", "logic": "tokenizeAndExtract(reviewCorpus)", "algorithm": { "tokenize": "分词并去除停用词", "ngrams": "提取高频单词和短语(1-gram, 2-gram, 3-gram)", "frequency": "统计词频" }, "output": "reviewKeywords" }, { "step": 2, "name": "ASIN反查搜索关键词", "condition": "asins && asins.length > 0", "forEach": "asins", "api": { "service": "SorftimeApiService.getAsinKeywords", "endpoint": "/api/ASINRequestKeyword", "method": "POST", "forwardUrl": "https://server.fmode.cn/api/voc-ecom/forward", "headers": { "Authorization": "Bearer {{vocToken}}" }, "requestBody": { "ASIN": "${asin}" }, "queryParams": { "domain": "${domain}" } }, "output": "searchKeywords", "responseExtract": "Array<{ Keyword, KeywordCNName, SearchVolume, SearchRank }>" }, { "step": 3, "name": "合并关键词+情感标注", "type": "compute", "logic": "mergeAndAnnotate(reviewKeywords, searchKeywords, topN)", "algorithm": { "merge": "合并评论关键词和搜索关键词", "source": "标注来源(review/search/both)", "sentiment": "基于情感词典和上下文判断 positive/negative/neutral", "weight": "按频率/搜索量/关联ASIN数加权排序", "categorize": "分类: 产品特性/使用场景/购买决策/问题反馈" }, "output": "keywordCloud" } ], "response": { "type": "object", "properties": { "keywordCloud": { "type": "array", "description": "关键词云数据", "items": { "type": "object", "properties": { "keyword": { "type": "string" }, "weight": { "type": "integer" }, "frequency": { "type": "integer" }, "source": { "type": "string", "enum": [ "review", "search", "both" ] }, "sentiment": { "type": "string", "enum": [ "positive", "negative", "neutral" ] }, "searchVolume": { "type": "integer" }, "relatedAsins": { "type": "integer" } } } }, "categories": { "type": "object", "description": "关键词分类", "properties": { "产品特性": { "type": "array", "items": { "type": "string" } }, "使用场景": { "type": "array", "items": { "type": "string" } }, "购买决策": { "type": "array", "items": { "type": "string" } }, "问题反馈": { "type": "array", "items": { "type": "string" } } } }, "searchKeywords": { "type": "array", "items": { "type": "object", "properties": { "keyword": { "type": "string" }, "searchVolume": { "type": "integer" }, "rank": { "type": "integer" } } } }, "totalKeywords": { "type": "integer" }, "reviewKeywordsCount": { "type": "integer" }, "searchKeywordsCount": { "type": "integer" }, "overlapKeywords": { "type": "integer" } } }, "timeout": 300000, "retry": { "maxAttempts": 2, "delay": 2000, "backoffMultiplier": 2 }, "tokenConfig": { "type": "bearer", "configFile": "~/.openclaw/voc-credentials.json", "tokenField": "vocToken", "resolutionOrder": [ "configFile" ], "apigId": "7HwdQZk55B", "paymentUrlResolution": { "description": "动态构建充值URL:在已存在 session token 时查出用户 objectId,拼接到专属充值页面", "steps": [ "1. 从 voc-credentials.json 获取当前 session token", "2. 调用 GET https://server.fmode.cn/parse/users/me (Header: X-Parse-Application-Id: ncloudmaster, X-Parse-Session-Token: {token})获取用户 objectId", "3. 拼接充值URL: https://app.fmode.cn/dev/apig-pay/?user={objectId}&apigid=7HwdQZk55B&fun_id=HOkkX72PMF", "4. 将该URL展示给用户,引导扫码支付" ], "userResolveEndpoint": "https://server.fmode.cn/parse/users/me", "userResolveHeaders": { "X-Parse-Application-Id": "ncloudmaster", "X-Parse-Session-Token": "{vocToken}" }, "paymentBaseUrl": "https://app.fmode.cn/dev/apig-pay/", "paymentParams": { "user": "{resolvedUserId}", "apigid": "7HwdQZk55B", "fun_id": "HOkkX72PMF" }, "balanceCheckEndpoint": "https://server.fmode.cn/api/apig/getApig" }, "onMissing": { "action": "showPaymentQR", "qrCodeUrl": "https://app.fmode.cn/dev/apig-pay/?apigid=7HwdQZk55B&fun_id=HOkkX72PMF", "title": "扫码开通 VOC-AI 数据服务", "message": "此 Skill 需要有效的 API Token。请先打开充值页面完成登录和充值;当用户提供 session token 后,请由 OpenClaw 运行 node scripts/tools/set-voc-token.js 写入 ~/.openclaw/voc-credentials.json 的 vocToken 字段,再重试当前 Skill。", "tokenSetupCommandTemplate": "node scripts/tools/set-voc-token.js {sessionToken}", "tokenSetupInstructions": "当用户完成登录和充值后,如果用户把 session token 发给你,请直接运行 node scripts/tools/set-voc-token.js 写入 ~/.openclaw/voc-credentials.json,然后重试当前 Skill。" }, "onBalanceInsufficient": { "action": "resolveUserThenShowPayment", "title": "VOC-AI Token 余额不足,请扫码充值", "message": "当前 Token 余额不足,我将为你生成专属充值链接,扫码支付后即可继续使用。" } }, "errorHandling": { "balanceInsufficient": { "conditions": [ { "responseField": "code", "operator": "in", "value": [ -2, -3, -10, 402, 429 ] }, { "responseField": "msg", "operator": "contains", "value": [ "余额不足", "insufficient", "balance", "quota", "没有开通", "权限或余额" ] }, { "responseField": "mess", "operator": "contains", "value": [ "余额不足", "insufficient", "balance", "quota", "没有开通", "权限或余额" ] }, { "responseField": "message", "operator": "contains", "value": [ "余额不足", "insufficient", "balance", "没有开通", "权限或余额" ] } ], "matchMode": "any", "trigger": "tokenConfig.onBalanceInsufficient" }, "unauthorized": { "conditions": [ { "responseField": "code", "operator": "in", "value": [ 401, 403 ] }, { "responseField": "msg", "operator": "contains", "value": [ "unauthorized", "token", "invalid", "auth" ] } ], "matchMode": "any", "trigger": "tokenConfig.onMissing" } } }