feat: Added explanation on the parsing method of knowledge graph #1594 (#1916)

### What problem does this PR solve?

feat: Added explanation on the parsing method of knowledge graph #1594

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-08-12 18:56:01 +08:00
committed by GitHub
parent 936d8ab7dd
commit eb8feaf20a
9 changed files with 226 additions and 7 deletions

View File

@ -3,6 +3,7 @@ import { useTranslate } from '@/hooks/common-hooks';
import { useSelectParserList } from '@/hooks/user-setting-hooks';
import { Col, Divider, Empty, Row, Typography } from 'antd';
import DOMPurify from 'dompurify';
import camelCase from 'lodash/camelCase';
import { useMemo } from 'react';
import styles from './index.less';
import { ImageMap } from './utils';
@ -18,7 +19,7 @@ const CategoryPanel = ({ chunkMethod }: { chunkMethod: string }) => {
if (item) {
return {
title: item.label,
description: t(item.value),
description: t(camelCase(item.value)),
};
}
return { title: '', description: '' };

View File

@ -37,6 +37,9 @@ export const useSubmitKnowledgeConfiguration = (form: FormInstance) => {
};
};
// The value that does not need to be displayed in the analysis method Select
const HiddenFields = ['email', 'picture', 'audio'];
export const useFetchKnowledgeConfigurationOnMount = (form: FormInstance) => {
const parserList = useSelectParserList();
const allOptions = useSelectLlmOptionsByModelType();
@ -62,7 +65,9 @@ export const useFetchKnowledgeConfigurationOnMount = (form: FormInstance) => {
}, [form, knowledgeDetails]);
return {
parserList,
parserList: parserList.filter(
(x) => !HiddenFields.some((y) => y === x.value),
),
embeddingModelOptions: allOptions[LlmModelType.Embedding],
disabled: knowledgeDetails.chunk_num > 0,
};

View File

@ -15,6 +15,7 @@ export const ImageMap = {
resume: getImageName('resume', 2),
table: getImageName('table', 2),
one: getImageName('one', 2),
knowledge_graph: getImageName('knowledge-graph', 2),
};
export const TextMap = {