feat(data-process): 优化上传切分流程与PDF高亮预览
This commit is contained in:
@@ -30,9 +30,8 @@ const SMART_PREPROCESS_OPTIONS: UnstructuredPreprocessOption[] = [
|
||||
]
|
||||
|
||||
const CHUNK_METHODS: Array<{ value: ChunkMethod; label: string }> = [
|
||||
{ value: 'semantic', label: '自动语义切分' },
|
||||
{ value: 'heading', label: '按标题和段落' },
|
||||
{ value: 'fixed', label: '按固定长度' },
|
||||
{ value: 'structure', label: '文档结构' },
|
||||
{ value: 'fixed', label: '固定 Token' },
|
||||
{ value: 'custom', label: '自定义分隔符' },
|
||||
]
|
||||
|
||||
@@ -70,9 +69,9 @@ function updateGenerationOptions(value: GenerationControlOptions) {
|
||||
|
||||
function updateSmartPreprocess(value: string | number | boolean) {
|
||||
const enabled = Boolean(value)
|
||||
const remainingOptions = props.options.preprocessOptions.filter(
|
||||
const remainingOptions = Array.from(new Set(props.options.preprocessOptions.filter(
|
||||
(option) => !SMART_PREPROCESS_OPTIONS.includes(option),
|
||||
)
|
||||
)))
|
||||
updateField(
|
||||
'preprocessOptions',
|
||||
enabled ? [...SMART_PREPROCESS_OPTIONS, ...remainingOptions] : remainingOptions,
|
||||
@@ -80,9 +79,11 @@ function updateSmartPreprocess(value: string | number | boolean) {
|
||||
}
|
||||
|
||||
function updateDesensitize(value: string | number | boolean) {
|
||||
const preprocessOptions: UnstructuredPreprocessOption[] = props.options.preprocessOptions.filter(
|
||||
(option) => option !== 'desensitize',
|
||||
)
|
||||
const preprocessOptions: UnstructuredPreprocessOption[] = Array.from(new Set(
|
||||
props.options.preprocessOptions.filter(
|
||||
(option) => option !== 'desensitize',
|
||||
),
|
||||
))
|
||||
if (Boolean(value)) preprocessOptions.push('desensitize')
|
||||
updateField('preprocessOptions', preprocessOptions)
|
||||
}
|
||||
@@ -116,7 +117,7 @@ defineExpose({ revealValidation })
|
||||
<div class="section-title-row">
|
||||
<div>
|
||||
<h3>预处理选项</h3>
|
||||
<p>默认使用推荐策略,只需决定是否需要脱敏</p>
|
||||
<p>默认启用结构感知的推荐策略,只需决定是否需要脱敏</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="preprocess-option-grid">
|
||||
@@ -127,7 +128,7 @@ defineExpose({ revealValidation })
|
||||
/>
|
||||
<span class="preprocess-option-copy">
|
||||
<strong>智能预处理</strong>
|
||||
<small>自动清理、解析、去重及保留上下文</small>
|
||||
<small>清理无效内容、感知文档结构、合并短块、预过滤低质量内容、近重复去重,并通过重叠保护上下文</small>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
@@ -138,7 +139,7 @@ defineExpose({ revealValidation })
|
||||
/>
|
||||
<span class="preprocess-option-copy">
|
||||
<strong>敏感信息脱敏</strong>
|
||||
<small>处理姓名、手机号等隐私信息</small>
|
||||
<small>识别并脱敏姓名、手机号、邮箱和身份证号</small>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
@@ -159,7 +160,7 @@ defineExpose({ revealValidation })
|
||||
<div class="section-title-row">
|
||||
<div>
|
||||
<h3>切分选项</h3>
|
||||
<p>以语义完整为优先,将长文档拆成可独立生成问答的内容块</p>
|
||||
<p>按文档结构、固定 Token 或自定义分隔符拆分长文档</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -178,7 +179,7 @@ defineExpose({ revealValidation })
|
||||
:value="method.value"
|
||||
/>
|
||||
</el-select>
|
||||
<small>推荐使用自动语义切分,在长度限制内优先保留完整句段</small>
|
||||
<small>推荐使用文档结构,按标题、段落和句子边界保留完整内容块</small>
|
||||
</label>
|
||||
|
||||
<label class="config-field">
|
||||
|
||||
Reference in New Issue
Block a user