This invention relates to the field of
natural language processing technology, specifically to an intelligent template generation method based on dual-document comparison. The method includes: receiving a benchmark and comparison document, performing
parsing and matching, and outputting a benchmark model tree, difference features, spatial coordinates, and offset matrix; constructing a text
dependency graph by performing topological mapping combined with lexical boundaries, and extracting and concatenating a multi-dimensional joint
tensor; inputting the
tensor into a
semantic network to generate and verify labels, and fusion the multi-dimensional output mapping
data structure;
parsing the structure to extract logical placeholders, replacing the difference nodes of the benchmark tree according to coordinates to generate a constraint tree, and finally serializing and outputting a
structured document template. This invention constructs a closed-loop end-to-
end system from low-level physical offset extraction, mid-level topological semantic calibration to high-level template
serialization output, improving the
system stability and data flow consistency during automated
processing of complex typed documents.