Document parsing rules
This topic describes how to customize document parsing rules and manage parsing policies.
Overview
Customize parsing rules to match your document's structure. This optimizes the parsing process and improves knowledge base performance.
Customize hierarchical parsing rules
Parsing rules are defined using regular expressions. The following table provides several examples.

Category | Rule | Configuration |
# ## ### #### ##### | ^# .* ^## .* ^### .* ^#### .* ^##### .* |
|
Chapter 1 Section 1 Article 1 | ^Chapter .* ^Section\s+.+ ^Article \S+.* |
|
I. (I) 1. (1) | ^[一二三四五六七八九十]+\、.* ^[\(\(][一二三四五六七八九十]+[\)\)]+.* ^[0-9]+、.* ^[0-9]+).* |
|
1 1.1 1.1.1 1.1.1.1 1.1.1.1.1 | ^[0-9]+[^0-9\、\)\)\%]+ ^[0-9]+\.[0-9]+[^0-9]+ ^[0-9]+\.[0-9]+\.[0-9]+[^0-9]+ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[^0-9]+ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+[^0-9]+ |
|
Customize splitting and merging rules
Split: Content at or above the current heading level is split into separate chunks.
Default: Uses the system's default rules for splitting or merging.
Merge: Content at or below the current heading level is merged into a single chunk.


Manage parsing policies
Log in to the Chatbot console. From your bot's workspace, navigate to Knowledge Base > Document Management.
Click Parsing Policy Management to edit or delete existing parsing policies.
Click Create Parsing Policy to create a new policy. For configuration details, see the parsing settings in the Document Knowledge Management topic.



