mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 04:05:58 +08:00
### What problem does this PR solve? Feat: Cross-language query #7376 #4503 #5710 #7470 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
a14865e6bb
commit
2fe332d01d
39
web/src/components/cross-language-item.tsx
Normal file
39
web/src/components/cross-language-item.tsx
Normal file
@ -0,0 +1,39 @@
|
||||
import { Select as AntSelect, Form } from 'antd';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const Languages = [
|
||||
'English',
|
||||
'Chinese',
|
||||
'Spanish',
|
||||
'French',
|
||||
'German',
|
||||
'Japanese',
|
||||
'Korean',
|
||||
];
|
||||
|
||||
const options = Languages.map((x) => ({ label: x, value: x }));
|
||||
|
||||
type CrossLanguageItemProps = {
|
||||
name?: string | Array<string>;
|
||||
};
|
||||
|
||||
export const CrossLanguageItem = ({
|
||||
name = ['prompt_config', 'cross_languages'],
|
||||
}: CrossLanguageItemProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Form.Item
|
||||
label={t('chat.crossLanguage')}
|
||||
name={name}
|
||||
tooltip={t('chat.crossLanguageTip')}
|
||||
>
|
||||
<AntSelect
|
||||
options={options}
|
||||
allowClear
|
||||
placeholder={t('common.languagePlaceholder')}
|
||||
mode="multiple"
|
||||
/>
|
||||
</Form.Item>
|
||||
);
|
||||
};
|
@ -106,7 +106,8 @@ export default {
|
||||
disabled: 'Disable',
|
||||
action: 'Action',
|
||||
parsingStatus: 'Parsing Status',
|
||||
parsingStatusTip: 'Document parsing time varies based on several factors. Enabling features like Knowledge Graph, RAPTOR, Auto Question Extraction, or Auto Keyword Extraction will significantly increase processing time. If the progress bar stalls, please consult these two FAQs: https://ragflow.io/docs/dev/faq#why-does-my-document-parsing-stall-at-under-one-percent.',
|
||||
parsingStatusTip:
|
||||
'Document parsing time varies based on several factors. Enabling features like Knowledge Graph, RAPTOR, Auto Question Extraction, or Auto Keyword Extraction will significantly increase processing time. If the progress bar stalls, please consult these two FAQs: https://ragflow.io/docs/dev/faq#why-does-my-document-parsing-stall-at-under-one-percent.',
|
||||
processBeginAt: 'Begin at',
|
||||
processDuration: 'Duration',
|
||||
progressMsg: 'Progress',
|
||||
@ -542,6 +543,8 @@ This auto-tagging feature enhances retrieval by adding another layer of domain-s
|
||||
'If an API key is correctly set here, Tavily-based web searches will be used to supplement knowledge base retrieval.',
|
||||
tavilyApiKeyMessage: 'Please enter your Tavily API Key',
|
||||
tavilyApiKeyHelp: 'How to get it?',
|
||||
crossLanguage: 'Cross-language search',
|
||||
crossLanguageTip: `Select one or more languages for cross‑language search. If no language is selected, the system searches with the original query.`,
|
||||
},
|
||||
setting: {
|
||||
profile: 'Profile',
|
||||
|
@ -105,7 +105,8 @@ export default {
|
||||
disabled: '禁用',
|
||||
action: '動作',
|
||||
parsingStatus: '解析狀態',
|
||||
parsingStatusTip: '文件解析時間取決於多種因素。如果啟用了知識圖譜、RAPTOR、自動問題提取、自動關鍵詞提取等功能,解析時間將會顯著延長。如果解析進度條長時間未更新,請參考這兩條常見問題解答FAQ:https://ragflow.io/docs/dev/faq#why-does-my-document-parsing-stall-at-under-one-percent。',
|
||||
parsingStatusTip:
|
||||
'文件解析時間取決於多種因素。如果啟用了知識圖譜、RAPTOR、自動問題提取、自動關鍵詞提取等功能,解析時間將會顯著延長。如果解析進度條長時間未更新,請參考這兩條常見問題解答FAQ:https://ragflow.io/docs/dev/faq#why-does-my-document-parsing-stall-at-under-one-percent。',
|
||||
processBeginAt: '流程開始於',
|
||||
processDuration: '過程持續時間',
|
||||
progressMsg: '進度消息',
|
||||
@ -317,7 +318,8 @@ export default {
|
||||
<i>不符合上述規則的文字行將被忽略。</i>
|
||||
`,
|
||||
useRaptor: '使用 RAPTOR 文件增強策略',
|
||||
useRaptorTip: '啟用 RAPTOR 以用於多跳問答任務。詳情請參見:https://ragflow.io/docs/dev/enable_raptor',
|
||||
useRaptorTip:
|
||||
'啟用 RAPTOR 以用於多跳問答任務。詳情請參見:https://ragflow.io/docs/dev/enable_raptor',
|
||||
prompt: '提示詞',
|
||||
promptMessage: '提示詞是必填項',
|
||||
promptText: `请請總結以下段落。 小心數字,不要編造。 段落如下:
|
||||
@ -419,7 +421,8 @@ export default {
|
||||
setAnOpenerTip: '您想如何歡迎您的客戶?',
|
||||
knowledgeBases: '知識庫',
|
||||
knowledgeBasesMessage: '請選擇',
|
||||
knowledgeBasesTip: '選擇關聯的知識庫。新建或空的知識庫不會在下拉選單中顯示。',
|
||||
knowledgeBasesTip:
|
||||
'選擇關聯的知識庫。新建或空的知識庫不會在下拉選單中顯示。',
|
||||
system: '系統提示词',
|
||||
systemInitialValue: `你是一個智能助手,請總結知識庫的內容來回答問題,請列舉知識庫中的數據詳細回答。當所有知識庫內容都與問題無關時,你的回答必須包括“知識庫中未找到您要的答案!”這句話。回答需要考慮聊天歷史。
|
||||
以下是知識庫:
|
||||
@ -526,6 +529,8 @@ export default {
|
||||
'如果 API 金鑰設定正確,它將利用 Tavily 進行網路搜尋作為知識庫的補充。',
|
||||
tavilyApiKeyMessage: '請輸入你的 Tavily API Key',
|
||||
tavilyApiKeyHelp: '如何獲取?',
|
||||
crossLanguage: '跨語言搜尋',
|
||||
crossLanguageTip: `選擇一種或多種語言進行跨語言搜尋。如果沒有選擇語言,系統將使用原始查詢進行搜尋。 `,
|
||||
},
|
||||
setting: {
|
||||
profile: '概述',
|
||||
|
@ -105,7 +105,8 @@ export default {
|
||||
disabled: '禁用',
|
||||
action: '动作',
|
||||
parsingStatus: '解析状态',
|
||||
parsingStatusTip: '文本解析的时间取决于诸多因素。如果开启了知识图谱、RAPTOR、自动问题提取、自动关键词提取等功能,时间会更长。如果解析进度条长时间不更新,也可以参考这两条 FAQ:https://ragflow.io/docs/dev/faq#why-does-my-document-parsing-stall-at-under-one-percent。',
|
||||
parsingStatusTip:
|
||||
'文本解析的时间取决于诸多因素。如果开启了知识图谱、RAPTOR、自动问题提取、自动关键词提取等功能,时间会更长。如果解析进度条长时间不更新,也可以参考这两条 FAQ:https://ragflow.io/docs/dev/faq#why-does-my-document-parsing-stall-at-under-one-percent。',
|
||||
processBeginAt: '开始于',
|
||||
processDuration: '持续时间',
|
||||
progressMsg: '进度',
|
||||
@ -334,7 +335,8 @@ export default {
|
||||
<i>不符合上述规则的文本行将被忽略。</i>
|
||||
`,
|
||||
useRaptor: '使用召回增强 RAPTOR 策略',
|
||||
useRaptorTip: '为多跳问答任务启用 RAPTOR,详情请见 : https://ragflow.io/docs/dev/enable_raptor。',
|
||||
useRaptorTip:
|
||||
'为多跳问答任务启用 RAPTOR,详情请见 : https://ragflow.io/docs/dev/enable_raptor。',
|
||||
prompt: '提示词',
|
||||
promptMessage: '提示词是必填项',
|
||||
promptText: `请总结以下段落。 小心数字,不要编造。 段落如下:
|
||||
@ -436,7 +438,8 @@ General:实体和关系提取提示来自 GitHub - microsoft/graphrag:基于
|
||||
setAnOpenerTip: '您想如何欢迎您的客户?',
|
||||
knowledgeBases: '知识库',
|
||||
knowledgeBasesMessage: '请选择',
|
||||
knowledgeBasesTip: '选择关联的知识库。新建或空知识库不会在下拉菜单中显示。',
|
||||
knowledgeBasesTip:
|
||||
'选择关联的知识库。新建或空知识库不会在下拉菜单中显示。',
|
||||
system: '系统提示词',
|
||||
systemInitialValue: `你是一个智能助手,请总结知识库的内容来回答问题,请列举知识库中的数据详细回答。当所有知识库内容都与问题无关时,你的回答必须包括“知识库中未找到您要的答案!”这句话。回答需要考虑聊天历史。
|
||||
以下是知识库:
|
||||
@ -543,6 +546,8 @@ General:实体和关系提取提示来自 GitHub - microsoft/graphrag:基于
|
||||
'如果 API 密钥设置正确,它将利用 Tavily 进行网络搜索作为知识库的补充。',
|
||||
tavilyApiKeyMessage: '请输入你的 Tavily API Key',
|
||||
tavilyApiKeyHelp: '如何获取?',
|
||||
crossLanguage: '跨语言搜索',
|
||||
crossLanguageTip: `选择一种或多种语言进行跨语言搜索。如果未选择任何语言,系统将使用原始查询进行搜索。`,
|
||||
},
|
||||
setting: {
|
||||
profile: '概要',
|
||||
|
@ -6,6 +6,7 @@ import { Button, Card, Divider, Flex, Form, Input } from 'antd';
|
||||
import { FormInstance } from 'antd/lib';
|
||||
import { LabelWordCloud } from './label-word-cloud';
|
||||
|
||||
import { CrossLanguageItem } from '@/components/cross-language-item';
|
||||
import { UseKnowledgeGraphItem } from '@/components/use-knowledge-graph-item';
|
||||
import styles from './index.less';
|
||||
|
||||
@ -40,6 +41,7 @@ const TestingControl = ({ form, handleTesting }: IProps) => {
|
||||
<SimilaritySlider isTooltipShown></SimilaritySlider>
|
||||
<Rerank></Rerank>
|
||||
<UseKnowledgeGraphItem filedName={['use_kg']}></UseKnowledgeGraphItem>
|
||||
<CrossLanguageItem name={'cross_languages'}></CrossLanguageItem>
|
||||
<Card size="small" title={t('testText')}>
|
||||
<Form.Item<FieldType>
|
||||
name={'question'}
|
||||
|
@ -28,6 +28,7 @@ import {
|
||||
} from '../interface';
|
||||
import { EditableCell, EditableRow } from './editable-cell';
|
||||
|
||||
import { CrossLanguageItem } from '@/components/cross-language-item';
|
||||
import Rerank from '@/components/rerank';
|
||||
import TopNItem from '@/components/top-n-item';
|
||||
import { UseKnowledgeGraphItem } from '@/components/use-knowledge-graph-item';
|
||||
@ -181,6 +182,7 @@ const PromptEngine = (
|
||||
<Switch></Switch>
|
||||
</Form.Item>
|
||||
<Rerank></Rerank>
|
||||
<CrossLanguageItem></CrossLanguageItem>
|
||||
<section className={classNames(styles.variableContainer)}>
|
||||
<Row align={'middle'} justify="end">
|
||||
<Col span={9} className={styles.variableAlign}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user