mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
fix: eco knowledge retrieval method (#6798)
This commit is contained in:
parent
0675c5f716
commit
0a744a73b3
|
@ -32,6 +32,7 @@ import { RerankingModeEnum } from '@/models/datasets'
|
|||
import cn from '@/utils/classnames'
|
||||
import { useSelectedDatasetsMode } from '@/app/components/workflow/nodes/knowledge-retrieval/hooks'
|
||||
import Switch from '@/app/components/base/switch'
|
||||
import { useGetLanguage } from '@/context/i18n'
|
||||
|
||||
type Props = {
|
||||
datasetConfigs: DatasetConfigs
|
||||
|
@ -43,6 +44,11 @@ type Props = {
|
|||
selectedDatasets?: DataSet[]
|
||||
}
|
||||
|
||||
const LEGACY_LINK_MAP = {
|
||||
en_US: 'https://docs.dify.ai/guides/knowledge-base/integrate-knowledge-within-application',
|
||||
zh_Hans: 'https://docs.dify.ai/v/zh-hans/guides/knowledge-base/integrate_knowledge_within_application',
|
||||
} as Record<string, string>
|
||||
|
||||
const ConfigContent: FC<Props> = ({
|
||||
datasetConfigs,
|
||||
onChange,
|
||||
|
@ -53,6 +59,7 @@ const ConfigContent: FC<Props> = ({
|
|||
selectedDatasets = [],
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
const language = useGetLanguage()
|
||||
const selectedDatasetsMode = useSelectedDatasetsMode(selectedDatasets)
|
||||
const type = datasetConfigs.retrieval_model
|
||||
const setType = (value: RETRIEVE_TYPE) => {
|
||||
|
@ -167,7 +174,21 @@ const ConfigContent: FC<Props> = ({
|
|||
title={(
|
||||
<div className='flex items-center'>
|
||||
{t('appDebug.datasetConfig.retrieveOneWay.title')}
|
||||
<TooltipPlus popupContent={<div className='w-[320px]'>{t('dataset.nTo1RetrievalLegacy')}</div>}>
|
||||
<TooltipPlus
|
||||
popupContent={(
|
||||
<div className='w-[320px]'>
|
||||
{t('dataset.nTo1RetrievalLegacy')}
|
||||
<a
|
||||
className='underline'
|
||||
href={LEGACY_LINK_MAP[language]}
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
>
|
||||
({t('dataset.nTo1RetrievalLegacyLink')})
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
>
|
||||
<div className='ml-1 flex items-center px-[5px] h-[18px] rounded-[5px] border border-text-accent-secondary system-2xs-medium-uppercase text-text-accent-secondary'>legacy</div>
|
||||
</TooltipPlus>
|
||||
</div>
|
||||
|
|
|
@ -8,7 +8,10 @@ export const useKnowledge = () => {
|
|||
return t(`dataset.indexingTechnique.${indexingTechnique}`)
|
||||
}, [t])
|
||||
|
||||
const formatIndexingMethod = useCallback((indexingMethod: string) => {
|
||||
const formatIndexingMethod = useCallback((indexingMethod: string, isEco?: boolean) => {
|
||||
if (isEco)
|
||||
return t('dataset.indexingMethod.invertedIndex')
|
||||
|
||||
return t(`dataset.indexingMethod.${indexingMethod}`)
|
||||
}, [t])
|
||||
|
||||
|
@ -16,7 +19,7 @@ export const useKnowledge = () => {
|
|||
let result = formatIndexingTechnique(indexingTechnique)
|
||||
|
||||
if (indexingMethod)
|
||||
result += ` · ${formatIndexingMethod(indexingMethod)}`
|
||||
result += ` · ${formatIndexingMethod(indexingMethod, indexingTechnique === 'economy')}`
|
||||
|
||||
return result
|
||||
}, [formatIndexingTechnique, formatIndexingMethod])
|
||||
|
|
|
@ -53,6 +53,7 @@ const translation = {
|
|||
semantic_search: 'VECTOR',
|
||||
full_text_search: 'FULL TEXT',
|
||||
hybrid_search: 'HYBRID',
|
||||
invertedIndex: 'INVERTED',
|
||||
},
|
||||
mixtureHighQualityAndEconomicTip: 'The Rerank model is required for mixture of high quality and economical knowledge bases.',
|
||||
inconsistentEmbeddingModelTip: 'The Rerank model is required if the Embedding models of the selected knowledge bases are inconsistent.',
|
||||
|
@ -67,7 +68,8 @@ const translation = {
|
|||
semantic: 'Semantic',
|
||||
keyword: 'Keyword',
|
||||
},
|
||||
nTo1RetrievalLegacy: 'According to the optimization and upgrade of the retrieval strategy, N-to-1 retrieval will be officially deprecated in September. Until then you can still use it normally.',
|
||||
nTo1RetrievalLegacy: 'N-to-1 retrieval will be officially deprecated from September. It is recommended to use the latest Multi-path retrieval to obtain better results. ',
|
||||
nTo1RetrievalLegacyLink: 'Learn more',
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
|
|
@ -53,6 +53,7 @@ const translation = {
|
|||
semantic_search: '向量检索',
|
||||
full_text_search: '全文检索',
|
||||
hybrid_search: '混合检索',
|
||||
invertedIndex: '倒排索引',
|
||||
},
|
||||
mixtureHighQualityAndEconomicTip: '混合使用高质量和经济型知识库需要配置 Rerank 模型。',
|
||||
inconsistentEmbeddingModelTip: '当所选知识库配置的 Embedding 模型不一致时,需要配置 Rerank 模型。',
|
||||
|
@ -67,7 +68,8 @@ const translation = {
|
|||
semantic: '语义',
|
||||
keyword: '关键词',
|
||||
},
|
||||
nTo1RetrievalLegacy: '为了对检索策略进行优化和升级,N 选 1 检索功能将于九月份正式被优化。在此之前,您仍然可以正常使用该功能。',
|
||||
nTo1RetrievalLegacy: '9 月 1 日起我们将不再提供此能力,推荐使用最新的多路召回获得更好的检索效果。',
|
||||
nTo1RetrievalLegacyLink: '了解更多',
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
|
Loading…
Reference in New Issue
Block a user