fix: #209 after saving the knowledge base configuration, jump to the dataset page (#212)

### What problem does this PR solve?
fix: #209 after saving the knowledge base configuration, jump to the
dataset page
feat: translate ConfigurationForm
feat: translate KnowledgeTesting
feat: translate document list page
feat: translate knowledge list page

Issue link: #209

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-04-03 11:21:54 +08:00
committed by GitHub
parent 392e515c3f
commit 9b9b6d5408
19 changed files with 299 additions and 196 deletions

View File

@@ -1,3 +1,4 @@
import { useTranslate } from '@/hooks/commonHooks';
import { Form, Slider } from 'antd';
type FieldType = {
@@ -10,27 +11,23 @@ interface IProps {
}
const SimilaritySlider = ({ isTooltipShown = false }: IProps) => {
const { t } = useTranslate('knowledgeDetails');
return (
<>
<Form.Item<FieldType>
label="Similarity threshold"
label={t('similarityThreshold')}
name={'similarity_threshold'}
tooltip={isTooltipShown && `We use hybrid similarity score to evaluate distance between two lines of text.
It\'s weighted keywords similarity and vector cosine similarity.
If the similarity between query and chunk is less than this threshold, the chunk will be filtered out.`
}
tooltip={isTooltipShown && t('similarityThresholdTip')}
initialValue={0.2}
>
<Slider max={1} step={0.01} />
</Form.Item>
<Form.Item<FieldType>
label="Vector similarity weight"
label={t('vectorSimilarityWeight')}
name={'vector_similarity_weight'}
initialValue={0.3}
tooltip={isTooltipShown && `We use hybrid similarity score to evaluate distance between two lines of text.
It\'s weighted keywords similarity and vector cosine similarity.
The sum of both weights is 1.0.
`}
tooltip={isTooltipShown && t('vectorSimilarityWeightTip')}
>
<Slider max={1} step={0.01} />
</Form.Item>