Network public opinion monitoring method, device and equipment and storage medium
By using the BERT-CBAM emotion classification model and the TF-IDF algorithm, the problem of low accuracy and efficiency of network public opinion monitoring technology is solved, and accurate identification and early warning of negative public opinion is achieved, and the efficiency and accuracy of public opinion monitoring are improved.
Patent Information
- Application Number
- CN202410953125.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-12-17
AI Technical Summary
The accuracy and efficiency of existing online public opinion monitoring technologies have been low, resulting in slow responses in the face of emergencies and inability to detect or deal with negative public opinion in a timely manner, leading to the expansion of the crisis.
The pre-trained BERT-CBAM emotion classification model is used to combine the TF-IDF algorithm to obtain network public opinion data for emotional classification, screen negative public opinion keywords, and achieve accurate monitoring and early warning of public opinion through heat calculation and early warning mechanism.
It improves the efficiency and accuracy of online public opinion monitoring, can timely identify and warn of negative public opinion, avoid further expansion, and achieve accurate grasp and early warning of the public opinion situation.
Smart Images

Figure CN119149802A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a network public opinion monitoring method, device, equipment and storage medium. Background Art
[0002] With the continuous development of Internet technology and the rise of new media, everyone can become a publisher and disseminator of information, which makes public opinion have explosive growth and unpredictable diffusion speed. If it is not guided well, negative online public opinion will pose a greater threat to social public security. In recent years, due to the low accuracy and efficiency of public opinion monitoring, many companies have suffered a lot in the face of emergencies because they did not discover them in time or handled them improperly. There are also greater crises caused by not taking avoidance measures when public opinion first appeared. Therefore, it is necessary to invent a network public opinion monitoring method to solve the above problems. Summary of the invention
[0003] Embodiments of the present disclosure provide a method, apparatus, device and storage medium for monitoring online public opinion.
[0004] In a first aspect, an embodiment of the present disclosure provides a method for monitoring online public opinion, the method comprising:
[0005] Obtain online public opinion data;
[0006] Inputting the network public opinion data into a pre-trained sentiment classification model to obtain a sentiment classification result;
[0007] Based on the TF-IDF algorithm, keywords are screened for online public opinion data with negative sentiment classification results to generate public opinion feature keywords;
[0008] The heat calculation is performed based on the public opinion characteristic keywords, and the heat ranking and early warning of the public opinion are performed.
[0009] In some implementations of the first aspect, the pre-trained sentiment classification model is a BERT-CBAM model;
[0010] The pre-trained sentiment classification model is trained by the following steps:
[0011] Obtain historical online public opinion data;
[0012] Performing sentiment annotation on the historical network public opinion data to generate a training sample set;
[0013] The BERT-CBAM model is trained according to the training sample set to obtain a sentiment classification model.
[0014] In some implementations of the first aspect, training the BERT-CBAM model according to the training sample set includes:
[0015] The BERT-CBAM model is trained using semi-supervised learning.
[0016] In some implementations of the first aspect, the BERT-CBAM model is based on the BERT pre-trained model and includes a text encoding layer, an attention focusing layer, and an output layer, wherein:
[0017] The text encoding layer is responsible for converting short text into a vector matrix through the BERT encoder;
[0018] The attention focusing layer extracts deep semantics and key features from the vector matrix through CAM and SAM combined with convolutional neural network;
[0019] The output layer is composed of a fully connected layer plus a Softmax function, and the sentiment classification result is obtained from the key features;
[0020] The BERT pre-training model is obtained by pre-training the BERT model based on the training sample set.
[0021] In some implementations of the first aspect, the keyword screening of the network public opinion data with negative sentiment classification results based on the TF-IDF algorithm to generate public opinion feature keywords includes:
[0022] Calculate the text word frequency TF and inverse document frequency IDF of the online public opinion data with negative sentiment classification results, and obtain the TF-IDF value of each word;
[0023] Arrange in descending order by TF-IDF value, and take the first n keywords as public opinion feature keywords, where n is a positive integer greater than or equal to 1.
[0024] In some possible implementations of the first aspect, performing heat calculation based on the public opinion feature keywords, and performing heat ranking and early warning of public opinion includes:
[0025] Calculate the popularity of the public opinion feature keywords obtained within a preset time period, and sort them in descending order according to the popularity calculation results, and select the top n public opinion feature keywords among them, where n is a positive integer greater than or equal to 1;
[0026] According to the selected public opinion feature keywords, select the corresponding network public opinion data;
[0027] Quantify and sort the selected online public opinion data;
[0028] When the heat index of a certain network public opinion data is greater than or equal to the preset threshold, an early warning will be issued.
[0029] In some implementations of the first aspect, the method further includes:
[0030] The heat ranking and early warning situations are analyzed, and the report describes the public opinion status and performs a visual display of the public opinion monitoring status.
[0031] In a second aspect, an embodiment of the present disclosure provides a network public opinion monitoring device, the device comprising:
[0032] Data acquisition module, used to obtain network public opinion data;
[0033] The sentiment classification module is used to input the network public opinion data into a pre-trained sentiment classification model to obtain a sentiment classification result;
[0034] The feature extraction module is used to perform keyword screening on online public opinion data with negative sentiment classification results based on the TF-IDF algorithm to generate public opinion feature keywords;
[0035] The monitoring and early warning module is used to calculate the heat based on the public opinion feature keywords, and to sort the heat of the public opinion and issue early warnings.
[0036] In a third aspect, an embodiment of the present disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described above.
[0037] In a fourth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause a computer to execute the method described above.
[0038] In the embodiments of the present disclosure, firstly, sentiment classification of online public opinion data can be performed based on the sentiment classification model. Secondly, the TF-IDF algorithm can be used to perform keyword screening on the online public opinion data with negative sentiment classification results. Finally, the public opinion heat calculation method can be used to quantify and sort the heat of each online public opinion data to determine the negative public opinion information that needs to be dealt with urgently, thereby improving the monitoring efficiency. When the heat index of a certain online public opinion data is greater than or equal to a preset threshold, an early warning is issued to avoid further expansion of negative public opinion, thereby achieving accurate grasp and early warning of the public opinion situation.
[0039] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, among which:
[0041] Figure 1 A flowchart of a network public opinion monitoring method provided by an embodiment of the present disclosure is shown;
[0042] Figure 2 A structural diagram of a network public opinion monitoring device provided by an embodiment of the present disclosure is shown;
[0043] Figure 3 A structural diagram of an exemplary electronic device capable of implementing an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0045] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0046] In view of the problems in the background technology, the present disclosure provides a network public opinion monitoring method, device, equipment and storage medium. Specifically, network public opinion data is obtained; the network public opinion data is input into a pre-trained sentiment classification model to obtain sentiment classification results; based on the TF-IDF algorithm, keyword screening is performed on network public opinion data with negative sentiment classification results to generate public opinion feature keywords; based on the public opinion feature keywords, heat calculation is performed to sort the heat of public opinion and give early warning.
[0047] In this way, firstly, we can classify the online public opinion data based on the sentiment classification model, and secondly, we can use the TF-IDF algorithm to perform keyword screening on the online public opinion data with negative sentiment classification results. Finally, we can use the public opinion heat calculation method to quantify and sort the heat of each online public opinion data, judge the negative public opinion information that needs to be dealt with urgently, improve the monitoring efficiency, and issue a warning when the heat index of a certain online public opinion data is greater than or equal to the preset threshold to avoid further expansion of negative public opinion, thereby achieving accurate grasp and warning of the public opinion situation.
[0048] In conjunction with the accompanying drawings, a network public opinion monitoring method, device, equipment and storage medium provided by the embodiments of the present disclosure are described in detail below through specific embodiments.
[0049] Figure 1 A flowchart of a network public opinion detection method provided by an embodiment of the present disclosure is shown. Figure 1 As shown, the network public opinion detection method 100 may include the following steps:
[0050] S110, obtaining online public opinion data.
[0051] Exemplarily, online public opinion data can be obtained from various types of media through web crawlers and / or APIs, including social media, news websites, forums, private domain portals and other platforms. After obtaining a certain amount of public opinion data, the public opinion data is cleaned and standardized, including removing irrelevant information (such as URLs, tags, irrelevant symbols, etc.), converting uppercase and lowercase, and word segmentation. For a small amount of English data, the NLTK tool is used for word segmentation and standardization; for most Chinese data, tools such as jieba are used for word segmentation to avoid interference with public opinion analysis, facilitate subsequent public opinion sentiment analysis and keyword extraction, and complete the preprocessing of public opinion data.
[0052] S120, inputting the network public opinion data into a pre-trained sentiment classification model to obtain a sentiment classification result.
[0053] In some embodiments, the pre-trained sentiment classification model is a BERT-CBAM model;
[0054] The pre-trained sentiment classification model is trained by the following steps:
[0055] Obtain historical online public opinion data;
[0056] Performing sentiment annotation on the historical network public opinion data to generate a training sample set;
[0057] The BERT-CBAM model is trained according to the training sample set to obtain a sentiment classification model.
[0058] The BERT-CBAM model is trained using semi-supervised learning.
[0059] The BERT-CBAM model is based on the BERT pre-trained model, including a text encoding layer, an attention focus layer, and an output layer.
[0060] The text encoding layer is responsible for converting short text into a vector matrix through the BERT encoder;
[0061] The attention focusing layer extracts deep semantics and key features from the vector matrix through CAM and SAM combined with convolutional neural network;
[0062] The output layer is composed of a fully connected layer plus a Softmax function, and the sentiment classification result is obtained from the key features;
[0063] The BERT pre-training model is obtained by pre-training the BERT model based on the training sample set.
[0064] S130, based on the TF-IDF algorithm, keyword screening is performed on the network public opinion data with negative sentiment classification results to generate public opinion feature keywords.
[0065] In some embodiments, by calculating the text word frequency TF and inverse document frequency IDF of the network public opinion data whose sentiment classification result is negative, the TF-IDF value of each word is obtained;
[0066] Arrange in descending order by TF-IDF value, and take the first n keywords as public opinion feature keywords, where n is a positive integer greater than or equal to 1.
[0067] S140, performing heat calculation based on the public opinion characteristic keywords, and performing heat ranking and early warning of the public opinion.
[0068] In some embodiments, the public opinion characteristic keywords obtained within a preset time period are heat-calculated, and are arranged in descending order according to the heat calculation results, and the top n public opinion characteristic keywords are selected, where n is a positive integer greater than or equal to 1;
[0069] According to the selected public opinion feature keywords, select the corresponding network public opinion data;
[0070] Quantify and sort the selected online public opinion data;
[0071] When the heat index of a certain network public opinion data is greater than or equal to the preset threshold, an early warning will be issued.
[0072] In the embodiments of the present disclosure, firstly, sentiment classification of online public opinion data can be performed based on the sentiment classification model. Secondly, the TF-IDF algorithm can be used to perform keyword screening on the online public opinion data with negative sentiment classification results. Finally, the public opinion heat calculation method can be used to quantify and sort the heat of each online public opinion data to determine the negative public opinion information that needs to be dealt with urgently, thereby improving the monitoring efficiency. When the heat index of a certain online public opinion data is greater than or equal to a preset threshold, an early warning is issued to avoid further expansion of negative public opinion, thereby achieving accurate grasp and early warning of the public opinion situation.
[0073] In some embodiments, for ease of management, the network public opinion detection method 100 may further include:
[0074] The heat ranking and early warning situations are analyzed, and the report describes the public opinion status and performs a visual display of the public opinion monitoring status.
[0075] The network public opinion detection method 100 provided by the embodiment of the present disclosure is described in detail below in conjunction with a specific embodiment, as shown below:
[0076] Step 1: Obtain online public opinion data from various types of media through web crawlers and / or APIs, including social media, news websites, forums, private domain portals and other platforms; after obtaining a certain amount of online public opinion data, clean and standardize the online public opinion data, including removing irrelevant information (such as URLs, tags, irrelevant symbols, etc.), converting uppercase and lowercase, and word segmentation. For a small amount of English data, use NLTK tools for word segmentation and standardization; for most Chinese data, use tools such as jieba for word segmentation to avoid interference with public opinion analysis, facilitate subsequent online public opinion sentiment analysis and keyword extraction, and complete the preprocessing of online public opinion data.
[0077] Step 2: Input the pre-processed online public opinion data into the pre-trained sentiment classification model, which includes a text encoding layer, an attention focus layer, and an output layer. The pre-processed online public opinion data is converted into a vector matrix by the BERT encoder in the text encoding layer;
[0078] In the attention focus layer, CAM and SAM are combined with convolutional neural networks to extract deep semantics and key features from the vector matrix;
[0079] In the output layer, classification prediction is performed through a fully connected layer plus a Softmax function to obtain the sentiment classification results from the key features.
[0080] Step 3: Calculate the text word frequency TF and inverse document frequency IDF of the online public opinion data with negative sentiment classification results, and obtain the TF-IDF value of each word; sort them in descending order according to the TF-IDF value, and use the top n keywords as public opinion feature keywords, where n is a positive integer greater than or equal to 1. The specific implementation steps of the algorithm are as follows:
[0081] 1) Calculate word frequency TF
[0082]
[0083] Term frequency is abbreviated as TF, which indicates the number of times a word appears in a paragraph or a text. TF(x) represents the frequency of word x, and the total number of words in the text is recorded as N.
[0084] 2) Calculate the inverse document frequency IDF
[0085]
[0086] Inverse document frequency is usually referred to as IDF. In order to calculate IDF, the entire corpus needs to be calculated. The corpus consists of multiple texts. IDF(x) represents the inverse document frequency of word x. The total number of texts in the corpus is recorded as A, and the number of texts containing the word is recorded as B.
[0087] From the above formula, we can see that if a word is more common, the denominator is larger, and the IDF(x) is smaller and closer to 0. To avoid the denominator being 0 (that is, all documents do not contain the word), the denominator is increased by 1. The larger the IDF(x), the more concentrated the distribution of this characteristic in the text, indicating that the word x has a stronger ability to distinguish the attributes of the text content.
[0088] 3) Calculate TF-IDF
[0089] The term frequency and inverse document frequency of word x will be obtained, and the TF-IDF of word x will be calculated:
[0090] TF-IDF=TF(x)*IDF(x) (3)
[0091] It can be seen that TF-IDF is proportional to the number of times x appears in a document, and inversely proportional to the number of times a word appears in the entire language. Therefore, automatic keyword extraction is to calculate the TF-IDF value of each word in the document, then sort them in descending order, and take the top n keywords as public opinion feature keywords.
[0092] Step 4: Calculate the heat of the public opinion feature keywords obtained within the preset time period, and arrange them in descending order according to the heat calculation results, select the top n public opinion feature keywords, where n is a positive integer greater than or equal to 1; select the corresponding network public opinion data according to the selected public opinion feature keywords; quantify and sort the heat of the selected network public opinion data; issue an early warning when the heat index of a certain network public opinion data is greater than or equal to the preset threshold. The method for calculating the heat of public opinion is as follows:
[0093] The crowd interaction heat score S can be based on
[0094] S=K1*A-K2*D+… (4)
[0095] Calculated, where K i is the interaction score weight, A is the number of likes, and D is the number of dislikes.
[0096] The heat decay formula is
[0097] T i =e(k*(t1-t0)),i=0,1,…,n (5)
[0098] Where k is the cooling coefficient, t1 is the current time, and t0 is the message publishing time.
[0099] Single message text heat score H i Can be based on
[0100]
[0101] Calculated, where S0 is the initial heat score, S is the crowd interaction heat score, T i is the heat decay value of the i-th text in a text set.
[0102] The heat score H of all message texts related to this keyword can be based on
[0103] H=H1+H2+…+H n (7)
[0104] Through the public opinion heat calculation method, the heat of the text involved in each keyword is quantified and sorted. Then, when the heat index of a certain network public opinion data is greater than or equal to the preset threshold, an early warning is issued to provide a reference for subsequent processing by relevant departments.
[0105] Step 5: Analyze the popularity ranking and warning status, describe the public opinion status in the report and visualize the public opinion monitoring status.
[0106] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0107] The above is an introduction to the method embodiment. The following is a further explanation of the scheme disclosed in the present invention through an apparatus embodiment.
[0108] Figure 2 The structure diagram of a network public opinion monitoring device provided by an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the network public opinion monitoring device 200 may include:
[0109] Data acquisition module 210, used to acquire network public opinion data;
[0110] The sentiment classification module 220 is used to input the network public opinion data into a pre-trained sentiment classification model to obtain a sentiment classification result;
[0111] Feature extraction module 230, for performing keyword screening on network public opinion data with negative sentiment classification results based on TF-IDF algorithm to generate public opinion feature keywords;
[0112] The monitoring and early warning module 240 is used to calculate the heat based on the public opinion feature keywords, and perform heat ranking and early warning of public opinion.
[0113] In some embodiments, the sentiment classification model is trained by the following steps:
[0114] Obtain historical online public opinion data;
[0115] Performing sentiment annotation on the historical network public opinion data to generate a training sample set;
[0116] The BERT-CBAM model is trained according to the training sample set to obtain a sentiment classification model.
[0117] In some embodiments, the sentiment classification module 220 is specifically used to:
[0118] The BERT-CBAM model is trained using semi-supervised learning.
[0119] In some embodiments, the sentiment classification module 220 is specifically used to:
[0120] The BERT pre-trained model is used as the basic model of the BERT-CBAM model, including a text encoding layer, an attention focusing layer, and an output layer.
[0121] The text encoding layer is responsible for converting short text into a vector matrix through the BERT encoder;
[0122] The attention focusing layer extracts deep semantics and key features from the vector matrix through CAM and SAM combined with convolutional neural network;
[0123] The output layer is composed of a fully connected layer plus a Softmax function, and the sentiment classification result is obtained from the key features;
[0124] The BERT pre-training model is obtained by pre-training the BERT model based on training samples.
[0125] In some embodiments, the feature extraction module 230 is specifically used to:
[0126] Calculate the text word frequency TF and inverse document frequency IDF of the online public opinion data with negative sentiment classification results, and obtain the TF-IDF value of each word;
[0127] Arrange in descending order by TF-IDF value, and take the first n keywords as public opinion feature keywords, where n is a positive integer greater than or equal to 1.
[0128] In some embodiments, the monitoring and early warning module 240 is specifically used to:
[0129] Calculate the popularity of the public opinion feature keywords obtained within a preset time period, and sort them in descending order according to the popularity calculation results, and select the top n public opinion feature keywords among them, where n is a positive integer greater than or equal to 1;
[0130] According to the selected public opinion feature keywords, select the corresponding network public opinion data;
[0131] Quantify and sort the selected online public opinion data;
[0132] When the heat index of a certain network public opinion data is greater than or equal to the preset threshold, an early warning will be issued.
[0133] In some embodiments, the network public opinion monitoring device 200 further includes:
[0134] The visualization display module is used to analyze the heat ranking and warning situation, report the public opinion status and perform a visualization display of the public opinion monitoring status.
[0135] Understandably, Figure 2 Each module / unit in the network public opinion monitoring device 200 shown has the function of realizing Figure 1 The functions of each step in the network public opinion monitoring method 100 shown and its corresponding technical effects can be achieved, which will not be described here for the sake of brevity.
[0136] Figure 3 A block diagram of an exemplary electronic device capable of implementing an embodiment of the present disclosure is shown. The electronic device 300 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 300 may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0137] like Figure 3 As shown, the electronic device 300 may include a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 may also be stored. The computing unit 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0138] A number of components in the electronic device 300 are connected to the I / O interface 305, including: an input unit 306, such as a keyboard, a mouse, etc.; an output unit 307, such as various types of displays, speakers, etc.; a storage unit 308, such as a disk, an optical disk, etc.; and a communication unit 309, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 309 allows the electronic device 300 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0139] The computing unit 301 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 301 performs the various methods and processes described above, such as method 100. For example, in some embodiments, the method 100 may be implemented as a computer program product, including a computer program, which is tangibly contained in a computer-readable medium, such as a storage unit 308. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 300 via the ROM 302 and / or the communication unit 309. When the computer program is loaded into the RAM 303 and executed by the computing unit 301, one or more steps of the method 100 described above may be performed. Alternatively, in other embodiments, the computing unit 301 may be configured to perform the method 100 in any other appropriate manner (e.g., by means of firmware).
[0140] The various embodiments described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs, which may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general programmable processor, which may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0141] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0142] In the context of the present disclosure, a computer-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a computer-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 foregoing.
[0143] It should be noted that the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute method 100 and achieve the corresponding technical effect achieved by the embodiments of the present disclosure executing the method. For the sake of brevity, they are not repeated here.
[0144] In addition, the present disclosure also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method 100 is implemented.
[0145] To provide interaction with a user, the above-described embodiments may be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0146] The embodiments described above can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0147] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0148] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0149] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A network public opinion monitoring method, characterized in that: include: Obtain online public opinion data; Inputting the network public opinion data into a pre-trained sentiment classification model to obtain a sentiment classification result; Based on the TF-IDF algorithm, keywords are screened for online public opinion data with negative sentiment classification results to generate public opinion feature keywords; The heat calculation is performed based on the public opinion characteristic keywords, and the heat ranking and early warning of the public opinion are performed.
2. The method according to claim 1, wherein: The pre-trained sentiment classification model is a BERT-CBAM model; The pre-trained sentiment classification model is trained by the following steps: Obtain historical online public opinion data; Performing sentiment annotation on the historical network public opinion data to generate a training sample set; The BERT-CBAM model is trained according to the training sample set to obtain a sentiment classification model.
3. The method according to claim 2, characterized in that The training of the BERT-CBAM model according to the training sample set includes: The BERT-CBAM model is trained using semi-supervised learning.
4. The method according to claim 2, characterized in that: The BERT-CBAM model is based on the BERT pre-trained model, including a text encoding layer, an attention focus layer, and an output layer. The text encoding layer is responsible for converting short text into a vector matrix through the BERT encoder; The attention focusing layer extracts deep semantics and key features from the vector matrix through CAM and SAM combined with convolutional neural network; The output layer is composed of a fully connected layer plus a Softmax function, and the sentiment classification result is obtained from the key features; The BERT pre-training model is obtained by pre-training the BERT model based on the training sample set.
5. The method according to claim 1, characterized in that The keyword screening of the network public opinion data with negative sentiment classification results based on the TF-IDF algorithm to generate public opinion feature keywords includes: Calculate the text word frequency TF and inverse document frequency IDF of the online public opinion data with negative sentiment classification results, and obtain the TF-IDF value of each word; Arrange in descending order by TF-IDF value, and take the first n keywords as public opinion feature keywords, where n is a positive integer greater than or equal to 1.
6. The method according to claim 1, characterized in that The heat calculation based on the public opinion feature keywords, the heat ranking and early warning of the public opinion include: Calculate the popularity of the public opinion feature keywords obtained within a preset time period, and sort them in descending order according to the popularity calculation results, and select the top n public opinion feature keywords among them, where n is a positive integer greater than or equal to 1; According to the selected public opinion feature keywords, select the corresponding network public opinion data; Quantify and sort the selected online public opinion data; When the heat index of a certain network public opinion data is greater than or equal to the preset threshold, an early warning will be issued.
7. The method according to claim 1, characterized in that The method further comprises: The heat ranking and early warning situations are analyzed, and the report describes the public opinion status and performs a visual display of the public opinion monitoring status.
8. A network public opinion monitoring device, characterized in that: include: Data acquisition module, used to obtain network public opinion data; The sentiment classification module is used to input the network public opinion data into a pre-trained sentiment classification model to obtain a sentiment classification result; The feature extraction module is used to perform keyword screening on online public opinion data with negative sentiment classification results based on the TF-IDF algorithm to generate public opinion feature keywords; The monitoring and early warning module is used to calculate the heat based on the public opinion feature keywords, and to sort the heat of the public opinion and issue early warnings.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
Citation Information
Patent Citations
Network public opinion monitoring method, device and storage medium
CN109145216A
Entity-level affective classification method based on convolution attention mechanism network
CN109213868A
Public opinion monitoring method and public opinion monitoring system
CN115017302A
Online public opinion real-time monitoring system and method based on artificial intelligence
CN115438180A
Public opinion analysis and arrangement system based on AIGC
CN115982473A
Cited By
Public opinion clustering method and system in brokerage credit comment scene, electronic equipment and medium
CN119322850A
