A Method for Constructing a Multivariate Knowledge Base in the Field of Inspection and Testing Based on a Large Model

By performing feature preprocessing and vectorization on data in the field of inspection and testing, a knowledge topology network is constructed, which solves the problem of inaccurate retrieval results in existing technologies and achieves more accurate and readable knowledge retrieval results.

CN121658668BActive Publication Date: 2026-04-21浙江金汇数字技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
浙江金汇数字技术有限公司
Filing Date
2026-02-05
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing knowledge retrieval methods in the field of testing and inspection lack a deep understanding of the overall semantic intent of the query statement, resulting in insufficient accuracy and relevance of the retrieval results, and difficulty in distinguishing between complex terms and simple word combinations.

Method used

By performing feature preprocessing on structured and unstructured raw data, a knowledge topology network is constructed, and basic semantic units are converted into embedded vectors. Dynamic semantic partitioning and calibration are then performed to form a vectorized knowledge base, which is then used to generate natural language responses using a large language model.

Benefits of technology

It achieves comprehensive coverage and effective integration of diverse data, improves the accuracy of knowledge retrieval in the field of testing and inspection and the readability of results, automatically adapts to the semantic differences of knowledge in the field of testing and inspection, and avoids confusion between different topics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658668B_ABST
    Figure CN121658668B_ABST
Patent Text Reader

Abstract

This invention provides a method for constructing a multivariate knowledge base in the field of testing and inspection based on a large model, relating to the field of data processing technology. The method includes: Step 1, performing feature preprocessing on structured and unstructured raw data in the testing and inspection field to form a document set; Step 2, decomposing the document set into several basic semantic units to construct a preliminary knowledge topology network, and converting the basic semantic units into embedding vectors to form a semantic unit vector set; Step 3, based on the semantic unit vector set, calculating the distance and density between semantic units in the vector space, and performing dynamic semantic partitioning according to the aggregation characteristics of semantic units, adjusting the decision boundaries of each partition, and forming multiple semantically consistent regions. This invention improves the accuracy and readability of multivariate knowledge retrieval in the testing and inspection field, achieving professional and reliable natural language responses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method for constructing a multi-dimensional knowledge base in the field of inspection and testing based on a large model. Background Technology

[0002] In the field of testing and inspection, most existing knowledge retrieval methods rely on rule-based structured database queries or keyword search engine technology combined with inverted indexes. These methods mostly require a relatively strict structured organization of data in the professional knowledge base, such as pre-defining fields, tags, or classification systems, and responding to user query requests through word segmentation, word frequency statistics, and Boolean logic matching.

[0003] However, in actual testing and inspection scenarios, the above methods have some limitations. Their retrieval logic is mostly based on surface-level word matching, lacking a deep understanding of the overall semantic intent of the query. For example, when a user enters the query "electric bicycle range testing method," traditional methods may process and match words such as electric, bicycle, range, and test independently, potentially returning only combinations of unrelated documents such as power tool testing and bicycle safety regulations. This fails to accurately identify electric bicycles as a complete technical product category and its specific range testing requirements, resulting in insufficient accuracy and relevance of the returned results. The keyword matching mechanism lacks sufficient understanding of the overall semantic meaning of the query, making it difficult to effectively distinguish between complex terms and simple word combinations, leading to a discrepancy between the search results and the user's true semantic intent. Summary of the Invention

[0004] The technical problem to be solved by this invention is to provide a method for constructing a multi-dimensional knowledge base in the field of inspection and testing based on a large model, thereby improving the accuracy and readability of multi-dimensional knowledge retrieval in the field of inspection and testing, and achieving professional and reliable natural language responses.

[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:

[0006] Firstly, a method for constructing a multivariate knowledge base in the field of inspection and testing based on a large model, the method comprising:

[0007] Step 1: Perform feature preprocessing on the structured and unstructured raw data in the field of inspection and testing to form a document set;

[0008] Step 2: Decompose the document collection into several basic semantic units to construct a preliminary knowledge topology network, and convert the basic semantic units into embedding vectors to form a set of semantic unit vectors;

[0009] Step 3: Based on the set of semantic unit vectors, calculate the distance and density between semantic units in the vector space, and perform dynamic semantic partitioning according to the aggregation characteristics of semantic units, adjust the decision boundary of each partition, and form multiple semantically consistent regions.

[0010] Step 4: Analyze the distance distribution and angle relationship between the semantic unit vectors inside and outside each semantic consistency region, quantify the semantic tightness and association strength between the semantic unit and the region core, generate the regional semantic calibration coefficient, and calibrate the semantic unit based on the regional semantic calibration coefficient to obtain the calibrated semantic document data.

[0011] Step 5: Store the calibrated semantic document data in a vector database to form a vectorized knowledge base. When responding to user queries, convert the query into a query vector, obtain the initial relevant document set from the vectorized knowledge base through approximate nearest neighbor retrieval, and use the re-ranking model to filter the initial relevant document set by semantic matching degree to obtain the target document subset.

[0012] Step 6: Combine the target document subset with the user query to construct prompt words, input them into the large language model to generate a natural language response, and obtain the results through an interactive question-and-answer interface.

[0013] In a second aspect, a computing device includes:

[0014] One or more processors;

[0015] A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method.

[0016] Thirdly, a computer-readable storage medium storing a program that, when executed by a processor, implements the method.

[0017] The above-described solution of the present invention has at least the following beneficial effects:

[0018] By performing feature preprocessing on structured and unstructured raw data in the field of inspection and testing, comprehensive coverage and effective integration of multi-source data are achieved, expanding the data source range of the knowledge base. By constructing a knowledge topology network and converting basic semantic units into embedded vectors, scattered knowledge is organized into an ordered structure with semantic associations as the core, preserving the inherent logical relationships between knowledge, and achieving precise quantitative expression of semantics. Dynamic semantic partitioning is performed based on the distance, density, and clustering characteristics of semantic units, and the decision boundaries of each partition are flexibly adjusted. This can automatically adapt to the semantic differences of knowledge in the field of inspection and testing, avoid confusion between different topics, and make the partitioning results more consistent with the actual knowledge system. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating a method for constructing a multi-dimensional knowledge base in the field of inspection and testing based on a large model, provided by an embodiment of the present invention.

[0020] Figure 2 This is a schematic diagram provided by an embodiment of the present invention, which shows how to construct prompt words by combining a subset of target documents with user queries, inputting them into a large language model to generate natural language responses, and obtaining the results through an interactive question-and-answer interface. Detailed Implementation

[0021] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0022] like Figure 1 As shown, embodiments of the present invention propose a method for constructing a multivariate knowledge base in the field of inspection and testing based on a large model. The method includes the following steps:

[0023] Step 1: Perform feature preprocessing on the structured and unstructured raw data in the field of inspection and testing to form a document set;

[0024] Step 2: Decompose the document collection into several basic semantic units to construct a preliminary knowledge topology network, and convert the basic semantic units into embedding vectors to form a set of semantic unit vectors;

[0025] Step 3: Based on the set of semantic unit vectors, calculate the distance and density between semantic units in the vector space, and perform dynamic semantic partitioning according to the aggregation characteristics of semantic units, adjust the decision boundary of each partition, and form multiple semantically consistent regions.

[0026] Step 4: Analyze the distance distribution and angle relationship between the semantic unit vectors inside and outside each semantic consistency region, quantify the semantic tightness and association strength between the semantic unit and the region core, generate the regional semantic calibration coefficient, and calibrate the semantic unit based on the regional semantic calibration coefficient to obtain the calibrated semantic document data.

[0027] Step 5: Store the calibrated semantic document data in a vector database to form a vectorized knowledge base. When responding to user queries, convert the query into a query vector, obtain the initial relevant document set from the vectorized knowledge base through approximate nearest neighbor retrieval, and use the re-ranking model to filter the initial relevant document set by semantic matching degree to obtain the target document subset.

[0028] Step 6: Combine the target document subset with the user query to construct prompt words, input them into the large language model to generate a natural language response, and obtain the results through an interactive question-and-answer interface.

[0029] In this embodiment of the invention, by performing feature preprocessing on structured and unstructured raw data in the field of inspection and testing, comprehensive coverage and effective integration of multi-source data are achieved, expanding the data source range of the knowledge base. By constructing a knowledge topology network and converting basic semantic units into embedded vectors, scattered knowledge forms an ordered structure with semantic association as the core, preserving the inherent logical relationship between knowledge, and achieving accurate quantitative expression of semantics. Dynamic semantic partitioning is performed based on the distance, density, and aggregation characteristics of semantic units, and the decision boundaries of each partition are flexibly adjusted. This can automatically adapt to the semantic differences of knowledge in the field of inspection and testing, avoid confusion between different topics, and make the partitioning results more consistent with the actual knowledge system.

[0030] In a preferred embodiment of the present invention, step 1 above, which involves performing feature preprocessing on structured and unstructured raw data in the field of inspection and testing to form a document set, may include:

[0031] In this embodiment of the invention, the collected structured raw data is first processed to unify its format. If the data is in JSON, Excel, or other formats, it is first converted to CSV format to speed up subsequent processing. Attribute features of each column are extracted and used as the header of that column to clarify the core meaning of each column. Each row of data in the CSV format is traversed, and the content of each row is associated with the header of the corresponding column. The combination format is: header 1 corresponds to content 1, header 2 corresponds to content 2, ..., header n corresponds to content n. In this way, each row of structured data is converted into a semantically complete text fragment. Each combined text fragment is treated as an independent document, and all processed text fragments are segmented to form a subset of documents corresponding to the structured data. The collected unstructured raw data is then processed to unify its format. If the data is in PDF, image, or other formats, it is first processed using OCR technology. The text content is extracted and converted to docx format for storage. The core theme of each docx document is determined and used as the document title, serving as the main feature identifier. The document content is then optimized by finding and replacing ambiguous terms such as "this document" or "this file" to avoid semantic ambiguity. The document is initially segmented by paragraphs. If a paragraph is too long, it is further segmented to ensure that each document fragment has a focused theme. Feature identifiers are added to each segmented document fragment in the format: [Document Title][Fragment Core Content], clearly identifying the source and core information of each fragment. The preprocessed and segmented subset of structured data documents is then integrated with the subset of unstructured data documents. All independent documents, including those segmented from structured data and those segmented from unstructured data, together constitute a complete document set, ensuring that each document in the set has a clear feature identifier and clear semantics.

[0032] In a preferred embodiment of the present invention, step 2 above, which decomposes the document set into several basic semantic units to construct a preliminary knowledge topology network, and converts the basic semantic units into embedding vectors to form a semantic unit vector set, may include:

[0033] In this embodiment of the invention, step 220 involves structurally decomposing the document set by identifying semantic boundaries and dividing each document into multiple basic semantic units to obtain a set of basic semantic units. Specifically, this includes: firstly, performing refined preprocessing on two types of core documents in the document set to ensure the content focuses on core semantics, cleaning up redundant information, removing headers, footers, page numbers, and watermarks from all documents, and deleting consecutively repeated punctuation marks and meaningless filler words; standardizing the format by uniformly adjusting structured document fragments to short sentence formats of attribute content, and splitting unstructured documents into paragraphs, with each paragraph not exceeding 5 lines of text; then, deeply integrating the curve inflection point detection algorithm with semantic boundary recognition to accurately locate segmentation nodes. Specifically, this involves constructing a semantic correlation curve, extracting keywords, and extracting core keywords sentence by sentence from the preprocessed single document. Keywords are strictly limited to terms specific to the testing and inspection field, including six categories: standard number, testing item, testing object, technical parameters, operational actions, and related conjunctions. Each category of keywords is labeled with a unique category identifier. Finally, calculating the semantic correlation between adjacent sentences, for each consecutive sentence in the document... Let these be sentences S1 and S2. First, count the number of overlapping keywords between them, only counting keywords with the same category identifier and identical terminology. Then, calculate the keyword overlap, which is the number of overlapping keywords divided by the total number of keywords in S1 and S2 (the number of keywords in S1 plus the number of keywords in S2). Determine the semantic logical relevance: if S2 contains conjunctions such as "based on," "refer to," or "based on," and the connecting object is a keyword in S1, assign a logical relevance value of 1.0; if S2 contains conjunctions such as "as follows," "including," or "specifically as," and the subsequent content expands on the core information of S1, assign a logical relevance value of 1.0. 0.9; If S1 and S2 have the same keyword category but no connecting words, assign a logical relevance value of 0.8; If the keyword categories are different but semantically related, assign a logical relevance value of 0.5; If the keywords have no relation, assign a logical relevance value of 0.2; Calculate the final semantic relevance by adding the keyword overlap and the semantic logical relevance, then dividing by 2 to obtain the semantic relevance value of the adjacent sentence pair; Arrange the relevance values ​​of all adjacent sentence pairs in order of sentence sequence, with the horizontal axis representing the adjacent sentence pair number and the vertical axis representing the semantic relevance value, forming a continuous semantic relevance curve.

[0034] The inflection point of the detection curve is determined, and the absolute value of the rate of change is calculated. Each data point on the semantic relevance curve corresponds to the relevance of an adjacent sentence pair. For the nth data point, the relevance value is Vn. First, the difference between the nth data point and the previous data point (Vn-1) is calculated (Vn-Vn-1), then the difference between the nth data point and the next data point (Vn+1) is calculated (Vn+1-Vn). The two differences are added together, and the absolute value is taken to obtain the absolute value of the rate of change for that data point. For example, if Vn=0.8, Vn-1=0.9, and Vn+1=0.2, the difference 1 is -0.1, the difference 2 is -0.6, and the sum of the absolute values ​​is 0.7. A rate of change threshold is set, and statistical analysis is performed on the data. The semantic relevance curve features of 000 typical documents in the field of inspection and testing were analyzed. The average absolute value of the inflection point change rate of all documents was calculated to be 0.58, and the final threshold was set at 0.6. To determine the semantic inflection point, if the absolute value of the change rate of a data point is greater than or equal to 0.6, then the adjacent sentences corresponding to that data point are considered semantic inflection points, i.e., semantic boundaries, and are marked as strong boundaries. If the absolute values ​​of the change rates of 2-3 consecutive data points are all between 0.4 and 0.59, then the sentence gap at the middle position of the consecutive data points is taken as a weak boundary. If the absolute value of the change rate of a single data point is between 0.4 and 0.59, and the change rates of the preceding and following data points are stable, then it is not determined as a boundary.

[0035] The document is segmented and optimized into basic semantic units. Initial segmentation follows the principle of prioritizing strong boundaries and supplementing with weak boundaries, dividing the document into multiple consecutive sentence sets along semantic boundaries. Unit validity verification requires each sentence set to meet the principle of single core semantic meaning, containing only one clear core information for verification. If a segmented sentence set is too short and its core semantic meaning is incomplete, it is merged with adjacent sentence sets. If a sentence set is too long and contains multiple core semantic meanings, the semantic correlation curve within the set is re-analyzed to supplement and identify internal weak boundaries, followed by secondary segmentation. Unit identification: each qualified sentence set is a basic semantic unit, labeled with its corresponding original document identifier, segmentation position, and core semantic type. All units are integrated to form a basic semantic unit set.

[0036] Step 221 involves performing semantic association analysis on the set of basic semantic units to determine the semantic relationships between them. A preliminary knowledge topology network is then constructed, with each basic semantic unit as a node and semantic relationships as edges. Specifically, this includes: first, generating a unique core semantic identifier for each basic semantic unit. The identifier consists of four parts: domain code, core element, association attribute, and semantic type. The construction rules for each part are as follows: the domain code is subdivided according to the testing and inspection domain, such as TF for textile testing, HJ for environmental testing, SP for food testing, and JG for institutional capability. The code is uniformly two letters. The core element extracts the 1-2 most critical terms within the unit, prioritizing standard numbers or testing items. Association attributes are categorized as citation, supplementary, parallel, and causal. Citation refers to the unit referencing other standards or documents; supplementary refers to the unit providing details about other units; parallel refers to the unit having the same semantic level as other units; and causal refers to the unit being the result or prerequisite of other units. Semantic types are categorized according to standard definition, testing method, technical parameters, scope of application, testing results, and institutional capability, with corresponding Chinese abbreviations.

[0037] Next, a comprehensive semantic association analysis is conducted to calculate the semantic association strength between units. For any two basic semantic units, denoted as Unit A and Unit B, their core semantic identifiers are extracted, and the overlap of core elements is counted. The element overlap ratio is calculated by dividing the overlap by the total number of core elements in Units A and B (the sum of the core elements in A and B). The logical association value of the association attribute is determined: if the association attribute of A is a reference type and the referenced core element is a core element of B, the logical association value is assigned 0.9; if the association attribute of A is a supplement type and the supplemented object is the core semantics of B, the logical association value is assigned 0.8; if A and B have the same semantic type and consistent domain coding, the logical association value is assigned 0.7; if A and B have different domain coding but are semantically related, the logical association value is assigned 0.5; if there is no logical association, the logical association value is assigned 0.1. The final association strength is calculated by adding the element overlap ratio to the logical association value of the association attribute, then dividing by 2, and rounding the result to two decimal places. This is the semantic association strength between the two units. For effective semantic association, a threshold of 0.5 is set for the association strength. If the semantic association strength of two units is greater than or equal to 0.5, they are considered to have effective semantic association. If the association strength is between 0.3 and 0.49 and the domain codes of the two units are the same, they are considered to have potential association. If the association strength is less than 0.3, they are considered to have no association. Finally, a preliminary knowledge topology network is constructed. Nodes are constructed with each basic semantic unit as an independent node. Node identifiers adopt the format of domain code-original document identifier-unit sequence number. The node stores the complete information of the core semantic identifier and the original text fragment of the unit. Edges are constructed with solid lines for effective semantic associations and the weight of the edge labeled with the semantic association strength. Edges with potential associations are labeled with dashed lines and the weight of the edge labeled with the semantic association strength. No edge is constructed if there is no association. The network is integrated by grouping nodes and edges according to domain codes to form multiple domain sub-networks. Potential associations across domains are connected to different sub-networks with dashed edges. Finally, a preliminary knowledge topology network with clear nodes, clear edge weights, and domain-based hierarchy is formed. Each node and edge in the network is labeled with a unique identifier.

[0038] Step 222: For each basic semantic unit corresponding to each node in the preliminary knowledge topology network, extract semantic features and perform vectorization mapping, converting each basic semantic unit into a high-dimensional embedding vector to generate a set of semantic unit vectors corresponding to the network structure. Specifically, this includes: firstly, constructing a high-dimensional vector dimension system specific to the inspection and testing domain, with a preset total vector dimension of 1024 dimensions, categorized by core element dimension (1-256 dimensions), domain attribute dimension (257-400 dimensions), semantic type dimension (401-500 dimensions), technical parameter dimension (501-800 dimensions), and association strength dimension (801- ). The system is divided into five major dimensional ranges (1024 dimensions). Each range's sub-dimensions correspond to specific semantic features, as follows: Core Element Dimensions (1-256 dimensions): Dimensions 1-64 correspond to standard numbers (each standard number is assigned a unique dimension); Dimensions 65-150 correspond to testing items (each testing item is assigned a unique dimension); Dimensions 151-200 correspond to testing objects (each testing object is assigned a unique dimension); Dimensions 201-256 correspond to core conjunctions (each conjunction is assigned a unique dimension); Domain Attribute Dimensions (257-400 dimensions): Each sub-domain corresponds to one dimension (e.g., 257 dimensions for textile testing, 257 dimensions for environmental testing, etc.). The system includes several dimensions: 258 for detection, 259 for food detection, etc.; semantic type dimension (401-500 dimensions), with six semantic types such as standard definitions and detection methods each occupying a corresponding dimension; technical parameter dimension (501-800 dimensions), with common technical parameters such as moisture content, conditioning time, and temperature each occupying a corresponding dimension; and association strength dimension (801-1024 dimensions), corresponding to the number of associated edges of nodes in the knowledge topology network. For each node in the preliminary knowledge topology network, semantic features are extracted and vectorized according to the following steps, with semantic features assigned dimension by dimension. The core element dimension is defined as follows: if a unit contains a certain type of core element, then... Dimensions are assigned a value of 1.0, and all other dimensions are assigned a value of 0.0. If a unit contains multiple core elements, then each of the corresponding dimensions is assigned a value of 1.0. For domain attribute dimensions, the dimension corresponding to the domain to which the unit belongs is assigned a value of 1.0, and all other dimensions are assigned a value of 0.0. For semantic type dimensions, the dimension corresponding to the semantic type of the unit is assigned a value of 1.0, and all other dimensions are assigned a value of 0.0. For technical parameter dimensions, the specific technical parameter values ​​within the unit are extracted and converted to a value between 0 and 1 according to the ratio of the parameter value to the common maximum value of that parameter in the domain. If the unit does not have this technical parameter, the corresponding dimension is assigned a value of 0.0. If the parameter has no specific value, the corresponding dimension is assigned a value of 0.5. For the association strength dimension, first calculate the average association strength of the node in the knowledge topology network, sum the weights of all valid association edges, and then divide by the number of valid association edges. Then, fill the association strength dimension interval with the average value in dimensional order. Optimize vector features by calculating the association strength weight of the node and using the average association strength of the node as the weight coefficient. For vector optimization, multiply each dimension value of the initial high-dimensional vector by the association strength weight coefficient to strengthen the features of semantically closely associated units and weaken the features of loosely associated units, ensuring that the vector reflects the semantic importance of the node in the network. Generate a set of semantic unit vectors, with each basic semantic unit corresponding to a 1024-dimensional high-dimensional embedding vector. Each dimension value of the vector is rounded to two decimal places. Arrange all vectors according to the node identifier order of the knowledge topology network. Store each vector in association with its corresponding node identifier, the original text of the basic semantic unit, and the core semantic identifier, forming a complete set of semantic unit vectors. This ensures a one-to-one correspondence between the vectors and the original semantic information, without any association errors.

[0039] By refining the semantic boundary recognition rules for documents in the field of inspection and testing, and combining the characteristic differences between structured and unstructured documents to formulate targeted segmentation strategies, the basic semantic units after segmentation are more focused on the theme and the information is more complete. This eliminates the need to rely on the strict structured specifications of the original data and reduces the requirements for the structure and quality of the original data in the knowledge base.

[0040] In a preferred embodiment of the present invention, step 3 above, which involves calculating the distance and density between semantic units in the vector space based on the set of semantic unit vectors, and performing dynamic semantic partitioning according to the aggregation characteristics of semantic units, adjusting the decision boundaries of each partition, and forming multiple semantically consistent regions, may include:

[0041] In this embodiment of the invention, step 330 involves calculating the distance between each embedded vector and its neighboring vectors in the vector space based on the semantic unit vector set, and calculating the corresponding local density value of each embedded vector based on the distance. Specifically, this includes: firstly, preprocessing the semantic unit vector set to confirm that all embedded vectors in the set have the same dimension, ensuring that all vectors are in the same standard vector space; secondly, for each embedded vector in the set, performing two steps: firstly, accurately defining the range of neighboring vectors of the target vector. Two methods of definition are available, which can be selected according to the actual business scenario. One method is to define the range by a preset number, first counting the total number of vectors in the semantic unit vector set, and then, based on the granularity of the semantic clustering analysis, setting the proportion of neighboring vectors to the total number of vectors. The first step is to determine the ratio or directly fix a preset number; then, sort all other embedded vectors from closest to farthest from the target vector, and select the preset number of vectors at the top of the sort as the neighbor vectors of the target vector; define the distance threshold by first calculating the maximum and minimum distances between all embedded vectors in the semantic unit vector set, and taking the midpoint of the two as the initial reference threshold; then adjust the threshold according to the semantic distinction requirements; finally, determine all other vectors whose distance from the target vector is less than the adjusted threshold as the neighbor vectors of the target vector; the second step is to calculate the distance between the target vector and each neighbor vector; the specific calculation process is to take the target vector and a certain neighbor vector, and for each corresponding dimension of the two vectors, first set the value of the target vector in that dimension. Subtract the value of the neighboring vector in that dimension to obtain the difference in that dimension. If the target vector value is less than the neighboring vector value, the difference is negative, and subsequent squaring can eliminate the positive or negative effect. Then, square the difference in each dimension separately, that is, multiply the difference by itself to obtain the squared difference value for each dimension. Next, sum the squared differences of all dimensions to obtain the sum of the squared differences. Finally, take the square root of the sum, which is the final distance between the target vector and the neighboring vector. Repeat this process until the distance between the target vector and all neighboring vectors is calculated. The third step is to calculate the local density value of the target vector. The specific calculation process is as follows: for each neighboring vector to the target vector, calculate its reciprocal, that is, 1 divided by the distance value. The smaller the distance, the stronger the reciprocal. The larger the number, the greater the contribution of the neighboring vector to the local density of the target vector. If the distance between a neighboring vector and the target vector is zero, that is, all dimensions of the two vectors are exactly the same, then the reciprocal of the distance is set as the preset maximum density coefficient. This coefficient is determined with reference to the maximum reciprocal of all non-zero distances. For example, if the maximum reciprocal of the non-zero distance is 15, then the preset maximum density coefficient is 15, ensuring that such identical vectors can be included in the local density without interfering with the overall calculation logic. Then, the reciprocals corresponding to all neighboring vectors are summed, and the summed result is the local density value of the target vector. Following the complete process described above, each embedded vector in the semantic unit vector set is processed one by one, and finally the local density values ​​of all embedded vectors are obtained.

[0042] Step 331: Based on the distance and local density values ​​of each embedding vector, identify embedding vectors with high local density that maintain a certain distance from high-density vectors, and determine them as core semantic points representing different semantic clusters. Specifically, this includes: First, filtering the high-density vector set. First, collect the local density values ​​of all embedding vectors and arrange them in descending order of value to form a density sorting list. Then, set a filtering ratio based on the business's expectation of the number of semantic clusters. If the number of vectors obtained after filtering according to the ratio exceeds or falls short of the expected range, adjust the ratio, and finally select the vectors with the highest sorting ratio to form the high-density vector set. Second, calculating the minimum distance between each vector in the high-density vector set. For each vector in the high-density vector set, calculate the distance between the candidate vector and all other candidate vectors in the high-density vector set one by one, following the vector distance calculation method in Step 330. Among all the calculated distances, select the distance with the smallest value as the minimum distance between the candidate vector and other high-density vectors. Iterate through all candidate vectors in the high-density vector set to complete the calculation of the minimum distance for each candidate vector. Third, setting a distance threshold. The minimum distance is determined using a combination of two methods. The statistical method involves summing the minimum distances of all candidate vectors and dividing the sum by the total number of candidate vectors to obtain the average minimum distance. If the minimum distance of some candidate vectors is significantly greater than or less than the average, these outliers are removed, and the average is recalculated. This corrected average is used as the distance threshold. The preset method sets a fixed threshold based on the fineness of semantic distinction. If the average obtained by the statistical method differs significantly from the preset threshold, the median value is taken as the final distance threshold. The fourth step involves determining the core semantic points. For each candidate vector, its minimum distance is compared to the set distance threshold. If the minimum distance of a candidate vector is greater than or equal to the distance threshold, it indicates that the vector maintains sufficient semantic distance from other high-density vectors and can represent an independent semantic clustering direction; therefore, it is determined as a core semantic point. If the minimum distance of a candidate vector is less than the distance threshold, it indicates that the vector has high semantic overlap with other high-density vectors and cannot independently represent a semantic cluster; therefore, the vector is excluded. This determination process is repeated until all candidate vectors in the high-density vector set have been traversed, ultimately forming the core semantic point set.

[0043] Step 332: Centered on the core semantic points, and based on the distance metric between vectors, divide the non-core embedding vectors into regions represented by the nearest core semantic points, forming multiple initial semantic partitions. Specifically, this includes: First, initializing the initial semantic partitions by assigning a unique identifier to each core semantic point, making each core semantic point the center of an initial semantic partition, with each initial semantic partition initially consisting only of the corresponding core semantic point, and recording the partition's identifier information; Second, traversing the non-core embedding vectors, filtering out all embedding vectors not marked as core semantic points (i.e., non-core embedding vectors) from the semantic unit vector set, according to their storage order in the set; Third, calculating the distance between non-core vectors and core semantic points. For the currently traversed non-core embedding vector, calculate the distance according to the vector distance metric in step 330. The calculation method involves calculating the distance between the vector and all core semantic points in the core semantic point set one by one, and recording the distance value corresponding to each core semantic point. In the fourth step, non-core vectors are divided into initial partitions. The distance values ​​of the non-core vectors to all core semantic points are compared, and the smallest distance value is found to determine the core semantic point corresponding to the smallest distance. The non-core embedding vector is then marked with the unique identifier of the core semantic point, and the minimum distance between the vector and the core semantic point is recorded. Then, the non-core vector is assigned to the initial semantic partition corresponding to the identifier. The second to fourth steps are repeated until all non-core embedding vectors are marked and assigned to the corresponding initial semantic partitions, ultimately forming multiple initial semantic partitions. Each partition contains one core semantic point and several non-core embedding vectors that are closest to the core semantic point.

[0044] Step 333: Based on multiple initial semantic partitions, analyze the ambiguity of the embedded vectors at the boundaries of adjacent partitions. Through multiple rounds of adjusting the decision boundaries of each partition, merge partitions with high semantic overlap and strengthen the boundaries of partitions with strong independence, ultimately forming multiple final semantic regions with clear boundaries and consistent internal semantics. Specifically, this includes: First, identifying adjacent initial semantic partitions, calculating the distance between all core semantic points in the core semantic point set, and setting an adjacency threshold; initial semantic partitions whose distance between two core semantic points is less than the adjacency threshold are determined to be adjacent partitions; traversing all core semantic points to sort out all pairs of adjacent initial semantic partitions; Second, filtering the boundary ambiguity vectors of adjacent partitions. For each pair of adjacent initial semantic partitions, first find all embedded vectors that may be at the boundary between the two, i.e., vectors that are close to the core semantic points of both partitions; calculate the distances of these vectors to the core semantic points of partition A and partition B respectively, and then calculate the difference between the two distances; set a ambiguity threshold, which is 10%-20% of the distance between the core semantic points of partition A and partition B. For example, if the core distance is 5.0, then the ambiguity threshold is 0.5-1.0; If the distance difference of a vector is less than the fuzziness threshold, it means that the vector cannot be clearly assigned to a certain partition and is judged as a vector with fuzzy assignment; count the number of fuzzy vectors between each pair of adjacent partitions; the third step is to calculate the partition overlap and independence index. For each pair of adjacent partitions, calculate the partition overlap by dividing the number of fuzzy vectors in the pair of adjacent partitions by the total number of vectors in the two partitions, i.e., the total number of vectors in partition A plus the total number of vectors in partition B. The ratio obtained is the partition overlap. Calculate the partition independence index by dividing the number of fuzzy vectors in each partition by the total number of vectors in that partition. The ratio obtained is the independence index of that partition; the fourth step is to adjust the decision boundary in multiple rounds, set the overlap threshold and independence threshold, enter the adjustment process, merge highly overlapping partitions. If the overlap of a pair of adjacent partitions is greater than the overlap threshold, it means that the semantic overlap of the two partitions is serious and they need to be merged into a temporary partition; redetermine the core semantics of the temporary partition. For each corresponding dimension of the original two core semantic points, add the value of that dimension of the original partition A core to the value of that dimension of the original partition B core, and then divide the sum by 2 to obtain the average value of that dimension. The average values ​​of all dimensions together form the new core semantic points of the temporary partition. At the same time, all vectors of the original two partitions are assigned to the temporary partition, and the identifier of the temporary partition is updated. Clarify the vector affiliation of the low independence partition. If the independence index of a partition is less than the independence threshold, it means that the boundary vector affiliation problem of the partition is relatively mild and does not need to be merged. Appropriately reduce the fuzziness threshold and recalculate the distance difference between the boundary vectors of the partition and the adjacent partitions. According to the new difference result, if the vector difference is still less than the reduced fuzziness threshold, then combine the distance between the vector and the two core semantic points to clearly assign it to the partition with the closer distance. If the difference is greater than the reduced fuzziness threshold, then the vector belongs to the current partition and is no longer considered a fuzzy vector. The fifth step is to cyclically verify until the standard is met. After each round of adjustments, the adjacency relationships, number of blurred boundary vectors, partition overlap, and independence indices between all partitions are recalculated. This adjustment process is repeated until the overlap of all adjacent partitions is less than the overlap threshold, and the independence indices of all partitions are greater than the independence threshold. No more partitions with severe semantic overlap or blurred boundaries appear, ultimately forming multiple final semantic regions with clear boundaries and strong, consistent semantic relationships between their internal vectors.

[0045] By defining the range of neighboring vectors and calculating vector distance and local density in two ways, distortion of local density caused by ambiguous range definition or coarse calculation is avoided, providing highly reliable basic data for the recognition of core semantic points.

[0046] In a preferred embodiment of the present invention, step 4 above, which analyzes the distance distribution and angle relationship between semantic unit vectors inside and outside each semantic consistency region, quantifies the semantic tightness and association strength between semantic units and the region core, generates regional semantic calibration coefficients, and calibrates semantic units based on the regional semantic calibration coefficients to obtain calibrated semantic document data, may include:

[0047] In this embodiment of the invention, step 440 involves analyzing the distance distribution between each embedded vector within a semantically consistent region, as well as the angle relationship between vectors within the region and selected relevant external region vectors, to obtain semantic structure analysis results. Specifically, this includes: first, determining the core semantic points of each semantically consistent region and counting the total number of all semantically consistent regions; when determining relevant external regions, first calculating the distance between the core semantic point of this region and the core semantic points of every other semantically consistent region; arranging these distances in ascending order, and selecting the region closest to the core semantic point as a candidate relevant external region based on a preset proportion of the total number of regions; then calculating the average distance from all embedded vectors within this region to the core semantic point; if the distance between a candidate external region and the core semantic point of this region exceeds three times the average, it indicates a very weak semantic association between the two, and the candidate region is eliminated. The next region is selected from the remaining distances until a preset number of relevant external regions with matching distances are selected, ensuring a valid semantic association between the external regions and this region; next, analyzing the distance distribution between each embedded vector within the region; for a single semantically consistent region, first traversing all embedded vectors within the region, and denoting each embedded vector as vector M. Calculate the distance between vector M and all other embedded vectors within the region, denoted as vector N, to obtain all distance data corresponding to vector M. After traversing all vectors, collect the distances between all vectors within the region to form a total distance set. Calculate the statistical characteristics of the total distance set by summing all distance values ​​and dividing by the total number of distances (i.e., the total number of vectors in the region multiplied by (the total number of vectors minus 1) and divided by 2). Since the distance is calculated only once for each vector pair, obtain the average distance. Sort all distances in ascending order. If the number of values ​​in the middle position is even, take the average of the two middle values ​​as the median. Filter out the total distances. The largest value in the set is the maximum value, and the smallest value is the minimum value. Divide the distance into intervals, using the minimum value, half the average value, the average value, 1.5 times the average value, and the maximum value as interval boundaries to divide into 4 consecutive intervals. Count the number of distances contained in each interval, and divide the number of distances in each interval by the total number of distances to obtain the distance percentage of each interval. At the same time, count the percentage of distances less than the average value and the percentage of distances greater than twice the average value. Integrate these statistical characteristics and interval percentage data to form the vector distance distribution characteristic data within the region.

[0048] Then, the angle relationship between the vectors within the region and the vectors in the relevant external regions is analyzed. From each relevant external region, embedded vectors are randomly selected as external sample vectors according to a preset proportion of the total number of vectors in the region. If the total number of vectors in the region is small, 10 sample vectors are selected to ensure that the sample vectors can fully represent the semantic features of the external region. Each embedded vector in the region is denoted as vector P, and the angle between each embedded vector and each external sample vector is denoted as vector Q is calculated. The first step is to calculate the dot product by multiplying the value of each dimension of vector P by the value of the corresponding dimension of vector Q to obtain the product result of each dimension. The first step is to sum the products of all dimensions to obtain the dot product of vectors P and Q. The second step is to calculate the magnitude of vector P by squaring the value of each dimension of vector P, summing all the squares, and taking the square root of the sum. The third step is to calculate the magnitude of vector Q in the same way as the magnitude of vector P. The fourth step is to calculate the cosine of the angle between vectors P and Q by dividing the dot product of the magnitudes of P and Q. The fifth step is to determine the range of the angle; if the cosine value is between 0.8 and 1.0, then the angle is between 0 and 36 degrees. The values ​​are as follows: Cosine values ​​are between 0.3 and 0.8, with an angle between 36 and 69 degrees; Cosine values ​​are between -0.3 and 0.3, with an angle between 69 and 111 degrees; Cosine values ​​are between -0.8 and 0.3, with an angle between 111 and 144 degrees; Cosine values ​​are between -1.0 and 0.8, with an angle between 144 and 180 degrees. The calculation includes the average (sum of all cosine values ​​divided by the total number of vectors), maximum (selecting the largest cosine value), and minimum (selecting the smallest cosine value) of the angles between all vectors in this region and each sample vector in the external region. The number of vectors within the three intervals of 0-60 degrees, 60-120 degrees, and 120-180 degrees is calculated. The number of vectors in each interval is divided by the total number of vectors in the region to obtain the proportion of each interval. These angle statistics are integrated to form angle relationship analysis data. Finally, the vector distance distribution feature data within a single semantically consistent region is merged with the angle relationship analysis data, and the region's identification information is labeled to obtain the semantic structure analysis result for that region. The above process is repeated to traverse all semantically consistent regions one by one to complete the semantic structure analysis of all regions, forming a complete set of semantic structure analysis results.

[0049] Step 441: Based on the semantic structure analysis results, calculate the semantic tightness quantification value between each embedding vector and its corresponding region core, and the semantic association strength quantification value between each embedding vector and the remaining related region cores. Specifically, this includes: first, calculating the semantic tightness quantification value. For each embedding vector within a semantically consistent region, denoted as vector X, the first step is to calculate the distance between vector X and its corresponding region core semantic point, denoted as core point C. The second step is to calculate the reciprocal of this distance, i.e., 1 divided by the distance value. The smaller the distance, the larger the reciprocal, intuitively reflecting the tightness between the vector and the core point. The third step is to calculate the reciprocal of the average tightness of the region. This involves traversing all embedding vectors within the region and calculating the reciprocal of the average tightness of each embedding vector. The first step is to calculate the reciprocal of the distance to the core point C. Sum all the reciprocals to get a total reciprocal. Then divide this total by the total number of embedded vectors within the region to obtain the reciprocal of the region's average density. The fourth step is to calculate the density ratio. Divide the reciprocal of the distance to vector X by the reciprocal of the region's average density. The ratio is the density ratio. A ratio greater than 1 indicates that vector X is closer to the core point than the average level within the region, while a ratio less than 1 indicates that it is farther away. The fifth step is to determine the basic density coefficient. Based on the semantic sensitivity requirements of the inspection and testing field, a fixed basic density coefficient is preset. The sixth step is to calculate the semantic density quantification value. Multiply the density ratio by the basic density coefficient to obtain the semantic density of vector X. The quantification value indicates that the larger the value, the stronger the semantic association between vector X and the core of its region. Next, the semantic association strength quantification value is calculated. For each embedded vector X, the first step is to traverse all relevant external regions of its region, denoted as region Y. The second step is to obtain the core semantic point of region Y, denoted as core point D. The third step is to calculate the cosine of the angle between vector X and core point D. The fourth step is to calculate the external region relevance weight. First, calculate the distance between the core point C of this region and the core point D of region Y, then calculate the reciprocal of this distance. The result is the external region relevance weight; the closer the distance, the larger the reciprocal, and the higher the weight, indicating a stronger semantic association between region Y and this region. The fifth step is to calculate the association strength score of a single external region by multiplying the cosine of the angle between vector X and core point D by the relevant weight of region Y to obtain the association strength score between vector X and region Y. The sixth step is to calculate the total association strength quantification value by adding the association strength scores of vector X with all relevant external regions. The sum is the semantic association strength quantification value of vector X. The larger this value is, the closer the semantic association between vector X and other relevant regions. Following the complete process described above, each embedded vector in all semantically consistent regions is traversed one by one to complete the calculation of the semantic tightness quantification value and the semantic association strength quantification value of all vectors, and the two quantification values ​​are associated and stored with the vector itself and the identifier of the region to which it belongs.

[0050] Step 442: Based on the semantic tightness quantification value and the semantic association strength quantification value, determine a corresponding regional semantic calibration coefficient for each embedding vector. Specifically, this includes: first, setting weight coefficients. Considering the business characteristics of the inspection and testing field, preset semantic tightness weight coefficients and semantic association strength weight coefficients, with the sum of the two weight coefficients fixed at 1.0. For example, if the inspection and testing field values ​​the purity of semantics within a region, the semantic tightness weight coefficient is set to 0.7 and the semantic association strength weight coefficient to 0.3; if cross-regional association analysis needs to be balanced, the semantic tightness weight coefficient is adjusted to 0.6 and the semantic association strength weight coefficient to 0.4. The setting of the weight coefficients needs to be verified through domain business scenarios to ensure it meets actual application requirements. Next, calculate the contribution values. For each embedding vector X, the first step is to calculate the tightness contribution value by multiplying the semantic tightness quantification value of vector X by the preset semantic tightness weight coefficient. The result is the tightness contribution value, which reflects the degree of influence of the semantic tightness of vector X on calibration within the region. The second step is to calculate the association strength contribution value by multiplying the semantic association of vector X... The intensity quantization value is multiplied by a preset semantic association strength weighting coefficient to obtain the association strength contribution value, which reflects the degree of influence of the association strength between vector X and the external region on the calibration. Then, the initial calibration coefficient is calculated by adding the density contribution value and the association strength contribution value of vector X; the sum is the initial calibration coefficient for that vector. If the initial calibration coefficient is negative, because the cosine of the included angle may be negative, resulting in a negative association strength contribution value that is greater than the density contribution value, the absolute value of the initial calibration coefficient is first taken, and then multiplied by a preset correction coefficient to obtain... The initial calibration coefficients are corrected and ensured to be positive and logically consistent. Finally, the final calibration coefficients are determined, with a reasonable range of 0.5-1.5. The corrected initial calibration coefficients are evaluated: if they fall within this range, they are directly used as the final semantic calibration coefficient for the vector; if they are greater than 1.5, 1.5 is used as the final calibration coefficient to avoid over-enhancement; if they are less than 0.5, 0.5 is used as the final calibration coefficient to avoid over-weakening. After determining the final calibration coefficients for all vectors, the calibration coefficients are associated with the vector, quantization value, and region to ensure a one-to-one correspondence.

[0051] Step 443: Using the regional semantic calibration coefficient, perform calibration operations on the corresponding original embedding vectors to finally obtain calibrated semantic document data. Specifically, this includes: for each embedding vector X, calibration is performed according to the following process: First, extract all dimensional information of vector X and clarify the original value of each dimension; second, obtain the final regional semantic calibration coefficient corresponding to vector X; third, perform calibration operations dimension by dimension. For each dimension of vector X, multiply the original value of that dimension by the final regional semantic calibration coefficient to obtain the calibrated value of that dimension. The calibration logic is as follows: if the final calibration coefficient is greater than 1.0, multiplying the original value by the coefficient will amplify the semantic features of that dimension, further strengthening the core semantic attributes of the region to which vector X belongs, making it more consistent with the regional semantics; if the final calibration coefficient is less than 1.0, multiplying the original value by the coefficient will shrink the semantic features of that dimension, weakening interference information unrelated to the core semantics of the region, while retaining reasonable cross-regional semantic relationships. If the final calibration coefficient equals 1.0, the calibrated value is consistent with the original value and no adjustment is needed. For special cases, if the original value of a certain dimension is zero, the calibrated value remains zero to avoid introducing meaningless semantic information. If the original value of a certain dimension is negative, it is calculated normally by multiplying the original value by the calibration coefficient, preserving its positive or negative attributes to ensure that the reverse semantic features are not tampered with. After calibrating all dimensions of vector X, the calibrated embedding vector is composed of the calibrated values ​​of all dimensions. A unique association index is established between this calibrated embedding vector and the corresponding original document text. The index information includes the vector identifier, the original text identifier, the identifier of the semantic consistency region, the region semantic calibration coefficient, and the calibration timestamp. The above calibration process is repeated for all embedding vectors, collecting all calibrated embedding vectors, association indexes, and original text. These are then categorized and organized according to their semantic consistency regions, ultimately forming semantic document data with more accurate semantic attributes after calibration.

[0052] By conducting multi-dimensional statistical analysis of vector distance distribution within the region and refining the calculation of cross-regional vector angle relationships, the semantic position, regional distribution characteristics, and cross-regional association attributes of each embedded vector are captured comprehensively and accurately. This avoids the omission of semantic features due to a single analysis dimension, and improves the semantic organization rationality, application reliability, and retrieval accuracy of the multi-dimensional knowledge base in the field of inspection and testing.

[0053] In a preferred embodiment of the present invention, step 5 above, which involves storing the calibrated semantic document data in a vector database to form a vectorized knowledge base, converting the query into a query vector when responding to a user query, obtaining an initial set of relevant documents from the vectorized knowledge base through approximate nearest neighbor retrieval, and using a re-ranking model to filter the initial set of relevant documents based on semantic matching to obtain a subset of target documents, may include:

[0054] In this embodiment of the invention, step 550 involves converting the calibrated semantic document data into a high-dimensional vector representation, generating semantic document vectors, and then indexing the semantic document vectors with their corresponding original document texts and storing them in a vector database to form a vectorized knowledge base. Specifically, this includes: first, determining the complete structure of the calibrated semantic document data, which contains three core parts: the embedded vectors calibrated in step 443, the original document texts corresponding one-to-one with the vectors, and associated auxiliary information; when converting to a high-dimensional vector representation, strictly adhering to the homology rule consistent with the vector generation above to ensure data compatibility; the first step involves extracting the core semantic features of the semantic document, and, combined with the characteristics of the inspection and testing field, clarifying the feature category. The first step includes the detection standard number, detection item name, detection object, technical parameters, scope of application, and description of detection method, ensuring coverage of the document's core semantics. The second step assigns feature weights to each core semantic feature item. The assignment rule is as follows: core terms that play a decisive role in the document's semantics are assigned a value based on their frequency of occurrence in the document, with 1.0 for each occurrence and an additional 0.2 for each additional occurrence, up to a maximum of 2.0. Auxiliary descriptive words are uniformly assigned a value of 0.3; conjunctions without actual semantic meaning are assigned a value of 0.0. The third step presets a fixed number of high-dimensional vector dimensions and assigns a dedicated dimension interval to each core semantic feature item, mapping the weight value of each feature item to the corresponding dimension within its dedicated dimension interval. For dimensions without corresponding feature terms within the interval, a preset base value of 0.01 is uniformly assigned to ensure that there are no missing dimension values. The fourth step involves fusing calibration coefficients to optimize the vector. The values ​​of each dimension of the calibrated embedded vector are multiplied by the feature weight values ​​of the corresponding dimensions to obtain the final value for each dimension. The final values ​​of all dimensions are combined sequentially to form a semantic document vector, ensuring that its dimensions are completely consistent with the preset high-dimensional vector dimensions. When building the index, structured index entries are created. Each entry contains seven types of information: a unique identifier for the semantic document vector, a unique identifier for the original document text, the total number of vector dimensions, core semantic feature terms and their corresponding dimension intervals, the identifier of the semantic consistency region, the region semantic calibration coefficient, and the storage timestamp. The unique identifiers of semantic document vectors and original document text use the same encoding rules to ensure a one-to-one correspondence without any association or confusion. All semantic document vectors are categorized according to their semantic consistency region identifiers and stored in batches to the corresponding partitions of the vector database to avoid cross-region storage and retrieval redundancy. At the same time, all index entries are synchronously stored in the index module of the vector database, and a two-level index directory is established. The first level is categorized according to semantic region identifiers, and the second level is categorized according to core semantic features, such as semantic region 1 - detection item - rubbing color fastness, which facilitates quick location of vectors during retrieval. After the storage of all vectors and indexes is completed, a vectorized knowledge base with clear data associations, well-organized classifications, and convenient retrieval is formed.

[0055] Step 551: When responding to a user query, the user query text is converted into a query vector with a high-dimensional vector representation. Based on the query vector, the distance between the query vector and each semantic document vector in the vectorized knowledge base is calculated. Specifically, this includes: when responding to a user query, the user query text is first standardized and preprocessed. The first step is to remove meaningless interference information, including interjections, punctuation marks, redundant modifiers, and repetitive expressions, retaining only the core expressions. The second step is to extract the core semantic elements of the query. Taking the query scenario in the field of inspection and testing as an example, if the user query is for inspection... The primary standard for measuring the colorfastness to rubbing of silk scarves is determined by the following criteria: After preprocessing, the core semantic elements extracted are silk scarf, colorfastness to rubbing, and testing standard. Following the semantic document vector conversion rules in step 550, a query vector is generated to ensure source-consistent adaptation. The first step involves matching each core semantic element with its corresponding core semantic feature item. The second step assigns values ​​to the core semantic elements according to the same weighting rules: key elements such as testing items, standard numbers, and testing institutions are assigned a value of 1.5, while auxiliary elements such as testing objects and applicable scope are assigned a value of 1.0. The third step maps the weight values ​​of the core semantic elements to the semantic document vector... For dimension intervals and corresponding dimensions with the same quantity, dimensions without corresponding elements are also assigned a preset base value of 0.01 to generate a query vector that is completely consistent with the high-dimensional vector representation, ensuring that the number of dimensions is consistent with the semantic document vector. When calculating the distance between the query vector and each semantic document vector in the vectorized knowledge base, the Euclidean distance calculation logic consistent with the previous one is used to ensure that the similarity judgment standard is consistent. For a query vector and a certain semantic document vector, the total number of dimensions of both is first determined. Starting from the first dimension, each corresponding dimension is processed one by one. The value of the query vector in that dimension is subtracted from the value of the semantic document vector in that dimension to obtain the difference of that dimension. The difference of each dimension is squared. After the squared differences of all dimensions are calculated, all squared differences are summed to obtain the sum of squared differences. Finally, the square root of the sum is taken to obtain the final distance between the query vector and the semantic document vector. Following the above complete process, the distance between the query vector and all semantic document vectors in the vectorized knowledge base is calculated one by one. After each distance is calculated, the distance value is associated with the unique identifier of the corresponding semantic document vector and stored to form a list of vector identifiers and distance values.

[0056] Step 552: Based on the distance filtering, select the semantic document vectors with the highest similarity to the query vector, and obtain the corresponding initial relevant document set according to the index relationship between the selected semantic document vectors and the original document text. Specifically, this includes: First, sorting all distance values ​​in the list corresponding to vector identifiers and distance values ​​in ascending order. The smaller the distance value, the higher the semantic similarity between the query vector and the semantic document vector; the larger the distance value, the lower the semantic similarity. A dual filtering rule is set to ensure the comprehensiveness and relevance of the initial relevant document set. The first filtering is based on a preset number: according to the coverage requirements of the inspection and testing field, a preset number of distance values ​​and their corresponding unique semantic document vector identifiers are selected from the sorted list to form a candidate vector set. The second filtering is based on a distance threshold: first, calculate the average of all distance values ​​in the candidate vector set (i.e., sum all distance values ​​and then divide by the number of vectors in the candidate vector set), and set this average as the distance threshold. The candidate vector set is then traversed. The process involves several steps: First, unique semantic document vector identifiers with a distance value greater than a threshold are removed, while those with a distance value less than or equal to the threshold are retained. This ensures that the selected vectors are core vectors with high semantic similarity to the query vector. Based on the retained unique semantic document vector identifiers, an initial set of relevant documents is obtained. The first step involves finding the corresponding index entry in the vector database's index module using the unique vector identifier. The second step involves extracting the unique identifier of the original document text from the index entry. The third step involves locating the corresponding original document text in the document storage module of the vector database based on the original document text identifier. The fourth step involves annotating each located original document text with association information, including the corresponding unique semantic document vector identifier, the distance value from the query vector, and its initial ranking in the sorting list. Finally, all annotated original document texts are integrated according to their initial ranking, while retaining the association between each document and the semantic document vector and index entry, forming a traceable and verifiable initial set of relevant documents to ensure that the data source can be verified in reverse.

[0057] Step 553: Calculate the semantic matching degree between each document in the initial relevant document set and the user query using a re-ranking model. Then, filter and re-rank the initial relevant document set based on the semantic matching degree to obtain the target document subset most semantically relevant to the user query. This includes combining the user query with each document in the initial relevant document set to form multiple query document pairs; inputting the query document pair set into the re-ranking model to obtain the semantic relevance score between each query document pair through deep semantic analysis; assigning a corresponding semantic matching metric value to each document in the initial relevant document set based on the semantic relevance score, forming a semantic matching metric value set; re-ranking the documents in the initial relevant document set according to their scores from high to low based on the semantic matching metric value set, obtaining a re-ranked document sequence, and selecting a predetermined number of documents from the front of the re-ranked document sequence to form the final target document subset. Specifically, this includes: firstly, extracting comparison benchmark information; on the one hand, extracting the core semantic content of each document in the initial relevant document set, focusing on extracting key information such as the detection standard number, detection project name, detection object, technical parameters, applicable scope, detection institution name, and detection capability description to ensure coverage of the document's core semantics; on the other hand... The core semantic elements of the user query extracted in step 551 are reused to maintain consistency with the comparison benchmark and avoid matching deviations caused by benchmark differences. The semantic matching degree between each document and the user query is calculated in three steps to ensure accurate quantification results. The first step calculates the feature overlap: the number of overlaps between the core semantic content of the current document and the core semantic elements of the user query is counted; the overlap number is divided by the total number of core semantic elements of the user query to obtain the feature overlap ratio. The second step calculates the semantic relevance: for each overlapping core semantic element, the feature weight value of that element in the document's core semantic content and its relevance in the query's core semantic elements are extracted. The first step is to calculate the overall semantic matching degree. First, the feature weight values ​​of the overlapping elements are multiplied together to obtain the association score of a single overlapping element. Then, the association scores of all overlapping elements are summed to obtain the total association score between the document and the query. The second step calculates the overall semantic matching degree. First, the weight coefficients for feature overlap and semantic relevance are preset, with their sum fixed at 1.0. The feature overlap ratio is multiplied by the feature overlap weight coefficient to obtain the overlap contribution value. The total association score is multiplied by the semantic relevance weight coefficient to obtain the relevance contribution value. Finally, the overlap contribution value and the relevance contribution value are summed to obtain the overall semantic matching degree of the document.

[0058] The process involves filtering and reordering to obtain a subset of target documents. The first step involves setting a semantic matching threshold, preset to 0.3 based on the minimum requirements for semantic relevance in the testing and detection field. The initial relevant document set is then traversed, removing documents with a comprehensive semantic matching score below 0.3 to prevent irrelevant documents from interfering with subsequent processes. The second step involves reordering the remaining documents according to their comprehensive semantic matching score from highest to lowest, forming a reordered document sequence to ensure that documents with higher semantic relevance rank higher. The third step involves setting the selection quantity for the target document subset, selecting a preset number of documents from the beginning of the sorted document sequence. Finally, each document in the target document subset is labeled with key information, including the comprehensive semantic matching score, the reordered ranking, the corresponding unique semantic document vector identifier, and the unique identifier of the original document text. This facilitates accurate retrieval when constructing prompts, ultimately forming the target document subset most semantically relevant to the user's query.

[0059] The establishment and categorized storage of structured indexes make the data relationships in the vectorized knowledge base clear and the retrieval path explicit, improving retrieval efficiency. The generation of query vectors and distance calculation adopt the same logic as semantic document vectors, ensuring the fairness and accuracy of similarity judgment. The dual screening rules not only ensure the comprehensiveness of the initial relevant document set, but also filter out low-relevance vectors, avoiding redundant data and improving the reliability, relevance and practicality of the knowledge base in responding to user queries.

[0060] like Figure 2 As shown, in a preferred embodiment of the present invention, step 6 above, which involves constructing prompt words by combining a subset of the target documents with the user query, inputting them into a large language model to generate a natural language response, and obtaining the result through an interactive question-and-answer interface, may include:

[0061] In this embodiment of the invention, step 660 involves constructing specific prompt words for guiding the large language model based on the content of the user query and the target document subset, according to preset rules. Specifically, this includes: first, formulating a complete set of preset rules, which covers four core elements: role positioning, requirement decomposition, information integration, and response constraints. Each element has clearly defined operational standards to ensure that the prompt word construction is systematic and unambiguous. The first step precisely defines the guiding role, clearly stating the wording at the beginning of the prompt word. The second step refines the core of the query, first extracting the core semantic elements of the user query from step 551; then, according to the query object (scarf) + core requirement 1 (reference standard) + core requirement 2 (detection method) + hidden... The first step involves logically reorganizing the user's needs (precise and actionable), ultimately restating it as follows: the core user requirement is to find the official standard referenced for testing the colorfastness to rubbing of silk scarves, as well as the specific testing methods specified in that standard. Directly referable standard information and step-by-step testing guidelines must be provided. The third step involves deep integration of document information. Documents are sorted by semantic matching degree from highest to lowest, and the following operations are performed on each document: extracting core and effective information. For structured document fragments, extract the standard number, clause number, technical parameter name, parameter value, and applicable conditions. For unstructured semantic unit text, extract the conclusion statement, standard basis, applicable scenario, and limiting conditions. The extracted information is then labeled with a dedicated document. The identifier, formatted as [Document Number - Semantic Matching Degree - Core Information Type], ensures traceability of information. Duplicate information is eliminated by comparing the core information of all documents. If different documents mention the same standard clause or technical parameter, only the information corresponding to the document with the highest semantic matching degree is retained to avoid redundancy. All valid information is integrated according to the industry logic order of reference standards, core clauses, testing methods, technical parameters, scope of application, and limitations to form a structured information list, ensuring that the information arrangement conforms to user query habits. The fourth step clarifies the specific details of the response specification, listing the requirements item by item at the end of the prompt. The structured specification must use the core conclusion (bold) + point-by-point explanation (Arabic numerals, each...). (Points should not exceed 3 sentences) and should be logically ordered as standard information, test preparation, operation steps, and result judgment; Terminology specifications: all terms must be consistent with the target document subset, such as color fastness test should not be written as color fastness test, and humidity conditioning time should not be written as humidity conditioning duration; Standard labeling specifications: when mentioning a standard, both the standard number and the full name of the standard must be indicated; Test method specifications: when describing operation steps, the action + object + parameter must be clearly stated, such as wet rubbing a silk scarf sample with P120 water-resistant fine sandpaper, the number of rubbing times is 10; Information missing handling specifications: if the target document subset does not cover a core requirement in the query, it must be clearly marked in the corresponding position that the relevant information was not found, and it must not be omitted or vaguely mentioned;Language standardization prohibits colloquialisms and vague expressions, and uniformly uses precise technical expressions. The above content is coherently pieced together in the order of guiding role, core query restatement, integrated document information list, and response specification details, forming a logically closed loop with detailed information and clearly defined constraints. This ensures that the large language model can accurately decode the guiding intent and efficiently utilize a subset of target documents to generate compliant original responses.

[0062] Step 661 involves inputting specific prompt words into the large language model to generate an original natural language response based on a subset of the target document content. This includes: firstly, constructing the entire large language model, with each step focusing on its suitability for the testing and inspection field to ensure the model accurately understands professional content and generates standardized responses; secondly, meticulous data preparation by collecting data from diverse domains, including complete texts of national mandatory testing standards, industry recommended standards, and international standards; technical manuals and operating guidelines published by key national testing and inspection institutions; a case database of the testing and inspection industry over the past 10 years; and a professional terminology database reviewed by industry experts. The data is then categorized and organized according to standard texts. Four data subsets were established: categories, technical manuals, case studies, and terminology. Each subset was further subdivided according to the detection domain. Preprocessing involved checking each sentence of the text data, correcting typos, and standardizing punctuation. For long texts exceeding 5000 words, they were semantically split into short sentences of 200-300 words each, with splitting points chosen at paragraph breaks or semantic transitions to ensure semantic integrity was maintained. The second step involved deep pre-training. The preprocessed text data was input into a basic language model in batches, which processed the text using a 12-layer neural network structure. Each short sentence was first segmented into words, converting them into numerical codes recognizable by the basic language model. The hidden layer learns semantic collocation rules in the field of inspection and testing by calculating the association weights between codes; the basic language model attempts to predict the next word in each short sentence, compares the code of the predicted word with the code of the real word, and calculates the error value (error value = sum of the absolute values ​​of the differences between the predicted code and the real code in each dimension, divided by the total number of dimensions); if the error value is greater than a preset threshold, the weight parameters of the neural network are adjusted, and training is repeated until the average error value of all batches of data is less than 0.2, ensuring that the basic language model can accurately capture the semantic logic and sentence structure features in the field; the third step is targeted fine-tuning; 10,000 real question-and-answer samples in the field of inspection and testing are collected and processed according to... The dataset is divided into training and validation sets in an 8:2 ratio, with samples covering different detection domains and query types. Each training sample is input into the pre-trained large language model. The large language model learns the mapping relationship between user query encoding, target document information extraction, and professional response generation. It first parses the core elements in the query encoding, then matches them with the corresponding document information encoding in the training set, and finally generates the response encoding and converts it into text. For every 1000 training samples, the validation set is used to test the response accuracy of the large language model. Accuracy = Number of correct responses generated by the large language model in the validation set ÷ Total number of samples in the validation set. If the accuracy is below 90%, the learning rate is adjusted from 0.001 to 0.0005, retrain the batch of samples; if the accuracy is higher than 95%, maintain the learning rate until the entire training set is completed and the validation set accuracy is stable above 92%; incorporate semantic matching logic into the fine-tuning process, converting the semantic matching value in step 553 into weights, so that the large language model prioritizes calling information from highly matched documents when generating responses; the fourth step is adaptive deployment, adapting the fine-tuned model to the knowledge base system interface to ensure that the large language model can receive the prompt words output by the system and that the output responses can be received by the system; set the large language model generation parameters: maximum generated text length is set to 2000 characters; temperature parameter is set to 0.3; response timeout is set to 10 seconds to ensure that users do not have to wait for a long time; conduct stress testing. Simulating simultaneous queries from 100 users, the response speed and stability of the large language model were tested. If a response delay exceeded 10 seconds, the model's computational resource allocation was optimized until the stress test passed. After the large language model was built, the specific prompt words constructed in step 660 were fully input into the large language model. The large language model first parses the guiding role and response specification details in the prompt words, clarifying the response boundaries and format requirements; then it extracts the core semantic codes from the core query paraphrasing and matches them with the integrated document information codes; the language is organized logically according to a conclusion-first and point-by-point approach, prioritizing information from documents with high semantic matching to ensure that each point corresponds to the core content in the document, generating a raw natural language response without fabricated information and conforming to the preliminary specifications.

[0063] Step 662 involves conducting a standardization review and terminology calibration of the original natural language response to generate an intermediate response text that conforms to the standards of the testing and inspection field. Specifically, this includes: firstly, constructing a standard library of testing and inspection standards to ensure clear basis for review and calibration; collecting standardized testing and inspection terminology standards, test report writing rules, and terminology manuals; classifying and organizing the terms, expression specifications, and unit standards within these libraries to form a terminology standard sub-library, an expression specification sub-library, and a unit standard sub-library; the terminology standard sub-library is categorized by testing field, with each term including a standard expression, prohibited expressions, and a definition; the expression specification sub-library clarifies sentence structure requirements and a list of prohibited words; the unit standard sub-library standardizes the unit writing of technical parameters; the first step involves conducting a standardization review sentence by sentence, reading the original natural language response from beginning to end, focusing on three aspects for each sentence: whether it contains colloquialisms, whether it contains vague expressions, and whether the unit expression is standardized; if colloquialisms are found, they are directly replaced with standard expressions; if vague expressions are found, they are replaced with precise expressions based on the content of the target document subset; if... The first step involves identifying non-standard unit expressions and correcting them according to the unit's standard sub-library. Punctuation usage is checked, ensuring that bullet points are uniformly expressed using Arabic numerals followed by commas, and that clause citations are enclosed in parentheses, avoiding the mixing of Chinese and English punctuation to ensure neat formatting. The second step involves word-by-word terminology calibration, extracting all terms from the response and comparing them to the standard terminology sub-library. If a term matches the standard expression, the original expression is retained; if it is a prohibited expression, it is directly corrected to the standard expression; if it is an abbreviation, a complete expression is added and marked upon its first appearance, and the abbreviation can be used directly upon its recurrence; if a term is missing, the corresponding standard number is extracted from the target document subset and added; if a term is incorrect, it is corrected according to the standard terminology sub-library and the error location is marked. The third step involves recording and integrating the modification history, recording all modifications in tabular form, including the modification location, the original expression, the revised expression, and the basis for the modification, ensuring traceability of the modifications; and integrating all modified sentences in their original logical order, eliminating redundant expressions resulting from the modifications, to form an intermediate response text that is precise in terminology, standardized in expression, and free from colloquialisms and ambiguities.

[0064] Step 663 involves performing a final check on the logical structure and information integrity of the intermediate response text to generate the final natural language response for presentation. Specifically, this includes: first, defining dual verification benchmarks to ensure clear targets for verification; the core semantic element benchmark, listing the core semantic elements of the user query extracted in step 551 as mandatory verification items, with each element corresponding to a verification point; and the target document information benchmark, listing the core information of the target document subset marked in step 553 as mandatory verification items, with each document's core information corresponding to a verification point. The first step involves conducting a logical structure check to verify whether the overall response structure conforms to... The requirements for concluding with a summary and presenting points in detail should be followed. Ensure the core conclusion is at the beginning of the response and that points are logically ordered according to reference standards, testing preparation, operational steps, and result determination. Check the coherence between points, ensuring each point builds upon the previous one. Examine the internal logic of each point to ensure it conforms to the action + object + parameter description logic. If logical inconsistencies exist, readjust the point order according to the actual operational process. If any point lacks internal logic, retrieve the corresponding parameters from the target document subset to supplement it. The second step involves verifying information completeness, checking each mandatory verification item, and ensuring each user's query is complete. To ensure semantic elements are covered in the response, if the query includes reference standards and detection methods, the response must clearly address both without omissions. Verify that all mandatory validation items are included, ensuring that core information from highly semantically matched documents in the target document subset is utilized. For example, if document 1 mentions a wet friction moisture content ≥65%, confirm that the response includes this parameter. Calculate the information coverage rate: Information coverage = (Number of covered validation items ÷ Total number of validation items). If the coverage rate is below 90%, return to the target document subset to extract any uncovered information and supplement it in the response. If the target document subset lacks corresponding information, then include it in the response. The corresponding location is clearly marked as not found, with an explanation of the missing content; check for information redundancy, and whether the response contains content irrelevant to the query, and delete any redundant information; the third step is final optimization and integration, adjusting the fluency of the response sentences, optimizing stiff expressions into coherent expressions; delete duplicate expressions, such as multiple complete annotations of the same standard number, only retaining the first complete annotation, and simplifying subsequent annotations to numbers; perform a final read-through of the intermediate response text to ensure there are no logical gaps, no missing information, and no redundant content, generating a final natural language response that is clearly structured, complete in information, and logically rigorous.

[0065] Step 664: Organize and present the final natural language response through an interactive question-and-answer interface to complete the response to the user's query. Specifically, this includes: First, determining the presentation logic of the interactive question-and-answer interface, focusing on enabling users to quickly obtain core information, conveniently verify information, and flexibly perform subsequent operations. The following operations are performed: First, refine the formatting of the response text. The core conclusion section uses bold Song typeface (size 2), centered and highlighted; the detailed points use Song typeface (size 4), left-aligned, numbered 1, 2, 3, ..., with two spaces before each point; key information such as the detection standard number, technical parameters, and tool name is displayed in bold Song typeface (size 4). Bold Song typeface is used for annotations; supplementary explanations use gray Song typeface, size 12, left-aligned, with two spaces in front, to maintain visual distinction from the core content; paragraph spacing: one line space between the core conclusion and the details, half a line space between the points, and one line space between the supplementary explanations and the details, to ensure a clean and readable interface; the second step is to construct a traceable information source pattern, setting the information source pattern below the response text, with the pattern title using bold Song typeface, size 12, left-aligned, with two spaces in front; the pattern content is sorted from high to low semantic matching degree, and each source includes document number + document identifier + semantic matching degree + link to the original text fragment, with the document identifier using a retrieval method. The coding rules for the testing domain, standard number, and fragment sequence number are as follows: semantic matching degree is retained to two decimal places; after the user clicks the link to the original text fragment, a new window pops up, displaying the corresponding original document text fragment and indicating its position in the original document, facilitating user verification of information authenticity; the third step is to configure convenient subsequent interactive functions; two function buttons are set at the bottom of the interface, with button names in bold Song typeface (size 4), a light blue background, centered alignment, and a 20-pixel spacing between buttons; a further question button, when clicked by the user, automatically redirects the interface to the query input box, which is pre-filled with "based on the color fastness test of silk scarf rubbing". To provide further information and core details of the current response, users can easily supplement their queries. The "Export Response Results" button generates a PDF file upon user click. The file includes the response title, the final natural language response text, the information source module, and the export timestamp. The file naming convention is: Detection Query Response - User Query Keywords - Export Timestamp. Users can directly download and archive the file or edit it. After completing the layout, source tracing mode construction, and interactive function configuration, the final natural language response is fully presented in the interactive Q&A interface, ensuring a reasonable interface layout, convenient operation, and a complete response to user queries.

[0066] The meticulous construction of the large language model throughout the entire process enables it to deeply learn the semantic logic, terminology norms, and response patterns in the field of inspection and testing. This improves the professionalism and accuracy of the generated original responses. The sentence-by-sentence and word-by-word operation of standardization review and terminology calibration completely eliminates colloquial and vague expressions, unifies terminology and unit standards, eliminates ambiguity in information transmission, and ensures the professionalism and rigor of the responses.

[0067] Embodiments of the present invention also provide a computing device, including: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0068] Embodiments of the present invention also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0069] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for constructing a multivariate knowledge base in the field of inspection and testing based on a large model, characterized in that, The method includes: Step 1: Perform feature preprocessing on the structured and unstructured raw data in the field of inspection and testing to form a document set; Step 2: Decompose the document collection into several basic semantic units to construct a preliminary knowledge topology network, and convert the basic semantic units into embedding vectors to form a set of semantic unit vectors; Step 3: Based on the set of semantic unit vectors, calculate the distance and density between semantic units in the vector space, and perform dynamic semantic partitioning according to the aggregation characteristics of semantic units, adjust the decision boundary of each partition, and form multiple semantically consistent regions. Step 4: Analyze the distance distribution and angle relationship between the semantic unit vectors inside and outside each semantic consistency region, quantify the semantic tightness and association strength between the semantic unit and the region core, generate the regional semantic calibration coefficient, and calibrate the semantic unit based on the regional semantic calibration coefficient to obtain the calibrated semantic document data. Step 5: Store the calibrated semantic document data in a vector database to form a vectorized knowledge base. When responding to user queries, convert the query into a query vector, obtain the initial relevant document set from the vectorized knowledge base through approximate nearest neighbor retrieval, and use the re-ranking model to filter the initial relevant document set by semantic matching degree to obtain the target document subset. Step 6: Combine the target document subset with the user query to construct prompt words, input them into the large language model to generate a natural language response, and obtain the results through an interactive question-and-answer interface.

2. The method for constructing a multi-dimensional knowledge base in the field of inspection and testing based on a large model as described in claim 1, characterized in that, Step 1 includes converting structured data into standardized document fragments by column attributes, and segmenting and identifying unstructured data by topic.

3. The method for constructing a multi-dimensional knowledge base in the field of inspection and testing based on a large model as described in claim 2, characterized in that, The document collection is decomposed into several basic semantic units to construct a preliminary knowledge topology network, and the basic semantic units are converted into embedding vectors to form a set of semantic unit vectors, including: The document collection is structurally decomposed by identifying semantic boundaries and dividing each document into multiple basic semantic units to obtain a set of basic semantic units; Semantic association analysis is performed on the set of basic semantic units to determine the semantic associations between each basic semantic unit, and a preliminary knowledge topology network is constructed with each basic semantic unit as a node and semantic associations as edges. For each basic semantic unit corresponding to each node in the preliminary knowledge topology network, semantic features are extracted and vectorized, and each basic semantic unit is converted into a high-dimensional embedding vector, generating a set of semantic unit vectors corresponding to the network structure.

4. The method for constructing a multi-dimensional knowledge base in the field of inspection and testing based on a large model as described in claim 3, characterized in that, Based on a set of semantic unit vectors, the distance and density between semantic units are calculated in the vector space. Dynamic semantic partitioning is then performed based on the clustering characteristics of the semantic units, adjusting the decision boundaries of each partition to form multiple semantically consistent regions, including: Based on the set of semantic unit vectors, the distance between each embedded vector and its neighboring vectors is calculated in the vector space, and the local density value of each embedded vector is calculated based on the distance. Based on the distance and local density values ​​of each embedding vector, embedding vectors with high local density and a certain distance from high-density vectors are identified and determined as core semantic points representing different semantic clusters. Centered on the core semantic point, and based on the distance metric between vectors, non-core embedding vectors are divided into regions represented by the nearest core semantic point, forming multiple initial semantic partitions. Based on multiple initial semantic partitions, the ambiguity of the embedded vectors at the boundaries of adjacent partitions is analyzed. Through multiple rounds of adjustment of the decision boundaries of each partition, partitions with high semantic overlap are merged, and the boundaries of partitions with strong independence are strengthened, ultimately forming multiple final semantic regions with clear boundaries and consistent internal semantics.

5. The method for constructing a multi-dimensional knowledge base in the field of inspection and testing based on a large model as described in claim 4, characterized in that, The distance distribution and angle relationship between semantic unit vectors inside and outside each semantic consistency region are analyzed to quantify the semantic tightness and association strength between semantic units and the region core. Regional semantic calibration coefficients are generated, and semantic units are calibrated based on these coefficients to obtain calibrated semantic document data, including: Based on each semantically consistent region, the distance distribution between each embedded vector within the region and the angle relationship between the vectors within the region and the selected relevant external region vectors are analyzed to obtain the semantic structure analysis results. Based on the semantic structure analysis results, the semantic tightness quantification value between each embedding vector and its corresponding region core, as well as the semantic association strength quantification value between each embedding vector and the remaining related region cores are calculated. Based on the semantic tightness quantization value and the semantic association strength quantization value, a corresponding regional semantic calibration coefficient is determined for each embedding vector. By using the regional semantic calibration coefficients, the corresponding original embedding vectors are calibrated to obtain the calibrated semantic document data.

6. The method for constructing a multi-dimensional knowledge base in the field of inspection and testing based on a large model as described in claim 5, characterized in that, The calibrated semantic document data is stored in a vector database to form a vectorized knowledge base. When responding to user queries, the query is converted into a query vector. An initial set of relevant documents is retrieved from the vectorized knowledge base using approximate nearest neighbor retrieval. A re-ranking model is then used to filter the initial set of relevant documents based on semantic matching, resulting in a subset of target documents, including: The calibrated semantic document data is converted into a high-dimensional vector representation to generate semantic document vectors. The semantic document vectors are then indexed with the corresponding original document text and stored in a vector database to form a vectorized knowledge base. When responding to a user query, the user query text is converted into a query vector with a high-dimensional vector representation, and based on the query vector, the distance between the query vector and each semantic document vector in the vectorized knowledge base is calculated. Based on the distance filtering, select the semantic document vectors with the highest similarity to the query vector, and based on the index relationship between the selected semantic document vectors and the original document text, obtain the corresponding initial set of relevant documents. The semantic matching degree between each document in the initial relevant document set and the user query is calculated using a re-ranking model. Based on the semantic matching degree, the initial relevant document set is filtered and re-ranked to obtain the target document subset that is most semantically relevant to the user query.

7. The method for constructing a multi-dimensional knowledge base in the field of inspection and testing based on a large model as described in claim 6, characterized in that, The semantic match degree between each document in the initial relevant document set and the user query is calculated using a re-ranking model. Based on the semantic match degree, the initial relevant document set is filtered and re-ranked to obtain a subset of target documents that are most semantically relevant to the user query, including: The user query is combined with each document in the initial relevant document set to form multiple query document pairs; The set of query document pairs is input into the re-ranking model, and the semantic relevance score between each query document pair is obtained through deep semantic analysis. Based on the semantic relevance score, each document in the initial relevant document set is assigned a corresponding semantic matching metric value, forming a set of semantic matching metric values; Based on the set of semantic matching metrics, the documents in the initial relevant document set are reordered from high to low scores to obtain a reordered document sequence. A preset number of documents are then selected from the front of the reordered document sequence to form the final target document subset.

8. The method for constructing a multi-dimensional knowledge base in the field of inspection and testing based on a large model as described in claim 7, characterized in that, The target document subset is combined with the user query to construct prompt words, which are then input into a large language model to generate a natural language response. The results are obtained through an interactive question-and-answer interface, including: Based on the content of the user query and the target document subset, specific prompt words are constructed according to preset rules to guide the large language model; Specific prompt words are input into a large language model to generate an original natural language response based on the content of a subset of the target document; The original natural language responses are subject to standardization review and terminology calibration to form intermediate response texts that conform to the standards of the testing and inspection field; The intermediate response text undergoes a final check for logical structure and information integrity, generating the final natural language response for presentation. The final natural language response is organized and presented through an interactive question-and-answer interface to complete the response to the user's query.

9. A computing device, characterized in that, include: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that, when executed by a processor, implements the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Knowledge base retrieval method fused with natural language large model

    CN121168677A

  • Embedded data synthesis method and device integrating retrieval and large model distillation and medium

    CN121365670A