|
|
|
|
|
|
|
|
import { IParserConfig } from '@/interfaces/database/document'; |
|
|
import { IParserConfig } from '@/interfaces/database/document'; |
|
|
import { IChangeParserConfigRequestBody } from '@/interfaces/request/document'; |
|
|
import { IChangeParserConfigRequestBody } from '@/interfaces/request/document'; |
|
|
import { AutoKeywordsItem, AutoQuestionsItem } from '../auto-keywords-item'; |
|
|
import { AutoKeywordsItem, AutoQuestionsItem } from '../auto-keywords-item'; |
|
|
|
|
|
import { DatasetConfigurationContainer } from '../dataset-configuration-container'; |
|
|
import Delimiter from '../delimiter'; |
|
|
import Delimiter from '../delimiter'; |
|
|
import EntityTypesItem from '../entity-types-item'; |
|
|
import EntityTypesItem from '../entity-types-item'; |
|
|
import ExcelToHtml from '../excel-to-html'; |
|
|
import ExcelToHtml from '../excel-to-html'; |
|
|
|
|
|
|
|
|
selectedTag === DocumentParserType.Naive || |
|
|
selectedTag === DocumentParserType.Naive || |
|
|
selectedTag === DocumentParserType.KnowledgeGraph; |
|
|
selectedTag === DocumentParserType.KnowledgeGraph; |
|
|
|
|
|
|
|
|
const hideDivider = [showPages, showOne, showMaxTokenNumber].every( |
|
|
|
|
|
(x) => x === false, |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const showEntityTypes = selectedTag === DocumentParserType.KnowledgeGraph; |
|
|
const showEntityTypes = selectedTag === DocumentParserType.KnowledgeGraph; |
|
|
|
|
|
|
|
|
const showExcelToHtml = |
|
|
const showExcelToHtml = |
|
|
|
|
|
|
|
|
/> |
|
|
/> |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
</Space> |
|
|
</Space> |
|
|
{hideDivider || <Divider></Divider>} |
|
|
|
|
|
<Form name="dynamic_form_nest_item" autoComplete="off" form={form}> |
|
|
|
|
|
|
|
|
<Divider></Divider> |
|
|
|
|
|
<Form |
|
|
|
|
|
name="dynamic_form_nest_item" |
|
|
|
|
|
autoComplete="off" |
|
|
|
|
|
form={form} |
|
|
|
|
|
className="space-y-4" |
|
|
|
|
|
> |
|
|
{showPages && ( |
|
|
{showPages && ( |
|
|
<> |
|
|
<> |
|
|
<Space> |
|
|
<Space> |
|
|
|
|
|
|
|
|
</Form.List> |
|
|
</Form.List> |
|
|
</> |
|
|
</> |
|
|
)} |
|
|
)} |
|
|
{showOne && <LayoutRecognize></LayoutRecognize>} |
|
|
|
|
|
|
|
|
|
|
|
{showPages && ( |
|
|
{showPages && ( |
|
|
<Form.Item |
|
|
<Form.Item |
|
|
noStyle |
|
|
noStyle |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
)} |
|
|
)} |
|
|
{showMaxTokenNumber && ( |
|
|
|
|
|
<> |
|
|
|
|
|
<MaxTokenNumber |
|
|
|
|
|
max={ |
|
|
|
|
|
selectedTag === DocumentParserType.KnowledgeGraph |
|
|
|
|
|
? 8192 * 2 |
|
|
|
|
|
: 2048 |
|
|
|
|
|
} |
|
|
|
|
|
></MaxTokenNumber> |
|
|
|
|
|
<Delimiter></Delimiter> |
|
|
|
|
|
</> |
|
|
|
|
|
)} |
|
|
|
|
|
{showAutoKeywords(selectedTag) && ( |
|
|
|
|
|
<> |
|
|
|
|
|
<AutoKeywordsItem></AutoKeywordsItem> |
|
|
|
|
|
<AutoQuestionsItem></AutoQuestionsItem> |
|
|
|
|
|
</> |
|
|
|
|
|
)} |
|
|
|
|
|
{showExcelToHtml && <ExcelToHtml></ExcelToHtml>} |
|
|
|
|
|
|
|
|
<DatasetConfigurationContainer show={showOne || showMaxTokenNumber}> |
|
|
|
|
|
{showOne && <LayoutRecognize></LayoutRecognize>} |
|
|
|
|
|
{showMaxTokenNumber && ( |
|
|
|
|
|
<> |
|
|
|
|
|
<MaxTokenNumber |
|
|
|
|
|
max={ |
|
|
|
|
|
selectedTag === DocumentParserType.KnowledgeGraph |
|
|
|
|
|
? 8192 * 2 |
|
|
|
|
|
: 2048 |
|
|
|
|
|
} |
|
|
|
|
|
></MaxTokenNumber> |
|
|
|
|
|
<Delimiter></Delimiter> |
|
|
|
|
|
</> |
|
|
|
|
|
)} |
|
|
|
|
|
</DatasetConfigurationContainer> |
|
|
|
|
|
<DatasetConfigurationContainer |
|
|
|
|
|
show={showAutoKeywords(selectedTag) || showExcelToHtml} |
|
|
|
|
|
> |
|
|
|
|
|
{showAutoKeywords(selectedTag) && ( |
|
|
|
|
|
<> |
|
|
|
|
|
<AutoKeywordsItem></AutoKeywordsItem> |
|
|
|
|
|
<AutoQuestionsItem></AutoQuestionsItem> |
|
|
|
|
|
</> |
|
|
|
|
|
)} |
|
|
|
|
|
{showExcelToHtml && <ExcelToHtml></ExcelToHtml>} |
|
|
|
|
|
</DatasetConfigurationContainer> |
|
|
{showRaptorParseConfiguration(selectedTag) && ( |
|
|
{showRaptorParseConfiguration(selectedTag) && ( |
|
|
<ParseConfiguration></ParseConfiguration> |
|
|
|
|
|
|
|
|
<DatasetConfigurationContainer> |
|
|
|
|
|
<ParseConfiguration></ParseConfiguration> |
|
|
|
|
|
</DatasetConfigurationContainer> |
|
|
)} |
|
|
)} |
|
|
{showGraphRagItems(selectedTag) && <GraphRagItems></GraphRagItems>} |
|
|
{showGraphRagItems(selectedTag) && <GraphRagItems></GraphRagItems>} |
|
|
{showEntityTypes && <EntityTypesItem></EntityTypesItem>} |
|
|
{showEntityTypes && <EntityTypesItem></EntityTypesItem>} |