Merge pull request #469 from HanqingZ/fix/modify-knowledge-pipeline

This commit is contained in:
Chenhe Gu
2025-09-26 19:29:26 +09:00
committed by GitHub
10 changed files with 6 additions and 51 deletions

View File

@@ -28,10 +28,8 @@ Built-in pipelines are official knowledge base templates pre-configured by Dify.
| General Mode-ECO | General | Economical | Inverted Index | Divide document content into smaller paragraphs, directly used for matching user queries and retrieval. |
| Parent-child-HQ | Parent-Child | High Quality | Hybrid Search | Adopt advanced chunking strategy, dividing document text into larger parent chunks and smaller child chunks. The parent chunks contain child chunks which ensure both retrieval precision and maintain contextual integrity. |
| Simple Q&A | Question & Answer | High Quality | Vector Search | Convert tabular data into question-answer format, using question matching to quickly hit corresponding answer information. |
| Complex PDF with Images & Tables | Parent-child | High Quality | Hybrid Search - Weighted Score | Extract image and table content from PDF files. |
| Contextual Enrichment Using LLM | Parent-child | High Quality | Hybrid Search - Weighted Score | Extract images and tables from documents and automatically generate descriptive annotations by using large language models, achieving intelligent contextual enhancement. |
| Convert to Markdown | Parent-child | High Quality | Hybrid Search - Weighted Score | Designed for Office native file formats such as DOCX, XLSX, and PPTX, converting them to Markdown format for better information processing. ⚠️ Note: PDF files are not recommended. |
| LLM Generated Q&A | Question & Answer | High Quality | Vector Search | Generate structured question-answer pairs with large language models based on original text paragraphs. Find relevant answer by using question matching mechanism. |
| Convert to Markdown | Parent-child | High Quality | Hybrid Search - Weighted Score | Designed for Office native file formats such as DOCX, XLSX, and PPTX, converting them to Markdown format for better information processing. ⚠️ Note: PDF files are not recommended. |
To preview the selected built-in pipeline, click **Details** on any template card. Then, check information in the popup window, including: orchestration structure, pipeline description, and chunk structure. Click **Use this Knowledge Pipeline** for orchestration.

View File

@@ -169,7 +169,7 @@ In this stage, these tools extract, chunk, and transform the content for optimal
Documents come in different formats - PDF, XLSX, DOCX. However, LLM can't read these files directly. That's where extractors come in. They support multiple formats and handle the conversion, so your content is ready for the next step of the LLMs.
You can choose Dify's Doc Extractor to process files, or select tools based on your needs from Marketplace which offers Dify Extractor and third-party tools like MinerU, Unstructured, and more.
You can choose Dify's Doc Extractor to process files, or select tools based on your needs from Marketplace which offers Dify Extractor and third-party tools such as Unstructured.
#### Doc Extractor
@@ -187,19 +187,6 @@ Dify Extractor is a built-in document parser presented by Dify. It supports mult
![Dify Extractor](/images/knowledge-base/knowledge-pipeline-orchestration-5.png)
#### MinerU
<div style={{display: 'flex', flexWrap: 'wrap', gap: '30px'}}>
<div style={{flex: 1, minWidth: '200px'}}>
![MinerU](/images/knowledge-base/knowledge-pipeline-orchestration-6.png)
</div>
<div style={{flex: 2, minWidth: '300px'}}>
[MinerU](https://marketplace.dify.ai/plugins/langgenius/mineru) is a high-quality document parser that converts documents into machine-readable formats (Markdown, JSON) with a focus on preserving complex structures and mathematical notations.
Compared with basic PDF extractors, MinerU removes headers, footers, and page numbers while preserving semantic coherence. It also automatically detects scanned PDFs and garbled documents, enabling OCR functionality for 84 languages. Try MinerU with scientific papers with complex formulas (auto converts to LaTex), multi-column layouts, academic publications documents with mixed content (text + images + tables).
</div>
</div>
#### Unstructured
<div style={{display: 'flex', flexWrap: 'wrap', gap: '30px'}}>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

After

Width:  |  Height:  |  Size: 454 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 478 KiB

After

Width:  |  Height:  |  Size: 358 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 KiB

After

Width:  |  Height:  |  Size: 312 KiB

View File

@@ -31,10 +31,8 @@ Difyは2種類のテンプレートを提供しています**内部パイプ
| 汎用分割モード<br/>General Mode | 汎用モード | 省リソース | 逆インデックス | ドキュメントを小さな段落へ分割し、ユーザークエリのマッチングと直接検索に利用されます。 |
| 親子分割モード<br/>Parent-child Structure | 親子モード | 高品質 | ハイブリッド検索 | ドキュメントを大きな親チャンクと小さな子チャンクに分割。親チャンクが子チャンクを包含し、検索精度と文脈整合性の両立を実現します。 |
| 簡単なQ&A<br/>Simple Q&A | Q&Aモード | 高品質 | ベクター検索 | 表形式データをQ&A形式へと変換し、質問マッチングを通じて迅速に回答が取得できます。 |
| 複雑なPDF画像やテーブルを含む<br/>Complex PDF with Images & Tables | 親子モード | 高品質 | ハイブリッド検索・重み付けスコア | PDF内の画像や表の内容も抽出可能です。 |
| LLMによる文脈強化<br/>Contextual Enrichment Using LLM | 親子モード | 高品質 | ハイブリッド検索・重み付けスコア | ドキュメントから画像や表を抽出し、LLMで説明注釈を自動生成して文脈を高度に強化します。 |
| Markdownへの変換<br/>Convert to Markdown | 親子モード | 高品質 | ハイブリッド検索・重み付けスコア | DOCX、XLSX、PPTXほかOfficeファイルをMarkdownへ変換し、情報処理を最適化します。※PDFは推奨されません。 |
| LLMによるQ&Aの自動生成<br/>LLM Generated Q&A | Q&Aモード | 高品質 | ベクター検索 | LLMによるQ&Aペアを原文テキストから自動生成し、質問マッチングで関連回答を検索します。 |
| Markdownへの変換<br/>Convert to Markdown | 親子モード | 高品質 | ハイブリッド検索・重み付けスコア | DOCX、XLSX、PPTXほかOfficeファイルをMarkdownへ変換し、情報処理を最適化します。※PDFは推奨されません。 |
テンプレートカードの「詳細」ボタンをクリックすると、ポップアップでオーケストレーション構造、パイプライン説明、チャンキング構造を確認できます。内容を確認して**このナレッジベースパイプラインを使用**をクリックすれば、そのテンプレートでオーケストレーションを開始できます。

View File

@@ -175,7 +175,7 @@ Google Drive、Dropbox、OneDriveなどのクラウドストレージサービ
PDF, XLSX, DOCXなど多様な形式のドキュメントが存在しますが、LLMはこれらをそのまま扱えません。そのため、抽出器Extractorが各種ファイルを解析・変換し、LLMが扱いやすい形式に変換します。
Difyのドキュメント抽出器、あるいはMarketplaceから「Dify Extractor」「MinerU」「Unstructured」等のツールを選択できます。
Difyのドキュメント抽出器、あるいはMarketplaceから「Dify Extractor」「Unstructured」等のツールを選択できます。
#### Doc Extractorドキュメント抽出器
@@ -193,19 +193,6 @@ Dify Extractorは、Difyが提供する内蔵ドキュメント解析ツール
![Dify Extractor](/images/knowledge-base/knowledge-pipeline-orchestration-5.png)
#### MinerU
<div style={{display: 'flex', flexWrap: 'wrap', gap: '30px'}}>
<div style={{flex: 1, minWidth: '200px'}}>
![MinerU](/images/knowledge-base/knowledge-pipeline-orchestration-6.png)
</div>
<div style={{flex: 2, minWidth: '300px'}}>
[MinerU](https://marketplace.dify.ai/plugins/langgenius/mineru)は、複雑な構造や数式表現を保持したまま、PDF等をMarkdownやJSONなどの機械可読形式へ高品質に変換できるツールです。
基本的なPDF抽出ツールと比べ、ヘッダー・フッター・ページ番号を除去しつつ意図した論理構造を保持できます。また、スキャン画像・文字化けドキュメントの自動検出や、84言語対応のOCR光学文字認識もサポート。LaTeX形式の数式抽出や多カラム・テーブル・画像混在ドキュメントの解析にも最適です。
</div>
</div>
#### Unstructured
<div style={{display: 'flex', flexWrap: 'wrap', gap: '30px'}}>

View File

@@ -32,10 +32,8 @@ Dify 提供了两种模版方案: **内置流水线**Built-in) 和**自定
| 通用模式General Mode | 通用模式 | 经济 | 倒排索引 | 将文档内容分割成较小的段落块(通用块),直接用于匹配用户查询和检索。 |
| 父子模式Parent-child Structure) | 父子模式 | 高质量 | 混合检索 | 采用了高级分块策略,将文档文本分成较大的"父块"和较小的"子块"。其中,"父块"包含了"子块"。这样既保证了检索的精确性,又维持了上下文的完整性。 |
| 简单问答Simple Q&A) | 问答模式 | 高质量 | 向量搜索 | 将表格数据转化为一问一答的形式,通过问题匹配来快速找到对应的答案信息。适用于结构化表格数据。 |
| 复杂 PDF 含图片和表格Complex PDF with Images & Tables | 父子模式 | 高质量 | 混合检索 - 加权评分 | 提取 PDF 文件内的图像和表格内容。 |
| LLM 上下文增强Contextual Enriching Using LLM) | 父子模式 | 高质量 | 混合检索 - 加权评分 | 将文档内的图片和表格提取出来,使用大型语言模型自动生成描述性注释,实现上下文的智能增强。 |
| Markdown 转换Convert to Markdown) | 父子模式 | 高质量 | 混合检索 - 加权评分 | 专为 DOCX、XLSX 和 PPTX 等 Office 原生文件格式设计,将其转换为 Markdown 格式以便更好地进行信息处理。⚠️ 注意:不推荐使用 PDF 文件。 |
| LLM 生成问答LLM Generated Q&A) | 问答模式 | 高质量 | 向量搜索 - 加权评分 | 使用大型语言模型自动生成结构化的问答对,通过问题匹配机制找到相关的答案信息。 |
| Markdown 转换Convert to Markdown) | 父子模式 | 高质量 | 混合检索 - 加权评分 | 专为 DOCX、XLSX 和 PPTX 等 Office 原生文件格式设计,将其转换为 Markdown 格式以便更好地进行信息处理。⚠️ 注意:不推荐使用 PDF 文件。 |
点击模版卡片上的详情按钮,即可在弹窗中预览选中的流水线的编排结构、流水线简介和分段模式。点击使用此知识流水线模版进行编排。

View File

@@ -159,7 +159,7 @@ title: "步骤二:知识流水线编排"
### 文档处理
由于知识库无法直接理解 PDF、Word 等各种文档格式,提取器负责将这些文档"解读"成系统可以处理的文本内容。它支持多种常见文件格式,确保你的文档内容能够被正确提取和处理,并转换为大型语言模型可以有效使用的格式。 你可以选择 Dify 文档提取器来处理文件,也可以根据你的需求从 Dify Marketplace 中选择更多工具。Marketplace 提供了如 Dify Extractor 以及 MinerU、Unstructured 等第三方工具。
由于知识库无法直接理解 PDF、Word 等各种文档格式,提取器负责将这些文档"解读"成系统可以处理的文本内容。它支持多种常见文件格式,确保你的文档内容能够被正确提取和处理,并转换为大型语言模型可以有效使用的格式。 你可以选择 Dify 文档提取器来处理文件,也可以根据你的需求从 Dify Marketplace 中选择更多工具。Marketplace 提供了如 Dify Extractor、Unstructured 等第三方工具。
#### 文档提取器 (Doc Extractor)
@@ -177,19 +177,6 @@ Dify Extractor 是 Dify 开发的一款内置文档解析器。它支持多种
![Dify Extractor](/images/knowledge-base/knowledge-pipeline-orchestration-5.png)
#### MinerU
<div style={{display: 'flex', flexWrap: 'wrap', gap: '30px'}}>
<div style={{flex: 1, minWidth: '200px'}}>
![MinerU](/images/knowledge-base/knowledge-pipeline-orchestration-6.png)
</div>
<div style={{flex: 2, minWidth: '300px'}}>
MinerU 是一款高质量文档解析器可将文档转换为机器可读格式Markdown、JSON专注于保留复杂结构和数学符号。
与基础 PDF 提取器相比MinerU 会移除页眉、页脚和页码,同时保持语义连贯性。它还能自动检测扫描 PDF 和乱码文档,支持 84 种语言的 OCR 功能。建议使用 MinerU 处理包含复杂公式的科学论文(自动转换为 LaTex、多栏布局、包含混合内容文本+图片+表格)的学术出版物文档。
</div>
</div>
#### Unstructured
<div style={{display: 'flex', flexWrap: 'wrap', gap: '30px'}}>