A training method of an intent recognition model for understanding user requirements in a software development scenario
By constructing a hierarchical variable-dimensional projection matrix and semantically orthogonal logical conflict samples in the context of Wensheng software, and optimizing the neural network weights, the problem of low recognition accuracy in existing technologies is solved, and accurate recognition of fine-grained operation instructions in complex software environments is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN JINIU SOFTWARE TECH CO LTD
- Filing Date
- 2026-02-09
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies cannot effectively identify fine-grained operation instructions in complex software contexts, leading to semantic confusion and logical conflicts, failing to construct clear inter-class boundaries, and resulting in low recognition accuracy.
By acquiring software architecture topology data, designing a hierarchical variable-dimensional projection matrix mapping table, identifying semantic orthogonal logical conflict samples, constructing orthogonal constraint terms for feature branches within the hierarchy, optimizing neural network weights, and building a textual software intent recognition model.
It achieves accurate recognition of fine-grained operation instructions in complex software environments. By using hierarchical variable-dimensional projection matrices and semantically orthogonal logical conflict samples, it forces the separation of feature representations of parallel architecture branches, constructs a high-discrimination decision boundary, and improves recognition accuracy.
Smart Images

Figure CN121682283B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of model training and learning technology, and in particular to a training method for an intent recognition model for understanding user needs in text-based software scenarios. Background Technology
[0002] The field of model training and learning technology encompasses the technology of enabling computer systems to automatically analyze data to obtain patterns through computational means, and then using these patterns to make predictions or decisions about unknown data.
[0003] The core aspects of this field include constructing neural network topologies, setting target loss functions, and iteratively updating the model's internal parameters using optimization strategies such as backpropagation or stochastic gradient descent, so that the model can approximate the target data distribution and improve feature extraction and pattern recognition capabilities.
[0004] The traditional training method for intent recognition models used in text-based software scenarios to understand user needs refers to the process of parsing the natural language text input by the user describing the software functions in order to determine the corresponding software operation instructions.
[0005] Existing technologies employ manual annotation to establish a sample set containing user command text and standard intent labels. They then use the bag-of-words model or Word2Vec technology to convert the text sequence into a high-dimensional numerical vector, which is then input into a support vector machine or long short-term memory network for supervised training. The model parameters are established by calculating the cross-entropy value between the predicted result and the true label, and adjusting the network connection weights based on this value.
[0006] Existing technologies employ globally fixed-dimensional text vectorization representations and general supervised learning mechanisms, ignoring the inherent tree-like nested hierarchical dependencies within the software architecture. This results in the model's inability to dynamically perceive the logical granularity differences between nodes at different depths. When processing deep, specific functions, semantic confusion arises due to the limited feature representation space. Furthermore, the lack of sample adversarial mining for code logic conflicts leads to high overlap between structurally similar but intentionally different sibling branches in the feature space, making it impossible to construct clear inter-class boundaries. Consequently, the recognition accuracy of fine-grained operation instructions in complex software contexts is low. Summary of the Invention
[0007] To address the technical problems existing in the prior art, embodiments of the present invention provide a training method for an intent recognition model for understanding user needs in text-based software scenarios, comprising the following steps:
[0008] To achieve the above objectives, the present invention adopts the following technical solution: a training method for an intent recognition model for understanding user needs in text-based software scenarios, comprising the following steps:
[0009] S1: Obtain the topology data of the Wensheng software architecture, traverse the path to determine the hierarchical position of the node relative to the root node, design the row and column structure of the projection matrix and allocate multi-dimensional space for shallow nodes and finite-dimensional space for deep nodes to obtain the architecture hierarchical variable-dimensional projection matrix mapping table.
[0010] S2: Based on the training environment determined by the hierarchical variable-dimensional projection matrix mapping table of the architecture, collect code fragments and corresponding natural language annotations in the source code library, calculate the semantic association degree between variable identifiers and annotation entity nouns in the vector space, and generate semantically orthogonal logical conflict sample pairs.
[0011] S3: Identify the hierarchical position of the target architecture node in the semantic orthogonal logical conflict sample pair, call the architecture hierarchical variable-dimensional projection matrix mapping table, retrieve the target projection matrix that matches the hierarchical position, change the dimensional granularity of the feature expression, and obtain the hierarchical variable-dimensional feature vector.
[0012] S4: Based on the hierarchical variable-dimensional feature vector, identify sibling architecture nodes at the same level in the software architecture, obtain the feature representation of the sibling node and perform vector dot product operation with the real-time node feature, evaluate the degree of overlap generated by the vector dot product operation, and obtain the orthogonal constraint term of the feature branch within the hierarchy.
[0013] As a further aspect of the present invention, the architecture-level variable-dimensional projection matrix mapping table includes a node-level depth index, differentiated dimension configuration parameters, and projection matrix row and column specifications. The semantically orthogonal logical conflict sample pairs include code snippets with semantic bias, logically mutually exclusive variable entities, and original natural language description text. The hierarchical variable-dimensional feature vectors include geometric space transformation coordinate values, hierarchical adaptive dimension values, and variable-granularity semantic feature encoding. The orthogonal constraint terms of feature branches within the hierarchy include branch independence quantization coefficients, feature space overlap measurement values, and sibling node correlation cumulative penalty values.
[0014] As a further aspect of the present invention, the specific steps of S1 are as follows:
[0015] S101: Obtain the topology data of the Wensheng software architecture, parse the internally defined node entities and the connection edge attributes between nodes, take the root node of the topology as the traversal starting point, search for subordinate nodes level by level along the connection edge, calculate the shortest path hop count of the subordinate node relative to the root node, assign the shortest path hop count as a quantitative index to the corresponding node, divide and classify the nodes according to the hop count value, extract the node identifier and corresponding hop count features within the level, and generate a node level depth distribution sequence.
[0016] S102: Call the node hierarchy depth distribution sequence, set the hierarchy segmentation benchmark value, determine the nodes whose hop count feature is less than the hierarchy segmentation benchmark value as shallow nodes, calculate the multidimensional row and column values, determine the nodes whose hop count feature is greater than or equal to the hierarchy segmentation benchmark value as deep nodes, and generate a set of differentiated dimension space configuration parameters.
[0017] S103: Based on the differentiated dimensional space configuration parameter set, construct the corresponding empty projection matrix framework according to the row and column values, extract the hierarchical position coordinate information of the nodes, establish a one-way index logic pointing the hierarchical position coordinates to the row and column structure of the projection matrix framework, perform integrity verification and conflict detection on the index logic of the nodes, and serialize and arrange the index logic that has been verified without error in the order of shallow to deep hierarchy to obtain the architecture hierarchical variable dimension projection matrix mapping table.
[0018] As a further aspect of the present invention, the specific steps of S2 are as follows:
[0019] S201: Obtain code snippets and bound natural language comments from the source code repository, perform data flow analysis on the code snippets, identify key variable identifiers, perform entity recognition on the natural language comments, extract core entity nouns, and bind variable identifiers and entity nouns to the same source based on the correspondence between code line numbers and comment paragraphs, generating a group of variable identifiers and comment nouns with the same source.
[0020] S202: Call the cognate group of the variable identifier and the annotation noun, convert the text data in the cognate group into a multi-dimensional space vector, calculate the cosine similarity between the variable identifier vector and the annotation noun vector, quantify the degree of semantic fit between the two, and obtain a set of semantic space association quantification indicators.
[0021] S203: Based on the semantic space correlation metric set, retrieve heteronyms that are vertically or negatively correlated, forcibly replace the original variable identifiers in the original code snippet with the heteronyms, retain the original comment content, construct an adversarial scenario of deviation between code logic and comment description, and generate semantic orthogonal logic conflict sample pairs.
[0022] As a further aspect of the present invention, the specific steps of S3 are as follows:
[0023] S301: Call the semantic orthogonal logic conflict sample pair, parse the syntactic dependency relationship of the code fragments included in the semantic orthogonal logic conflict sample pair, locate the hierarchical depth of the target architecture node in the software architecture topology, extract the hierarchical depth value as the hierarchical positioning identifier, perform numerical encoding conversion on natural language and code text, combine and package the hierarchical positioning identifier and numerical encoding result to generate node hierarchical index and text encoding vector group;
[0024] S302: Based on the node level index and text encoding vector group, read the level positioning identifier encapsulated in the group, use the level positioning identifier as a key value to input the architecture level variable dimension projection matrix mapping table for traversal retrieval, lock the target matrix structure configuration parameters that match the level depth, construct a linear transformation entity with target row and column dimensions according to the target matrix structure configuration parameters, and generate the target level spatial projection matrix.
[0025] S303: For the target hierarchical spatial projection matrix, call the numerical encoding result in the node hierarchical index and text encoding vector group, perform matrix multiplication operation between the input vector and the projection matrix, map the original vector data to the geometric feature space defined by the target hierarchical spatial projection matrix, and reshape the feature expression according to the dimensionality attribute to obtain the hierarchical variable dimension feature vector.
[0026] As a further aspect of the present invention, the positioning of the target architecture node in the software architecture topology is limited to an integer value that is not less than 1 layer and not greater than a preset maximum number of layers, and the layer depth value is normalized and used as a layer positioning identifier to participate in the combination and packaging.
[0027] In the architecture-level variable-dimensional projection matrix mapping table, matrix structure configuration parameters with different row and column dimensions are pre-stored for different level depths. The number of rows or columns of the matrix corresponding to adjacent level depths has at least one dimension difference, and the matrix structure configuration parameters are limited to a set of positive integer dimensions.
[0028] The construction process of the linear transformation entity is limited to directly generating a dense matrix structure based on the matrix structure configuration parameters, and the data type of the matrix elements is fixed to be consistent with the data type of the numerical encoding result.
[0029] Before performing the matrix multiplication operation, the vector length of the numerical encoding result is checked. When the vector length is inconsistent with the column dimension of the target hierarchical spatial projection matrix, linear interpolation or a feature mapping layer is used to align the dimensions and generate the hierarchical variable-dimensional feature vector.
[0030] As a further aspect of the present invention, the specific steps of S4 are as follows:
[0031] S401: Based on the hierarchical variable-dimensional feature vector, parse the node index and hierarchical attributes it carries, traverse the software architecture topology data, identify the sibling nodes under the same parent node branch as the node, extract the real-time status feature data of the sibling nodes, convert the real-time status feature data into a vector form consistent with the dimension of the target node, summarize the vector data of the sibling nodes, and generate a feature set of sibling nodes at the same level.
[0032] S402: Call the feature set of sibling nodes at the same level, perform a pairwise vector dot product operation with the hierarchical variable-dimensional feature vector, calculate the projection component magnitude of the target vector in the direction of the sibling node vector, characterize the degree of non-orthogonal overlap of the differentiated architecture branches in the feature space according to the magnitude of the projection component magnitude, arrange the calculated values in order to obtain the branch feature projection overlap scalar sequence.
[0033] S403: For the branch feature projection overlap scalar sequence, perform the summation operation of the sequence values to quantify the total correlation between the target node features and the sibling node features, define the total correlation value as the penalty term to be minimized in model training, and generate the orthogonal constraint term of the feature branches within the layer.
[0034] As a further aspect of the present invention, the real-time state feature data of the sibling nodes is limited to structural state vectors collected within the same time window, and when converted into a vector form consistent with the dimension of the target node, a fixed-length numerical encoding rule is adopted to eliminate dimensional differences.
[0035] The pairwise vector dot product operation is limited to being performed after all vector elements have been normalized, and the magnitude of the projection component is limited to a non-negative real number.
[0036] The arrangement rule of the branch feature projection overlap scalar sequence is limited to arranging them in descending order of value, and only retaining sequence elements with values not less than a preset threshold to participate in the cumulative summation operation;
[0037] The summation operation is limited to performing a one-time linear summation on all retained elements in the branch feature projection overlap scalar sequence to generate orthogonal constraint terms for feature branches within the hierarchy.
[0038] As a further aspect of the present invention, the method further includes step S5:
[0039] S5: Based on the orthogonal constraint term of the feature branch within the level, calculate the Euclidean distance between the hierarchical variable-dimensional feature vector and the true intent label, construct an optimization objective that minimizes the positive sample distance and maximizes the conflict sample distance, perform backpropagation, update the weight configuration of the neural network, and construct the Wensheng software intent recognition optimization model.
[0040] The Wensheng software intent recognition optimization model includes converged neural network weight parameters, intent classification probability distribution information, and optimized feature space mapping rules.
[0041] As a further aspect of the present invention, the specific steps of S5 are as follows:
[0042] S501: Call the orthogonal constraint terms of the feature branches within the level, obtain the true intent label vector, calculate the Euclidean distance between the feature vector and the true label, calculate the distance between the feature vector and the conflict sample label, integrate the orthogonal constraint terms of the feature branches within the level according to the principle of minimizing the difference of positive samples and maximizing the distance of conflict samples, perform a weighted summation operation, and obtain the composite spatial distance loss metric.
[0043] S502: Based on the composite spatial distance loss metric, backpropagation is performed on the neural network. The partial derivative of the loss metric with respect to the weights of the multi-layer connections is calculated according to the chain rule. The distribution of the error transmission between network layers is determined. The magnitude and direction of the numerical values that need to be adjusted for each neuron node parameter in the real-time iteration round are quantified. The gradient correction tensor of the weights of all network nodes is generated.
[0044] S503: For the weight gradient correction tensor of the entire network nodes, perform gradient descent update operation, apply the correction tensor values element by element to the weight matrix of the real-time neural network, dynamically adjust the mapping parameters of the real-time neural network from the feature space to the intent space, cyclically update the connection state inside the network until the parameter distribution converges, fix the weight configuration parameters, and construct the Wensheng software intent recognition optimization model.
[0045] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0046] In this invention, a mapping mechanism between hierarchical positions and variable-dimensional projection matrices is established through software architecture topology. Multi-dimensional space is allocated to shallow nodes to accommodate macroscopic semantics and the dimensions of deep nodes are restricted to focus on specific logic, thus solving the problem of mismatch between feature granularity and architecture depth. By constructing semantically orthogonal logical conflict samples and introducing orthogonal constraints on the feature branches of sibling nodes, the feature representations of parallel architecture branches are forcibly separated in the vector space, maximizing the spacing between logical conflict samples and eliminating the semantic overlap of similar functional nodes. A highly discriminative decision boundary is constructed to accurately parse complex nested instructions. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a schematic diagram of the steps of the present invention;
[0049] Figure 2 This is a detailed schematic diagram of S1 of the present invention;
[0050] Figure 3This is a detailed schematic diagram of S2 of the present invention;
[0051] Figure 4 This is a detailed schematic diagram of S3 of the present invention;
[0052] Figure 5 This is a detailed schematic diagram of S4 of the present invention;
[0053] Figure 6 This is a detailed schematic diagram of S5 of the present invention. Detailed Implementation
[0054] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0055] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0056] Please see Figure 1 This invention provides a method for training an intent recognition model for understanding user needs in text-based software scenarios, comprising the following steps:
[0057] S1: Obtain the topology data of the Wensheng software architecture, traverse the path to determine the hierarchical position of the node relative to the root node, design the row and column structure of the projection matrix and allocate multi-dimensional space for shallow nodes and finite-dimensional space for deep nodes, establish the mapping relationship between the hierarchical position and the target matrix structure, and obtain the architecture hierarchical variable-dimensional projection matrix mapping table.
[0058] S2: Based on the training environment determined by the hierarchical variable-dimensional projection matrix mapping table, code snippets and corresponding natural language annotations are collected from the source code library, the data flow is analyzed, variable identifiers and annotation entity names are identified, the semantic correlation between variable identifiers and annotation entity names in the vector space is calculated, identifiers that are vertical or negatively correlated are selected to replace the original variables, and semantically orthogonal logical conflict sample pairs are generated.
[0059] S3: Identify the hierarchical position of the target architecture node in the semantic orthogonal logical conflict sample pair, call the architecture hierarchical variable-dimensional projection matrix mapping table, retrieve the target projection matrix that matches the hierarchical position, perform the multiplication operation between the input text semantic vector and the target projection matrix to transform the geometric space representation, change the dimensional granularity of the feature expression, and obtain the hierarchical variable-dimensional feature vector.
[0060] S4: Based on the hierarchical variable-dimensional feature vector, identify sibling architecture nodes at the same level in the software architecture, obtain the feature representation of the sibling nodes and perform vector dot product operation with the real-time node features, evaluate the degree of overlap generated by the vector dot product operation, quantify the independence between parallel architecture branches, accumulate the operation results of the sibling nodes as the penalty basis for model optimization, and obtain the orthogonal constraint term of the feature branches within the hierarchy.
[0061] S5: Based on the orthogonal constraint term of the feature branches within the hierarchy, calculate the Euclidean distance between the hierarchical variable-dimensional feature vector and the true intent label, construct an optimization objective that minimizes the positive sample distance and maximizes the conflict sample distance, perform backpropagation, update the weight configuration of the neural network, and construct the Wensheng software intent recognition optimization model.
[0062] The architecture-level variable-dimensional projection matrix mapping table includes node-level depth indexes, differentiated dimension configuration parameters, and projection matrix row and column specifications. Semantic orthogonal logical conflict sample pairs include code snippets with semantic bias, logically mutually exclusive variable entities, and original natural language description text. The hierarchical variable-dimensional feature vectors include geometric space transformation coordinate values, hierarchical adaptive dimension values, and variable-granularity semantic feature encoding. The orthogonal constraint terms of feature branches within the hierarchy include branch independence quantization coefficients, feature space overlap measurement values, and sibling node correlation cumulative penalty values. The Wensheng software intent recognition optimization model includes convergent neural network weight parameters, intent classification probability distribution information, and optimized feature space mapping rules.
[0063] Please see Figure 2 The specific steps of S1 are as follows:
[0064] S101: Obtain the topology data of the Wensheng software architecture, parse the internally defined node entities and the connection edge attributes between nodes, take the root node of the topology as the traversal starting point, search for subordinate nodes level by level along the connection edge, calculate the shortest path hop count of the subordinate node relative to the root node, assign the shortest path hop count as a quantitative index to the corresponding node, divide and classify the nodes according to the hop count value, extract the node identifier and corresponding hop count features within the level, and generate a node level depth distribution sequence.
[0065] Establish a communication connection with the software configuration management system. Extract the architecture topology data of the Wensheng software by reading configuration files or parsing the source code directory tree structure. The process performs in-depth analysis on the internally defined node entities (such as classes, interfaces, and service components) and the connection edge attributes between nodes (such as call relationships, inheritance relationships, and data dependencies). Set the root node of the topology structure as the traversal starting point and use the breadth-first search algorithm (BFS) to search for subordinate nodes level by level along the connection edges. For each retrieved subordinate node, the process calculates the shortest path hop count relative to the root node. Specifically, it counts the minimum number of connection edges required to reach the target node from the root node and assigns this number as a quantitative indicator to the corresponding node. Based on the size of the hop count, the nodes in the entire network are hierarchically divided and classified.
[0066] Taking a typical microservice e-commerce architecture as an example, assuming that "API Gateway (Gateway)" is the root node (hop count 0), if "Auth Service (Auth_Service)" is directly called by the gateway, its hop count is 1, and it belongs to the first level; if "User Data Object (User_DAO)" is called by "User Service (User_Service, hop count 2)," and "User Service" is called by "Business Controller (Biz_Controller, hop count 1)," and the controller is called by the gateway, then the shortest path for "User_DAO" to reach the root node is Gateway->Controller->Service->DAO, and its hop count feature is calculated as 3, belonging to the third level. Subsequently, the node identifiers and corresponding hop count features in each level are extracted and assembled in sequence to generate a node level depth distribution sequence, as shown in Table 1, which displays some of the parsed node level distribution data;
[0067] Table 1: Example of node hierarchy depth analysis
[0068]
[0069] As shown in Table 1, this process provides a precise topological basis for subsequent feature dimension configuration by quantifying the depth position of nodes in the architecture.
[0070] S102: Call the node hierarchy depth distribution sequence, set the hierarchy segmentation benchmark value, determine the nodes whose hop count feature is less than the hierarchy segmentation benchmark value as shallow nodes, calculate the multidimensional row and column values, determine the nodes whose hop count feature is greater than or equal to the hierarchy segmentation benchmark value as deep nodes, and generate a set of differentiated dimension space configuration parameters.
[0071] A hierarchical segmentation baseline is set, which is determined based on the complexity of the architecture and the inflection point of the depth distribution curve. For example, it is calculated by averaging the number of hops of nodes and rounding up. In this embodiment, the baseline value is set to 3. The process determines nodes with a hop count feature value less than 3 as shallow nodes. For shallow nodes, the process calculates multi-dimensional row and column values based on the full features, that is, it counts the sum of the number of metadata fields associated with the node, the code length of the code line feature, and the number of interface parameters, and uses it as the dimension parameter of the high-dimensional feature space. At the same time, nodes with a hop count feature value greater than or equal to 3 are determined as deep nodes. For deep nodes, the process introduces the principal component retention rate parameter (set to 95%). By performing singular value decomposition (SVD) on the original feature matrix of the node, the minimum number of principal components required to retain 95% of the cumulative variance contribution rate (i.e., information content) is calculated, and this number is used as the finite-dimensional row and column value. The dimension values calculated by each node are integrated to generate a differentiated dimension space configuration parameter set.
[0072] In terms of numerical computation logic, assuming that a shallow node (such as Order_Service) has 20 metadata fields, the length of the code line count feature after being encoded by the bag-of-words model is 50, and the number of input parameters defined by the interface is 10, the process performs an accumulation operation on these three values, that is, 20 plus 50 plus 10, to obtain a result of 80. This value of 80 is established as the full feature dimension value corresponding to the shallow node. For deep nodes (such as User_DAO), assuming that the sum of the eigenvalues of its original feature covariance matrix is 100 (representing the total amount of information), if its eigenvalues are sorted from largest to smallest, the sum of the top 5 largest eigenvalues is 95. At this time, the cumulative contribution rate reaches 95 / 100=95%, which meets the retention rate requirement. Then, the process establishes the value 5 as the finite-dimensional row and column value of the deep node. In this way, it achieves the differentiated configuration of retaining rich details for shallow high-frequency changing nodes and performing noise reduction and compression for deep stable support nodes.
[0073] S103: Based on the differentiated dimensional space configuration parameter set, construct the corresponding empty projection matrix framework according to the row and column values, extract the hierarchical position coordinate information of the nodes, establish a one-way index logic pointing the hierarchical position coordinates to the row and column structure of the projection matrix framework, perform integrity verification and conflict detection on the index logic of the nodes, and serialize and arrange the index logic that has been verified without error in the order of the hierarchy from shallow to deep to obtain the architecture hierarchical variable dimension projection matrix mapping table;
[0074] Based on the row and column values determined for each node, a floating-point storage space of the corresponding size is allocated in memory, and a corresponding empty projection matrix framework is constructed. The hierarchical position coordinate information of the node (i.e., the hierarchical number and the intra-hierarchical sequence number) is extracted, and a one-way index logic pointing the hierarchical position coordinates to the specific row and column structure of the projection matrix framework is established. For the index logic of each node, integrity verification and conflict detection are performed. Specifically, this includes checking whether the index value exceeds the matrix boundary and whether the indexes of different nodes point to the same storage unit. If the detection passes, the error-free index logic is serialized and arranged in the order of the hierarchy from shallow to deep (i.e., the number of hops from small to large) to obtain the architecture hierarchical variable-dimensional projection matrix mapping table.
[0075] The operational logic lies in constructing a conflict-free address mapping: Assuming the parameter set specifies that a certain node corresponds to an 8-row, 4-column matrix block, and that the node is located at the 2nd position of the 3rd layer, the process first calculates the starting row offset of the matrix block in the global projection matrix. The calculation method is to sum the number of rows allocated to the nodes in the first two layers. Assuming that the nodes in the first two layers occupy a total of 200 rows, the starting row index of the node is calculated as 200 + 1 = 201. If the conflict detection finds that index 201 has been occupied by the remaining nodes, an exception is triggered; if there is no conflict, the mapping relationship of "the 2nd position of the 3rd layer pointing to the starting row index 201" is written into the mapping table, ensuring the orderliness of the feature space construction and the uniqueness of physical storage.
[0076] Please see Figure 3 The specific steps of S2 are as follows:
[0077] S201: Obtain code snippets and bound natural language comments from the source code repository, perform data flow analysis on the code snippets, identify key variable identifiers, perform entity recognition on the natural language comments, extract core entity nouns, and bind variable identifiers and entity nouns to the same source based on the correspondence between code line numbers and comment paragraphs, generating a group of variable identifiers and comment nouns with the same source.
[0078] The system batch retrieves code snippets from source code files along with their closely linked natural language comment blocks. For the code snippets, it performs Abstract Syntax Tree (AST) analysis and data flow parsing to identify key variable identifiers, such as local variable names, function parameter names, and global constant names. Simultaneously, it performs entity recognition operations on the natural language comment content, using a pre-trained natural language processing model (such as BERT-NER) to extract core entity nouns, such as business object names and operation action nouns. Based on the correspondence between the line number of the code and the paragraph position of the comment, it binds variable identifiers and entity nouns within the same logical block to generate homologous groups of variable identifiers and comment nouns.
[0079] S202: Call the cognate group of variable identifiers and annotation nouns, and construct the projection space based on the architecture-level variable-dimensional projection matrix mapping table. Convert the text data in the cognate group into a multi-dimensional space vector, calculate the cosine similarity between the variable identifier vector and the annotation noun vector, quantify the degree of semantic fit between the two, and obtain a set of semantic space association quantification indicators.
[0080] By using word embedding techniques (such as Word2Vec), text data within the same group of origins is converted into multi-dimensional spatial vectors. Specifically, variable identifier text is mapped to the first vector, and annotation noun text is mapped to the second vector. Cosine similarity between the vectors is calculated. Specifically, the dot product of the first vector and the second vector is calculated, and then the Euclidean norm (L2 norm) of the two vectors is calculated. The dot product value is divided by the product of the two norms, thereby quantifying the degree of semantic fit between the two and obtaining a set of semantic spatial association metrics.
[0081] In computational logic, assume the variable identifier vector is... The annotation noun vector is Calculate the dot product of the two: Next, calculate the vector magnitude: The modulus is ; The modulus is Calculate the cosine similarity: The value of 0.8 is the semantic space correlation metric, which indicates that the two are highly correlated semantically.
[0082] S203: Based on the semantic space association metric set, retrieve heteronyms that are vertically or negatively correlated, forcibly replace the original variable identifiers in the original code snippet with the heteronyms, retain the original comment content, construct an adversarial scenario of deviation between code logic and comment description, and generate semantically orthogonal logical conflict sample pairs.
[0083] Set a threshold for determining semantic discrepancies (e.g., 0.1) and a threshold for determining negative correlation (e.g., -0.5). Retrieve identifier pairs whose similarity values are in the orthogonal vertical range (i.e., close to 0, such as absolute value less than 0.1) or show negative correlation (i.e., less than -0.5) and mark them as semantic discrepancies. Then, the process will forcibly replace the original variable identifiers in the original code snippet with the retrieved semantic discrepancies, while keeping the original annotation content unchanged. In this way, an adversarial scenario is constructed in which there is a significant deviation between the code logic (represented by the replaced semantic discrepancies) and the annotation description (represented by the original annotation), generating semantically orthogonal logical conflict sample pairs.
[0084] Suppose that the similarity between a temporary variable name "temp_val" and the comment term "User_ID" is found to be 0.05 in the index set, which is lower than the semantic discrimination threshold of 0.1, and is therefore judged as a semantic discrepancy. In the process, "current_uid" with clear semantics in the original code is uniformly replaced with "temp_val", while the comment retains "get current user ID". In the sample pairs generated as a result, the code-side features point to temporary variables without clear meaning, while the comment-side features point to user entity semantics. The two are approximately orthogonal in the semantic space (the angle between them is close to 90 degrees), which constitutes a valid logical conflict sample. As shown in Table 2, specific data instances of conflict sample generation are presented.
[0085] Table 2: Semantic Orthogonal Logical Conflict Sample Generation Table
[0086]
[0087] As shown in Table 2, by introducing heteronyms with low similarity, a high-quality dataset was successfully constructed for training the model to identify inconsistencies between code and annotations, thereby enhancing the robustness of the model.
[0088] Please see Figure 4 The specific steps of S3 are as follows:
[0089] S301: Call the semantic orthogonal logic conflict sample pair, parse the syntactic dependency relationship of the code fragments included in the semantic orthogonal logic conflict sample pair, locate the hierarchical depth of the target architecture node in the software architecture topology, extract the hierarchical depth value as the hierarchical positioning identifier, perform numerical encoding conversion on natural language and code text, combine and package the hierarchical positioning identifier and numerical encoding result to generate node hierarchical index and text encoding vector group;
[0090] The syntactic dependency relations of code fragments in the sample pair are parsed using a syntactic analyzer to construct a dependency syntax tree. Simultaneously, based on the hierarchical distribution sequence, the hierarchical depth of the target architecture node in the software architecture topology is located, and the depth value is extracted as a hierarchical location identifier (e.g., a depth value of 3). Numerical encoding transformation is performed on natural language annotations and code text. The encoder of a pre-trained language model is used to transform the text into a fixed-dimensional initial vector. Finally, the extracted hierarchical location identifier and the numerical encoding result are combined and packaged to generate a node hierarchical index and text encoding vector group containing structural and semantic information.
[0091] S302: Based on the node level index and text encoding vector group, read the level positioning identifier encapsulated in the group, use the level positioning identifier as the key value input to the architecture level variable dimension projection matrix mapping table for traversal retrieval, lock the target matrix structure configuration parameters that match the level depth, construct a linear transformation entity with target row and column dimensions according to the target matrix structure configuration parameters, and generate the target level spatial projection matrix.
[0092] Read the hierarchical positioning identifier encapsulated within the group, use this identifier as a key value, and input it into the architecture hierarchical variable dimension projection matrix mapping table for traversal retrieval. During the process, lock the target matrix structure configuration parameters that match the depth of the hierarchy, including the number of rows, the number of columns, and the initial weight distribution of the matrix. Based on these parameters, construct a linear transformation entity with the target row and column dimensions in memory, that is, initialize a specific numerical matrix and generate the target hierarchical spatial projection matrix.
[0093] Regarding parameter settings and retrieval, assuming the level positioning identifier is "Level_3", the mapping table configuration shows that the matrix dimension corresponding to Level_3 is 128 rows and 64 columns. The process allocates memory accordingly and uses the Xavier initialization method to fill the matrix elements, i.e., starting from a mean of 0 and a variance of... The matrix is filled with randomly sampled values from the distribution, for example, the input dimension. Output dimension Then the variance is calculated as follows: The process generates a specific floating-point value filling matrix based on this statistical law, thus completing the construction of the target-level spatial projection matrix.
[0094] S303: For the target hierarchical spatial projection matrix, call the numerical encoding results in the node hierarchical index and text encoding vector group, perform matrix multiplication operation between the input vector and the projection matrix, map the original vector data to the geometric feature space defined by the target hierarchical spatial projection matrix, and reshape the feature expression according to the dimensionality attribute to obtain the hierarchical variable dimension feature vector.
[0095] The numerical encoding result (i.e., the input vector) in the node-level index and text encoding vector group is called, and matrix multiplication operation is performed between the input vector and the projection matrix. Specifically, each element of the input vector is weighted and summed with the elements of the corresponding column of the matrix. Through this operation, the original vector data is mapped to the geometric feature space defined by the target-level spatial projection matrix. According to the dimensionality attribute of the matrix (such as the number of columns being less than the number of rows), this operation realizes the dimensionality reduction and reshaping transformation (or dimensionality increase) of the feature expression, and obtains the hierarchical variable-dimensional feature vector.
[0096] In the specific numerical operation logic, assume the input vector is a 1-row, 4-column vector. Target-level spatial projection matrix It is a 4x2 matrix, where the elements in the first column are... The second column elements are Calculate the first element of the output vector: Perform the dot product operation between the input vector and the first column of the matrix, i.e. Calculate the second element of the output vector: perform the dot product operation between the input vector and the second column of the matrix, i.e. The resulting hierarchical variable-dimensional feature vector is This example demonstrates the process of compressing 4-dimensional features into 2-dimensional space through matrix transformation, thereby reshaping the features.
[0097] Please see Figure 5 The specific steps of S4 are as follows:
[0098] S401: Based on hierarchical variable-dimensional feature vectors, the node index and hierarchical attributes are parsed, the software architecture topology data is traversed, the sibling nodes under the same parent node branch are identified, the real-time status feature data of the sibling nodes are extracted, the real-time status feature data is converted into a vector form with the same dimension as the target node, the vector data of the sibling nodes are summarized, and a feature set of sibling nodes at the same level is generated.
[0099] The metadata carried by the node is parsed to obtain the node index ID and hierarchical attributes. The process traverses the software architecture topology data, using the parent node of the current node as the anchor point to identify the remaining child nodes under the same parent node branch, i.e., sibling nodes (same-level sibling nodes). The real-time status feature data of the sibling nodes (such as the current load value, response time, etc.) is extracted, and the data is transformed by a projection matrix with the same parameters as the target node. L2 normalization is then performed to convert it into a unit vector form with the same dimension as the target node and a magnitude of 1. The unit vector data of the sibling nodes are summarized to generate a feature set of sibling nodes at the same level.
[0100] S402: Call the feature set of sibling nodes at the same level, perform a pairwise vector dot product operation with the hierarchical variable-dimensional feature vector, calculate the projection component magnitude of the target vector in the direction of the sibling node vector, characterize the degree of non-orthogonal overlap of the differentiated architecture branches in the feature space according to the magnitude of the projection component magnitude, arrange the values obtained by the operation in order, and obtain the branch feature projection overlap scalar sequence.
[0101] Each hierarchical variable-dimensional feature vector of the target node is paired with a vector dot product operation (which is also pre-normalized). This operation aims to calculate the magnitude of the projection component of the target vector in the direction of each sibling node vector. According to the principle of vector algebra, under the premise of unit vectors, the dot product value is equal to the cosine similarity. The larger the value, the more similar the directions of the two vectors are in the feature space. That is, the higher the degree of non-orthogonal overlap of the differentiated architecture branches in the feature space (the stronger the correlation). The process arranges the magnitude values obtained from the operation in descending order to obtain the scalar sequence of branch feature projection overlap.
[0102] In numerical computation logic, assume the normalized target node vector is... Normalized sibling node vector (verify: ), process calculation and dot product: This value of 0.8 is... exist The magnitude of the projection component in the direction indicates a strong directional overlap between the two nodes. If the vector of the other sibling node is... ,but and The dot product is This indicates and The feature space is orthogonal, the overlap is 0, and the process will calculate the scalar value. Collect and sort to form a sequence.
[0103] S403: For the overlapping scalar sequence of branch feature projections, perform the summation operation of the sequence values to quantify the total correlation between the target node features and the sibling node features, define the total correlation value as the penalty term to be minimized in model training, and generate the orthogonal constraint term of the feature branches within the layer.
[0104] The sequence values are summed to quantify the total correlation between the features of the target node and the features of its sibling nodes. The process defines this total correlation as a penalty term to be minimized during model training. This means that during optimization, the feature representation of the target node is forced to be as orthogonal as possible to its sibling nodes, highlighting the uniqueness of the node and generating orthogonal constraint terms for feature branches within the hierarchy.
[0105] Continuing from the previous example, the sequence contains the values 0.8 and 0. The process adds these two together, i.e. The value of 0.8 is the value of the orthogonal constraint term for feature branches within the level. In the model optimization objective, the smaller the value, the better. If the value is too large (such as reaching 5.0), it indicates that the feature distinction between the target node and the surrounding nodes is low. The weight will be adjusted through the steps to reduce this value. This mechanism ensures that the feature branches within each level do not interfere with each other in spatial distribution through mathematical constraints, thereby improving the feature recognition. Experimental data show that after introducing this orthogonal constraint term, the misidentification rate of similar functions is reduced by about 15%, as shown in Table 3.
[0106] Table 3: Verification Table of the Impact of Orthogonal Constraint Terms on Recognition Accuracy
[0107]
[0108] As shown in Table 3, the discrimination accuracy significantly improves with the increase of constraint strength (the overlap scalars decrease), proving the effectiveness of the computational logic.
[0109] Please see Figure 6 The specific steps of S5 are as follows:
[0110] S501: Call the orthogonal constraint terms of the feature branches within the hierarchy, obtain the true intent label vector, calculate the Euclidean distance between the feature vector and the true label, calculate the distance between the feature vector and the conflict sample label, integrate the orthogonal constraint terms of the feature branches within the hierarchy according to the principle of minimizing the difference of positive samples and maximizing the distance of conflict samples, perform weighted summation operation, and obtain the composite spatial distance loss metric.
[0111] The model obtains the true intent label vectors (one-hot encoded) corresponding to the samples from the training set. The process calculates the Euclidean distance between the model's output feature vector and the true intent label vector as the positive sample loss. Simultaneously, it calculates the distance between the feature vector and the conflict sample labels generated in S203 as the negative sample rejection loss. Following the principle of "minimizing positive sample differences and maximizing conflict sample distances," and incorporating orthogonal constraints, a weighted summation operation is performed using margin ranking loss logic. Specifically, first, second, and third weight coefficients are set and multiplied by the positive sample loss and the margin loss for conflict samples, respectively. The product of the three terms (including the orthogonal constraint term) and the orthogonal constraint term is added together to obtain the composite spatial distance loss metric.
[0112] In the specific numerical logic, assuming the Euclidean distance between positive samples is 0.2, the distance between conflicting samples is 0.8, the orthogonality constraint term is 0.5, the margin threshold is set to 1.0, and the weights are set as follows: First weight Second weight Third weight Calculate the first part (positive sample loss): Calculate the second part (conflict repulsion loss): calculate the interval loss. (This means that the desired conflict distance is at least 1.0, currently it is only 0.8, hence the penalty of 0.2); Weighted Calculate the third part (orthogonal constraints): Composite spatial distance loss metric = The value of 0.35 comprehensively reflects the current state of the model, including prediction bias, insufficient anti-interference ability, and poor feature orthogonality.
[0113] S502: Based on the composite spatial distance loss metric, backpropagation is performed on the neural network. The partial derivative of the loss metric with respect to the weights of multiple layers is calculated according to the chain rule. The distribution of error propagation between network layers is determined. The magnitude and direction of the parameters of each neuron node need to be adjusted in real-time iterations are quantified, and the gradient correction tensor of the weights of all network nodes is generated.
[0114] Backpropagation is performed on the constructed deep neural network, which consists of an input layer, several hidden layers, and an output layer. The layers are connected by fully connected or convolutional structures, and the activation function is ReLU or Tanh. The process follows the chain rule in calculus, calculating the partial derivative of the loss metric with respect to the connection weights of each layer from the output layer to the input layer to determine the propagation distribution of the error between network layers. The magnitude and direction (i.e., the sign of the gradient) of the parameters of each neuron node that need to be adjusted in the current real-time iteration are quantified, and the gradient correction tensor of the weights of all nodes in the network is generated.
[0115] S503: For the gradient correction tensor of the weights of all network nodes, perform gradient descent update operation, apply the correction tensor values element by element to the weight matrix of the real-time neural network, dynamically adjust the mapping parameters of the real-time neural network from the feature space to the intent space, cyclically update the connection state inside the network until the parameter distribution converges, fix the weight configuration parameters, and build the Wensheng software intent recognition optimization model.
[0116] The gradient descent update operation is performed, and the learning rate parameter is set (e.g., 0.01). Each gradient value in the correction tensor is multiplied by the learning rate to obtain the specific weight adjustment amount. The adjustment amount is applied element by element to the current weight matrix of the real-time neural network, specifically by subtracting the adjustment amount from the current weight. In this way, the mapping parameters of the real-time neural network from the feature space to the intent space are dynamically adjusted. The forward propagation to calculate the loss, the backpropagation to calculate the gradient, and the weight update steps are executed iteratively, and the trend of the loss value is monitored in real time until the change of the loss value in several consecutive rounds (e.g., 50 rounds) is less than the preset convergence threshold (e.g., 0.0001). The process determines that the network parameter distribution has converged, and the iteration stops. The current weight configuration parameters are fixed, and the Wensheng software intent recognition optimization model is constructed.
[0117] In the example of the update logic, assuming the current value of a certain connection weight is 0.5, the calculated corresponding gradient value is 0.1, and the learning rate is set to 0.01, calculate the adjustment amount: Perform the update: The new weight value is 0.499. This adjustment causes the network to slightly shift its output towards reducing the loss value in the next prediction. Through thousands of such iterations, the model gradually approaches the optimal solution. The benefit of this optimization process is that by introducing joint optimization of orthogonal constraints and adversarial sample distance, the model can not only accurately identify the intent, but also effectively resist the interference caused by inconsistencies between code and comments, thus significantly improving robustness.
[0118] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
[0119] Therefore, the scope of protection of this invention should be determined by the scope of protection of the described technical solution.
Claims
1. A training method for an intent recognition model used in text-based software scenarios to understand user needs, characterized in that, Includes the following steps: S1: Obtain the topology data of the Wensheng software architecture, traverse the path to determine the hierarchical position of the node relative to the root node, design the row and column structure of the projection matrix and allocate multi-dimensional space for shallow nodes and finite-dimensional space for deep nodes to obtain the architecture hierarchical variable-dimensional projection matrix mapping table. S2: Based on the training environment determined by the hierarchical variable-dimensional projection matrix mapping table of the architecture, collect code fragments and corresponding natural language annotations in the source code library, calculate the semantic association degree between variable identifiers and annotation entity nouns in the vector space, and generate semantically orthogonal logical conflict sample pairs. S3: Identify the hierarchical position of the target architecture node in the semantic orthogonal logical conflict sample pair, call the architecture hierarchical variable-dimensional projection matrix mapping table, retrieve the target projection matrix that matches the hierarchical position, change the dimensional granularity of the feature expression, and obtain the hierarchical variable-dimensional feature vector. S4: Based on the hierarchical variable-dimensional feature vector, identify sibling architecture nodes at the same level in the software architecture, obtain the feature representation of the sibling node and perform vector dot product operation with the real-time node feature, evaluate the degree of overlap generated by the vector dot product operation, and obtain the orthogonal constraint term of the feature branch within the hierarchy.
2. The training method for an intent recognition model for understanding user needs in a text-based software scenario according to claim 1, characterized in that, The architecture-level variable-dimensional projection matrix mapping table includes node-level depth index, differentiated dimension configuration parameters, and projection matrix row and column specifications. The semantically orthogonal logical conflict sample pairs include code snippets with semantic bias, logically mutually exclusive variable entities, and original natural language description text. The hierarchical variable-dimensional feature vectors include geometric space transformation coordinate values, hierarchical adaptive dimension values, and variable-granularity semantic feature encoding. The hierarchical feature branch orthogonal constraint terms include branch independence quantization coefficients, feature space overlap measurement values, and sibling node correlation cumulative penalty values.
3. The training method for an intent recognition model for understanding user needs in a text-based software scenario according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Obtain the topology data of the Wensheng software architecture, parse the internally defined node entities and the connection edge attributes between nodes, take the root node of the topology as the traversal starting point, search for subordinate nodes level by level along the connection edge, calculate the shortest path hop count of the subordinate node relative to the root node, assign the shortest path hop count as a quantitative index to the corresponding node, divide and classify the nodes according to the hop count value, extract the node identifier and corresponding hop count features within the level, and generate a node level depth distribution sequence. S102: Call the node hierarchy depth distribution sequence, set the hierarchy segmentation benchmark value, determine the nodes whose hop count feature is less than the hierarchy segmentation benchmark value as shallow nodes, calculate the multidimensional row and column values, determine the nodes whose hop count feature is greater than or equal to the hierarchy segmentation benchmark value as deep nodes, and generate a set of differentiated dimension space configuration parameters. S103: Based on the differentiated dimensional space configuration parameter set, construct the corresponding empty projection matrix framework according to the row and column values, extract the hierarchical position coordinate information of the nodes, establish a one-way index logic pointing the hierarchical position coordinates to the row and column structure of the projection matrix framework, perform integrity verification and conflict detection on the index logic of the nodes, and serialize and arrange the index logic that has been verified without error in the order of shallow to deep hierarchy to obtain the architecture hierarchical variable dimension projection matrix mapping table.
4. The training method for the intent recognition model for understanding user needs in text-based software scenarios according to claim 3, characterized in that, The specific steps of S2 are as follows: S201: Obtain code snippets and bound natural language comments from the source code repository, perform data flow analysis on the code snippets, identify key variable identifiers, perform entity recognition on the natural language comments, extract core entity nouns, and bind variable identifiers and entity nouns to the same source based on the correspondence between code line numbers and comment paragraphs, generating a group of variable identifiers and comment nouns with the same source. S202: Call the cognate group of the variable identifier and the annotation noun, convert the text data in the cognate group into a multi-dimensional space vector, calculate the cosine similarity between the variable identifier vector and the annotation noun vector, quantify the degree of semantic fit between the two, and obtain a set of semantic space association quantification indicators. S203: Based on the semantic space correlation metric set, retrieve heteronyms that are vertically or negatively correlated, forcibly replace the original variable identifiers in the original code snippet with the heteronyms, retain the original comment content, construct an adversarial scenario of deviation between code logic and comment description, and generate semantic orthogonal logic conflict sample pairs.
5. The training method for an intent recognition model for understanding user needs in a text-based software scenario according to claim 4, characterized in that, The specific steps for S3 are as follows: S301: Call the semantic orthogonal logic conflict sample pair, parse the syntactic dependency relationship of the code fragments included in the semantic orthogonal logic conflict sample pair, locate the hierarchical depth of the target architecture node in the software architecture topology, extract the hierarchical depth value as the hierarchical positioning identifier, perform numerical encoding conversion on natural language and code text, combine and package the hierarchical positioning identifier and numerical encoding result to generate node hierarchical index and text encoding vector group; S302: Based on the node level index and text encoding vector group, read the level positioning identifier encapsulated in the group, use the level positioning identifier as a key value to input the architecture level variable dimension projection matrix mapping table for traversal retrieval, lock the target matrix structure configuration parameters that match the level depth, construct a linear transformation entity with target row and column dimensions according to the target matrix structure configuration parameters, and generate the target level spatial projection matrix. S303: For the target hierarchical spatial projection matrix, call the numerical encoding result in the node hierarchical index and text encoding vector group, perform matrix multiplication operation between the input vector and the projection matrix, map the original vector data to the geometric feature space defined by the target hierarchical spatial projection matrix, and reshape the feature expression according to the dimensionality attribute to obtain the hierarchical variable dimension feature vector.
6. The training method for an intent recognition model for understanding user needs in a text-based software scenario according to claim 5, characterized in that, The positioning of the target architecture node in the software architecture topology is limited to an integer value that is not less than 1 layer and not greater than the preset maximum number of layers. The layer depth value is normalized and then used as the layer positioning identifier for combination and packaging. In the architecture-level variable-dimensional projection matrix mapping table, matrix structure configuration parameters with different row and column dimensions are pre-stored for different level depths. The number of rows or columns of the matrix corresponding to adjacent level depths has at least one dimension difference, and the matrix structure configuration parameters are limited to a set of positive integer dimensions. The construction process of the linear transformation entity is limited to directly generating a dense matrix structure based on the matrix structure configuration parameters, and the data type of the matrix elements is fixed to be consistent with the data type of the numerical encoding result. Before performing the matrix multiplication operation, the vector length of the numerical encoding result is checked. When the vector length is inconsistent with the column dimension of the target hierarchical spatial projection matrix, linear interpolation or a feature mapping layer is used to align the dimensions and generate the hierarchical variable-dimensional feature vector.
7. The training method for an intent recognition model for understanding user needs in a text-based software scenario according to claim 5, characterized in that, The specific steps of S4 are as follows: S401: Based on the hierarchical variable-dimensional feature vector, parse the node index and hierarchical attributes it carries, traverse the software architecture topology data, identify the sibling nodes under the same parent node branch as the node, extract the real-time status feature data of the sibling nodes, convert the real-time status feature data into a vector form consistent with the dimension of the target node, summarize the vector data of the sibling nodes, and generate a feature set of sibling nodes at the same level. S402: Call the feature set of sibling nodes at the same level, perform a pairwise vector dot product operation with the hierarchical variable-dimensional feature vector, calculate the projection component magnitude of the target vector in the direction of the sibling node vector, characterize the degree of non-orthogonal overlap of the differentiated architecture branches in the feature space according to the magnitude of the projection component magnitude, arrange the calculated values in order to obtain the branch feature projection overlap scalar sequence. S403: For the branch feature projection overlap scalar sequence, perform the summation operation of the sequence values to quantify the total correlation between the target node features and the sibling node features, define the total correlation value as the penalty term to be minimized in model training, and generate the orthogonal constraint term of the feature branches within the layer.
8. The training method for an intent recognition model for understanding user needs in a text-based software scenario according to claim 7, characterized in that, The real-time state feature data of the sibling nodes are limited to structural state vectors collected within the same time window, and when converted into a vector form with the same dimension as the target node, a fixed-length numerical encoding rule is used to eliminate dimensional differences. The pairwise vector dot product operation is limited to being performed after all vector elements have been normalized, and the magnitude of the projection component is limited to a non-negative real number. The arrangement rule of the branch feature projection overlap scalar sequence is limited to arranging them in descending order of value, and only retaining sequence elements with values not less than a preset threshold to participate in the cumulative summation operation; The summation operation is limited to performing a one-time linear summation on all retained elements in the branch feature projection overlap scalar sequence to generate orthogonal constraint terms for feature branches within the hierarchy.
9. The training method for an intent recognition model for understanding user needs in a text-based software scenario according to claim 1, characterized in that, The method further includes step S5: S5: Based on the orthogonal constraint term of the feature branch within the level, calculate the Euclidean distance between the hierarchical variable-dimensional feature vector and the true intent label, construct an optimization objective that minimizes the positive sample distance and maximizes the conflict sample distance, perform backpropagation, update the weight configuration of the neural network, and construct the Wensheng software intent recognition optimization model. The Wensheng software intent recognition optimization model includes converged neural network weight parameters, intent classification probability distribution information, and optimized feature space mapping rules.
10. The training method for an intent recognition model for understanding user needs in a text-based software scenario according to claim 9, characterized in that, The specific steps of S5 are as follows: S501: Call the orthogonal constraint terms of the feature branches within the level, obtain the true intent label vector, calculate the Euclidean distance between the feature vector and the true label, calculate the distance between the feature vector and the conflict sample label, integrate the orthogonal constraint terms of the feature branches within the level according to the principle of minimizing the difference of positive samples and maximizing the distance of conflict samples, perform a weighted summation operation, and obtain the composite spatial distance loss metric. S502: Based on the composite spatial distance loss metric, backpropagation is performed on the neural network. The partial derivative of the loss metric with respect to the weights of the multi-layer connections is calculated according to the chain rule. The distribution of the error transmission between network layers is determined. The magnitude and direction of the numerical values that need to be adjusted for each neuron node parameter in the real-time iteration round are quantified. The gradient correction tensor of the weights of all network nodes is generated. S503: For the weight gradient correction tensor of the entire network nodes, perform gradient descent update operation, apply the correction tensor values element by element to the weight matrix of the real-time neural network, dynamically adjust the mapping parameters of the real-time neural network from the feature space to the intent space, cyclically update the connection state inside the network until the parameter distribution converges, fix the weight configuration parameters, and construct the Wensheng software intent recognition optimization model.
Citation Information
Patent Citations
Intention recognition intelligent dialogue method and system based on large model
CN119226486A
Conversational AI multi-intention understanding and decision-making method for tourism scene
CN120429392A