The invention belongs to the technical field of electric
digital data processing, and particularly relates to a method for analyzing a table in a pdf document under an RAG scene, which comprises the following steps of: analyzing the pdf document, extracting the table in the pdf document page by page, storing the table as an Excel file and positioning information, converting the Excel file into a Markdown format table, and storing the Markdown format table into a
server; the content of a Markdown format table is summarized through a large
language model, a descriptive text is generated, context of the table is extracted through generated descriptive text positioning information and stored as a relevance text, and the extracted context information is combined with the descriptive text to generate a summarized text. According to the method, the descriptive text, the relevance text and the summary text are subjected to vectorization
processing to generate a vectorized file, the vectorized file is stored in a vector
database, the Markdown format table and the generated vectorized file are subjected to associative storage, complex PDF analysis can be processed only through the combination of the large
language model and the Markdown format table, the deployment cost is low, and meanwhile, the method is easy to implement. The information generated by retrieval is more accurate, and the displayed content is more intuitive.