A text classification method, medium and device

By dynamically adjusting the number of parallel inferences and unsupervised quality assessment, the problems of low resource utilization and insufficient reliability of results in text classification methods are solved, achieving high efficiency, accuracy and compliance of text classification results.

CN122087115APending Publication Date: 2026-05-26HANGZHOU YUNSHEN TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU YUNSHEN TECH CO LTD
Filing Date
2026-04-27
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In existing technologies, text classification methods have shortcomings in terms of resource utilization and result reliability. In particular, when the number of parallel inferences does not match the real-time computing resources, it leads to computational congestion or waste of computing power. Furthermore, the lack of an effective quality assessment mechanism may result in non-compliance and reliability issues in the classification results.

Method used

By dynamically determining the number of parallel inferences M, multiple candidate output sequences are generated and subjected to unsupervised quality assessment, including compliance verification and confidence evaluation. Finally, the text classification result corresponding to the highest quality score is selected.

Benefits of technology

It achieves efficient utilization of computing resources, reduces the bias of single-sequence inference, ensures the accuracy and compliance of classification results, and avoids resource waste and compliance risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122087115A_ABST
    Figure CN122087115A_ABST
Patent Text Reader

Abstract

This invention relates to the field of text classification technology, and more particularly to a text classification method, medium, and device. It dynamically determines the first parallel inference quantity M using computational resources, achieving a balance between computational resource utilization and inference stability. By initiating multi-threaded parallel inference, it generates M candidate output sequences containing a first intermediate semantic representation and a first text classification result, covering different inference logics of the model for the target text. This approach balances result diversity and inference efficiency, reducing classification errors caused by single-sequence inference bias. Through compliance verification and confidence assessment, it calculates a first quality score to obtain the target classification result. This not only filters sequences containing security risks or structural defects, ensuring the security of the classification process, but also distinguishes the reliability differences of the classification results, avoiding one-sided judgments that ignore reliability based solely on labels. In scenarios without real labels, it achieves objective quality quantification, ensuring the accuracy of the text classification results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of text classification technology, and in particular to a text classification method, medium, and device. Background Technology

[0002] Text classification, as a core foundational task in the field of natural language processing, plays an irreplaceable role in professional scenarios such as content security review and data governance. However, in fields such as security management where data standardization and security requirements are extremely high, text classification tasks exhibit unique characteristics of being multi-layered, highly constrained, and highly sensitive, placing stringent standards on the reliability, compliance, and accuracy of text classification methods that far exceed those of general scenarios.

[0003] Existing text classification methods based on pre-trained models such as BERT or RoBERTa perform only one inference for a single text and directly output the classification result. This makes the inference result susceptible to random perturbations of the model or text ambiguity, resulting in insufficient reliability of a single result. Furthermore, they do not consider the utilization efficiency of real-time computing resources. When computing power is sufficient, the robustness of the result cannot be improved through parallel computing. When computing power is limited, the high resource consumption of a single inference may lead to delays.

[0004] Parallel classification models based on distributed frameworks such as Spark MLlib use a preset fixed number of parallel inferences, such as 4 or 8 times. This leads to a disconnect between the number of parallel inferences and real-time computing resources. When resources are insufficient, it can easily cause computational congestion, while when resources are sufficient, it can lead to a waste of computing power and cannot dynamically adapt to resource fluctuations. Furthermore, the parallel output results lack an effective quality evaluation mechanism and often simply use majority voting to decide the final result, ignoring the compliance of intermediate semantic representations and the differences in result confidence. This may result in the inclusion of low-quality results in the decision-making process. If only the final classification result is relied upon, it may lead to compliance risks such as the leakage of personal information.

[0005] Therefore, how to address the issues of low resource utilization and insufficient reliability and compliance of classification results when model-based text classification fails to dynamically match the number of parallel inferences with real-time computing resources, and the evaluation focusing only on the final result while ignoring intermediate semantic compliance, has become an urgent problem to be solved. Summary of the Invention

[0006] To address the aforementioned technical problems, the present invention provides a text classification method, which includes the following steps: S1, based on the first real-time computing resources, determine the first number of parallel inferences M for the target text to be classified by the target text classification model, where M is a positive integer.

[0007] S2, the target text is processed according to the target text classification model to obtain M candidate output sequences, where each candidate output sequence contains a first intermediate semantic representation and a first text classification result.

[0008] S3, perform unsupervised quality assessment on each candidate output sequence to obtain the first quality score corresponding to each candidate output sequence. The unsupervised quality assessment includes compliance verification of the first intermediate semantic representation and confidence assessment of the first text classification result.

[0009] S4. The first text classification result corresponding to the highest first quality score is determined as the target classification result of the target text.

[0010] The present invention also provides a non-transitory computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the above-described text classification method.

[0011] The present invention also provides an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0012] This invention has at least the following beneficial effects: Firstly, by dynamically determining the first parallel inference quantity M using first real-time computing resources, it avoids inference lag and timeouts caused by M being too large and exceeding resource capacity, while also avoiding wasted computing power due to M being too small, achieving a precise balance between computing resource utilization and inference stability. Secondly, by initiating multi-threaded parallel inference, it generates M candidate output sequences containing a first intermediate semantic representation and a first text classification result, covering different inference logics of the model for the target text, while simultaneously considering result diversity and inference efficiency, significantly reducing classification errors caused by single-sequence inference bias. Thirdly, by calculating the first quality score through compliance verification and confidence assessment, it not only filters sequences containing security risks or structural defects, ensuring the security of the classification process, but also distinguishes the reliability differences of the classification results, avoiding one-sided judgments that ignore reliability based solely on labels, achieving objective quality quantification of candidate output sequences in scenarios without real labels. Finally, by extracting the first text classification result corresponding to the highest first quality score as the target classification result, it ensures the accuracy of the text classification result. Attached Figure Description

[0013] 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.

[0014] Figure 1 This is a flowchart of a text classification method provided in Embodiment 1 of the present invention. Detailed Implementation

[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0016] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is understood that, where appropriate, the terms used to distinguish similar objects can be interchanged so that the invention can also be implemented in other embodiments besides the illustrated or described embodiments. Furthermore, the terms "including," "having," and any variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.

[0017] Example 1 This embodiment provides a text classification method, such as Figure 1 As shown, this text classification method includes the following steps: S1, based on the first real-time computing resources, determine the first number of parallel inferences M for the target text to be classified by the target text classification model, where M is a positive integer.

[0018] The first real-time computing resource refers to the hardware computing power and resource status that can be directly accessed when performing the target text classification task. This includes the number of currently available computing nodes (such as the number of idle computing nodes in a server cluster), the computing power of a single computing node (measured in floating-point operations per second, or FLOPs, reflecting the node's data processing speed), and the memory capacity of the computing node (reflecting the scale of data and model parameters that can be loaded simultaneously). This serves as the core basis for determining the first parallel inference quantity M, avoiding problems caused by a mismatch between the number of inferences and resources, thereby ensuring a balance between resource utilization and inference efficiency. For example, if the number of inferences exceeds the resource carrying capacity, it will cause model lag and inference timeouts; if the number of inferences is lower than the resource carrying capacity, it will result in idle and wasted computing power.

[0019] The number of parallel inferences, M, is the number of candidate output sequences generated in parallel by the target text classification model for a single target text. It directly determines the computational power consumption and the diversity of inference results of the model. Specifically, the larger M is, the more computational power is required, but more candidate output sequences can be generated, making it easier to select the optimal classification result; the smaller M is, the less computational power is required, but the number of candidate sequences is small, which may lead to classification errors due to single inference bias.

[0020] Therefore, based on the first real-time computing resources, the first number of parallel inferences M for the target text to be classified by the target text classification model is determined, which avoids both resource overload and resource idleness, while taking into account the diversity of results and inference efficiency.

[0021] In one specific embodiment, the text classification method further includes the following steps: S10: For any reference text in the reference text set, input the current reference text into the reference text classification model to obtain the reference output sequence corresponding to the current reference text, which includes the second text classification result. The reference text set includes several reference texts.

[0022] S20, based on the second text classification results and true classification labels corresponding to all reference texts, incrementally update the parameters of the reference text classification model to obtain the target text classification model.

[0023] The reference text set is a dataset consisting of several sample texts labeled with real classification labels. Each sample text is a reference text. The reference texts must belong to the same domain as the target texts and contain key features consistent with the target texts, such as structured fields and label levels.

[0024] True classification labels are absolutely accurate classification conclusions drawn from domain experts or authoritative annotation tools for the reference text, and must conform to the classification standards of the domain to which the reference text belongs. A dataset containing several reference texts, each with a corresponding known true classification label, is collected and used as the training basis for model updates.

[0025] The reference text classification model is an initial model without incremental updates. It possesses basic text classification capabilities but may suffer from insufficient classification accuracy and poor adaptability (such as non-compliance with target domain format specifications). It is typically a pre-trained semantic classification model with basic text classification capabilities, preferably built on the Transformer architecture, and includes an input layer, feature extraction layer, attention layer, and classification output layer. The input layer tokenizes the text and maps it to vectors, transforming the reference text into a vector sequence that the model can recognize. The feature extraction layer extracts and maps text semantic features to high dimensions using stacked convolutional units and fully connected layers. The attention layer captures the semantic relationships of key information in the text through a multi-head attention mechanism. The classification output layer outputs the class probability distribution through a Softmax activation function, achieving preliminary text classification. The reference text classification model supports multi-threaded parallel inference deployment, dynamically adjusting the number of inference threads based on real-time computing resources. Furthermore, the model parameters support partial freezing and low-rank matrix mounting, providing an architectural foundation for subsequent incremental updates. This allows for rapid adaptation to target classification scenarios while retaining the model's basic capabilities, reducing training computational costs and time. The basic classification capabilities of the reference text classification model are adapted to general natural language processing scenarios. Scenario adaptation can be achieved through incremental training with domain data. In this invention, the initial adaptation domain of the reference text classification model is consistent with the domain of the reference text set and the target text.

[0026] The output of the reference text classification model is random and variable. Even if the same reference text is input, the reference text classification model may output multiple different initial output sequences due to slight differences in the reasoning process. That is, it contains different second intermediate semantic representations and second text classification results. It is necessary to filter to obtain the reference output sequence containing the second intermediate semantic representation and the second text classification result.

[0027] The second intermediate semantics represents the reasoning process description of the reference text classification model, and the second text classification result is the preliminary classification judgment of the reference text by the reference text classification model.

[0028] Because the parameters of the reference text classification model suffer from domain adaptation defects—that is, the parameters of the general reference text classification model are not optimized for the format specifications, labeling systems, and other characteristics of the reference text domain—the second text classification result differs from the true classification label. Full retraining of the reference text classification model consumes significant computational power and time, and may cause the model to forget its basic classification capabilities. Incremental updates, which only adjust local parameters of the model, such as the low-rank matrix in the LoRA scheme, can retain the model's basic capabilities while reducing computational consumption and shortening training time, quickly adapting to the target classification scenario and forming a higher-performing target text classification model. Therefore, this embodiment incrementally updates the parameters of the reference text classification model to specifically correct its defects and obtain the target text classification model.

[0029] Correspondingly, the target text classification model is an optimized version of the reference text classification model after incremental updates using a low-rank matrix. It inherits the same architecture as the original reference model, retaining its input layer, feature extraction layer, attention layer, and classification output layer, with all original model parameters frozen throughout the process. Compared to the reference model, the optimization of the target text classification model lies in attaching a trained optimal low-rank matrix to a pre-defined position in the feature extraction layer. This forms a two-layer feature processing mechanism of original feature extraction and low-rank matrix feature optimization, enabling the target text classification model to accurately capture the semantic features and classification rules of the target text domain. The target text classification model features dynamic parallel inference and unsupervised quality assessment adaptation: it can automatically calculate and match the optimal number of parallel inferences M based on the first real-time computing resources, achieving dynamic adaptation of computing resources; during classification inference, it synchronously outputs the first intermediate semantic representation and the first text classification result, and the output format is fully adapted to the compliance verification rule base and confidence evaluation logic, supporting quantitative quality scoring of candidate output sequences; the inference computing cost and memory usage of the target text classification model can be accurately obtained through benchmark testing, providing data support for the calculation of the number of parallel inferences M, and the overall classification accuracy, domain adaptability, and compliance are all superior to the reference text classification model.

[0030] As described above, by incrementally updating parameters using a reference text set and real classification labels, the parameter defects of the reference text classification model are specifically corrected. This allows the target text classification model to quickly adapt to the format specifications and label system of the target text's domain, avoiding classification errors caused by model generalization and significantly improving classification accuracy and domain adaptability.

[0031] In one specific implementation, each reference output sequence further includes a second intermediate semantic representation, and S10 includes the following steps: S101, based on the second real-time computing resources corresponding to the current reference text, determine the second parallel inference quantity K of the reference text classification model for the current reference text, where K is a positive integer.

[0032] S102, input the current reference text into the reference text classification model to obtain K initial output sequences corresponding to the current reference text, wherein each initial output sequence contains a second intermediate semantic representation and a second text classification result.

[0033] S103, perform supervised quality assessment on each initial output sequence corresponding to the current reference text to obtain the second quality score corresponding to each initial output sequence. The supervised quality assessment includes compliance verification of the second intermediate semantic representation and accuracy verification of the second text classification result.

[0034] S104, determine the initial output sequence corresponding to the highest second quality score as the reference output sequence corresponding to the current reference text.

[0035] The second real-time computing resource refers to the hardware computing power and resource status that can be directly accessed when performing the reference text classification task. The second parallel inference quantity K is the number of initial output sequences generated in parallel by the reference text classification model for a single reference text. A reasonable value for K can ensure that a sufficiently diverse range of initial output sequences are generated, covering more inference possibilities, avoiding the inability to select high-quality reference output sequences due to insufficient sequence quantity, and avoiding exceeding the resource carrying capacity.

[0036] Specifically, first calculate the upper limit of the total computing power of the second real-time computing resources, which is the product of the number of available computing nodes and the computing power of a single computing node. Then, obtain the computing power cost of a single inference of the reference text classification model, that is, the number of floating-point operations required for one inference of a single text. Round down the ratio of the upper limit of total computing power to the computing power cost of a single inference to obtain the maximum value of K. At the same time, in order to ensure the diversity of sequences to support subsequent screening, K must satisfy K≥2. Therefore, if the calculation result <2, then take K=2. At this time, it is necessary to temporarily allocate additional resources or reduce the computing power consumption of a single inference, such as reducing the length of the model input sequence.

[0037] The initial output sequence is the raw output result generated by the reference text classification model after performing parallel inference on the reference text. Each initial output sequence contains a second intermediate semantic representation and a second text classification result. The reference text classification model generates K initial output sequences through a multi-threaded parallel inference mechanism. Specifically, after receiving the reference text, the reference text classification model starts K independent inference threads. Each thread loads the same model parameters but uses different random initializations, such as small perturbations in the attention layer weights and random masks for text tokens. This ensures that the second intermediate semantic representation generated by each thread differs from the second text classification result, achieving the same input but diverse outputs.

[0038] Supervised quality assessment is an evaluation method that uses real classification labels and a pre-set compliance rule base to quantitatively score the quality of each initial output sequence. It includes two main modules: compliance verification of the second intermediate semantic representation (such as sensitive information, format, and logic verification), and accuracy verification of the second text classification result (such as matching degree with real labels). This transforms the compliance and accuracy of the initial output sequence into comparable quantitative indicators, avoiding the subjectivity and inefficiency of manual screening. It ensures that the selected reference output sequence not only meets compliance requirements but also closely approximates the real classification results, providing high-quality error samples for the incremental parameter updates of the subsequent reference text classification model.

[0039] Specifically, the preset compliance rule base includes rules for detecting sensitive information, such as identifying unanonymized ID card numbers and mobile phone numbers; format standard rules, such as verifying the integrity of key information fields; and semantic logic rules, such as verifying the consistency of reasoning processes. The compliance verification module compares the second intermediate semantic representation with the preset compliance rule base, calculates the proportion of compliant items, and obtains a compliance score based on the proportion of compliant items. The accuracy verification module compares the second text classification result with the actual classification labels, calculates the label matching degree, and obtains an accuracy score. For example, a complete match scores 70 points, a partial match is calculated proportionally, and a complete mismatch scores 0 points.

[0040] Furthermore, the second quality score is a comprehensive quantitative score assigned to each initial output sequence through supervised quality assessment. It can be obtained by summing the compliance score and the accuracy score according to preset weights, such as a compliance weight of 0.3 and an accuracy weight of 0.7. The higher the score, the better the sequence quality. By comparing the second quality scores of all initial output sequences, the initial output sequence corresponding to the highest second quality score can be quickly located as the reference output sequence, ensuring that the error samples used for model updates are of reliable quality and avoiding deviations in the model update direction caused by low-quality sequences.

[0041] As described above, by determining K based on the second real-time computing resource, the resource adaptability and execution stability of the reference text inference are significantly improved. By generating K initial output sequences and dual-module supervised quality assessment, the quality reliability and compliance security of the reference output sequences are guaranteed, providing high-quality error samples for model updates, avoiding the model from learning non-compliant logic, ensuring the continuous improvement of the classification accuracy and compliance of the target text classification model, and ultimately meeting the actual needs of target text classification.

[0042] In one specific embodiment, S20 includes the following steps: S201, insert a low-rank matrix at a preset position in the feature extraction layer of the reference text classification model. The low-rank matrix consists of two low-rank matrices, and the total number of parameters of the low-rank matrix is ​​set as the product of the total number of parameters of the reference text classification model and a preset ratio.

[0043] S202, construct the model loss based on the difference between the second text classification result corresponding to the highest second quality score of each reference text and the true classification label.

[0044] S203, train the low-rank matrix based on the model loss to obtain the optimal low-rank matrix.

[0045] S204. The optimal low-rank matrix is ​​attached to the reference text classification model, while keeping the original parameters of the reference text classification model unchanged, to obtain the target text classification model after parameter incremental update.

[0046] Among them, the feature extraction layer is the core network layer in the reference text classification model responsible for extracting semantic features from the input text. It is commonly found in models based on architectures such as Transformer and CNN, such as the Encoder layer of the Transformer model and the convolutional layer of the CNN model. It can transform the original token sequence of the input text into a high-dimensional feature vector containing semantic information.

[0047] A low-rank matrix is ​​a matrix whose rank (the number of non-zero eigenvalues ​​in the matrix) is much smaller than its dimension. In this embodiment, it consists of two low-rank matrices, A and B. For example, the dimension of matrix A is the feature dimension × the rank parameter r, and the dimension of matrix B is the rank parameter r × the feature dimension. The concatenation of the two matrices is equivalent to a low-rank transformation matrix, which can be embedded in the preset position of the model feature extraction layer, that is, in the feature transfer path of the feature extraction layer. This optimizes the feature extraction effect without destroying the structure of the feature extraction layer and adapts to the domain characteristics of the reference text.

[0048] Compared to updating all parameters of the reference text classification model, training only the low-rank matrix can significantly reduce the number of parameters. For example, if the original model has 1 billion parameters, with a preset ratio of 0.2%, the low-rank matrix only has 2 million parameters, reducing training computational costs and the risk of overfitting, while accurately adjusting feature extraction performance. The preset ratio can be set according to the complexity of the text and the training computational budget, and can be determined by the implementer based on actual conditions. For example, the preset ratio is 0.1%-0.3% for simple text classification tasks and 0.3%-0.5% for complex tasks; in this embodiment, 0.2% is preferred.

[0049] The classification result of the second text corresponding to the highest second quality score is compared with the true classification label. The classification loss of a single reference text is calculated using the cross-entropy loss function. Finally, the average of the single losses of all reference texts is calculated to obtain the global model loss, which reflects the gap between the current best ability of the reference text classification model and the true standard. This provides a reliable error signal for the training of the low-rank matrix, and the optimal low-rank matrix is ​​obtained through training.

[0050] Furthermore, a modular mounting mechanism is adopted, in which the optimal low-rank matrix and the feature extraction layer of the reference text classification model are connected in parallel. After the text is input into the model, the feature extraction layer first extracts the original feature vector, and then optimizes and adjusts the feature vector through the low-rank matrix (A→B) to obtain an optimized feature vector adapted to the domain characteristics. Finally, the classification result is output based on this feature vector. If the parameters of the original model's feature extraction layer are directly replaced, the model will lose its ability to classify general text and will not be able to revert to the state before the update. With the modular mounting mechanism, the original model parameters remain frozen throughout the process, and incremental updates are only achieved through the low-rank matrix. While retaining the generality of the original model, the domain optimization capability of the low-rank matrix is ​​superimposed. If there are subsequent adjustment needs such as updates to the domain label system, only the low-rank matrix needs to be replaced, which greatly improves the model's iteration efficiency and flexibility.

[0051] As described above, by inserting a low-rank matrix next to the feature extraction layer and controlling the preset ratio, the computational cost and parameter efficiency of the incremental model update are optimally balanced; by constructing the model loss using the classification result with the highest second quality score, the accuracy of the error signal trained by the low-rank matrix is ​​greatly improved; by training the low-rank matrix and attaching it to the original reference text classification model, the domain adaptability and iterative flexibility of the target text classification model are significantly enhanced, the classification accuracy is improved, and the model iteration cost and time are reduced.

[0052] In one specific embodiment, S203 includes the following steps: S2031, Based on all the second quality scores of the reference text classification model for all reference texts, obtain the third quality score corresponding to the reference text classification model.

[0053] S2032, the reference text set is divided into a training subset and a validation subset according to a preset ratio. The training subset is used for iterative training of the low-rank matrix, and the validation subset is used to verify the classification effect of the model.

[0054] S2033, in each training round, the parameter values ​​of the low-rank matrix are adjusted through backpropagation and gradient descent algorithms based on the model loss corresponding to all reference texts in the current batch.

[0055] S2034 After completing the preset training rounds, the trained low-rank matrix is ​​attached to the reference text classification model to obtain a temporary updated model.

[0056] S2035, based on all the second quality scores corresponding to the temporary update model in the validation subset, obtain the fourth quality score corresponding to the temporary update model.

[0057] S2036, if the difference between the fourth quality score and the third quality score is less than the preset score threshold, then terminate the training and backtrack to the parameter value of the low-rank matrix in the previous round, and return to step S2033 until the difference between the fourth quality score and the third quality score is greater than or equal to the preset score threshold, or until the number of backtracking times meets the preset number of times threshold, then determine the low-rank matrix after the last training as the optimal low-rank matrix.

[0058] The third quality score is a comprehensive classification quality quantification index of the reference text classification model on all reference texts. It is calculated by the second quality score corresponding to all reference texts according to a preset method (such as arithmetic mean or weighted average), and reflects the basic classification ability of the model before the update.

[0059] Independent training and validation subsets are obtained by dividing the reference text set according to a preset ratio (e.g., 7:3, 8:2). The training subset contains most of the reference text and is used for iterative parameter updates of the low-rank matrix. The validation subset contains a few reference texts and does not overlap with the training subset. It is used to evaluate the classification performance of the trained model.

[0060] The preset number of epochs refers to the number of iterations for a single parameter update of the low-rank matrix (e.g., 5 epochs, 10 epochs). This is typically set based on the size of the training subset and the parameter convergence speed, ensuring that the low-rank matrix parameters have been optimized to a certain extent before each validation epoch, avoiding distortion of validation results due to insufficient iterations. For example, during training, all original parameters of the reference text classification model are frozen, and only the low-rank matrices A and B are updated. The AdamW optimizer is used, with an initial learning rate set to 5e-5 (0.00005), weight decay of 0.01, and a batch size of 32. The training epochs are set to 10, and an early stopping strategy is employed: if the validation set loss no longer decreases for three consecutive epochs, training is terminated early. In each training epoch, the parameter values ​​of the low-rank matrix are adjusted using backpropagation and gradient descent algorithms.

[0061] The temporary update model serves as an intermediate validation model during the training of the low-rank matrix. It is a transitional model not intended for practical application. Its architecture combines the original architecture of the reference text classification model with a temporary mount of a low-rank matrix that has not yet undergone optimal training. It is used only for evaluating the classification performance of a validation subset and does not participate in actual text classification inference. The parameters of the temporary update model are the original parameters of the reference text classification model plus the parameters of the low-rank matrix after the current training round. Its inference logic and output format are consistent with the target text classification model. It can simultaneously output a second intermediate semantic representation and a second text classification result, and supports supervised quality assessment and the calculation of a second quality score. The purpose of the temporary update model is to validate the training effect of the low-rank matrix in the current round. By comparing its fourth quality score on the validation subset with the third quality score of the reference text classification model, the effectiveness of the low-rank matrix parameter adjustments is determined, providing objective model performance data for selecting the optimal low-rank matrix. After training, the temporary update model will be replaced when the low-rank matrix parameters are updated or rolled back; it has no independent storage or deployment value.

[0062] The fourth quality score is a comprehensive classification quality quantification index of the model on the validation subset, which is temporarily updated. It is derived from the second quality score corresponding to all reference texts in the validation subset in the same preset way as the third quality score, and reflects the model performance after training with a low-rank matrix.

[0063] The difference between the fourth quality score and the third quality score directly reflects the optimization effect of the low-rank matrix. A difference greater than or equal to the preset score threshold indicates effective optimization; otherwise, it indicates that the current parameter adjustment is ineffective, requiring the triggering of a rollback mechanism to terminate the current training, roll back to the low-rank matrix parameters of the previous round (rollback count + 1), and retrain based on the rolled-back parameters. If the number of rollbacks reaches the preset threshold, even if the difference requirement is still not met, training is terminated, and the low-rank matrix after the last training is determined as the optimal low-rank matrix to avoid infinite loops.

[0064] The preset score threshold is the minimum quality improvement to judge the optimization effect of the low-rank matrix, such as 0.5 points or 1 point, based on the maximum score of the second quality score. The preset number of times threshold is the maximum number of times the rollback mechanism can be executed, such as 3 or 5 times, to avoid infinite rollback that could cause training stagnation, ensure that the training process can be terminated, and balance model performance and training efficiency.

[0065] The above-mentioned operations, including temporary model validation, difference judgment, and backoff mechanism, make the selection of the optimal low-rank matrix more accurate and the training process more controllable. Temporary validation can eliminate invalid parameters in advance, the backoff mechanism can correct the training direction, and the number of times threshold can prevent training stagnation. The optimal low-rank matrix selected in the end can not only effectively improve the model performance, but also ensure that the training process is completed within the preset range, thus balancing model performance and training efficiency.

[0066] In one specific implementation, the first real-time computing resource includes the number of currently available computing nodes, the computing power of a single computing node, and the memory capacity. S1 includes the following steps: S11, obtain the computational cost of a single inference operation corresponding to the target text classification model.

[0067] S12: Calculate the upper limit of the total computing power available for target text reasoning based on the number of currently available computing nodes, the computing power of a single computing node, and the memory capacity.

[0068] S13 is the ratio of the total computing power limit to the computing power cost per inference rounded down, which is used as the first number of parallel inferences M for the target text classification model for the target text.

[0069] The computational cost per inference run can be obtained through benchmark testing and dynamic adaptation. Specifically, a test text with the same length and format as the target text is selected, input into the target text classification model, and an inference run is performed. The FLOPs consumed in this inference run are recorded using a computational power monitoring tool (such as NVIDIA NVProf or TensorBoard) as the base computational cost. If the target text length differs from the test text length, such as the target text having 1.2 times the number of tokens as the test text, the base computational cost is adjusted linearly according to the length ratio, for example, by multiplying the base cost by 1.2 to obtain the final computational cost per inference run.

[0070] The total computing power limit can be calculated using a minimum-value logic based on dual constraints of computing power and memory. Specifically, the theoretical limit based on computing power is the product of the number of currently available computing nodes, the computing power of a single computing node (FLOPs / second), and the inference time allowance (e.g., if the target text inference needs to be completed within 1 second, then the inference time allowance is 1 second). The actual limit based on memory is the ratio of the product of the number of currently available computing nodes, the memory capacity of a single computing node, and the computing power of a single computing node to the memory usage for a single inference operation. The memory usage for a single inference operation is the memory required for one instance of target text inference, such as the memory used for model parameter loading plus the memory used for text data. Therefore, the total computing power limit is the smaller of the theoretical limit based on computing power and the actual limit based on memory.

[0071] It should be noted that if M < 2 after rounding down, then M should be forcibly set to 2. In this case, it is necessary to temporarily reduce the computing power of non-critical tasks or reduce the memory usage of single inference, such as shortening the text input length, to ensure that M ≥ 2, so as to ensure the reliability of subsequent selection of the optimal classification result.

[0072] It should be noted that, to ensure the standardization and legality of the input data, strict preprocessing and validation are performed on the original text, including format validation: checking whether the text contains necessary structured fields, and text with missing fields will be marked as illegal input and rejected from subsequent processes; desensitization: matching sensitive information such as ID card numbers, mobile phone numbers, and bank card numbers based on regular expressions and replacing them with special placeholders (such as [ID], [PHONE]); standardization: converting dates to YYYY-MM-DD format, removing redundant whitespace characters, and standardizing full-width / half-width symbols; word segmentation and encoding: using BERT's built-in Chinese word segmenter (such as BertTokenizer) to segment the text, adding special markers [CLS] (for classification) and [SEP] (for separation), and truncating or padding to a fixed length (such as 512 tokens). Through the above preprocessing, it can be ensured that the data input to the target text classification model and the reference text classification model not only meets security and compliance requirements but also satisfies the standardization of the model input format.

[0073] The above-mentioned method ensures that the computational cost of a single inference is accurately obtained and the upper limit of the total computational power is calculated through dual constraints of computational power and memory. This ensures that the subsequent calculation of M can truly match the inference requirements of the target text. At the same time, it ensures that the parallel inference task corresponding to M can be completed on time with the support of computational power and can be executed stably under memory constraints. This avoids crashes or timeouts during the inference process and improves the accuracy and stability of the target text classification results.

[0074] S2, the target text is processed according to the target text classification model to obtain M candidate output sequences, where each candidate output sequence contains a first intermediate semantic representation and a first text classification result.

[0075] The first intermediate semantic representation is a semantic description output by the target text classification model during the classification reasoning process. It intuitively reflects the classification logic of the target text classification model, such as the target text containing event time, involving subject fields, and having a complete format. Based on the field content, it is initially determined to be text of category XX, which is different from the final classification conclusion. It focuses on the reasoning process rather than the result. Specifically, the target text classification model generates M candidate output sequences through multi-threaded parallel reasoning. Each reasoning thread shares the same model parameters, but introduces reasoning randomness by setting different random seeds (e.g., seed values ​​are 0, 1, ..., M-1) or enabling different Dropout masks, thereby generating diverse intermediate semantic representations and classification results. The first intermediate semantic representation is taken from the hidden state vector (e.g., dimension 768) corresponding to the [CLS] token output by the last Transformer layer of the target text classification model. This hidden state vector aggregates the global semantic information of the input text. The first text classification result is the category label with the highest probability after classification head and Softmax and its probability value.

[0076] The first text classification result is the final classification conclusion output by the target text classification model for the target text. It is usually presented in the form of labels and needs to match the classification label system of the target text's domain.

[0077] S3, perform unsupervised quality assessment on each candidate output sequence to obtain the first quality score corresponding to each candidate output sequence. The unsupervised quality assessment includes compliance verification of the first intermediate semantic representation and confidence assessment of the first text classification result.

[0078] The unsupervised quality assessment can quantitatively evaluate the quality of candidate output sequences without relying on real classification labels, based solely on preset rules and the model's own output information. It includes two main modules: compliance verification of the first intermediate semantic representation and confidence assessment of the first text classification result, providing an objective quality ranking basis for M candidate output sequences. In the absence of real labels, unsupervised assessment can quickly filter out sequences with excellent compliance and high confidence, avoiding the subjectivity and inefficiency of manual assessment and ensuring the reliability of the target classification result.

[0079] As described above, unsupervised quality assessment eliminates the need for pre-labeled real labels, enabling evaluation solely based on rules and model information. This allows for high-quality filtering of target text even in scenarios without real labels, adapting to real-time classification tasks and preventing the inability to select optimal results due to a lack of labels, thus improving the practicality of the classification method. Furthermore, the dual-dimensional assessment of compliance and confidence not only identifies compliance flaws in the reasoning process (such as sensitive information and formatting issues) but also evaluates the reliability of the classification results, avoiding risks associated with single-dimensional filtering and enhancing the security and reliability of the classification results.

[0080] In one specific embodiment, S3 includes the following steps: S31, compare the first intermediate semantic representation in each candidate output sequence with the compliance verification rule base, and take the ratio of the number of first intermediate semantic representations that conform to the rules to the total number of first intermediate semantic representations as the first compliance score. The compliance verification rule base includes sensitive information detection rules, format standard rules and semantic logic specification rules.

[0081] S32, based on the category probability distribution output by the target text classification model, obtain the category probability value corresponding to each candidate output sequence.

[0082] S33, the class probability value corresponding to each candidate output sequence is used as the first confidence score.

[0083] S34. Based on the first compliance score and the first confidence score corresponding to each candidate output sequence, obtain the first quality score corresponding to each candidate output sequence.

[0084] The compliance verification rule base is a pre-built set of rules used to verify whether the first intermediate semantic representation conforms to domain specifications. It includes three core categories of rules: sensitive information detection rules (such as rules for identifying unanonymized ID card numbers and mobile phone numbers), format standard rules (such as rules for the integrity of key information fields and the use of special symbols), and semantic logic standard rules (such as rules for determining whether the reasoning process is consistent and free from redundancy). Through the rule base, compliance defects in the first intermediate semantic representation can be systematically identified, preventing sequences containing sensitive information, disordered formats, or logical contradictions from entering subsequent screening, thus ensuring the security and standardization of the classification process.

[0085] The first compliance score is a quantitative indicator that reflects the compliance level of the first intermediate semantic representation, obtained through compliance verification. It is calculated by the ratio of the number of first intermediate semantic representations that comply with the rules to the total number of first intermediate semantic representations, and the value ranges from 0 to 1 or 0 to 100. The higher the score, the stronger the compliance. It is used to provide a refined basis for comparison and support the subsequent comprehensive quality ranking.

[0086] The category probability distribution is the set of probabilities output by the target text classification model, corresponding to all possible categories. For example, the probability of category 1 is 0.7, the probability of category 2 is 0.2, and the probability of category 3 is 0.1. It reflects the confidence level of the target text classification model for each category and satisfies the constraint that the sum of the probabilities of all categories is 1.

[0087] Correspondingly, the first confidence score reflects the reliability of the first text classification result. It is directly taken as the probability value of the category corresponding to the first text classification result output by the target text classification model. For example, if the first text classification result is government notice, its corresponding probability of 0.85 is the first confidence score. The value range is 0-1 or 0-100. The higher the score, the stronger the model's confidence in the classification result.

[0088] The first quality score is a quantitative indicator that comprehensively reflects the overall quality of the candidate output sequence. It is obtained by summing the first compliance score and the first confidence score according to preset weights (such as compliance weight 0.4 and confidence weight 0.6). The value range is 0-1 or 0-100 points, thereby achieving a comprehensive balance between compliance and reliability, ensuring that the finally selected sequence is both compliant and reliable, meeting the dual requirements of domain text classification.

[0089] The above-mentioned three-category rule-based full-coverage verification avoids defects and omissions, effectively filtering sequences containing sensitive information, disordered formats, or logical contradictions, thus ensuring the standardization and security of the classification process. By combining the first compliance score and the first confidence score to obtain the first quality score, a quantitative indicator that comprehensively reflects the overall quality of the candidate output sequence is obtained, achieving a comprehensive balance between compliance and reliability, thereby improving the security and reliability of the classification results.

[0090] In one specific embodiment, S31 includes the following steps: S311, for any first intermediate semantic representation, match the current first intermediate semantic representation with the sensitive information detection rule. If the current first intermediate semantic representation does not contain the un-de-identified privacy field in the sensitive information detection rule, then determine that the current first intermediate semantic representation meets the sensitive information requirements.

[0091] S312, Match the current first intermediate semantic representation with the format standard rules. If all formats of the current first intermediate semantic representation conform to the format standard rules, then determine that the current first intermediate semantic representation conforms to the format requirements.

[0092] S313, Match the current first intermediate semantic representation with the semantic logic specification rules. If the current first intermediate semantic representation passes the logical consistency verification corresponding to the semantic logic specification rules, then determine that the current first intermediate semantic representation meets the semantic logic requirements.

[0093] S314. If the current first intermediate semantic representation meets the requirements of sensitive information, format, and semantic logic, then the current first intermediate semantic representation is determined to conform to the rules.

[0094] S315, iterate through all the first intermediate semantic representations, and take the ratio of the number of all first intermediate semantic representations that conform to the rules to the total number of first intermediate semantic representations as the first compliance score.

[0095] Among them, un-anonymized privacy fields are sensitive information fields that have not undergone privacy protection processing (such as anonymization or masking). Their specific types are defined by sensitive information detection rules, such as personal identification information, contact information, and privacy attribute information. If such fields appear directly in the first intermediate semantic representation, it will violate data security regulations. By identifying un-anonymized privacy fields, compliance risks in the first intermediate semantic representation can be quickly located, avoiding security problems caused by privacy leaks and meeting the stringent data security requirements of the domain.

[0096] The format standard rules include three elements: field completeness (such as key information fields, event time, and no missing subjects), symbol standardization (such as date format being uniformly YYYY-MM-DD, and correct use of special identifiers []), and conciseness of expression (such as no redundant semantic repetition and no invalid placeholders). All elements must be satisfied simultaneously to meet the format requirements. If only a single format element is checked (such as only checking field completeness), symbol errors or redundancy issues may be missed. Full format validation can ensure the structured and standardized semantic representation of the first intermediate element, adapting to subsequent data processing needs.

[0097] The logical consistency verification of semantic logic rules involves using pre-defined logical judgment rules to check for contradictions or loopholes in the reasoning process of the first intermediate semantic representation. This includes consistency in causal logic (e.g., no time contradiction between the event occurrence date of 2024-05-01 and the subsequent handling date of 2024-04-30), consistency in expression logic (e.g., consistent use of the same subject's name, avoiding ambiguity caused by the interchangeable use of "Company A" and "Enterprise A"), and consistency in common-sense logic (e.g., no common-sense conflict between an outdoor event and the absence of weather records). Focusing solely on format and sensitive information might overlook logical flaws in the reasoning process. Logical consistency verification ensures the rigor of the reasoning logic in the first intermediate semantic representation, providing reliable logical support for the first text classification results.

[0098] The first intermediate semantic representation must simultaneously meet the requirements for sensitive information, format, and semantic logic; none of these can be omitted. This is to ensure the rigor and comprehensiveness of the compliance assessment, avoid compliance loopholes caused by relaxing certain requirements, thereby minimizing compliance risks and ensuring the quality of the first intermediate semantic representation.

[0099] The above-mentioned requirements, including sensitive information requirements, format requirements, and semantic logic requirements, along with logical judgments, make the compliance standards of the first intermediate semantic representation more rigorous and comprehensive. This avoids defects and omissions caused by compliance in a single dimension, ensures that the compliance sequence simultaneously possesses security, standardization, and rigor, and ensures the accuracy of the first quality score calculation. Thus, it provides high-quality reasoning support for the first text classification results.

[0100] S4. The first text classification result corresponding to the highest first quality score is determined as the target classification result of the target text.

[0101] Among them, the first quality score has integrated the first compliance score (reflecting the compliance of the reasoning process) and the first confidence score (reflecting the reliability of the classification result). The highest score means that the corresponding sequence performs best in both core indicators. Therefore, the first text classification result corresponding to the highest first quality score is determined as the target classification result of the target text, which serves as the final category assignment conclusion for the target text to be classified, and can provide an accurate category basis for subsequent business processing.

[0102] As described above, by dynamically determining the first parallel inference quantity M using the first real-time computing resources, it avoids inference lag and timeouts caused by M being too large and exceeding resource capacity, while also avoiding idle computing power waste caused by M being too small, thus achieving a precise balance between computing resource utilization and inference stability. By initiating multi-threaded parallel inference, M candidate output sequences containing the first intermediate semantic representation and the first text classification result are generated, covering different inference logics of the model for the target text, while taking into account result diversity and inference efficiency, significantly reducing classification errors caused by single sequence inference bias. By calculating the first quality score through compliance verification and confidence assessment, sequences containing security risks or structural defects are not only filtered out, ensuring the security of the classification process, but also the reliability differences of classification results are distinguished, avoiding one-sided judgments that ignore reliability based solely on labels, and achieving objective quality quantification of candidate output sequences in scenarios without real labels. Finally, by extracting the first text classification result corresponding to the highest first quality score as the target classification result, the accuracy of the text classification result is ensured.

[0103] Example 2 Embodiment 2 of the present invention provides a non-transitory computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiment. The at least one instruction or at least one program is loaded and executed by the processor to implement the text classification method provided in the above embodiment.

[0104] Example 3 Embodiment 3 of the present invention provides an electronic device, which includes a processor and the non-transitory computer-readable storage medium of Embodiment 2 of the present invention.

[0105] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A text classification method, characterized in that, The text classification method includes the following steps: S1, based on the first real-time computing resources, determine the first number of parallel inferences M for the target text to be classified by the target text classification model, where M is a positive integer; S2, the target text is processed according to the target text classification model to obtain M candidate output sequences, wherein each candidate output sequence contains a first intermediate semantic representation and a first text classification result; S3, perform unsupervised quality assessment on each candidate output sequence to obtain the first quality score corresponding to each candidate output sequence, wherein the unsupervised quality assessment includes compliance verification of the first intermediate semantic representation and confidence assessment of the first text classification result; S4, determine the first text classification result corresponding to the highest first quality score as the target classification result of the target text.

2. The text classification method according to claim 1, characterized in that, The text classification method also includes the following steps: S10, for any reference text in the reference text set, input the current reference text into the reference text classification model to obtain the reference output sequence corresponding to the current reference text, which includes the second text classification result, wherein the reference text set includes several reference texts; S20, based on the second text classification results and true classification labels corresponding to all reference texts, the parameters of the reference text classification model are incrementally updated to obtain the target text classification model.

3. The text classification method according to claim 2, characterized in that, Each reference output sequence also includes a second intermediate semantic representation, and S10 includes the following steps: S101, based on the second preset classification effect and the second real-time computing resources corresponding to the current reference text, determine the second parallel inference quantity K of the reference text classification model for the current reference text, where K is a positive integer; S102, the current reference text is input into the reference text classification model to obtain K initial output sequences corresponding to the current reference text, wherein each initial output sequence contains a second intermediate semantic representation and a second text classification result; S103, Perform supervised quality assessment on each initial output sequence corresponding to the current reference text to obtain a second quality score for each initial output sequence. The supervised quality assessment includes compliance verification of the second intermediate semantic representation and accuracy verification of the second text classification result. S104, determine the initial output sequence corresponding to the highest second quality score as the reference output sequence corresponding to the current reference text.

4. The text classification method according to claim 2, characterized in that, S20 includes the following steps: S201, a low-rank matrix is ​​inserted at a preset position in the feature extraction layer of the reference text classification model, wherein the low-rank matrix consists of two low-rank matrices, and the total number of parameters of the low-rank matrix is ​​set as the product of the total number of parameters of the reference text classification model and a preset ratio; S202, construct the model loss based on the difference between the second text classification result corresponding to the highest second quality score of each reference text and the true classification label; S203, Train the low-rank matrix based on the model loss to obtain the optimal low-rank matrix; S204, the optimal low-rank matrix is ​​attached to the reference text classification model, and the original parameters of the reference text classification model are kept unchanged to obtain the target text classification model after parameter incremental update.

5. The text classification method according to claim 4, characterized in that, S203 includes the following steps: S2031, Based on all the second quality scores of all reference texts for the reference text classification model, obtain the third quality score corresponding to the reference text classification model; S2032, the reference text set is divided into a training subset and a validation subset according to a preset ratio, wherein the training subset is used to iteratively train the low-rank matrix, and the validation subset is used to verify the classification effect of the model; S2033, In each training round, the parameter values ​​of the low-rank matrix are adjusted by backpropagation and gradient descent algorithms based on the model loss corresponding to all reference texts in the current batch. S2034, After completing the preset number of training rounds, the trained low-rank matrix is ​​attached to the reference text classification model to obtain a temporary updated model; S2035, based on all the second quality scores corresponding to the temporary update model for the verification subset, obtain the fourth quality score corresponding to the temporary update model; S2036, if the difference between the fourth quality score and the third quality score is less than a preset score threshold, then terminate the training and revert to the parameter value of the low-rank matrix in the previous round, and return to step S2033 until the difference between the fourth quality score and the third quality score is greater than or equal to the preset score threshold, or until the number of reverts meets the preset number threshold, then determine the low-rank matrix after the last training as the optimal low-rank matrix.

6. The text classification method according to claim 1, characterized in that, The first real-time computing resource includes the number of currently available computing nodes, the computing power of a single computing node, and the memory capacity. S1 includes the following steps: S11, Obtain the single inference computing cost corresponding to the target text classification model; S12, based on the number of currently available computing nodes, the computing power of a single computing node, and the memory capacity, calculate the upper limit of the total computing power that can be used for target text reasoning; S13, the ratio of the total computing power limit to the computing power cost per inference is rounded down to the nearest integer, which is used as the first parallel inference number M of the target text classification model for the target text.

7. The text classification method according to claim 1, characterized in that, S3 includes the following steps: S31, compare the first intermediate semantic representation in each candidate output sequence with the compliance verification rule base, and take the ratio of the number of first intermediate semantic representations that conform to the rules to the total number of first intermediate semantic representations as the first compliance score. The compliance verification rule base includes sensitive information detection rules, format standard rules and semantic logic specification rules. S32, Based on the category probability distribution output by the target text classification model, obtain the category probability value corresponding to each candidate output sequence; S33, use the class probability value corresponding to each candidate output sequence as the first confidence score; S34. Based on the first compliance score and the first confidence score corresponding to each candidate output sequence, obtain the first quality score corresponding to each candidate output sequence.

8. The text classification method according to claim 7, characterized in that, S31 includes the following steps: S311, for any first intermediate semantic representation, match the current first intermediate semantic representation with the sensitive information detection rule. If the current first intermediate semantic representation does not contain the unde-identified privacy field in the sensitive information detection rule, then determine that the current first intermediate semantic representation meets the sensitive information requirements. S312, Match the current first intermediate semantic representation with the format standard rules. If all formats of the current first intermediate semantic representation conform to the format standard rules, then determine that the current first intermediate semantic representation conforms to the format requirements. S313, Match the current first intermediate semantic representation with the semantic logic specification rules. If the current first intermediate semantic representation passes the logical consistency verification corresponding to the semantic logic specification rules, then determine that the current first intermediate semantic representation meets the semantic logic requirements. S314, If the current first intermediate semantic representation simultaneously meets the sensitive information requirements, format requirements, and semantic logic requirements, then the current first intermediate semantic representation is determined to conform to the rules; S315, iterate through all the first intermediate semantic representations, and take the ratio of the number of all first intermediate semantic representations that conform to the rules to the total number of first intermediate semantic representations as the first compliance score.

9. A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the text classification method as described in any one of claims 1-8.

10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.