Automatic intellectual property document retrieval method and system based on machine learning

By dynamically optimizing the gradient analysis subnetwork and gradient modulation unit, the problem of gradient conflict in the multi-task learning framework is solved, improving the model convergence efficiency and retrieval accuracy of the intellectual property document retrieval system, and making it suitable for rapid iteration of large-scale intellectual property retrieval platforms.

CN121502019APending Publication Date: 2026-02-10HAINAN KEYING INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511611166.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-05
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Existing multi-task learning frameworks suffer from gradient conflict issues in intellectual property document retrieval, making it difficult for the model to optimize multiple objectives simultaneously. This manifests as slow model convergence and decreased accuracy in some tasks, especially when user search intent is complex and varied.

Method used

A gradient analysis subnetwork and a gradient modulation unit are employed to identify gradient conflicts through cosine similarity analysis, generate gradient scaling factors and orientation bias terms, and weight and adjust the orientation of gradients for each subtask. Furthermore, a gradient memory buffer and a reinforcement learning-driven dynamic optimization mechanism are introduced to improve model convergence efficiency and retrieval accuracy.

Benefits of technology

It achieves flexible coordination of gradient contradictions, ensures balanced improvement of semantic modeling capabilities for each task, simplifies model development and deployment processes, reduces hardware resource consumption, and is suitable for online upgrades and rapid iterations of large-scale intellectual property retrieval platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121502019A_ABST
    Figure CN121502019A_ABST
Patent Text Reader

Abstract

The invention provides an intellectual property document automatic retrieval method and system based on machine learning, and the method comprises the steps: carrying out the preprocessing of a user retrieval request, including text standardization, BERT word segmentation, stop word and punctuation filtering and word form normalization, and obtaining structured input; deep shared semantic features are extracted by using a multilayer Transform network, and multi-task training such as keyword intention, technical field and legal state prediction is executed in parallel; a gradient analysis and modulation mechanism is adopted, gradient conflicts are recognized and relieved based on gradient cosine similarity between tasks, and modulation parameters are dynamically optimized in combination with gradient memory and reinforcement learning agency, so that the training stability and the multi-task generalization ability of the model are effectively improved; the intellectual property document retrieval method is beneficial for improving multi-dimensional understanding and decision accuracy of intellectual property document retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of natural language processing and multi-task learning technology, and in particular to a method and system for automatic retrieval of intellectual property documents based on machine learning. Background Technology

[0002] Currently, with the rapid development of intellectual property informatization and machine learning technologies, automatic intellectual property document retrieval systems based on natural language processing have become crucial support for fields such as document retrieval, technical analysis, and legal status assessment. Mainstream solutions generally employ multi-task learning frameworks, leveraging deep neural networks to perform deep semantic understanding of the retrieval request text and concurrently complete various sub-tasks such as keyword matching, technical field attribution determination, and patent legal status identification. These systems often utilize structures such as Transformer or BERT to construct a unified underlying semantic encoder, and then build multiple task-specific output heads on this basis, thereby improving the model's coverage of complex and specialized retrieval intents and overall retrieval accuracy. In recent years, academia and industry have shown great interest in the application of multi-task learning in document retrieval, search recommendation, and intent recognition. Related research indicates that semantic feature transfer can be achieved through parameter sharing between tasks, effectively improving the system's generalization ability to meet multi-dimensional retrieval needs. However, with the increasing complexity and number of retrieval tasks, multi-task joint training models have also revealed significant technical challenges in terms of parameter space optimization and collaborative mechanisms. Current mainstream technologies typically aggregate the errors (loss functions) of each subtask in a weighted manner, synthesize the total loss, and then perform backpropagation and parameter optimization uniformly. This simple weighted gradient fusion strategy can achieve good results in scenarios where tasks are similarly related and gradient directions are approximately consistent. However, in complex scenarios with significant differences in task semantics or conflicting retrieval objectives, "gradient conflict" is prone to occur: that is, the gradient directions of different tasks in the shared layer contradict each other, making it difficult for the model to optimize multiple objectives simultaneously. This ultimately manifests as slow model convergence, decreased accuracy in some tasks, and even negative transfer. This problem is particularly prominent in the field of intellectual property text retrieval, where user retrieval intents are complex and varied, and the semantic space overlap between intents is low. Some cutting-edge research has attempted to use measures such as fixed task weights, phased training, or manually designed scheduling rules, but all of these have limitations such as poor tuning flexibility, weak generalization ability, and difficulty in adapting to the diversity of actual retrieval. Summary of the Invention

[0003] In order to solve the above-mentioned technical problems, the present invention provides an automatic retrieval method for intellectual property documents based on machine learning.

[0004] The technical solution of this invention is implemented as follows: A machine learning-based automatic retrieval method for intellectual property documents, comprising: S1: Obtain the intellectual property document retrieval request text input by the user, and preprocess the text, including removing stop words and punctuation marks and standardizing word segmentation, to generate structured text input; S2: Input the preprocessed text into the shared semantic coding network, extract the deep semantic representation of the text through a multi-layer Transformer structure, and generate a shared semantic feature vector; S3: Based on the shared semantic feature vector, input it into multiple task-specific output heads respectively, execute the keyword expansion intent recognition, technical field attribution judgment and legal status association prediction sub-tasks, and calculate the loss function value of each sub-task; S4: Collect the original gradient vectors generated by each subtask in the shared semantic coding network and input them into the gradient analysis subnetwork. Perform cosine similarity analysis on the gradient vectors to quantify the degree of gradient conflict between tasks. S5: Determine whether the cosine similarity between each task pair is lower than a preset threshold. If it is lower than the threshold, it is determined that there is a gradient conflict. The gradient modulation unit is activated and the corresponding gradient scaling factor and orientation bias term are generated. S6: Based on the scaling factor and orientation bias term output by the gradient modulation unit, the gradients of each subtask are weighted and their orientations adjusted to generate a modulated gradient vector for use in updating the parameters of the shared semantic coding network. S7: Introduce a gradient memory buffer to record effective gradient combination patterns in historical training iterations and provide prior modulation strategy suggestions based on the current gradient conflict state to enhance the stability of the gradient modulation strategy. S8: The modulation parameters are dynamically optimized by a reinforcement learning agent. The multi-task performance on the validation set is used as a reward signal to update the learnable parameters in the gradient modulation unit, thereby improving the model's convergence efficiency and retrieval accuracy.

[0005] The present invention also provides an automatic intellectual property document retrieval system based on machine learning, which uses the above-mentioned automatic intellectual property document retrieval method based on machine learning to retrieve intellectual property documents.

[0006] The present invention provides an automatic intellectual property document retrieval method based on machine learning, which has the following beneficial effects: (1) This invention innovatively constructs a gradient analysis subnetwork, a learnable gradient modulation unit and a gradient memory buffer, and achieves flexible coordination of gradient contradictions by dynamically identifying gradient conflicts and adaptively adjusting the contribution intensity and projection direction of the gradients of each subtask. (2) This invention uses a gradient modulation mechanism driven by reinforcement learning to dynamically fine-tune the modulation parameters in real time using the balanced performance of multiple tasks on the validation set as the feedback reward signal, thereby avoiding the dominance of a certain task in the optimization process and ensuring the balanced improvement of semantic modeling capabilities of each task. (3) The collaborative training method of the present invention is entirely based on the gradient process in the model training stage. It does not require significant modification to the multi-task neural network structure itself, does not rely on task-specific parameters or external prior knowledge, and can be seamlessly integrated into various mainstream semantic coding network structures such as Transformer. The gradient modulation unit parameters are linked with historical effective combination patterns through gradient memory buffer, so that the modulation strategy has continuous adaptive and evolutionary capabilities, has strong adaptability to newly introduced tasks or retrieval intentions, and significantly expands the application field of the technology; (4) The gradient modulation process of the present invention is fully automatic and end-to-end, requiring no manual setting or iterative adjustment of multi-task weights, which greatly simplifies the model development and deployment process and reduces tuning costs. At the same time, through dynamic gradient modulation optimization, the number of effective parameter updates required for each training round is reduced, which helps to shorten the model training time, reduce hardware resource consumption, and is suitable for the online upgrade and rapid iterative operation of large-scale intellectual property retrieval platforms. Attached Figure Description

[0007] Figure 1 This is a flowchart of an automatic intellectual property document retrieval method based on machine learning according to the present invention; Figure 2 This is a sub-flowchart of an automatic intellectual property document retrieval method based on machine learning according to the present invention; Figure 3 This is another sub-flowchart of the machine learning-based automatic retrieval method for intellectual property documents according to the present invention. Detailed Implementation

[0008] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0009] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0010] like Figure 1 As shown, this invention provides a machine learning-based automatic retrieval method for intellectual property documents, specifically including: S1: Obtain the intellectual property document retrieval request text input by the user, and preprocess the text, including removing stop words and punctuation marks and standardizing word segmentation, to generate structured text input; S2: Input the preprocessed text into the shared semantic coding network, extract the deep semantic representation of the text through a multi-layer Transformer structure, and generate a shared semantic feature vector; S3: Based on the shared semantic feature vector, input it into multiple task-specific output heads respectively, execute the keyword expansion intent recognition, technical field attribution judgment and legal status association prediction sub-tasks, and calculate the loss function value of each sub-task; S4: Collect the original gradient vectors generated by each subtask in the shared semantic coding network and input them into the gradient analysis subnetwork. Perform cosine similarity analysis on the gradient vectors to quantify the degree of gradient conflict between tasks. S5: Determine whether the cosine similarity between each task pair is lower than a preset threshold. If it is lower than the threshold, it is determined that there is a gradient conflict. The gradient modulation unit is activated and the corresponding gradient scaling factor and orientation bias term are generated. S6: Based on the scaling factor and orientation bias term output by the gradient modulation unit, the gradients of each subtask are weighted and their orientations adjusted to generate a modulated gradient vector for use in updating the parameters of the shared semantic coding network. S7: Introduce a gradient memory buffer to record effective gradient combination patterns in historical training iterations and provide prior modulation strategy suggestions based on the current gradient conflict state to enhance the stability of the gradient modulation strategy. S8: The modulation parameters are dynamically optimized by a reinforcement learning agent. The multi-task performance on the validation set is used as a reward signal to update the learnable parameters in the gradient modulation unit, thereby improving the model's convergence efficiency and retrieval accuracy.

[0011] Step S1: Obtain the intellectual property document retrieval request text input by the user, and preprocess the text, including removing stop words and punctuation marks and standardizing word segmentation, to generate structured text input. Specifically, this includes: S1.1: Based on the intellectual property document retrieval request text in natural language form collected by the user terminal device, perform text format standardization processing, convert non-standard encoded characters, and obtain the original text input in a unified encoding format; Based on the natural language form of the intellectual property document retrieval request text data stream collected by user terminal devices, a character encoding detection method (parameters: UTF-8, GBK, ISO-8859-1 and other encoding modes) is used to identify and mark the encoding type of the input text, ensuring the encoding adaptability of the subsequent conversion process; Furthermore, by using a unified encoding conversion algorithm (parameters: target encoding format = UTF-8, conversion strategy = character-by-character mapping and illegal byte replacement), non-standard encoded characters are converted into a preset unified encoding format, and the original text data with consistent encoding is obtained. Furthermore, a character validity filtering method (parameter: control character range = U+0000 to U+001F and U+007F) is adopted to remove illegal control characters in the original text and generate a valid text sequence containing only the set of legal visible characters; Furthermore, by using a standardized whitespace character normalization algorithm (parameters: space mapping rule = full-width to half-width, tabs and newlines are replaced with spaces), we can unify the processing of whitespace characters of different forms and generate a structurally stable original text row and column format; Furthermore, a symbol normalization mapping method is adopted (parameters: Chinese symbols and English symbols are unified, and half-width and full-width symbols are consistent) to standardize the format of punctuation and special symbols in the input text and generate the original text input with a unified symbol set; Through the above-mentioned encoding detection, conversion, filtering and normalization processing methods, the original natural language input results of the previous step are transformed into original text data with a unified encoding format and consistent symbol rules, so as to achieve the expected technical effect of format standardization in the text processing chain. For example, in a patent search scenario, the text submitted by the user terminal device is “\uA3BFPatent Term?”. The initial encoding detection module identifies that the input text uses GB2312 encoding, and the encoding detection score threshold is set to 95%. After detecting that \uA3BF is an illegal Unicode encoding, it performs a unified encoding conversion to map it to “%”, and uses UTF-8 encoding to generate a valid character sequence after conversion. During character validity filtering, control characters such as U+0007 are removed, and visible characters are retained. During the whitespace normalization process, tabs are replaced with single half-width spaces; the symbol normalization mapping uniformly replaces the Chinese question mark “?” with a half-width question mark “?”. The original text obtained after conversion is “%Patent Term?”, with a length of 9 characters, an encoding format of UTF-8, and a consistent symbol set. This result is input into the BERT-based word segmentation processing chain in sub-step S1.2. S1.2: Perform word segmentation on the original text input after format standardization. Use a pre-trained word segmentation model based on BERT to segment the text and generate a preliminary word segmentation sequence composed of basic vocabulary units. S1.3: Perform a stop word filtering operation on the initial word segmentation sequence. Based on the preset intellectual property domain stop word list, match and remove words from the word segmentation results to remove general and domain-irrelevant words that are not related to semantic intent, and obtain an effective word sequence after removing stop words. The input is a preliminary word segmentation sequence segmented by the BERT word segmenter, which contains a list of basic vocabulary units and the position index information of each word in the text; A stop word search algorithm based on a hash mapping structure (parameters: intellectual property field stop word list, number of hash buckets 1024) is adopted to achieve high-speed matching and retrieval function between each word segmentation unit and the stop word list; Furthermore, by using the Boolean bit-marking method (parameters: vocabulary ID mapping table, stop word Boolean array), the matched word segmentation units are quickly removed, and binary state vectors of retention and removal are obtained; Furthermore, a vector filtering algorithm (parameters: initial word segmentation sequence vector, removal state vector) is used to remove lexical units marked as stop words and retain effective words, generating a domain relevance retention rate index. Furthermore, based on the domain relevance retention rate index and a preset threshold (the threshold is set to 0.85), the impact of the current stop word filtering on subsequent semantic analysis is evaluated, and the effective word sequences and their position indices are recorded. By using a stop word filtering algorithm, the initial word segmentation sequence from the previous step is transformed into an effective word sequence containing only semantic intent-related words, thereby improving the information density within the domain and suppressing noise in the text input. For example, in an initial segmented sequence containing 500 word units, a hash mapping structure is used to match a list of 3000 intellectual property stop words. The number of hash buckets is set to 1024, and the average matching time is 0.02ms. A binary state vector of length 500 is generated using Boolean bit marking, where a value of "1" indicates a stop word to be removed. A total of 125 stop word units are marked. After removing these stop word units using a vector filtering algorithm, 375 effective words are obtained. The domain relevance retention rate is calculated as follows: The calculated result was 0.75, lower than the preset threshold of 0.85. The system recorded the effective word sequence and index information after this round of filtering and dynamically optimized the stop word list range in subsequent batches, significantly improving the retention rate. In the subsequent semantic encoding stage, this effective word sequence, as input, can significantly improve the feature extraction accuracy of the shared semantic encoding network for intellectual property retrieval intent. S1.4: Perform punctuation removal on the effective word sequence. Based on the regular expression matching mechanism, identify and remove all punctuation marks in the text to generate a clean text sequence containing only semantically related words. S1.5: Perform lexical normalization on the clean text sequence. Based on the stemming algorithm and lexical reconstruction technology, standardize the vocabulary to generate a structured text input with unified lexical representation, which serves as the input data for the shared semantic coding network.

[0012] Step S2: The preprocessed text is input into a shared semantic coding network, and a deep semantic representation of the text is extracted through a multi-layer Transformer structure to generate a shared semantic feature vector. Specifically, this includes: S2.1: Perform word embedding mapping on the structured text input after removing stop words, punctuation marks and standardizing word segmentation to obtain the initial word vector representation; S2.2: The word vector representation is injected with positional information based on the positional encoding mechanism to generate a context-aware word embedding sequence containing positional semantics; S2.3: Input the context-aware word embedding sequence into a multi-layer Transformer encoder structure, and model long-distance semantic dependencies through a self-attention mechanism to obtain multi-level intermediate semantic representations; S2.4: Perform layer normalization and residual connection processing on the multi-level intermediate semantic representation to improve the model training stability and enhance the hierarchical consistency of semantic representation; S2.5: Based on pooling operations, perform global feature aggregation on the output of the final Transformer layer to generate a shared semantic feature vector of uniform dimension for subsequent parallel processing by multiple task output heads; Based on the context feature matrix output by the final layer of the multi-layer Transformer encoder, a global pooling method (parameter: pooling mode selects a combination of mean pooling and max pooling) is adopted to statistically aggregate the feature values ​​in the sequence dimension to eliminate the influence of input length differences. Furthermore, by using a weighted pooling method (parameter: the weight vector is derived from the normalization result of the self-attention weights), greater aggregation weights are assigned to features at positions with high semantic importance, and a weighted global feature representation matrix is ​​obtained. Furthermore, a feature dimension normalization method (parameter: a standardization strategy with a mean of 0 and a variance of 1) is adopted to achieve scale uniformity processing of the weighted global feature representation and generate a normalized feature vector with high numerical stability. Furthermore, by using a dimensionality reduction mapping method (parameters: based on principal component analysis (PCA), the target dimension d is set by the input dimension constraint shared by the multi-task output heads), the normalized feature vector is converted into a feature representation of uniform length, and a fixed-dimensional shared semantic feature vector is generated. Through the above global feature aggregation and unified dimension mapping processing, the multi-position contextual semantic information of the previous step is transformed into single vectorized feature data, achieving the technical effect of providing consistent input features for specific output heads of each task. For example, when the retrieval request text has 128 word embeddings, the final layer output of the Transformer is a 128×512 context feature matrix. A combination of mean pooling and max pooling is used, averaging and maximizing the 128 values ​​of each feature dimension, then linearly combining them with a weighted ratio of 0.6:0.4 to obtain a 512-dimensional global feature vector. Self-attention weights (128×128) are summed and normalized along the sequence dimension to obtain a weight vector, which is then used for weighted pooling of the original feature matrix, emphasizing word position features with higher weights in retrieval intent recognition. Normalization is then performed, adjusting the mean of each feature dimension to 0 and the variance to 1 to ensure numerical stability for subsequent training tasks. Dimensionality reduction is performed using PCA, retaining the first 256 principal components to achieve a cumulative contribution rate of over 95%, while satisfying the constraint that the input dimension of the multi-task output head is 256. The 256-dimensional shared semantic feature vector output at this time serves as a unified input in the three tasks of keyword expansion intent recognition, technical field attribution judgment, and legal status association prediction.

[0013] Step S3: Based on the shared semantic feature vector, input it into multiple task-specific output heads respectively, and execute sub-tasks of keyword expansion intent recognition, technical field attribution judgment, and legal status association prediction, and calculate the loss function value of each sub-task. For example... Figure 2 As shown, it specifically includes: S3.1: Based on the shared semantic feature vector, the output head of the keyword expansion intent recognition task is processed by fully connected mapping and Softmax normalization to generate the probability distribution of keyword expansion intent, which is used as the output result of the keyword expansion intent recognition task. S3.2: Perform cross-entropy loss function calculation on the output of the keyword expansion intent recognition task and the pre-labeled keyword expansion intent labels to obtain the local loss value of the keyword expansion intent recognition task, which serves as the error feedback signal for the task. The input conditions are the probability distribution vector generated by the keyword expanded intent recognition task output head, and the pre-annotated keyword expanded intent label matrix of the corresponding batch of samples. The cross-entropy loss function is used for calculation (parameters: probability distribution vector p = [p1, p2, …, p...). n The label vector q = [q1, q2, …, q] is defined. n This allows for the measurement of information differences between the predicted and true distributions. Furthermore, the pre-annotated keyword extended intent labels are transformed into binary vectors q of the same dimension through the One-Hot encoding method (parameters: total number of categories n, label index k) to achieve dimensionality consistency between the label matrix and the predicted vector; Furthermore, using the cross-entropy calculation formula, the predicted vector and label vector for each sample are paired and operated on. The formula is as follows: in, To expand the local loss value for the intent recognition task using keywords, This refers to the batch sample size. The total number of categories, The category j label indicator value for sample i, Predict the probability value of sample i as class j; Furthermore, the cross-entropy calculation process is optimized by batch vector operations, and matrix multiplication and element-wise logarithmic operations are used to accelerate the generation of indices and reduce numerical errors. By taking a weighted average of the cross-entropy loss of all samples in the batch (the weights can be set based on task importance or sample confidence), the result of the previous step is transformed into a local loss value for the keyword expansion intent recognition task, thereby realizing the output of the error feedback signal for this task. For example, in a scenario with batch size N = 4 and total number of categories n = 3, the prediction probability matrix p is [[0.7,0.2, 0.1], [0.1, 0.6, 0.3], [0.2, 0.2, 0.6], [0.8, 0.1, 0.1]], with label indices of 0, 1, 2, 0. After One-Hot encoding, the label matrix q is [[1,0,0],[0,1,0],[0,0,1],[1,0,0]]. Substituting into the cross-entropy formula above, the loss values ​​for each sample are calculated element-wise as 0.357, 0.511, 0.511, 0.223, and the batch average loss is 0.4005, which is output as the local loss value and passed to the backpropagation process to update the parameters of the keyword extended intent recognition task. The process took 0.02 seconds to compute in a GPU environment, and its numerical stability met the training requirements, ultimately improving the task's classification accuracy for retrieval intent. S3.3: Based on the shared semantic feature vector, the output head of the technology field attribution judgment task is subjected to linear transformation and multi-class activation function processing to generate a technology field attribution category prediction vector, which serves as the output result of the technology field attribution judgment task; S3.4: Perform multi-class cross-entropy loss function calculation on the output results of the technical field attribution judgment task and the pre-labeled technical field tags to obtain the local loss value of the technical field attribution judgment task, which serves as the error feedback signal for the task. S3.5: Based on the shared semantic feature vector, feature projection and binary classification Sigmoid activation are performed on the output head of the legal state association prediction task to generate legal state prediction probability values, which are used as the output results of the legal state association prediction task. S3.6: Perform binary classification cross-entropy loss function calculation on the output results of the legal status association prediction task and the pre-labeled legal status labels to obtain the local loss value of the legal status prediction task, which serves as the error feedback signal for the task. The input conditions required for calculating the binary cross-entropy loss function on the output of the legal status association prediction task and the pre-labeled legal status labels are: on the one hand, the legal status prediction probability value generated by the output head of the legal status association prediction task and activated by Sigmoid; on the other hand, the pre-labeled legal status label of the corresponding sample in the intellectual property corpus, which is limited to 0 or 1. The binary classification cross-entropy loss function is used to calculate the loss (parameter: prediction probability). Authentic Labels This enables the quantification of the error between the predicted legal status output and the actual label. Furthermore, by constructing a loss function and performing normalized summation on batch samples, the average error value of each batch can be calculated. Furthermore, through batch normalization calculation, an adaptive error measure for different batch sample sizes is achieved; Furthermore, by introducing a smoothing term during the calculation process... (Typical value) )right The function input is bounded to prevent numerical underflow or computational anomalies, and numerically stable local loss values ​​are generated. By using the binary classification cross-entropy loss function, the legal status prediction probability and the true label in the previous step are mapped to a measurable error feedback signal, thereby achieving an accurate evaluation of the prediction performance of this subtask and providing a basis for parameter updates in the subsequent gradient backpropagation step. For example, in a training scenario for predicting the legal status of intellectual property rights, the input batch sample size is 500. The probability vector for predicting the legal status, after Sigmoid activation, ranges from 0.05 to 0.92. The pre-labeled vector consists of 0s and 1s, with 1s accounting for 35% of the labels. A smoothing coefficient is set during the calculation of the binary classification cross-entropy loss. for For probability values ​​and 1 The probability value is truncated with a lower bound. The sum of the losses of each sample is divided by the total number of samples in the batch to obtain the average batch loss value, which is calculated to be 0.253. This loss value is added as a local loss to the legal status association prediction task when the total loss of subsequent multi-task tasks is weighted. Combined with the losses of other sub-tasks, multi-task joint optimization is achieved, which effectively enhances the ability to identify legal status elements in complex user search intent. S3.7: The local loss values ​​of each subtask are weighted and summed according to the preset initial task weights to generate the total loss function value for multi-task joint training, which serves as the input for the subsequent gradient backpropagation process.

[0014] Step S4: Collect the original gradient vectors generated by each subtask in the shared semantic coding network and input them into the gradient analysis subnetwork. Perform cosine similarity analysis on the gradient vectors to quantify the degree of gradient conflict between tasks. Figure 3 As shown, it specifically includes: S4.1: During the multi-task joint training process, the original gradient vectors generated by multiple sub-tasks in the shared semantic coding network are obtained during the backpropagation stage. The sub-tasks include keyword expansion intent recognition, technical field attribution judgment and legal status association prediction tasks, so as to obtain the gradient distribution information of each task in the shared parameter space. In the multi-task joint training scenario, the total loss function value calculated in step S3 is used as the driving signal for the backpropagation process. The gradient derivative operation of the shared semantic coding network parameters is performed through the automatic differentiation mechanism of the deep learning framework to obtain the set of original gradient vectors of each task in the common parameter space. A gradient separation algorithm based on task output header index (parameters: task identifier list, shared network parameter mapping table) is adopted to independently identify and extract gradient channels of different subtasks, ensuring that each gradient vector corresponds to a unique subtask output header; Furthermore, by using a gradient storage buffer management method (parameters: batch number, timestamp, task identifier), the gradient vectors collected in the current training batch are stored in a structured manner, and metadata related to the training batch is attached, thereby providing a time series reference for subsequent conflict analysis. Furthermore, a gradient dimension unification processing algorithm (parameter: shared parameter dimension mapping matrix) is adopted to achieve precise alignment of gradient vectors in the dimension space, ensuring that the gradients of each task are comparable and consistent, thus laying the foundation for cosine similarity calculation. By using a gradient magnitude monitoring method (parameters: norm type L2, magnitude threshold), the gradient strength of each subtask is initially quantified, generating a set of gradient distribution information for subsequent collision detection and modulation strategy selection. Through gradient extraction and separation processing, the results of the previous step are transformed into task-specific raw gradient vector data, realizing the basic input conditions required for multi-task gradient conflict analysis. For example, in a training batch containing 64 samples, the three sub-tasks of joint training are keyword expansion intent recognition, technical field attribution judgment, and legal status association prediction. The system calls the automatic differentiation module to perform backpropagation on the shared semantic coding network to obtain the shared network parameter matrix. The partial derivatives with respect to the loss values ​​of the three tasks form three sets of original gradient vectors. Each group has 768 dimensions. The gradient separation algorithm uses the task identifier list ["KW_EXT","TECH_DOM","LEGAL_STA"] to match with the shared parameter mapping table to extract the corresponding gradient channels. The buffer management module stores each gradient vector according to the batch number B102 and the timestamp T=1683719200, and adds task identifier metadata to form the storage structure {task ID: gradient vector, batch ID: B102, time: T}. Dimensional consistency processing uses the shared parameter dimension mapping matrix. Ensure that the three sets of gradients correspond to the same parameter index positions in the 768-dimensional space. Calculate using L2 norm magnitude monitoring. =15.28, =13.95, =14.62, generating gradient magnitude distribution information {KW_EXT:15.28,TECH_DOM:13.95,LEGAL_STA:14.62}. This embodiment outputs three sets of comparable, fully stored task-specific original gradient vectors and their magnitude distribution data, providing accurate and structured input for subsequent cosine similarity analysis; S4.2: Perform vector normalization on the original gradient vector, and perform normalization operation on the gradient vector based on the L2 norm to eliminate the interference of the difference in gradient magnitude of each task on the subsequent cosine similarity calculation, and generate a standardized gradient vector. Based on obtaining the original gradient vectors of each subtask in the shared semantic coding network as input conditions, a normalization algorithm based on vector norm (parameter: L2 norm threshold is 1.0) is adopted to normalize the gradient vector magnitude, so as to eliminate the cosine similarity calculation bias introduced by the difference in gradient magnitude. Furthermore, the L2 norm calculation module (parameter: precision 1e-8) is used to calculate each gradient vector. Perform vector magnitude calculation to obtain the scalar value of the magnitude. The formula is: in For gradient components, For component index; Furthermore, through the vector normalization module (parameter: division-to-zero protection threshold is 1e-8), the gradient components are divided by the magnitude scalar operation to generate a normalized gradient vector. The formula is: Ensure that its modulus length is always 1; Furthermore, the normalized gradient vectors are re-checked using the numerical stability verification module (parameter: modulus tolerance is ±0.001) to ensure that the modulus of all task gradient vectors meets the unit length constraint, and numerically abnormal vectors are removed to prevent a decrease in the accuracy of subsequent cosine similarity calculations. By using the above-mentioned L2 norm-based normalization algorithm and numerical stability verification, the original gradient vector in the previous step is transformed into standardized gradient vector data, achieving the expected technical effect of consistent gradient vector magnitude, and providing a mathematical stability basis for subsequent gradient cosine similarity analysis. For example, in a single multi-task training iteration, suppose the original gradient vector for the keyword expansion intent recognition task is... The original gradient vector for the task of determining the technical field affiliation is: The original gradient vector for the legal status association prediction task is: By calculating using the L2 norm, the modulus lengths were obtained as follows: = , = , = After normalization, the standardized gradient vector for the first task is: The second task is The third task is Numerical stability verification results show that the gradient magnitude of all tasks is 1±0.0001, which meets the unit length constraint. The final output standardized gradient vector is directly fed into the gradient analysis sub-network to perform cosine similarity calculation, ensuring the analysis accuracy and numerical stability. S4.3: The standardized gradient vector is used as input to the gradient analysis sub-network. The gradient vectors of any two tasks are compared pairwise based on the cosine similarity calculation formula, and the cosine value of their angle is calculated to obtain the gradient alignment matrix between tasks. S4.4: Based on the gradient alignment matrix, perform statistical analysis on the cosine similarity values ​​of each task pair, calculate its average similarity score, and compare it with a preset similarity threshold to identify task combinations with significant gradient conflicts. S4.5: Based on the gradient conflict identification results of the task combination, generate gradient conflict identification information and transmit the identification information to the gradient modulation unit as the decision basis for subsequent dynamic adjustment of gradient scaling factor and direction bias term.

[0015] Step S5: Determine whether the cosine similarity between each task pair is lower than a preset threshold. If it is lower than the threshold, a gradient conflict is determined, the gradient modulation unit is activated, and the corresponding gradient scaling factor and direction bias term are generated. Specifically, this includes: S5.1: Based on the cosine similarity matrix output by the gradient analysis subnetwork, the similarity of the gradient vectors corresponding to any two retrieval intent subtasks is measured to obtain the gradient alignment index between task pairs. S5.2: Compare the gradient alignment index with a preset cosine similarity threshold. If the cosine similarity between task pairs is lower than the threshold, it is determined that the task pair has significant gradient conflict in the current training batch. Based on the gradient alignment index output by the gradient analysis subnetwork, a threshold comparison algorithm (parameter: preset cosine similarity threshold τ) is used to quantitatively determine the consistency of gradient directions of each task pair. Furthermore, the directional correlation between each task pair in the current training batch is calculated using the cosine similarity formula, as follows: in, and Let represent the normalized gradient vectors of the two subtasks in the parameter space of the shared semantic coding network, respectively. The numerator is the absolute value of the vector dot product, and the denominator is the norm product of the two vectors. Furthermore, by comparing the cosine similarity values ​​of each task pair with a threshold... To determine the conflict state, a significant gradient conflict is considered to be achieved when the following conditions are met: Furthermore, the judgment result is transformed into a binary conflict label matrix (parameter: number of tasks m×m) to realize the global identification of the conflict status of all task pairs in the current batch and to provide input control signals for the gradient modulation unit; By using the threshold comparison and binarization methods described above, the gradient similarity measurement results are transformed into input indicators that can directly drive the modulation strategy, thereby automating and standardizing conflict detection during multi-task joint training. For example, in one training iteration, the cosine similarity value of the gradient analysis subnetwork output by the keyword extended intent recognition task and the technical field attribution judgment task is... , and preset threshold Compare and meet the conditions This is determined to be a significant gradient conflict. The cosine similarity between the legal state association prediction task and the technical field affiliation judgment task is... If the value is higher than the threshold, it is considered conflict-free. The conflict tag matrix for this batch is recorded as [[0,1,0],[1,0,0],[0,0,0]], where 1 indicates a conflict and 0 indicates no conflict. After activating the modulation unit, a scaling factor for the conflicting task pairs is generated, with the initial value set to [value missing]. And adjust the gradient direction bias of the conflict task. Spend; S5.3: Based on the gradient conflict determination result, activate the learnable parameter module in the gradient modulation unit and generate an initial gradient scaling factor, which is used to adjust the gradient contribution intensity of conflicting tasks. S5.4: Based on the gradient conflict determination result, a direction bias term is generated. The direction bias term is used to rotate and adjust the gradient direction of the conflicting task to reduce the degree of conflict between it and the gradient direction of other tasks. Based on the gradient conflict determination results, the set of gradient vectors of the task pairs that need to be adjusted is extracted from the cosine similarity matrix output by the gradient analysis subnetwork, and used as the target data input for direction adjustment; Orthogonal projection decomposition method is used (parameter: current task gradient vector). Reference task gradient vector This allows the gradient vector of the conflict task to be decomposed into components parallel to and perpendicular to the reference gradient, and the decomposition coefficient vector is obtained. Furthermore, a rotation transformation algorithm (parameter: rotation angle θ is determined by the conflict degree calculation formula of the gradient angle) is used to generate the direction bias of the conflict gradient vector, and the rotation-adjusted direction correction vector is obtained. The conflict degree value c is calculated by the following formula: in, and The standardized gradient vectors of the two tasks, with the dot product sign. This represents the vector dot product operation. The contents of the package represent the magnitude of the vector; Furthermore, based on the conflict degree value c, a direction rotation angle θ is generated through a linear mapping function (parameter range: c∈[0,1]), and this is used as input to execute the Rodrigues rotation formula in two-dimensional or high-dimensional space to implement the direction bias term: in, The rotation axis is a unit vector, obtained by normalizing the reference gradient vector.

[0016] Furthermore, the rotated direction correction vector is processed through normalization constraints. Convert to unit length and generate direction offset term. , as the orientation adjustment parameter of the gradient modulation unit; The above rotation transformation algorithm transforms the gradient conflict determination result of the previous step into a bias parameter that can be used for gradient direction optimization, thereby achieving the expected technical effect of reducing the gradient direction angle of conflicting tasks and improving gradient fusion compatibility. For example, in a certain training batch, the gradient vector of the keyword expansion intent recognition task... Gradient vector of task attribution to technical field The cosine similarity is 0.2, classifying them as a significantly conflicting task pair. Based on the conflict degree formula, c = 0.8. In the mapping relationship between c and the rotation angle, θ = π / 4 is set, i.e. .by Using the normalized vector as the rotation axis k, substituting it into Rodriguez's formula... Perform a directional rotation to obtain The included angle in the two-dimensional components is reduced by approximately 45°. This is generated after normalization. Used in the directional modulation unit. In the training and testing results of this batch, the joint gradient fusion signal after directional modulation, after being updated by the shared semantic coding network, showed improved multi-task comprehensive performance, reduced gradient convergence iterations, and significantly improved retrieval accuracy; S5.5: The generated gradient scaling factor and orientation bias term are input into the gradient modulation unit for subsequent weighted fusion and orientation optimization of the gradient vectors of each subtask, thereby improving the convergence efficiency of the multi-task joint training model.

[0017] Step S6: Based on the scaling factor and orientation bias term output by the gradient modulation unit, the gradients of each sub-task are weighted and their orientations adjusted to generate modulated gradient vectors for use in updating the parameters of the shared semantic coding network. Specifically, this includes: S6.1: Analyze the gradient scaling factor and orientation bias term output by the gradient modulation unit to determine the normalization coefficient and projection direction parameter of the gradient channel of each subtask. S6.2: Based on the normalization coefficient, the original gradient vectors generated by each subtask in the shared semantic coding network are weighted element by element to generate a weighted gradient vector; S6.3: Perform directional projection transformation on the weighted gradient vector using the projection direction parameters, and generate a directional modulated gradient vector by rotating the gradient direction to alleviate gradient conflicts between tasks. S6.4: Perform gradient merging operation on the direction-modulated gradient vector, and generate a unified gradient update signal based on the task weight allocation strategy and gradient fusion rules; S6.5: Input the unified gradient update signal into the parameter update module of the shared semantic coding network, and update the shared parameters by gradient descent based on the optimizer algorithm to obtain the updated shared semantic feature coding model. For the unified gradient update signal generated by the gradient merging operation, a parameterized optimizer algorithm (parameters: learning rate η, momentum μ, weight decay λ) is used to calculate the gradient descent for all trainable parameters in the shared semantic coding network. Furthermore, an adaptive moment estimation algorithm based on the Adam optimizer (parameters: first-order moment decay rate β1, second-order moment decay rate β2, numerical stability constant ε) is used to achieve adaptive scaling of each gradient component and obtain a parameter update vector containing first-order and second-order moment estimates. Furthermore, a weight decay process is performed on the parameter update vector, and the new parameter values ​​are calculated based on the following update formula: in, To share parameters, This is the correction value for the deviation of the first moment. This is the deviation correction value for the second moment. For learning rate, To prevent division by zero for constants; Furthermore, by using the above parameter update formula, while maintaining numerical stability, the update step and direction of each parameter are optimized to achieve the optimal convergence state of the updated shared semantic feature encoding model. Furthermore, gradient cache cleanup and batch index archiving are performed on the shared semantic coding network after parameter updates to ensure data link consistency and parameter inheritance correctness in the next training iteration. By using an adaptive gradient update and weight decay processing method based on the Adam optimizer algorithm, the unified gradient update signal of the previous step is transformed into a numerically stable and highly convergent shared parameter update result, thereby achieving the expected technical effect of improving semantic representation consistency and retrieval accuracy in multi-task joint training. For example, in a single training batch, the components of the uniform gradient update signal range from [-0.015, 0.02], and the optimizer selects a learning rate... ,momentum Weight decay Adam parameter β1 is set to β2 is ε is .

[0018] Calculate the first moment estimate With second-order moment estimation The values ​​are [0.0008, -0.0006] and [2.1e-6, 1.8e-6], respectively. After performing deviation correction, the results are obtained. The values ​​are [0.0009, -0.00065]. The parameter is [2.3e-6, 1.9e-6]. Substituting this value into the update formula completes the update. This parameter update strategy is effective in alleviating task conflicts and improving performance.

[0019] Step S7: Introducing a gradient memory buffer to record effective gradient combination patterns from historical training iterations, and providing prior modulation strategy suggestions based on the current gradient conflict state to enhance the stability of the gradient modulation strategy. Specifically, this includes: S7.1: Initialize the gradient memory buffer to store effective gradient combination patterns collected in historical training iterations. The gradient combination pattern includes the scaling factor and orientation bias term of the gradient of each subtask. The scaling factor and orientation bias term are dynamically generated based on the gradient conflict detection results to form a gradient modulation strategy sample set with historical reference value. S7.2: Based on the task gradient conflict state output by the gradient analysis subnetwork in the current training iteration, calculate the similarity matching score between the current gradient combination and the historical gradient combination pattern in the gradient memory buffer. The similarity matching score is obtained by dynamically comparing the cosine similarity change trend of the gradient conflict task pair to identify the historical gradient modulation strategy that is highly matched with the current gradient conflict state. S7.3: Based on the similarity matching score, select historical gradient modulation strategies from the gradient memory buffer that have a matching degree higher than a preset threshold with the current gradient conflict state, and perform weighted fusion on the strategies to generate a priori modulation parameter suggestion for the current gradient conflict state. The priori modulation parameter suggestion includes the initial scaling factor and direction bias term of each task gradient as the initial input parameters of the gradient modulation unit. S7.4: Input the prior modulation parameter suggestions into the gradient modulation unit and initialize the learnable parameters in the current gradient modulation unit to shorten the policy exploration cycle of the reinforcement learning agent, improve the convergence speed of the gradient modulation policy, and thus enhance the stability and generalization ability of the model in the multi-task joint training process. S7.5: After each training iteration, the final modulation parameters generated by the current gradient modulation unit and the corresponding gradient conflict state information are written into the gradient memory buffer. The incremental update operation of the gradient combination mode is performed to continuously enrich the historical policy samples in the gradient memory buffer, thereby improving the accuracy and adaptability of the prior modulation policy suggestions in subsequent training iterations. After the training iteration is completed, based on the scaling factor and orientation bias parameter set currently generated by the gradient modulation unit, the parameter binding storage method (the parameter set includes task number, channel index, scaling factor vector, and bias orientation matrix) is used to realize the structured encapsulation of the final modulation parameters. Furthermore, the gradient conflict state acquisition module (parameters: task pair index, cosine similarity matrix, conflict identifier set) is used to acquire the gradient conflict state data of the current iteration and bind it with the aforementioned modulation parameter set to obtain a gradient combination pattern instance containing complete context information. Furthermore, by using an incremental update algorithm (parameters: current buffer capacity threshold, replacement strategy identifier, insertion priority rule), new gradient combination pattern instances are written into the gradient memory buffer. At the same time, low-priority or expired combination patterns are eliminated according to the buffer replacement strategy, thereby expanding the diversity of strategy samples while maintaining data capacity balance. Furthermore, the gradient combination pattern index table in the buffer is updated by using the pattern index reconstruction method (parameters: historical iteration sequence number, pattern feature vector hash key) to ensure the fast retrieval capability of subsequent prior strategy queries; By using the above-mentioned parameter binding, conflict information collection, incremental writing and index reconstruction processing methods, the modulation result of the current iteration is transformed into a policy sample with timestamps, task conflict identifiers and parameter dependencies, thereby achieving continuous enrichment and retrieval of the gradient memory buffer content, and thus improving the accuracy and adaptability of the prior modulation policy suggestion generation process. For example, after a multi-task joint training iteration, the set of modulation parameters output by the gradient modulation unit includes scaling factors and orientation bias terms for three sub-tasks, where the scaling factors are respectively... The direction offset terms are expressed in radians. The gradient conflict state acquisition module detected a cosine similarity between Task 1 and Task 3. Below the preset threshold Significant conflicts were identified. The gradient combination pattern instances generated in this iteration include a task number mapping table, a scaling factor array, a direction bias array, and a list of conflicting task pairs. These are inserted into the buffer using an incremental update algorithm, and pattern data from five iterations prior are deleted to maintain a maximum buffer capacity of 100 records. During pattern index reconstruction, a 128-bit feature vector hash key is generated for each combination pattern, updating the B+ tree-based index table so that subsequent queries can retrieve the historical policy sample with the highest matching degree within milliseconds. In the next iteration, the prior modulation policy generation module uses the historical samples in this buffer to provide the gradient modulation unit with the initial scaling factors for Task 1 and Task 3. with direction offset Recommended value.

[0020] Step S8: Dynamically optimize the modulation parameters using a reinforcement learning agent, using the multi-task performance on the validation set as the reward signal to update the learnable parameters in the gradient modulation unit, thereby improving model convergence efficiency and retrieval accuracy. Specifically, this includes: S8.1: Based on the loss values ​​of the sub-network outputs of each task in the current training iteration, calculate the multi-task comprehensive performance index on the validation set, and use it as the input of the immediate reward signal for the reinforcement learning agent; S8.2: Input the multi-task integrated performance index into the reinforcement learning agent and execute the policy gradient-based optimization algorithm to update the learnable scaling factor and orientation bias term parameters in the gradient modulation unit; S8.3: Based on the updated scaling factor and orientation bias term, the gradients generated by each task in the shared semantic coding network are weighted and their orientations adjusted to generate modulated gradient vectors for updating shared parameters; S8.4: Apply the modulated gradient vector to the parameter update process of the shared semantic coding network, and perform parameter gradient descent through the Adam optimizer to improve the model's ability to jointly model multi-task intentions; S8.5: Periodically compare the updated modulation parameters with the historical gradient combination patterns. If a significant performance improvement is detected, store the current modulation strategy in the gradient memory buffer to enhance the stability and generalization ability of the gradient modulation strategy in subsequent training iterations.

[0021] The present invention also provides an automatic intellectual property document retrieval system based on machine learning, which uses an automatic intellectual property document retrieval method based on machine learning to retrieve intellectual property documents.

[0022] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.

[0023] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and rules of the present invention should be included within the scope of protection of the present invention.

Claims

1. A machine learning-based automatic retrieval method for intellectual property documents, characterized in that, Includes the following steps: S1: Obtain the intellectual property document retrieval request text input by the user, and preprocess the text, including removing stop words and punctuation marks and standardizing word segmentation, to generate structured text input; S2: Input the structured text into a shared semantic coding network, extract the deep semantic representation of the text through a multi-layer Transformer structure, and generate a shared semantic feature vector; S3: Based on the shared semantic feature vector, input it into multiple task-specific output heads respectively, execute the keyword expansion intent recognition, technical field attribution judgment and legal status association prediction sub-tasks, and calculate the loss function value of each sub-task; S4: Collect the original gradient vectors generated by each subtask in the shared semantic coding network and input them into the gradient analysis subnetwork to perform cosine similarity analysis on the gradient vectors; S5: Determine whether the cosine similarity between each task pair is lower than a preset threshold. If it is lower than the threshold, it is determined that there is a gradient conflict. The gradient modulation unit is activated and the corresponding gradient scaling factor and orientation bias term are generated. S6: Based on the scaling factor and orientation bias term output by the gradient modulation unit, the gradients of each sub-task are weighted and their orientations adjusted to generate a modulated gradient vector. S7: Introduces a gradient memory buffer to record effective gradient combination patterns in historical training iterations and provides prior modulation strategy suggestions based on the current gradient conflict state.

2. The method for automatic retrieval of intellectual property documents based on machine learning according to claim 1, characterized in that, Following step S7, the following is also included: S8: The modulation parameters are dynamically optimized through a reinforcement learning agent, and the multi-task integrated performance on the validation set is used as a reward signal to update the learnable parameters in the gradient modulation unit.

3. The method for automatic retrieval of intellectual property documents based on machine learning according to claim 1, characterized in that, Step S1 specifically includes: Based on the intellectual property document retrieval request text in natural language form collected by user terminal devices, text format standardization processing is performed to convert non-standard encoded characters and obtain the original text input in a unified encoding format; The original text input is processed by word segmentation. A pre-trained word segmentation model based on BERT is used to segment the text and generate a preliminary word segmentation sequence composed of basic vocabulary units. A stop word filtering operation is performed on the preliminary word segmentation sequence. The word segmentation results are matched and removed based on a preset intellectual property field stop word list to obtain a valid word sequence after removing stop words. A punctuation removal operation is performed on the effective word sequence. Based on the regular expression matching mechanism, all punctuation marks in the text are identified and removed to generate a clean text sequence containing only semantically related words. The clean text sequence is subjected to lexical normalization processing. Based on the stemming algorithm and lexical restoration technology, the vocabulary is standardized and converted to generate a structured text input with unified lexical representation.

4. The automatic intellectual property document retrieval method based on machine learning according to claim 3, characterized in that, Step S1 further includes using a hash mapping structure to match word segmentation units with a stop word list in the intellectual property field, using Boolean bit tags and vector filtering to screen and record effective word sequences and indices, and dynamically adjusting the stop word list based on the domain relevance retention rate and threshold to suppress noise.

5. The method for automatic retrieval of intellectual property documents based on machine learning according to claim 1, characterized in that, Step S2 specifically includes: Perform word embedding mapping on the structured text input to obtain the initial word vector representation; The word vector representation is injected with positional information based on a positional encoding mechanism to generate a context-aware word embedding sequence containing positional semantics; The context-aware word embedding sequence is input into a multi-layer Transformer encoder structure, and long-distance semantic dependencies are modeled through a self-attention mechanism to obtain multi-level intermediate semantic representations; The multi-level intermediate semantic representation is subjected to layer normalization and residual connection processing; The pooling operation is used to perform global feature aggregation on the output of the final Transformer layer, generating a shared semantic feature vector with a unified dimension.

6. The method for automatic retrieval of intellectual property documents based on machine learning according to claim 1, characterized in that, Step S3 specifically includes: Based on the shared semantic feature vector, the probability distribution of keyword extended intent is generated by performing fully connected mapping and Softmax normalization on the output head of the keyword extended intent recognition task. The cross-entropy loss function is used to calculate the output of the keyword expansion intent recognition task and the pre-labeled keyword expansion intent labels to obtain the local loss value of the keyword expansion intent recognition task. Based on the shared semantic feature vector, a linear transformation and multi-class activation function are performed on the output head of the technical field attribution judgment task to generate a technical field attribution category prediction vector. The output of the technical field attribution judgment task and the pre-labeled technical field tags are compared using a multi-class cross-entropy loss function to obtain the local loss value of the technical field attribution judgment task. Based on the shared semantic feature vector, feature projection and binary classification sigmoid activation are performed on the output head of the legal state association prediction task to generate legal state prediction probability values. The local loss value of the legal status prediction task is obtained by calculating the binary cross-entropy loss function between the output of the legal status association prediction task and the pre-labeled legal status labels. The local loss values ​​of each subtask are weighted and summed according to the preset initial task weights to generate the total loss function value for multi-task joint training.

7. The method for automatic retrieval of intellectual property documents based on machine learning according to claim 1, characterized in that, Step S4 specifically includes: During the multi-task joint training process, the original gradient vectors generated by multiple sub-tasks in the shared semantic coding network are obtained during the backpropagation stage. The sub-tasks include keyword expansion intent recognition, technical field attribution judgment and legal status association prediction tasks. The gradient distribution information of each task in the shared parameter space is obtained. The original gradient vector is normalized by performing vector normalization, and the gradient vector is normalized based on the L2 norm to generate a normalized gradient vector. The standardized gradient vector is used as input to the gradient analysis sub-network. Based on the cosine similarity calculation formula, the gradient vectors of any two tasks are compared pairwise, and the cosine value of their angle is calculated to obtain the gradient alignment matrix between tasks. Based on the gradient alignment matrix, the cosine similarity values ​​of each task pair are statistically analyzed, their average similarity scores are calculated, and compared with a preset similarity threshold to identify task combinations with significant gradient conflicts. Based on the gradient conflict identification results of the task combination, gradient conflict identification information is generated and transmitted to the gradient modulation unit.

8. The method for automatic retrieval of intellectual property documents based on machine learning according to claim 7, characterized in that, Step S4 further includes using the task output header index and parameter mapping table to independently identify and extract gradient channels for different subtasks, and combining batch number, timestamp and task identifier with additional metadata for structured storage and conflict analysis.

9. The method for automatic retrieval of intellectual property documents based on machine learning according to claim 1, characterized in that, Step S5 specifically includes: Based on the cosine similarity matrix output by the gradient analysis subnetwork, the similarity of the gradient vectors corresponding to any two retrieval intention subtasks is measured to obtain the gradient alignment index between the task pairs. The gradient alignment index is compared with a preset cosine similarity threshold. If the cosine similarity between task pairs is lower than the threshold, it is determined that the task pair has significant gradient conflict in the current training batch. Based on the gradient conflict determination result, the learnable parameter module in the gradient modulation unit is activated, and a gradient scaling factor is generated. The gradient scaling factor is used to adjust the gradient contribution intensity of conflicting tasks. Based on the gradient conflict determination result, a direction bias term is generated. The direction bias term is used to rotate and adjust the gradient direction of the conflicting task to reduce the degree of conflict between it and the gradient direction of other tasks. The gradient scaling factor and the direction bias term are input into the gradient modulation unit.

10. An automatic intellectual property document retrieval system based on machine learning, characterized in that: The intellectual property document retrieval method based on machine learning as described in any one of claims 1-9 is used to retrieve intellectual property documents.