Knowledge retrieval and question-answering method and system based on metadata enhancement and query intention expansion in industrial intelligence field
By using metadata enhancement and query intent expansion methods, the accuracy and adaptability issues of industrial knowledge retrieval and question answering in complex scenarios are solved, enabling efficient and reliable utilization of knowledge data and question answer generation, supporting direct application in industrial settings.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies struggle to effectively extract the value of knowledge data in industrial scenarios. They suffer from issues such as data parsing being unsuitable for complex industrial environments, knowledge base construction failing to fully consider industrial logic characteristics, query comprehension lacking contextual capabilities, retrieval matching unable to predict user intent, and question-and-answer generation lacking adaptability, resulting in insufficient retrieval accuracy and question-and-answer adaptability.
We employ a method based on metadata enhancement and query intent expansion, using a unified parsing tool to process multiple types of data, construct semantically complete text blocks, generate a hybrid index structure, combine industrial entity weights and multi-dimensional field-aware algorithms for retrieval, utilize a large language model to generate traceable question-and-answer results, and continuously improve through a feedback optimization mechanism.
It significantly improves the accuracy and comprehensiveness of industrial knowledge retrieval, bridges the semantic gap between professional documents and user queries, enhances the structured utilization of knowledge data and the reliability and feasibility of question answering, and has self-optimization capabilities.
Smart Images

Figure CN121880518A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial intelligence and artificial intelligence technology, and relates to a knowledge retrieval and question answering method and system based on metadata enhancement and query intent expansion in the field of industrial intelligence. Background Technology
[0002] With the deep integration of Industry 4.0 and Industrial Intelligence technologies, industrial enterprises have accumulated massive amounts of diverse knowledge data, including structured production process parameters and equipment operation logs, as well as unstructured equipment maintenance manuals, process procedure documents, and industrial scene images. This data is a crucial resource supporting improved production efficiency and ensured equipment reliability. However, in practical applications, existing knowledge retrieval and question-answering technologies struggle to effectively extract the value of industrial data and meet the stringent requirements of complex industrial scenarios. Specifically, existing technologies have the following limitations: In terms of data parsing, general data processing solutions cannot adapt to the specific characteristics of complex industrial scenarios. Key content in industrial documents, such as technical parameter tables and equipment fault diagrams, often suffers from information loss or formatting errors during parsing, resulting in low utilization of knowledge resources. Simultaneously, industrial images lack contextual semantic understanding capabilities, making it difficult to automatically extract valuable equipment status and fault characteristic information.
[0003] In terms of knowledge base construction, existing technologies fail to fully consider the logical characteristics of industrial technologies. General text segmentation methods often rely on fixed lengths or simple punctuation marks for segmentation, which can easily disrupt the continuity of process steps and the completeness of troubleshooting. Furthermore, metadata information such as document titles and chapters is not deeply integrated with the text content and is only used as auxiliary filtering conditions, resulting in poor retrieval performance in knowledge association scenarios across chapters and documents.
[0004] In terms of query comprehension, the differences in professional expressions in industrial scenarios pose significant obstacles. Query queries from field engineers often contain colloquial features such as omission of terminology and ambiguous referents. General query rewriting techniques lack the ability to understand industrial contexts, making it difficult to generate semantically complete and technically compliant query statements, thus affecting the accuracy of subsequent searches.
[0005] In terms of retrieval and matching, existing systems lack a mechanism to predict users' potential query intentions. There are significant differences between the professional content representations in industrial knowledge bases and the actual query methods used by field engineers. Existing technologies rely solely on direct semantic matching between queries and text blocks, failing to expand knowledge representations through pre-generating diverse query questions, thus hindering the effective retrieval of relevant knowledge.
[0006] In terms of retrieval strategies, a single retrieval method cannot simultaneously achieve precise matching of industrial terms and deep association with technical semantics. Existing hybrid retrieval solutions do not optimize weight allocation for the characteristics of industrial terms, and the fusion ranking parameters are not adapted to the characteristics of industrial scenarios. In particular, they lack a differentiated weighting mechanism for the original content of text blocks and preset questions, making it impossible to achieve a balance between precise matching and semantic understanding.
[0007] In terms of question-and-answer generation, the answers generated by the general-purpose large language model lack adaptability to industrial scenarios. Technical details such as parameter ranges and operating procedures are often not clear enough, and there is a lack of traceable referencing mechanisms, making it difficult to directly apply the generated content to the production site, thus reducing the trust and willingness of industrial users to use it.
[0008] Therefore, there is an urgent need for an intelligent knowledge retrieval and question-answering solution specifically designed for complex industrial scenarios. This solution should systematically address the shortcomings of existing technologies through scenario-based data parsing, semantically enhanced knowledge base construction, precise hybrid retrieval, and traceable question-answer generation. Summary of the Invention
[0009] In view of this, the purpose of this invention is to provide a knowledge retrieval and question answering method and system based on metadata enhancement and query intent expansion in the field of industrial intelligence.
[0010] To achieve the above objectives, the present invention provides the following technical solution: A knowledge retrieval and question answering method in the field of industrial intelligence based on metadata enhancement and query intent expansion, the method comprising the following steps: S1: Acquire structured and unstructured data in the field of industrial intelligence, convert the data into a structured format through a unified parsing tool, and perform post-processing operations including: preserving the hierarchical relationship of structured data and generating a summary, extracting document directory information and adding chapter information to text blocks, intelligently splicing text blocks that are broken across pages, generating a summary of image data containing equipment status and fault characteristics, and converting the format of table data and generating a semantic summary. S2: Perform block segmentation on the processed text data: Generate semantically complete text blocks using an industrial semantic block segmentation method based on semantic consistency; Construct a set of preset questions associated with each text block through large language model generation and expert feedback injection; Append document metadata to the front of the text blocks to construct a hybrid index structure containing sparse text index and multidimensional feature vector index; Store the text block content, metadata, and corresponding text block vectors and the set of preset question vectors into a distributed full-text search engine to complete the construction of a dedicated knowledge base for the industrial intelligence field. S3: Obtain user queries from multi-turn dialogues, rewrite queries based on industrial domain prompts, and generate semantically complete query statements; S4: Perform hybrid retrieval on the rewritten query: Based on the hybrid index structure built in step S2, perform full-text retrieval and vector retrieval in parallel, and merge, sort and reorder the two retrieval results to output a preset number of highly relevant text blocks; S5: Input the highly relevant text blocks into the large language model, and generate traceable question-and-answer results that conform to industry professional standards by controlling the generation quality through structured prompting engineering.
[0011] Furthermore, in S1, the unified parsing tool is a multi-format document intelligent parsing tool; The intelligent splicing rule is that when a text block does not end with a preset Chinese or English ending punctuation mark, it is merged with the next text block; The image summary generation, combined with image title information, is achieved using a large visual model. The table data processing includes converting HTML format to JSON format while preserving the row and column structure, then converting it to structured text format, and finally generating a table summary using a large language model.
[0012] Furthermore, in S2, the industrial semantic segmentation method is as follows: The text is decomposed into independent technical sentences according to the semantic rules of the industrial field. Each sentence is converted into a vector representation through a semantic vector embedding model. The cosine similarity between adjacent sentences is calculated. A threshold is set based on the interquartile range method. When the similarity is lower than the threshold, it is determined to be the semantic block boundary.
[0013] Furthermore, the threshold setting is achieved through the following formula: set up Let be the set of cosine similarities of all adjacent sentence pairs in the text, where Indicates the first i The sentence and the first i Cosine similarity of +1 sentence n The total number of sentences in the text; Calculate the first quartile and the third and fourth quartiles : Q 1 = 25th percentile (S); Q 3 = 75th percentile (S); Calculate the interquartile range: ; Set semantic segmentation threshold: ; When the cosine similarity of adjacent sentences When this occurs, the location is determined as the semantic block boundary.
[0014] Furthermore, in S2, the preset question set is composed of synthetic questions generated by a large language model and real query questions injected based on retrieval feedback; the text block format is structured text containing metadata fields and content fields, and its structure includes at least document identification information, industry chapter level information, technical topic information, and text block body content.
[0015] Furthermore, in step S4, the full-text retrieval employs a relevance scoring algorithm based on industrial entity weights and multi-dimensional field perception, the calculation formula of which is:
[0016] in, Q For query statements, D For document; n This is the number of terms in the query; For document length, The average length of all documents; and b To adjust the parameters; N This represents the total number of documents in the knowledge base. For included terms The number of documents, To prevent the smoothing constant from having a denominator of zero; The weighted word frequency, which incorporates industrial feature weights, is calculated using the following formula:
[0017] in and These represent the number of times a term appears in the metadata field and the text field, respectively. and For the corresponding field-aware weights and , This refers to the dynamic weighting coefficient for industrial entities, which is applied when a term matches a pre-defined industrial terminology database. Use the gain value; otherwise, use the reference value.
[0018] Furthermore, the vector retrieval in step S4 employs a dual-view semantic collaborative perception algorithm to calculate a comprehensive similarity score, the formula of which is:
[0019] Where SIM_block represents the cosine similarity between the query and the text block content, calculated using the following formula:
[0020] SIM_query is the maximum cosine similarity between the query and a preset set of questions, calculated using the following formula:
[0021] Q For query vector, C For text block vectors, For the first i A pre-defined problem vector, n The preset number of questions;
[0022] Where A and B are two vectors. For dot product, and α and β are the L2 norms of vectors A and B, respectively; α is the text block content weight, β is the preset question weight, and α+β=1, γ is the adaptive threshold coefficient.
[0023] Furthermore, in step S4, the fusion sorting adopts the Reciprocal Rank Fusion (RRF) algorithm, and its calculation formula is as follows:
[0024] in, d For document, D For a collection of documents, For document d Rank position in search results k This is the smoothing constant.
[0025] A knowledge retrieval and question answering system for the industrial intelligence field based on the aforementioned method, which is based on metadata enhancement and query intent expansion, includes: The data parsing module is used to perform step S1. The knowledge base construction module is used to execute step S2. The query rewrite module is used to execute the S3 step described above; A hybrid retrieval module is used to perform step S4. The question-and-answer generation module is used to execute the S5 step described above; The feedback optimization module is used to collect real user queries that failed to retrieve data, establish a mapping relationship between the real queries and the correct target text blocks, and inject the real queries as preset questions into the knowledge base construction module to trigger dynamic updates of the hybrid index structure.
[0026] A computer storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described therein.
[0027] The beneficial effects of this invention are as follows: (1) Significantly improves the accuracy and comprehensiveness of knowledge retrieval in complex industrial scenarios. By introducing a relevance scoring algorithm based on industrial entity weights and metadata enhancement technology, the system can effectively identify and weight key industrial terms and technical parameters, ensuring that core technical knowledge can be accurately located and recalled in long texts.
[0028] (2) It effectively bridges the semantic gap between professional document descriptions and users' colloquial queries. By utilizing a pre-generated set of preset questions and a dual-perspective semantic collaborative perception algorithm, the system can not only match the document text but also understand the user's potential query intent, thereby enabling accurate responses to non-standard questions from on-site engineers.
[0029] (3) Significantly enhanced the structured utilization and semantic integrity of industrial knowledge data. The dynamic segmentation method based on semantic consistency avoids the semantic fragmentation problem caused by traditional mechanical segmentation. At the same time, by deeply integrating metadata information, the structured value of industrial documents is fully explored, and the logical relevance of knowledge units is improved.
[0030] (4) It achieves high reliability, applicability and traceability of question-and-answer results. By strictly constraining the generation behavior of the large language model through structured prompting engineering, it ensures that the answers are strictly based on the retrieved knowledge and the source is clearly marked, effectively suppressing the illusion phenomenon. At the same time, it supports the structured restoration of tabular data, so that the generated content can be directly applied to production and operation and maintenance decisions.
[0031] (5) It has continuous self-optimization and self-adaptation capabilities. Through the feedback optimization mechanism, the system can automatically collect failed retrieval cases and transform them into new preset questions to inject into the knowledge base, so as to realize continuous learning and evolution of long-tail difficult questions and continuously improve the practical coverage and robustness of the system.
[0032] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0033] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein: Figure 1 This is a flowchart illustrating a knowledge retrieval and question-answering construction method based on metadata enhancement and query intent expansion in the field of industrial intelligence, as described in this application. Figure 2 This is a technical architecture diagram of an embodiment of the present disclosure; Figure 3This is a schematic diagram of the data flow and index document structure for knowledge base construction according to an embodiment of this disclosure; Figure 4 This is a schematic diagram of the query rewriting module prompt word template in an embodiment of this disclosure; Figure 5 This is a schematic diagram of the prompt word template for the question-and-answer generation module in an embodiment of this disclosure; Figure 6 This is a structural block diagram of a knowledge retrieval and question answering system based on metadata enhancement and query intent expansion in the field of industrial intelligence, as described in this application.
[0034] Attached image labels: 10-Document parsing model, 20-Knowledge base construction module, 30-Query rewriting module, 40-Hybrid retrieval module, 50-Question answer generation module, 60-Feedback optimization module. Detailed Implementation
[0035] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0036] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0037] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0038] Example 1 Combination Figure 1 and Figure 2This disclosure provides an explanation of a knowledge retrieval and question-answering method in the field of industrial intelligence based on metadata enhancement and query intent expansion.
[0039] Reference Figure 1 , Figure 1 This is a flowchart illustrating a knowledge retrieval and question-answering construction method based on metadata enhancement and query intent expansion in the field of industrial intelligence, as described in this application. Figure 1 As shown, the method proposed in this application includes: industrial data parsing S10, knowledge base construction S20, query rewriting S30, hybrid retrieval S40, and question-answer generation S50.
[0040] In step S10, various types of industrial data in the field of industrial intelligence are acquired. By extracting document directory information, intelligently splicing cross-page text, generating scene-based image summaries, and enhancing the semantics of tables, data standardization conversion and metadata extraction are completed to ensure the integrity and structured expression of industrial technical details.
[0041] In this implementation, the present embodiment adopts a multi-format document parsing scheme based on the MinerU parsing tool, which can process various file formats such as PDF, doc, docx, ppt, and pptx, generating Markdown format text and structured JSON files. The JSON file contains basic document metadata, extractable text and multimedia association information, document structure and precise element coordinate information, as well as processing status and quality information.
[0042] It should be noted that although MinerU provides basic parsing capabilities, directly using its parsing results still has the following limitations when processing complex industrial documents: 1. MinerU uses visual models and OCR technology, which has limited understanding of document structure. It may misidentify chapter names and headings as body text, resulting in text blocks that are too small and unable to make full use of important structural information. 2. Excessively long blocks can lead to excessive noise, resulting in poor retrieval quality and potentially exceeding the contextual limitations of the larger model. 3. If the document contains broken pages, MinerU may split the originally continuous text content into multiple pieces due to page breaks. 4. Regarding image information in documents, MinerU can only recognize it as image content and retain the local path, lacking contextual semantic summarization; 5. Structured tabular data is presented in HTML format and cannot be directly used for semantic retrieval.
[0043] The specific document parsing and post-processing procedure is as follows: Chapter and Title Recognition: Document titles and chapter information are saved based on the document's table of contents. Since each page can only have one main chapter, the chapter to which each text block belongs is appended based on the table of contents information. Titles are identified by whether the text block ends with punctuation: the characteristic of a title in the main text is that it does not end with punctuation. Therefore, in the text block parsed by MinerU, if it does not end with punctuation and the content exists in the document's table of contents, it is determined to be title information. Cross-page text concatenation: Determine if the text block ends with Chinese punctuation "。!?;" or English punctuation "。!?;". If so, it is a complete text block; otherwise, it is merged with the next text block. Image summary generation: Combining image title information, a large visual model is used to generate a contextualized summary, and the quality of the generated summary is manually checked. Table data processing: Convert HTML format tables to JSON format while preserving row, column and hierarchical relationships, then convert to Markdown tables, and finally call a large language model to generate a semantic summary of the tables to enhance information density.
[0044] In step S20, the ultra-long text is semantically segmented based on industrial semantic rules and interquartile range (IQR), and a metadata enhancement and query intent expansion mechanism is innovatively introduced: industrial metadata information such as document title and chapter is attached to the front of the text block, and five possible user query questions are generated for each text block through a large language model, thus constructing a dedicated knowledge base for metadata enhancement and query intent expansion, which significantly improves the semantic correlation between knowledge and the accuracy of retrieval recall.
[0045] The specific semantic segmentation process is as follows: 1. Decompose the text into independent technical sentences according to the semantic rules of the industrial field; 2. Convert the technical sentences into vector embeddings using the bge-m3 model (or other high-dimensional semantic embedding models); 3. Calculate the cosine similarity of adjacent sentences; 4. Use the interquartile range (IQR) method to set the block threshold: 5. When the similarity between adjacent sentences is lower than the threshold, it is determined as a semantic block boundary, and a new text block is created.
[0046] Furthermore, to support the accurate calculation of dynamic weights of industrial entities in the subsequent retrieval stage (S40), this embodiment also includes an automatic construction and updating step of an industrial terminology database: Based on the full set of structured text data parsed in step S10, the system uses a large language model or an unsupervised keyword extraction algorithm (such as TextRank) to scan the document set, automatically extracting frequently occurring proper nouns, equipment models (such as "M-200"), fault codes (such as "E04"), and process parameter names; the extracted candidate terms are filtered through preset regular expression rules (such as retaining codes containing combinations of numbers and letters) and expert rules, and then deduplicated and stored in the industrial terminology database. This terminology database serves as a preset knowledge prior, providing a data foundation for entity recognition in subsequent relevance scoring algorithms based on industrial entity weights and multi-dimensional field perception.
[0047] To improve retrieval quality, this embodiment adopts a dual strategy of "generation + injection" to construct a set of preset questions: First, a large language model (such as Qwen-Plus) is used to automatically generate 5 questions that users may query for each text block; Second, a feedback-based knowledge injection mechanism is introduced to inject real user queries (Bad Cases) that were not hit or had low confidence in historical searches into the corresponding text blocks as "preset questions" after expert review.
[0048] When building the index, text blocks are formatted as structured strings to maximize information density: "Document Name: [Full Name]\nChapter: [Industry Chapter Name]\nTitle: [Technical Topic]\nContent: [Text Block]" Specifically, this embodiment selects OpenSearch as the knowledge base storage and retrieval engine. The system builds a hybrid index structure in OpenSearch, with the following specific configuration: 1. Index Mapping Design: A keyword type field is set to store document metadata such as document ID, chapter name, and page number to support precise filtering queries; multiple text type fields are set to store "text block content" and "pre-generated question set," and the ik_smart Chinese word segmenter is configured to support sparse text index retrieval based on industrial entity weights and multi-dimensional field-aware relevance scoring algorithms; a knn_vector type field is set to store "text block vector" and "pre-generated question vector," with the dimension of this field adapted to the selected bge-m3 model to support vector space retrieval.
[0049] 2. Data Ingestion: The processed JSON objects containing metadata, text content, and vector representations are written in batches to the OpenSearch index via the Bulk API, thereby completing the construction of the text sparse index and the HNSW vector index.
[0050] Figure 3 This diagram illustrates the data flow and index document structure for constructing the knowledge base in the disclosed embodiment. First, MinerU performs preliminary parsing to obtain raw JSON format data. Then, through steps S10 and S20, hybrid chunking, vector embedding, table and image summary generation, metadata enhancement, and query intent expansion operations are performed to generate a structured document object that conforms to the OpenSearch index mapping requirements. The specific field structure of this structured document object is as follows: Figure 3 As shown, it contains enhanced metadata, a pre-generated question set, and corresponding vector representations. Ultimately, this JSON object will be written in batches to the OpenSearch engine to complete index construction.
[0051] In step S30, user queries from multi-turn dialogues are obtained and rewritten based on industrial field prompt word engineering and mind chain technology: omitted industrial technology elements are supplemented, vague referents are clarified, industrial terminology is standardized, and semantically complete query statements are generated.
[0052] In practice, an industrial-domain prompt word engineering based on thought chain is adopted, and precise rewriting is achieved through hierarchical structure design. Figure 4 This is a schematic diagram of the query rewriting module prompt word template in an embodiment of the present disclosure. Figure 4 As shown, the prompt word structure comprises a role definition layer, an example injection layer, a context injection layer, a task description layer, and an output control layer. The role definition layer clarifies the large model's role as a query rewrite; the example injection layer provides examples for the large model to understand the task; the context injection layer provides historical dialogue information; the task description layer specifies the rewriting rules; and the output control layer defines the format as "Rewrite: [Rewritten content]". This hierarchical design significantly improves the accuracy and consistency of query rewriting in multi-turn dialogues.
[0053] In step S40, a hybrid retrieval strategy of "full-text retrieval based on industrial entity weight and multi-dimensional field perception + vector retrieval with metadata enhancement and query intent expansion + RRF fusion ranking + re-ranking" is adopted, combined with a pre-generated question weight mechanism, to accurately filter out relevant knowledge fragments.
[0054] In its implementation, it includes four sub-steps: 1. Full-text search: Input the rewritten query into the OpenSearch search engine, and the engine will automatically call the Chinese word segmenter (i.e., ik_smart) that is consistent with the index building stage to perform word segmentation on the query.
[0055] Subsequently, a relevance scoring algorithm based on industrial entity weights and multi-dimensional field perception is executed. Addressing the issue that key equipment models or fault codes in complex industrial scenarios are easily buried by generic terms, this embodiment introduces an industrial terminology database for entity recognition during the text sparse index retrieval stage, and utilizes the hybrid index structure constructed in step S2 to perform domain-specific weighting of the metadata field and content field. By amplifying the weight coefficients of industrial entity words and the hit weight of the metadata field, text blocks containing core technical parameters and matching chapter titles receive higher ranking scores. The specific calculation formula of the algorithm is as follows:
[0056] in, Q For query statements, D For document; n This is the number of terms in the query; For document length, The average length of all documents; and To adjust parameters; first item For terms The inverse document frequency component, where This represents the total number of documents in the knowledge base. For included terms The number of documents, To prevent a smoothing constant with a denominator of zero, it is preferable to set... =1.5, .
[0057] in, The formula for calculating the weighted word frequency after incorporating industrial features is as follows:
[0058] in, For terms The number of times it appears in the metadata information appended to the beginning of the text block (including title, chapter, preset questions), For terms Number of times it appears in the main text; and The field-aware weights for the metadata domain and the text domain are set respectively. (Set in this example) ); As a dynamic weighting coefficient for industrial entities, the system matches a preset industrial terminology database in real time during retrieval: when a term... When the equipment model, fault code, or process terminology is matched, Take the gain value (Set in this example) ); when terms When it is a general term, Take the baseline value .
[0059] 2. Vector Retrieval: The query and text blocks are converted into vectors using the bge-m3 model, and cosine similarity is calculated. A dual-view semantic collaborative perception algorithm is introduced.
[0060] Where SIM_block represents the cosine similarity between the query and the text block content, calculated using the following formula:
[0061] SIM_query is the maximum cosine similarity between the query and a preset set of questions, calculated using the following formula:
[0062] in, For query vector, For text block vectors, For the i-th preset problem vector, The preset number of questions; The cosine similarity is calculated using the following formula:
[0063] Where A and B are two vectors. For vectors and dot product, and Representing vectors respectively and The L2 norm; α is the weight of the text block content, β is the preset question weight, and α+β=1; γ is the adaptive threshold coefficient; In this embodiment, α is 0.4, β is 0.6, and γ is 1.0.
[0064] 3. RRF Fusion: The results of full-text search and vector search are initially fused based on the RRF algorithm. The calculation formula for the RRF fusion ranking algorithm is as follows:
[0065] in, For document, For a collection of documents, For document Rank position in search results The smoothing constant is set to 60.
[0066] 4. Re-ranking: The bge-reranker-v2-m3 model is used to interactively re-rank candidate text blocks. The query and text blocks are concatenated into the model in the format "[CLS]query[SEP]text block[SEP]". The model captures deep semantic relationships through a self-attention mechanism and finally outputs the TOP-5 text blocks.
[0067] In step S50, the large language model is driven to generate traceable and applicable technical Q&A results by combining the retrieved knowledge. The results must cover equipment operation steps, process parameter ranges, troubleshooting procedures, optimization solution details, and strictly cite document sources to ensure that they can be directly applied to production sites, maintenance work, or process improvement scenarios.
[0068] In practice, a structured prompting engineering approach is used to control the quality of the large language model generation. Figure 5 This is a schematic diagram of the prompt word template for the question-and-answer generation module in an embodiment of this disclosure. Figure 5 As shown, the prompt word architecture includes four dimensions: role definition, information source limitation, citation specifications, and output format control.
[0069] Role definition: Limited to large models as industrial knowledge assistants; Information source restriction: The requirement is to "answer using only the provided documents; if the context does not contain relevant information, reply 'I cannot answer based on the provided documents'"; Citation guidelines: When citing knowledge base content, clearly indicate the document name or title, and indicate the paragraph or chapter if necessary. Output format control: The answer should be organized into paragraphs and key points, with long answers limited to 5 key points, and Markdown format should be used to ensure readability.
[0070] For tabular data, it is preferentially converted to Markdown format to maintain the integrity of the data structure. This structured prompt design significantly improves the professionalism, accuracy, and traceability of the question-and-answer results.
[0071] The above is an introduction to the method embodiments. The following describes the solution described in this disclosure further through device embodiments.
[0072] Example 2 Reference Figure 6 , Figure 6This is a structural block diagram of a knowledge retrieval and question-answering system based on metadata enhancement and query intent expansion in the field of industrial intelligence, as described in this application. Figure 6 As shown, the system proposed in this application includes: a data parsing module 10, a knowledge base construction module 20, a query rewriting module 30, a hybrid retrieval module 40, a question-and-answer generation module 50, and a feedback optimization module 60.
[0073] The data parsing module 10 is used to perform unified parsing and structured post-processing steps on multi-source heterogeneous data in the field of industrial intelligence.
[0074] The knowledge base construction module 20 is used to perform the knowledge base construction steps.
[0075] The query rewriting module 30 is used to perform semantic integrity optimization steps on the user's original query through industrial field prompt word engineering and mind chain technology.
[0076] The hybrid retrieval module 40 is used to perform multi-way retrieval and fusion steps.
[0077] The question-and-answer generation module 50 is used to generate traceable question-and-answer results that conform to industry professional standards through a structured prompting engineering control large language model.
[0078] The feedback optimization module 60 is used to achieve adaptive evolution of the system. This module is configured with a user feedback interface and a log analysis unit to collect real queries that failed to retrieve data or were marked as "unsatisfactory" by users (i.e., long-tail difficult queries / BadCase). Operations personnel can use this module to establish a mapping relationship between real queries and correct text blocks, and inject the query into the knowledge base construction module 20 to trigger incremental index updates, thereby continuously improving the system's ability to solve long-tail difficult problems.
[0079] The industrial intelligence field provided in this application is based on a multimodal knowledge retrieval and traceable question-answering system and method. Through scenario-based data parsing, industrial semantic knowledge base construction, precise hybrid retrieval, and practical question-answer generation, it effectively solves the problems of low accuracy of knowledge retrieval, poor adaptability of question-answering results, and lack of traceability in existing technologies in complex industrial scenarios, and significantly improves the application efficiency and decision support capabilities of industrial knowledge.
[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A knowledge retrieval and question answering method in the field of industrial intelligence based on metadata enhancement and query intent expansion, characterized in that: The method includes the following steps: S1: Acquire structured and unstructured data in the field of industrial intelligence, convert the data into a structured format through a unified parsing tool, and perform post-processing operations including: preserving the hierarchical relationship of structured data and generating a summary, extracting document directory information and adding chapter information to text blocks, intelligently splicing text blocks that are broken across pages, generating a summary of image data containing equipment status and fault characteristics, and converting the format of table data and generating a semantic summary. S2: Perform block segmentation on the processed text data: Generate semantically complete text blocks using an industrial semantic block segmentation method based on semantic consistency; Construct a set of preset questions associated with each text block through large language model generation and expert feedback injection; Append document metadata to the front of the text blocks to construct a hybrid index structure containing sparse text index and multidimensional feature vector index; Store the text block content, metadata, and corresponding text block vectors and the set of preset question vectors into a distributed full-text search engine to complete the construction of a dedicated knowledge base for the industrial intelligence field. S3: Obtain user queries from multi-turn dialogues, rewrite queries based on industrial domain prompts, and generate semantically complete query statements; S4: Perform hybrid retrieval on the rewritten query: Based on the hybrid index structure built in step S2, perform full-text retrieval and vector retrieval in parallel, and merge, sort and reorder the two retrieval results to output a preset number of highly relevant text blocks; S5: Input the highly relevant text blocks into the large language model, and generate traceable question-and-answer results that conform to industry professional standards by controlling the generation quality through structured prompting engineering.
2. The knowledge retrieval and question answering method for the field of industrial intelligence based on metadata enhancement and query intent expansion as described in claim 1, characterized in that: In S1, the unified parsing tool is a multi-format document intelligent parsing tool; The intelligent splicing rule is that when a text block does not end with a preset Chinese or English ending punctuation mark, it is merged with the next text block; The image summary generation, combined with image title information, is achieved using a large visual model. The table data processing includes converting HTML format to JSON format while preserving the row and column structure, then converting it to structured text format, and finally generating a table summary using a large language model.
3. The knowledge retrieval and question answering method for the industrial intelligence field based on metadata enhancement and query intent expansion as described in claim 1, characterized in that: In S2, the industrial semantic segmentation method is as follows: The text is decomposed into independent technical sentences according to the semantic rules of the industrial field. Each sentence is converted into a vector representation through a semantic vector embedding model. The cosine similarity between adjacent sentences is calculated. A threshold is set based on the interquartile range method. When the similarity is lower than the threshold, it is determined as the semantic block boundary.
4. The knowledge retrieval and question answering method for the field of industrial intelligence based on metadata enhancement and query intent expansion as described in claim 3, characterized in that: The threshold setting is achieved through the following formula: set up Let be the set of cosine similarities of all adjacent sentence pairs in the text, where Indicates the first i The sentence and the first i Cosine similarity of +1 sentence n The total number of sentences in the text; Calculate the first quartile and the third and fourth quartiles : Q 1 = 25th percentile (S); Q 3 = 75th percentile (S); Calculate the interquartile range: ; Set semantic segmentation threshold: ; When the cosine similarity of adjacent sentences When this occurs, the location is determined as the semantic block boundary.
5. The knowledge retrieval and question answering method for the industrial intelligence field based on metadata enhancement and query intent expansion as described in claim 1, characterized in that: In S2, the preset question set consists of synthetic questions generated by a large language model and real query questions injected based on retrieval feedback; the text block format is structured text containing metadata fields and content fields, and its structure includes at least document identification information, industry chapter level information, technical topic information and text block body content.
6. The knowledge retrieval and question answering method for the field of industrial intelligence based on metadata enhancement and query intent expansion as described in claim 1, characterized in that: In step S4, the full-text search employs a relevance scoring algorithm based on industrial entity weights and multi-dimensional field perception, and its calculation formula is as follows: in, Q For query statements, D For document; n This is the number of terms in the query; For document length, The average length of all documents; and b To adjust the parameters; N This represents the total number of documents in the knowledge base. For included terms The number of documents, To prevent the smoothing constant from having a denominator of zero; The weighted word frequency, which incorporates industrial feature weights, is calculated using the following formula: in and These represent the number of times a term appears in the metadata field and the text field, respectively. and For the corresponding field-aware weights and , This refers to the dynamic weighting coefficients for industrial entities, applied when a term matches a pre-defined industrial terminology database. Use the gain value; otherwise, use the reference value.
7. The knowledge retrieval and question answering method for the field of industrial intelligence based on metadata enhancement and query intent expansion as described in claim 1, characterized in that: The vector retrieval in step S4 employs a dual-view semantic collaborative perception algorithm to calculate a comprehensive similarity score. The calculation formula is as follows: Where SIM_block represents the cosine similarity between the query and the text block content, calculated using the following formula: SIM_query is the maximum cosine similarity between the query and a preset set of questions, calculated using the following formula: Q For query vector, C For text block vectors, For the first i A pre-defined problem vector, n The preset number of questions; Where A and B are two vectors. For dot product, and α and β are the L2 norms of vectors A and B, respectively; α is the text block content weight, β is the preset question weight, and α+β=1, γ is the adaptive threshold coefficient.
8. The knowledge retrieval and question answering method for the field of industrial intelligence based on metadata enhancement and query intent expansion as described in claim 1, characterized in that: In step S4, the fusion sorting uses the reverse ranking fusion RRF algorithm, and its calculation formula is as follows: in, d For document, D For a collection of documents, For document d Rank position in search results k This is the smoothing constant.
9. A knowledge retrieval and question-answering system for the industrial intelligence field based on metadata enhancement and query intent expansion according to any one of claims 1 to 8, characterized in that: The system includes: The data parsing module is used to perform step S1. The knowledge base construction module is used to execute step S2. The query rewrite module is used to execute the S3 step described above; A hybrid retrieval module is used to perform step S4. The question-and-answer generation module is used to execute the S5 step described above; The feedback optimization module is used to collect real user queries that failed to retrieve data, establish a mapping relationship between the real queries and the correct target text blocks, and inject the real queries as preset questions into the knowledge base construction module to trigger dynamic updates of the hybrid index structure.
10. A computer storage medium, characterized in that: The computer storage medium stores computer execution instructions, which, when executed by a processor, are used to implement the method of any one of claims 1 to 8.