fix(kb): 处理excel清洗问题
(cherry picked from commit 1a0ceebc3340848171e2cc14d0a7b04c2dda4748)
This commit is contained in:
1 parent
7736a6991e
commit
87ac58c394
4 files changed
+166
-75
No files matched your search
@@ -25,6 +25,18 @@ class ChunkConfig(BaseModel):
|
||||
add_heading_path_prefix: bool = True
|
||||
|
||||
|
||||
class TableConfig(BaseModel):
|
||||
"""
|
||||
Excel/CSV 表格线性化配置。
|
||||
|
||||
用途:约束进入 Dify 前每段可容纳的完整原始行总字符数。
|
||||
逻辑:table_linearize 在 Excel/CSV 分支读取该值;Dify 同步仍按空行分段,
|
||||
因此本值应低于 Dify 的 max_tokens 能承载的保守字符数。
|
||||
"""
|
||||
|
||||
segment_max_chars: int = 480
|
||||
|
||||
|
||||
class CleanConfig(BaseModel):
|
||||
dedup_min_repeats: int = 3
|
||||
merge_short_line_chars: int = 15
|
||||
@@ -34,6 +46,7 @@ class SystemConfig(BaseModel):
|
||||
router: RouterConfig = Field(default_factory=RouterConfig)
|
||||
ocr: OCRConfig = Field(default_factory=OCRConfig)
|
||||
chunk: ChunkConfig = Field(default_factory=ChunkConfig)
|
||||
table: TableConfig = Field(default_factory=TableConfig)
|
||||
clean: CleanConfig = Field(default_factory=CleanConfig)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in new issue
Block a user