Large language model RAG application method for ship field national standard document knowledge extraction

By constructing a text hierarchy tree of ship design business requirements and custom form processing, combined with the intent-based question-and-answer recognition mechanism of a large language model, the problem of high-precision information retrieval of national ship standard documents was solved, achieving flexible information management and high-accuracy question-and-answer.

CN122019566APending Publication Date: 2026-05-12SHANGHAI WAIGAOQIAO SHIP BUILDING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI WAIGAOQIAO SHIP BUILDING CO LTD
Filing Date
2026-01-20
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing large language models suffer from problems such as low document recognition accuracy, loss of semantic parsing of forms, loss of form and text retrieval information, and rigid business logic when processing national standard documents in the shipbuilding field, making it difficult to meet the professional needs of shipbuilding companies.

Method used

By constructing a text hierarchy tree adapted to the needs of ship design business, combining custom forms and text segmentation processing, a knowledge base is established. Furthermore, by employing prompt word engineering and a large language model, an intent-based question-and-answer recognition mechanism is built to perform multi-route information retrieval and rearrangement, thereby achieving high-precision information retrieval and generation.

Benefits of technology

It fulfills the high-precision question-and-answer requirements in ship design scenarios, improves the accuracy and flexibility of information retrieval, and supports business personnel to customize module weight parameters, adapting to the knowledge management and information retrieval needs in the ship design field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122019566A_ABST
    Figure CN122019566A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a big language model RAG application method for ship field national standard document knowledge extraction, which comprises the following steps of: establishing a knowledge base, classifying and sorting related national standard documents, classifying and independently storing the documents, performing text recognition, combining a user-defined form and performing text segmentation processing, and obtaining a big language model RAG. Constructing a text hierarchy tree matched with a specification document text structure and ship design business requirements; the method comprises the following steps of: performing retrieval enhancement to generate a service flow, constructing an intention question and answer recognition mechanism by combining a cue word project and a large language model, performing multi-routing information recall for intention recognition and task allocation, introducing a comprehensive rearrangement mechanism, and guiding the large model to generate a retrieval reply through the cue word project and a thinking chain technology. According to the embodiment of the invention, national standard knowledge extraction in the ship field is taken as a target, a large language model and an RAG technology are utilized, national standard document knowledge extraction application is realized, and design work of business personnel is supported.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of ship information data analysis and generation technology, and in particular to a method for applying the large language model (RAG) for knowledge extraction from national standard documents in the shipbuilding field. Background Technology

[0002] With the continuous enhancement of semantic understanding, function calling, and context loading window capabilities of large language models, intelligent applications with large language models as their core engine have received widespread attention. Existing implementations include natural language processing tools such as intelligent question-answering systems and voice interaction, as well as AI agents that support auxiliary code generation and automatic tool invocation. It is worth noting that the standard documents in the shipbuilding industry (such as national standards, technical specifications, and design drawings) are highly specialized, complex in format, and dynamically updated. Traditional large language models typically face significant limitations when directly processing such documents. Specifically, general-purpose large language models lack a deep understanding of specific shipbuilding terminology, easily leading to semantic confusion and misunderstandings. From the perspective of knowledge timeliness, the shipbuilding industry standard system exhibits dynamic evolution characteristics. Current general-purpose large language models generally suffer from bottlenecks in the timeliness of training data; in offline operation mode, the models cannot obtain subsequently updated shipbuilding standard documents in real time, resulting in significant knowledge blind spots.

[0003] From a domain-specific perspective, the standards and regulations documents involved in shipbuilding enterprises contain a large number of technical terms, unique business logics, and enterprise-specific standards. The training data for general-purpose large-scale models comes from widely available online content, lacking learning from the shipbuilding enterprises' private, specialized data. This makes it difficult to deeply understand and accurately answer questions involving the design principles of complex ship structures and the details of construction processes for specific ship types. Furthermore, data security and privacy are also key factors hindering the widespread application of general-purpose large-scale models in shipbuilding enterprises. Shipbuilding enterprises' standards and regulations documents often contain sensitive information such as trade secrets and core technical data.

[0004] Given the limitations of general-purpose large language models in processing shipbuilding enterprise standard documents, Retrieval-Augmented Generation (RAG) systems offer new ideas and possibilities for shipbuilding enterprises to overcome information utilization difficulties. These systems integrate external knowledge sources, ensure data security, update knowledge in real time, and deeply understand professional content. RAG technology improves the accuracy and controllability of large language models by combining information retrieval and text generation modules. Its core process includes three stages: retrieval, augmentation, and generation. Existing mature open-source solution platforms include RAGFlow, Dify, and n8n, all of which can realize RAG applications based on text information. However, due to the specialized knowledge and text form structure differences in shipbuilding standard documents, these platforms still have significant room for improvement in fine-grained document information extraction and high-precision document parsing.

[0005] The RAG application primarily encompasses two main business aspects: knowledge base establishment and the development of retrieval enhancement generation workflows. Regarding the establishment of a ship standard document knowledge base, while existing open-source platforms offer good universality, they face significant challenges such as low document recognition accuracy, loss of semantic parsing in forms, and loss of form and text retrieval information. For example, RAGFlow and Dify, when analyzing heterogeneous ship text forms, often encounter issues like missing or corrupted form structures, lost paragraph association information, and disrupted contextual structures due to document context segmentation. In the retrieval enhancement generation stage, the limitations of customizable workflow operations in tools like RAGFlow and Dify make it difficult to directly adapt to the extraction needs of standard document knowledge within the shipbuilding industry, resulting in relatively rigid business logic. Summary of the Invention

[0006] In view of the above-mentioned problems in the prior art, the present invention provides a method for applying the Large Language Model (RAG) to extract knowledge from national standard documents in the shipbuilding field, so as to solve the technical problems in the prior art, such as low document recognition accuracy, loss of form semantic parsing, loss of form and text retrieval information, and relatively rigid business logic.

[0007] This invention provides a method for applying the Large Language Model (RAG) to extract knowledge from national standard documents in the shipbuilding field, comprising the following steps: Step S1: Knowledge base establishment. Relevant national standard documents are classified and organized, and the documents are classified and stored independently. Through text recognition, combined with custom forms and text segmentation processing, a text hierarchy tree that adapts to the writing structure of standard documents and the business needs of ship design is constructed. Step S2: Retrieve and enhance the business flow. Combine prompt word engineering and large language model to build an intent question answering recognition mechanism. Perform multi-route information retrieval for intent recognition and task allocation and introduce a comprehensive reordering mechanism. Through prompt word engineering and mind chain technology, guide the large model to generate retrieval responses. In one embodiment, step S1 includes, Step S11: National standard document format conversion and database resource request establishment; Step S12: PDF text parsing and document content categorization; Step S13: Document content categorization and reprocessing; Step S14: Storing the text as a vector.

[0008] In one embodiment, step S2 includes, Step S21: Identify the intent to inquire about national standard materials; Step S22, multi-channel information recall; Step S23, multi-path information rearrangement; Step S24: Multi-channel information fusion and text generation.

[0009] In one embodiment, in step S11, for each PDF file, three vector database requirements are declared: a text vector database, a form vector database, and an image vector database for the current document. The text vector database, form vector database, and image vector database all use the HNSW indexing method.

[0010] In one embodiment, step S12 includes, Step S121: Standard PDF text parsing requirements are constructed by setting the MinerU processing parameters to adapt to business processing requirements, calling the corresponding functional modules of MinerU, and obtaining the PDF document parsing content that meets the national standard processing requirements. Step S122: Standard PDF text parsing, polling, and decompression are performed to confirm the processing status of the MinerU server and capture the result information in a timely manner.

[0011] In one embodiment, in step S13, the parsed content is further processed to achieve plain text information processing, form information processing, and image information processing.

[0012] In one embodiment, in step S21, Based on the Deepseek large language model and relying on the prompt word project, specific prompt words and case descriptions are formulated, and national standard business scenario constraints are superimposed. By supplementing questions, the problem keywords input by users are extracted to form the input information text of the downstream Chroma vector database and provide the query category and guidance information of the national standard documents.

[0013] In one embodiment, the rearrangement strategy used in step S23 includes a rearrangement strategy based on the BM25 algorithm and a rearrangement strategy based on the BGE-Reranker model.

[0014] In one embodiment, step S24 includes, By editing summary prompts and utilizing the Deepseek large language model, the rearranged results are briefly summarized by text, image, and table categories. The knowledge recall and summary overviews from text, images, and tables were merged separately. Based on the provided prompt word templates, a large language model prompt word is generated, which integrates the strategy formulation and generation stages, including query intent recognition, key judgment conditions, content matching checks, content analysis, form processing, and output format constraints. The large language model generates text based on the above multi-path fusion information and constraint prompts.

[0015] Compared with existing technologies, the beneficial effects of the RAG (Rapid Language Analysis) application method for knowledge extraction from national standard documents in the shipbuilding field provided by this invention are as follows: 1. The business flow is highly customized. In order to meet the high precision and accuracy of question answering requirements of personnel in the ship design scenario, the embodiments of the present invention have carried out customized operations in terms of knowledge base generation and retrieval enhancement of business flow design. This avoids the performance constraints of existing open source or low code platform functional modules. At the same time, business personnel can also make adaptive adjustments to the weight parameters in relevant modules to enhance the applicability of the business flow. 2. Hierarchical management of national standard information in the field of ship design: In the knowledge base establishment stage of this invention, by classifying national standards and classifying and decomposing the content of national standards into text, forms and images, knowledge management in the ship design scenario is realized. Compared with existing open source or low code development platforms, it meets the knowledge extraction needs in the ship design scenario. 3. Business flow information retrieval and recall strategy management: In this embodiment of the invention, information retrieval involves multiple stages such as intent recognition and reordering strategy selection. Each stage supports customized strategy switching and management, which improves the adaptability of the solution in the actual business production environment. At the same time, this embodiment of the invention also supports modular strategy updates. The coupling between functional modules is relatively low. Under the premise of ensuring the input and output structure, it supports the switching of multiple module functions in the business flow, and provides an interface for subsequent upgrades and functional optimizations of related modules. 4. Business presentation based on a low-code platform: This embodiment of the invention is developed based on the Langflow platform. Each function has been encapsulated into a functional module, which supports online construction of business flows on the web page. Compared with the existing fixed RAG strategies and frameworks, it has strong flexibility, and business personnel can customize relevant modules and business flows themselves. Attached Figure Description

[0016] Figure 1 A schematic diagram illustrating the establishment of a national standard text vector database involved in a large language model (RAG) application method for knowledge extraction from national standard documents in the shipbuilding field, provided in an embodiment of the present invention. Figure 2 This invention provides a schematic diagram of the business flow for enhancing the generation of national standard text retrieval in the field of ship design, based on a large language model (RAG) application method for knowledge extraction from national standard documents in the shipbuilding field. Detailed Implementation

[0017] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0018] Various embodiments and features of this application are described herein with reference to the accompanying drawings.

[0019] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.

[0020] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application, which have the features described in the claims and are therefore all within the scope of protection defined herein.

[0021] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.

[0022] Specific embodiments of this application are described below with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to ascertain the true intent based on the user's historical operations, and to avoid unnecessary or redundant details that would obscure this application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in various ways with substantially any suitable detailed structure.

[0023] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.

[0024] The principles and features of the present invention are described below with reference to the accompanying drawings. The embodiments described are for illustrative purposes only and are not intended to limit the scope of the invention. The following description, in conjunction with... Figure 1-2 The preferred embodiments of the present invention will be described in further detail below: This invention relates to key technologies such as text OCR recognition, large language model semantic analysis, natural language processing, and vector database management. It is primarily used for scenarios involving knowledge extraction from national standard documents in the shipbuilding field, question-and-answer reuse, and enhanced information retrieval generation.

[0025] Given the ease of accessing publicly available information, this invention primarily focuses on extracting knowledge from national standards in the shipbuilding field. It utilizes large language models and RAG technology to achieve knowledge extraction and application from national standard documents, supporting the design work of business personnel.

[0026] like Figure 1-2 As shown, this embodiment of the invention provides a method for applying a large language model (RAG) to extract knowledge from national standard documents in the shipbuilding field. It mainly consists of two business components: the establishment of a knowledge base and the formulation of enhanced retrieval and generation business flows. The necessary software configurations include the Langflow development platform for business flow management, a Python 3.12 environment for code development, a Chrome browser for page rendering, a Chroma vector database for information storage and retrieval, Deepseek API keys for calling large model functions, the Ollama model management platform for loading text embedding models, and MinerU API keys for calling text parsing functions.

[0027] I. Knowledge Base Establishment 1. National Standard Document Format Conversion and Database Resource Request Establishment. It should be noted that most publicly available national standard documents are currently in PDF text format. To achieve high-precision and efficient question-and-answer and information extraction, this embodiment of the invention requires the use of the MinerU tool as the information extraction tool for PDF text. MinerU can generate corresponding text Markdown files, form image files, and JSON files containing text and chart position information for each text and chart when parsing the file. Therefore, to construct a database information management module, firstly, for each standard document, the text vector database name is determined based on the file name and its business category. Furthermore, for each PDF file, three vector database requirements are declared: a text vector database, a form vector database, and an image vector database for the current document. The functions and structure design of each vector database are as follows: Text Vector Database: Used to store GB standard text content slices. Database fields include text slice ID, text slice content, vectorized text slice representation, and text slice metadata information; Form Vector Database: Used to store itemized form information fragments in the national standard. The database fields include form item ID, form item content, vectorized form item content, and form item metadata information; Image Vector Database: Used to store text parsing information for images in national standards. Database fields include image entry ID, manually parsed text content of the image, vectorized representation of the parsed text, and image metadata information.

[0028] The above databases use the HNSW (Hierarchical Navigable Small World) indexing method to support near-nearest neighbor retrieval in the business data retrieval process.

[0029] 2. PDF Text Parsing and Document Content Categorization. Existing mature RAG applications have relatively weak document parsing capabilities and lack customization. Therefore, a custom PDF text parsing module is set up to meet the needs of high-precision information extraction. Considering that existing PDF parsing tools such as Marker, Unstructured, and Docling have good adaptability to English text but poor parsing performance for Chinese text, MinerU is selected as the PDF parser in this embodiment of the invention.

[0030] When using a custom PDF text parsing module to parse documents, the following core steps need to be completed: Standard PDF Text Parsing Requirement Construction: This step aims to configure MinerU processing parameters to meet business processing needs, thereby enabling the invocation of MinerU functions and obtaining PDF document parsing content that conforms to national standard processing requirements. First, upload parameters are constructed, including enabling OCR, disabling table recognition, enabling formula recognition, and constructing the filename. Other upload parameters use MinerU system default values. After completing the upload parameter settings, an authorization request is sent to the MinerU server. Once the server status is confirmed, the document is uploaded.

[0031] Standard PDF text parsing polling and decompression: This step primarily confirms the processing status and timely captures results on the MinerU server side. In its implementation, by setting a maximum access attempt and an access interval, the MinerU server-side document processing result status is polled, and an exception handling mechanism is implemented to avoid unnecessary waiting. Once the server completes processing, the processed result is decompressed to a specified path. It should be noted that setting the maximum access attempt and access interval prevents document processing lag and allows business personnel to promptly obtain document processing status. Furthermore, the maximum number of access attempts and the access interval can be manually and dynamically adjusted according to document size and actual business needs.

[0032] After completing the above core processing steps, the parsed text of the standard PDF is as follows: The source document's Markdown text content: This is a Markdown formatted file containing hierarchical chapter headings and content organized in Markdown style, as well as formulas expressed in LaTeX syntax. Furthermore, tables and images in the file use Markdown-style image insertion syntax to function as placeholders within the document. The layout JSON file contains the coordinates and category information of each text, image, and form element in the source document, which helps in the subsequent extraction and processing of the content and position information of forms and images.

[0033] The source document is hierarchically split into JSON files: containing text content, page number information for text and charts, and the storage location of charts, making it easy to quickly locate text and chart content and their position in the source file. It can support the construction of metadata information for text, forms, image vector databases.

[0034] Tables and images in the source document saved as JPG images.

[0035] 3. Document Content Categorization and Reprocessing. In the previous step, a custom PDF text parsing module was used to perform preliminary processing of national standard PDF documents and generate parsed content. To adapt to the question-and-answer requirements in the ship design scenario, the parsed content needs further processing. Therefore, a document content reprocessing module was built, mainly to realize refined processing functions for plain text information processing, form information processing, and image information processing.

[0036] Plain text information processing: Based on the Markdown text content and heading format of the source document, the MarkdownHeaderTextSplitter component in Langchain is developed. By setting the hierarchical key character segmentation and text block size parameters of Markdown syntax style, the goal of splitting the text according to multi-level chapter content is achieved and outputting Langchain Document objects. Then, meta-information such as chapter, sub-chapter and file address is added to the sliced ​​Document text block objects to assist the subsequent information retrieval process.

[0037] Image Information Processing: Due to the significant differences and highly specialized nature of images in ship specifications, coupled with the relatively limited number of images, it is impossible to conduct corresponding model training and fine-tuning. Therefore, a manual method is chosen to interpret the images, and the interpreted content and image metadata (including page number, file location, text name, etc.) are encapsulated using the Document object in the Langchain development framework.

[0038] Form text parsing: Due to the complexity of the form, considering long text forms, heterogeneous forms, and wired and wireless forms, three key operations need to be performed.

[0039] By integrating the TableStructureReRec open-source project, we initialize the WiredTableRecognition (wired table engine), LinelessTableRecognition (wireless table engine), TableCls (table classifier), and RapidOCR (OCR engine). Then, we iterate through all image files in the directory, using the table classifier to classify each image by table type (wired / wireless). Next, we utilize the OCR engine for text recognition and, based on the table type (wired / wireless), call the corresponding engine to parse the table structure. We then input the image path and OCR results, performing enhancement, rotation repair, and other operations. Finally, we generate an HTML file and a visualization image, saving them to the output directory.

[0040] Based on the obtained HTML parsing results of the forms, a custom HTML2JSON conversion function was designed. Using tools such as BeautifulSoup and Pandas, the function reads the HTML content, finds all table elements, creates a table matrix representation for each table, analyzes the table structure and type, extracts data according to the type, and returns JSON data (each entry data and its corresponding header information form a one-to-one correspondence of JSON data entries). Since the tables have been broken down into rows and entries, the data in each row of the form and the header data have been integrated to construct the corresponding structured JSON data.

[0041] We introduced Langchain's textsplitter tool to split form data and integrate metadata based on the JSON text storage format.

[0042] 4. Text Vectorization and Storage. Text vectorization and storage are implemented through the text vectorization management module. It should be noted that this part of the vectorization relies on the bge-m3 model provided by the Ollama platform to embed information. Similar to the three different types of text content mentioned in the previous step, for text content, since hierarchical processing and text block size segmentation have already been implemented in the previous step, in this step, the text content of the text Document object is vectorized, and its metadata is stored in the corresponding text Chroma database. At this point, the vectorization and storage process of the GBK text is completed. For image objects, the processing method is similar to that of text, and they are stored in the corresponding image Chroma database. For tables, since each table has been broken down according to table row entries and metadata integrated in the previous step, the subsequent operations are similar to the text vectorization and storage process.

[0043] The operations and business processes involved in the above steps are as follows: Figure 1 As shown. II. Enhanced Search Generation Business Flow 1. Intent Recognition for National Standard Materials Inquiry. An intent recognition module is constructed based on the Deepseek large language model. Leveraging technologies such as emotional stimulation, self-calibration, and displaying thought chains under the prompt word engineering framework, it extracts user-input keywords through specific prompt words and case descriptions, overlays national standard business scenario constraints, and provides input text to the downstream Chroma vector database by supplementing questions. This text then provides the query category and guidance information for the national standard document. (See Appendix A for a sample prompt word template.) 2. Multi-channel Information Retrieval. The multi-channel information retrieval module injects the national standard document query text obtained in the previous step into the corresponding national standard document database, and simultaneously sends the query input information to the text vector database, form vector database, and image vector database. It then uses a cosine similarity evaluation standard to search for relevant text, form, and image information. It's important to note that, to achieve a balance between search speed, accuracy, and knowledge richness, for a single query, the number of results returned by the text vector database is set to 100 during the database search phase, and the output of the image vector database is set to 10. For form information, due to the possibility of searching for extremely long forms, the output of the form database is determined by a cosine similarity threshold constraint, rather than by specifying the number of outputs. Furthermore, business personnel can dynamically adjust the relevant parameter settings according to business needs.

[0044] 3. Multi-path Information Reordering. In the previous step, retrieval information was obtained from text vector databases, form vector databases, and image vector databases. To further improve the effectiveness of the information and suppress noise in the retrieval information, a multi-path information reordering module is introduced. In this embodiment, the reordering strategy is mainly divided into two categories: a reordering strategy based on the BM25 algorithm and a reordering strategy based on the BGE-Reranker model. Compared with the BGE-Reranker model strategy, the BM25 reordering strategy is faster, consumes fewer system resources, and has relatively lower hardware requirements. However, its drawback is that it ignores information such as text context relationships, making it more suitable for scenarios requiring precise keyword information retrieval. This embodiment introduces two reordering strategies that can be selected individually, or a hybrid reordering can be performed by normalizing the scores of both strategies or by fusing them based on the reciprocal ranking. Business personnel can adjust the relevant weight parameters to adapt to various scenarios. Similar to the previous step, the filtering of text and image information still uses a quantity constraint method to extract the recall information with the highest final reordering scores. Although there is no limit to the number of forms, each item will still be scored to support the text generation of the subsequent large model.

[0045] 4. Multi-path Information Fusion and Text Generation. This step mainly consists of two parts: text information fusion and Deepseek large language model prompt word editing. During text information fusion, summary prompt words are edited, and the Deepseek large language model is used to briefly summarize the rearrangement results from the previous step according to text, image, and table categories. Then, in the large language model prompt word editing stage, the recalled knowledge and summary summaries for text, images, and tables are merged separately to support the large language model's inference process. Regarding the constraint prompt word editing in the large language model's inference process, the provided prompt word template is used to integrate strategies such as query intent recognition, key judgment conditions, content matching checks, content analysis, form processing, and output format constraints to formulate the large language model prompt words for the generation stage. Finally, the large language model generates text based on the above multi-path fused information and constraint prompt words. (See Appendix B for a sample prompt word template.) The operations and business processes involved in the above steps are as follows: Figure 2 As shown.

[0046] Based on the problems described in the background art, this invention proposes corresponding improvements in the establishment of the knowledge base and the formulation of enhanced retrieval and generation business processes. Firstly, regarding the establishment of the knowledge base, this invention solves the document screening and classification problem by classifying and organizing relevant national standard documents and independently storing them in the database. Furthermore, by integrating OCR recognition tools with custom forms and text segmentation tools, it achieves the construction of a hierarchical tree of text and the hierarchical segmentation of professional text, adapting to the writing structure of standardized documents and the business needs of ship design.

[0047] In terms of form processing, it features customized image content conversion, HTML2JSON conversion, information synthesis, and specific conversion character segmentation functions to associate forms with text information, supporting high-precision information retrieval and enhanced text generation.

[0048] In terms of customizing the business flow for enhanced retrieval, to further improve the quality of information retrieval and the accuracy of question answering, an intent question answering recognition mechanism is constructed by combining prompt word engineering and large language models to realize the recognition of query intent and task adaptation. Then, multi-route information retrieval is performed for intent recognition and task allocation, and a comprehensive re-ranking mechanism based on BM25 and BGE Reranker models is introduced. Furthermore, prompt word engineering and mind chain technology are used to guide the large model to generate retrieval responses, empowering business personnel to retrieve knowledge.

[0049] It should be noted that in the knowledge base establishment of this embodiment of the invention, since multimodal vectorized embedding technology is still in the experimental stage in the industry, the image information in standard text is manually interpreted and annotated in this embodiment of the invention. Text and form information in standard documents are embedded using existing open-source text parsing tools and custom parsing Python code.

[0050] Appendix A You are a professional vector database retrieval intent recognizer. Your task is to analyze users' natural language queries, understand their core intent, and then generate an optimized text retrieval statement specifically for ChromaDB's vector similarity search.

[0051] Please follow these guidelines: 1. Carefully analyze user queries to identify core topics and key concepts. 2. Extract keywords and phrases that best express the user's intent. 3. Remove stop words, conjunctions, and unnecessary modifiers. 4. Retain the full form of technical terms and entity names. 5. If the original query contains multiple aspects or concepts, ensure that all of them are reflected in the search query. 6. For vague or incomplete queries, enhance search results by adding relevant terms. 7. Retain all numerical data and specifications, as these are often key information for queries. 8. All numerical values ​​and their units (such as 10m², 20mm, etc.) must be fully retained; do not omit any numbers. 9. For technical specification inquiries, ensure that all parameter values ​​and standards are identified and retained. 10. The original query language must be maintained. Special note: Numbers are the core information in technical queries, and no numerical value, no matter how small, should be omitted. - Combinations of units and numbers (such as m², mm, etc.) should be retained as a whole. - When a query involves multiple numeric parameters (such as "area 10m²" and "wall thickness 10 and 20"), you must ensure that all of these values ​​appear in the search statement. Your output should be a single, optimized text string that: - Concise and clear, directly expressing the core intent of the query. - Includes all relevant keywords, concepts, and values - Arrange keywords according to semantic importance - Does not contain any JSON formatting, tags, or other markup. - This does not contain any explanation or analysis; it only provides the search query itself. Remember: ChromaDB will use this text for vector similarity search, so your output should maximize the likelihood of a semantic match.

[0052] Appendix B # Intelligent Retrieval and Data Extraction System ## System Tasks Based on the user's query "{question}", the system intelligently identifies the query intent, extracts relevant information from the search results, and presents it in the most suitable format, with special optimization for the processing and display of table data.

[0053] ## Input Data - User query: {question} - Search results: {context} ## Query Intent Identification The system should first determine the type of user query: 1. Comprehensive Information Inquiry: Users require comprehensive information and background explanations. 2. Precise data query: Users only need specific table data, without additional explanation. 3. Mixed Queries: Users require specific data and its related context. ## Key Judgment Conditions 1. Content relevance assessment: - First, assess whether the search results contain content relevant to the query. - Calculate a relevance score for each search result. - Set minimum correlation threshold: 0.6 (can be adjusted according to actual needs) - If the relevance scores of all search results are below the threshold, a message indicating that no relevant content was found will be returned. - If {context} is empty or does not contain any actual content, a message indicating that no relevant content was found is returned. ## Execution Process 1. Content matching check: - Perform a relevance assessment on each result in {context}. - If no relevant content is found (score < 0.6), output the standard "No relevant content found" message. - If relevant content is found, continue with the subsequent processing procedure. 2. Content Analysis: - Identify table structures and non-table content in search results - Determine the best response format (full explanation, plain tabular data, or a combination thereof). 3. Table Processing Special Topic: - Actively recognize HTML table tags (` `, ` `, ` `, ` `) - Detect keywords such as tables, data, parameters, and metrics in user queries. - Extract the table name and complete HTML tag content. - Preserve the original table structure, format, and all data. - Convert to Markdown format, maintaining alignment and complete layout. 4. Output Generation: - For comprehensive information queries: Provides an overview and complete answers to the Top-3 related content. - For precise data queries: Only provide tabular data that matches the keywords, without any explanation. - For mixed queries: Provide the necessary context and complete table data. ## Output Format Specifications ### Comprehensive Information Mode 1. Overview of Top-3 related content: - Score: [Relevance Score] - File source: [file_path] - Content Preview: [Content Summary] 2. Table information (if any): - Complete conversion to Markdown table - The data source is indicated below the table (using a hyperlink to file_path). 3. Supplementary Explanation and Comprehensive Answer ### Precise Data Pattern 1. Pure table output: - Only provide table rows / columns directly related to the query keywords. - Use Markdown table format - Retain the complete structure and all columns of the original table. - No explanation, background, or summary added. ### Blended Mode 1. Brief Relevant Background 2. Complete table data display 3. Minimal necessary explanation ## Handling No Matching Content When the system does not find content related to the user's query "{question}" in {context}: - The system returns a concise and clear message: "Sorry, no results were found in the database that match your query. Please try using different keywords or a more specific description of your problem." - No speculative or approximate alternative answers are provided. - Do not fabricate or construct information that does not exist in the search results. - Do not force the output of content that may be relevant but is actually irrelevant. ## Quality Control Guidelines 1. Data accuracy: - The table must be 100% identical to the original document. - Prevent the generation of data that does not exist in the search results. - Disallow merging tabular data from different sources. 2. Response adaptability: - Automatically adjusts the depth and format of the answer based on the question type. - Only table data is returned when performing precise data queries. - Provides complete context and explanation when querying full information. 3. Completeness of results: - Ensure the table is extracted completely, without truncation or omission. - If there are multiple related tables, they should be displayed separately and each should be labeled with its source. - When data is insufficient, clearly state the limitations. ## Strictly Prohibited 1. Add any explanation or background in precise data mode. 2. Modify, reorganize, or merge original table data. 3. Add content that does not exist in the search results. 4. Omit any relevant columns when extracting table data. 5. Forcefully generate speculative or irrelevant answers when no matching content is found.

[0054] The above embodiments are merely exemplary embodiments of the present invention and are not intended to limit the present invention. The scope of protection of the present invention is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to the present invention within its spirit and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of the present invention.

Claims

1. A method for extracting knowledge from national standard documents in the shipbuilding field using the Large Language Model (RAG), characterized in that... Includes the following steps: Step S1: Knowledge base establishment. Relevant national standard documents are classified and organized, and the documents are classified and stored independently. Through text recognition, combined with custom forms and text segmentation processing, a text hierarchy tree that adapts to the writing structure of standard documents and the business needs of ship design is constructed. Step S2: Retrieve and enhance the business flow. Combine prompt word engineering and large language model to build an intent question answering recognition mechanism. Perform multi-route information retrieval for intent recognition and task allocation and introduce a comprehensive reordering mechanism. Through prompt word engineering and mind chain technology, guide the large model to generate retrieval responses.

2. The method for applying the Large Language Model (RAG) for knowledge extraction from national standard documents in the shipbuilding field according to claim 1, characterized in that: Step S1 includes, Step S11: National standard document format conversion and database resource request establishment; Step S12: PDF text parsing and document content categorization; Step S13: Document content categorization and reprocessing; Step S14: Storing the text as a vector.

3. The method for applying the Large Language Model (RAG) to extract knowledge from national standard documents in the shipbuilding field according to claim 1, characterized in that: Step S2 includes, Step S21: Identify the intent to inquire about national standard materials; Step S22, multi-channel information recall; Step S23, multi-path information rearrangement; Step S24: Multi-channel information fusion and text generation.

4. The method for applying the Large Language Model (RAG) for knowledge extraction from national standard documents in the shipbuilding field according to claim 2, characterized in that: In step S11, for each PDF file, three vector database requirements are declared: a text vector database, a form vector database, and an image vector database for the current document. All three databases use the HNSW indexing method.

5. The method for applying the Large Language Model (RAG) for knowledge extraction from national standard documents in the shipbuilding field according to claim 2, characterized in that: Step S12 includes, Step S121: Standard PDF text parsing requirements are constructed by setting the MinerU processing parameters to adapt to business processing requirements, calling the corresponding functional modules of MinerU, and obtaining the PDF document parsing content that meets the national standard processing requirements. Step S122: Standard PDF text parsing, polling, and decompression are performed to confirm the processing status of the MinerU server and capture the result information in a timely manner.

6. The method for applying the Large Language Model (RAG) for knowledge extraction from national standard documents in the shipbuilding field according to claim 4, characterized in that: In step S13, the parsed content is further processed to achieve plain text information processing, form information processing, and image information processing.

7. The method for extracting knowledge from national standard documents in the shipbuilding field using the RAG (Rapid Language Analysis) model, as described in claim 3, is characterized in that: In step S21, Based on the Deepseek large language model and relying on the prompt word project, specific prompt words and case descriptions are formulated, and national standard business scenario constraints are superimposed. By supplementing questions, the problem keywords input by users are extracted to form the input information text of the downstream Chroma vector database and provide the query category and guidance information of the national standard documents.

8. The method for applying the Large Language Model (RAG) to extract knowledge from national standard documents in the shipbuilding field according to claim 7, characterized in that: The rearrangement strategies used in step S23 include rearrangement strategies based on the BM25 algorithm and rearrangement strategies based on the BGE-Reranker model.

9. The method for applying the Large Language Model (RAG) to extract knowledge from national standard documents in the shipbuilding field according to claim 8, characterized in that: Step S24 includes, By editing summary prompts and utilizing the Deepseek large language model, the rearranged results are briefly summarized by text, image, and table categories. The knowledge recall and summary overviews from text, images, and tables were merged separately. Based on the provided prompt word templates, a large language model prompt word is generated, which integrates the strategy formulation and generation stages, including query intent recognition, key judgment conditions, content matching checks, content analysis, form processing, and output format constraints. The large language model generates text based on the above multi-path fusion information and constraint prompts.