Public text auditing method and device, storage medium and electronic equipment
By analyzing the word segmentation feature sequence and self-attention mechanism of the text to be reviewed, the semantic differences in different contexts are identified, the accuracy problem of the text matching model in different contexts is solved, and efficient text review and user experience optimization are achieved.
Patent Information
- Application Number
- CN202410370313.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2025-09-26
AI Technical Summary
Existing text matching models have difficulty identifying the different meanings of the same word or sentence in different contexts, resulting in inaccurate text review results, requiring manual review and reducing efficiency.
By extracting the word segmentation feature sequence of the text to be reviewed, using the self-attention mechanism to obtain the word segmentation correlation, updating the semantic features, combining the trained text recognition model to identify sentences that meet the preset emotional conditions, and using the matching algorithm to perform text review.
It improves the accuracy and efficiency of text review, optimizes the user's viewing experience, reduces manual intervention, and improves the review quality of content on online platforms.
Smart Images

Figure CN120706405A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device, storage medium and electronic device for reviewing public texts. Background Art
[0002] With the rapid development of artificial intelligence technology, methods based on artificial intelligence technology to achieve text review have emerged.
[0003] Under related technologies, a text matching model constructed using artificial intelligence technology is usually used to perform character matching on the text to be reviewed to obtain the text review results.
[0004] However, the same word or phrase can represent different meanings in different contexts. The above text matching model is difficult to verify the different meanings represented by the same word or phrase when it is in different text positions in the text to be reviewed through character matching, which leads to inaccurate final text review results.
[0005] For example, taking the polysemous word "AB", for "AB website", "AB" is a blocked word that does not meet the review conditions, while for "AB font", "AB" is a normal word that meets the review conditions; when the above method is used to review "AB website" and "AB font", by matching the characters of "AB", it can only be reviewed that "AB" is a blocked word (or normal word) in both "AB website" and "AB font", resulting in inaccurate text review results.
[0006] In view of this, a new text review method needs to be provided to overcome the above defects. Summary of the Invention
[0007] The present application provides a method, device, storage medium and electronic device for public text review, which are used to solve the problem that related technologies have difficulty in identifying the different meanings of the same word in different contexts, improve the accuracy and efficiency of text review, and thus optimize the user's viewing experience of public texts on network platforms.
[0008] In a first aspect, the present application provides a method for reviewing public texts, comprising:
[0009] Extracting a segmentation feature sequence of each of N clauses in the text to be reviewed, where N>0, and the segmentation feature sequence includes: semantic features of each segmentation contained in the corresponding clause;
[0010] Based on the self-attention mechanism, in each word segmentation feature sequence, the feature correlation between each word and at least one adjacent word is obtained, and the word segmentation weight generated based on the at least one feature correlation corresponding to each word is used to update the semantic features of the corresponding word, thereby obtaining the updated feature sequences of the N clauses.
[0011] Using the trained text recognition model, semantic feature recognition is performed on each of the N updated feature sequences to obtain corresponding semantic recognition results, and sentences corresponding to the recognition results that meet the preset emotion recognition conditions are selected from the N obtained recognition results as sentences to be reviewed;
[0012] With reference to the preset shielded text, a preset matching algorithm is used to perform text review on the sentence to be reviewed, obtain a text review result of the text to be reviewed, and shield the text to be reviewed or prompt the user.
[0013] Optionally, the text review result at least includes: an inclusion relationship between the text to be reviewed and the shielded text;
[0014] Then, the step of shielding or prompting the user of the text to be reviewed includes:
[0015] Determining, from the text review result, a sentence to be shielded that contains the shielded text, and shielding the sentence to be shielded;
[0016] or,
[0017] From the text review result, the to-be-screened sentence containing the screened text is determined, and prompt information of the to-be-screened text is generated according to the prompt information corresponding to the screened text for prompting the user.
[0018] In a second aspect, the present application provides a public text review device, comprising:
[0019] An extraction unit extracts a segmentation feature sequence of each of N sentences in the text to be reviewed, wherein N>0, and the segmentation feature sequence includes: semantic features of each segmentation contained in the corresponding sentence;
[0020] An updating unit, based on a self-attention mechanism, obtains, in each segmentation feature sequence, a feature correlation between each segmentation and at least one adjacent segmentation, and updates the semantic features of the corresponding segmentation using a segmentation weight generated based on at least one feature correlation corresponding to each segmentation, thereby obtaining updated feature sequences for each of the N clauses;
[0021] The recognition unit performs semantic feature recognition on the N updated feature sequences using a trained text recognition model to obtain corresponding semantic recognition results, and selects, from the N obtained recognition results, sentences corresponding to the recognition results that meet preset emotion recognition conditions as sentences to be reviewed;
[0022] The review unit refers to the preset shielded text and adopts a preset matching algorithm to perform text review on the sentence to be reviewed, obtains the text review result of the text to be reviewed, and shields the text to be reviewed or prompts the user.
[0023] In a third aspect, the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any one of the methods for reviewing public texts described in the first aspect is implemented.
[0024] In a fourth aspect, the present application provides a computer storage medium, wherein the computer-readable storage medium stores computer program instructions, and the computer program instructions are executed by a processor to implement any one of the text review methods described in the first aspect.
[0025] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising computer program instructions, which, when executed by a processor, implement any one of the public text review methods in the first aspect.
[0026] The beneficial effects of this application are as follows:
[0027] In an embodiment of the present application, a method for reviewing public texts is provided, involving artificial intelligence technology. In this method, the different semantics of the same words in different contexts are analyzed to identify content that may contain preset blocked texts, thereby improving the accuracy and efficiency of text review and optimizing the user's viewing experience of the public text to be reviewed.
[0028] Specifically, the execution device first extracts the segmentation feature sequences of N (N>0) sentences from the text to be reviewed, such as that published on a network platform. Each segmentation feature sequence includes: the semantic features of each segmentation in the corresponding sentence. Then, based on the self-attention mechanism, in each segmentation feature sequence, the feature correlation between each segmentation and at least one adjacent segmentation is obtained to explore the correlation relationship between different segmentations in the same sentence.
[0029] Subsequently, the word segmentation weights generated based on at least one feature correlation corresponding to each word segmentation are used to update the semantic features of the corresponding word segmentation, and the updated feature sequences of each of the N sentences are obtained. Then, the N updated feature sequences are subjected to semantic feature recognition through the trained text recognition model to obtain the corresponding semantic recognition results. Among the N recognition results obtained, the sentences corresponding to the recognition results that meet the preset emotion recognition conditions are used as the sentences to be reviewed, so as to realize the recognition of the emotional colors of different word segmentations in the same sentence, solve the problem that related technologies are difficult to recognize the different meanings of the same word in different contexts, and improve the accuracy and efficiency of subsequent text review.
[0030] Finally, referring to the preset shielded text, the preset matching algorithm is used to perform text review on the sentence to be reviewed, and the text review result of the text to be reviewed is obtained, and the text to be reviewed is blocked or the user is prompted. In this way, text review is performed on the identified sentence to be reviewed, and the text review result is used to block or prompt the user for the text to be reviewed, which can optimize the user's viewing experience of the text to be reviewed.
[0031] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present application. The purposes and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0033] Figure 1 A schematic diagram of possible application scenarios in the embodiments of the present application;
[0034] Figure 2 A flowchart of a method for reviewing public texts provided in an embodiment of the present application;
[0035] Figure 3 Schematic diagram of a possible process for obtaining a first word vector in an embodiment of the present application;
[0036] Figure 4 Schematic diagram of the process of obtaining a possible second word vector in an embodiment of the present application;
[0037] Figure 5 Schematic diagram of the process of obtaining possible semantic features in an embodiment of the present application;
[0038] Figure 6 A logical diagram of possible model fine-tuning in an embodiment of the present application;
[0039] Figure 7 A logical diagram of a possible method for implementing a public text review method in an embodiment of the present application;
[0040] Figure 8 A schematic diagram of the structure of a public text review device provided in an embodiment of the present application;
[0041] Figure 9 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0043] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0044] In the embodiments of the present application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0045] This application relates to the field of artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, as a comprehensive technology that combines theories such as mathematics, computer science, and psychology, it can be understood that it is an attempt to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. In short, artificial intelligence can study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.
[0046] Specifically, artificial intelligence (AI) technology is an interdisciplinary discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, pre-trained model technologies, operating / interaction systems, and mechatronics. Pre-trained models, also known as large models or basic models, can be fine-tuned and widely applied to downstream tasks across various AI disciplines. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning. They aim to enable machines to perform complex tasks that typically require human intelligence, such as learning, reasoning, perception, and interaction.
[0047] The embodiments of this application mainly involve natural language processing technology, machine learning and pre-training models in the field of artificial intelligence technology.
[0048] Natural language processing (NLP) is an important field in the fields of computer science and artificial intelligence. It studies various theories and methods that enable effective communication between humans and computers using natural language. Natural language processing involves natural language, that is, the language people use in daily life, and is closely related to linguistic research; it also involves computer science and mathematics. As an important technology for model training in the field of artificial intelligence, natural language processing has evolved into pre-trained models such as large language models (LLMs). After fine-tuning, large language models can be widely used in downstream tasks. Natural language processing technologies generally include text processing, semantic understanding, machine translation, robot question answering, knowledge graphs, and other technologies.
[0049] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning. Pretrained models, as the latest development in deep learning, integrate these techniques.
[0050] A pre-trained model (PTM), also known as a cornerstone model or large model, refers to a deep neural network (DNN) with large parameters. It is trained on massive amounts of unlabeled data. Leveraging the function approximation capabilities of large-parameter DNNs, the PTM extracts common features from the data. Through techniques such as fine tuning, efficient parameter fine tuning (PEFT), and prompt tuning, the PTM is then adapted for downstream tasks. Therefore, pre-trained models can achieve ideal results in few-shot or zero-shot scenarios. Based on the data modality processed, PTMs can be categorized into language models (e.g., ELMO, BERT, GPT), vision models (e.g., Swin-Transformer, ViT, V-MOE), speech models (e.g., VALL-E), and multimodal models (e.g., ViBERT, CLIP, FlaCingo, Gato). Multimodal models are those that represent features from two or more data modalities. Pre-trained models are important tools for outputting artificial intelligence generated content (AIGC) and can also serve as a universal interface for connecting multiple specific task models.
[0051] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, drones, digital twins, virtual humans, robots, artificial intelligence-generated content, conversational interaction, smart medical care, smart customer service, game AI, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0052] The embodiments of the present application involve the various artificial intelligence technologies mentioned above, and in particular, relate to a method for reviewing public texts. For details, please refer to the relevant descriptions in the following implementation methods.
[0053] The following introduces the design concept of the embodiment of this application.
[0054] The existing text review method usually builds a text matching model and obtains the corresponding text review results based on character matching.
[0055] However, the same phrase can represent different meanings in different contexts. Text matching models, relying solely on character matching, struggle to identify the varying meanings of the same phrase at different locations within the text being reviewed, leading to inaccurate text review results. Consequently, these approaches often require manual review, significantly reducing the efficiency of text review.
[0056] In view of this, an embodiment of the present application provides a method for public text review, in which artificial intelligence technology is involved. By analyzing the different semantics of the same words in different contexts, content that may contain preset blocked text is identified, thereby improving the accuracy and efficiency of text review and optimizing the user's viewing experience.
[0057] Specifically, the execution device first extracts the word feature sequences of N (N>0) sentences from the text to be reviewed, such as the text published on the network platform. Each word feature sequence includes: the semantic features of each word in the corresponding sentence. Then, based on the self-attention mechanism, in each word feature sequence, the feature correlation between each word and at least one adjacent word is obtained to explore the correlation relationship between different word segments in the same sentence. Subsequently, the word weights generated based on at least one feature correlation corresponding to each word are used to update the semantic features of the corresponding word, and the updated feature sequences of the N sentences are obtained. Then, the semantic feature recognition of the N updated feature sequences is performed on each of the N updated feature sequences through the trained text recognition model to obtain the corresponding semantic recognition results. From the N recognition results obtained, the sentences corresponding to the recognition results that meet the preset emotion recognition conditions are used as the sentences to be reviewed, thereby realizing the recognition of the emotional color of different word segments in the same sentence. Finally, referring to the preset shielded text, the preset matching algorithm is used to perform text review on the sentence to be reviewed, and the text review result of the text to be reviewed is obtained. The text to be reviewed is blocked or the user is prompted. This solves the problem that related technologies are difficult to identify the different meanings of the same word in different contexts, improves the accuracy and efficiency of text review, and at the same time improves the user's viewing experience of the text to be reviewed.
[0058] The text review method provided in the embodiments of this application can be applied to various content review tasks, assisting in detecting content that does not meet business requirements in texts published on online platforms. Taking the review of prohibited content as an example, this solution can be applied to detecting potentially offensive content such as illegal and irregular content, advertisements, and personal attacks, thereby preventing the spread of harmful information and ensuring that the public content on various online platforms meets user viewing needs.
[0059] The following describes possible application scenarios to which the technical solutions of the embodiments of the present application can be applied. The implementation process of the solutions in other applicable application scenarios can be similarly obtained. Those skilled in the art will appreciate that, during specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to the needs of the actual application scenario.
[0060] See Figure 1 As shown, it is an interaction diagram of a possible application scenario provided by an embodiment of the present application. In this scenario, a terminal device 110 and a server 120 may be included.
[0061] The terminal device 110 may be, for example, a mobile phone, a smart phone, a tablet computer (PAD), a laptop computer, a desktop computer, a game console, a smart watch, a smart TV, a smart car device, a smart wearable device, an input device, an output device, etc. The terminal device 110 may be installed with or connected to a content review platform with a text review function. The visual presentation form of the content review platform involved in the embodiment of the present application may be a web page, software, mini-program, or other application. Accordingly, the operating platform it carries may be a browser, a software client, a mini-program client, etc.
[0062] The server 120 can be a background server corresponding to the content review platform installed or connected to the terminal device 110, such as: the server 120 is a background server corresponding to a web page, software, applet, etc., and the specific type of the background server is not limited here. Specifically, the aforementioned background server can have the background functions of the text review platform to implement the steps of the text review method provided in the embodiment of the present application, such as: the background server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, i.e., content delivery networks (CDN), as well as basic cloud computing services such as big data and artificial intelligence platforms, etc. The specific type of the background server is not limited here.
[0063] like Figure 1As shown, the text audit method provided in the embodiment of the present application can be executed by the terminal device 110 or the server 120, or can be executed in combination with the terminal device 110 and the server 120. The terminal device 110 or the server 120 may include one or more processors, memories, and an I / O interface for interacting with the terminal. In addition, the terminal device 110 or the server 120 may also be configured with a database, or interact with the server 120 configured with a database, and the database may be used to store preset shielded texts, preset matching algorithms, trained text recognition models, etc. Among them, the program instructions of the text audit method provided in the embodiment of the present application may also be stored in the memory of the terminal device 110 or the server 120, and these program instructions, when executed by the processor, can be used to implement the steps of the text audit method provided in the embodiment of the present application, so as to improve the accuracy and efficiency of the text audit, realize shielding or prompting the user of the text to be audited, and optimize the user's viewing experience.
[0064] Specifically, the solution provided in the embodiments of the present application can also be applied to various network platform scenarios such as e-commerce platforms, social platforms, video platforms, and game platforms.
[0065] For example, e-commerce platforms contain a large number of user comments with diverse content, which can easily contain offensive content such as personal attacks and advertisements. This text review method can cover various text content types, detect user content, block or prompt users for inappropriate content in comments, and reduce manual review costs.
[0066] Taking social platforms as an example, this solution's text review method can be widely applied to forums (Bulletin Board Systems, BBSs), blogs, and various websites with user-generated content (UGC), including posting, replying, and internal messaging, to detect inappropriate content. This text review method automatically triggers incremental content, providing millisecond-level response times and effectively protecting the user's browsing experience.
[0067] For example, during live video broadcasts, there are numerous user comments and barrages. Existing methods rely on manual review and annotation to remove offending content, resulting in long review cycles and low efficiency. However, the text review method in this solution can accurately detect offensive, unsafe, or inappropriate content, quickly locate it, and automatically prompt users to take standardized action such as blocking it. Alternatively, with user authorization, such content can be blocked, effectively improving review efficiency and ensuring platform security.
[0068] For example, in gaming platforms, highly open information disclosure platforms, such as world chat channels, host a vast amount of user-generated information. This text moderation method can automatically review user-generated content, preventing personal attacks and shady advertising, which can drown out signals from ordinary users and purify the gaming environment.
[0069] It is worth emphasizing that during the implementation of the public text review of the online platform provided by this plan, if it involves the collection, storage, use, processing, transmission, provision and disclosure of user personal information, it shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.
[0070] like Figure 1 As shown, in the embodiment of the present application, the terminal device 110 and the server 120 can be directly or indirectly connected to each other through one or more networks 130. The network 130 can be a wired network or a wireless network, for example, a mobile cellular network or a Wireless Fidelity (WIFI) network. Of course, other possible networks are also possible, and the embodiment of the present invention does not limit this.
[0071] It should be noted that, in the embodiment of the present application, the number of terminal devices 110 can be one or more, and similarly, the number of servers 120 can be one or more. Here, the number of terminal devices 110 or servers 120 can be set according to actual application requirements.
[0072] like Figure 1 As shown in the figure, in a possible specific application scenario, the server 120 serves as the background server of the content review platform, and the terminal device 110 serves as the main body for interaction between the content review platform and the user. The user can use the content review platform on the terminal device 110, browse the text review interface presented on the terminal device 110, and trigger the text review instruction for the public text to be reviewed on the application configuration interface through interactive operations such as touch and mouse keys, and view the text review results of the text to be reviewed presented in the application configuration interface.
[0073] In detail, the terminal device 110 responds to the text review instruction triggered by the use object and transmits the text review instruction to the server 120 through the communication network 130. Accordingly, the server 120 receives the instruction to be reviewed and activates the background server of the content review platform to perform text review processing on the text to be reviewed targeted by the instruction to be reviewed. In the process of text review processing performed by the server 120, it involves: extracting the word segmentation feature sequence of each sentence in the text to be reviewed, updating each word segmentation feature sequence to generate a corresponding updated feature sequence, using a trained text review model to identify each updated feature sequence to obtain the sentence to be reviewed, using a preset matching algorithm to perform text review on the sentence to be reviewed to obtain the corresponding text review result, shielding the text to be reviewed with the user's authorization, or prompting the user so that the user can ban the text to be reviewed, and other standardized processing. Furthermore, after the server 120 generates the text review result of the text to be reviewed after processing, the text review result can also be fed back to the user. Specifically, the text review result is fed back to the terminal device 110 for visual display through the communication network 130, so that the user can efficiently view the text review result; the above-mentioned prompting of the user is also processed in the same way and will not be repeated here. Here, the inventor has found through practice that, benefiting from the design of the open text review method of this solution, the above-mentioned text review processing process can achieve better review accuracy and faster processing and response speed in actual application, thereby greatly improving the user experience of the user.
[0074] In one possible application scenario, in order to further reduce the communication delay of public text review, servers 120 can be deployed in various regions, or to achieve load balancing, different servers 120 can serve terminal devices 110 in different regions respectively. For example, the terminal device 110 is located at location a and establishes a communication connection with the server 120 serving location a. The terminal device 110 is located at location b and establishes a communication connection with the server 120 serving location b. Multiple servers 120 form a data sharing system, and data sharing is achieved through blockchain.
[0075] Each server 120 in the data sharing system has a node identifier corresponding to that server 120. Each server 120 in the data sharing system can store the node identifiers of other servers 120 in the data sharing system, so that the generated blocks can be broadcast to other servers 120 in the data sharing system based on the node identifiers of other servers 120. Each server 120 can maintain a node identifier list, storing the server 120 name and node identifier in the node identifier list. The node identifier can be an Internet Protocol (IP) address for interconnecting networks or any other information that can be used to identify the node.
[0076] Of course, the method provided in the embodiment of the present application is not limited to Figure 1 The application scenarios shown can also be used in other possible application scenarios, and the embodiments of this application are not limited thereto. Figure 1 The functions that can be implemented by each device in the application scenario shown will be described in subsequent method embodiments and will not be described in detail here.
[0077] The following describes the method flow provided in each embodiment of the present application in conjunction with the accompanying drawings. Figure 1 The process may be executed by the server 120 or the terminal device 110, or may be executed jointly by the terminal device 110 and the server 120. Here, the process is mainly introduced by taking the execution of the server 120 as an example.
[0078] See Figure 2 The figure shows a flow chart of the method for reviewing public texts provided in an embodiment of the present application.
[0079] Step 201: extracting the word segmentation feature sequences of each of N clauses in the text to be reviewed, wherein N>0, and the word segmentation feature sequences include: semantic features of each word contained in the corresponding clause.
[0080] In the embodiment of the present application, the text to be reviewed is public information that can be identified by the execution device and may contain shielded text that does not meet business needs. The public information can be disclosed on the network platform, on the official account, or on the client, etc. Here, the disclosure on the network platform is mainly used as an example for detailed description. The text to be reviewed can be obtained by the execution device from the audit instruction triggered by the user object, or it can be obtained from the public data of the network platform based on the preset audit instruction by the execution device. Of course, the collection, storage, use, processing, transmission, provision and disclosure of the text to be reviewed are in compliance with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0081] As an implementation method, in order to better identify the different meanings represented by different sentences of the same shielded text in the text to be reviewed, it is first necessary to extract the word segmentation feature sequence of each sentence in the text to be reviewed.
[0082] Specifically, for the text to be reviewed, at least based on the frequency of occurrence of the corresponding segmentation in the historical text set, the initial word vector corresponding to each segmentation in the text to be reviewed is obtained. Then, for each segmentation in the text to be reviewed, the following operations are performed respectively: a first word vector representing the probability of occurrence of the segmentation under C (C>0) adjacent segmentations is obtained, and a second word vector representing the probability of occurrence of C adjacent segmentations under the segmentation is obtained, and based on the specified feature dimension, the obtained first word vector and the second word vector are feature encoded to obtain the semantic features of the segmentation. After obtaining the semantic features of each segmentation, N sentences of the text to be reviewed are extracted, and based on the semantic features of each segmentation in each sentence, the segmentation feature sequences of each of the N sentences are obtained.
[0083] In an optional implementation, the present invention provides a method for obtaining the initial word vector for each word segment. Simply put, the sequence of word segments is treated as a random event and a corresponding probability is assigned to describe the possibility that it belongs to a certain text set, thereby achieving vector processing of the word segmentation.
[0084] Specifically, the frequency of occurrence of each different word segment in the historical text collection is counted in advance, the word segmentations with a higher frequency than the preset frequency are stored, and the word segmentations with a lower frequency than the preset frequency are replaced with specified symbols to improve the accuracy of subsequent text review. Based on this, vectorization is performed for each different word segmentation stored in advance, and the initial word vector of each word segmentation is generated to construct the corresponding dictionary table. In this way, the initial word vector corresponding to each word segmentation can be directly obtained from the preset dictionary table. The initial word vector reflects the usage density of the corresponding word segmentation in the historical text collection, and to a certain extent reflects the importance of the corresponding word segmentation for understanding the semantics of the word segmentation.
[0085] For example, for the generation of the above initial word vector and the construction of the dictionary table; taking "Yao Ming plays basketball very well" as an example, a dictionary table with a dimension of 5 can be constructed based on this sentence: {0 "Yao Ming", 1 "of", 2 "basketball", 3 "play well", 4 "very well"}. When the frequency of "basketball" is 0.75, the initial word vector of the word "basketball" can be represented as [0, 0, 0.75, 0, 0]
[0086] In one possible implementation, the embodiment of the present application provides a method for obtaining the first word vector and the second word vector. Taking a single word in a single sentence as an example, each word in other sentences can be obtained in the same way. The following is divided into two parts to explain them separately.
[0087] The first part is how to obtain the first word vector: based on the association weights between a word and its C adjacent word vectors, the initial word vectors of the C adjacent word vectors are weighted summed to obtain the first word vector of the word vector.
[0088] The C adjacent participles include at least the participles directly connected to the above participle in the corresponding clause, and may further include the participles indirectly connected to the above participle in the corresponding clause; that is, there is a direct connection between the above participle and every two of its C adjacent participles. Of course, the term "adjacent" here mainly describes a direct connection in the same direction. For clauses with multiple directions, this can be set according to actual application needs.
[0089] Specifically, in the embodiment of the present application, a pre-trained word segmentation prediction model can be used to implement the above-mentioned word segmentation for the occurrence probability of C adjacent word segments to obtain the first word vector output by the model. The word segmentation prediction model may include: an input layer, a hidden layer, and an output layer.
[0090] like Figure 3 As shown in the figure, it is a schematic diagram of the process of obtaining the first word vector in the embodiment of the present application. The initial word vectors of each V dimension of C adjacent word segments are used as the input of the input layer, and are multiplied by a first weight matrix W of V×M dimensions. V×N , obtain the corresponding C intermediate word vectors, that is, the corresponding row vectors of the extracted weights. Then, perform weighted averaging on the C intermediate word vectors. The processing dimension can be represented as: [1, V] × [V, N] = [1, N], and obtain the output of the hidden layer Then use the weight matrix h i Multiply by a second weight matrix W' of N×V dimensions respectively N×V , get the output of each node in the output layer Among them, is the second matrix W' N×V Based on this, calculate the output of the output layer and obtain the first word vector of the probability of the word appearing for its C adjacent words
[0091] It should be noted that in the training process of the word segmentation prediction model, the probability of exp (output of the target position) and exp (the sum of the outputs of all positions) can be maximized, that is, max(y j *), where * represents all y i , and then obtain the corresponding loss value by taking the negative calculation, and use the loss value to backpropagate and update the weight matrices in the model. The specific update method can refer to the backpropagation algorithm, which will not be elaborated here.
[0092] Optionally, the word segmentation prediction model can be built based on the framework of various language models, such as ELMO, BERT, GPT, etc. Taking the BERT model as an example, Figure 3The hidden layer shown may include multiple consecutive Transformer encoding modules, and then the word segmentation is encoded by each of the multiple Transformer encoding modules to generate the corresponding first word vector.
[0093] For example, clause 1 is "The cat is on the mat" and clause 2 is "The dog is in the fog". Clause 1 and clause 2 are input into the BERT model respectively. The common participle "the" of the two clauses can obtain different first word vector representations after passing through the BERT model. For example, the first word vector representation of "the" in clause 1 is: [0.2, -0.3, 0.1, ..., 0.4], while the first word vector representation of "the" in clause 2 is: [0.1, -0.2, 0.2, ..., 0.3].
[0094] In short, the first word vector of a segmentation represents the probability of the segmentation appearing in C adjacent segmentations. By mining the closeness of the connection between a segmentation and its adjacent segmentations compared to other segmentations, it can, to a certain extent, reflect the semantic information of the same segmentation in different contexts, thereby helping to improve the accuracy of subsequent text review.
[0095] The second part, how to obtain the second word vector, maps the initial word vector of the segmented word to the semantic channel determined based on its C adjacent segmented words to obtain the second word vector of the segmented word. The C adjacent segmented words can be found in the description of the first part above and will not be repeated here.
[0096] Specifically, in an embodiment of the present application, a pre-trained context prediction model can be used to implement the process of processing the occurrence probability of the above C adjacent word segments for the above word segment based on the maximum likelihood function to obtain the second word vector output by the model. The context prediction model may include: an input layer, a hidden layer, and an output layer.
[0097] like Figure 4 As shown in the figure, it is a schematic diagram of the process of obtaining the second word vector in the embodiment of the present application. The initial word vector x of the word segmentation is used as the input of the input layer. For example, the dimension of the initial word vector x is V×1, and it is multiplied by the transpose W of the third weight matrix W (with a shape of V×N) respectively. T , obtain the corresponding hidden layer vector h, that is, extract the kth (k is the position of the initial word vector x) row vector in the third weight matrix. Then, the hidden layer vector h is combined with the transpose W' of the fourth weight matrix W' T Multiply to obtain the hidden layer output vector u, for each component u of the hidden layer output vector u j , which can be characterized as: Here, each component u j Considered as a series of scores, that is, the predicted word in the context of the word, the hidden layer output vector u is the second word vector of the probability of occurrence of C adjacent word segments for the specified word.
[0098] Furthermore, an activation function (such as softmax function) is used to process y c =Softmax(u), we can obtain the probability of each context segmentation being the context segmentation of the segmentation based on the segmentation, that is: Among them, y c,j It is y c The j-th component of represents the probability of predicting the j-th word in the pre-stored word library V given a specified word, where the sum of all probabilities is 1.
[0099] It should be noted that during the training process of the context model, the probability of adjacent word segmentations of C real contexts can be maximized, that is, the product of these probabilities can be maximized: Among them, f * c is the index of the adjacent word of the desired i-th output context; based on this, the loss value of the context model is calculated The loss value is used for back propagation to update the weight matrices in the model. The specific update method can be referred to the back propagation algorithm, which will not be elaborated here.
[0100] Optionally, the context prediction model can also be built based on the framework of various language models, such as ELMO, BERT, GPT, etc., which will not be elaborated on.
[0101] For example, clause 1 is "The cat is on the mat", clause 2 is "The dog is in the fog", and each word in each clause corresponds to an initial word vector; then clause 1 can be split into the following combinations: (cat, the), (is, cat), (on, is), (the, on), (mat, the), and through the context prediction model, by maximizing the likelihood function, the second word vector representation of each word can be obtained, such as: the second word vector representation of "the" is: [0.1, 0.2, -0.1], and the second word vector representation of "cat" is: [0.3 ,-0.5,0.2], the second word vector of “is” is expressed as: [0.2,0.1,0.4], the second word vector of “on” is expressed as: [-0.1,0.3,0.2], the second word vector of “mat” is expressed as: [0.4,-0.2,0.3], the second word vector of “dog” is expressed as: [-0.2,0.4,-0.3], “in” [0.3,0.2,0.1], and the second word vector of “fog” is expressed as: [0.1,0.6,-0.2].
[0102] In short, the second word vector of a segmentation represents the probability of occurrence of C adjacent segmentations for a specified segmentation. It explores the closeness of the connection between adjacent segmentations compared to other segmentations, and can, to a certain extent, reflect the different semantic information of the same segmentation in different contexts, thereby helping to improve the accuracy of subsequent text review.
[0103] As an integrated overview, Figure 5 As shown, referring to the above-mentioned first and second parts, an embodiment of the present application provides a method for obtaining the first word vector and the second word vector of a word segmentation. For a single word segmentation, on the one hand, its corresponding initial word vector is obtained from a preset word segmentation library, and then the word segmentation prediction model and the context prediction model are respectively input to obtain the first word vector and the second word vector of the word segmentation, and the semantic features of the word segmentation are obtained by combining the two.
[0104] Optionally, the combination of the first word vector and the second word vector can be a concatenation process, an averaging process, a weighted summation process, or a Transformer encoding process, which is not specifically limited here.
[0105] In one possible implementation, the embodiment of the present application provides a text sentence segmentation method for splitting the text to be reviewed into N sentences, which helps to improve the subsequent recognition accuracy of variant texts such as those with inserted irrelevant characters, mixed multiple languages, and mixed pinyin texts.
[0106] It is easy to understand that in addition to the regular punctuation marks and grammatical rules, the text to be reviewed also contains some variant texts, such as the punctuation marks contained in the morning and afternoon texts, and the punctuation marks contained in abbreviations (such as "US"). If the punctuation marks are used as sentence segmentation markers, the subsequent recognition accuracy of the sentences will be low.
[0107] Specifically, a string matching method can be used to remove special characters from the text to be reviewed to obtain a candidate text. Then, the language of the candidate text is identified, and a sentence end marker preset for the text language is obtained. Based on the sentence end marker, the candidate text is then segmented to obtain N sentences.
[0108] For example, in practical applications, a programming language (such as Python) can be used to provide a system class library to match tags such as Hypertext Markup Language (HTML), Uniform Resource Locator (URL), and email addresses. In addition, the language of the text to be recognized will be identified. For example, if the text to be recognized is English, the text preprocessing rules of English can be used to first unify the capitalization and font size specifications, unify different forms of vocabulary such as plural and tense into their basic forms, and then use the preset word segmentation library and stem extraction algorithm based on the corresponding English sentence end marker to extract N sentences.
[0109] The extraction of the above N clauses can be achieved using regular expressions. The implementation steps generally include: removing special symbols (such as HTTM, URL, email address, etc.), removing non-alphanumeric and space characters, replacing consecutive spaces with single spaces, and removing spaces at the beginning and end of lines.
[0110] Alternatively, a sequence tagging model can be used to perform the sentence extraction described above. This approach can automatically learn patterns in text and better handle issues caused by irrelevant characters.
[0111] It should also be noted that if the text language of the text to be reviewed includes Chinese and English, that is, it corresponds to the mixed situation of Chinese and English, then the following steps can be performed: Get the sentence end markers of Chinese and English, such as English: (.)(!)(?), Chinese (.)(!)(?), etc. Traverse each character in the text to be reviewed, and when the sentence end marker is matched, check whether the subsequent characters (if any) meet the conditions for the start of the sentence: for English, the condition for the start of the sentence can be an uppercase letter; for Chinese, the condition for the start of the sentence can be that the character is a Chinese character, punctuation mark, etc.; if the condition for the start of the sentence is met, the current position is regarded as the end of the sentence. Among them, for special symbols such as abbreviations, quotation marks, brackets, etc., regular expressions can still be used for matching.
[0112] Based on this step of the embodiment of the present application, the text to be reviewed can be accurately split into N sentences by shielding special characters in the text. At the same time, combined with the word segmentation prediction model and the context prediction model, the correlation between each word in each sentence can be comprehensively evaluated, which will help the subsequent evaluation of the different meanings of the same word in different sentences (that is, different contextual contexts) and improve the review accuracy of the text to be reviewed.
[0113] Step 202: Based on the self-attention mechanism, in each word segmentation feature sequence, the feature correlation between each word segmentation and at least one adjacent word segmentation is obtained respectively, and the word segmentation weight generated based on at least one feature correlation corresponding to each word segmentation is used to update the semantic features of the corresponding word segmentation to obtain the updated feature sequences of each of the N clauses.
[0114] In the embodiment of the present application, in order to deeply explore the contextual interpretation within each sentence and better identify the true semantics of each word in the corresponding context, a method of using word weights to update the semantic features of words is also proposed, which is described in detail below.
[0115] In one possible implementation, the embodiment of the present application provides a method for obtaining feature relevance. Specifically, taking each of N word segmentation feature sequences as a unit, the following operations are performed for each word in a single word segmentation feature sequence:
[0116] The semantic features of a segmented word and the semantic features of at least one directly adjacent segmented word are obtained. Then, based on the self-attention mechanism, the feature similarity between the semantic features of the segmented word and the semantic features of at least one adjacent segmented word is calculated. The feature similarity corresponding to at least one adjacent segmented word is then used to perform a weighted summation and normalization process on the semantic features of the corresponding directly adjacent segmented words to obtain the feature association of the segmented word.
[0117] It should be noted that the at least one adjacent participle can be a participle directly connected to the aforementioned participle in the corresponding clause. That is, if the aforementioned participle is located at the beginning or end of the corresponding clause, the number of adjacent participles is 1; otherwise, the number of adjacent participles is 2. Of course, the aforementioned connection mainly describes a direct connection relationship in the same direction. For situations with multiple directions, the setting can be based on actual application requirements.
[0118] Of course, the number of the at least one connected participle can also be set according to actual conditions. For example, for a single sentence, the number is the total number of participles in the sentence minus one, so as to further explore the association relationship between the participles at different positions in each sentence.
[0119] Alternatively, for the aforementioned method of calculating the feature similarity between a single segmented word and a neighboring segmented word, if the semantic feature is a feature value, an encoder is used to convert the semantic feature representation of the corresponding segmented word into a feature vector. By calculating the dot product between the feature vectors corresponding to the two segmented words, the feature similarity between the two is obtained, i.e., the correlation between the two segmented words at different positions in the corresponding sentence. The dot product result can also be normalized to serve as the corresponding feature similarity.
[0120] The dot product is the length of the two feature vectors and the cosine of the angle between them, which reflects the similarity between the word segments corresponding to the two feature vectors in the direction of the coordinate system.
[0121] Optionally, for each segmented word, the feature similarity corresponding to at least one adjacent segmented word is obtained. The obtained feature similarity is used to perform a weighted summation process on the semantic features of the corresponding segmented word in the at least one adjacent segmented word, thereby obtaining the feature correlation of the segmented word. The feature correlation reflects the degree of similarity between the segmented word and the at least one adjacent segmented word in the corresponding sentence. The processing result is then normalized to obtain the corresponding segmented word weight.
[0122] Furthermore, the semantic features of each segmentation are updated using the segmentation weight of each segmentation to obtain updated feature sequences for each of the N clauses. During the calculation of feature relevance, the calculation of segmentation weights, and the updating of segmentation semantic features, a convolution operation can be performed on the semantic features of each segmentation involved to extract information from the semantic features that characterizes the segmentation itself and the relationship between it and its related segmentations, as follows:
[0123] As a possible implementation method, the above convolution operation can be implemented using the convolution layer in a convolutional neural network / deep learning model to extract global semantic information and local semantic information.
[0124] For example, a convolution kernel of size k is used in the convolution layer to perform a convolution operation on the word segmentation feature vector of the input sentence. Assuming k = 2, and the weight matrix of the convolution kernel is: W = [[0.1, -0.2, 0.3], [-0.1, 0.4, 0.2]], then the convolution kernel is slid on the word segmentation feature vector of the sentence to obtain the convolved feature map. For example, taking the first sentence "The cat is on the mat", the feature map after the convolution operation may include: z1 = f([0.1, 0.2, -0.1] * [0.1, -0.2, 0.3] + [0.3, -0.5, 0.2] * [-0.1, 0.4, 0.2]) = f(0.22); z2 = f([0.3, -0.5, 0.2] * [0.1, -0.2, 0.3] + [0.2, 0.1, 0.4] * [-0.1, 0.4, 0.2]) = f(-0.03), etc. Among them, z1 represents the convolution output of the convolution kernel at the first position ("the" and "cat"), z2 identifies the convolution output at the second position ("cat" and "is"), and f represents the activation function (such as ReLU).
[0125] Optionally, for the processing of the above-mentioned convolution kernel, the weight matrix W of the convolution kernel is used to multiply the input word segmentation feature vector element by element and sum it. As in the above example, z1 is obtained by calculating the product of the two word segmentation feature vectors and the convolution kernel weights, and then passing the result to the activation function. Similarly, the convolution output of the convolution kernel at other positions (such as z2, z3, etc.) will also be calculated. Based on this, a feature map corresponding to each sentence is generated. The feature map is used to reflect the local information in the input word segmentation feature vector. Each row in the feature map represents the semantic feature of extracting part of the semantic information for one of the word segmentations.
[0126] Optionally, a max pooling operation can be performed on the convolutional feature map to extract the global semantic information of each sentence. For example, taking the sentence feature map [z1,z2,z3,z4] as an example, the result of the max pooling operation can be represented as: y = max(z1,z2,z3,z4) = max(0.22,-0.03,...,0.16) = 0.22; where y represents the global feature value of the sentence after the max pooling operation.
[0127] It should be noted that in practical applications, the above convolution processing typically uses multiple convolution kernels to extract different global information. The resulting global feature value y can be a vector containing multiple global feature values. Furthermore, the global feature value can be integrated into the word segmentation feature sequence of the corresponding sentence, for example, using it to update each semantic feature therein.
[0128] Based on this step of the embodiment of the present application, the self-attention mechanism can be used to dig out the correlation between adjacent segmentations in the same sentence, thereby identifying the different semantic information of the same segmentation in different sentences, thereby solving the problem of misjudgment. For example, taking the polysemous word "AB" as an example, the correlation between "AB" and "website" is different from the correlation between "AB" and "font". By calculating the segmentation weights that represent the correlation between adjacent segmentations, the degree of attention to some parts is strengthened, which helps to improve the accuracy of subsequent semantic recognition.
[0129] Step 203: Using the trained text recognition model, semantic feature recognition is performed on each of the N updated feature sequences to obtain corresponding semantic recognition results. From the N obtained recognition results, the sentences corresponding to the recognition results that meet the preset emotion recognition conditions are selected as the sentences to be reviewed.
[0130] In an embodiment of the present application, the text recognition model may include: multiple expert task modules and a shared task module.
[0131] Among them, each expert task module corresponds to an expert task, which can include syntactic recognition tasks, entity recognition tasks, emotion recognition tasks, etc., and the model parameters in each expert task module are updated and adjusted based on the training process of the corresponding expert task.
[0132] The shared task module corresponds to a shared task, a comprehensive task for reviewing text that encompasses the processes of each expert task. The model parameters in the shared task module can be updated and adjusted based on the training process of each expert task. This allows the shared task to better integrate information from multiple expert tasks, preventing biased data from influencing the model training process and leading to lower accuracy.
[0133] In one possible implementation, semantic feature recognition is performed on each of the N update feature sequences using a trained text recognition model to obtain corresponding semantic recognition results. For each of the N update feature sequences, the following operations are performed:
[0134] Using a pre-trained text recognition model, syntactic feature recognition is performed on a single update feature sequence to obtain a corresponding syntactic recognition result. This syntactic recognition result is then added to the update feature sequence to obtain a corresponding syntactic feature sequence. The syntactic feature sequence is then weighted using preset sentiment classification parameters to obtain a corresponding sentiment feature sequence. Subsequently, based on at least the sentiment category information corresponding to the normalized sentiment feature sequence, a semantic recognition result for the corresponding sentence is generated.
[0135] The sentiment classification parameter represents the relationship between the historical syntactic feature sequence and the sentiment category information. The semantic recognition result includes at least the sentiment category information of each of the N clauses. The sentiment category information includes at least a negative sentiment identifier and a positive sentiment identifier.
[0136] It should be noted that in the embodiment of the present application, the emotion classification parameter corresponds to the emotion recognition task, and the expert task module corresponding to the emotion recognition task at least includes the emotion classification parameter. Of course, the shared task module may also include the corresponding emotion classification parameter, which will not be described in detail here.
[0137] Optionally, in an embodiment of the present application, the above-mentioned syntactic feature recognition process can be implemented based on the syntactic recognition task to obtain the syntactic recognition result of each sentence.
[0138] Each syntactic recognition result includes at least the part-of-speech information of each word in the corresponding clause, as well as the dependency relationships between the words. The part-of-speech information includes at least content words and function words; content words can include nouns, verbs, adjectives, quantifiers, and pronouns, while function words can include adverbs, prepositions, conjunctions, particles, interjections, and onomatopeia. The dependency relationships are typically used to reveal syntactic structures, such as subject-verb relationships, verb-object relationships, and core relationships.
[0139] Specifically, in the expert task module corresponding to the syntactic recognition task, a syntactic approach to pattern recognition, also known as a structural or linguistic method, can be used to identify part-of-speech information and dependency relationships. Fundamentally, this approach involves combining recognizable syntactic structural patterns (samples or graphs) into a specific text based on their structure, and then using syntactic pattern recognition to determine which category they belong to. This approach describes a pattern as a combination of simpler subpatterns, which can be described as combinations of even simpler subpatterns, ultimately resulting in a tree-like structural description. The simplest subpatterns at the bottom are called pattern primitives. Primitives represent the basic characteristics of a pattern and should not contain significant structural information. This form of describing a pattern as a set of primitives and their combination relationships is called a pattern description statement, similar to how sentences and phrases are combined with words, and words are combined with characters in language. Primitives are combined into patterns according to grammatical rules.
[0140] Optionally, in an embodiment of the present application, the above-mentioned entity feature recognition process can be implemented based on an entity recognition task.
[0141] Specifically, based on the part-of-speech information in the previous syntactic recognition results, entity segmentations whose part-of-speech information corresponds to named entities can be selected from the segmentations included in the corresponding clauses of the updated feature sequence. The entity identifiers corresponding to the named entities are then added to the semantic features of each selected entity segmentation, resulting in a syntactic feature sequence generated by the addition operation on the updated feature sequence.
[0142] Among them, the above-mentioned named entities are entities with specific meanings in the text, which may include names of people, places, organizations, proper nouns, etc. In the embodiment of the present application, entity segmentation can be roughly divided into three categories, such as entity class, time class, and number class. Entity segmentation can also be divided into seven subcategories, such as names of people, organizations, places, time, date, currency, and percentage. Of course, in different application scenarios, the categories of named entities and the categories of selected entity segmentation can have different definitions.
[0143] Optionally, in an embodiment of the present application, for the execution process of each expert task module, the input can also be synchronously transmitted to the shared task module for processing, and a new gating unit can be added to combine the output results of the expert task module and the output results of the shared task module, and the combined results can be used as the actual output results of the corresponding expert task module.
[0144] In addition, in the embodiment of the present application, the various expert task modules in the text recognition module can be executed in series or in parallel, and the specific settings can be made according to the actual application situation.
[0145] Furthermore, in a possible implementation, for the semantic recognition results of each of the N sentences, since the semantic recognition results contain at least the positive emotion identifier / negative emotion identifier of the corresponding sentence, each semantic recognition result is matched by the preset emotion identifier in the preset emotion recognition condition to obtain a matching sentence as the sentence to be reviewed.
[0146] For example, the preset emotional identifier is a negative emotional identifier, which can effectively improve the recognition efficiency of reviewing bad text information. Of course, the semantic recognition result may also include a biased emotional identifier, and the corresponding preset emotional identifier is a biased emotional identifier, etc., which is not specifically limited here. However, it should be emphasized that in the embodiments of this application, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0147] In short, in an embodiment of the present application, the text recognition module combines at least one expert task module and a shared task module, and can identify the emotional tendencies of N sentences based on at least the sentiment classification parameters therein, taking sentences as units, thereby obtaining corresponding semantic recognition results and improving the accuracy and efficiency of subsequent automatic text review.
[0148] In a possible specific implementation process, the text recognition model of the embodiment of the present application can be trained and obtained in the following manner: first, a training sample set is obtained, wherein each training sample includes: a sample update feature sequence of a sample sentence and a corresponding sample label, and the sample label includes: the true semantic information of a sample sentence. Then, a training sample is selected from the training sample set, and the corresponding sample update feature sequence is input into the text recognition model to be trained. During each round of iterative training of the text recognition model, the sample update feature sequence is subjected to semantic recognition processing based on at least the preset syntactic recognition dimension and sentiment classification dimension to obtain the corresponding sample semantic recognition result. Finally, based on the difference information between the semantic recognition results of each sample and the corresponding true semantic information, the model parameters in the text recognition model are updated. Until the difference information obtained in the current iteration round meets the preset training termination condition, a trained text recognition model is obtained.
[0149] Among them, the training termination conditions may include: the current iteration round meets the preset total iteration rounds, the current difference information falls into the preset difference interval information, and the text recognition model of the current iteration round has converged.
[0150] Optionally, in each iteration, first, based on a preset syntactic recognition dimension, an expert task module corresponding to the syntactic recognition task is used to perform semantic processing on the sample update sequence to obtain a first processing result; then, based on a preset entity recognition dimension, an expert task module corresponding to the entity recognition task is used to perform semantic processing on the first processing result to obtain a second processing result; then, based on a preset emotion recognition dimension, an expert task module corresponding to the emotion recognition task is used to perform semantic processing on the second processing result to obtain a semantic recognition result. The semantic recognition result may include: a syntactic recognition result, an entity recognition result, and an emotion recognition result for each sentence.
[0151] For the module parameters in each expert task module, fine-tuning can be adopted to enable the expert task module to learn relevant knowledge of the corresponding task, thereby improving the adaptability of the text recognition model.
[0152] For example, see Figure 6 , which is a possible logic diagram for fine-tuning model parameters in an embodiment of the present application. Here, the expert task model corresponding to the emotion recognition task is used as an example for specific explanation. Those skilled in the art will appreciate that the fine-tuning logic for each expert task module is similarly derived, and that the shared task module can also fine-tune its internal model parameters in the same manner.
[0153] like Figure 6As shown, for the input information, the preset first emotion classification sub-parameter performs weighted summation (Add) and normalization (Norm) processing on the input information, and then inputs the processing result into the conversion unit (Adapter). In the first processing process, based on the initial state information in the conversion unit, the previous processing results are summed up and the h A Upsampling (W up ) and downsampling (W Down ) to obtain h FM Then, the preset second emotion classification sub-parameter is used to process the processing result h FM Perform weighted summation and normalization to obtain the output result h F , replace the state information in the conversion unit, and use the output result h F Update the first emotion classification sub-parameter and the second emotion classification sub-parameter.
[0154] Through the above-mentioned model fine-tuning method, the text recognition model learns rich language knowledge, such as grammar, syntax, and semantics, and further fine-tunes the model parameters on the training sample set. During the fine-tuning process, the text recognition model will further learn various knowledge of the corresponding tasks, thereby improving the adaptability of the text recognition model.
[0155] It should be noted that the above fine-tuning process can be used to update the feature sequences of each of the N sentences. After the output of the original expert task module, a learnable weight that has undergone low-rank decomposition is added. By training these parameters, the model can be adapted to the new recognition task.
[0156] Based on this step of the embodiment of the present application, a multi-task recognition module and a shared task recognition module can be constructed through a text recognition model, so as to accurately identify the different semantic information of the same word in different sentences, thereby improving the review accuracy of subsequent review texts.
[0157] Step 204: referring to the preset shielded text, using the preset matching algorithm, performing text review on the sentence to be reviewed, obtaining the text review result of the text to be reviewed, and shielding the text to be reviewed or prompting the user.
[0158] In the embodiment of the present application, the preset shielded text can be characters or word segments or sentence segments, which ensures that the text does not meet the audit requirements. The preset matching algorithm is an algorithm that meets the audit requirements.
[0159] In one possible implementation, string matching is performed on each complete word in the sentence to be reviewed, based on a preset masked text, to obtain a first review result. Then, the number of edit operations required to convert each word in the sentence to be reviewed is obtained, and words with a number of edit operations exceeding a preset threshold are selected as the words to be masked, to generate a second review result. Finally, based on the first and second review results, a text review result for the text to be reviewed is obtained.
[0160] Optionally, the first audit result can be obtained by processing using a preset regular expression to improve the model's ability to identify variant content to be blocked. Regular expressions are a powerful text matching and search tool that can be used to identify strings with specific patterns.
[0161] For example, suppose the text to be blocked is "cat" and "dog," including all uppercase and lowercase variants. The following regular expression can be used to match these words: Regular Expression 1: \b(?i:cat|dog)\b. In this regular expression, \b matches character boundaries, ensuring only complete characters are matched; (?i:...) indicates case-insensitive character matching; and cat|dog matches "cat" or "dog." In other words, Regular Expression 1 can be used to search for and block "cat" and "dog," as well as their uppercase and lowercase variants, in the text to be reviewed.
[0162] Optionally, the second audit result can be obtained by processing using a preset fuzzy matching algorithm to improve the model's ability to identify variant content to be blocked. Here, the fuzzy matching algorithm can be used to identify similar but not identical character strings in the text.
[0163] Exemplarily, in an embodiment of the present application, a possible fuzzy matching algorithm is provided, that is, calculating the edit distance. First, the edit distance is explained, which represents the minimum number of single-character editing operations (insertion, deletion, or replacement) required to convert one string into another. For example, suppose that all forms of "cat" need to be shielded, including misspelled variants. The edit distance algorithm can be used to identify strings similar to "cat". For example, a threshold can be set, such as a string with an edit distance less than or equal to 1 will be regarded as a variant of "cat". Of course, in the specific implementation, each word (character) in the text to be reviewed can be traversed to calculate their edit distance with "cat". If the distance is less than or equal to the threshold, this word (character) is regarded as content to be shielded.
[0164] Furthermore, for a single sentence: if the first audit result is that the sentence contains blocked text and the second audit result is that the sentence does not contain blocked text, then the text audit result of the sentence is that it contains blocked text; if the first audit result is that the sentence does not contain blocked text and the second audit result is that the sentence contains blocked text, then the text audit result of the sentence is that it contains blocked text; if the first audit result is that the sentence contains blocked text and the second audit result is that the sentence contains blocked text, then the text audit result of the sentence is that it contains blocked text; if the first audit result is that the sentence does not contain blocked text and the second audit result is that the sentence does not contain blocked text, then the text audit result of the sentence is that it does not contain blocked text. Among them, the text audit result that does not contain blocked text is normal; the text audit result that contains blocked text is abnormal, and the specific abnormality category can be obtained based on the abnormality information corresponding to the matching content of the preset matching algorithm.
[0165] In other words, the above text review results at least include: the inclusion relationship of the text to be reviewed to the blocked text; then in a possible implementation method, the embodiment of the present application provides a method for blocking or prompting the user for the text to be reviewed, which is specifically explained in the following two situations.
[0166] Case 1: Blocking the text to be reviewed: Based on the text review results, at least the sentences to be blocked containing the blocked text can be determined. By blocking these sentences, the text to be reviewed can be automatically blocked. Of course, the blocking process here can be triggered in response to a blocking instruction triggered in real time by the user, or it can be triggered in response to a blocking instruction preset with user authorization.
[0167] For example, on a network platform, the above method can be used to specifically block texts awaiting review that are publicly available on the network platform, especially some texts awaiting review that are highly real-time, thereby optimizing the user's viewing experience on the network platform.
[0168] Case 2: Prompting the user: Based on the text review results, at least the sentence to be reviewed containing the blocked text can be determined. Then, based on the correspondence between the blocked text and the preset prompt information for prompting the user, by integrating the prompt information corresponding to each blocked text contained in the sentence to be reviewed, a prompt information for the text to be reviewed can be generated and presented in a visual display area to prompt the user. Of course, the prompt processing here can be triggered in response to a request instruction previously triggered by the user, or in response to a prompt instruction triggered by the user in real time, or it can be automatically triggered in response to a preset prompt instruction authorized by the user.
[0169] For example, in the visual display area, prompt information of the text to be reviewed is presented, wherein prompt information corresponding to the sentences to be blocked is presented in sequence according to the order in which the sentences to be blocked are arranged in the text to be reviewed. In addition, in order to further optimize the user's review efficiency and viewing experience, the sentences to be blocked can be highlighted in the text to be reviewed presented in the visual display area according to the actual user's viewing needs. Of course, with respect to the triggering condition for highlighting the sentences to be blocked, the sentence to be blocked corresponding to the selection operation can also be highlighted in the text to be reviewed presented in the visual display area in response to the user's selection operation triggered by any prompt information.
[0170] Based on this step of the embodiment of the present application, while identifying the different meanings of the same word in different contexts, in order to improve the subsequent detection accuracy, the preset shielded text is referred to, and the preset string matching method and fuzzy matching method are adopted to obtain the final text review result. Based on this, the text to be reviewed is shielded or the user is prompted, which greatly optimizes the user's viewing experience of the text to be reviewed.
[0171] To sum up, in an embodiment of the present application, a text review method is provided, involving artificial intelligence technology. In this method, the different semantics of the same words in different contexts are analyzed to identify content that may contain preset blocked text, thereby improving the accuracy and efficiency of text review.
[0172] For the convenience of those skilled in the art, see Figure 7 As shown, it is a possible logical diagram of implementing public text review provided in an embodiment of the present application.
[0173] like Figure 7As shown, in an embodiment of the present application, the execution device first obtains the initial word vector of each word in the public text to be reviewed from the preset word segmentation library based on the word embedding method. Based on this, a convolutional neural network is used to extract the word segmentation feature sequences of N (N>0) sentences in the text to be reviewed, and each word segmentation feature sequence includes: the semantic features of each word in the corresponding sentence. Then, based on the self-attention mechanism, in each word segmentation feature sequence, the feature correlation between each word and at least one adjacent word is obtained to explore the correlation between different word segments in the same sentence, and the word segmentation weights generated based on at least one feature correlation corresponding to each word are used to update the semantic features of the corresponding word, and obtain the updated feature sequences of the N sentences. Subsequently, semantic feature recognition is performed on the N updated feature sequences through the trained text recognition model to obtain corresponding semantic recognition results. From the N recognition results obtained, the sentences corresponding to the recognition results that meet the preset emotion recognition conditions are used as sentences to be reviewed, which helps to identify the emotional colors of different words in the same sentence. Finally, with reference to the preset shielded text and using the preset matching algorithm, text review is performed on the sentences to be reviewed to obtain the text review results of the text to be reviewed. The text to be reviewed is shielded or the user is prompted to solve the problem that related technologies are difficult to recognize the different meanings of the same word in different contexts, improve the accuracy and efficiency of text review, and optimize the user's viewing experience.
[0174] Optionally, the above text review results can be used for text recognition tasks, risk control management tasks, text review tasks, etc. in various application scenarios. The text mentioned here is not limited to text expression form, but can also be text carried in images, audio, video, etc.
[0175] See also Figure 8 As shown, based on the same inventive concept, the embodiment of the present application further provides a disclosed text review device 800, which includes:
[0176] The extraction unit 801 is used to extract the word segmentation feature sequence of each of N clauses in the text to be reviewed, wherein N>0, and the word segmentation feature sequence includes: the semantic features of each word contained in the corresponding clause;
[0177] An updating unit 802 is configured to obtain, based on a self-attention mechanism, a feature correlation between each segmentation and at least one adjacent segmentation in each segmentation feature sequence, and update the semantic features of the corresponding segmentation using a segmentation weight generated based on at least one feature correlation corresponding to each segmentation, thereby obtaining updated feature sequences for each of the N clauses.
[0178] The recognition unit 803 is configured to perform semantic feature recognition on each of the N updated feature sequences using a trained text recognition model to obtain corresponding semantic recognition results, and select, from the N obtained recognition results, sentences corresponding to the recognition results that meet preset emotion recognition conditions as sentences to be reviewed;
[0179] The review unit 804 is used to refer to the preset shielded text, adopt a preset matching algorithm, perform text review on the sentence to be reviewed, obtain the text review result of the text to be reviewed, and shield the text to be reviewed or prompt the user.
[0180] In an optional embodiment, the extraction unit 801 is specifically configured to:
[0181] Obtaining an initial word vector corresponding to each word segment in the text to be reviewed; wherein the initial word vector is generated based at least on the frequency of occurrence of the corresponding word segment in the historical text set;
[0182] For each word segment in the text to be reviewed, the following operations are performed: a first word vector representing the probability of occurrence of the word segment under C adjacent word segments and a second word vector representing the probability of occurrence of the C adjacent word segments under the word segment are obtained, where C>0; feature encoding is performed on the first word vector and the second word vector based on a specified feature dimension to obtain the semantic feature of the word segment;
[0183] N sentences of the text to be reviewed are extracted, and based on the semantic features of each word in each sentence, word feature sequences of each of the N sentences are obtained.
[0184] In an optional embodiment, the extraction unit 801 is configured to obtain a first word vector representing the probability of occurrence of a word under C adjacent word segments, and a second word vector representing the probability of occurrence of the C adjacent word segments under the word segment, specifically for:
[0185] Based on the association weights between a segmentation and its C adjacent segmentations, a weighted summation process is performed on the initial word vectors of the C adjacent segmentations to obtain a first word vector for the segmentation; wherein the first word vector represents the probability of occurrence of the segmentation with respect to the C adjacent segmentations;
[0186] as well as,
[0187] The initial word vector of the word segmentation is mapped to the semantic channel determined based on the C adjacent word segmentations to obtain a second word vector of the word segmentation; wherein the second word vector represents the occurrence probability of the C adjacent word segmentations for the word segmentation.
[0188] In an optional embodiment, the extraction unit 801 is configured to extract N sentences from the text to be reviewed, specifically:
[0189] Using a string matching method, special characters in the text to be reviewed are removed to obtain a candidate text;
[0190] By identifying the text language corresponding to the candidate text, a sentence end marker preset for the text language is obtained;
[0191] Based on the sentence end identifier, the candidate text is sentence-processed to obtain N sentences.
[0192] In an optional embodiment, the updating unit 802 is configured to obtain, in each word segmentation feature sequence, a feature correlation between each word segmentation and at least one adjacent word segmentation based on a self-attention mechanism, specifically to:
[0193] In each word segmentation feature sequence, the following operations are performed for the semantic features of each word segmentation:
[0194] Obtaining the semantic features of at least one directly adjacent segmentation of the segmentation;
[0195] Calculating feature similarities between the semantic features of the segmented words and the semantic features of at least one adjacent segmented word;
[0196] The feature similarities corresponding to the at least one adjacent segmented word are respectively used to perform weighted summation and normalization processing on the semantic features of the corresponding directly adjacent segmented words to obtain the feature association of the segmented words.
[0197] In a possible embodiment, the recognition unit 803 is configured to perform semantic feature recognition on each of the N updated feature sequences using a trained text recognition model to obtain corresponding semantic recognition results, specifically for:
[0198] For each of the N updated feature sequences, perform the following operations:
[0199] Using a pre-trained text recognition model, syntactic feature recognition is performed on the updated feature sequence to obtain a corresponding syntactic recognition result; wherein the syntactic recognition result includes at least: part-of-speech information of each word in the corresponding sentence, and the dependency relationship between the words;
[0200] Adding the syntactic recognition result to the updated feature sequence to obtain a corresponding syntactic feature sequence;
[0201] Using preset sentiment classification parameters, weighting the syntactic feature sequence to obtain a corresponding sentiment feature sequence; wherein the sentiment classification parameter represents: the correlation between the historical syntactic feature sequence and the sentiment category information;
[0202] A semantic recognition result of a corresponding sentence is generated based at least on the emotion category information corresponding to the normalization processing result of the emotion feature sequence.
[0203] In a possible embodiment, the recognition unit 803 is configured to add the syntactic recognition result to the updated feature sequence to obtain a corresponding syntactic feature sequence, specifically for:
[0204] Based on the part-of-speech information in the syntactic recognition result, selecting entity participles whose part-of-speech information corresponds to a named entity from each participle included in the sentence corresponding to the updated feature sequence;
[0205] The entity identifier corresponding to the named entity is added to the semantic features of each selected entity segmentation, and a syntactic feature sequence generated by performing an adding operation on the updated feature sequence is obtained.
[0206] In a possible embodiment, the text recognition model is obtained by training in the following manner, and the recognition unit 803 is further configured to:
[0207] Acquire a training sample set, wherein each training sample includes: a sample update feature sequence of a sample sentence and a corresponding sample label; wherein the sample label includes: true semantic information of the sample sentence;
[0208] Selecting training samples from the training sample set, and inputting corresponding sample update feature sequences into the text recognition model to be trained, performing semantic recognition processing on the sample update feature sequences based on at least a preset syntactic recognition dimension and a sentiment classification dimension, to obtain corresponding sample semantic recognition results;
[0209] Based on the difference information between the semantic recognition results of each sample and the corresponding true semantic information, updating the model parameters in the text recognition model;
[0210] Until the difference information satisfies a preset training termination condition, a trained text recognition model is obtained.
[0211] In a possible embodiment, the review unit 804 is specifically configured to:
[0212] Based on the preset shielded text, each complete word segment in the sentence to be reviewed is matched using a string matching method to obtain a first review result;
[0213] In the sentence to be reviewed, the number of editing operations required for each segmented word to be converted into the shielded text is obtained, and the segmented words whose number of editing operations is greater than a preset threshold are selected as the segmented words to be shielded, so as to generate a second review result;
[0214] Based on the first review result and the second review result, a text review result of the text to be reviewed is obtained.
[0215] Optionally, the text review result at least includes: an inclusion relationship between the text to be reviewed and the shielded text;
[0216] The review unit 804 is used to block or prompt the user about the text to be reviewed, specifically to:
[0217] Determining, from the text review result, a sentence to be shielded that contains the shielded text, and shielding the sentence to be shielded;
[0218] or,
[0219] From the text review result, the to-be-screened sentence containing the screened text is determined, and prompt information of the to-be-screened text is generated according to the prompt information corresponding to the screened text for prompting the user.
[0220] The device can be used to execute the methods shown in the various embodiments of the present application. Therefore, for the functions that can be implemented by the various functional modules of the device, please refer to the description of the aforementioned embodiments and no further details will be given.
[0221] See Figure 9 As shown, based on the same technical concept, the embodiment of the present application also provides a computer device 900, which can be Figure 1 As shown in the terminal device or server, the computer device 900 may include a memory 901 and a processor 902 .
[0222] The so-called memory 901 is used to store computer programs executed by the processor 902. The memory 901 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the computer device, etc. The processor 902 may be a central processing unit (CPU), or a digital processing unit, etc. The specific connection medium between the above-mentioned memory 901 and the processor 902 is not limited in the embodiment of the present application. The embodiment of the present application is Figure 9 In the embodiment, the memory 901 and the processor 902 are connected via a bus 903. The bus 903 is connected to the processor 902 via a bus 903. Figure 9The connections between the other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The so-called bus 903 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0223] Memory 901 may be a volatile memory, such as random-access memory (RAM); or a non-volatile memory, such as read-only memory, flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 901 may be a combination of the aforementioned memories.
[0224] The processor 902 is used to execute the method executed by the device in each embodiment of the present application when calling the computer program stored in the so-called memory 901.
[0225] In some possible implementations, various aspects of the method provided in the present application can also be implemented in the form of a program product, which includes program code. When the so-called program product is run on a computer device, the so-called program code is used to enable the so-called computer device to execute the steps of the method according to the various exemplary embodiments of the present application described above in this specification. For example, the so-called computer device can execute the method executed by the device in each embodiment of the present application.
[0226] The so-called program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0227] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0228] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A method for reviewing public texts, characterized in that: The method comprises: Extracting a segmentation feature sequence of each of N clauses in the text to be reviewed, where N>0, and the segmentation feature sequence includes: semantic features of each segmentation contained in the corresponding clause; Based on the self-attention mechanism, in each word segmentation feature sequence, the feature correlation between each word and at least one adjacent word is obtained, and the word segmentation weight generated based on the at least one feature correlation corresponding to each word is used to update the semantic features of the corresponding word, thereby obtaining the updated feature sequences of the N clauses. Using the trained text recognition model, semantic feature recognition is performed on each of the N updated feature sequences to obtain corresponding semantic recognition results, and sentences corresponding to the recognition results that meet the preset emotion recognition conditions are selected from the N obtained recognition results as sentences to be reviewed; With reference to the preset shielded text, a preset matching algorithm is used to perform text review on the sentence to be reviewed, obtain a text review result of the text to be reviewed, and shield the text to be reviewed or prompt the user.
2. The method according to claim 1, wherein The step of extracting the word segmentation feature sequences of each of the N clauses in the text to be reviewed includes: Obtaining an initial word vector corresponding to each word segment in the text to be reviewed; wherein the initial word vector is generated based at least on the frequency of occurrence of the corresponding word segment in the historical text set; For each word segment in the text to be reviewed, the following operations are performed: a first word vector representing the probability of occurrence of the word segment under C adjacent word segments and a second word vector representing the probability of occurrence of the C adjacent word segments under the word segment are obtained, where C>0; feature encoding is performed on the first word vector and the second word vector based on a specified feature dimension to obtain the semantic feature of the word segment; N sentences of the text to be reviewed are extracted, and based on the semantic features of each word in each sentence, word feature sequences of each of the N sentences are obtained.
3. The method according to claim 2, wherein The step of obtaining a first word vector representing the probability of a word appearing in C adjacent word segments, and a second word vector representing the probability of the C adjacent word segments appearing in the word segment, includes: Based on the association weights between a segmentation and its C adjacent segmentations, a weighted summation process is performed on the initial word vectors of the C adjacent segmentations to obtain a first word vector for the segmentation; wherein the first word vector represents the probability of occurrence of the segmentation with respect to the C adjacent segmentations; as well as, The initial word vector of the word segmentation is mapped to the semantic channel determined based on the C adjacent word segmentations to obtain a second word vector of the word segmentation; wherein the second word vector represents the occurrence probability of the C adjacent word segmentations for the word segmentation.
4. The method according to claim 2, wherein The extracting N sentences of the text to be reviewed includes: Using a string matching method, special characters in the text to be reviewed are removed to obtain a candidate text; By identifying the text language corresponding to the candidate text, a sentence end marker preset for the text language is obtained; Based on the sentence end identifier, the candidate text is sentence-processed to obtain N sentences.
5. The method according to claim 1, wherein The self-attention mechanism is based on obtaining the feature correlation between each segmentation and at least one adjacent segmentation in each segmentation feature sequence, including: In each word segmentation feature sequence, the following operations are performed for the semantic features of each word segmentation: Obtaining the semantic features of at least one directly adjacent segmentation of the segmentation; Calculating feature similarities between the semantic features of the segmented words and the semantic features of at least one adjacent segmented word; The feature similarities corresponding to the at least one adjacent segmented word are respectively used to perform weighted summation and normalization processing on the semantic features of the corresponding directly adjacent segmented words to obtain the feature association of the segmented words.
6. The method according to claim 1, wherein The method of performing semantic feature recognition on the N updated feature sequences using the trained text recognition model to obtain corresponding semantic recognition results includes: For each of the N updated feature sequences, perform the following operations: Using a pre-trained text recognition model, syntactic feature recognition is performed on the updated feature sequence to obtain a corresponding syntactic recognition result; wherein the syntactic recognition result includes at least: part-of-speech information of each word in the corresponding sentence, and the dependency relationship between the words; Adding the syntactic recognition result to the updated feature sequence to obtain a corresponding syntactic feature sequence; Using preset sentiment classification parameters, weighting the syntactic feature sequence to obtain a corresponding sentiment feature sequence; wherein the sentiment classification parameter represents: the correlation between the historical syntactic feature sequence and the sentiment category information; A semantic recognition result of a corresponding sentence is generated based at least on the emotion category information corresponding to the normalization processing result of the emotion feature sequence.
7. The method according to claim 6, wherein The step of adding the syntactic recognition result to the updated feature sequence to obtain a corresponding syntactic feature sequence includes: Based on the part-of-speech information in the syntactic recognition result, selecting entity participles whose part-of-speech information corresponds to a named entity from each participle included in the sentence corresponding to the updated feature sequence; The entity identifier corresponding to the named entity is added to the semantic features of each selected entity segmentation, and a syntactic feature sequence generated by performing an adding operation on the updated feature sequence is obtained.
8. The method according to any one of claims 1 to 7, wherein: The text recognition model is trained in the following way: Acquire a training sample set, wherein each training sample includes: a sample update feature sequence of a sample sentence and a corresponding sample label; wherein the sample label includes: true semantic information of the sample sentence; Selecting training samples from the training sample set, and inputting corresponding sample update feature sequences into the text recognition model to be trained, performing semantic recognition processing on the sample update feature sequences based on at least a preset syntactic recognition dimension and a sentiment classification dimension, to obtain corresponding sample semantic recognition results; Based on the difference information between the semantic recognition results of each sample and the corresponding true semantic information, updating the model parameters in the text recognition model; Until the difference information satisfies a preset training termination condition, a trained text recognition model is obtained.
9. The method according to any one of claims 1 to 7, wherein: The reference preset shielded text, using a preset matching algorithm, performs text review on the sentence to be reviewed, and obtains a text review result of the text to be reviewed, including: Based on the preset shielded text, each complete word segment in the sentence to be reviewed is matched using a string matching method to obtain a first review result; In the sentence to be reviewed, the number of editing operations required for each segmented word to be converted into the shielded text is obtained, and the segmented words whose number of editing operations is greater than a preset threshold are selected as the segmented words to be shielded, so as to generate a second review result; Based on the first review result and the second review result, a text review result of the text to be reviewed is obtained.
10. A public text review device, characterized in that: The device comprises: An extraction unit extracts a segmentation feature sequence of each of N sentences in the text to be reviewed, wherein N>0, and the segmentation feature sequence includes: semantic features of each segmentation contained in the corresponding sentence; An updating unit, based on a self-attention mechanism, obtains, in each segmentation feature sequence, a feature correlation between each segmentation and at least one adjacent segmentation, and updates the semantic features of the corresponding segmentation using a segmentation weight generated based on at least one feature correlation corresponding to each segmentation, thereby obtaining updated feature sequences for each of the N clauses; The recognition unit performs semantic feature recognition on the N updated feature sequences using a trained text recognition model to obtain corresponding semantic recognition results, and selects, from the N obtained recognition results, sentences corresponding to the recognition results that meet preset emotion recognition conditions as sentences to be reviewed; The review unit refers to the preset shielded text and adopts a preset matching algorithm to perform text review on the sentence to be reviewed, obtains the text review result of the text to be reviewed, and shields the text to be reviewed or prompts the user.
11. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
12. A computer storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
13. A computer program product comprising computer program instructions, characterized in that When the computer program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.