Emotion tag acquisition method, device and equipment and readable storage medium
By combining multiple iterations of multi-role-playing intelligent agents and behavioral psychologist intelligent agents, and simulating user emotions using multimodal data, the problems of lag and accuracy in emotion prediction are solved, enabling accurate prediction of user emotional attitudes before the target event occurs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MALANSHAN AUDIO & VIDEO LABORATORY
- Filing Date
- 2025-12-26
- Publication Date
- 2026-04-17
AI Technical Summary
Existing sentiment prediction technologies suffer from lag and insufficient accuracy, failing to meet the needs of practical sentiment prediction.
By acquiring target events and user identifiers, extracting event context and user features, and using multi-role-playing agents and behavioral psychologist agents for multiple iterations, combined with multimodal data to simulate and score emotional states, and finally using sentiment analysis models to predict sentiment labels.
It enables accurate prediction of users' emotional attitudes before the target event occurs, thus improving the accuracy of sentiment prediction.
Smart Images

Figure CN121880648A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, and in particular to a method, apparatus, device and readable storage medium for obtaining emotion tags. Background Technology
[0002] Traditional sentiment analysis can assign sentiment labels to published comments (e.g., this comment is negative).
[0003] Sentiment prediction can not only lead to better marketing in the buying and selling of goods, but also assist in the precise allocation of disaster relief resources and provide early warnings of extreme emotions or potential conflicts after disasters or trending events. However, current sentiment prediction methods suffer from lag and insufficient accuracy, failing to meet the needs of practical sentiment prediction.
[0004] In summary, how to effectively improve the lag and accuracy of sentiment prediction is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, device, and readable storage medium for obtaining emotion tags, which can predict users' emotional attitudes toward events that have not yet occurred. It can combine multimodal data with multi-role intelligent agents and behavioral psychologist intelligent agents to achieve multiple rounds of iteration, thereby improving the accuracy of emotion prediction.
[0006] To solve the above-mentioned technical problems, this application provides the following technical solution:
[0007] A sentiment prediction method includes:
[0008] Obtain the target event and the user identifier of the target user; wherein the target event has not occurred;
[0009] Extract the event context of the target event, and use the user identifier to extract user features and similar features from historical dialogue comment data;
[0010] The event context, user characteristics, and similarity characteristics are input into role-playing agents in different emotional states to obtain sub-emotional comments for different emotional states.
[0011] The behavioral psychologist agent is used to fuse the latest sub-emotional comments to obtain a total emotional comment, and the total emotional comment is scored and optimization suggestions are generated.
[0012] The optimization suggestions are fed back to the role-playing agents in different emotional states to obtain the new sub-emotion comments after optimization by the role-playing agents, until the iteration threshold is reached;
[0013] After reaching the iteration threshold, the target total sentiment comment with the highest score is determined from the total sentiment comments generated in multiple rounds;
[0014] The sentiment analysis model is used to predict the sentiment of the total target sentiment comments, thereby obtaining the sentiment labels of the target users for the target event.
[0015] Preferably, the similarity features extracted from historical dialogue comment data using the user identifier include:
[0016] The embedded features of the target user are queried from the user vector library using the user identifier; wherein the user vector library is constructed based on the historical dialogue comment data;
[0017] Using the embedded features, retrieve several most similar users from the user vector database, and determine the retrieved users as user similarity features;
[0018] Using the event context, the event database is searched to obtain similar event database information, and the event database information is identified as the user's similar event attitude; wherein, the event database is constructed based on historical event information and historical dialogue comment data;
[0019] The user similarity features and the user similar event attitudes are identified as the similarity features.
[0020] Preferably, the user vector library is constructed based on the historical dialogue comment data, including:
[0021] Obtain the historical dialogue and comment data for each user;
[0022] User node vectors are obtained by dividing the data according to preset features, using user identifiers as the dimension.
[0023] The user node vectors are trained by combining contrastive learning training.
[0024] After training is completed, the embedded features of each user are stored in the user vector library.
[0025] Preferably, the event database is constructed based on historical event information and the historical dialogue comment data, including:
[0026] The historical event information is used to classify the events by attributes.
[0027] Events under different attribute categories are aggregated according to user identifier dimension, and user attitudes are extracted from the aggregated comment information;
[0028] The extracted user attitudes are sorted by time, and user comments at a specified time are selected as group comments;
[0029] Historical events are written into the event database according to event identifier, event attribute classification, event user identifier, event attitude group under different users, and group comments.
[0030] Preferably, the user identifier is used to extract user features from historical dialogue comment data, including:
[0031] Obtain the target historical dialogue comment data corresponding to the user identifier; wherein, the historical dialogue comment data includes images and text, the images include emoticons, and the text includes character emoticons;
[0032] Extract tone and style features from the target historical dialogue comment data;
[0033] Input the tone style features and the event upper limit text information corresponding to the target historical dialogue comment data into the multimodal large model to obtain the event attitude features;
[0034] The tone style features and the event attitude features are determined as the user features.
[0035] Preferably, the event context, the user characteristics, and the similarity characteristics are input into the role-playing agent in different emotional states to obtain sub-emotional comments for different emotional states, including:
[0036] The event context, user characteristics, and similarity characteristics are input into the positive emotion role-playing agent to obtain sub-emotion comments of the positive emotion state;
[0037] The event context, user characteristics, and similarity characteristics are input into the neutral emotion role-playing agent to obtain sub-emotion comments of the neutral emotion state;
[0038] The event context, user characteristics, and similarity characteristics are input into the role-playing agent for negative emotions to obtain sub-emotion comments of the negative emotion state.
[0039] Preferably, scoring the total sentiment comments and generating optimization suggestions includes:
[0040] The overall sentiment comments are scored;
[0041] The total sentiment comments are reviewed to identify anomalies that are inconsistent with the target user.
[0042] The aforementioned anomalies are identified as areas for optimization and improvement.
[0043] Accordingly, the optimization suggestions are fed back to the role-playing agents in different emotional states to obtain the optimized sub-emotion comments from the role-playing agents, including:
[0044] The optimization suggestions are fed back to the role-playing agents in different emotional states;
[0045] Using role-playing agents in different emotional states, sub-emotional comments for different emotional states are re-output based on the optimization suggestions.
[0046] An emotion tag acquisition device, comprising:
[0047] An input module is used to obtain the target event and the user identifier of the target user; wherein the target event has not occurred;
[0048] The feature extraction module is used to extract the event context of the target event and, using the user identifier, extract user features and similar features from historical dialogue comment data;
[0049] A multi-role-playing module is used to input the event context, the user features, and the similar features into role-playing agents in different emotional states to obtain sub-emotional comments in different emotional states.
[0050] The iterative correction module is used to fuse the latest different sub-emotion comments using a behavioral psychologist agent to obtain a total emotion comment, score the total emotion comment and generate optimization suggestions; the optimization suggestions are fed back to the role-playing agents of different emotion states to obtain the newly output sub-emotion comments after optimization by the role-playing agents, until the iteration threshold is reached;
[0051] The sentiment prediction module is used to determine the target total sentiment comment with the highest score from the total sentiment comments generated in multiple rounds after reaching the iteration threshold; and to perform sentiment prediction on the target total sentiment comment using a sentiment analysis model to obtain the target user's sentiment label for the target event.
[0052] An electronic device, comprising:
[0053] Memory, used to store computer programs;
[0054] A processor is used to implement the steps of the above-described emotion tag acquisition method when executing the computer program.
[0055] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described emotion tag acquisition method.
[0056] The method provided in this application includes: obtaining the user identifiers of a target event and a target user; wherein the target event has not occurred; extracting the event context of the target event, and using the user identifier to extract user features and similar features from historical dialogue comment data; inputting the event context, user features, and similar features into role-playing agents in different emotional states to obtain sub-emotional comments in different emotional states; using a behavioral psychologist agent to fuse the latest sub-emotional comments to obtain a total emotional comment, and scoring the total emotional comment and generating optimization suggestions; feeding back the optimization suggestions to role-playing agents in different emotional states to obtain new sub-emotional comments output by the role-playing agents after optimization, until an iteration threshold is reached; after reaching the iteration threshold, determining the target total emotional comment with the highest score from the total emotional comments generated in multiple rounds; and using a sentiment analysis model to predict the sentiment of the target total emotional comment to obtain the target user's sentiment label for the target event.
[0057] In this application, even before the target event has occurred and before the user has commented on it, the event context can be extracted based on the target event, and user features and similar features can be extracted from historical dialogue comment data based on the target user's user identifier. Considering that the target event has not yet occurred and the target user has not commented on it, to know the target user's emotional attitude towards the target event, the target user's emotional comment on the target event can be simulated, and then the emotional attitude can be predicted based on the emotional comment. Specifically, to make the prediction results more accurate, the event context, user features, and similar features can be input into role-playing agents in different emotional states, thus obtaining sub-emotional comments for different emotional states. Then, a behavioral psychologist agent is used to fuse the latest sub-emotional comments to obtain a total emotional comment, which is then scored and optimization suggestions are generated. The optimization suggestions are then fed back to the role-playing agents in different emotional states to obtain newly output sub-emotional comments after optimization, until an iteration threshold is reached. That is, through rounds of iteration, multiple rounds of corresponding total emotional comments and their scores can be obtained. Finally, after reaching the iteration threshold, the target total sentiment comment with the highest score is determined from the total sentiment comments generated in multiple rounds. In this way, the prediction of the target user's sentiment towards a target event that has not yet occurred is achieved.
[0058] It is evident that this application can not only predict users' emotional attitudes toward events that have not yet occurred, but also combine multimodal data with multi-role intelligent agents and behavioral psychologist intelligent agents to achieve multiple iterations, thereby improving the accuracy of sentiment prediction.
[0059] Accordingly, embodiments of this application also provide an emotion tag acquisition device, equipment, and readable storage medium corresponding to the above-described emotion tag acquisition method, which have the above-described technical effects, and will not be repeated here. Attached Figure Description
[0060] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 This is a flowchart illustrating the implementation of an emotion tag acquisition method in this application.
[0062] Figure 2 This is a flowchart illustrating a specific implementation of an emotion tag acquisition method in this application.
[0063] Figure 3 This is a schematic diagram of user similarity feature extraction in an embodiment of this application;
[0064] Figure 4 This is a schematic diagram illustrating user attitude extraction for similar events in an embodiment of this application;
[0065] Figure 5 This is a schematic diagram of the structure of an emotion tag acquisition device according to an embodiment of this application;
[0066] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application;
[0067] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0068] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0069] Please refer to Figure 1 and Figure 2 This method can be applied to sentiment prediction systems built on computer technology or computer devices used for sentiment prediction (sentiment prediction devices). The method includes the following steps:
[0070] S101. Obtain the user identifier of the target event and the target user.
[0071] The target event did not occur.
[0072] The target event can be any event that has not yet occurred and in which the user's emotional state needs to be predicted. For example, the target event could be a disaster event, a safety event, or a project promotion event (such as the launch of a new product).
[0073] Target users can be either the audience affected by the target event or users who have access to, understand, or are likely to pay attention to the target event.
[0074] The user identifier can be a user ID.
[0075] Specifically, when it is necessary to predict the emotional attitude of target users towards target events that have not yet occurred, the target users and target events can be input into an emotion prediction system or emotion prediction device.
[0076] S102. Extract the event context of the target event and use user identifiers to extract user features and similar features from historical dialogue comment data.
[0077] To facilitate the prediction of users' sentiment towards a target event, the event context can be extracted. Based on user identifiers, user features and similar features can be extracted from historical dialogue and comment data. User features are those corresponding to the target user, while similar features are those similar to or related to the target user.
[0078] In one specific embodiment of this application, user characteristics are extracted from historical dialogue comment data using user identifiers, including:
[0079] Obtain the target historical dialogue comment data corresponding to the user identifier; wherein, the historical dialogue comment data includes images and text, images include emoticons, and text includes character emoticons;
[0080] Extract tone and style features from target historical dialogue comment data;
[0081] Input tone style features and event upper bound information corresponding to the target historical dialogue comment data into the multimodal large model to obtain event attitude features;
[0082] The characteristics of tone and style and attitude towards events are identified as user characteristics.
[0083] Specifically, user tone style reflects personal expression habits as a "label," while event attitude characteristics represent a user's ongoing evaluation and stance on currently occurring events (such as hurricanes or elections). Therefore, in this embodiment, user characteristics may include tone style characteristics and event attitude characteristics.
[0084] For the implementation of tone style feature extraction, the Qwen3-VL multimodal large model tool is used. The input data includes comments or dialogues posted by the user before time T-1, including various data types such as images and text, images (e.g., emoticons), and text. The specific extraction instruction is "Based on the user's historical dialogue data, please use three standardized adjectives to describe the user's tone style." The final output is used as the user's tone style feature, such as (confident, humorous, objective).
[0085] For event attitude feature extraction, the Qwen3-VL multimodal large model tool is used. The input is the user's tone style (Feature1) and the event context information from T-1 time points prior to the user's time, specifically the event's chronological nodes. Each node contains a description of the event's background at that time point and the user's corresponding comment information group at that time point. The specific event attitude extraction instruction is: "Based on the given user tone style, the event's chronological context faced by the user, and the user's comment information at each node within the event context, infer the user's attitude towards the event's development in chronological order. Please use three standardized adjectives to describe the attitude towards the event, such as (panic, worry, anticipation)."
[0086] In one specific embodiment of this application, similar features are extracted from historical dialogue comment data using user identifiers, including:
[0087] The embedding features of the target user are queried from the user vector library using the user identifier; the user vector library is constructed based on historical dialogue and comment data.
[0088] The most similar users are retrieved from the user vector database using embedded features, and the retrieved users are identified as user similarity features.
[0089] By utilizing event context, the event database is searched to obtain similar event information, and this information is then used to identify users' attitudes toward similar events. The event database is constructed based on historical event information and historical dialogue and comment data.
[0090] User similarity features and user attitudes toward similar events are identified as similarity features.
[0091] Among them, a user vector library is constructed based on historical dialogue and comment data, including:
[0092] Obtain the historical conversation comment data corresponding to each user respectively;
[0093] Taking the user identifier as the dimension, divide according to the preset features to obtain the user node vector;
[0094] Combined with contrastive learning training, train the user node vector;
[0095] After the training is completed, store the embedding features of each user obtained from the training into the user vector library.
[0096] Among them, an event library is constructed based on historical event information and historical conversation comment data, including:
[0097] Use historical event information to classify the attributes of events;
[0098] Aggregate the events under different attribute classifications according to the user identifier dimension respectively, and extract the user attitudes from the aggregated comment information;
[0099] Sort the extracted user attitudes by time, and select the user comments at the specified moment as the grouped comments;
[0100] Write each historical event into the event library according to the event identifier, the attribute classification of the event, the event user identifier, the event attitude group under different users, and the grouped comments.
[0101] In the embodiment of the present application, the similarity features include user similarity styles (user similarity features) and user similar event attitudes. The extraction of user similarity features has two main functions. On the one hand, it serves as a supplement to the sparse features of the "user feature extraction" module. On the other hand, it serves as a dynamic data module in the LLM instruction prompt words of the role agent, prompting the generalization and individuality of role-playing. Similarly, the extraction of user similar event attitudes also has the same function.
[0102] Please refer to Figure 3 , among which, for the extraction of user similarity features, based on the user's historical conversation data <user_id, user basic features (gender, age, consumption level, region), hobby preference labels, the number of comments of the user in the last 7 days, the number of comments in the last 30 days, the Item_ids of the user's reading event news sequence, the user's friendship relationship, the user's comment on other user relationships, all the comment data of the user under this time series>, perform user Embedding (embedding feature) feature training to obtain the user's Embedding, so as to construct a historical user vector library; input the current user ID, and retrieve the top 5 most similar users from the user vector library through user Embedding feature extraction
[0103] Among them, the detailed process of user Embedding feature training includes:
[0104] Step A, Sample Feature Encoding: Organize user historical dialogue data, using user ID as the dimension, and refer to the following feature classifications: Single-category features are mapped to the corresponding embedding layer using one-hot encoding (8 dimensions); Multi-value features, such as hobby / preference tags, are also embedded for each value and then pooled to obtain the embedding layer for that category (16 dimensions); Numerical features (such as the number of comments / conversations in the last day, the last 7 days, and the last 30 days) are normalized, binned, and then embedded to obtain the embedding layer for that category (16 dimensions); Sequence features are modeled using DIN sequence for the Item_ids of the user's read event news sequence to obtain the embedding layer for that category (32 dimensions); Graph relationship features are obtained by sampling neighbors offline using GraphSAGE for the user's followed friends relationships and commenting user relationships to obtain the user node vector embedding (32 dimensions).
[0105] Step B, Comparative Learning Training: The goal is to make all vectors of the same user as close as possible in the final 64-dimensional space to reflect their true interests; at the same time, to keep different users as far apart as possible.
[0106] Among them, positive samples: construct positive sample pairs (for the same user) with drop-out perturbation: sequence mask 20%, multi-value tag random drop 15%, and numerical Gaussian noise; negative samples: other users in the batch (in-batch negative).
[0107] The loss function for contrastive learning is: Loss: InfoNCE (temperature τ=0.05).
[0108] Please refer to Figure 4 For extracting similar user attitudes to events, based on historical event information (event_id, news list in chronological order under the event, and user comment data list in chronological order under the event) and user historical dialogue comment data (the structure above), the event information is analyzed to understand the events and build an event database. When the current event context is input, the event database is searched to retrieve similar event database information. The specific output is shown in the figure below, where the output information describes and explains that event_id represents the event ID, user_attitude1 represents the user's event attitude tag under the event ID, and next_comment1 represents the comment content that the user will make next under this event attitude.
[0109] Specifically, the work done by understanding specific events involves converting event information and historical dialogue information into records in the event database, including event classification, event user attitude grouping aggregation, and event user attitude grouping comments.
[0110] Event Classification: This function categorizes input event information according to attributes, based on the open-source LLM Qwen3. Attribute categories cover natural disasters, accidents, social security incidents, public health, mass incidents, network and information, economics and finance, education and research, government governance, culture and sports, corporate governance, ethics and technology, and international and diplomatic issues. The specific LLM command implementation is as follows: "Input the corresponding event news information and attribute categories, and provide the most suitable attribute classification."
[0111] Event User Attitude Grouping and Aggregation: User comment information under an event is aggregated according to the user_id dimension. User event attitudes are extracted from the aggregated comment information (refer to the previous attitude extraction method). When extracting time-based attitudes, information from the previous t-1 time period is selected to obtain the event attitude groups for different users under that event, specifically represented as follows:<event_id, user_id, user_attitude_t-1, user_comments> .
[0112] Event-based user attitude grouping comments: The user_comments data in the event-based user attitude grouping aggregation is sorted chronologically, and the user comments at time t are selected as the final grouped comments. Specifically, this is represented as follows:<event_id,user_id, user_attitude_t-1, user_comment_t> .
[0113] The event database construction involves organizing the data after understanding the events, categorizing it according to each sample item.<event_id, event_type, event_user_id, event_user_attitude_t-1, user_comment_t> The output format is such that each event may correspond to multiple samples.
[0114] In the event retrieval process, the user is input with an event context, a user ID, and a list of similar user IDs. The event is then categorized based on the input time context, and data of the same event category is retrieved. Next, samples whose event_user_id matches the input user ID or similar user ID appear in the retrieved event category are selected first. If the retrieved sample event_user_id does not match the input user ID or the list of similar user IDs, the top 10 most similar samples are retrieved from the retrieved event samples using "user embedding".
[0115] The final output will retain 10 samples.<event_id,user_attitude_t-1, user_comment_t> The output will also set user_comment_t to next_comment.
[0116] Event context: This step mainly involves inputting social media information related to the event to be predicted and integrating it into an event timeline to provide context for subsequent role-playing predictions. This integration is performed using the open-source large-scale model Qwen3, with the specific format: [Event Node 1 - Time: Summary Description; Event Node 2 - Time: Summary Description; ...,].
[0117] S103. Input the event context, user characteristics, and similar characteristics into the role-playing agent in different emotional states to obtain sub-emotion comments for different emotional states.
[0118] In this application, in order to accurately predict the target user's emotional comments on the target event, color-correcting agents in different emotional states are used to obtain sub-emotional comments for different emotional states, which are then fused based on the sub-emotional comments.
[0119] In one specific embodiment of this application, the event context, user characteristics, and similarity features are input into the role-playing agent in different emotional states to obtain sub-emotional comments for different emotional states, including:
[0120] Input the event context, user characteristics, and similar characteristics into the positive emotion role-playing agent to obtain sub-emotion comments of the positive emotion state;
[0121] Input the event context, user characteristics, and similarity features into the neutral emotion role-playing agent to obtain sub-emotion comments of the neutral emotion state;
[0122] By inputting the event context, user characteristics, and similarity features into the role-playing agent for negative emotions, sub-emotional comments of the negative emotional state can be obtained.
[0123] Among them, an intelligent agent (AI agent) is a software and hardware system that can perceive the environment, make autonomous decisions, execute actions, and optimize goals. Its core is a closed loop of perception-decision-execution, which can complete complex tasks without continuous human intervention.
[0124] Specifically, the multi-agent fine-grained user agent (role-playing agents with different emotions) aims to act as the input user based on different granular emotions. It generates a comment at a future time T based on user features and similarity features extracted from the feature extraction module, providing the user with the basis for generating the comment beforehand. Three role-playing agents are provided: positive, neutral, and negative. The role-playing LLM dynamically constructs a prompt instruction based on different input users. The dynamic part involves recalling show cases based on similar features. Different user inputs correspond to different show cases in the prompt; including reference cases in the larger LLM prompt model significantly improves the model's accuracy. The specific implementation is as follows:
[0125] For the subjectively positive role of the Agent:
[0126] # Objective: You are now required to role-play a user. Given the user's tone of voice, attitude towards previous events, and contextual information about the current event, predict the role-playing user's likely comments on the event from an optimistic and positive perspective.
[0127] # Requirements: You need to follow the characteristics of the role you are playing and play it in an optimistic and positive way; you need to first output the basis for generating event comments, and then generate event comments.
[0128] # Dynamic reference few shot, {some_sim_case};
[0129] # Input:
[0130] The user's tone and style you will be portraying are: {Feature}, and the user's current attitude towards the event is: {user_attitude};
[0131] Current event context: {event_info};
[0132] Current role-playing optimization suggestions: {advice_content};
[0133] # Output: <reason> Your basis< / reason> , <comment>Emotional commentary.
[0134] Similarly, the implementation methods for neutral and negative agent roles can simply replace the "optimistic and positive dimension" mentioned above.
[0135] Thus, we have obtained three emotional comments from the multi-agent fine-grained agent and their corresponding generation basis.
[0136] In this instruction, some_sim_case refers to the Top 10 cases recalled in the similarity feature extraction in the first step; Feature represents the user's speaking style features; user_attitude represents the user's attitude towards the event; event_info represents the event context; and advice_content represents objective suggestions. The open-source LLM Qwen3 is used to execute the LLM.
[0137] S104. Utilize a behavioral psychologist agent to fuse the latest sub-emotional comments to obtain a total emotional comment, score the total emotional comment, and generate optimization suggestions.
[0138] After obtaining sub-emotional comments representing different emotional states, a psychologist-based intelligent agent merges the latest batch of sub-emotional comments to obtain a total emotional comment. This total emotional comment, compared to sub-emotional comments representing single emotional attitudes, more closely approximates the actual emotional comments that the target user might make. Once the total emotional comment is obtained, it can be scored, and optimization suggestions can be generated based on it.
[0139] After obtaining the sub-sentiment comments in each iteration, step S104 is executed once.
[0140] In one specific embodiment of this application, scoring the overall sentiment rating and generating optimization suggestions includes:
[0141] Score the overall sentiment comments;
[0142] Review the overall sentiment comments to identify anomalies that are inconsistent with the target users;
[0143] Identify the anomalies as areas for optimization and improvement.
[0144] Specifically, the behavioral psychologist agent's core objectives are, on the one hand, to collect emotional comments from an objective and consistent perspective, summarizing and categorizing them into a reasonable emotional comment; on the other hand, to review the summarized emotional comments, such as those containing "persona collapse" (tone / attitude inconsistent with the user's history), and to provide specific scores and feedback (i.e., optimization suggestions).
[0145] S105. Feedback the optimization suggestions to the role-playing agents in different emotional states to obtain the new sub-emotion comments after optimization by the role-playing agents, until the iteration threshold is reached.
[0146] Through multi-round interactive dialogues between the behavioral psychologist agent and the multi-agent fine-grained user agent, the consistency between emotional comments and user nature is iteratively improved. Specifically, each time, the behavioral psychologist agent records the summarized total emotional comments, their scores, and provides optimization suggestions for improvement. These suggestions are fed back to the multi-agent fine-grained agent as the `advice_content` value, thereby enabling each role-playing agent to optimize the newly output sub-emotional comments.
[0147] In one specific embodiment of this application, optimization suggestions are fed back to the role-playing agent in different emotional states to obtain a new sub-emotion comment output by the role-playing agent after optimization, including:
[0148] The optimization suggestions are fed back to the role-playing agents in different emotional states;
[0149] By using role-playing agents in different emotional states, sub-emotional comments for each emotional state are re-output based on optimization suggestions.
[0150] In other words, the same optimization suggestion is fed back to role-playing agents in different emotional states. These agents then re-output sub-emotional comments based on the optimization suggestion, each corresponding to a different emotional state. This process continues until an iteration threshold is reached, resulting in multiple total emotional comments and their corresponding scores.
[0151] The iteration threshold can be set according to the actual situation, such as 5 times, 10 times, 15 times, or other different values. The more iterations, the more sentiment comments are available. The total number of sentiment comments is equal to the number of iterations.
[0152] S106. After reaching the iteration threshold, determine the target total sentiment comment with the highest score from the total sentiment comments generated in multiple rounds.
[0153] After obtaining the iteration threshold, the highest-rated total sentiment comment from several rounds of generated total sentiment comments can be selected as the target total sentiment comment. In other words, the target total sentiment comment is considered as the target user's predicted comment on a target event that has not yet occurred.
[0154] S107. Use a sentiment analysis model to predict the sentiment of the target's total emotional comments and obtain the target users' sentiment labels for the target event.
[0155] Sentiment analysis models can be used to predict the overall sentiment of the target user's comments, thus obtaining the target user's sentiment tag for the target event. This sentiment tag can then be used to optimize or select appropriate responses to the target event.
[0156] The method provided in this application includes: obtaining the user identifiers of a target event and a target user; wherein the target event has not occurred; extracting the event context of the target event, and using the user identifier to extract user features and similar features from historical dialogue comment data; inputting the event context, user features, and similar features into role-playing agents in different emotional states to obtain sub-emotional comments in different emotional states; using a behavioral psychologist agent to fuse the latest sub-emotional comments to obtain a total emotional comment, and scoring the total emotional comment and generating optimization suggestions; feeding back the optimization suggestions to role-playing agents in different emotional states to obtain new sub-emotional comments output by the role-playing agents after optimization, until an iteration threshold is reached; after reaching the iteration threshold, determining the target total emotional comment with the highest score from the total emotional comments generated in multiple rounds; and using a sentiment analysis model to predict the sentiment of the target total emotional comment to obtain the target user's sentiment label for the target event.
[0157] In this application, even before the target event has occurred and before the user has commented on it, the event context can be extracted based on the target event, and user features and similar features can be extracted from historical dialogue comment data based on the target user's user identifier. Considering that the target event has not yet occurred and the target user has not commented on it, to know the target user's emotional attitude towards the target event, the target user's emotional comment on the target event can be simulated, and then the emotional attitude can be predicted based on the emotional comment. Specifically, to make the prediction results more accurate, the event context, user features, and similar features can be input into role-playing agents in different emotional states, thus obtaining sub-emotional comments for different emotional states. Then, a behavioral psychologist agent is used to fuse the latest sub-emotional comments to obtain a total emotional comment, which is then scored and optimization suggestions are generated. The optimization suggestions are then fed back to the role-playing agents in different emotional states to obtain newly output sub-emotional comments after optimization, until an iteration threshold is reached. That is, through rounds of iteration, multiple rounds of corresponding total emotional comments and their scores can be obtained. Finally, after reaching the iteration threshold, the target total sentiment comment with the highest score is determined from the total sentiment comments generated in multiple rounds. In this way, the prediction of the target user's sentiment towards a target event that has not yet occurred is achieved.
[0158] It is evident that this application can not only predict users' emotional attitudes toward events that have not yet occurred, but also combine multimodal data with multi-role intelligent agents and behavioral psychologist intelligent agents to achieve multiple iterations, thereby improving the accuracy of sentiment prediction.
[0159] Corresponding to the above method embodiments, this application also provides an emotion tag acquisition device. The emotion tag acquisition device described below can be referred to in correspondence with the emotion tag acquisition method described above.
[0160] As shown in Figure*, the device includes the following modules:
[0161] Input module 101 is used to obtain the target event and the user identifier of the target user; wherein, the target event has not occurred;
[0162] The feature extraction module 102 is used to extract the event context of the target event and extract user features and similar features from historical dialogue comment data using user identifiers;
[0163] The multi-role-playing module 103 is used to input event context, user characteristics and similar characteristics into role-playing agents in different emotional states to obtain sub-emotion comments in different emotional states.
[0164] The iterative correction module 104 is used to fuse the latest different sub-emotion comments using a behavioral psychologist agent to obtain a total emotion comment, score the total emotion comment and generate optimization suggestions; the optimization suggestions are fed back to the role-playing agents of different emotion states to obtain the new sub-emotion comments output by the role-playing agents after optimization, until the iteration threshold is reached;
[0165] The sentiment prediction module 105 is used to determine the target total sentiment comment with the highest score from the total sentiment comments generated in multiple rounds after reaching the iteration threshold; and to use the sentiment analysis model to predict the sentiment of the target total sentiment comment to obtain the target user's sentiment label for the target event.
[0166] The apparatus provided in this application includes: acquiring a target event and a user identifier of a target user; wherein the target event has not occurred; extracting the event context of the target event, and using the user identifier to extract user features and similar features from historical dialogue comment data; inputting the event context, user features, and similar features into role-playing agents in different emotional states to obtain sub-emotional comments in different emotional states; using a behavioral psychologist agent to fuse the latest sub-emotional comments to obtain a total emotional comment, and scoring the total emotional comment and generating optimization suggestions; feeding back the optimization suggestions to role-playing agents in different emotional states to obtain new sub-emotional comments output by the role-playing agents after optimization, until an iteration threshold is reached; after reaching the iteration threshold, determining the target total emotional comment with the highest score from the total emotional comments generated in multiple rounds; and using a sentiment analysis model to predict the sentiment of the target total emotional comment to obtain the target user's sentiment label for the target event.
[0167] In this application, even before the target event has occurred and before the user has commented on it, the event context can be extracted based on the target event, and user features and similar features can be extracted from historical dialogue comment data based on the target user's user identifier. Considering that the target event has not yet occurred and the target user has not commented on it, to know the target user's emotional attitude towards the target event, the target user's emotional comment on the target event can be simulated, and then the emotional attitude can be predicted based on the emotional comment. Specifically, to make the prediction results more accurate, the event context, user features, and similar features can be input into role-playing agents in different emotional states, thus obtaining sub-emotional comments for different emotional states. Then, a behavioral psychologist agent is used to fuse the latest sub-emotional comments to obtain a total emotional comment, which is then scored and optimization suggestions are generated. The optimization suggestions are then fed back to the role-playing agents in different emotional states to obtain newly output sub-emotional comments after optimization, until an iteration threshold is reached. That is, through rounds of iteration, multiple rounds of corresponding total emotional comments and their scores can be obtained. Finally, after reaching the iteration threshold, the target total sentiment comment with the highest score is determined from the total sentiment comments generated in multiple rounds. In this way, the prediction of the target user's sentiment towards a target event that has not yet occurred is achieved.
[0168] It is evident that this application can not only predict users' emotional attitudes toward events that have not yet occurred, but also combine multimodal data with multi-role intelligent agents and behavioral psychologist intelligent agents to achieve multiple iterations, thereby improving the accuracy of sentiment prediction.
[0169] In one specific embodiment of this application, the feature extraction module is specifically used to query the embedded features of a target user from a user vector library using the user identifier; wherein, the user vector library is constructed based on historical dialogue comment data;
[0170] The most similar users are retrieved from the user vector database using embedded features, and the retrieved users are identified as user similarity features.
[0171] By utilizing event context, the event database is searched to obtain similar event information, and this information is then used to identify users' attitudes toward similar events. The event database is constructed based on historical event information and historical dialogue and comment data.
[0172] User similarity features and user attitudes toward similar events are identified as similarity features.
[0173] In one specific embodiment of this application, the feature extraction module is specifically used to obtain historical dialogue comment data corresponding to each user;
[0174] User node vectors are obtained by dividing the data according to preset features, using user identifiers as the dimension.
[0175] The user node vectors are trained by combining contrastive learning training.
[0176] After training is completed, the embedded features of each user are stored in the user vector library.
[0177] In one specific embodiment of this application, the feature extraction module is specifically used to classify the attributes of events using historical event information;
[0178] Events under different attribute categories are aggregated according to user identifier dimension, and user attitudes are extracted from the aggregated comment information;
[0179] The extracted user attitudes are sorted by time, and user comments at a specified time are selected as group comments;
[0180] Historical events are written into the event database according to event identifier, event attribute classification, event user identifier, event attitude group under different users, and group comments.
[0181] In one specific embodiment of this application, the feature extraction module is specifically used to obtain target historical dialogue comment data corresponding to the user identifier; wherein, the historical dialogue comment data includes images and text, the images include emoticons, and the text includes character emoticons;
[0182] Extract tone and style features from target historical dialogue comment data;
[0183] Input tone style features and event upper bound information corresponding to the target historical dialogue comment data into the multimodal large model to obtain event attitude features;
[0184] The characteristics of tone and style and attitude towards events are identified as user characteristics.
[0185] In one specific embodiment of this application, a multi-role-playing module is specifically used to input event context, user characteristics and similar characteristics into a positive emotion role-playing agent to obtain sub-emotion comments of the positive emotion state.
[0186] Input the event context, user characteristics, and similarity features into the neutral emotion role-playing agent to obtain sub-emotion comments of the neutral emotion state;
[0187] By inputting the event context, user characteristics, and similarity features into the role-playing agent for negative emotions, sub-emotional comments of the negative emotional state can be obtained.
[0188] In one specific embodiment of this application, the iterative correction module is specifically used to score the total sentiment comments;
[0189] Review the overall sentiment comments to identify anomalies that are inconsistent with the target users;
[0190] Identify the anomalies as areas for optimization and improvement.
[0191] The optimization suggestions are fed back to the role-playing agents in different emotional states;
[0192] By using role-playing agents in different emotional states, sub-emotional comments for each emotional state are re-output based on optimization suggestions.
[0193] Corresponding to the above method embodiments, this application also provides an electronic device. The electronic device described below can be referred to in conjunction with the emotion tag acquisition method described above.
[0194] See Figure 4 As shown, the electronic device includes:
[0195] Memory 332 is used to store computer programs;
[0196] The processor 322 is used to implement the steps of the emotion tag acquisition method in the above method embodiment when executing a computer program.
[0197] For details, please refer to Figure 5 , Figure 5 This is a schematic diagram of the specific structure of an electronic device provided in this embodiment. The electronic device can vary significantly due to differences in configuration or performance. It may include one or more central processing units (CPUs) (e.g., one or more processors) and a memory 332. The memory 332 stores one or more computer programs 342 or data 344. The memory 332 can be temporary or permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the data processing device. Furthermore, the processor 322 may be configured to communicate with the memory 332 and execute the series of instruction operations stored in the memory 332 on the electronic device 301.
[0198] Electronic device 301 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.
[0199] The steps in the emotion tag acquisition method described above can be implemented by the structure of an electronic device.
[0200] Corresponding to the above method embodiments, this application also provides a readable storage medium. The readable storage medium described below can be referred to in conjunction with the emotion tag acquisition method described above.
[0201] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the emotion tag acquisition method described in the above method embodiments.
[0202] The readable storage medium can specifically be a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or any other readable storage medium capable of storing program code.
[0203] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0204] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0205] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0206] Finally, it should be noted that in this document, relationships 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 "include," "contain," or any other variations 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.
[0207] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.< / comment>
Claims
1. An emotion label acquisition method characterized by comprising: include: Obtain the target event and the user identifier of the target user; wherein the target event has not occurred; Extract the event context of the target event, and use the user identifier to extract user features and similar features from historical dialogue comment data; The event context, user characteristics, and similarity characteristics are input into role-playing agents in different emotional states to obtain sub-emotional comments for different emotional states. The behavioral psychologist agent is used to fuse the latest sub-emotional comments to obtain a total emotional comment, and the total emotional comment is scored and optimization suggestions are generated. The optimization suggestions are fed back to the role-playing agents in different emotional states to obtain the new sub-emotion comments after optimization by the role-playing agents, until the iteration threshold is reached; After reaching the iteration threshold, the target total sentiment comment with the highest score is determined from the total sentiment comments generated in multiple rounds; The sentiment analysis model is used to predict the sentiment of the total target sentiment comments, thereby obtaining the sentiment labels of the target users for the target event.
2. The method according to claim 1, characterized in that, Using the user identifier, similar features are extracted from historical dialogue comment data, including: The embedded features of the target user are queried from the user vector library using the user identifier; wherein the user vector library is constructed based on the historical dialogue comment data; Using the embedded features, retrieve several most similar users from the user vector database, and determine the retrieved users as user similarity features; Using the event context, the event database is searched to obtain similar event database information, and the event database information is identified as the user's similar event attitude; wherein, the event database is constructed based on historical event information and historical dialogue comment data; The user similarity features and the user similar event attitudes are identified as the similarity features.
3. The method according to claim 2, characterized in that, The user vector library is constructed based on the historical dialogue and comment data, including: Obtain the historical dialogue and comment data for each user; User node vectors are obtained by dividing the data according to preset features, using user identifiers as the dimension. The user node vectors are trained by combining contrastive learning training. After training is completed, the embedded features of each user are stored in the user vector library.
4. The method according to claim 2, characterized in that, The event database is constructed based on historical event information and the historical dialogue comment data, including: The historical event information is used to classify the events by attributes. Events under different attribute categories are aggregated according to user identifier dimension, and user attitudes are extracted from the aggregated comment information; The extracted user attitudes are sorted by time, and user comments at a specified time are selected as group comments; Historical events are written into the event database according to event identifier, event attribute classification, event user identifier, event attitude group under different users, and group comments.
5. The method according to claim 1, characterized in that, Using the user identifier, user features are extracted from historical dialogue comment data, including: Obtain the target historical dialogue comment data corresponding to the user identifier; wherein, the historical dialogue comment data includes images and text, the images include emoticons, and the text includes character emoticons; Extract tone and style features from the target historical dialogue comment data; Input the tone style features and the event upper limit text information corresponding to the target historical dialogue comment data into the multimodal large model to obtain the event attitude features; The tone style features and the event attitude features are determined as the user features.
6. The method according to claim 1, characterized in that, The event context, user characteristics, and similarity characteristics are input into role-playing agents in different emotional states to obtain sub-emotional comments for different emotional states, including: The event context, user characteristics, and similarity characteristics are input into the positive emotion role-playing agent to obtain sub-emotion comments of the positive emotion state; The event context, user characteristics, and similarity characteristics are input into the neutral emotion role-playing agent to obtain sub-emotion comments of the neutral emotion state; The event context, user characteristics, and similarity characteristics are input into the role-playing agent for negative emotions to obtain sub-emotion comments of the negative emotion state.
7. The method according to any one of claims 1 to 6, characterized in that, The overall sentiment comments are scored and optimization suggestions are generated, including: The overall sentiment comments are scored; The total sentiment comments are reviewed to identify anomalies that are inconsistent with the target user. The aforementioned anomalies are identified as areas for optimization and improvement. Accordingly, the optimization suggestions are fed back to the role-playing agents in different emotional states to obtain the optimized sub-emotion comments from the role-playing agents, including: The optimization suggestions are fed back to the role-playing agents in different emotional states; Using role-playing agents in different emotional states, sub-emotional comments for different emotional states are re-output based on the optimization suggestions.
8. An emotion tag acquisition device, characterized in that, include: An input module is used to obtain the target event and the user identifier of the target user; wherein the target event has not occurred; The feature extraction module is used to extract the event context of the target event and, using the user identifier, extract user features and similar features from historical dialogue comment data; A multi-role-playing module is used to input the event context, the user features, and the similar features into role-playing agents in different emotional states to obtain sub-emotional comments in different emotional states. The iterative correction module is used to fuse the latest different sub-emotion comments using a behavioral psychologist agent to obtain a total emotion comment, score the total emotion comment and generate optimization suggestions; the optimization suggestions are fed back to the role-playing agents of different emotion states to obtain the newly output sub-emotion comments after optimization by the role-playing agents, until the iteration threshold is reached; The sentiment prediction module is used to determine the target total sentiment comment with the highest score from the total sentiment comments generated in multiple rounds after reaching the iteration threshold; and to perform sentiment prediction on the target total sentiment comment using a sentiment analysis model to obtain the target user's sentiment label for the target event.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the emotion tag acquisition method as described in any one of claims 1 to 7 when executing the computer program.
10. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the emotion tag acquisition method as described in any one of claims 1 to 7.