The invention belongs to a document generation method, and provides a
document analysis and enhancement generation method and a related device aiming at the technical problem that factual errors or information missing easily occur in generated contents when table contents are designed by an existing
document retrieval enhancement generation technology. The method comprises the following steps: analyzing a document image through a
layout detection model, identifying to obtain different functional regions of the document image, then constructing a document structure tree for representing a spatial and hierarchical relationship between the functional regions, respectively performing fine-grained semantic analysis on each functional region by using a visual
language model, inputting semantic analysis into a large
language model, and constructing a document structure tree for representing the spatial and hierarchical relationship between the functional regions; the corresponding
natural language description is obtained, then the
natural language description is coded into dense vectors, and all the dense vectors are constructed into a vector index
database; according to the method, fine-grained
layout detection, multi-
modal structure understanding and structured
language representation are introduced into a retrieval enhancement
generation process, and an end-to-end analytic framework is formed.