mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-27 13:28:32 +07:00
* fix redirect language code prefixes * rename: cn -> zh, jp -> ja * remove hardcoded ja / zh references * remove hardcoded 'english' references * renamed variable names and dict keys to language agnostic names * fix: add missing language helper methods to PRAnalyzer - Add get_language_directory() method - Initialize source_language and target_languages from config - Fixes AttributeError when generating mixed PR errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * test: kitchen sink workflow validation v2 This PR validates the translation workflow after config-driven refactoring: Changes: - Add new test file: test-workflow-validation.mdx - Modify existing file: introduction.mdx - Update docs.json navigation Tests: - New file translation (add workflow) - Existing file translation (update workflow) - Navigation sync across languages - Config-driven language codes (zh/ja instead of cn/jp) - Source language abstraction (no hardcoded "English") Expected workflow behavior: 1. Detect changes in en/ directory 2. Translate new file to zh and ja 3. Update modified file translations 4. Sync docs.json for all language sections 5. Commit translated files automatically 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: update workflow paths to use zh/ja instead of cn/jp Aligns workflow trigger paths with the zh/ja language directory rename. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Revert "fix: update workflow paths to use zh/ja instead of cn/jp" This reverts commit9587b7cc5d. * Revert "test: kitchen sink workflow validation v2" This reverts commit4abdd69fd2. * fix: update workflow paths in doc analyze workflow to use zh/ja instead of cn/jp * Refactor/language codes (#240) * test: kitchen sink workflow validation v2 This PR validates the translation workflow after config-driven refactoring: Changes: - Add new test file: test-workflow-validation.mdx - Modify existing file: introduction.mdx - Update docs.json navigation Tests: - New file translation (add workflow) - Existing file translation (update workflow) - Navigation sync across languages - Config-driven language codes (zh/ja instead of cn/jp) - Source language abstraction (no hardcoded "English") Expected workflow behavior: 1. Detect changes in en/ directory 2. Translate new file to zh and ja 3. Update modified file translations 4. Sync docs.json for all language sections 5. Commit translated files automatically 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: update workflow paths to use zh/ja instead of cn/jp Aligns workflow trigger paths with the zh/ja language directory rename. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Revert "fix: update workflow paths to use zh/ja instead of cn/jp" This reverts commit9587b7cc5d. * Revert "test: kitchen sink workflow validation v2" This reverts commit4abdd69fd2. * fix: update workflow paths in doc analyze workflow to use zh/ja instead of cn/jp --------- Co-authored-by: Claude <noreply@anthropic.com> * fix: update workflow files to use 'source' instead of 'english' After refactoring the PR analyzer to use 'source' for source language PRs (instead of hardcoded 'english'), the workflow files need to match. Changes: - sync_docs_analyze.yml: pr_type == 'source' (was 'english') - sync_docs_update.yml: PR_TYPE != 'source' check - Updated all comments from "English" to "source language" - Updated all pr_type values in JSON from "english" to "source" This ensures the workflows trigger correctly with the refactored config-driven language system. Related: language code refactoring (cn/jp → zh/ja) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix/workflow source language references (#245) * test: kitchen sink workflow validation v2 This PR validates the translation workflow after config-driven refactoring: Changes: - Add new test file: test-workflow-validation.mdx - Modify existing file: introduction.mdx - Update docs.json navigation Tests: - New file translation (add workflow) - Existing file translation (update workflow) - Navigation sync across languages - Config-driven language codes (zh/ja instead of cn/jp) - Source language abstraction (no hardcoded "English") Expected workflow behavior: 1. Detect changes in en/ directory 2. Translate new file to zh and ja 3. Update modified file translations 4. Sync docs.json for all language sections 5. Commit translated files automatically 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: update workflow paths to use zh/ja instead of cn/jp Aligns workflow trigger paths with the zh/ja language directory rename. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Revert "fix: update workflow paths to use zh/ja instead of cn/jp" This reverts commit9587b7cc5d. * Revert "test: kitchen sink workflow validation v2" This reverts commit4abdd69fd2. * fix: update workflow paths in doc analyze workflow to use zh/ja instead of cn/jp * fix: update workflow files to use 'source' instead of 'english' After refactoring the PR analyzer to use 'source' for source language PRs (instead of hardcoded 'english'), the workflow files need to match. Changes: - sync_docs_analyze.yml: pr_type == 'source' (was 'english') - sync_docs_update.yml: PR_TYPE != 'source' check - Updated all comments from "English" to "source language" - Updated all pr_type values in JSON from "english" to "source" This ensures the workflows trigger correctly with the refactored config-driven language system. Related: language code refactoring (cn/jp → zh/ja) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com> * fix * fix docs.json language codes * rename previous version docs: cn -> zh, jp -> ja * rm duplicate redirect entires --------- Co-authored-by: Claude <noreply@anthropic.com>
82 lines
3.6 KiB
Plaintext
82 lines
3.6 KiB
Plaintext
---
|
||
title: "问题分类器"
|
||
icon: "sitemap"
|
||
---
|
||
|
||
<Note> ⚠️ 本文档由 AI 自动翻译。如有任何不准确之处,请参考[英文原版](/en/use-dify/nodes/question-classifier)。</Note>
|
||
|
||
|
||
问题分类器节点智能地对用户输入进行分类,以将对话路由到不同的工作流路径。无需构建复杂的条件逻辑,你只需定义类别,让大型语言模型基于语义理解来确定最合适的分类。
|
||
|
||
## 配置
|
||
|
||
### 输入和模型设置
|
||
|
||
**输入变量** - 选择要分类的内容,通常是用户问题的 `sys.query`,但也可以是来自之前工作流节点的任何文本变量。
|
||
|
||
**模型选择** - 选择用于分类的大型语言模型。对于简单分类,速度较快的模型表现良好,而对于细致入微的区分,更强大的模型处理得更好。
|
||
|
||
<Frame caption="问题分类器配置界面">
|
||
<img src="https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/2f039c5ff3f095b0eed291101d9bff15.png" alt="问题分类器设置" />
|
||
</Frame>
|
||
|
||
### 类别定义
|
||
|
||
为每个类别创建清晰、描述性的标签,并具体描述每个类别应包含的内容。明确类别之间的边界,以帮助大型语言模型做出准确决策。
|
||
|
||
每个类别都成为一个潜在的输出路径,你可以将其连接到不同的下游节点,如专门的知识库、响应模板或处理工作流。
|
||
|
||
## 分类示例
|
||
|
||
以下是问题分类器在客户服务场景中的工作方式:
|
||
|
||
<Frame caption="客户服务分类工作流">
|
||
<img src="https://assets-docs.dify.ai/dify-enterprise-mintlify/en/guides/workflow/node/2f06ecce149c844c23be70a8fcff09bc.png" alt="客户服务分类" />
|
||
</Frame>
|
||
|
||
**定义的类别:**
|
||
- **售后服务** - 保修申请、退货、维修和购后支持
|
||
- **产品使用** - 设置说明、故障排除、功能解释
|
||
- **其他问题** - 特定类别未涵盖的一般查询
|
||
|
||
**分类结果:**
|
||
- "如何在iPhone 14上设置联系人?" → **产品使用**
|
||
- "我购买的产品保修期是多长?" → **售后服务**
|
||
- "今天天气如何?" → **其他问题**
|
||
|
||
每个分类结果都路由到不同的知识库和响应策略,确保用户获得相关的专业帮助。
|
||
|
||
## 高级配置
|
||
|
||
### 指令和指南
|
||
|
||
在**指令**字段中添加详细的分类指南,以处理边缘情况、模糊场景或特定业务规则。这有助于大型语言模型理解类别之间的细微差别。
|
||
|
||
### 记忆集成
|
||
|
||
启用**记忆**以在分类输入时包含对话历史。这提高了多轮对话中的准确性,其中当前输入依赖于之前的上下文。
|
||
|
||
**记忆窗口**控制包含多少对话历史,在上下文感知与标记数效率和处理速度之间取得平衡。
|
||
|
||
## 输出使用
|
||
|
||
分类器输出一个包含匹配类别标签的 `class_name` 变量。在下游节点中使用此变量用于:
|
||
|
||
**条件路由** - 基于分类结果连接不同的工作流路径
|
||
|
||
**知识库选择** - 路由到每个类别的专门知识库
|
||
|
||
**响应自定义** - 应用不同的响应模板或处理逻辑
|
||
|
||
**分析和日志记录** - 跟踪用户查询在各类别中的分布情况
|
||
|
||
## 最佳实践
|
||
|
||
**清晰的类别边界** - 定义明确、不重叠的类别,并提供具体描述以提高分类准确性。
|
||
|
||
**适当的模型选择** - 根据分类复杂性选择模型。简单的二元分类适用于速度较快的模型,而细致入微的多类别分类可能需要更强大的模型。
|
||
|
||
**测试边缘情况** - 验证可能适合多个类别的用对话上下文** - 为依赖之前交互进行分类的对话应用程序启用记忆。
|
||
|
||
**监控和迭代** - 审查分类结果,并根据实际使用模式优化类别描述。
|