Public opinion risk identification method and device, electronic equipment and storage medium
By performing natural language processing on WeChat group chat content, using pre-trained risk identification model and risk identification model trained by historical public opinion text data, identifying and determining the type and level of public opinion risk, the efficiency and accuracy of public opinion risk identification in the existing technology are solved. The problem of low results enables more efficient and accurate monitoring of public opinion risks.
Patent Information
- Application Number
- CN202411493043.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, the efficiency and accuracy of public opinion risks are low, and it is difficult to adapt to the rapid pace of public opinion changes in modern environments.
By obtaining the text data to be identified, input it into the first risk identification model and the second risk identification model, the public opinion risk identification results are respectively output, and the final identification results are judged based on the risk type and level. The first risk identification model is obtained based on historical public opinion text data and pre-trained risk identification model.
It improves the efficiency and accuracy of identifying public opinion risks, can adapt to changes in public opinion more quickly, and reduces the risks to corporate brand image and legal disputes.
Smart Images

Figure CN119441480A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing technology, and in particular to a method, device, electronic device and storage medium for identifying public opinion risks. Background Art
[0002] In recent years, with the rapid development of mobile Internet, social media platforms have become the main channel for people to communicate and share information in daily life. WeChat groups have become an important position for brand communication and customer service due to their convenient group management and broad user base. More and more companies are adopting this novel way to conduct business. However, the openness and instant messaging characteristics of WeChat groups also bring challenges to the management of negative public opinion. For example, politically sensitive remarks, consumer complaints, fierce conflicts between members, and unauthorized commercial advertisements and other negative public opinions, if not managed in a timely and effective manner, may not only damage the corporate brand image, but also cause legal disputes and cause immeasurable losses to the company. Traditional manual monitoring methods have problems such as low efficiency and low accuracy in identifying public opinion risks, and are difficult to adapt to the rapid pace of public opinion changes in the modern environment. Summary of the invention
[0003] The purpose of the present invention is to provide a method, device, electronic device and storage medium for identifying public opinion risks, so as to solve the technical problems of low efficiency and low accuracy in identifying public opinion risks in the prior art.
[0004] The technical solution of the present invention is as follows, which provides a method for identifying public opinion risks, including:
[0005] Obtaining text data to be recognized;
[0006] Input the text data to be identified into a first risk identification model, and after being processed by the first risk identification model, output a first public opinion risk identification result, wherein the first public opinion risk identification result includes a first public opinion risk type and a first public opinion risk level, and the first risk identification model is trained based on historical public opinion text data and a pre-trained risk identification model;
[0007] Inputting the text data to be identified into a second risk identification model corresponding to the first public opinion risk type, and outputting a second public opinion risk identification result after being processed by the second risk identification model, wherein the second public opinion risk identification result includes a second public opinion risk type and a second public opinion risk level;
[0008] If the first public opinion risk type and the second public opinion risk type are the same, and the first public opinion risk level is greater than the second public opinion risk level, the first public opinion risk identification result shall be used as the final public opinion risk identification result; if the first public opinion risk type and the second public opinion risk type are the same, and the first public opinion risk level is not greater than the second public opinion risk level, the second public opinion risk identification result shall be used as the final public opinion risk identification result.
[0009] Furthermore, the step of training the first risk identification model based on historical public opinion text data and a pre-trained risk identification model includes:
[0010] Acquire the annotated historical public opinion text, and form the historical public opinion text data according to the annotated historical public opinion text;
[0011] The parameters of the pre-trained risk identification model are adjusted by a prefix adjustment method to obtain an adjusted pre-trained risk identification model, and the adjusted pre-trained risk identification model is trained using the historical public opinion text data to obtain the first risk identification model.
[0012] Furthermore, the method of adjusting the parameters of the pre-trained risk identification model by prefix adjustment includes:
[0013] A token is constructed as a prefix, and parameters of the prefix are updated to adjust the parameters of the pre-trained risk identification model.
[0014] Further, the adjusted pre-trained risk identification model is trained using the historical public opinion text data, including:
[0015] Determine the task definition content, the input of the adjusted pre-trained risk identification model and the output of the adjusted pre-trained risk identification model according to the historical public opinion text data, and train the adjusted pre-trained risk identification model according to the task definition content, the input and the output.
[0016] Furthermore, the first public opinion risk type includes a political risk type, a complaint risk type, a fierce conflict risk type or a micro-business advertising risk type, and the second public opinion risk type includes a political risk type, a complaint risk type, a fierce conflict risk type or a micro-business advertising risk type.
[0017] Furthermore, the second risk identification model corresponding to the first public opinion risk type is a machine learning model corresponding to a political risk type, a complaint risk type, a fierce conflict risk type or a micro-business advertising risk type.
[0018] Furthermore, the public opinion risk identification method also includes: if the public opinion risk level corresponding to the final public opinion risk identification result is greater than the preset public opinion risk level, a public opinion risk warning is issued.
[0019] Another technical solution of the present invention is as follows: a public opinion risk identification device is also provided, including a data acquisition module, a first identification module, a second identification module and a risk determination module;
[0020] The data acquisition module is used to acquire the text data to be recognized;
[0021] The first identification module is used to input the text data to be identified into a first risk identification model, and after being processed by the first risk identification model, output a first public opinion risk identification result, wherein the first public opinion risk identification result includes a first public opinion risk type and a first public opinion risk level, and the first risk identification model is trained based on historical public opinion text data and a pre-trained risk identification model;
[0022] The second identification module is used to input the text data to be identified into a second risk identification model corresponding to the first public opinion risk type, and after being processed by the second risk identification model, output a second public opinion risk identification result, wherein the second public opinion risk identification result includes a second public opinion risk type and a second public opinion risk level;
[0023] The risk determination module is used to use the first public opinion risk identification result as the final public opinion risk identification result when the first public opinion risk type and the second public opinion risk type are the same and the first public opinion risk level is greater than the second public opinion risk level; and to use the second public opinion risk identification result as the final public opinion risk identification result when the first public opinion risk type and the second public opinion risk type are the same and the first public opinion risk level is not greater than the second public opinion risk level.
[0024] Another technical solution of the present invention is as follows: an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, the method for identifying public opinion risks as described in any of the above technical solutions is implemented.
[0025] Another technical solution of the present invention is as follows: a computer-readable storage medium is also provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for identifying public opinion risks as described in any technical solution is implemented.
[0026] The beneficial effects of the present invention are as follows: obtaining text data to be identified; inputting the text data to be identified into a first risk identification model, and after being processed by the first risk identification model, outputting a first public opinion risk identification result, the first public opinion risk identification result including a first public opinion risk type and a first public opinion risk level, the first risk identification model being trained based on historical public opinion text data and a pre-trained risk identification model; inputting the text data to be identified into a second risk identification model corresponding to the first public opinion risk type, and after being processed by the second risk identification model, outputting a second public opinion risk identification result, the second public opinion risk identification result including a second public opinion risk type and a second public opinion risk level; if the first public opinion risk type and the second public opinion risk type are the same, and the first public opinion risk level is greater than the second public opinion risk level, then the first public opinion risk identification result is used as the final public opinion risk identification result; if the first public opinion risk type and the second public opinion risk type are the same, and the first public opinion risk level is not greater than the second public opinion risk level, then the second public opinion risk identification result is used as the final public opinion risk identification result; through the above technical solution, the efficiency and accuracy of public opinion risk identification can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic diagram of a process for identifying public opinion risks provided by an embodiment of the present invention;
[0028] Figure 2 A schematic diagram of the structure of a public opinion risk identification device provided by an embodiment of the present invention;
[0029] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] In the description of this application, the words "first", "second", etc. are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order. In this specification, the terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0032] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0033] Figure 1 is a flow chart of the method for identifying public opinion risks according to an embodiment of the present invention. It should be noted that if there are substantially the same results, the method for identifying public opinion risks according to the present invention is not limited to Figure 1 The process sequence shown is limited. Figure 1 As shown, the public opinion risk identification method mainly includes the following steps:
[0034] S101, obtaining text data to be recognized;
[0035] In some embodiments, the FLINK real-time computing framework can be used to obtain group chat content, and natural language processing technology can be used to perform data cleaning, word segmentation and part-of-speech tagging on the group chat content to obtain text data to be identified, wherein data cleaning can include the identification and removal of personal information such as telephone numbers, license plates, vehicle frames, ID cards, conversion of uppercase and lowercase letters, conversion of simplified and traditional Chinese characters, and deletion of continuous punctuation marks, etc.
[0036] S102, inputting the text data to be identified into a first risk identification model, and outputting a first public opinion risk identification result after being processed by the first risk identification model, wherein the first public opinion risk identification result includes a first public opinion risk type and a first public opinion risk level, and the first risk identification model is trained based on historical public opinion text data and a pre-trained risk identification model;
[0037] In an optional implementation, the step of training the first risk identification model based on historical public opinion text data and a pre-trained risk identification model includes:
[0038] Acquire the annotated historical public opinion text, and form the historical public opinion text data according to the annotated historical public opinion text;
[0039] The parameters of the pre-trained risk identification model are adjusted by a prefix adjustment method to obtain an adjusted pre-trained risk identification model, and the adjusted pre-trained risk identification model is trained using the historical public opinion text data to obtain the first risk identification model.
[0040] In some embodiments, the above-mentioned pre-trained risk identification model can be a pre-trained large language model based on the Transformer architecture, for example, BERT. The pre-trained risk identification model does not require initial training. The pre-trained risk identification model has the function of semantic analysis, but the pre-trained risk identification model needs to be adjusted (fine-tuned). Since full parameter fine-tuning consumes a lot of computing resources, the pre-trained risk identification model can be adjusted in a parameter-efficient fine-tuning manner. Specifically, the parameters of the pre-trained risk identification model can be adjusted by the prefix adjustment method.
[0041] The embodiment of the present invention obtains the annotated historical public opinion text and forms historical public opinion text data according to the annotated historical public opinion text; adjusts the parameters of the pre-trained risk identification model by a prefix adjustment method to obtain an adjusted pre-trained risk identification model; and uses the historical public opinion text data to train the adjusted pre-trained risk identification model to obtain a first risk identification model, so that the first risk identification model has the ability to accurately identify public opinion risks, thereby improving the accuracy of public opinion risk identification.
[0042] In an optional implementation, the method of adjusting the parameters of the pre-trained risk identification model by prefix adjustment includes:
[0043] A token is constructed as a prefix, and parameters of the prefix are updated to adjust the parameters of the pre-trained risk identification model.
[0044] In some embodiments, a prefix adjustment method is used to construct a token as a prefix, and the parameters of the prefix are changed while other parameters of the pre-trained risk identification model remain unchanged to adjust the parameters of the pre-trained risk identification model.
[0045] In an embodiment of the present invention, a token is constructed as a prefix, and the parameters of the prefix are updated to adjust the parameters of the pre-trained risk identification model, which can improve the training efficiency of the pre-trained risk identification model and improve the accuracy of the first risk identification model in identifying public opinion risks.
[0046] In an optional implementation, the adjusted pre-trained risk identification model is trained using the historical public opinion text data, including:
[0047] Determine the task definition content, the input of the adjusted pre-trained risk identification model and the output of the adjusted pre-trained risk identification model according to the historical public opinion text data, and train the adjusted pre-trained risk identification model according to the task definition content, the input and the output.
[0048] In some embodiments, the above-mentioned historical public opinion text data is processed to determine the task definition content, the input of the adjusted pre-trained risk identification model and the output of the adjusted pre-trained risk identification model. For example, the task definition content may include "You are a public opinion risk detection expert. There are four types of public opinion risks, namely political risks, complaint risks, fierce conflicts and micro-business advertisements. Please distinguish which type of public opinion risk the following chat content belongs to, and output the public opinion risk level. The level reflects the urgency of public opinion and takes values between 1-10. The larger the level, the higher the level." The above-mentioned input may include "Do you still need to ask me such a low-level question?", and the output may include "fierce conflict, the public opinion risk level is 6". The adjusted pre-trained risk identification model can be trained according to the task definition content, input and output.
[0049] In an embodiment of the present invention, task definition content, input of an adjusted pre-trained risk identification model and output of the adjusted pre-trained risk identification model are determined based on historical public opinion text data, and the adjusted pre-trained risk identification model is trained based on the task definition content, input and output. The first risk identification model thus obtained can accurately identify public opinion risks, thereby improving the accuracy of public opinion risk identification.
[0050] S103, inputting the text data to be identified into a second risk identification model corresponding to the first public opinion risk type, and outputting a second public opinion risk identification result after being processed by the second risk identification model, wherein the second public opinion risk identification result includes a second public opinion risk type and a second public opinion risk level;
[0051] In an optional implementation, the first public opinion risk type includes a political risk type, a complaint risk type, a fierce conflict risk type or a micro-business advertising risk type, and the second public opinion risk type includes a political risk type, a complaint risk type, a fierce conflict risk type or a micro-business advertising risk type.
[0052] In some embodiments, the text data to be identified is input into a first risk identification model, and after being processed by the first risk identification model, a first public opinion risk identification result is output. If the first public opinion risk type in the first public opinion risk identification result includes a political risk type, then the text data to be identified corresponds to a political risk; if the first public opinion risk type includes other public opinion risk types, then the text data to be identified corresponds to a public opinion risk.
[0053] In an embodiment of the present invention, by making the first public opinion risk type include a political risk type, a complaint risk type, a fierce conflict risk type or a micro-business advertising risk type, and making the second public opinion risk type include a political risk type, a complaint risk type, a fierce conflict risk type or a micro-business advertising risk type, the first risk identification model and the second risk identification model can identify different public opinion risks such as political risks, complaint risks, fierce conflict risks or micro-business advertising risks.
[0054] In an optional implementation, the second risk identification model corresponding to the first public opinion risk type is a machine learning model corresponding to a political risk type, a complaint risk type, a fierce conflict risk type, or a micro-business advertising risk type.
[0055] In some embodiments, since the first public opinion risk type includes a political risk type, a complaint risk type, an intense conflict risk type, or a micro-business advertising risk type, the second risk identification model corresponding to the first public opinion risk type needs to identify political risk, complaint risk, intense conflict risk, or micro-business advertising risk. When the first public opinion risk type includes a political risk type, the second risk identification model is a machine learning model corresponding to the political risk type. The machine learning model can be a classifier, specifically a classifier based on keywords and context understanding. The classifier is trained by using historical public opinion text data corresponding to political risks, so that the classifier can identify text data to be identified involving politically sensitive topics. When the first public opinion risk type is a complaint risk type, the second risk identification model is a machine learning model corresponding to the complaint risk type. The machine learning model can also be a classifier or its machine learning model. The machine learning model is trained by using historical public opinion text data corresponding to complaint risks, so that the machine learning model can identify text data to be identified involving consumer dissatisfaction and complaint expressions. Similar to the above, when the first public opinion risk type is a fierce conflict risk type, the second risk identification model is a machine learning model corresponding to the fierce conflict risk type. By using the historical public opinion text data corresponding to the fierce conflict risk, the machine learning model is trained so that the machine learning model can identify the text data to be identified involving potential conflicts between group members. When the first public opinion risk type is a micro-business advertising risk type, the second risk identification model is a machine learning model corresponding to the micro-business advertising risk type. By using the historical public opinion text data corresponding to the micro-business advertising risk, the machine learning model is trained so that the machine learning model can identify the text data to be identified involving unauthorized commercial promotion information.
[0056] S104: If the first public opinion risk type and the second public opinion risk type are the same, and the first public opinion risk level is greater than the second public opinion risk level, the first public opinion risk identification result is used as the final public opinion risk identification result; if the first public opinion risk type and the second public opinion risk type are the same, and the first public opinion risk level is not greater than the second public opinion risk level, the second public opinion risk identification result is used as the final public opinion risk identification result.
[0057] In some embodiments, if the first public opinion risk type and the second public opinion risk type are different, it indicates that there may be controversy in the public opinion risk, and no public opinion risk warning is temporarily issued. If the first public opinion risk type and the second public opinion risk type are the same, the public opinion risk identification result with a higher risk level is taken as the final public opinion risk identification result.
[0058] In an embodiment of the present invention, when the first public opinion risk type and the second public opinion risk type are the same, taking the public opinion risk identification result with a larger risk level as the final public opinion risk identification result can further improve the accuracy of public opinion risk identification.
[0059] In an optional implementation, the public opinion risk identification method further includes: if the public opinion risk level corresponding to the final public opinion risk identification result is greater than the preset public opinion risk level, then issuing a public opinion risk warning.
[0060] In some embodiments, the preset public opinion risk level can be determined according to actual conditions, taking into account the urgency, scope of impact and potential danger of public opinion. For example, half of the maximum public opinion risk level is taken. If the public opinion risk level corresponding to the final public opinion risk identification result is greater than the preset public opinion risk level, a public opinion risk warning is issued. Otherwise, no public opinion risk warning is issued.
[0061] In the embodiment of the present invention, when the public opinion risk level corresponding to the final public opinion risk identification result is greater than the preset public opinion risk level, a public opinion risk warning is issued, which can avoid false public opinion risk warnings and improve the effectiveness of the warning.
[0062] The public opinion risk identification method provided by the embodiment of the present invention obtains text data to be identified; inputs the text data to be identified into a first risk identification model, and after being processed by the first risk identification model, outputs a first public opinion risk identification result, wherein the first public opinion risk identification result includes a first public opinion risk type and a first public opinion risk level, and the first risk identification model is obtained by training based on historical public opinion text data and a pre-trained risk identification model; inputs the text data to be identified into a second risk identification model corresponding to the first public opinion risk type, and after being processed by the second risk identification model, outputs a second public opinion risk identification result, wherein the second public opinion risk identification result includes a second public opinion risk type and a second public opinion risk level; if the first public opinion risk type and the second public opinion risk type are the same, and the first public opinion risk level is greater than the second public opinion risk level, then the first public opinion risk identification result is used as the final public opinion risk identification result; if the first public opinion risk type and the second public opinion risk type are the same, and the first public opinion risk level is not greater than the second public opinion risk level, then the second public opinion risk identification result is used as the final public opinion risk identification result; the efficiency and accuracy of public opinion risk identification can be improved.
[0063] The public opinion risk identification method provided by the embodiment of the present invention can be constructed based on artificial intelligence, and relevant data can be acquired and processed based on artificial intelligence technology to realize unattended artificial intelligence public opinion risk identification. Among them, 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.
[0064] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0065] The embodiment of the present invention provides a public opinion risk identification device, Figure 2 2 is a schematic diagram of the structure of a public opinion risk identification device according to an embodiment of the present invention. The public opinion risk identification device 20 includes a data acquisition module 21, a first identification module 22, a second identification module 23 and a risk determination module 24;
[0066] The data acquisition module 21 is used to acquire text data to be recognized;
[0067] The first identification module 22 is used to input the text data to be identified into a first risk identification model, and after being processed by the first risk identification model, output a first public opinion risk identification result, wherein the first public opinion risk identification result includes a first public opinion risk type and a first public opinion risk level, and the first risk identification model is trained based on historical public opinion text data and a pre-trained risk identification model;
[0068] The second identification module 23 is used to input the text data to be identified into a second risk identification model corresponding to the first public opinion risk type, and after being processed by the second risk identification model, output a second public opinion risk identification result, wherein the second public opinion risk identification result includes a second public opinion risk type and a second public opinion risk level;
[0069] The risk determination module 24 is used to use the first public opinion risk identification result as the final public opinion risk identification result when the first public opinion risk type and the second public opinion risk type are the same and the first public opinion risk level is greater than the second public opinion risk level; and to use the second public opinion risk identification result as the final public opinion risk identification result when the first public opinion risk type and the second public opinion risk type are the same and the first public opinion risk level is not greater than the second public opinion risk level.
[0070] In an optional embodiment, the public opinion risk identification device 20 also includes a model training module, which is used to obtain the historical public opinion text after annotation, and form the historical public opinion text data based on the annotated historical public opinion text; adjust the parameters of the pre-trained risk identification model by a prefix adjustment method to obtain an adjusted pre-trained risk identification model, and use the historical public opinion text data to train the adjusted pre-trained risk identification model to obtain the first risk identification model.
[0071] In an optional embodiment, the model training module adjusts the parameters of the pre-trained risk identification model by a prefix adjustment method, including: constructing a token as a prefix, updating the parameters of the prefix to adjust the parameters of the pre-trained risk identification model.
[0072] In an optional embodiment, the model training module uses the historical public opinion text data to train the adjusted pre-trained risk identification model, including: determining the task definition content, the input of the adjusted pre-trained risk identification model and the output of the adjusted pre-trained risk identification model according to the historical public opinion text data, and training the adjusted pre-trained risk identification model according to the task definition content, the input and the output.
[0073] In an optional implementation, the first public opinion risk type includes a political risk type, a complaint risk type, a fierce conflict risk type or a micro-business advertising risk type, and the second public opinion risk type includes a political risk type, a complaint risk type, a fierce conflict risk type or a micro-business advertising risk type.
[0074] In an optional implementation, the second risk identification model corresponding to the first public opinion risk type is a machine learning model corresponding to a political risk type, a complaint risk type, a fierce conflict risk type, or a micro-business advertising risk type.
[0075] In an optional embodiment, the public opinion risk identification device 20 also includes an early warning module, which is used to issue a public opinion risk early warning when the public opinion risk level corresponding to the final public opinion risk identification result is greater than a preset public opinion risk level.
[0076] The public opinion risk identification device provided by the embodiment of the present invention obtains text data to be identified; inputs the text data to be identified into a first risk identification model, and after being processed by the first risk identification model, outputs a first public opinion risk identification result, wherein the first public opinion risk identification result includes a first public opinion risk type and a first public opinion risk level, and the first risk identification model is obtained by training based on historical public opinion text data and a pre-trained risk identification model; inputs the text data to be identified into a second risk identification model corresponding to the first public opinion risk type, and after being processed by the second risk identification model, outputs a second public opinion risk identification result, wherein the second public opinion risk identification result includes a second public opinion risk type and a second public opinion risk level; if the first public opinion risk type and the second public opinion risk type are the same, and the first public opinion risk level is greater than the second public opinion risk level, the first public opinion risk identification result is used as the final public opinion risk identification result; if the first public opinion risk type and the second public opinion risk type are the same, and the first public opinion risk level is not greater than the second public opinion risk level, the second public opinion risk identification result is used as the final public opinion risk identification result; the efficiency and accuracy of public opinion risk identification can be improved.
[0077] An embodiment of the present invention provides an electronic device, Figure 3 1 is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. The electronic device 30 includes a processor 31 and a memory 32 which is in communication with the processor 31 .
[0078] The memory 32 stores program instructions for implementing the public opinion risk identification method of any of the above embodiments.
[0079] The processor 31 is used to execute program instructions stored in the memory 32 to identify public opinion risks.
[0080] The processor 31 may also be referred to as a CPU (Central Processing Unit). The processor 31 may be an integrated circuit chip having signal processing capabilities. The processor 31 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0081] An embodiment of the present invention provides a storage medium, and the storage medium of the embodiment of the present invention stores program instructions that can implement all the above-mentioned public opinion risk identification methods, and the storage medium can be non-volatile or volatile. Among them, the program instructions can be stored in the above-mentioned storage medium in the form of a software product, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk, etc., which can store program codes, or terminal devices such as computers, servers, mobile phones, and tablets.
[0082] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0083] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software functional unit. The above is only an implementation mode of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the specification and drawings of the present invention, or directly or indirectly used in other related technical fields, is also included in the patent protection scope of the present invention.
[0084] The above description is only an implementation mode of the present invention. It should be pointed out that, for ordinary technicians in this field, improvements can be made without departing from the creative concept of the present invention, but these all belong to the protection scope of the present invention.
Claims
1. A method for identifying public opinion risks, characterized in that: include: Obtaining text data to be recognized; Input the text data to be identified into a first risk identification model, and after being processed by the first risk identification model, output a first public opinion risk identification result, wherein the first public opinion risk identification result includes a first public opinion risk type and a first public opinion risk level, and the first risk identification model is trained based on historical public opinion text data and a pre-trained risk identification model; Inputting the text data to be identified into a second risk identification model corresponding to the first public opinion risk type, and outputting a second public opinion risk identification result after being processed by the second risk identification model, wherein the second public opinion risk identification result includes a second public opinion risk type and a second public opinion risk level; If the first public opinion risk type and the second public opinion risk type are the same, and the first public opinion risk level is greater than the second public opinion risk level, the first public opinion risk identification result shall be used as the final public opinion risk identification result; if the first public opinion risk type and the second public opinion risk type are the same, and the first public opinion risk level is not greater than the second public opinion risk level, the second public opinion risk identification result shall be used as the final public opinion risk identification result.
2. The method for identifying public opinion risks according to claim 1, characterized in that: The step of training the first risk identification model according to the historical public opinion text data and the pre-trained risk identification model includes: Acquire the annotated historical public opinion text, and form the historical public opinion text data according to the annotated historical public opinion text; The parameters of the pre-trained risk identification model are adjusted by a prefix adjustment method to obtain an adjusted pre-trained risk identification model, and the adjusted pre-trained risk identification model is trained using the historical public opinion text data to obtain the first risk identification model.
3. The method for identifying public opinion risks according to claim 2, characterized in that: The method of adjusting the parameters of the pre-trained risk identification model by prefix adjustment includes: A token is constructed as a prefix, and parameters of the prefix are updated to adjust the parameters of the pre-trained risk identification model.
4. The method for identifying public opinion risks according to claim 2, characterized in that: The adjusted pre-trained risk identification model is trained using the historical public opinion text data, including: Determine the task definition content, the input of the adjusted pre-trained risk identification model and the output of the adjusted pre-trained risk identification model according to the historical public opinion text data, and train the adjusted pre-trained risk identification model according to the task definition content, the input and the output.
5. The method for identifying public opinion risks according to claim 1, characterized in that: The first public opinion risk type includes a political risk type, a complaint risk type, a fierce conflict risk type or a micro-business advertising risk type, and the second public opinion risk type includes a political risk type, a complaint risk type, a fierce conflict risk type or a micro-business advertising risk type.
6. The method for identifying public opinion risks according to claim 5, characterized in that: The second risk identification model corresponding to the first public opinion risk type is a machine learning model corresponding to a political risk type, a complaint risk type, a fierce conflict risk type, or a micro-business advertising risk type.
7. The method for identifying public opinion risks according to claim 1, characterized in that: The public opinion risk identification method also includes: if the public opinion risk level corresponding to the final public opinion risk identification result is greater than the preset public opinion risk level, a public opinion risk warning is issued.
8. A public opinion risk identification device, characterized in that: It includes a data acquisition module, a first identification module, a second identification module and a risk determination module; The data acquisition module is used to acquire the text data to be recognized; The first identification module is used to input the text data to be identified into a first risk identification model, and after being processed by the first risk identification model, output a first public opinion risk identification result, wherein the first public opinion risk identification result includes a first public opinion risk type and a first public opinion risk level, and the first risk identification model is trained based on historical public opinion text data and a pre-trained risk identification model; The second identification module is used to input the text data to be identified into a second risk identification model corresponding to the first public opinion risk type, and after being processed by the second risk identification model, output a second public opinion risk identification result, wherein the second public opinion risk identification result includes a second public opinion risk type and a second public opinion risk level; The risk determination module is used to use the first public opinion risk identification result as the final public opinion risk identification result when the first public opinion risk type and the second public opinion risk type are the same and the first public opinion risk level is greater than the second public opinion risk level; and to use the second public opinion risk identification result as the final public opinion risk identification result when the first public opinion risk type and the second public opinion risk type are the same and the first public opinion risk level is not greater than the second public opinion risk level.
9. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program executable by the processor, wherein: When the processor executes the computer program, the method for identifying public opinion risks as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for identifying public opinion risks as described in any one of claims 1 to 7 is implemented.