为您的 AI 应用定义“好”和“坏”的含义。
在设计测试之前,请先查看 ThemeBuilder的典型完美输出。 每次评估都会处理此对象的一个版本:
{
"id": "example-002",
"userInput": {
"companyName": "Nova news",
"description": "Space exploration news and educational content.",
"audience": "science enthusiasts",
"tone": [
"informative",
"scientific",
"inspiring"
]
},
"appOutput": {
"motto": "Unveiling the universe.",
"colorPalette": {
"textColor": "#E2E8F0",
"backgroundColor": "#0B0D17",
"primary": "#7000FF",
"secondary": "#00C2FF"
}
}
}
定义成功和失败
创建评估的第一步是定义成功和失败。 为此,您必须熟悉自己的数据;了解生产环境中可能会出现哪些错误输出。如果可以,请查看生产数据。
ThemeBuilder 的错误输出示例包括:
- 数据结构不正确:
- JSON 无效、缺少键
- 调色板值不是十六进制值
- 标语或某些颜色是空字符串
- 标语的字数超过了我们设置的 6 个字的限制。
- 标语不佳:
- 标语与品牌、受众群体或语气不符。
- 标语具有恶意性。
- 调色板不佳:
- 调色板与品牌、受众群体或语气不符。
- 文本与背景的色彩对比度小于 4.5。
用户输入示例
User input: {
"companyName": "Moon Cafe",
"description": "A cozy nocturnal coffee shop serving late-night espresso and pastries.",
"audience": "night owls and students"
}
输出:数据不正确
// Wrong key `tagline` instead of `motto`.
// Array of colors instead of the required `colorPalette` object.
Output: {"tagline": "Freshly brewed", "colors": \["\#f0f0f0"\]}
// The motto is over our 6-word limit
Output: {
"motto": "The best place for late night espresso and cozy pastries",
"colorPalette": ...
}
// Colors are invalid hexadecimal strings
Output: {
"motto": "Brewed for the moon.",
"colorPalette": {"textColor": "grey", "backgroundColor": "white", "primary": "neon-purple", "secondary": "\#\#00C2FF"}
}
输出:标语不佳
// Brand and tone mismatch (too cold for a cozy vibe)
Output motto: "Beans for maximum productivity."
// Toxic (rude and unwelcoming)
Output motto: "Go away loser, we're busy."
输出:调色板不佳
// Brand and tone mismatch (clashing neon colors for a cozy cafe)
Output color palette: {
"textColor": "\#00FF00", "backgroundColor": "\#FF00FF",
"primary": "\#FFFF00", "secondary": "\#0000FF"
}
// Contrast ratio below the 4.5:1 requirement
Output color palette: {
"textColor": "\#CCCCCC", "backgroundColor": "\#FFFFFF",
"primary": "\#EEEEEE", "secondary": "\#DDDDDD"
}
定义评估标准和方法
您可以根据输出未能满足您期望的方式定义评估标准和方法:
- 如需测试客观标准,请创建基于规则的评估(使用常规代码)。
- 如需测试主观标准,请使用评判模型。
| 评估标准 | 评估方法 |
|---|---|
| 数据格式正确:JSON 有效、所有键都存在、颜色为十六进制、没有空值、标语不超过 6 个字 | 基于规则(客观) |
| 文本与背景的色彩对比度易于辨认 | 基于规则 |
| 标语与品牌、受众群体和语气相符 | LLM 评判(主观) |
| 调色板与品牌、受众群体和语气相符 | LLM 评判 |
| 标语不具有恶意性 | LLM 评判 |
评分准则
没有完美的创意标语或调色板。因此,请不要将 ThemeBuilder 的输出与理想结果进行比较,而是为评判提供明确的指南。
// Example rubric for color palette brand fit
Criteria:
1. **Psychological and literal association**: Do the colors logically map
to the literal product and evoke the right vibe?
2. **Constraint verification**: Does the palette violate any fundamental
keywords (such as "sustainable", "discreet", or "organic")?
3. **Appropriate and harmonious**: Is the palette suitable for the company's
industry baseline, regardless of secondary trendy adjectives?
使用特定于任务的标准
除了特定于用例的指标之外,还要使用与任务相关的标准和指标。例如,对于 摘要, 常见指标包括:
- 对齐:摘要遵循特定的用户说明、语气或风格。
- 简洁:摘要只说明所需内容,没有多余内容。
- 丰富性:摘要包含所有要点。
- 正确性:摘要基于事实且真实。
- 可靠性:每项声明都可追溯到来源,以防止出现幻觉。
预构建的评估
评估解决方案和工具提供可能适合您使用情形的受管理的评估或预构建指标。 探索可用的功能。