Method, device and equipment for determining emotional tendency of network user and storage medium

CN115270807BActive Publication Date: 2026-09-18NAT COMP NETWORK & INFORMATION SECURITY MANAGEMENT CENT +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210764771.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2026-09-18
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

而在开源社交媒体中,网络用户对舆论事件发表的评论通常与舆论事件的背景知识存在关联,当前消息的理解依赖于舆论事件整体的背景知识,因此现有方法难以捕捉网络用户的真实观点,对网络用户情感倾向的判定不准确

Benefits of technology

[0048] The technical solution provided in this disclosure has the following advantages compared with the prior art:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115270807B_ABST
    Figure CN115270807B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method and device for determining the emotional tendency of a network user, an apparatus and a storage medium, wherein the method comprises: obtaining first comment information of a network user commenting on a target event, and second comment information of an object commenting on the target event; constructing a knowledge graph of the target event according to the first comment information; performing emotional analysis on the second comment information based on the knowledge graph to obtain a first emotional tendency value; and determining the emotional tendency of the object for the target event based on at least the first emotional tendency value. The present disclosure uses the comments of the whole network user to construct a knowledge graph as the background knowledge base of the target event, and performs emotional analysis on the comments of the network user of the target object by combining the background knowledge of the target event, and then determines the emotional tendency, so that the determination of the emotional tendency of the network user is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and in particular to a method, apparatus, device, and storage medium for determining the sentiment tendency of network users. Background Technology

[0002] With the development of social media, more and more people are posting their comments on events on social media, and these comments usually represent the users' stance and emotions.

[0003] When conducting public opinion event investigations and analyses on open-source social media, it is necessary to infer the sentiment of online users towards specific events. Existing methods mainly focus on semantic analysis and inference based on the content of individual comments posted by a single user. However, in open-source social media, online users' comments on public opinion events are usually related to their background knowledge of the events. Understanding the current message depends on the overall background knowledge of the public opinion event. Therefore, existing methods struggle to capture the true opinions of online users and are inaccurate in determining their sentiment. Summary of the Invention

[0004] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, this disclosure provides a method, apparatus, device and storage medium for determining the sentiment tendency of network users.

[0005] Firstly, this disclosure provides a method for determining the sentiment tendency of internet users, including:

[0006] Obtain first comment information from network users regarding the target event, and second comment information from the object regarding the target event;

[0007] Construct a knowledge graph of the target event based on the first comment information;

[0008] Based on the knowledge graph, sentiment analysis is performed on the second comment information to obtain a first sentiment tendency value;

[0009] Based at least on the first sentiment tendency value, the object's sentiment tendency toward the target event is determined.

[0010] Optionally, the method further includes:

[0011] Sentiment analysis is performed on the second comment information based on the stance detection model to obtain a second sentiment tendency value. The stance detection model is trained based on the first comment information.

[0012] Determining the object's emotional tendency towards the target event, based at least on the first emotional tendency value, includes:

[0013] Based on the first sentiment tendency value and the second sentiment tendency value, the sentiment tendency of the object towards the target event is determined.

[0014] Optionally, the method further includes:

[0015] Obtain at least one third comment related to the target event that was subjected to the target operation by the object;

[0016] Sentiment analysis is performed on each third comment to obtain a third sentiment tendency value corresponding to each third comment. A weighted average of the third sentiment tendency values ​​is then performed to obtain a fourth sentiment tendency value.

[0017] Determining the object's emotional tendency towards the target event, based at least on the first emotional tendency value, includes:

[0018] Based on the first sentiment tendency value and the fourth sentiment tendency value, the sentiment tendency of the object towards the target event is determined.

[0019] Optionally, before determining the object's sentiment towards the target event based at least on the first sentiment tendency value, the method further includes:

[0020] Obtain at least one fourth comment information of the object on the target event, wherein the fourth comment information is historical comment information preceding the second comment information;

[0021] The degree of association between the fourth comment information and the second comment information is determined based on the knowledge graph, and the degree is used as the association coefficient of the fourth comment information;

[0022] The average correlation coefficient is obtained by weighting the correlation coefficients of the fourth comment information;

[0023] The first sentiment tendency value is corrected based on the average correlation coefficient to obtain the corrected first sentiment tendency value;

[0024] Determining the object's emotional tendency towards the target event, based at least on the first emotional tendency value, includes:

[0025] The object's emotional tendency toward the target event is determined based at least on the modified first sentiment value.

[0026] Optionally, the stance detection model includes a stance target detection sub-model, a stance topic detection sub-model, and a stance sentiment detection sub-model;

[0027] The sentiment analysis of the second comment information based on the stance detection model to obtain a second sentiment tendency value includes:

[0028] Based on the aforementioned stance target detection sub-model, the stance target is determined according to the second comment information;

[0029] Based on the aforementioned stance topic detection sub-model, the stance topic of the stance target is determined according to the second comment information;

[0030] Based on the aforementioned stance sentiment detection sub-model, the sentiment intensity of the stance topic is determined according to the second comment information;

[0031] The second sentiment tendency value is determined based on the stated position objective, the stated position theme, and the stated sentiment intensity.

[0032] Secondly, this disclosure provides a device for determining the sentiment tendency of network users, comprising:

[0033] The acquisition module acquires first comment information from network users regarding the target event, and second comment information from the object regarding the target event;

[0034] The processing module is used to construct a knowledge graph of the target event based on the first comment information;

[0035] The analysis module is used to perform sentiment analysis on the second comment information based on the knowledge graph to obtain a first sentiment tendency value;

[0036] The determination module is used to determine the object's emotional tendency toward the target event based at least on the first emotional tendency value.

[0037] Optionally, the analysis module is further configured to perform sentiment analysis on the second comment information based on the stance detection model to obtain a second sentiment tendency value, wherein the stance detection model is trained based on the first comment information;

[0038] When the determination module determines the object's emotional tendency toward the target event based at least on the first emotional tendency value, it is specifically used to determine the object's emotional tendency toward the target event based on the first emotional tendency value and the second emotional tendency value.

[0039] Optionally, the acquisition module is further configured to acquire at least one third comment information related to the target event from which the target operation is performed by the object;

[0040] The analysis module is also used to perform sentiment analysis on each third comment information to obtain a third sentiment tendency value corresponding to each third comment information, and to perform a weighted average on the third sentiment tendency values ​​to obtain a fourth sentiment tendency value.

[0041] The determination module determines the object's emotional tendency toward the target event based at least on the first emotional tendency value, specifically based on the first emotional tendency value and the fourth emotional tendency value.

[0042] Thirdly, this disclosure provides an electronic device, including:

[0043] Memory;

[0044] Processor; and

[0045] Computer programs;

[0046] The computer program is stored in the memory and configured to be executed by the processor to implement the method as described in the first aspect.

[0047] Fourthly, this disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0048] The technical solution provided in this disclosure has the following advantages compared with the prior art:

[0049] The method, apparatus, device, and storage medium for determining the sentiment tendency of network users disclosed herein construct a knowledge graph of the target event by acquiring the first comment information of network users on the target event. Based on the knowledge graph, sentiment analysis is performed on the second comment information published by the target. The second comment information can be supplemented by the background knowledge of the target event contained in the knowledge graph, which can more accurately determine the semantics corresponding to the second comment information. The sentiment analysis of the second comment information is combined with the background knowledge of the target event, thereby obtaining a more accurate first sentiment tendency value. Finally, the sentiment tendency of the target is determined by the first sentiment tendency value, thus improving the accuracy of sentiment tendency determination. Attached Figure Description

[0050] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0051] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 A flowchart of a method for determining the sentiment tendency of network users provided in this embodiment of the disclosure;

[0053] Figure 2 A flowchart of a method for determining the sentiment tendency of network users, provided in another embodiment of this disclosure;

[0054] Figure 3 A flowchart of a method for determining the sentiment tendency of network users, provided in another embodiment of this disclosure;

[0055] Figure 4 A schematic diagram of the structure of a network user sentiment determination device provided in an embodiment of this disclosure;

[0056] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0057] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0058] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0059] Existing methods for determining sentiment based on comments posted by online users rely solely on semantic analysis and inference of the content of a single comment from a particular user. This makes it difficult to capture the true opinions of online users and leads to inaccurate assessments of their sentiment. Specific reasons include: 1. In open-source social media, user comments are related to the background knowledge of the event. In some cases, a user's current comment may even be related to previously posted comments. Understanding the current message depends on the overall background knowledge of the event and the expression of the user's historical comments. 2. User posts often do not directly express their own stance. The target mentioned in a comment may not be the object of the comment; the comment may express a stance on a particular aspect of the target or its opposite. 3. Social networks have a large number of "lurkers" who do not actively speak out but express their opinions through actions such as liking or forwarding existing comments. Existing methods ignore user behavior data.

[0060] To address the aforementioned issues, this disclosure provides a method for determining the sentiment tendency of network users. The method will be described below with reference to specific embodiments.

[0061] Figure 1This disclosure provides a flowchart of a method for determining the sentiment orientation of a network user. This method can be executed by a network user sentiment orientation determination device, which can be implemented in software and / or hardware. The device can be configured in an electronic device, such as a server or terminal, where the terminal specifically includes a mobile phone, computer, or tablet computer. The method specifically includes the following steps:

[0062] S101. Obtain the first comment information of network users on the target event, and the second comment information of the object on the target event.

[0063] Both the first and second comment information can be obtained from open-source social media. The first comment information is used in subsequent steps to construct a knowledge graph, expressing background knowledge related to the target event and enabling sentiment assessment of a comment within its context. Therefore, the collected first comment information comprises comment information from all online users who have commented on the target event, thus greatly enriching the background knowledge about the target event.

[0064] The second set of comment information consists of current comments from online users on the target event. Since users' sentiment may change as information about the event unfolds or as the event itself evolves, the determination of users' sentiment is based on the currently posted comments. For example, several comments with the highest number of likes on open-source social media can be selected as the second set of comment information, and the sentiment of each selected comment can be assessed to determine the sentiment of the online user who posted it. Alternatively, some users' comments can be selected from the first set of comment information for sentiment assessment.

[0065] S102. Construct a knowledge graph of the target event based on the information in the first comment.

[0066] Knowledge graphs typically organize knowledge using triples (head entity, relation, tail entity). This symbolic representation uses different symbolic nodes to represent entities and relations in the knowledge graph. Knowledge graphs can represent people, things, and the relationships between people and things in a target event, thus effectively reflecting the background knowledge contained in the target event.

[0067] A knowledge graph is constructed based on the first comments obtained about the target event, serving as a public opinion knowledge base for the target event. This allows for the determination of sentiment orientation of comments posted by online users by combining background knowledge of the target event.

[0068] S103. Perform sentiment analysis on the second comment information based on the knowledge graph to obtain the first sentiment tendency value.

[0069] Because online users often comment on disclosed public opinion information when commenting on target events, the information contained in these comments is incomplete. This leads to inaccurate semantic analysis of comments based on single sentences. Therefore, utilizing knowledge graphs to understand the entities and relationships between them related to the target event allows for reasoning about the entities and relationships within the comments, enriching the background knowledge and enabling a more accurate determination of the comments' semantics. This results in a more comprehensive semantic representation of the comments, leading to more accurate sentiment analysis values. By reasoning about the entities and relationships within the knowledge graph, the entities and relationships contained in the second comment are analyzed to obtain a semantic representation enriched with background knowledge. Sentiment analysis is then performed on this semantic representation to obtain the first sentiment value.

[0070] In practical applications, relational reasoning using knowledge graphs requires complex graph algorithms to manipulate these symbols, resulting in low efficiency and making it difficult to meet the needs of large-scale real-time computing. Therefore, distributed representation learning, which is highly computable, can be used to represent knowledge graphs in a low-dimensional vector space, transforming relational reasoning into simple vector operations.

[0071] This disclosure employs a Shared Embedding based Neural Network (SENN) model for relation reasoning. The relation reasoning task in SENN is reduced to the following subtasks: given a relation and a tail entity, predict the head entity; given a head entity and a tail entity, predict the relation; given a head entity and a relation, predict the tail entity. SENN directly models these three subtasks of relation reasoning and integrates them within a unified neural network framework through shared vector representations. To this end, SENN comprises two main components: two shared representation matrices, corresponding to the entity representation matrix and the relation representation matrix, respectively, and three substructures, corresponding to the prediction of the head entity, relation, and tail entity, respectively. Here, the interaction between different prediction subtasks is captured through the shared vector representation matrices of entities and relations. The three prediction subtasks are modeled separately, resulting in three similar prediction substructures, allowing for the prediction of specified inferences using different given information. Intuitively, prediction is a process of gradually approaching a target. Therefore, SENN employs a fully connected neural network with decreasing dimensionality to simulate this process, gradually reasoning to lock onto the target from relatively more information. Furthermore, this disclosure also designs an adaptive weighted loss mechanism based on the following considerations. On the one hand, triples can be categorized into four types based on their mapping properties: one-to-one, one-to-many, many-to-one, and many-to-many. For example, one-to-many means that for this type of relationship, one head entity may correspond to multiple tail entities. Similarly, given head and tail entities, there may be multiple relationships. Obviously, a prediction with only one entity / relationship is more certain than a prediction with multiple entities / relationships. In other words, the more possible outcomes a prediction has, the lower its certainty. Therefore, during training, this project imposes a heavier penalty on relatively certain predictions; that is, the weight of the loss is associated with the number of valid entities / relationships corresponding to the prediction, and the project uses their inverses to weight the corresponding loss. On the other hand, relationship prediction, due to its smaller candidate set, has been shown to be simpler and more effective than entity prediction. Therefore, this disclosure multiplies the head and tail entity predictions by an additional weight factor w greater than 1 to encourage SENN to learn difficult prediction tasks well.

[0072] For example, referring to the above operation process, the second comment information can be transformed into a vector representation by using the knowledge graph about the target event entity and the relationship between entities, combined with the state space representation of the knowledge graph in the low-dimensional vector space. Then, the relationship reasoning is performed through the SENN model mentioned above, which improves the operation speed and can quickly generate the first sentiment value corresponding to the second comment information.

[0073] S104. Determine the object's emotional tendency toward the target event, at least based on the first sentiment value.

[0074] Based on the mapping relationship between sentiment values ​​and different types of sentiment, the sentiment corresponding to the first sentiment value is determined, thereby determining the object's current sentiment towards the target event. For example, if the first sentiment value is (0, 0, 1), the corresponding sentiment is support, where different coordinates of the vector represent different sentiment types, such as (oppose, neutral, support), thus determining the sentiment corresponding to (0, 0, 1) as support. The mapping relationship between sentiment values ​​and different types of sentiment can be set according to specific needs and algorithms, and this embodiment does not impose specific limitations.

[0075] This embodiment constructs a knowledge graph of the target event by acquiring first comment information from network users regarding the target event. Based on the knowledge graph, sentiment analysis is performed on the second comment information published by the judgment object. The second comment information can be supplemented by the background knowledge of the target event contained in the knowledge graph, which can more accurately determine the semantics corresponding to the second comment information. This allows the sentiment analysis of the second comment information to be combined with the background knowledge of the target event, thereby obtaining a more accurate first sentiment tendency value. Finally, the sentiment tendency of the judgment object is determined by the first sentiment tendency value, improving the accuracy of sentiment tendency determination.

[0076] Figure 2 A flowchart of a method for determining the sentiment tendency of network users is provided in another embodiment of this disclosure. The method specifically includes the following steps:

[0077] S201. Obtain the first comment information of network users on the target event, and the second comment information of the object on the target event.

[0078] Specifically, the implementation process and principle of S201 and S101 are the same, and will not be repeated here.

[0079] S202. Construct a knowledge graph of the target event based on the information in the first comment.

[0080] Specifically, the implementation process and principle of S202 and S102 are the same, and will not be repeated here.

[0081] S203. Based on the knowledge graph, perform sentiment analysis on the second comment information to obtain the first sentiment tendency value.

[0082] Specifically, the implementation process and principle of S203 and S103 are the same, and will not be repeated here.

[0083] S204. Based on the stance detection model, perform sentiment analysis on the second comment information to obtain the second sentiment tendency value. The stance detection model is trained based on the first comment information.

[0084] Stance detection primarily involves extracting users' stance information regarding a specific target from comments posted online. This target could be a person, an event, or a concrete thing. Stance detection based on specific targets is similar to sentiment classification based on specific targets, but the main difference lies in the target's position. In the latter, the target appears in the text and is clearly marked, while in stance detection based on specific targets, the target is not necessarily the subject of the comment. The text may express a stance on a particular aspect of the target or its opposite. Furthermore, the stance expressed in the text and its sentiment polarity are not always the same. Therefore, detecting the true stance expressed in comments posted by online users helps in determining sentiment bias.

[0085] Using comment information about the target event to train the stance detection model makes the model more accurate in detecting stances on comments related to the target event. As mentioned above, the first set of comment information collected consists of comment information from all network users who have commented on the target event. The stance detection model provided in this embodiment is trained based on the first set of comment information, thus making the stance detection of the second set of comment information about the target event more accurate.

[0086] For example, in this embodiment of the disclosure, word vector representations of the second comment information are obtained through a Natural Language Processing (BERT) model, and the word vector representations are input into a stance detection model for sentiment analysis focusing on stance detection to obtain a second sentiment tendency value.

[0087] S205. Based on the first sentiment tendency value and the second sentiment tendency value, determine the object's sentiment tendency towards the target event.

[0088] The second sentiment tendency value is used as a bias of the first sentiment tendency value. The first sentiment tendency value and the second sentiment tendency value are weighted and summed to obtain the sum of the two. The sentiment tendency of the object to the target event is determined according to the sentiment tendency type corresponding to the sum of the two.

[0089] This embodiment of the disclosure performs sentiment analysis on the second comment information using a stance detection model trained based on the first comment information to obtain a second sentiment tendency value. The first and second sentiment tendency values ​​are combined to determine the object's sentiment tendency towards the target event, so that the determination of sentiment tendency incorporates the true stance expressed by the determined object, thereby making the determination result of sentiment tendency more accurate.

[0090] Figure 3 A flowchart of a method for determining the sentiment tendency of network users is provided in another embodiment of this disclosure. The method specifically includes the following steps:

[0091] S301. Obtain the first comment information of the network user on the target event, and the second comment information of the object on the target event.

[0092] Specifically, the implementation process and principle of S301 and S101 are the same, and will not be repeated here.

[0093] S302. Construct a knowledge graph of the target event based on the information in the first comment.

[0094] Specifically, the implementation process and principle of S302 and S102 are the same, and will not be repeated here.

[0095] S303. Perform sentiment analysis on the second comment information based on the knowledge graph to obtain the first sentiment tendency value.

[0096] Specifically, the implementation process and principle of S303 and S103 are the same, and will not be repeated here.

[0097] S304. Obtain at least one third comment information related to the target event from which the target operation is performed on the object.

[0098] Target actions include liking and sharing, because in social media, actions like liking or sharing a comment can reflect the sentiment of the target user. Furthermore, some internet users rarely actively post comments to express their emotions, but they choose to express their stance through these actions. Therefore, by categorizing target actions into different sentiment types, and then determining the sentiment of the comment in which the target action was performed, the target user's sentiment can be determined. For example, a "like" indicates agreement with the comment in which the target action was performed; if the comment's sentiment is supportive, then the target user's sentiment towards performing the target action is supportive. In addition, the time-series data corresponding to the target actions contains information about the evolution of internet users' sentiment over time, which can help to more accurately characterize internet users. Therefore, effectively modeling time-series data can better capture internet users' behavioral patterns and thus uncover their sentiment.

[0099] S305. Perform sentiment analysis on each third comment to obtain the third sentiment tendency value corresponding to each third comment, and perform a weighted average on the third sentiment tendency values ​​to obtain the fourth sentiment tendency value.

[0100] By performing sentiment analysis on the third-party comments related to the target operation, a third sentiment tendency value is obtained for each third-party comment. Then, a weighted average of these third sentiment tendency values ​​is calculated based on the temporal information of the target operation. For example, the closer the time of the "like" operation on a third-party comment is to the time of determining the current sentiment tendency, the greater the weight of the third sentiment tendency value corresponding to that comment. Alternatively, a weighted average of the third sentiment tendency values ​​can be calculated by performing temporal modeling on the temporal information corresponding to the target operation. A fourth sentiment tendency value is obtained by weighting the third sentiment tendency values ​​based on the temporal information corresponding to the target operation.

[0101] S306. Based on the first sentiment tendency value and the fourth sentiment tendency value, determine the object's sentiment tendency towards the target event.

[0102] Specifically, the implementation process and principle of S306 and S205 are the same, and will not be repeated here.

[0103] This embodiment of the disclosure obtains third comment information related to the target event and the target operation performed by the object, performs sentiment analysis on the third comment information to obtain a third sentiment tendency value, and then performs a weighted average of the obtained third sentiment tendency value based on the time sequence information corresponding to the target operation to obtain a fourth sentiment tendency value. Finally, the first sentiment tendency value and the fourth sentiment tendency value are combined to determine the object's sentiment tendency towards the target event, so that the determination of sentiment tendency combines the behavioral information of the object to be determined, thereby making the determination result of sentiment tendency more accurate.

[0104] In some embodiments, the object's emotional tendency toward the target event can also be determined based on a first emotional tendency value, a second emotional tendency value, and a fourth emotional tendency value, thereby further improving the accuracy of emotional tendency determination.

[0105] Based on the above embodiments, before determining the object's sentiment towards the target event based at least on the first sentiment tendency value, the method further includes: obtaining at least one fourth comment information of the object regarding the target event, wherein the fourth comment information is historical comment information prior to the second comment information; determining the degree of association between the fourth comment information and the second comment information based on a knowledge graph, and using the degree as the association coefficient of the fourth comment information; performing a weighted average of the association coefficients of the fourth comment information to obtain an average association coefficient; correcting the first sentiment tendency value based on the average association coefficient to obtain a corrected first sentiment tendency value; and determining the object's sentiment towards the target event based at least on the first sentiment tendency value, including: determining the object's sentiment towards the target event based at least on the corrected first sentiment tendency value.

[0106] As mentioned above, when performing sentiment analysis on second comments to determine sentiment orientation, combining sentiment analysis with background knowledge of the target event will lead to a more accurate determination of sentiment orientation. This is because the second comment is published based on the specific circumstances of the target event, and therefore, the semantic determination of the second comment needs to be combined with background knowledge of the target event. Another scenario is when the second comment is based on comments published before it; in this case, it is necessary to combine the historical comments published by the target before the second comment to perform sentiment analysis on the second comment.

[0107] By acquiring the fourth comment information published by the target before the second comment information was published, and then determining the degree of association between each fourth comment information and the second comment information based on the knowledge graph, the degree of association is used as the association coefficient corresponding to each fourth comment information. The association coefficients are then weighted and averaged to obtain the average association coefficient. For example, based on the state space representation method of the knowledge graph described above, SENN can be used to infer the entities and entity relationships contained in the knowledge graph, generating a state space representation of the fourth comment information after incorporating background knowledge. Then, the attention mechanism of SENN is used to infer the association between each fourth comment information and the second comment information using the knowledge graph, obtaining the association coefficient for each message. Finally, a weighted average is used to obtain the average association coefficient. After obtaining the average association coefficient, the average association coefficient is multiplied by the first sentiment tendency value, and the product is used as the corrected first sentiment tendency value. Finally, based on the corrected first sentiment tendency value, the target's sentiment tendency towards the target event is determined.

[0108] This embodiment of the disclosure obtains the fourth comment information published by the object in the second comment information, and determines the degree of correlation between the fourth comment information and the second comment information based on a knowledge graph to obtain a correlation coefficient. Then, the correlation coefficient is weighted and averaged to obtain an average correlation coefficient, which is used to correct the first sentiment tendency value. Finally, the object's sentiment tendency towards the target event is determined based on the corrected first sentiment tendency value. By combining the sentiment analysis of the second comment information with historical comment information, the determination of sentiment tendency is combined with the historical comment information published by the object, thereby making the determination result of sentiment tendency more accurate.

[0109] Based on the above embodiments, the stance detection model includes a stance target detection sub-model, a stance topic detection sub-model, and a stance sentiment detection sub-model. Sentiment analysis is performed on the second comment information based on the stance detection model to obtain a second sentiment tendency value, including: determining the stance target based on the second comment information using the stance target detection sub-model; determining the stance topic of the stance target based on the second comment information using the stance topic detection sub-model; determining the sentiment intensity of the stance topic based on the second comment information using the stance sentiment detection sub-model; and determining the second sentiment tendency value based on the stance target, stance topic, and sentiment intensity.

[0110] A stance target is a person or thing that a commentary expresses a position towards, and this stance target can effectively help in judging the stance of the text. However, stance target information is usually very brief, making it difficult to clearly determine the target's attitude towards the stance target. Although online users usually do not explicitly express their stance target's attitude, they often discuss one or more topics related to the target and express their attitudes towards these topics, thus implicitly expressing their views on the target. The sentiment of the text reflects, to some extent, the strength of the online user's stance on the discussed topics, and plays a positive role in judging the stance.

[0111] The stance target detection sub-model is used to detect the stance target expressed by the second comment information. The stance topic detection sub-model is used to detect the stance topic discussed by the second comment information under the stance target. The stance sentiment detection sub-model is used to detect the sentiment intensity expressed by the second comment information towards the discussed stance topic. The second sentiment tendency value corresponding to the second comment information can be determined by the stance target, stance topic and sentiment intensity.

[0112] For example, this disclosure provides a position detection model based on an emotion-assisted multi-head attention bidirectional long short-term memory network (Bi-LSTM). The model is mainly divided into three parts, which are used to generate text representations based on position goals, text representations based on position topics, and text representations based on position sentiments, namely, position goal detection sub-model, position topic detection sub-model, and position sentiment detection sub-model.

[0113] Bidirectional Long Short-Term Memory (Bi-LSTM) networks capture the contextual semantics of text through a forward LSTM and the following semantics through a backward LSTM. By concatenating the hidden layer outputs of the bidirectional LSTMs, more contextual information is obtained, resulting in better text representation. This Bi-LSTM network is used to represent the word vectors [x1, x2, ..., x] generated by the BERT model. n Modeling yields a high-order text representation [h1, h2, ..., h n This allows for the capture of more textual information. The t-th text word vector x...t The corresponding higher-order text vector h t The format is as follows:

[0114]

[0115]

[0116]

[0117] Then, a Latent Dirichlet Allocation (LDA) topic model is used to obtain K topic information for the text. For each topic T... i The topic is represented by the word vectors of the first m words under that topic, i.e. For topic T i The embedding representation is used to generate each word under this topic using the BERT model. Corresponding word embedding expression Then, based on the probability of each topic word under this topic generated by the LDA model. Obtain the weight of each word. ( (This represents the degree of influence of the j-th word in the source end on the i-th word in the target end), thus obtaining the embedding representation T of the topic. i . and T i The calculation formula is as follows:

[0118]

[0119]

[0120] Let T target ={T 1 ,T 2 ,…,T K} represents K topic information, T target Embedded representation of position and objective information.

[0121] Stance detection focuses on identifying the stance of target words. The core of identifying the stance bias of a text lies in the parts of the text that are significantly related to the target words. Therefore, this disclosure utilizes an attention mechanism to give a larger weight to feature words that better distinguish categories, thus focusing more on feature words and reducing the influence of noise or redundant features. Stance targets and topic representations are matched with latent expressions in the text to obtain the relevance weight of each latent expression in the text.

[0122] For each topic T i The attention mechanism assigns weights in the following form:

[0123]

[0124]

[0125] Where h j For high-order text word vector representation [h1,h2,…,h] n The j-th high-order text word vector in ] To represent the theme The word vector of the j-th word in the text. This represents the attention weight.

[0126] Then output the bidirectional LSTM hidden layer [h1,h2,…,h n Attention weights Weighted summation for topic T i The text representation of S i .

[0127]

[0128] Ultimately, we obtain K+1 text representations, which are text representations based on stance topics {S}. 1 ,S 2 ,…,S K} and position-based text representation S target The above mechanism can be viewed as a multi-head attention mechanism, where each topic T... i It is a query vector with an attention mechanism.

[0129] The sentiment of text reflects, to some extent, the strength of online users' stances and attitudes towards a discussion topic, and plays a positive role in stance judgment. Based on this, this paper proposes a pre-trained sentiment-assisted classifier to incorporate the sentiment expression of text into stance judgment. The sentiment-assisted classifier is trained using a Bi-LSTM model, taking the text word vectors [x1, x2, ..., x...] generated by the BERT model as input. n Inputting the data into the Bi-LSTM model yields the sentiment-based text representation S. senti =[h1,h2,…,h n ].

[0130] For each text, the LDA model generates a probability p that it belongs to each topic. i Therefore, this paper further fuses the topic-based text representation according to the topic distribution probability of the text, in the following form:

[0131] S topics =Σ i p i S i

[0132] The final text representation is a position-based text representation S. target S-based text representation of positions and themes topics and position-based sentiment-based text representation S senti The splicing is as follows.

[0133]

[0134] The final classification result is generated by using a fully connected layer, and then the predicted probability of each sentiment type is output through the normalization exponent (softmax) function to generate the sentiment tendency value.

[0135] The stance detection model provided in this embodiment is divided into three parts. By detecting the stance target, the stance topic under the stance target, and the emotional intensity of the stance topic of the second comment information respectively, it can accurately capture the stance expressed by the second comment information, thereby assisting in the determination of sentiment tendency and making the determination of sentiment tendency more accurate.

[0136] Figure 4 This is a schematic diagram of a network user sentiment determination device provided in an embodiment of this disclosure. The device can be configured as a component in a terminal to execute the processing flow provided in the network user sentiment determination method embodiment. The network user sentiment determination device 400 includes: an acquisition module 401, which acquires first comment information of a network user's comments on a target event, and second comment information of the user on the target event; a processing module 402, used to construct a knowledge graph of the target event based on the first comment information; an analysis module 403, used to perform sentiment analysis on the second comment information based on the knowledge graph to obtain a first sentiment value; and a determination module 404, used to determine the user's sentiment towards the target event based at least on the first sentiment value.

[0137] Optionally, the analysis module 403 is also used to perform sentiment analysis on the second comment information based on the stance detection model to obtain a second sentiment tendency value. The stance detection model is trained based on the first comment information. When the determination module 404 determines the object's sentiment tendency towards the target event based at least on the first sentiment tendency value, it is specifically used to determine the object's sentiment tendency towards the target event based on the first sentiment tendency value and the second sentiment tendency value.

[0138] Optionally, the acquisition module 401 is further configured to acquire at least one third comment information related to the target event from which the target operation is performed by the object; the analysis module 403 is further configured to perform sentiment analysis on each third comment information to obtain a third sentiment tendency value corresponding to each third comment information, and to perform a weighted average on the third sentiment tendency values ​​to obtain a fourth sentiment tendency value; the determination module 404 determines the object's sentiment tendency towards the target event based at least on the first sentiment tendency value, specifically based on the first sentiment tendency value and the fourth sentiment tendency value.

[0139] Optionally, before determining the object's sentiment towards the target event based at least on the first sentiment tendency value, the acquisition module 401 is further configured to acquire at least one fourth comment information of the object regarding the target event, wherein the fourth comment information is historical comment information prior to the second comment information; the analysis module 403 is further configured to determine the degree of association between the fourth comment information and the second comment information based on the knowledge graph, and use the degree as the association coefficient of the fourth comment information; perform a weighted average on the association coefficient of the fourth comment information to obtain an average association coefficient; correct the first sentiment tendency value based on the average association coefficient to obtain a corrected first sentiment tendency value; when determining the object's sentiment tendency towards the target event based at least on the first sentiment tendency value, the determination module is specifically configured to determine the object's sentiment tendency towards the target event based at least on the corrected first sentiment tendency value.

[0140] Optionally, the stance detection model includes a stance target detection sub-model, a stance topic detection sub-model, and a stance sentiment detection sub-model. When the analysis module performs sentiment analysis on the second comment information based on the stance detection model to obtain the second sentiment tendency value, it is specifically used to determine the stance target based on the second comment information based on the stance target detection sub-model; determine the stance topic of the stance target based on the second comment information based on the stance topic detection sub-model; determine the sentiment intensity of the stance topic based on the second comment information based on the stance sentiment detection sub-model; and determine the second sentiment tendency value based on the stance target, stance topic, and sentiment intensity.

[0141] Figure 4 The network user sentiment determination device in the illustrated embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and will not be described again here.

[0142] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. The electronic device provided in this embodiment of the disclosure can execute the processing flow provided in the embodiment of the method for determining the sentiment tendency of network users, such as... Figure 5As shown, the electronic device 500 includes: a memory 501, a processor 502, a computer program, and a communication interface 503; wherein, the computer program is stored in the memory 501 and is configured to be executed by the processor 502 to determine the sentiment tendency of the network user as described above.

[0143] In addition, this disclosure also provides a computer-readable storage medium storing a computer program thereon, which is executed by a processor to implement the network user sentiment determination method described in the above embodiments.

[0144] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0145] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for determining the sentiment tendency of internet users, characterized in that, include: Obtain first comment information from network users regarding the target event, and second comment information from the object regarding the target event; Construct a knowledge graph of the target event based on the first comment information; Based on the knowledge graph, sentiment analysis is performed on the second comment information to obtain a first sentiment tendency value; Based at least on the first sentiment tendency value, determine the object's sentiment tendency toward the target event; Specifically, sentiment analysis is performed on the second comment information based on the knowledge graph to obtain a first sentiment tendency value, including: By utilizing the entities and relationships between entities in the knowledge graph, reasoning is performed on the entities and entity relationships contained in the second comment information to obtain a semantic representation enriched with background knowledge of the second comment information. Sentiment analysis is then performed on the semantic representation to obtain the first sentiment tendency value. The method further includes: Obtain at least one third comment related to the target event from which the target operation is performed by the object; the target operation includes liking and sharing. Sentiment analysis is performed on each third comment to obtain a third sentiment tendency value corresponding to each third comment. A weighted average of the third sentiment tendency values ​​is then performed to obtain a fourth sentiment tendency value. Determining the object's emotional tendency towards the target event, based at least on the first emotional tendency value, includes: Based on the first sentiment tendency value and the fourth sentiment tendency value, the sentiment tendency of the object towards the target event is determined.

2. The method as described in claim 1, characterized in that, The method further includes: Sentiment analysis is performed on the second comment information based on the stance detection model to obtain a second sentiment tendency value. The stance detection model is trained based on the first comment information. Determining the object's emotional tendency towards the target event, based at least on the first emotional tendency value, includes: Based on the first sentiment tendency value and the second sentiment tendency value, the sentiment tendency of the object towards the target event is determined.

3. The method as described in claim 1, characterized in that, Before determining the object's sentiment towards the target event based at least on the first sentiment tendency value, the method further includes: Obtain at least one fourth comment information of the object on the target event, wherein the fourth comment information is historical comment information preceding the second comment information; The degree of association between the fourth comment information and the second comment information is determined based on the knowledge graph, and the degree is used as the association coefficient of the fourth comment information; The average correlation coefficient is obtained by weighting the correlation coefficients of the fourth comment information; The first sentiment tendency value is corrected based on the average correlation coefficient to obtain the corrected first sentiment tendency value; Determining the object's emotional tendency towards the target event, based at least on the first emotional tendency value, includes: The object's emotional tendency toward the target event is determined based at least on the modified first sentiment value.

4. The method as described in claim 2, characterized in that, The stance detection model includes a stance target detection sub-model, a stance topic detection sub-model, and a stance sentiment detection sub-model. The sentiment analysis of the second comment information based on the stance detection model to obtain a second sentiment tendency value includes: Based on the aforementioned stance target detection sub-model, the stance target is determined according to the second comment information; Based on the aforementioned stance topic detection sub-model, the stance topic of the stance target is determined according to the second comment information; Based on the aforementioned stance sentiment detection sub-model, the sentiment intensity of the stance topic is determined according to the second comment information; The second sentiment tendency value is determined based on the stated position objective, the stated position theme, and the stated sentiment intensity.

5. A device for determining the emotional tendency of network users, characterized in that, include: The acquisition module acquires first comment information from network users regarding the target event, and second comment information from the object regarding the target event; The processing module is used to construct a knowledge graph of the target event based on the first comment information; The analysis module is used to perform sentiment analysis on the second comment information based on the knowledge graph to obtain a first sentiment tendency value; The determination module is used to determine the object's emotional tendency toward the target event based at least on the first emotional tendency value; Specifically, sentiment analysis is performed on the second comment information based on the knowledge graph to obtain a first sentiment tendency value, including: By utilizing the entities and relationships between entities in the knowledge graph, reasoning is performed on the entities and entity relationships contained in the second comment information to obtain a semantic representation enriched with background knowledge of the second comment information. Sentiment analysis is then performed on the semantic representation to obtain the first sentiment tendency value. The acquisition module is also used to acquire at least one third comment information related to the target event from which the object performs the target operation; the target operation includes liking and forwarding. The analysis module is also used to perform sentiment analysis on each third comment information to obtain a third sentiment tendency value corresponding to each third comment information, and to perform a weighted average on the third sentiment tendency values ​​to obtain a fourth sentiment tendency value. The determination module determines the object's emotional tendency toward the target event based at least on the first emotional tendency value, specifically based on the first emotional tendency value and the fourth emotional tendency value.

6. The apparatus as claimed in claim 5, characterized in that, The analysis module is also used to perform sentiment analysis on the second comment information based on the stance detection model to obtain a second sentiment tendency value. The stance detection model is trained based on the first comment information. When the determination module determines the object's emotional tendency toward the target event based at least on the first emotional tendency value, it is specifically used to determine the object's emotional tendency toward the target event based on the first emotional tendency value and the second emotional tendency value.

7. An electronic device, characterized in that, include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the method as described in any one of claims 1-4.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Network social media viewpoint tendency analysis system and method

    CN106951409A

  • Comment map building method and device based on artificial intelligence

    CN107220352A

  • User emotion tendency information obtaining method and device and electronic equipment

    CN111565322A

  • Comment sentiment analysis method and system based on knowledge graph and interaction graph convolution

    CN114492459A