Public opinion monitoring method and system
By combining BERT with emotional dictionary and deep learning model, the hidden emotional words in content generated by network users are identified, and the problem of hidden emotional words recognition in public opinion monitoring is solved, and the accuracy and efficiency of public opinion monitoring is improved.
Patent Information
- Application Number
- CN202411298736.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing public opinion monitoring technology is difficult to effectively identify the emotional tendency of network users to generate content by deliberately hiding emotional words, affecting the accuracy of emotional dictionary technology.
Emotional dictionary is used for preliminary emotion recognition, and emotional tendencies are judged based on user-generated content response data. If no obvious emotional words are identified and the content is subject to obvious response, in-depth emotion recognition is carried out through a BERT model based on deep learning, and feature data is extracted to identify Emotional tendency.
It realizes the accurate identification of contents of emotional words being deliberately hidden, reduces computing resources, improves the speed and accuracy of public opinion monitoring, and ensures the comprehensiveness and convenience of public opinion monitoring.
Smart Images

Figure CN119167928A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of public opinion monitoring, and in particular to a public opinion monitoring method and system. Background Art
[0002] With the full opening and popularization of the Internet, the majority of Internet users are not only the acquirers of Internet information, but also the main producers of Internet information. The Internet information released by Internet users on a certain event may have a certain tendency, and its display and dissemination may cause corresponding public opinion phenomena. Therefore, it is necessary to monitor the public opinion of Internet information.
[0003] A key task in public opinion monitoring is emotion recognition, which mainly refers to identifying the emotional tendencies of user-generated content such as instant messages and comments posted by Internet users. The most commonly used and convenient emotion recognition technology is the emotion dictionary technology, which can judge the emotional tendencies of user-generated content by identifying the emotion words in the user-generated content. However, when Internet users publish content, they are often influenced by the regulatory policies of relevant platforms or the Internet atmosphere, and they often deliberately hide some keywords, such as replacing certain keywords with emoticons, symbols, pinyin, abbreviations, homophones, etc. The above keywords also include emotion words. This deliberate hiding behavior will undoubtedly affect the emotion dictionary technology's recognition of emotion tendencies.
[0004] Therefore, how to achieve convenient, comprehensive and accurate public opinion monitoring is a technical problem that needs to be solved urgently. Summary of the invention
[0005] In order to solve the above-mentioned technical problems, the present invention provides a public opinion monitoring method and system, which can not only reduce computing resources and speed up recognition speed as much as possible, but also can specifically discover user-generated content in which sentiment words may be deliberately hidden, and effectively identify the sentiment tendency of user-generated content in which sentiment words are deliberately hidden, thereby facilitating convenient, comprehensive and accurate public opinion monitoring.
[0006] The technical solution adopted by the present invention is as follows: A method for monitoring public opinion comprises the following steps: obtaining user-generated content in text form on a network platform; performing preliminary emotion recognition on each user-generated content through an emotion dictionary; obtaining response data received by each user-generated content; judging the degree of response received by each user-generated content according to the response data received by each user-generated content, wherein the degree of response received includes receiving an obvious response and not receiving an obvious response; if positive emotion words or negative emotion words are recognized when performing preliminary emotion recognition on a certain user-generated content, determining the emotion tendency of the user-generated content according to the recognized positive emotion words and / or negative emotion words, Among them, the emotional tendency includes positive, negative and neutral; if no positive emotional words or negative emotional words are identified during the preliminary emotional recognition of a certain user-generated content, and the user-generated content does not receive a significant response, the emotional tendency of the user-generated content is determined to be neutral; if no positive emotional words or negative emotional words are identified during the preliminary emotional recognition of a certain user-generated content, and the user-generated content receives a significant response, in-depth emotional recognition is performed on the user-generated content through a deep learning-based emotional recognition model to obtain the emotional tendency of the user-generated content; public opinion results are obtained according to the emotional tendency of each of the user-generated contents.
[0007] The content of the network platform is crawled by a web crawler to obtain the user-generated content in text form.
[0008] The response data received by each user-generated content includes the sum of the number of likes, dislikes, comments, reposts, favorites, and reports of each user-generated content. The response data is compared with a preset threshold. If the response data is greater than the preset threshold, it is determined that the user-generated content has received a significant response; otherwise, it is determined that the user-generated content has not received a significant response.
[0009] The emotion recognition model based on deep learning is trained through the following steps: obtaining a plurality of sample contents in text form; hiding each of the sample contents word by word to obtain subsamples of the sample content one by one; labeling each of the sample contents and its multiple subsamples with emotional tendencies to obtain a training set, wherein each subsample has the same label as the sample content to which it belongs; and training the deep learning model with the training set to obtain the emotion recognition model based on deep learning.
[0010] The deep learning model is a BERT (Bidirectional Encoder Representations from Transformers) model with multiple levels of context encoding modules. The steps of feature extraction of the BERT model are: dividing a certain input content into at least one sentence according to the upper limit of the sentence length of the BERT model; obtaining the word vector of each sentence, and performing mean pooling on all the word vectors of the sentence to obtain the sentence vector of the sentence; performing mean pooling on all the sentence vectors of the input content to obtain the total vector of the input content; inputting the total vector into the context encoding modules of the multiple levels respectively, and outputting the feature data of the input content through the context encoding modules of the multiple levels.
[0011] A public opinion monitoring system comprises: a first acquisition module, the first acquisition module is used to acquire user-generated content in text form on a network platform; a first recognition module, the first recognition module is used to perform preliminary emotion recognition on each user-generated content through an emotion dictionary; a second acquisition module, the second acquisition module is used to acquire response data received by each user-generated content; a judgment module, the judgment module is used to judge the response degree of each user-generated content according to the response data received by each user-generated content, wherein the response degree includes receiving an obvious response and not receiving an obvious response; a first determination module, if positive emotion words or negative emotion words are identified during preliminary emotion recognition of a certain user-generated content, the first determination module determines the response degree of each user-generated content according to the identified positive emotion words and / or negative emotion words Determine the emotional tendency of the user-generated content, wherein the emotional tendency includes positive, negative and neutral; a second determination module, if no positive emotional words or negative emotional words are identified during the preliminary emotional recognition of a certain user-generated content, and the user-generated content does not receive a significant response, then the second determination module determines the emotional tendency of the user-generated content as neutral; a second recognition module, if no positive emotional words or negative emotional words are identified during the preliminary emotional recognition of a certain user-generated content, and the user-generated content receives a significant response, then the second recognition module performs in-depth emotional recognition on the user-generated content through an emotional recognition model based on deep learning to obtain the emotional tendency of the user-generated content; a third acquisition module, the third acquisition module is used to obtain public opinion results according to the emotional tendency of each of the user-generated contents.
[0012] The first acquisition module crawls the content of the network platform through a web crawler to obtain the user-generated content in text form.
[0013] The response data received by each user-generated content includes the sum of the number of likes, dislikes, comments, reposts, favorites, and reports of each user-generated content. The judgment module compares the response data with a preset threshold. If the response data is greater than the preset threshold, it is determined that the user-generated content has received a significant response; otherwise, it is determined that the user-generated content has not received a significant response.
[0014] The emotion recognition model based on deep learning is trained through the following steps: obtaining a plurality of sample contents in text form; hiding each of the sample contents word by word to obtain subsamples of the sample content one by one; labeling each of the sample contents and its multiple subsamples with emotional tendencies to obtain a training set, wherein each subsample has the same label as the sample content to which it belongs; and training the deep learning model with the training set to obtain the emotion recognition model based on deep learning.
[0015] The deep learning model is a BERT model with multiple levels of context encoding modules. The steps of feature extraction of the BERT model are: dividing a certain input content into at least one sentence according to the upper limit of the sentence length of the BERT model; obtaining the word vector of each sentence, and performing mean pooling on all the word vectors of the sentence to obtain the sentence vector of the sentence; performing mean pooling on all the sentence vectors of the input content to obtain the total vector of the input content; inputting the total vector into the context encoding modules of the multiple levels respectively, and outputting the feature data of the input content through the context encoding modules of the multiple levels.
[0016] Beneficial effects of the present invention: The present invention firstly performs preliminary emotion recognition on user-generated content in text form through a sentiment dictionary, and then combines the preliminary recognition situation and the response degree of the user-generated content to directly obtain the sentiment tendency, and performs in-depth sentiment recognition through a deep learning-based sentiment recognition model. As a result, compared with directly adopting deep learning technology, it can not only reduce computing resources and speed up recognition speed as much as possible, but also can specifically discover user-generated content in which sentiment words may be deliberately hidden, and effectively identify the sentiment tendency of user-generated content in which sentiment words are deliberately hidden, thereby facilitating convenient, comprehensive and accurate public opinion monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a flow chart of a method for monitoring public opinion according to an embodiment of the present invention; Figure 2 A block diagram of a public opinion monitoring system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0018] 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.
[0019] like Figure 1 As shown, the public opinion monitoring method of the embodiment of the present invention includes the following steps: S1, obtaining user-generated content in text form on a network platform.
[0020] The embodiments of the present invention can monitor public opinion on a certain, some, or all platforms in the entire network, and can also monitor public opinion on a certain topic or event. The content of the network platform can be crawled by a web crawler to obtain user-generated content in text form. Taking the public opinion monitoring of a certain topic as an example, user-generated content related to the topic on all platforms in the entire network can be obtained, such as user-generated content related to the topic on various news media platforms, social media platforms, live broadcast platforms, short video platforms, communities, and self-media platforms. The user-generated content in text form of the embodiment of the present invention may be originally in text form, such as text-based comments, or it may be obtained by converting user-generated content in the form of voice, pictures or videos into text, or by recognizing text in images and converting them into text.
[0021] S2, preliminary sentiment recognition is performed on each user-generated content through the sentiment dictionary.
[0022] Specifically, the sentiment words are obtained by matching the words in the sentiment dictionary with the words in the user-generated content, and the polarity of the sentiment words is determined to be positive sentiment words, negative sentiment words or neutral sentiment words.
[0023] S3, obtains the response data received by each user-generated content.
[0024] The responses to the user-generated content include the likes, dislikes, comments, reposts, favorites, reports, etc. of the user-generated content. In one embodiment of the present invention, the response data received by each user-generated content includes the sum of the number of likes, dislikes, comments, reposts, favorites, and reports of each user-generated content. The sum can be the total number of all the above responses or the weighted sum of all the above responses.
[0025] In a specific embodiment of the present invention, the response data received by each user-generated content can be calculated by the following formula: , in, RThe response data generated for a certain user, i.e., the weighted sum, n is the number of types of responses. In a specific embodiment n Take 6, which includes 6 responses: like, dislike, comment, forward, favorite, and report. α i For the i The weight coefficient of the response, N i For the i The weight coefficient of each response can be preset. In a specific embodiment, the weight coefficients of likes and dislikes can be 0.1, and the weight coefficients of comments, forwarding, collections, and reports can be 0.2.
[0026] S4, judging the response degree of each user-generated content according to the response data received by each user-generated content, wherein the response degree includes receiving an obvious response and not receiving an obvious response.
[0027] The response data may be compared with a preset threshold. If the response data is greater than the preset threshold, it is determined that the user-generated content has received an obvious response. Otherwise, it is determined that the user-generated content has not received an obvious response.
[0028] S5, if positive sentiment words or negative sentiment words are identified during the preliminary sentiment identification of a certain user-generated content, the sentiment tendency of the user-generated content is determined according to the identified positive sentiment words and / or negative sentiment words, wherein the sentiment tendency includes positive, negative and neutral.
[0029] When positive or negative sentiment words are identified, the existing sentiment dictionary recognition technology can be used to calculate the sentiment value of the user-generated content and judge the sentiment tendency through the sentiment polarity and sentiment value of the words.
[0030] S6: If no positive or negative sentiment words are identified during the initial sentiment identification of a certain user-generated content, and the user-generated content does not receive an obvious response, the sentiment tendency of the user-generated content is determined to be neutral.
[0031] S7, if no positive or negative sentiment words are identified during the initial sentiment recognition of a certain user-generated content, and the user-generated content receives an obvious response, then in-depth sentiment recognition is performed on the user-generated content through a deep learning-based sentiment recognition model to obtain the sentiment tendency of the user-generated content.
[0032] When no positive or negative sentiment words are identified, if the user-generated content does not receive an obvious response, it means that the user-generated content does not contain any sentiment words, or the polarity of the sentiment words are all neutral sentiment words, and the user-generated content will not and has not yet caused public opinion impact. At this time, its sentiment tendency can be directly determined as neutral; if the user-generated content receives an obvious response, it means that the user-generated content may contain deliberately hidden content, for example, a positive or negative sentiment word is hidden through expression replacement, symbol replacement, pinyin replacement, abbreviation replacement, homophone replacement, mosaic (for images), partial silencing (for voice), etc.
[0033] In the case where at least one positive sentiment word and / or negative sentiment word in user-generated content is deliberately hidden, the sentiment dictionary is obviously unable to accurately judge the sentiment tendency of the user-generated content, but deep learning technology still has a certain recognition and judgment ability.
[0034] Therefore, when no positive or negative sentiment words are identified during the initial emotion recognition, and the user-generated content receives a significant response, the user-generated content can be subjected to in-depth emotion recognition through an emotion recognition model based on deep learning to obtain the emotional tendency of the user-generated content.
[0035] In one embodiment of the present invention, the emotion tendency recognition based on the deep learning model can adopt the existing available technology. In order to further improve the accuracy of emotion tendency recognition, especially the accuracy of emotion tendency recognition of user-generated content with some content hidden in the embodiment of the present invention, another embodiment of the present invention also proposes an improved emotion tendency recognition method based on the deep learning model.
[0036] In this another embodiment of the present invention, the emotion recognition model based on deep learning can be trained by the following steps: obtaining multiple sample contents in text form; hiding each sample content word by word to obtain subsamples of the sample content one by one; labeling each sample content and its multiple subsamples with emotional tendencies to obtain a training set, wherein each subsample has the same label as the sample content to which it belongs; training the deep learning model with the training set to obtain an emotion recognition model based on deep learning.
[0037] The sample contents in multiple text forms obtained do not contain hidden content, and may be manually edited, or copied and processed from a network platform (for example, restoring pinyin to Chinese characters, restoring English abbreviations to original English text or corresponding Chinese characters, to ensure that they do not contain hidden content). These sample contents may be referred to as original samples. For each original sample, each word may be replaced with a random symbol from front to back, with only one word replaced each time, and the other words remaining unchanged. When the first word is replaced, the first subsample of the original sample is obtained, and when the second word is replaced, the second subsample of the original sample is obtained, and so on, until the last word is replaced to obtain the last subsample of the original sample. Random symbols may come from a pre-built random symbol library, which contains a variety of common symbols, such as common emoticons, mathematical symbols, special symbols, etc.
[0038] As a result, the trained deep learning-based sentiment recognition model can pay more attention to the overall structure of the full text, the relationship between the context and the sentiment tendency, and weaken the influence of a single word on the sentiment tendency, thereby improving the accuracy of sentiment tendency recognition of text content with hidden content.
[0039] It should be noted that the above-mentioned deep learning model and deep learning-based emotion recognition model are the names of the same model before and after training. In a specific embodiment of the present invention, both are BERT models, which have multiple levels of context encoding modules.
[0040] Furthermore, the steps of feature extraction of the BERT model are as follows: divide a certain input content into at least one sentence according to the upper limit of the sentence length of the BERT model; obtain the word vector of each sentence, and perform mean pooling on all the word vectors of the sentence to obtain the sentence vector of the sentence; perform mean pooling on all the sentence vectors of the input content to obtain the total vector of the input content; input the total vector into multiple levels of context encoding modules respectively, and output the feature data of the input content through multiple levels of context encoding modules.
[0041] The input content of the BERT model includes the sample content and sub-samples input during its training, as well as the user-generated content input during actual recognition. The upper limit of the sentence length of the BERT model refers to the maximum sentence length that it can handle, such as 512 characters. In the related technology, there is an enhanced version of the BERT model that can handle sentences larger than 512 characters, but it is also limited. Therefore, when the length of the input content of the embodiment of the present invention exceeds the upper limit of its sentence length, the input content can be split first. After the total vector of a certain input content is obtained through word vector extraction and related pooling processing, it is input into multi-level context coding modules. In sequence, the output of the context coding module of the previous level is used as the input of the context coding module of the next level, and finally the context coding module of the last level outputs the feature data of the input content.
[0042] Through the above-mentioned feature extraction design, the embodiment of the present invention is suitable for processing user-generated content or samples of any length; by utilizing multiple levels of context encoding modules, richer context information of the user-generated content or samples can be obtained, so that in the presence of hidden words, more emotional features can be obtained, thereby further improving the accuracy of emotional tendency recognition of the deep learning-based emotion recognition model.
[0043] S8, obtain the public opinion results according to the emotional tendency of each user-generated content.
[0044] The public opinion results may include the number, proportion, change trend, etc. of various sentiment tendencies (positive, negative and neutral) of all user-generated content. Based on the public opinion results, relevant departments or entities can understand the public opinion and implement corresponding public opinion-oriented management and other measures.
[0045] According to the public opinion monitoring method of the embodiment of the present invention, the sentiment dictionary is first used to perform preliminary sentiment recognition on the user-generated content in text form, and then, based on the preliminary recognition situation and the response degree of the user-generated content, some sentiment tendencies are directly obtained, and some are in-depth sentiment recognition is performed through a deep learning-based sentiment recognition model. As a result, compared with directly using deep learning technology, not only can the computing resources be reduced as much as possible and the recognition speed be accelerated, but also the user-generated content in which the sentiment words may be deliberately hidden can be discovered in a targeted manner, and the sentiment tendencies of the user-generated content in which the sentiment words are deliberately hidden can be effectively identified, thereby facilitating the realization of convenient, comprehensive and accurate public opinion monitoring.
[0046] Corresponding to the public opinion monitoring method of the above embodiment, the present invention also proposes a public opinion monitoring system.
[0047] like Figure 2As shown, the public opinion monitoring system of the embodiment of the present invention includes a first acquisition module 10, a first identification module 20, a second acquisition module 30, a judgment module 40, a first determination module 50, a second determination module 60, a second identification module 70 and a third acquisition module 80. Among them, the first acquisition module 10 is used to acquire user-generated content in text form on the network platform; the first identification module 20 is used to perform preliminary emotion recognition on each user-generated content through an emotion dictionary; the second acquisition module 30 is used to acquire response data received by each user-generated content; the judgment module 40 is used to judge the response degree of each user-generated content based on the response data received by each user-generated content, wherein the response degree includes receiving an obvious response and not receiving an obvious response; if positive emotion words or negative emotion words are identified when performing preliminary emotion recognition on a certain user-generated content, the first determination module 50 determines the emotional tendency of the user-generated content based on the identified positive emotion words and / or negative emotion words. , wherein the sentiment tendency includes positive, negative and neutral; if no positive sentiment words or negative sentiment words are identified during the preliminary sentiment recognition of a certain user-generated content, and the user-generated content does not receive a significant response, the second determination module 60 determines the sentiment tendency of the user-generated content as neutral; if no positive sentiment words or negative sentiment words are identified during the preliminary sentiment recognition of a certain user-generated content, and the user-generated content receives a significant response, the second recognition module 70 performs in-depth sentiment recognition on the user-generated content through a deep learning-based sentiment recognition model to obtain the sentiment tendency of the user-generated content; the third acquisition module 80 is used to obtain public opinion results according to the sentiment tendency of each user-generated content.
[0048] The embodiment of the present invention can monitor public opinion on a certain, some, or all platforms in the entire network, and can also monitor public opinion on a certain topic or event. The first acquisition module 10 can crawl the content of the network platform through a web crawler to obtain user-generated content in text form. Taking the public opinion monitoring of a certain topic as an example, the first acquisition module 10 can obtain user-generated content related to the topic on all platforms in the entire network, such as various news media platforms, social media platforms, live broadcast platforms, short video platforms, communities, and self-media platforms. The user-generated content in text form in the embodiment of the present invention may be originally in text form, such as text-based comments, or it may be obtained by the first acquisition module 10 converting user-generated content in the form of voice, pictures or videos into text, recognizing text in images and converting them into text.
[0049] The first recognition module 20 specifically obtains sentiment words by matching the words in the sentiment dictionary with the words in the user-generated content, and determines whether the polarity of the sentiment word belongs to a positive sentiment word, a negative sentiment word, or a neutral sentiment word.
[0050] The responses to the user-generated content include the likes, dislikes, comments, reposts, favorites, reports, etc. of the user-generated content. In one embodiment of the present invention, the response data received by each user-generated content includes the sum of the number of likes, dislikes, comments, reposts, favorites, and reports of each user-generated content. The sum can be the total number of all the above responses or the weighted sum of all the above responses.
[0051] In a specific embodiment of the present invention, the second acquisition module 30 can calculate the response data received by each user-generated content by the following formula: , in, R The response data generated for a certain user, i.e., the weighted sum, n is the number of types of responses. In a specific embodiment n Take 6, which includes 6 responses: like, dislike, comment, forward, favorite, and report. α i For the i The weight coefficient of the response, N i For the i The weight coefficient of each response can be preset. In a specific embodiment, the weight coefficients of likes and dislikes can be 0.1, and the weight coefficients of comments, forwarding, collections, and reports can be 0.2.
[0052] The determination module 40 may compare the response data with a preset threshold value. If the response data is greater than the preset threshold value, it is determined that the user-generated content has received an obvious response. Otherwise, it is determined that the user-generated content has not received an obvious response.
[0053] When positive or negative sentiment words are identified, the first determination module 50 may utilize existing sentiment dictionary recognition technology to calculate the sentiment value of the user-generated content and determine the sentiment tendency through the sentiment polarity and sentiment value of the words.
[0054] When no positive or negative sentiment words are identified, if the user-generated content does not receive an obvious response, it means that the user-generated content does not contain any sentiment words, or the polarity of the sentiment words are all neutral sentiment words, and the user-generated content will not and has not yet caused public opinion influence. At this time, the second determination module 60 can directly determine its sentiment tendency as neutral; if the user-generated content receives an obvious response, it means that the user-generated content may contain deliberately hidden content, for example, a positive or negative sentiment word is hidden through expression replacement, symbol replacement, pinyin replacement, abbreviation replacement, homophone replacement, mosaic (for images), local silencing (for voice), etc.
[0055] In the case where at least one positive sentiment word and / or negative sentiment word in user-generated content is deliberately hidden, the sentiment dictionary is obviously unable to accurately judge the sentiment tendency of the user-generated content, but deep learning technology still has a certain recognition and judgment ability.
[0056] Therefore, when no positive or negative emotional words are identified during the initial emotion recognition, and the user-generated content receives a significant response, the second recognition module 70 can perform in-depth emotion recognition on the user-generated content through an emotion recognition model based on deep learning to obtain the emotional tendency of the user-generated content.
[0057] In one embodiment of the present invention, the emotion tendency recognition based on the deep learning model can adopt the existing available technology. In order to further improve the accuracy of emotion tendency recognition, especially the accuracy of emotion tendency recognition of user-generated content with some content hidden in the embodiment of the present invention, another embodiment of the present invention also proposes an improved emotion tendency recognition method based on the deep learning model.
[0058] In this another embodiment of the present invention, the emotion recognition model based on deep learning can be trained by the following steps: obtaining multiple sample contents in text form; hiding each sample content word by word to obtain subsamples of the sample content one by one; labeling each sample content and its multiple subsamples with emotional tendencies to obtain a training set, wherein each subsample has the same label as the sample content to which it belongs; training the deep learning model with the training set to obtain an emotion recognition model based on deep learning.
[0059] The sample contents in multiple text forms obtained do not contain hidden content, and may be manually edited, or copied and processed from a network platform (for example, restoring pinyin to Chinese characters, restoring English abbreviations to original English text or corresponding Chinese characters, to ensure that they do not contain hidden content). These sample contents may be referred to as original samples. For each original sample, each word may be replaced with a random symbol from front to back, with only one word replaced each time, and the other words remaining unchanged. When the first word is replaced, the first subsample of the original sample is obtained, and when the second word is replaced, the second subsample of the original sample is obtained, and so on, until the last word is replaced to obtain the last subsample of the original sample. Random symbols may come from a pre-built random symbol library, which contains a variety of common symbols, such as common emoticons, mathematical symbols, special symbols, etc.
[0060] As a result, the trained deep learning-based sentiment recognition model can pay more attention to the overall structure of the full text, the relationship between the context and the sentiment tendency, and weaken the influence of a single word on the sentiment tendency, thereby improving the accuracy of sentiment tendency recognition of text content with hidden content.
[0061] It should be noted that the above-mentioned deep learning model and deep learning-based emotion recognition model are the names of the same model before and after training. In a specific embodiment of the present invention, both are BERT models, which have multiple levels of context encoding modules.
[0062] Furthermore, the steps of feature extraction of the BERT model are as follows: divide a certain input content into at least one sentence according to the upper limit of the sentence length of the BERT model; obtain the word vector of each sentence, and perform mean pooling on all the word vectors of the sentence to obtain the sentence vector of the sentence; perform mean pooling on all the sentence vectors of the input content to obtain the total vector of the input content; input the total vector into multiple levels of context encoding modules respectively, and output the feature data of the input content through multiple levels of context encoding modules.
[0063] The input content of the BERT model includes the sample content and sub-samples input during its training, as well as the user-generated content input during actual recognition. The upper limit of the sentence length of the BERT model refers to the maximum sentence length that it can handle, such as 512 characters. In the related technology, there is an enhanced version of the BERT model that can handle sentences larger than 512 characters, but it is also limited. Therefore, when the length of the input content of the embodiment of the present invention exceeds the upper limit of its sentence length, the input content can be split first. After the total vector of a certain input content is obtained through word vector extraction and related pooling processing, it is input into multi-level context coding modules. In sequence, the output of the context coding module of the previous level is used as the input of the context coding module of the next level, and finally the context coding module of the last level outputs the feature data of the input content.
[0064] Through the above-mentioned feature extraction design, the embodiment of the present invention is suitable for processing user-generated content or samples of any length; by utilizing multiple levels of context encoding modules, richer context information of the user-generated content or samples can be obtained, so that in the presence of hidden words, more emotional features can be obtained, thereby further improving the accuracy of emotional tendency recognition of the deep learning-based emotion recognition model.
[0065] The public opinion results obtained by the third acquisition module 80 may include the number, proportion, change trend, etc. of various sentiment tendencies (positive, negative and neutral) of all user-generated content. Based on the public opinion results, relevant departments or entities can understand the public opinion and implement corresponding public opinion guidance management and other measures.
[0066] According to the public opinion monitoring system of the embodiment of the present invention, a preliminary emotion recognition is first performed on the user-generated content in text form through a sentiment dictionary, and then based on the preliminary recognition situation and the response degree of the user-generated content, some emotional tendencies are directly obtained, and some are in-depth emotional recognition is performed through a deep learning-based emotion recognition model. As a result, compared with directly adopting deep learning technology, not only can the computing resources be reduced as much as possible and the recognition speed be accelerated, but also the user-generated content in which the sentiment words may be deliberately hidden can be discovered in a targeted manner, and the sentiment tendencies of the user-generated content in which the sentiment words are deliberately hidden can be effectively identified, thereby facilitating the realization of convenient, comprehensive and accurate public opinion monitoring.
[0067] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. "Multiple" means two or more, unless otherwise clearly and specifically defined.
[0068] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0069] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0070] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0071] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0072] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0073] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0074] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0075] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0076] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for monitoring public opinion, characterized in that: The following steps are involved: Access to user-generated content in text form on online platforms; Performing preliminary sentiment recognition on each user-generated content using a sentiment dictionary; Obtaining response data received by each user-generated content; Determining the degree of response of each user-generated content according to the response data received by each user-generated content, wherein the degree of response includes receiving an obvious response and not receiving an obvious response; If positive sentiment words or negative sentiment words are identified during the preliminary sentiment identification of a certain user-generated content, the sentiment tendency of the user-generated content is determined according to the identified positive sentiment words and / or negative sentiment words, wherein the sentiment tendency includes positive, negative and neutral; If no positive or negative sentiment words are identified during the initial sentiment recognition of a certain user-generated content, and the user-generated content does not receive an obvious response, the sentiment tendency of the user-generated content is determined to be neutral; If no positive or negative sentiment words are identified during the initial sentiment recognition of a certain user-generated content, and the user-generated content receives a significant response, the user-generated content is subjected to in-depth sentiment recognition through a deep learning-based sentiment recognition model to obtain the sentiment tendency of the user-generated content; The public opinion results are obtained according to the sentiment tendency of each user-generated content.
2. The method for monitoring public opinion according to claim 1, characterized in that: The content of the network platform is crawled by a web crawler to obtain the user-generated content in text form.
3. The method for monitoring public opinion according to claim 1, characterized in that: The response data received by each user-generated content includes the sum of the number of likes, dislikes, comments, reposts, favorites, and reports of each user-generated content. The response data is compared with a preset threshold. If the response data is greater than the preset threshold, it is determined that the user-generated content has received a significant response; otherwise, it is determined that the user-generated content has not received a significant response.
4. The method for monitoring public opinion according to claim 1, characterized in that: The emotion recognition model based on deep learning is trained by the following steps: Get multiple sample contents in text form; Performing word-by-word concealment processing on each of the sample contents to obtain sub-samples of the sample contents one by one; Labeling the sentiment tendency of each sample content and its multiple sub-samples respectively to obtain a training set, wherein each sub-sample has the same label as the sample content to which it belongs; The deep learning model is trained using the training set to obtain the emotion recognition model based on deep learning.
5. The method for monitoring public opinion according to claim 4, characterized in that: The deep learning model is a BERT model with multiple levels of context encoding modules, and the steps of feature extraction of the BERT model are as follows: Divide an input content into at least one sentence according to the upper limit of the sentence length of the BERT model; Get the word vector of each sentence, and perform mean pooling on all the word vectors of the sentence to get the sentence vector of the sentence; All sentence vectors of the input content are averaged and pooled to obtain the total vector of the input content; The total vector is input into the context coding modules of the multiple levels respectively, and the feature data of the input content is output through the context coding modules of the multiple levels.
6. A public opinion monitoring system, characterized in that: include: A first acquisition module, the first acquisition module is used to acquire user-generated content in text form on the network platform; A first recognition module, the first recognition module is used to perform preliminary emotion recognition on each user-generated content through an emotion dictionary; A second acquisition module, the second acquisition module is used to acquire response data received by each user-generated content; A judgment module, the judgment module is used to judge the response degree of each user-generated content according to the response data received by each user-generated content, wherein the response degree includes receiving an obvious response and not receiving an obvious response; A first determination module, if a positive sentiment word or a negative sentiment word is identified during preliminary sentiment identification of a certain user-generated content, the first determination module determines the sentiment tendency of the user-generated content according to the identified positive sentiment word and / or negative sentiment word, wherein the sentiment tendency includes positive, negative and neutral; A second determination module, wherein if no positive or negative sentiment words are identified during the initial sentiment identification of a certain user-generated content, and the user-generated content does not receive an obvious response, the second determination module determines the sentiment tendency of the user-generated content as neutral; The second recognition module, if no positive or negative sentiment words are recognized during the preliminary sentiment recognition of a certain user-generated content, and the user-generated content receives an obvious response, then the second recognition module performs in-depth sentiment recognition on the user-generated content through a deep learning-based sentiment recognition model to obtain the sentiment tendency of the user-generated content; The third acquisition module is used to obtain public opinion results according to the emotional tendency of each user-generated content.
7. The public opinion monitoring system according to claim 6, characterized in that: The first acquisition module crawls the content of the network platform through a web crawler to obtain the user-generated content in text form.
8. The public opinion monitoring system according to claim 6, characterized in that: The response data received by each user-generated content includes the sum of the number of likes, dislikes, comments, reposts, favorites, and reports of each user-generated content. The judgment module compares the response data with a preset threshold. If the response data is greater than the preset threshold, it is determined that the user-generated content has received a significant response; otherwise, it is determined that the user-generated content has not received a significant response.
9. The public opinion monitoring system according to claim 6, characterized in that: The emotion recognition model based on deep learning is trained by the following steps: Get multiple sample contents in text form; Performing word-by-word concealment processing on each of the sample contents to obtain sub-samples of the sample contents one by one; Labeling the sentiment tendency of each sample content and its multiple sub-samples respectively to obtain a training set, wherein each sub-sample has the same label as the sample content to which it belongs; The deep learning model is trained using the training set to obtain the emotion recognition model based on deep learning.
10. The public opinion monitoring system according to claim 9, characterized in that: The deep learning model is a BERT model with multiple levels of context encoding modules, and the steps of feature extraction of the BERT model are as follows: Divide an input content into at least one sentence according to the upper limit of the sentence length of the BERT model; Get the word vector of each sentence, and perform mean pooling on all the word vectors of the sentence to get the sentence vector of the sentence; All sentence vectors of the input content are averaged and pooled to obtain the total vector of the input content; The total vector is input into the context coding modules of the multiple levels respectively, and the feature data of the input content is output through the context coding modules of the multiple levels.
