Measurement knowledge intensive retrieval enhancement generation method, system and equipment
By constructing a multi-level metrology knowledge base with a structured index and vector database, and combining it with a large language model, the problems of accurate positioning and dynamic association in metrology knowledge retrieval are solved, enabling efficient and accurate acquisition of professional knowledge and supporting dynamic updates and traceability of metrology knowledge.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING INST OF RADIO METROLOGY & MEASUREMENT
- Filing Date
- 2025-12-08
- Publication Date
- 2026-04-28
AI Technical Summary
When faced with complex metrological tasks involving multiple levels and multiple fields, existing technologies suffer from low knowledge retrieval efficiency and weak semantic understanding capabilities, making it difficult to accurately locate and dynamically associate professional knowledge. This leads to delayed or insufficient technical decision-making, failing to meet the high requirements for accuracy, timeliness, and traceability of knowledge in scientific research and testing.
A multi-level metrology knowledge base structured index is constructed. By parsing the hierarchical semantic units in metrology procedure documents, a recursive and related index structure is generated. A vector database is also constructed to encode user queries and perform similarity matching with a large language model to generate response results that conform to metrology field standards.
It enables fine-grained organization and semantic association of professional knowledge, improves the accuracy and efficiency of knowledge retrieval, reduces computational load, supports dynamic updates of metrological knowledge, and meets the requirements of accurate knowledge location and traceability in the metrology field.
Smart Images

Figure CN121935344A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of metrology technology, specifically to a metrology knowledge-intensive retrieval enhancement generation method, system, and device. Background Technology
[0002] In related technologies, metrological knowledge management mainly relies on document storage and keyword retrieval, requiring technicians to manually consult numerous procedural documents to obtain the necessary information. This approach suffers from low knowledge retrieval efficiency, weak semantic understanding, and severe information fragmentation when faced with complex metrological tasks involving multiple levels and cross-domain operations. Especially with the rapid iteration of new measuring equipment and continuous updates to metrological procedures, traditional methods struggle to accurately locate and dynamically correlate professional knowledge, easily leading to delayed or insufficiently based technical decisions, and failing to meet the high requirements for accuracy, timeliness, and traceability of knowledge in scientific research and verification work. Summary of the Invention
[0003] In view of the problem that existing technologies are currently difficult to accurately locate and dynamically associate professional knowledge in practical applications, which can easily lead to delayed or insufficient technical decisions, this application provides a metrological knowledge-intensive retrieval enhancement generation method, system and device.
[0004] The first aspect of this application provides a method for enhancing the generation of metrological knowledge-intensive retrieval, including: Construct a multi-level, structured index for a metrological knowledge base; A vector database is constructed based on the structured knowledge base corresponding to the structured index; The user query is encoded, and the encoded user query is matched with the vector database for similarity. The matching result is input into the large language model to obtain the target response result.
[0005] In a possible implementation, the construction of a multi-level metrological knowledge base structured index includes: The hierarchical semantic units in the metrology procedure document are parsed, and a recursive association index structure is constructed based on the hierarchical semantic units. The position information and version information of each semantic unit in the original metrology procedure document are retained, so as to realize fine-grained organization and semantic association of professional knowledge.
[0006] In a possible implementation, the hierarchical semantic units in the parsed metrology procedure document include: The original text content of the metrology procedure document was extracted using a document parsing tool. The original text content includes chapter titles, sub-chapter contents, table descriptions, formula annotations, and technical descriptions. Identify the hierarchical heading system in the original text content, and divide the smallest semantic units with independent semantics based on the hierarchical heading system; Associate each smallest semantic unit with its corresponding hierarchical title to generate a hierarchical set of semantic units.
[0007] In a possible implementation, before constructing the vector database based on the structured knowledge base corresponding to the structured index, the following steps are also included: The text corresponding to each semantic unit in the structured knowledge base is divided into blocks to generate text blocks of a preset length, and overlapping areas are set between adjacent text blocks. The original semantic unit association information corresponding to each text block is retained, and the association information includes the original document identifier, chapter path and starting position information.
[0008] In a possible implementation, encoding the user query and performing similarity matching between the encoded query and the vector database includes: The pre-trained model determines the measurement domain to which the user's query belongs, and the corresponding domain sub-vector database is indexed based on the measurement domain. Semantic parsing is performed on user queries to identify the core conceptual elements contained therein; a pre-trained semantic embedding model is used to transform the user queries into a high-dimensional vector representation, which is consistent with the vector space of text blocks in the vector database; Calculate the similarity between the high-dimensional vector corresponding to the user query and the text block vectors in the domain sub-vector database, and select the text blocks with the highest similarity to form the matching results.
[0009] In a possible implementation, the semantic parsing of the user query to identify the core conceptual elements contained therein includes: Extract core elements such as task type, equipment type, physical quantity attributes, and technical parameter requirements from user queries; The extracted core elements are matched with the recursive association paths in the multi-level quantitative knowledge base structured index to determine the search scope.
[0010] In a possible implementation, the step of inputting the matching results into the context of a large language model to complete the enhanced retrieval generation process includes: After sorting the selected text blocks by similarity, they are integrated into a preset prompt word template, and the boundaries of the search results are marked. Add answer format constraints, professional terminology standardization requirements, and confidence level judgment rules to the prompt word template; The integrated prompts are input into a pre-defined large language model, and deterministic parameters, output length limit parameters, and redundancy control parameters are set to generate preliminary response results.
[0011] In a possible implementation, the method further includes: The preliminary response results are post-processed and optimized, including reordering, filtering redundant information, and extracting summaries. Verify the consistency between the optimized response results and the information in the original metrology procedure document, and eliminate any content that contradicts the original information; The optimized response result is appended with a source citation identifier, which includes the original document number, chapter position, and version information, to generate the final target response result.
[0012] A second aspect of this application provides a metrological knowledge-intensive retrieval enhancement generation system, the system comprising: The index building module is used to build a multi-level structured index for the metrological knowledge base; The database construction module is used to construct a vector database based on the structured knowledge base corresponding to the structured index; The matching module is used to encode user queries, perform similarity matching between the encoded queries and the vector database, and input the matching results into the large language model to obtain the target response results.
[0013] A third aspect of this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described above.
[0014] As described above, this application first constructs a multi-level metrology knowledge base structured index, mapping fragmented knowledge to a unified semantic framework of domain-metrology characteristics-equipment type-physical quantity attribute-sub-technical parameter. This provides a precise directory for knowledge retrieval, and locks down knowledge subsets through a semantic topology network, avoiding the blind traversal of documents indiscriminately in traditional methods. The retrieval scope is narrowed from the entire document to knowledge units under specific semantic paths, improving accuracy while reducing the computational load of subsequent matching. Based on this structured index, semantic unit text blocks are encoded into high-dimensional vectors to construct an efficient retrieval vector database. Finally, user queries are encoded through a semantic embedding model and matched against the vector database. The matched professional knowledge fragments are input into a large language model to complete enhanced retrieval generation, outputting target response results that conform to metrology domain standards. Furthermore, when new metrology regulations are released, this application only needs to parse the new regulations into semantic units, supplement them into the structured index, and update the database with encoded vectors. The large model can then generate responses based on the new knowledge without retraining the large model, solving the problem of lagging knowledge updates in traditional methods. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating a metrological knowledge-intensive retrieval enhancement generation method in an embodiment of this application.
[0017] Figure 2 This is a schematic diagram of the structure of a metrological knowledge-intensive retrieval enhancement generation system in an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] It should be noted that the professional knowledge in the field of metrology is characterized by its complex hierarchy, close interrelationships, and continuous updating. Traditional document storage and keyword retrieval methods are insufficient to meet the needs of technical personnel for accurate knowledge acquisition, rapid location, and reliable citation. Therefore, it is necessary to construct a complete workflow that integrates structured indexing, vector retrieval, and large language model generation.
[0020] It should be noted that BERT, which stands for Bidirectional Encoder Representations from Transformers, is a pre-trained language representation model.
[0021] Based on this, this application provides an implementation method for a metrological knowledge-intensive retrieval enhancement generation method, such as... Figure 1 As shown, it includes: S101, Construct a multi-level structured index for the metrological knowledge base; S102, Based on the structured knowledge base corresponding to the structured index, construct a vector database; S103, Encode the user query, perform similarity matching between the encoded user query and the vector database, input the matching result into the large language model, and obtain the target response result.
[0022] It should be noted that constructing a multi-level metrology knowledge base structured index is not simply about classifying knowledge, but rather about establishing recursive relationships between knowledge units. For example, the metrology field and metrology characteristics, or metrology characteristics and equipment types, are not independently divided, but rather allow retrieval from a knowledge unit back to or extended to related units, avoiding retrieval omissions caused by knowledge fragmentation. In practical applications, the constructed structured index can be integrated with the knowledge update mechanism of the metrology field. When a new metrology procedure is released, the above process can be repeated for the new procedure document to integrate the new knowledge into the existing system without reconstructing the overall framework. This application does not impose any restrictions on this.
[0023] For example, if a user requests a query on how to conduct indication error verification of a temperature sensor, the system first locates the knowledge path in the field of thermal metrology—indication error characteristics—temperature sensor—temperature physical quantity—indication error verification parameters through a multi-level structured index. Then, based on the structured knowledge base corresponding to this path, it matches text fragments directly related to indication error verification from the vector database. Finally, the relevant text fragments are input into a large language model to generate a complete response that includes pre-verification preparation, verification steps, and data processing. The entire process does not require technicians to manually review multiple procedural documents.
[0024] This application first uses a multi-level structured index to sort out the semantic relationships between knowledge, then builds a vector database based on the index to achieve efficient semantic matching, and finally inputs the matched professional knowledge into a large language model to generate response results that conform to the norms of the metrology field.
[0025] In one embodiment achievable under this application, the construction of a multi-level metrological knowledge base structured index includes: The hierarchical semantic units in the metrology procedure document are parsed, and a recursive association index structure is constructed based on the hierarchical semantic units. The position information and version information of each semantic unit in the original metrology procedure document are retained, so as to realize fine-grained organization and semantic association of professional knowledge.
[0026] This application parses the hierarchical semantic units of metrology procedure documents, which is the foundation for constructing a structured index. Since metrology procedure documents often contain various content formats such as chapter titles, sub-chapter sections, table descriptions, formula annotations, and technical descriptions, and some content exists in image format, a document parsing tool is first used to extract the text, ensuring no semantic information is missed. During the extraction process, the text is preprocessed, such as removing redundant spaces and standardizing terminology. For example, temperature transfer is standardized as temperature sensor, laying the foundation for subsequent semantic unit division.
[0027] It should be noted that the recursive association index structure of domain-measuring characteristics-equipment type-physical quantity attribute-sub-technical parameter enables bidirectional knowledge tracing. It can extend downward from the domain level to specific sub-technical parameters, and trace back upward from sub-technical parameters to their respective domains. The association method constructed in this application can effectively address scenarios where metrological knowledge is reused across domains. For example, the metrological characteristics for accuracy are applicable to both multimeters in the electrical field and thermometers in the thermal field. Through recursive association, accuracy-related knowledge of both types of equipment can be retrieved simultaneously.
[0028] This application is not limited to this. The number of levels in the index structure can be adjusted according to the specific needs of actual metrological knowledge. For example, a parameter detection standard level can be added under the sub-technical parameter to record the industry standards corresponding to the technical parameter, further improving the granularity of knowledge. For example, for DC ammeters in the field of electricity, the complete path in the index structure is: electrical metrology field - accuracy level characteristics - DC ammeter - current physical quantity - current indication error parameter. Each level node records the corresponding semantic information, and the nodes are bound to each other through association identifiers. During subsequent retrieval, matching any node can locate the knowledge information under the entire path.
[0029] This application also retains the location and version information of each semantic unit in the original metrological procedure document, which meets the strict requirements of the metrological field for knowledge traceability. After obtaining the response results, technicians can directly consult the corresponding chapter of the original document through the location information and confirm whether the procedure version corresponding to the knowledge is the current valid version through the version information, so as to avoid technical decision-making errors caused by using outdated procedures.
[0030] In one embodiment achievable under this application, the hierarchical semantic units in the parsed metrology procedure document include: S201, Use a document parsing tool to extract the original text content from the metrology procedure document. The original text content includes chapter titles, sub-chapter, table descriptions, formula annotations, and technical descriptions. S200, Identify the hierarchical heading system in the original text content, and divide the smallest semantic unit with independent semantics based on the hierarchical heading system; S203, associate each smallest semantic unit with its corresponding hierarchical title to generate a hierarchical set of semantic units.
[0031] The document parsing tool used in this application is custom-developed to address the characteristics of metrological procedure documents. Current general document parsing tools cannot accurately identify special formats in metrological procedures, such as numbered verification steps or special formats containing formulas. The custom parsing tool can preset a format rule library in the metrological field, such as recognizing standard chapter title formats like 1. Range, 2. Referenced Documents, etc. At the same time, it can convert row and column data in tables into structured text, ensuring the complete extraction of the original text content.
[0032] It should be noted that when identifying the hierarchical heading system, we do not only rely on the document's format markings, but also consider the logical relationships of the text content. For example, if a piece of text does not have a heading format, but the content revolves around the testing environment conditions and is located before the testing methods section, semantic analysis can determine that it belongs to the testing conditions level, and thus divide it into an independent semantic unit, avoiding semantic omissions due to non-standard document format.
[0033] This application is not limited to this. When dividing the smallest semantic unit, a user feedback mechanism is introduced. For example, if technicians frequently report that the content of a certain semantic unit is too coarse, such as treating the entire verification process as a unit and not being able to quickly locate a certain step, then the unit is further divided into smaller semantic units such as pre-verification preparation steps, core verification steps, and data processing steps to improve the accuracy of retrieval.
[0034] For example, in a certain metrology procedure document, under 3. Verification Methods, there are 3.1 Appearance Inspection and 3.2 Performance Verification. Among them, 3.2 Performance Verification includes 3.2.1 Zero-point Calibration and 3.2.2 Range Calibration. During parsing, 3.1 Appearance Inspection, 3.2.1 Zero-point Calibration, and 3.2.2 Range Calibration are divided into the smallest semantic units and associated with their respective hierarchical headings. For example, 3.2.1 Zero-point Calibration is associated with 3.2 Performance Verification and 3. Verification Methods, forming a set of units that includes hierarchy and semantics. When searching for zero-point calibration later, the specific semantic unit can be located directly.
[0035] In one embodiment that can be implemented in this application, the step of constructing the vector database based on the structured knowledge base corresponding to the structured index further includes: The text corresponding to each semantic unit in the structured knowledge base is divided into blocks to generate text blocks of a preset length, and overlapping areas are set between adjacent text blocks. The original semantic unit association information corresponding to each text block is retained, and the association information includes the original document identifier, chapter path and starting position information.
[0036] It should be noted that this application segments the text in the structured knowledge base to ensure that each text block contains complete semantic information. Technical content in the field of metrology typically has logical coherence; splitting at logical breakpoints can easily lead to incomplete semantics in the text blocks, thus affecting the accuracy of subsequent vector encoding. Therefore, semantic analysis is performed on the text before segmentation to identify its logical structure, such as principle-step-requirement, and then the segmentation boundaries are determined based on this logical structure.
[0037] It should be noted that setting overlapping areas between adjacent text blocks avoids semantic breaks caused by block division. Quantitative texts often contain key information that spans multiple text blocks. Overlapping areas can cover this key information, ensuring that even when searching for content involving multiple text blocks, the information in the overlapping areas can be used to link all relevant text blocks, thus improving the completeness of the search.
[0038] This application is not limited to this. The combination of block processing and the importance of knowledge can achieve the level adjustment. For core knowledge, its corresponding text block is set as an independent unit and does not overlap with other content to ensure that core information is not split. For auxiliary knowledge, a larger overlapping area is set with adjacent text blocks to balance semantic integrity and storage efficiency.
[0039] For example, a certain text block corresponds to section 4.2, Verification Conditions, in JJG123-2020, "Verification Procedure for DC Potentiometers". Its associated information will record the document identifier: JJG123-2020; section path: 4. Verification Conditions - 4.2 Environmental Conditions; starting position: page 5, paragraph 2. When the text block is retrieved subsequently, technicians can directly consult the corresponding content of the original procedure through the associated information.
[0040] In this embodiment of the application, when adjusting the length of the text block according to semantic integrity, the technical concepts commonly used in the field of metrology are used as a benchmark, such as the measurement range of physical quantities and the selection requirements of standard instruments. The corresponding text content usually needs to include elements such as definition, range, and requirements. When dividing the text into blocks, it is ensured that all elements are completely contained in one text block to avoid the situation where only the measurement range definition is included but the measurement range determination method is not included, thus ensuring the semantic integrity of the text block.
[0041] It should be noted that the key technical terms covered by the overlapping area were selected through a metrology terminology database. This database contains high-frequency terms in the metrology field, such as indication error, correction value, repeatability, and industry-specific terms, such as gauge blocks and standard resistors. High-frequency terms are used to connect different text contents. Covering high-frequency terms ensures that the semantic relationships between texts are captured during vector encoding. For example, if indication error appears in multiple text blocks, after the overlapping area covers the indication error, the vector encoding will semantically associate the multiple text blocks containing the indication error, and the relevant multiple text blocks can be retrieved when querying the indication error later.
[0042] It should be noted that this application uses large overlapping areas for semantically simple text to avoid redundancy, and small overlapping areas for semantically complex text to ensure that logical connection information is not lost. At the same time, it ensures that the length of text blocks does not exceed the input limit of the semantic embedding model, thus avoiding semantic understanding bias caused by excessively long inputs. If the text length of a certain technical content exceeds the model limit, it is split into multiple text blocks that meet the length requirements, while ensuring semantic integrity, and these blocks are linked by overlapping areas.
[0043] For example, a text document about pressure sensor calibration includes the following: Calibration principle: based on the principle of force balance; Calibration steps: 1. Install the sensor, 2. Apply standard pressure, 3. Record the reading; Calibration requirements: the accuracy level of the standard pressure source must be higher than that of the sensor. When dividing the text into blocks, the calibration principle is divided into three blocks: calibration steps, calibration requirements, and calibration requirements. An overlapping area is set between the calibration steps and calibration requirements to cover the key term "standard pressure source," ensuring that subsequent searches for the standard pressure source can simultaneously link to the text blocks corresponding to the calibration steps and calibration requirements.
[0044] In one embodiment that can be implemented in this application, the encoding of the user query, which involves performing similarity matching between the encoded query and the vector database, includes: S301, determine the measurement domain to which the user query belongs through a pre-trained model, and index the corresponding domain sub-vector database based on the measurement domain; S302, perform semantic parsing on the user query to identify the core conceptual elements contained therein; use a pre-trained semantic embedding model to transform the user query into a high-dimensional vector representation, the high-dimensional vector representation being consistent with the vector space of text blocks in the vector database; S303: Calculate the similarity between the high-dimensional vector corresponding to the user query and the text block vectors in the domain sub-vector database, and select the text blocks with the highest similarity to form a matching result.
[0045] It should be noted that the pre-trained model used in this application to determine the metrology domain to which a user query belongs is based on a large-scale metrology domain corpus. The pre-trained model can identify domain feature words in the query, such as resistance and voltage corresponding to electrical metrology, temperature and humidity corresponding to thermal metrology, and length and angle corresponding to geometric metrology. By analyzing the frequency and correlation of feature words in the domain, the domain to which the query belongs can be determined.
[0046] It should be noted that when using a pre-trained semantic embedding model to transform user queries into high-dimensional vectors, the model used is the BERT model, and its vector encoding formula is as follows: in, This represents the encoder module of the BERT model, which is responsible for bidirectional semantic encoding of the input text. This represents the input text, specifically the text block that can be queried by the user or found in a knowledge base. This represents the training parameters of the BERT model, including the attention weight matrix, fully connected layer weights, and bias terms. The output high-dimensional vector is used to capture the deep semantic information of the text, ensuring that texts with different expressions but the same semantics have similar vector representations. For example, it ensures that the high-dimensional vector of the multimeter calibration remains similar to that of the multimeter calibration.
[0047] When calculating vector similarity, the cosine similarity algorithm is used. This application does not impose any restrictions on this method. The specific formula for calculating cosine similarity is as follows: in, This represents the similarity value between the user query vector and the text block vector, with a value range of [value missing]. The closer the similarity value is to 1, the more semantically similar the meaning. This represents a high-dimensional vector encoded by BERT that represents a user query. This represents a high-dimensional vector after BERT encoding of a knowledge base text block. The dot product operation represents vectors and is used to calculate the directional similarity between two vectors. express The L2 norm of a vector is the square root of the sum of the squares of its elements. express The L2 norm is used to normalize the vector length, avoiding the influence of vector length differences on the similarity calculation results.
[0048] The method used in this application to determine the domain combines the user's historical query behavior. This application does not impose any restrictions on this method. For example, if a user has queried electrical metrology-related content multiple times in the past, and the current query does not have a clearly defined domain, the system will first associate with the sub-vector database of the electrical metrology domain to reduce the uncertainty of domain determination and improve retrieval efficiency. At the same time, when filtering the text blocks with the highest similarity, a dynamic threshold is set, which is adjusted according to the semantic complexity of the query. The threshold is higher for semantically simple queries to ensure accurate results, and the threshold can be lower for semantically complex queries to ensure coverage of all relevant content.
[0049] For example, when a user queries how to assess the measurement uncertainty of a multimeter, the system first identifies key terms such as "multimeter" and "measurement uncertainty" using a pre-trained model, determining the domain as electrical metrology. This is then indexed into an electrical metrology sub-vector database. Next, semantic parsing is performed on the query to identify core elements such as the device type (multimeter) and the task type (measurement uncertainty assessment). Finally, the query is encoded into a vector using a BERT model. , and text block vectors in the sub-library Calculate the cosine similarity and select the text blocks with the highest similarity. The selected text blocks usually contain the evaluation principle, evaluation steps, evaluation formula, etc. of the uncertainty of multimeter measurement.
[0050] In one embodiment that can be implemented in this application, the semantic parsing of the user query to identify the core conceptual elements contained therein includes: S401 extracts core elements such as task type, equipment type, physical quantity attributes, and technical parameter requirements from user queries; S402, the extracted core elements are matched with the recursive association paths in the multi-level quantitative knowledge base structured index to determine the search scope.
[0051] It should be noted that when extracting the core conceptual elements of user queries, this application employs semantic role labeling technology to analyze the semantic roles of each word in the query. For example, in a user query about how to calibrate the indication error of a DC voltmeter, calibration is labeled as an action role, DC voltmeter as an object role, and indication error as an attribute role. This labeling method accurately extracts core elements and avoids missing key information. Furthermore, standardization of the extracted core elements is necessary. In the metrology field, the same concept can have multiple expressions; for example, a DC voltmeter can be described as a DC voltage measuring instrument or a DC voltmeter. Standardization refers to metrology standard documents, unifying the expression to "DC voltmeter" to ensure consistency between the core elements and the node expressions in the multi-level index structure, avoiding path matching deviations caused by differences in expression.
[0052] When matching core elements with recursive association paths, this application employs a path matching algorithm to match the core elements one by one with the hierarchical nodes in the index structure. For example, the core elements "task type: error analysis," "equipment type: pressure transmitter," and "physical quantity attribute: pressure value" match the path "thermal engineering field - error characteristics - pressure transmitter - pressure value" in the index structure. The knowledge subset corresponding to this path constitutes the retrieval scope. It should be noted that if the core elements are incomplete, the algorithm returns all paths containing the mentioned elements. For instance, if a user queries to analyze pressure measurement errors but does not mention the equipment type, the algorithm will match paths such as "thermal engineering field - error characteristics - pressure transmitter - pressure value" and "thermal engineering field - error characteristics - pressure sensor - pressure value," ensuring that no relevant knowledge is missed.
[0053] For example, when a user queries and analyzes the measurement error of a temperature sensor, the semantic role labeling extracts the following elements: task type: error analysis, device type: temperature sensor, physical quantity attribute: temperature value. After standardization, the element description is consistent with the index structure nodes. The path matching algorithm matches all elements with the index structure, locating the path from thermal engineering field to error characteristics to temperature sensor to temperature value to measurement error parameter. The retrieval scope is precisely limited to knowledge under this path, avoiding the retrieval of error analysis content for other devices.
[0054] In one embodiment achievable under this application, the step of inputting the matching result into the context of a large language model to complete the enhanced retrieval generation process includes: S501: After sorting the selected text blocks by similarity, integrate them into the preset prompt word template and mark the boundaries of the search results; S502, add answer format constraints, professional terminology standardization requirements and confidence judgment rules to the prompt word template; S503 inputs the integrated prompt words into the preset large language model, sets deterministic parameters, output length limit parameters and redundancy control parameters, and generates preliminary response results.
[0055] It should be noted that when the text blocks matched in this application are sorted by similarity, a comprehensive sorting strategy of similarity-hierarchical weight is adopted. In addition to referring to the cosine similarity value, weights are assigned according to the hierarchical position of the text block. For example, text blocks belonging to the technical parameters or verification steps level usually directly correspond to the core needs of the user's query, and have a higher weight than text blocks belonging to the terminology definition or reference document level. Even if the similarity of text blocks at the technical parameters or verification steps level is slightly lower, their sorting position will be improved to ensure the professionalism and practicality of the generated results.
[0056] It should be noted that the preset prompt template contains three core parts: First, query paraphrasing, which rephrases the user query into a form that is easy for the large model to understand, such as paraphrasing "How to calibrate the resistance range of a multimeter" as "Please provide the calibration method for the resistance range of a multimeter"; second, search result guidance, which clearly informs the large model that it should generate content based on the retrieved text blocks; and third, generation requirements, which standardize the output format and terminology. Through the above structured template, the large model can be guided to generate a response that meets the requirements of the metrology field.
[0057] This application sets deterministic parameters, output length limit parameters, and redundancy control parameters. Among them, the deterministic parameter, namely the temperature parameter, is used to control the randomness of the generated results. The metrology field has high requirements for the accuracy of the results, so the temperature parameter is set low to ensure that the generated content is stable and repeatable, and to avoid randomly fabricated information. The output length limit parameter is used to control the length of the generated text, which is adjusted according to the query type. For example, the output length of terminology definition queries is shorter, while the output length of verification process queries is longer. The redundancy control parameters include existence penalty and frequency penalty, which are used to reduce the generation of duplicate content. For example, it avoids large models from repeatedly mentioning the same verification step, and ensures that the output content is concise and orderly.
[0058] For example, when a user queries the calibration items of a pressure sensor, the matched text blocks are sorted by similarity-level weight. The first few text blocks all belong to the calibration items and calibration requirement levels. When integrating them into the prompt word template, the template includes generation requirements: list the calibration items in the format of 1. Appearance inspection 2. Performance calibration 3. Error calibration, and briefly describe the calibration content for each item, without omitting core items. When inputting a large model, set the temperature parameter to be low, the output length to be moderate, and the redundancy control parameters to be reasonable, and finally generate a preliminary response result that includes appearance inspection, performance calibration, and error calibration.
[0059] In one embodiment achievable under this application, the method further includes: S601, perform post-processing optimization on the preliminary response results, the post-processing optimization includes reordering the preliminary response results, filtering redundant information and extracting summaries; S602, verify the consistency between the optimized response results and the information in the original metrology procedure document, and remove content that contradicts the original information; S603, add a source reference identifier to the optimized response result, the source reference identifier including the original document number, chapter position and version information, and generate the final target response result.
[0060] First, determine the relevance of the generated content to the user's query. Content that directly answers the core query needs should be ranked first, while supplementary content should be ranked last. Second, ensure the logical coherence of the content. For example, in responses related to verification processes, adjust the content position according to the logical order of preparation-steps-data processing-result judgment to improve readability.
[0061] It should be noted that the filtering of redundant information uses a text deduplication algorithm based on semantic similarity to calculate the semantic similarity of different paragraphs in the generated results. If the semantic similarity of two paragraphs exceeds a preset threshold, they are judged as redundant, and the paragraph with a more complete and accurate description is retained. At the same time, content that is not related to the query is deleted. For example, if the generated results contain equipment maintenance tips, such as calibration methods, the user query will be deleted to ensure that the output content is more in line with the user query.
[0062] The abstract extraction uses a Transformer-based text summarization model to condense lengthy technical descriptions into concise expressions. This application does not impose any limitations on the abstract extraction model. For example, during visual inspection, it is necessary to carefully check whether the pressure sensor housing is damaged, scratched, deformed, or otherwise defective. At the same time, it is necessary to confirm whether the markings on the device are complete and clear, including information such as model number, specifications, serial number, and accuracy class. This can be summarized as: Visual inspection: No damage, scratches, or deformation to the housing; markings (model number, specifications, serial number, accuracy class) are complete and clear. This approach retains core information while shortening the text length.
[0063] In the consistency verification stage, this application uses a text matching algorithm to compare the optimized response results with the content of the original metrology procedure document. Key information in the response results is matched with corresponding information in the original document. If there is a contradiction, such as the verification period of the response results being 1 year while the verification period of the original document is 2 years, the contradictory content will be removed, and the correct information will be extracted again from the matched text block. If the response results contain information not mentioned in the original document, it will be judged as unsubstantiated information and removed to ensure the accuracy of the generated results.
[0064] In the second aspect of this application, as Figure 2 As shown, a metrological knowledge-intensive retrieval enhancement generation system is proposed, the system comprising: Index building module 701 is used to build a multi-level quantitative knowledge base structured index; The database construction module 702 is used to construct a vector database based on the structured knowledge base corresponding to the structured index; The matching module 703 is used to encode the user query, perform similarity matching between the encoded query and the vector database, input the matching result into the large language model, and obtain the target response result.
[0065] If a technician finds errors in the response results, such as incorrect terminology or missing steps, they can submit feedback through the system. The system adjusts its optimization strategy based on the feedback. For example, if the feedback shows that the similarity threshold is too high and the results are incomplete, the threshold is lowered. If the feedback shows that there is redundant content, the similarity threshold for text deduplication is increased. Through continuous iterative optimization, the system's generation quality is improved.
[0066] It is understood that the technical effect of the metrological knowledge-intensive retrieval enhancement generation system provided in this disclosure is consistent with the technical effect of the method embodiment in the foregoing embodiments, and this disclosure will not elaborate on this.
[0067] A third aspect of this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements any of the methods described above.
[0068] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A method for enhancing the generation of quantitative knowledge-intensive retrieval systems, characterized in that, The method includes: Construct a multi-level, structured index for a metrological knowledge base; A vector database is constructed based on the structured knowledge base corresponding to the structured index; The user query is encoded, and the encoded user query is matched with the vector database for similarity. The matching result is input into the large language model to obtain the target response result.
2. The method for enhancing the generation of metrological knowledge-intensive retrieval according to claim 1, characterized in that, The construction of a multi-level metrological knowledge base structured index includes: The hierarchical semantic units in the metrology procedure document are parsed, and a recursive association index structure is constructed based on the hierarchical semantic units. The position information and version information of each semantic unit in the original metrology procedure document are retained, so as to realize fine-grained organization and semantic association of professional knowledge.
3. The method for enhancing the generation of metrological knowledge-intensive retrieval according to claim 2, characterized in that, The hierarchical semantic units in the parsed metrology procedure document include: The original text content of the metrology procedure document was extracted using a document parsing tool. The original text content includes chapter titles, sub-chapter contents, table descriptions, formula annotations, and technical descriptions. Identify the hierarchical heading system in the original text content, and divide the smallest semantic units with independent semantics based on the hierarchical heading system; Associate each smallest semantic unit with its corresponding hierarchical title to generate a hierarchical set of semantic units.
4. The method for enhancing the generation of metrological knowledge-intensive retrieval according to claim 1, characterized in that, Before constructing the vector database based on the structured knowledge base corresponding to the structured index, the following steps are also included: The text corresponding to each semantic unit in the structured knowledge base is divided into blocks to generate text blocks of a preset length, and overlapping areas are set between adjacent text blocks. The original semantic unit association information corresponding to each text block is retained, and the association information includes the original document identifier, chapter path and starting position information.
5. The method for enhancing the generation of metrological knowledge-intensive retrieval according to claim 1, characterized in that, The encoded user query, which involves performing similarity matching between the encoded query and the vector database, includes: The pre-trained model determines the measurement domain to which the user's query belongs, and the corresponding domain sub-vector database is indexed based on the measurement domain. Semantic parsing is performed on user queries to identify the core conceptual elements contained therein; a pre-trained semantic embedding model is used to transform the user queries into a high-dimensional vector representation, which is consistent with the vector space of text blocks in the vector database; Calculate the similarity between the high-dimensional vector corresponding to the user query and the text block vectors in the domain sub-vector database, and select the text blocks with the highest similarity to form the matching results.
6. The method for enhancing the generation of metrological knowledge-intensive retrieval according to claim 5, characterized in that, The semantic parsing of user queries, identifying the core conceptual elements contained therein, includes: Extract task type, equipment type, physical quantity attributes, and technical parameter requirements from user queries; The extracted core elements are matched with the recursive association paths in the multi-level quantitative knowledge base structured index to determine the search scope.
7. The method for enhancing the generation of metrological knowledge-intensive retrieval according to claim 1, characterized in that, The process of inputting the matching results into the context of the large language model to complete the enhanced retrieval generation includes: After sorting the selected text blocks by similarity, they are integrated into a preset prompt word template, and the boundaries of the search results are marked. Add answer format constraints, professional terminology standardization requirements, and confidence level judgment rules to the prompt word template; The integrated prompts are input into a pre-defined large language model, and deterministic parameters, output length limit parameters, and redundancy control parameters are set to generate preliminary response results.
8. The method for enhancing the generation of metrological knowledge-intensive retrieval according to claim 7, characterized in that, The method further includes: The preliminary response results are post-processed and optimized, including reordering, filtering redundant information, and extracting summaries. Verify the consistency between the optimized response results and the information in the original metrology procedure document, and eliminate any content that contradicts the original information; The optimized response result is appended with a source citation identifier, which includes the original document number, chapter position, and version information, to generate the final target response result.
9. A metrological knowledge-intensive retrieval enhancement generation system, characterized in that, The system includes: The index building module is used to build a multi-level structured index for the metrological knowledge base; The database construction module is used to construct a vector database based on the structured knowledge base corresponding to the structured index; The matching module is used to encode user queries, perform similarity matching between the encoded queries and the vector database, and input the matching results into the large language model to obtain the target response results.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1-8.