Text review method and apparatus, and electronic device and computer program product

By constructing a comprehensive framework and optimization strategies for multiple text review schemes, the problem of balancing efficiency and accuracy in text review in existing retrieval and classification models is solved, achieving more efficient and accurate text review results.

CN119202252BActive Publication Date: 2026-11-24中国邮政储蓄银行股份有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411263003.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2026-11-24
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

Existing technologies have failed to effectively integrate the advantages of retrieval and classification models in text review, making it difficult to achieve the best balance between review efficiency and accuracy, and lacking optimization methods for different schemes.

Method used

A comprehensive framework employing multiple text review schemes is proposed, including a retrieval scheme based on a pre-trained model and a retrieval and classification scheme based on a text review classification model. By constructing a full-cycle validation dataset and designing corresponding optimization strategies, the initial review results are optimized to improve accuracy.

Benefits of technology

By collaboratively exploring the complementarity of multiple solutions, the accuracy and efficiency of text review are improved, solving the problem of insufficient accuracy caused by the single solution in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119202252B_ABST
    Figure CN119202252B_ABST
Patent Text Reader

Abstract

This application discloses a text review method, apparatus, electronic device, and computer program product. The method includes: acquiring the text to be reviewed; reviewing the text using a currently used text review scheme to obtain an initial text review result, wherein the currently used text review scheme is determined after evaluating multiple text review schemes, and the text review scheme includes a retrieval scheme and a classification scheme; and optimizing the initial text review result according to the review optimization strategy corresponding to the currently used text review scheme to obtain a final text review result. This application constructs a new text review framework by evaluating the effects of multiple different text review schemes. Multiple different text review schemes work together, exploring the complementarity between the schemes to improve the effectiveness of text review. Furthermore, it designs result optimization strategies for different text review schemes to further improve the accuracy of text review.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of text review technology, and in particular to a text review method, apparatus, electronic device, and computer program product. Background Technology

[0002] Generally speaking, text review is a process of verifying the compliance and legality of multiple elements within a document, and it is a crucial step in ensuring business compliance and preventing legal risks. For example, during the legal review of contract documents, legal personnel typically issue a legal opinion after review. These legal opinions can serve as a reference for subsequent contract reviews and as a basis for supplementary review.

[0003] Traditionally, this process has relied heavily on legal professionals with extensive legal knowledge and practical experience, which is not only time-consuming and labor-intensive but also makes it difficult to comprehensively identify all potential legal risks. With the rapid development of information technology, especially the rise of artificial intelligence, using automated tools to assist or replace some manual review work has become an industry trend.

[0004] Currently, a relatively reliable solution is to collect a large amount of labeled data, train a classification model to classify the text to be reviewed, and then provide review opinions. However, in the production process, it is often difficult to obtain a large amount of labeled data. Therefore, some low-cost solutions are needed in the early stages of production. Most of these low-cost solutions are non-model training solutions, such as using retrieval solutions to solve the text review problem. However, these solutions are generally slightly inferior to model training solutions in terms of accuracy.

[0005] It is evident that most existing technologies employ only a single approach, failing to effectively integrate the respective advantages of retrieval and classification models to achieve the optimal balance between review efficiency and accuracy. Furthermore, they fail to fully consider the shortcomings of different approaches and adopt effective optimization methods. Therefore, how to construct a comprehensive review scheme that balances review efficiency and accuracy has become a pressing technical problem to be solved. Summary of the Invention

[0006] This application provides a text review method, apparatus, electronic device, and computer program product to improve the accuracy of text review.

[0007] The embodiments of this application adopt the following technical solutions:

[0008] In a first aspect, embodiments of this application provide a text review method, the text review method comprising:

[0009] Obtain the text to be reviewed;

[0010] The text to be reviewed is reviewed using the currently used text review scheme to obtain an initial text review result. The currently used text review scheme is determined after evaluating multiple text review schemes, including a retrieval scheme and a classification scheme.

[0011] The initial text review result is optimized according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result.

[0012] Optionally, the multiple text review schemes include a retrieval scheme based on a pre-trained model, a retrieval scheme based on a text review classification model, and a classification scheme based on a text review classification model. The text review method further includes:

[0013] Obtain the training dataset for the text censorship classification model;

[0014] If the amount of data in the training dataset exceeds a preset data volume threshold, the text review classification model is trained using the training dataset.

[0015] Based on the trained text censorship classification model, a retrieval scheme and a classification scheme based on the text censorship classification model are generated.

[0016] The various text review schemes were evaluated to determine which ones were suitable for deployment.

[0017] Optionally, the evaluation of multiple text moderation schemes to determine the text moderation schemes that can be deployed online includes:

[0018] Construct a full-cycle validation dataset;

[0019] The full-cycle verification dataset is used to evaluate multiple text review schemes to determine those that can be deployed online.

[0020] Optionally, constructing the full-cycle validation dataset includes:

[0021] Obtain the original training dataset, the original validation dataset, and the newly added training data;

[0022] The original validation dataset is updated using the original training dataset and the newly added training data to obtain the updated validation dataset;

[0023] The full-cycle validation dataset is constructed based on the original validation dataset and the updated validation dataset.

[0024] Optionally, the step of evaluating multiple text moderation schemes using the full-cycle verification dataset to determine the text moderation schemes that can be deployed online includes:

[0025] The pre-trained model is used to extract features from the data in the full-cycle validation dataset and the training dataset. Based on the first feature extraction results of the full-cycle validation dataset and the first feature extraction results of the training dataset, a retrieval and matching are performed to obtain the first classification result of the full-cycle validation dataset.

[0026] The text review classification model is used to extract features from the full-cycle verification dataset and the training dataset. Based on the second feature extraction results of the full-cycle verification dataset and the second feature extraction results of the training dataset, a retrieval and matching are performed to obtain the second classification result of the full-cycle verification dataset.

[0027] The text review classification model is used to classify the data in the full-cycle verification dataset to obtain the third classification result of the full-cycle verification dataset;

[0028] Based on the first, second, and third classification results of the full-cycle verification dataset, a text review scheme that can be deployed online is determined.

[0029] Optionally, the text review method further includes:

[0030] Determine whether to trigger the update strategy of the text review classification model, wherein the update strategy includes at least one of a periodic update strategy and a transactional update strategy;

[0031] When the text censorship classification model is triggered by the update strategy, the text censorship classification model is updated.

[0032] Optionally, the currently used text review scheme is a retrieval scheme implemented based on a pre-trained model or a text review classification model. The step of optimizing the initial text review result according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result includes:

[0033] Among the search results obtained using a search scheme based on a pre-trained model or a text review classification model, multiple search results with similarity values ​​exceeding a preset threshold are obtained.

[0034] Statistical analysis is performed on the text review categories corresponding to multiple search results that exceed a preset similarity threshold;

[0035] The final text review results will be determined based on the statistical findings.

[0036] Optionally, the currently used text review scheme is a classification scheme based on a text review classification model, and the optimization of the initial text review result according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result includes:

[0037] Determine whether the category probability corresponding to the text review result obtained by the classification scheme based on the text review classification model is less than a preset probability threshold;

[0038] If the category probability is less than a preset probability threshold, the retrieval results obtained by the retrieval scheme based on the pre-trained model and the text review classification model are acquired.

[0039] The text classification results output by the text review classification model and the retrieval results obtained by the retrieval scheme based on the pre-trained model and the text review classification model are fused to determine the final text review result.

[0040] Secondly, embodiments of this application also provide a text review device, the text review device comprising:

[0041] The first acquisition unit is used to acquire the text to be reviewed;

[0042] The review unit is used to review the text to be reviewed using the currently used text review scheme to obtain an initial text review result. The currently used text review scheme is determined after evaluating multiple text review schemes, including a retrieval scheme and a classification scheme.

[0043] The optimization unit is used to optimize the initial text review result according to the review optimization strategy corresponding to the currently used text review scheme, so as to obtain the final text review result.

[0044] Thirdly, embodiments of this application also provide an electronic device, including:

[0045] Processor; and

[0046] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform any of the aforementioned text review methods.

[0047] Fourthly, embodiments of this application also provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement any of the aforementioned text review methods.

[0048] The at least one technical solution adopted in this application embodiment can achieve the following beneficial effects: The text review method of this application embodiment first obtains the text to be reviewed; then reviews the text to be reviewed using the currently used text review scheme to obtain an initial text review result. The currently used text review scheme is determined after evaluating multiple text review schemes, including retrieval schemes and classification schemes; finally, the initial text review result is optimized according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result. The text review method of this application embodiment constructs a new text review framework by evaluating the effects of multiple different text review schemes. Multiple different text review schemes work together, explore the complementarity between multiple schemes, improve the effect of text review, and design result optimization strategies for different text review schemes to further improve the accuracy of text review. Attached Figure Description

[0049] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0050] Figure 1 This is a flowchart illustrating a text review method according to an embodiment of this application;

[0051] Figure 2 This is a schematic diagram of the training structure of a text review classification model in an embodiment of this application;

[0052] Figure 3 This is a schematic diagram of a multi-option evaluation process in an embodiment of this application;

[0053] Figure 4 This is a schematic diagram of a text review process for fusing multiple solutions in an embodiment of this application;

[0054] Figure 5 This is a schematic diagram of the overall process of text review in an embodiment of this application;

[0055] Figure 6 This is a schematic diagram of the structure of a text review device according to an embodiment of this application;

[0056] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0058] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0059] To facilitate understanding of the various embodiments of this application, the main text review schemes adopted in the prior art are first introduced:

[0060] Currently, there are various technical solutions for text review on the market, which can be mainly divided into two categories: retrieval solutions and classification solutions.

[0061] Search-based approaches: These approaches typically break down the document under examination into smaller units (such as single sentences or paragraphs), then search for similar or related content in the system's database, identifying potential risks by calculating sentence or text similarity. For example, patent document CN111046142A identifies potentially risky sentences by segmenting them into sentences and comparing them with similar sentences in the database; patent document CN110163478A provides risk warnings for paragraph texts by calculating the similarity between paragraph text and clause text in a contract sample. These methods do not require a large amount of labeled data and have relatively low implementation costs, but they have certain limitations in accuracy and semantic understanding.

[0062] Classification model-based solutions: Unlike retrieval solutions, classification model solutions rely on machine learning or deep learning algorithms. Through training on large amounts of labeled data, the model can autonomously learn the semantic features of text, thereby automatically classifying documents and assessing risks. As shown in patent document CN114860882A, this method uses a text classification model to classify and review government policy documents, significantly improving the accuracy and efficiency of the review process and effectively reducing the workload of experts. However, this method requires a large amount of data, and the model construction and training process is relatively complex.

[0063] While both approaches have demonstrated value in document review, they each have significant technical limitations. Retrieval methods, though inexpensive, struggle with complex semantic relationships and identifying potential legal risks. Classification methods, while highly accurate, are heavily reliant on data and face challenges in model adaptation and cross-domain application.

[0064] Based on this, embodiments of this application provide a text review method, such as... Figure 1 The diagram illustrates a text review method according to an embodiment of this application. The text review method includes at least the following steps S110 to S130:

[0065] Step S110: Obtain the text to be reviewed;

[0066] In this embodiment of the application, when conducting text review, it is necessary to first obtain the text to be reviewed. This text to be reviewed can be a contract text, application materials, advertising copy, etc. The text review method of this embodiment of the application can be applied to multiple fields related to documents, such as contract document review and analysis of submitted materials. The specific field of application is not specifically limited here.

[0067] Step S120: Review the text to be reviewed using the currently used text review scheme to obtain an initial text review result. The currently used text review scheme is determined after evaluating multiple text review schemes, including a retrieval scheme and a classification scheme.

[0068] When conducting text review, it is also necessary to determine the text review scheme currently in use. The text review scheme currently in use is determined after a comprehensive evaluation of multiple text review schemes, including retrieval schemes and classification schemes. The purpose of the evaluation is to ensure that the review scheme currently in use is the most effective one.

[0069] Then, the text to be reviewed is reviewed using the currently used text review scheme to obtain the initial review results. For example, for the retrieval scheme, multiple retrieval results can be obtained based on similarity calculation, and for the classification scheme, the probability results of the text belonging to each category can be obtained.

[0070] Step S130: Optimize the initial text review result according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result.

[0071] Considering that the text review scheme may face inaccurate or unclear initial text review results in the actual application stage, the embodiments of this application need to further adopt the review optimization strategy corresponding to the currently used text review scheme to optimize the search results or classification results obtained by the above review scheme, so as to obtain more accurate text review results.

[0072] The text review method in this application constructs a new text review framework by evaluating the effects of various different text review schemes. The synergy between these schemes is explored, improving the effectiveness of text review. Furthermore, the method designs result optimization strategies for different text review schemes, further enhancing the accuracy of text review.

[0073] In some embodiments of this application, multiple text review schemes include retrieval schemes based on pre-trained models, retrieval schemes based on text review classification models, and classification schemes based on text review classification models. The text review method further includes: obtaining a training dataset for the text review classification model; training the text review classification model using the training dataset when the amount of data in the training dataset exceeds a preset data amount threshold; generating retrieval schemes and classification schemes based on the trained text review classification model; evaluating multiple text review schemes to determine those that can be deployed online.

[0074] The text review schemes in this application can be divided into two main categories: retrieval schemes and classification schemes. The retrieval schemes can be further divided into retrieval schemes based on pre-trained models and retrieval schemes based on text review classification models. The classification schemes are those based on text review classification models.

[0075] Retrieval schemes based on pre-trained models can be combined with existing retrieval schemes. For example, the LongFormer pre-trained model, which has stronger generalization ability, can be used as the base model (hereinafter referred to as BaseModel) for semantic information extraction. This model is similar to the BERT semantic model, but it has better semantic expression capabilities and can adapt to longer sentence inputs. The extracted semantic information is then compared with the information stored in the database to calculate similarity, thereby determining the category of the text to be reviewed by identifying the most similar information.

[0076] Both the retrieval scheme and the classification scheme based on the text censorship classification model require implementation using the text censorship classification model. Before training the text censorship classification model, it's advisable to assess whether the available online data meets the training requirements. Insufficient data can lead to underfitting during training; therefore, a conventional retrieval scheme, such as the BaseModel-based scheme described above, can be used initially. Once a sufficient amount of data is available, such as 100 texts per category and more than 10 categories, training of the classification model can commence.

[0077] Model training refers to the process of fine-tuning the semantic model after acquiring sufficient labeled data. Labeled data mainly refers to the annotations on sentences in the text to be reviewed. For example, the annotation label for the text content "If Party B breaches this agreement, Party B shall compensate Party A for all direct losses caused thereby, unless otherwise stipulated by law," is categorized as a direct loss risk.

[0078] The training of the text review classification model can be implemented based on the aforementioned BaseModel. This mainly includes fine-tuning the parameters of the BaseModel and training the newly added classifier. The goal of model training is to enable the text review classification model to adapt to existing review data and establish a classification task. Finally, both the retrieval and classification schemes need to be applied to the text review process, which involves reviewing each sentence in the text to be reviewed.

[0079] like Figure 2 The diagram illustrates the training structure of a text censorship classification model according to an embodiment of this application. The network structure of the text censorship classification model mainly consists of a base model and a classifier, with the classifier connected after the feature output layer of the base model. The classifier can utilize two fully connected layers (FullyConnection), with a non-linear ReLU layer used for feature processing between the fully connected layers. Following the two fully connected layers is a Softmax layer for classification. The loss function can be SoftmaxLoss, and the number of categories corresponds to the number of censorship comment categories.

[0080] During training, the learning rate of the base model parameters was reduced by 0.01 times for fine-tuning. The classifier was trained with full learning rate parameters and optimized using the Adam optimization algorithm. The initial learning rate was set to 0.001. Training was stopped after 30-40 iterations when the accuracy on the validation set no longer changed. The trained model was then used as the adapted text review classification model, AdapModel.

[0081] Of course, it should be noted that the specific design of the classifier's network structure and the setting of the learning rate can be flexibly set by those skilled in the art based on the actual training effect and training objectives, and no specific limitations are made here.

[0082] In some embodiments of this application, the step of evaluating multiple text review schemes to determine those suitable for online use includes: constructing a full-cycle verification dataset; and using the full-cycle verification dataset to evaluate multiple text review schemes to determine those suitable for online use.

[0083] To ensure the effectiveness of the currently deployed text review scheme, this application embodiment evaluates the review performance of the three schemes—retrieval scheme based on a pre-trained model, retrieval scheme based on a text review classification model, and classification scheme based on a text review classification model—before deploying the current text review scheme. The optimal scheme is then selected for deployment. It should be noted that identifying the optimal text review scheme does not mean that only that scheme can be used; other schemes can still be employed, but the optimal scheme will be prioritized.

[0084] When evaluating multiple text review schemes, this application embodiment adopts the method of constructing a full-cycle validation set for multi-scheme evaluation. The validation set can usually reflect the effect of the model during the model training process. As the amount of available training data continues to increase, the validation set should also change accordingly. The full-cycle validation set proposed in this application embodiment is updated every time the training dataset of the model training changes. Using the full-cycle validation set for validation can more comprehensively and accurately evaluate the review effect of multiple schemes.

[0085] In some embodiments of this application, constructing the full-cycle validation dataset includes: obtaining the original training dataset, the original validation dataset, and newly added training data; updating the original validation dataset using the original training dataset and the newly added training data to obtain the updated validation dataset; and constructing the full-cycle validation dataset based on the original validation dataset and the updated validation dataset.

[0086] When constructing the full-cycle validation set, first keep the size of the validation set constant, such as 1000 samples. Then, update the validation set based on the ratio of the newly added training data to the original training data. For example, if the newly added data accounts for 20% of the original data, randomly discard 20% of the data in the original validation set and use 200 data points from the new data source to supplement the new validation set, ensuring that the size of the validation set remains unchanged. Of course, a maximum discard ratio can also be set, such as 60%, to ensure that the new model's performance is also applicable to the original validation set. Finally, maintain the original validation set and the updated validation set, and use these two validation sets as the full-cycle validation set for this model training.

[0087] It should be noted that the specific proportions and other parameters involved in the above process can be flexibly set by those skilled in the art according to actual needs, and are not specifically limited here.

[0088] In some embodiments of this application, evaluating multiple text moderation schemes using the full-cycle verification dataset to determine a usable text moderation scheme includes: extracting features from the data in the full-cycle verification dataset and the training dataset using the pre-trained model; performing retrieval matching based on the first feature extraction result of the full-cycle verification dataset and the first feature extraction result of the training dataset to obtain a first classification result for the full-cycle verification dataset; extracting features from the data in the full-cycle verification dataset and the training dataset using the text moderation classification model; performing retrieval matching based on the second feature extraction result of the full-cycle verification dataset and the second feature extraction result of the training dataset to obtain a second classification result for the full-cycle verification dataset; classifying the data in the full-cycle verification dataset using the text moderation classification model to obtain a third classification result for the full-cycle verification dataset; and determining a usable text moderation scheme based on the first, second, and third classification results of the full-cycle verification dataset.

[0089] like Figure 3 The diagram illustrates a multi-scheme evaluation process in an embodiment of this application. The first scheme is a retrieval scheme using BaseModel. BaseModel is used to extract features from the full-cycle validation set and training set. Each feature from the validation set is used as a query condition to retrieve data from the training set. The top K results are taken, and the category of the validation data is determined based on the corresponding training set label distribution of these K results.

[0090] The second approach is to use a text review classification model for retrieval. Similar to the first approach, the difference is that a new model, AdapModel, is used instead of BaseModel for feature extraction.

[0091] The third approach is to use a text review classification model to classify each piece of data in the entire validation set using AdapModel, thereby obtaining the predicted label for the validation set.

[0092] After obtaining the validation set results based on these three methods, the method with the best overall performance among the three methods is selected for deployment.

[0093] In some embodiments of this application, the text review method further includes: determining whether to trigger an update strategy for the text review classification model, the update strategy including at least one of a periodic update strategy and a transactional update strategy; and updating the text review classification model if the update strategy for the text review classification model is triggered.

[0094] Since online data is constantly changing, the model also needs to be changed to adapt to the changes in online data. This application proposes two model update triggering strategies: periodic update and transactional update.

[0095] Periodic updates refer to updating the model within a certain time period, using the latest data to adaptively fine-tune the model. Since online data accumulation requires a certain time period, a period length can be set, such as approximately one month, for each update. When the specified time period is reached, this embodiment of the application also determines whether the amount of new data in that period meets the standard. An update will only be performed if the amount of new data reaches a certain proportion of the existing training set; otherwise, periodic updates will not be performed. This ensures the real-time performance and effectiveness of the model.

[0096] Transactional updates refer to updates performed outside of periodic updates, but when specific transactions occur. For example, if the number of review categories increases, the model may not be able to adapt to the new categories, requiring model training. Of course, when a new category is added, the new model is not immediately trained; a period of data accumulation for the new category is needed. During this period, the online model's review method can be switched from a classification model to a retrieval model to ensure adaptability to new category data. This is because classification models can only provide results for existing categories, while retrieval models can provide similarity, judging the similarity between the current object to be reviewed and existing results, thus having greater generalization ability.

[0097] The model's adaptability to online data is ensured through periodic and transactional updates, making it a customized model specifically designed for online data.

[0098] In some embodiments of this application, the currently used text review scheme is a retrieval scheme implemented based on a pre-trained model or a text review classification model. The step of optimizing the initial text review result according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result includes: obtaining multiple retrieval results with a similarity higher than a preset threshold from the retrieval results obtained using the retrieval scheme implemented based on a pre-trained model or a text review classification model; statistically analyzing the text review categories corresponding to the multiple retrieval results with a similarity higher than the preset threshold; and determining the final text review result based on the statistical results.

[0099] After the offline model training and evaluation steps described in the aforementioned embodiments, the model to be used online can be determined. Online text review refers to the process of parsing and reviewing documents to be reviewed, and its review scheme is divided into retrieval scheme and classification scheme.

[0100] The retrieval scheme is similar to the conventional retrieval process. The document to be reviewed is segmented into sentences, semantic features are extracted sentence by sentence, and a search is performed in a specified online database based on these semantic features. The most similar result is selected as the matching result, and the review category corresponding to the most similar data in the database is taken as the review result of the text sentence to be reviewed.

[0101] However, in actual search results, hitting the first result may not be the correct one. Therefore, this application proposes a similarity voting strategy as a re-optimization strategy for search results. Specifically, it extracts the top K results (e.g., K=10) with similarity above a threshold, statistically analyzes the categories of these K results, and selects the result with the highest number of category counts as the accurate result of this search. This similarity voting strategy utilizes the idea that the collective is superior to the individual, making it more robust to search accuracy.

[0102] In some embodiments of this application, the currently used text review scheme is a classification scheme implemented based on a text review classification model. The step of optimizing the initial text review result according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result includes: determining whether the category probability corresponding to the text review result obtained by the classification scheme implemented based on the text review classification model is less than a preset probability threshold; if the category probability is less than the preset probability threshold, obtaining the retrieval result obtained by the retrieval scheme implemented based on a pre-trained model and the text review classification model; and fusing the text classification result output by the text review classification model and the retrieval result obtained by the retrieval scheme implemented based on the pre-trained model and the text review classification model to determine the final text review result.

[0103] For classification schemes based on classification models, the text sentence to be reviewed is directly fed into the classification model to obtain a specific category. However, in practice, inaccurate classification can occur. After analyzing the reasons, it was found that many erroneous samples had very uniform classification results, meaning that the model's classification layer was unsure which category these samples should be assigned to. To address this issue, this application proposes a multi-model result fusion scheme to solve the problem of uniform classification results, i.e., classification uncertainty.

[0104] like Figure 4The diagram illustrates a text review process for multi-scheme result fusion in an embodiment of this application. In this embodiment, uniformity of classification results is defined as whether the maximum probability output by the model's classification layer is lower than a certain threshold, such as 0.5. When the maximum probability is higher than the threshold, the classification layer is considered to have high confidence in the sample, and the classification result can be directly used as the final result. If the maximum probability is lower than the threshold, the model's classification layer is considered unable to determine the category of the sample, and therefore the multi-scheme result fusion strategy of this embodiment will be used.

[0105] The BaseModel and AdapModel retrieval results are obtained using the retrieval scheme described above. The AdapModel classification result is the classification result of the currently used model. The fusion of these three results is achieved using the following method:

[0106] The TopK1 result from the BaseModel retrieval results, the TopK2 result from the AdapModel retrieval results, and the TopK3 result from the AdapModel classification results are used to form a new set {TopK1, TopK2, TopK3}. This new set is statistically analyzed, and the category with the highest frequency is taken as the final result. This method also uses the idea that the collective is better than the individual, which ensures the robustness of the results.

[0107] This concludes the description of two major categories of solutions applicable to online text review, both representing novel approaches to addressing practical problems. Whether dealing with inaccurate first-order predictions or uniform classification model results, this application provides robust solutions that effectively improve the accuracy of text review.

[0108] For ease of understanding of the above embodiments of this application, as follows: Figure 5 The diagram illustrates the overall process of text review in an embodiment of this application. First, before training the text review classification model, the available online data volume is used to determine if the training requirements are met. If the data volume is insufficient, a conventional retrieval method is used for text review. If the data volume is sufficient, the text review classification model is trained offline using this data. Then, a full-cycle validation set is used to comprehensively evaluate the effectiveness of multiple text review methods, thereby selecting the optimal method for deployment. Since the online dataset is dynamic, a certain update strategy can be adopted to update the text review classification model and continuously optimize it.

[0109] After the text review scheme is launched, the optimal text review scheme used online is used for text review. Considering that the retrieval scheme and classification scheme may have inaccurate review results during application, corresponding review result optimization strategies can be adopted to optimize the scheme and obtain the final text review result.

[0110] In summary, the main improvements of this application are as follows:

[0111] The main improvements and technical effects of this application compared to the prior art mainly include:

[0112] 1) Most existing text review schemes use retrieval schemes or classification model schemes, and the complementarity between the two schemes has not been explored. However, this application adaptively integrates the two schemes into the same new text review framework, combines retrieval and classification models, explores the complementarity between the two schemes, and improves the effectiveness of text review.

[0113] 2) In the online text review process, the retrieval scheme has the problem of inaccurate first-order prediction. This application designs a similarity voting solution. The classification model scheme has the problem of fuzzy prediction (uniform classification). This application also designs a multi-model fusion scheme that combines retrieval. Both of the above schemes solve the problem of inaccurate text review results.

[0114] 3) During offline training, there are problems such as imperfect model evaluation, unrepresentative validation set, and unadaptability of the model. This application solves the problem of inaccurate evaluation by establishing a three-model structure, strengthens the consistency between the validation set and online data by constructing a full-cycle validation set, and improves the adaptability of the model by using periodic update and transaction update strategies.

[0115] This application also provides a text review device 600, such as... Figure 6 The diagram shows a structural schematic of a text review device according to an embodiment of this application. The text review device 600 includes: a first acquisition unit 610, a review unit 620, and an optimization unit 630, wherein:

[0116] The first acquisition unit 610 is used to acquire the text to be reviewed;

[0117] The review unit 620 is used to review the text to be reviewed using the currently used text review scheme to obtain an initial text review result. The currently used text review scheme is determined after evaluating multiple text review schemes, including a retrieval scheme and a classification scheme.

[0118] The optimization unit 630 is used to optimize the initial text review result according to the review optimization strategy corresponding to the currently used text review scheme, so as to obtain the final text review result.

[0119] In some embodiments of this application, the multiple text review schemes include a retrieval scheme based on a pre-trained model, a retrieval scheme based on a text review classification model, and a classification scheme based on a text review classification model. The text review device 600 further includes: a second acquisition unit for acquiring a training dataset of the text review classification model; a training unit for training the text review classification model using the training dataset when the amount of data in the training dataset is greater than a preset data amount threshold; a generation unit for generating a retrieval scheme based on the trained text review classification model and a classification scheme based on the text review classification model; and an evaluation unit for evaluating the multiple text review schemes and determining the text review schemes that can be used online.

[0120] In some embodiments of this application, the evaluation unit is specifically used to: construct a full-cycle verification dataset; evaluate multiple text review schemes using the full-cycle verification dataset, and determine text review schemes that can be deployed online.

[0121] In some embodiments of this application, the evaluation unit is specifically used to: acquire the original training dataset, the original validation dataset, and newly added training data; update the original validation dataset using the original training dataset and the newly added training data to obtain the updated validation dataset; and construct the full-cycle validation dataset based on the original validation dataset and the updated validation dataset.

[0122] In some embodiments of this application, the evaluation unit is specifically used for: extracting features from the data in the full-cycle verification dataset and the training dataset using the pre-trained model; performing retrieval matching based on the first feature extraction result of the full-cycle verification dataset and the first feature extraction result of the training dataset to obtain a first classification result of the full-cycle verification dataset; extracting features from the data in the full-cycle verification dataset and the training dataset using the text censorship classification model; performing retrieval matching based on the second feature extraction result of the full-cycle verification dataset and the second feature extraction result of the training dataset to obtain a second classification result of the full-cycle verification dataset; classifying the data in the full-cycle verification dataset using the text censorship classification model to obtain a third classification result of the full-cycle verification dataset; and determining a text censorship scheme that can be deployed online based on the first classification result, the second classification result, and the third classification result of the full-cycle verification dataset.

[0123] In some embodiments of this application, the text review device 600 further includes: a determining unit, configured to determine whether to trigger an update strategy for the text review classification model, the update strategy including at least one of a periodic update strategy and a transactional update strategy; and an updating unit, configured to update the text review classification model if the update strategy for the text review classification model is triggered.

[0124] In some embodiments of this application, the currently used text review scheme is a retrieval scheme implemented based on a pre-trained model or a text review classification model. The optimization unit 630 is specifically used to: obtain multiple retrieval results with a similarity higher than a preset threshold from the retrieval results obtained using the retrieval scheme implemented based on a pre-trained model or a text review classification model; perform statistics on the text review categories corresponding to the multiple retrieval results with a similarity higher than the preset threshold; and determine the final text review result based on the statistical results.

[0125] In some embodiments of this application, the currently used text review scheme is a classification scheme implemented based on a text review classification model. The optimization unit 630 is specifically used to: determine whether the category probability corresponding to the text review result obtained by the classification scheme implemented based on the text review classification model is less than a preset probability threshold; if the category probability is less than the preset probability threshold, obtain the retrieval result obtained by the retrieval scheme implemented based on the pre-trained model and the text review classification model; and fuse the text classification result output by the text review classification model and the retrieval result obtained by the retrieval scheme implemented based on the pre-trained model and the text review classification model to determine the final text review result.

[0126] It is understood that the above-mentioned text review device can implement each step of the text review method provided in the foregoing embodiments. The relevant explanations of the text review method are applicable to the text review device and will not be repeated here.

[0127] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 7 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.

[0128] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0129] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0130] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a text review device at the logical level. The processor executes the program stored in memory and specifically performs the following operations:

[0131] Obtain the text to be reviewed;

[0132] The text to be reviewed is reviewed using the currently used text review scheme to obtain an initial text review result. The currently used text review scheme is determined after evaluating multiple text review schemes, including a retrieval scheme and a classification scheme.

[0133] The initial text review result is optimized according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result.

[0134] The above is as stated in this application. Figure 1The text review device method disclosed in the illustrated embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0135] This application also proposes a computer program product, including a computer program or instructions, which, when executed by a processor, implements any of the aforementioned text review methods and is specifically used to perform:

[0136] Obtain the text to be reviewed;

[0137] The text to be reviewed is reviewed using the currently used text review scheme to obtain an initial text review result. The currently used text review scheme is determined after evaluating multiple text review schemes, including a retrieval scheme and a classification scheme.

[0138] The initial text review result is optimized according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result.

[0139] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0140] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0141] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0142] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0143] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0144] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0145] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0146] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0147] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0148] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application.

Claims

1. A text review method, characterized in that, The text review method includes: Obtain the text to be reviewed; The text to be reviewed is reviewed using the currently used text review scheme to obtain an initial text review result. The currently used text review scheme is determined after evaluating multiple text review schemes, including a retrieval scheme and a classification scheme. The initial text review result is optimized according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result; The multiple text review schemes include a retrieval scheme based on a pre-trained model, a retrieval scheme based on a text review classification model, and a classification scheme based on a text review classification model. The text review method further includes: Obtain the training dataset for the text censorship classification model; If the amount of data in the training dataset exceeds a preset data volume threshold, the text review classification model is trained using the training dataset. Generate a retrieval scheme and a classification scheme based on the trained text censorship classification model. The various text review schemes were evaluated to determine which ones were suitable for deployment. The text censorship classification model is trained based on the pre-trained model. The text review method further includes: determining whether to trigger an update strategy for the text review classification model, wherein the update strategy includes at least one of a periodic update strategy and a transactional update strategy; and updating the text review classification model if the update strategy for the text review classification model is triggered. The currently used text review scheme is a classification scheme implemented based on a text review classification model. The optimization of the initial text review result according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result includes: determining whether the category probability corresponding to the text review result obtained by the classification scheme implemented based on the text review classification model is less than a preset probability threshold; if the category probability is less than the preset probability threshold, obtaining the retrieval result obtained by the retrieval scheme implemented based on a pre-trained model and the text review classification model; and fusing the text classification result output by the text review classification model and the retrieval result obtained by the retrieval scheme implemented based on the pre-trained model and the text review classification model to determine the final text review result.

2. The text review method according to claim 1, characterized in that, The evaluation of multiple text review schemes to determine which text review schemes are suitable for deployment includes: Construct a full-cycle validation dataset; The full-cycle verification dataset is used to evaluate multiple text review schemes to determine those that can be deployed online.

3. The text review method according to claim 2, characterized in that, The construction of the full-cycle validation dataset includes: Obtain the original training dataset, the original validation dataset, and the newly added training data; The original validation dataset is updated using the original training dataset and the newly added training data to obtain the updated validation dataset. The full-cycle validation dataset is constructed based on the original validation dataset and the updated validation dataset.

4. The text review method according to claim 2, characterized in that, The step of evaluating multiple text moderation schemes using the full-cycle verification dataset to determine the text moderation schemes that can be deployed online includes: The pre-trained model is used to extract features from the data in the full-cycle validation dataset and the training dataset. Based on the first feature extraction results of the full-cycle validation dataset and the first feature extraction results of the training dataset, a retrieval and matching are performed to obtain the first classification result of the full-cycle validation dataset. The text review classification model is used to extract features from the full-cycle verification dataset and the training dataset. Based on the second feature extraction results of the full-cycle verification dataset and the second feature extraction results of the training dataset, a retrieval and matching are performed to obtain the second classification result of the full-cycle verification dataset. The text review classification model is used to classify the data in the full-cycle verification dataset to obtain the third classification result of the full-cycle verification dataset; Based on the first, second, and third classification results of the full-cycle verification dataset, a text review scheme that can be deployed online is determined.

5. The text review method according to claim 1, characterized in that, The currently used text review scheme is a retrieval scheme implemented based on a pre-trained model or a text review classification model. The optimization of the initial text review result according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result includes: Among the search results obtained using a search scheme based on a pre-trained model or a text review classification model, multiple search results with similarity values ​​exceeding a preset threshold are obtained. Statistical analysis is performed on the text review categories corresponding to multiple search results that exceed a preset similarity threshold; The final text review results will be determined based on the statistical findings.

6. A text review device, characterized in that, The text review device includes: The first acquisition unit is used to acquire the text to be reviewed; The review unit is used to review the text to be reviewed using the currently used text review scheme to obtain an initial text review result. The currently used text review scheme is determined after evaluating multiple text review schemes, including a retrieval scheme and a classification scheme. An optimization unit is used to optimize the initial text review result according to the review optimization strategy corresponding to the currently used text review scheme, so as to obtain the final text review result. The multiple text review schemes include a retrieval scheme based on a pre-trained model, a retrieval scheme based on a text review classification model, and a classification scheme based on a text review classification model. The text review device further includes: The second acquisition unit is used to acquire the training dataset of the text review classification model; A training unit is used to train a text review classification model using the training dataset when the amount of data in the training dataset is greater than a preset data amount threshold. The generation unit is used to generate a retrieval scheme based on the trained text censorship classification model and a classification scheme based on the text censorship classification model. An evaluation unit is used to evaluate multiple text review schemes and determine the text review schemes that can be deployed online. The text censorship classification model is trained based on the pre-trained model. The text review device is used to determine whether to trigger the update strategy of the text review classification model, the update strategy including at least one of periodic update strategy and transactional update strategy; if the update strategy of the text review classification model is triggered, the text review classification model is updated. The currently used text review scheme is a classification scheme implemented based on a text review classification model. The optimization of the initial text review result according to the review optimization strategy corresponding to the currently used text review scheme to obtain the final text review result includes: determining whether the category probability corresponding to the text review result obtained by the classification scheme implemented based on the text review classification model is less than a preset probability threshold; if the category probability is less than the preset probability threshold, obtaining the retrieval result obtained by the retrieval scheme implemented based on a pre-trained model and the text review classification model; and fusing the text classification result output by the text review classification model and the retrieval result obtained by the retrieval scheme implemented based on the pre-trained model and the text review classification model to determine the final text review result.

7. An electronic device, comprising: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform any of the text review methods described in claims 1 to 5.

8. A computer program product comprising a computer program or instructions that, when executed by a processor, implement the text review method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Contract term risk examination method and device

    CN110163478A

  • Text review method and device, electronic equipment and computer storage medium

    CN111046142A

  • Fair competition review auxiliary method based on text classification model

    CN114860882A

  • Sequence retrieval and classification method based on domain rule knowledge and data

    CN118520112A

  • Systems and methods for continuous active machine learning with document review quality monitoring

    US10354203B1