Feat: Metadata in documents for improve the prompt #3690 (#4462)

### What problem does this PR solve?

Feat: Metadata in documents for improve the prompt #3690

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-01-13 17:13:37 +08:00
committed by GitHub
parent 46c52d65b7
commit d8346cb7a6
12 changed files with 270 additions and 13 deletions

View File

@ -169,6 +169,28 @@ export default {
autoQuestions: 'Auto-question',
autoQuestionsTip: `Automatically extract N questions for each chunk to increase their ranking for queries containing those questions. You can check or update the added questions for a chunk from the chunk list. This feature will not disrupt the chunking process if an error occurs, except that it may add an empty result to the original chunk. Be aware that extra tokens will be consumed by the LLM specified in 'System model settings'.`,
redo: 'Do you want to clear the existing {{chunkNum}} chunks?',
setMetaData: 'Set Meta Data',
pleaseInputJson: 'Please enter JSON',
documentMetaTips: `<p>The meta data is in Json format(it's not searchable). It will be added into prompt for LLM if any chunks of this document are included in the prompt.</p>
<p>Examples:</p>
<b>The meta data is:</b><br>
<code>
{
"Author": "Alex Dowson",
"Date": "2024-11-12"
}
</code><br>
<b>The prompt will be:</b><br>
<p>Document: the_name_of_document</p>
<p>Author: Alex Dowson</p>
<p>Date: 2024-11-12</p>
<p>Relevant fragments as following:</p>
<ul>
<li> Here is the chunk content....</li>
<li> Here is the chunk content....</li>
</ul>
`,
metaData: 'Meta data',
},
knowledgeConfiguration: {
titleDescription:

View File

@ -165,6 +165,27 @@ export default {
autoQuestions: '自動問題',
autoQuestionsTip: `在查詢此類問題時,為每個區塊提取 N 個問題以提高其排名分數。在「系統模型設定」中設定的 LLM 將消耗額外的 token。您可以在區塊清單中查看結果。如果發生錯誤此功能不會破壞整個分塊過程除了將空結果新增至原始區塊。 `,
redo: '是否清空已有 {{chunkNum}}個 chunk',
setMetaData: '設定元數據',
pleaseInputJson: '請輸入JSON',
documentMetaTips: `<p>元資料為 Json 格式(不可搜尋)。如果提示中包含該文件的任何部分,它將被添加到 LLM 提示中。
<p>範例:</p>
<b>元資料是:</b><br>
<code>
{
"Author": "Alex Dowson",
"Date": "2024-11-12"
}
</code><br>
<b>提示將是:</b><br>
<p>文檔:文檔名稱</p>
<p>作者Alex Dowson</p>
<p>日期2024-11-12</p>
<p>相關片段如下:</p>
<ul>
<li>這是區塊內容....</li>
<li>這是區塊內容....</li>
</ul>
`,
},
knowledgeConfiguration: {
titleDescription: '在這裡更新您的知識庫詳細信息,尤其是解析方法。',

View File

@ -166,6 +166,28 @@ export default {
autoQuestions: '自动问题',
autoQuestionsTip: `在查询此类问题时,为每个块提取 N 个问题以提高其排名得分。在“系统模型设置”中设置的 LLM 将消耗额外的 token。您可以在块列表中查看结果。如果发生错误此功能不会破坏整个分块过程除了将空结果添加到原始块。`,
redo: '是否清空已有 {{chunkNum}}个 chunk',
setMetaData: '设置元数据',
pleaseInputJson: '请输入JSON',
documentMetaTips: `<p>元数据为 Json 格式(不可搜索)。如果提示中包含此文档的任何块,它将被添加到 LLM 的提示中。</p>
<p>示例:</p>
<b>元数据为:</b><br>
<code>
{
“作者”“Alex Dowson”
“日期”“2024-11-12”
}
</code><br>
<b>提示将为:</b><br>
<p>文档the_name_of_document</p>
<p>作者Alex Dowson</p>
<p>日期2024-11-12</p>
<p>相关片段如下:</p>
<ul>
<li> 这是块内容....</li>
<li> 这是块内容....</li>
</ul>
`,
metaData: '元資料',
},
knowledgeConfiguration: {
titleDescription: '在这里更新您的知识库详细信息,尤其是解析方法。',