Przeglądaj źródła

feat: Configurable for excel, html table or row based text #2516 (#2538)

### What problem does this PR solve?

feat: Configurable for excel, html table or row based text #2516

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
tags/v0.12.0
balibabu 1 rok temu
rodzic
commit
dd019e7ba1
No account linked to committer's email address

+ 5
- 0
web/src/components/chunk-method-modal/index.tsx Wyświetl plik

import { useTranslate } from '@/hooks/common-hooks'; import { useTranslate } from '@/hooks/common-hooks';
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 LayoutRecognize from '../layout-recognize'; import LayoutRecognize from '../layout-recognize';
import ParseConfiguration, { import ParseConfiguration, {
showRaptorParseConfiguration, showRaptorParseConfiguration,


const showEntityTypes = selectedTag === 'knowledge_graph'; const showEntityTypes = selectedTag === 'knowledge_graph';


const showExcelToHtml =
selectedTag === 'naive' && documentExtension === 'xlsx';

const afterClose = () => { const afterClose = () => {
form.resetFields(); form.resetFields();
}; };
<Delimiter></Delimiter> <Delimiter></Delimiter>
</> </>
)} )}
{showExcelToHtml && <ExcelToHtml></ExcelToHtml>}
{showRaptorParseConfiguration(selectedTag) && ( {showRaptorParseConfiguration(selectedTag) && (
<ParseConfiguration></ParseConfiguration> <ParseConfiguration></ParseConfiguration>
)} )}

+ 19
- 0
web/src/components/excel-to-html.tsx Wyświetl plik

import { useTranslate } from '@/hooks/common-hooks';
import { Form, Switch } from 'antd';

const ExcelToHtml = () => {
const { t } = useTranslate('knowledgeDetails');
return (
<Form.Item
name={['parser_config', 'html4excel']}
label={t('html4excel')}
initialValue={false}
valuePropName="checked"
tooltip={t('html4excelTip')}
>
<Switch />
</Form.Item>
);
};

export default ExcelToHtml;

+ 2
- 0
web/src/locales/en.ts Wyświetl plik

topK: 'Top-K', topK: 'Top-K',
topKTip: `K chunks will be fed into rerank models.`, topKTip: `K chunks will be fed into rerank models.`,
delimiter: `Delimiter`, delimiter: `Delimiter`,
html4excel: 'Excel to HTML',
html4excelTip: `Excel will be parsed into HTML table or not. If it's FALSE, every row in Excel will be formed as a chunk.`,
}, },
knowledgeConfiguration: { knowledgeConfiguration: {
titleDescription: titleDescription:

+ 2
- 0
web/src/locales/zh-traditional.ts Wyświetl plik

topK: 'Top-K', topK: 'Top-K',
topKTip: `K塊將被送入Rerank型號。`, topKTip: `K塊將被送入Rerank型號。`,
delimiter: `分段標識符`, delimiter: `分段標識符`,
html4excel: '表格轉HTML',
html4excelTip: `Excel 是否會被解析為 HTML 表格。如果為 FALSE,Excel 中的每一行都會形成一個區塊。`,
}, },
knowledgeConfiguration: { knowledgeConfiguration: {
titleDescription: '在這裡更新您的知識庫詳細信息,尤其是解析方法。', titleDescription: '在這裡更新您的知識庫詳細信息,尤其是解析方法。',

+ 2
- 0
web/src/locales/zh.ts Wyświetl plik

topK: 'Top-K', topK: 'Top-K',
topKTip: `K块将被送入Rerank型号。`, topKTip: `K块将被送入Rerank型号。`,
delimiter: `分段标识符`, delimiter: `分段标识符`,
html4excel: '表格转HTML',
html4excelTip: `Excel 是否将被解析为 HTML 表。如果为 FALSE,Excel 中的每一行都将形成一个块。`,
}, },
knowledgeConfiguration: { knowledgeConfiguration: {
titleDescription: '在这里更新您的知识库详细信息,尤其是解析方法。', titleDescription: '在这里更新您的知识库详细信息,尤其是解析方法。',

+ 2
- 0
web/src/pages/add-knowledge/components/knowledge-setting/configuration.tsx Wyświetl plik

import Delimiter from '@/components/delimiter'; import Delimiter from '@/components/delimiter';
import EntityTypesItem from '@/components/entity-types-item'; import EntityTypesItem from '@/components/entity-types-item';
import ExcelToHtml from '@/components/excel-to-html';
import LayoutRecognize from '@/components/layout-recognize'; import LayoutRecognize from '@/components/layout-recognize';
import MaxTokenNumber from '@/components/max-token-number'; import MaxTokenNumber from '@/components/max-token-number';
import ParseConfiguration, { import ParseConfiguration, {
<MaxTokenNumber></MaxTokenNumber> <MaxTokenNumber></MaxTokenNumber>
<Delimiter></Delimiter> <Delimiter></Delimiter>
<LayoutRecognize></LayoutRecognize> <LayoutRecognize></LayoutRecognize>
<ExcelToHtml></ExcelToHtml>
</> </>
)} )}
{showRaptorParseConfiguration(parserId) && ( {showRaptorParseConfiguration(parserId) && (

Ładowanie…
Anuluj
Zapisz