CN113254576B - Method and device for predicting and tracing human behaviors and emotions - Google Patents

Method and device for predicting and tracing human behaviors and emotions Download PDF

Info

Publication number
CN113254576B
CN113254576B CN202110453104.8A CN202110453104A CN113254576B CN 113254576 B CN113254576 B CN 113254576B CN 202110453104 A CN202110453104 A CN 202110453104A CN 113254576 B CN113254576 B CN 113254576B
Authority
CN
China
Prior art keywords
emotion
behavior
label
individual
task
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110453104.8A
Other languages
Chinese (zh)
Other versions
CN113254576A (en
Inventor
胡玥
谢玉强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Information Engineering of CAS
Original Assignee
Institute of Information Engineering of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute of Information Engineering of CAS filed Critical Institute of Information Engineering of CAS
Priority to CN202110453104.8A priority Critical patent/CN113254576B/en
Publication of CN113254576A publication Critical patent/CN113254576A/en
Application granted granted Critical
Publication of CN113254576B publication Critical patent/CN113254576B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3346Query execution using probabilistic model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/211Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/02Knowledge representation; Symbolic representation

Abstract

The invention discloses a method and a device for predicting and tracing human behaviors and emotions, which are used for uniformly modeling the incidence relation among emotions, demands and behaviors, can simulate individual activities through the relation among the emotions, the demands and the behaviors from the cognitive angle and realize four tasks of emotion prediction, emotion tracing, behavior prediction and behavior tracing. The method can perform preliminary and effective emotion prediction and tracing and behavior prediction and tracing on the text content, better reveal the essential relation among the demand, the emotion and the behavior, help researchers to trace the origin of the emotional response and the behavior, and provide more reasonable explanation for analysis.

Description

Method and device for predicting and tracing human behaviors and emotions
Technical Field
The invention belongs to the field of natural language processing, and particularly relates to a method and a device for predicting and tracing human behaviors and emotions.
Background
All social activities of a human individual are the process of the individual interacting with the external environment (physical world outside the individual, abstract events, etc.) driven by the individual's heart, and are embodied as follows: the individual, through its behavior, affects the external environment, which affects the individual by producing an emotional response in the individual's mind. The whole interaction process is completed and realized through the cooperative work of the individual mental demand, the emotion and the behavior. Therefore, the generation and change rules of the emotion, demand and behavior factors in the individual activities are comprehensively analyzed, the incidence relation among the emotion, demand and behavior factors is modeled, the root cause of the human activities can be deeply analyzed from the cognitive level, and the analysis result is reasonably explained. The technology has profound influence on multiple fields such as intelligent conversation, story generation, recommendation system and public opinion analysis, and has wide application prospect.
Traditional emotion analysis techniques have mainly focused on emotion detection and have been widely used (Socher et al, 2013;
hamilton et al, 2016). Although the most advanced emotion analysis systems today can detect the polarity of the text (Zhang et al, 2018) or consider fine-grained classes (aka aspects) that may cause emotion (Pontiki et al, 2016), the interpretation of the analysis of predictions and their causes is still very limited.
In recent years, there have been a number of large-scale data sources (Ding and Riloff, 2018; Rahimotoghi et al, 2017) exploring human needs, actions or emotions. Rashkin et al (2018a) propose a Story common sense to explain the reason for the change in the psychological state of a person in a Story. Sap et al, 2019b introduced SOCIAL IQA for exploring mood and SOCIAL intelligence in a daily setting. Then, Event2mind (Rashkin et al, 2018b), ATOMIC (Sap et al, 2019a) and COMET-ATOMIC2020(Hwang et al, 2020) collected different "what-if" psychological relationships.
In addition, some work (Gaonkar et al, 2020; Yuan et al, 2020) considered the introduction of various mental states into NLP tasks, such as mood analysis. Li and Hovy, 2017 explored the importance of human emotion analysis requirements. Otani and Hovy, 2019 consider human motivation as a driving force for human emotion, enhancing the ability of the system to perform emotional analysis. In addition, a great deal of work (Du et al, 2019; Paul and Frank, 2019; Bosselt and Choi, 2019) converts mental state knowledge into pre-trained models and applies it to conditional story generation tasks. Based on gpt (come) pre-trained on a common sense corpus, many work have come to consider the mind-generated mental states as conditions for story generation (Xu et al, 2020; Brahman and Chaturvedi, 2020; amanabolu et al, 2020; Yuan et al (2020).
However, the prior art has the following problems:
1. existing data resources focus on analyzing the binary relationship between human behavior and mental state (demand or emotion).
2. The prior art focuses on the analysis of the relationship between "demand and action" or "emotion and action", and does not uniformly consider the demand, action and emotion of human beings.
Disclosure of Invention
The invention provides a method and a device for predicting and tracing human behaviors and emotions.
The technical scheme of the invention comprises the following steps:
a method for predicting and tracing human behaviors and emotions comprises the following steps:
1) selecting element combinations to be input into a baseline system according to task types, wherein the task types comprise: the emotion prediction method comprises the following steps of emotion prediction tasks, emotion tracing tasks, behavior prediction tasks or behavior tracing tasks, wherein the element combination of the emotion prediction tasks comprises the following steps: the emotion tracing method comprises an individual X, a requirement label N and a text behavior A, wherein element combinations of the emotion tracing task or the behavior tracing task comprise: individual X, emotion tag E and text behavior A, and the element combination of the behavior prediction task comprises: individual X, requirement label N and emotion label E;
2) the baseline system selects a processing path according to the element combination, and processes the processing path through the following strategies to obtain an emotion prediction task result, an emotion traceability task result, a behavior prediction task result or a behavior traceability task result:
2.1) when the element combination comprises an individual X, a requirement label N and a text behavior A, processing is carried out by the following steps:
2.1.1) inputting a first natural language text sequence generated by the individual X and the requirement label N into an encoder to obtain a code h s1 And according to the code h s1 Acquiring first probability distribution of each emotion category label;
2.1.2) inputting the text behavior A into an emotion concept knowledge base to obtain the importance degree of each general knowledge in the text behavior A under each emotion category label, and obtaining first distribution of emotion general knowledge by combining with a set lookup table;
2.1.3) voting according to the first probability distribution of each emotion category label and the first distribution of emotion general knowledge, and selecting the best emotion category label to obtain an emotion prediction task result;
2.2) when the element combination comprises an individual X, an emotion tag E and a text behavior A, processing by:
2.1.1) second self generated by Individual X and Emotion tag EInputting the language text sequence into the coder to obtain a code h s2 And according to the code h s2 Acquiring second probability distribution of each emotion category label or probability distribution of each action category label;
2.1.2) inputting the text behavior A into a requirement concept knowledge base to obtain the importance degree of each common sense in the text behavior A under each emotion category label or each action category label, and obtaining second distribution of emotion common sense knowledge or behavior common sense knowledge distribution by combining with a set lookup table;
2.1.3) voting according to the second probability distribution of each emotion category label and the second distribution of emotion common sense knowledge, or the probability distribution of each behavior category label and the distribution of behavior common sense knowledge, and selecting the optimal emotion category label or behavior category label to obtain an emotion traceability task result or a behavior traceability task result;
and 2.3) when the element combination comprises an individual X, a demand label N and an emotion label E, inputting the individual X, the demand label N and the emotion label E into the language model to obtain a behavior prediction task result.
Further, in the step 1), the baseline system preprocesses the input demand label N and the emotion label E; the pretreatment comprises the following steps: and expanding the semantic information of the demand label N or the emotion label E through a set prompt template.
Further, the encoder includes: a GRU model, a BERT model, or a RoBERTa model.
Further, preprocessing the text behavior A before the text behavior A is input into an emotion concept knowledge base; the pretreatment comprises the following steps: stop words and high frequency words are deleted.
Further, constructing an emotion concept knowledge base through the following steps:
1) collecting the emotional common sense concept;
2) calculating the occurrence number of each common sense concept in each emotion category to form a matrix
Figure BDA0003039581150000031
Wherein d is c Dimension of common sense concept, d n As dimensions in emotion categories;
3) Calculating the importance degree of each common sense concept in each emotion category
Figure BDA0003039581150000032
Wherein
Figure BDA0003039581150000033
The method is characterized in that the method is a jth common sense concept of an ith label, s is a current label, Ct is the frequency of the common sense concept, V is the size of a word corresponding to the common sense concept, and N is the total number of the common sense concepts.
Further, the voting method comprises the following steps: using a pooling mechanism; the pooling mechanism includes: average pooling, maximum pooling, or sum pooling.
Further, the language model includes: BERT model or GPT-2 model.
Further, obtaining an emotion prediction task result through the following steps:
1) setting a slot filling template of an emotion prediction task;
2) and filling the prediction result corresponding to the optimal emotion category label into a slot filling template by using a slot filling method so as to obtain an emotion prediction task result interpreted by the natural language.
A storage medium having stored therein a computer program, wherein the computer program is arranged to perform the above-mentioned method when executed.
An electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer to perform the method as described above.
Compared with the prior art, the invention has the following beneficial effects:
1. a cognitive framework, CogFrHA, is proposed for analyzing human needs, behavior and emotion, which can model individual activities from a cognitive perspective through relationships between emotion, need and action.
2. A data set HAIL is established and four new tasks are introduced: the system can realize emotion prediction, emotion traceability, behavior prediction and behavior traceability according to requirements, behaviors and text input of the emotions.
3. From the cognition perspective, individual activities are simulated through the relationship among emotion, demand and actions, and the relationship among the emotion, the demand and the actions is considered in a unified way; experiments show that compared with the existing method, the essential relation among the requirements, the emotion and the behaviors can be better revealed by the framework. This will help researchers to track the origin of emotional responses and behaviors and provide a more reasonable explanation for the analysis.
4. The method can perform preliminary effective emotion prediction and source tracing, as well as behavior prediction and source tracing on the text content.
Drawings
FIG. 1 is a composition diagram of the CogFrHA framework.
Figure 2 schematic diagram of the basic elements of the CogFrHA framework.
Fig. 3 is a schematic diagram of a direct active mode and an indirect active mode.
FIG. 4 is a schematic diagram of demand versus behavior versus demand versus emotional response.
Fig. 5 is a schematic diagram of the data distribution of the HAIL data set.
FIG. 6 is a general model architecture diagram of four new task types of the present invention.
FIG. 7 is a diagram of an example distribution of a knowledge base of emotion concepts.
FIG. 8 is a schematic diagram of an example distribution of a knowledge base of requirements concepts.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a new Human individual activity cognitive Framework CogFrHA (cognitive Framework of Human activities) for uniformly modeling the association relation of emotion, demand and behavior, which comprises the following specific contents: in particular, we define components and primitives of human activities. Meanwhile, we propose the concept of human activity start and end points and classify individual activities into direct activity patterns and indirect activity patterns. Furthermore, we consider that the essential factor is that in order to achieve emotional reactions and produce actions, the human needs are the origin of emotional reactions and actions. Then, we define two basic causal relationships to model the relationship between demand, action and emotion. These relationships will help researchers to track the origin of emotional responses and behaviors and provide a more reasonable explanation for analysis.
One, CogFrHA framework
By utilizing the causal relationship between the demand and the behavior, deep behavior prediction analysis and behavior tracing analysis can be performed on the individual behavior; by using the causal relationship between the demand and the emotion response, emotion prediction analysis and emotion tracing analysis which are deeper than the previous work can be performed on the individual emotion, and a reasonable explanation is given to the analysis result.
We believe that the activity of a human individual (Mankind's individual) is the process by which the individual interacts with the external environment, driven by its heart. We model the framework from the point of interaction of the two and analyze each part in the framework, and the main contents include:
1) defining the composition of a framework;
2) defining basic elements of the framework;
3) defining the action and the mutual relation of each element in the individual activity;
4) the definition of the relationship between "demand and behavior" and the definition of the relationship between "demand and emotion" are proposed.
1.1 composition of the CogFrHA framework
CogFrHA consists of two parts, as shown in fig. 1, including a human individual and the external environment, where the individual is represented by needs, behaviors, and emotions, including emotional response and emotional desire; external environment is defined herein as factual events and individual behavioral events and outcomes that can have an effect on the mind of an individual, collectively referred to herein as "external environment. E _ rac is the emotional response and E _ exp is the emotional expectation.
1.2 basic elements of the CogFrHA framework
In CogFrHA, the basic elements of individual activity are as in figure 2, including: mental needs, emotional responses, emotional desires, and behaviors, where traditional "motivations" are interpreted in our framework as being formed by the combination of an individual's mental needs and its emotional desires. It is not an essential element in the framework, since its role can be replaced by the mental needs and emotional expectations:
(1) internal requirement: is the inherent physiological and psychological needs of human beings and is the root of the generation of human activities. Different psychological theories have different partitioning systems for human needs. The requirement is divided into five levels of physiological requirement, safety requirement, love and attribution, self-respect requirement and mental requirement by adopting a Maslow requirement level model.
(2) Emotional reaction: the emotional response is the psychological response of the individual internal demand to the satisfaction degree of the external environment, which is formed by the internal demand (internal cause) and the external environment (external cause) together, when the external environment meets the internal demand, the emotional response generates positive direction, otherwise, when the external environment can not meet the internal demand, the emotional response generates negative direction, according to the difference of the satisfaction degree, the emotional response can be divided into different grades, and when the internal demand is unrelated with the external environment, the emotional response does not generate. We use Plutchik base emotion to classify emotions into eight categories: joy, trust, sadness, surprise, fear, disgust, anger, expectation.
(3) Emotional expectation: is the emotion corresponding to a certain demand and eager about the demand, and the emotion expectation is generated as a part of participation behaviors of the emotion, wherein the emotion expectation in the invention is obtained through statistical results on the HAIL data set.
(4) Behavior: the action in the invention is performed under the psychological condition that a person has certain needs and hopes to meet the needs, and is the language which is generated by the person under the psychological condition that the person has certain internal needs and hopes to meet the needs and affects the external environment. Here we define behaviors in the form of < actor, predicate, victim > triplets.
1.3 the roles and interrelationships of the elements in the individual activities
Human individual activity is the process by which an individual interacts with the external environment, driven by his or her mind. We define an activity of an individual as: the individual generates a certain internal demand as a starting point, information communication with the external environment is carried out, the individual obtains a certain emotional reaction as an ending point, and one individual activity is completed.
There are two ways to move about, as in fig. 3:
1) the individual directly obtains information from the outside, and emotional response is generated, and behavior is not sent out, which is called as a direct activity mode;
2) the individual emits a behavior that affects the external environment, which affects the outcome of the individual's emotional response. We call "indirect activity mode".
Direct active mode: individuals respond emotionally to the external environment driven by some internal demand: (1) when the external environment meets the individual internal demand, positive emotions are generated, and positive emotions of different levels are generated according to different satisfaction degrees, (2) when the external environment cannot meet the individual internal demand, negative emotions are generated, and negative emotions of different levels are generated according to the dissatisfaction degrees. The activity process only comprises an information acquisition link.
Indirect activity mode: the individual is motivated by the mental demand and the emotional anticipation, and the behavior is driven by the motivation, and the result of the behavior influences the individual, namely, (1) positive emotion is generated when the result meets the mental demand of the individual, and different levels of positive emotion are generated according to different satisfaction degrees, (2) negative emotion is generated when the external environment cannot meet the mental demand of the individual, and different levels of negative emotion are generated according to the dissatisfaction degrees. The activity link comprises two links of behavior generation and information acquisition.
By analyzing, we can see that the analysis of individual activities can be classified into two basic links of 'information acquisition' and 'behavior generation'. Wherein, the 'information acquisition link' analyzes how individual emotional reactions are generated and what the root cause of the generation is; the 'behavior generation link' analyzes how behaviors are generated and what is the root cause of the generation. Because the internal demand is the internal source of individual behavior and emotional response, the generation and the generation reason of the behavior can be deeply analyzed by analyzing and modeling the relationship between the demand and the behavior, and the generation reason of the emotion can be deeply analyzed by analyzing and modeling the relationship between the demand and the emotion.
1.4 "demand vs. behavior relationship" and "demand vs. emotional response relationship" definitions
"demand-to-behavior relationship": the causal relationship between the demand and the behavior is under the action of emotional expectation, wherein the demand is a cause and the behavior is an effect, and the action of the emotional expectation is determinative of the manner and the degree of the behavior. (see A in FIG. 4)
Example (c): if the demand is 'food demand', the demand can be happy and satisfied corresponding to the emotion expectation, and the like positive emotions can be basically met; if the emotional desire is happy, the individual's behavior may be "go to a high restaurant to eat a large meal," if the emotional desire is substantially satisfied, the individual's behavior may be "go to a dining hall to eat a lunch.
Based on the relationship, deep behavior prediction and behavior tracing analysis can be performed on individual behaviors, and reasonable explanation can be given to analysis results.
Behavior prediction (demand → behavior)
The behavior that an individual will produce can be predicted given the individual's needs and its corresponding emotional expectations.
Behavior tracing (behavior → demand)
From the individual behavior, the intrinsic source (intrinsic demand) that produces this behavior can be analyzed.
"demand-to-emotional response relationship": the emotional response of an individual is formed by the internal demand and the external environment, but the emotional response can be generated only when the individual has the internal demand, namely, the internal demand is the internal source of the emotional response, the external environment is the external condition for determining what emotional response is generated, and the relationship of the three is defined as follows: the causal relationship between demand and emotional response is the result of the participation of the external environment, where demand is the cause and emotional response is the effect, and the role of the external environment is to determine what effect will be produced under known conditions of mental demand. (see B in FIG. 4)
Based on the relationship, the emotion prediction and emotion tracing analysis can be carried out deeper than before on individual emotional reactions, and reasonable explanation is given to analysis results.
Emotion response prediction (demand → emotional response)
Given the individual's needs and external circumstances, the emotional response that the individual will produce can be predicted.
Emotional response tracing (emotional response → demand)
According to the external environment and the emotional response of the individual, the intrinsic cardiac needs for producing the emotional response can be analyzed.
Second, implementation mode of predicting and tracing behaviors and emotions
2.1 task definition and data Collection
To verify the effectiveness of our cognitive framework, we constructed a data set hail (human Activities In life) and proposed two deep emotion analysis tasks: an emotion prediction task and an emotion traceability task are provided, and two deep behavior analysis tasks are also provided: and the behavior prediction task and the behavior tracing task respectively provide corresponding baseline systems for the four tasks.
2.2 task definition
1) Behavior prediction tasks: and predicting/reasoning the behavior of the individual according to the requirements and the corresponding emotion expectation (if the emotion expectation value is not specified, selecting the maximum forward emotion as the emotion expectation value according to common sense).
2) Behavior tracing task: the mental requirements for generating the behaviors are analyzed according to the individual behaviors.
3) And (3) emotion prediction task: the emotional response of the individual is predicted/inferred according to the internal demand and the external environment.
4) And (3) emotion tracing task: and analyzing the internal demand for generating the emotional response according to the emotional response and the external environment.
2.3 data Collection
We have created a new data set HAIL collected from the existing resource Story Commonsense (Rashkin et al, 2018a) using NLP tools and manual annotations. We make statistics on the HAIL dataset. As can be seen from FIG. 5, the label distribution of the data is relatively uniform, which is beneficial to the learning of the model.
2.4 Baseline System
The general system architecture for these four tasks is shown in fig. 6. We describe each system input below. In the emotion prediction task, an individual X, a label of a demand N and a text behavior A are input into the system. In the emotion tracing and behavior tracing tasks, the input to the system is emotion tags E, X and A. Behavior prediction tasks X, N, and E are assigned to generators. In addition, we design a simple hinting template to extend the semantic information of requirements and emotion tags and to point out individuals who possess requirements and emotions. For example, in the emotion prediction task, the template includes words (audios, has, needs) and locations to be filled in by the tags.
2.5 encoder
We describe the encoder below:
1) GRU (Chung et al, 2014) is a single-layer dual GRU for encoding input text and concatenating the final time-step hidden states from both directions to produce a sentence representation h s
2) BERT (Devlin et al, 2019): we used BERT for classification of text sequences according to the author's settings for the classification task.
3) RoBERTa (Liu et al, 2019) is an improved more robust BERT that shows the most advanced performance in many NLP tasks. Furthermore, we add an extra tag to each sentence. We use<s>As a sentence representation h s
2.6 knowledge base
We introduce a method to compute the distribution of common sense to all classes (needs/emotions) in the external environment (corpus). In this context, common sense knowledge refers to common sense concepts (words) that appear in an external environment (corpus) with a particular meaning.
Requirement concept knowledge base
We build the knowledge base of the concept of the demand in three steps. First, we extract a representative common sense concept. Then, we calculate the number of occurrences of each common sense concept in the requirement category, i.e., the number of occurrences of each common sense concept on each label, to form a matrix
Figure BDA0003039581150000081
Wherein d is c And d n Respectively, the dimensions of the concept and the requirements. The last step is to calculate the importance degree of each word (common sense) under each category label according to the matrix
Figure BDA0003039581150000082
Wherein
Figure BDA0003039581150000083
J is the jth concept of the ith label (s represents the current label), Ct is the number of times the concept appears, V is the size of the vocabulary (obtained by counting the number of independent words), and n is the total number of occurrences of the concept.
Emotional concept knowledge base
Also, we set up the emotional concept knowledge base through the above method. The difference is in the classification and dimension of the Matrix. In the emotional concept knowledge base, matrix
Figure BDA0003039581150000091
Wherein d is c And d e The dimensions of the concept and the number of emotions, respectively.
In this way, the distribution of each concept under each label can be calculated. Based on our proposed training set of H AIL datasets, we automatically build a knowledge base of needs and emotions. Examples of which are shown in fig. 7 and 8, respectively. These two knowledge bases can be used to make predictions or to assist in the decision-making of deep models. In addition, they can be used to evaluate or interpret the prediction.
2.7 classifier
Neural distribution of an encoder
Once the code h is extracted s By the sentence of (1), we pass through the MLPBy sorting tokens
Figure BDA0003039581150000095
Computing an emotion tag or demand tag P z Probability distribution of (2):
P z =W 2 tanh(W 1 h s +b 1 )
where H is the dimension of the hidden layer, weight
Figure BDA0003039581150000092
Offset amount
Figure BDA0003039581150000093
Weight of
Figure BDA0003039581150000094
H is the dimension of the hidden layer and N is the number of labels. The predicted answer to the model corresponds to the most probable demand (/ sentiment) tag.
Prior distribution of knowledge bases
The knowledge base constructed in 2.6 can give a prior distribution of demand classes and emotion classes according to common sense concepts in operation, which corresponds to the prior distribution in fig. 7 and 8. We first delete stop words and high frequency words using tools such as NLTK (http:// www, NLTK. org /) and space (https:// space, io /) to extract representative common sense concepts corresponding to the current action, and use each common sense concept to search the corresponding distribution in the knowledge base, get the importance of each word (common sense) under each category label, and use the importance to search in the lookup table to obtain the distribution { P > of all common sense knowledge in the current demand (or emotion) category c1 ,P c2 ,...,P cn }。
2.8 voting Module
As shown in FIG. 6, we construct a voting gate module to vote and integrate the labels P z Probability distribution of (2) and distribution of common sense knowledge { P c1 ,P c2 ,...,P cn }. The specific voting method is as follows:
P f =f_v(P z ,[P c1 ,P c2 ,...,P cn ])
where n is the number of related concepts and f _ v represents the integration of votes by a pooling mechanism (e.g., AVER, MAX or SUM pooling). Finally, the label with the highest probability of selection is used as the final prediction result through voting.
2.9 interpretation generators
After the final prediction is obtained, the system will generate a natural language interpretation of the psychological state according to the current task, which helps researchers better understand the relationship between needs, actions and emotions. The prediction result is filled into a preset slot by using a slot filling method. A slot filling template is set for emotion prediction, emotion tracing and behavior tracing tasks.
2.10 behavior generators
Since these works (Forbes et al, 2020; Rudinger et al, 2020; Sakaguchi et al, 2020) performed well in the relevant natural Language generation task, our main interest was in evaluating pre-trained Language models (Languge models). We have adopted an encoder-decoder architecture BART (Lewis et al, 2019) or a "standard" language model GPT-2(Radford et al, 2019).
Third, Experimental part
Experiments show that deeper emotion and behavior analysis and interpretation tasks can be performed than those of the existing method under the cognitive framework.
3.1 Experimental setup
Model training: in the emotion prediction, emotion tracing and behavior tracing tasks, we use a cross-entropy loss fine-tuning encoder and an MLP classifier. For the behavior prediction task, the goal of the behavior survivor is to generate reasonable behavior of the individual given the individual, demand, and emotional expectations. Therefore, we use conditional log-likelihood loss to train rows into memories:
Figure BDA0003039581150000101
system implementation details: we train the model on the 7k HAIL training example, then select the hyper-parameters from the model that performs best on the development set (2k), and then report the results on the test set (2 k). We refine the hyper-parameter settings by grid search (choosing the learning rate in {1e-5, 2e-5}, the batch size in {8, 16, 32}, and the number of fine tuning rounds in {3, 5, 10 }), and report the highest effect. The hidden layer size of GPT-2Large (1.5B parameter) is H1024, and the hidden size of BERT/RoBERTa Large (340M parameter) is H1024. We trained using HuggingFace PyTorch (Paszke et al, 2019) to achieve all results.
Evaluation indexes are as follows: we report the micro-average precision (P), recall (R) and F1 score (https:// githu. com/scinit-leern) for emotion prediction, emotion tracing and behavior tracing tasks. For the behavior prediction task, we take two automatic measures to evaluate the results of the generated text actions in terms of content quality and rationality. To evaluate the content quality, we used the following evaluation criteria: (1) BLEU scores (Papineni et al, 2002) where n is 1, 2, 4. (2) Rouge (Li et al, 2016) score, where n is 1, 2, L. We also evaluate the generated action appearance manually. As with Song et al, (2019), we ask the staff to evaluate a pair of stories (3 very good) at a ratio of 0-3 from two different angles: (1) the content quality is as follows: indicating whether the resulting behavior is smooth; (2) the content rationality is as follows: it is evaluated whether it follows a reasonable and consistent given need and emotion.
3.2 results of the experiment
Classification task
We show the results on the test set of table 1, with the last three rows being ablation experiments.
Figure BDA0003039581150000113
Indicating that the experimental setup in the corresponding paper was followed. Our method uses a prompt template, a constructed knowledge base, RoBERTa and a voting module, scoring highest in all models. Interestingly, emotion prediction and traceability are difficult for pre-trained linguistic models. In behavioral tracing, all modelsThe results of (a) are close to the human performance. This further supports our hypothesis that the desired mood is important for the traceability behavior.
Figure BDA0003039581150000111
TABLE 1 results of emotion prediction, emotion tracing and behavior tracing
Generating tasks
In table 2, training data (train data) refers to a given input at the time of model training. N represents demand. E represents emotion.
Figure BDA0003039581150000114
Representing pre-training GPT-2 with a corresponding corpus, targeting a language model, ROC is ROCSeries (Mostafazadeh et al, 2016), and HAIL is the training set of our proposed data set. The last two columns are the results of the manual evaluation. We can conclude that the GPT-2 model has the highest BLEU-1 score, and the lowest BLEU-2, 4 scores. For Rouge scores, the BART model showed good performance. One reason is that BART has been pre-trained by the aggregation task. Human evaluation shows that the model with the prompt template and training loss designed by us is superior to a model trained in advance on a story corpus based on language model targets. Interestingly, the content of the generated behaviors is fluent and grammatical, indicating that GPT-2 and BART are as good at organizing sentences as humans.
In summary, our approach shows better performance compared to other recent models. Results for all tasks demonstrate the feasibility and importance of CogFrHA.
Figure BDA0003039581150000112
Table 2 GPT-2 and BART behavior prediction results.
3.3 analytical experiments
Ablation experiment
The method carries out ablation experiments on the methods of emotion prediction, emotion tracing and behavior tracing. As shown in the last 3 rows of Table 1, (1) represents the importance of the hinting template designed for RoBERTA. (2, 3) shows that RoBERTa and KB score similarly in emotion prediction and emotion traceability. However, RoBERTa is better for the behavioral traceability task. One interpretable guess is that behavior tracing may require more natural language understanding.
Case analysis
We will introduce interesting behavioral text generated by a generator that we trained based on GPT-2 and BART methods. From the sample of Table 3, where X is personal, N is demand, and E is emotional expectation, we find all elements important for behavioral prediction. In particular, the individual needs are more important. GPT-2 based generators tend to produce transient but reasonable behavior. But the behavior produced by BART-based generators is typically long but can recur. From the labeled sample, we can see that it is difficult to make motion predictions only for needs or emotions. Interestingly, a generator trained on a story corpus may learn the personality or other characteristics of a particular individual.
Figure BDA0003039581150000121
TABLE 3 case analysis
Visual analysis
We perform a visual analysis of the relationship between demand, action and emotion. Table 4 shows the final prediction probability matrix for demand and mood. The matrix ties together the needs, actions and emotions and indicates that the needs (mental growth) have the expected emotional expectations (i.e., expectations (0.19)). Using this matrix, we can predict sentiment from given needs and infer needs from sentiment. Therefore, we can explain the relationship between demand, action and emotion more deeply based on visualization.
Figure BDA0003039581150000131
TABLE 4 visualization of the final distribution of the model
The above embodiments are only intended to illustrate the technical solution of the present invention and not to limit the same, and a person skilled in the art can modify the technical solution of the present invention or substitute the same without departing from the spirit and scope of the present invention, and the scope of the present invention should be determined by the claims.

Claims (10)

1. A method for predicting and tracing human behaviors and emotions comprises the following steps:
1) selecting element combinations to be input into a baseline system according to task types, wherein the task types comprise: the emotion prediction task comprises an emotion prediction task, an emotion traceability task, a behavior prediction task or a behavior traceability task, wherein the element combination of the emotion prediction task comprises the following components: the emotion tracing method comprises an individual X, a requirement label N and a text behavior A, wherein element combinations of the emotion tracing task or the behavior tracing task comprise: individual X, emotion tag E and text behavior A, and the element combination of the behavior prediction task comprises: individual X, requirement label N and emotion label E;
2) the baseline system selects a processing path according to the element combination, and processes the processing path through the following strategies to obtain an emotion prediction task result, an emotion traceability task result, a behavior prediction task result or a behavior traceability task result:
2.1) when the element combination comprises an individual X, a requirement label N and a text behavior A, processing is carried out by the following steps:
2.1.1) inputting a first natural language text sequence generated by the individual X and the requirement label N into an encoder to obtain a code h s1 And according to the code h s1 Acquiring first probability distribution of each emotion category label;
2.1.2) inputting the text behavior A into an emotion concept knowledge base to obtain the importance degree of each general knowledge in the text behavior A under each emotion category label, and obtaining the first distribution of the emotion general knowledge by combining with a set lookup table;
2.1.3) voting according to the first probability distribution of each emotion category label and the first distribution of emotion general knowledge, and selecting the best emotion category label to obtain an emotion prediction task result;
2.2) when the element combination comprises an individual X, an emotion tag E and a text behavior A, processing by:
2.2.1) inputting the second natural language text sequence generated by the individual X and the emotion label E into the coder to obtain a code h s2 And according to the code h s2 Acquiring second probability distribution of each emotion category label or probability distribution of each behavior category label;
2.2.2) inputting the text behavior A into a requirement concept knowledge base to obtain the importance degree of each common sense in the text behavior A under each emotion category label or each behavior category label, and combining with a set lookup table to obtain second distribution of emotion common sense knowledge or behavior common sense knowledge distribution;
2.2.3) voting according to the second probability distribution of each emotion category label and the second distribution of emotion common sense knowledge, or the probability distribution of each action category label and the second distribution of behavior common sense knowledge, and selecting the optimal emotion category label or behavior category label to obtain an emotion traceability task result or a behavior traceability task result;
and 2.3) when the element combination comprises an individual X, a demand label N and an emotion label E, inputting the individual X, the demand label N and the emotion label E into the language model to obtain a behavior prediction task result.
2. The method of claim 1, wherein in step 1), the baseline system preprocesses the input demand tag N and emotion tag E; the pretreatment comprises the following steps: and expanding the semantic information of the demand label N or the emotion label E through a set prompt template.
3. The method of claim 1, wherein the encoder comprises: a GRU model, a BERT model, or a RoBERTa model.
4. The method of claim 1, wherein text behavior a is preprocessed before entering an emotional concept knowledge base; the pretreatment comprises the following steps: stop words and high frequency words are deleted.
5. The method of claim 1, wherein the sentiment concept knowledge base is constructed by:
1) collecting the emotional common sense concept;
2) calculating the occurrence number of each common sense concept in each emotion category to form a matrix
Figure FDA0003039581140000021
Wherein d is c Dimension of common sense concept, d n Is a dimension in the sentiment category;
3) calculating the importance degree of each common sense concept in each emotion category
Figure FDA0003039581140000022
Wherein
Figure FDA0003039581140000023
The method is characterized in that the method is a jth common sense concept of an ith label, s is a current label, Ct is the frequency of the common sense concept, V is the size of a word corresponding to the common sense concept, and N is the total number of the common sense concepts.
6. The method of claim 1, wherein voting comprises: using a pooling mechanism; the pooling mechanism includes: average pooling, maximum pooling, or sum pooling.
7. The method of claim 1, wherein the language model comprises: BERT model or GPT-2 model.
8. The method of claim 1, wherein emotion prediction task results are obtained by:
1) setting a slot filling template of an emotion prediction task;
2) and filling the prediction result corresponding to the optimal emotion category label into a slot filling template by using a slot filling method so as to obtain an emotion prediction task result interpreted by the natural language.
9. A storage medium having a computer program stored thereon, wherein the computer program is arranged to, when executed, perform the method of any of claims 1-8.
10. An electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the method according to any of claims 1-8.
CN202110453104.8A 2021-04-26 2021-04-26 Method and device for predicting and tracing human behaviors and emotions Active CN113254576B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110453104.8A CN113254576B (en) 2021-04-26 2021-04-26 Method and device for predicting and tracing human behaviors and emotions

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110453104.8A CN113254576B (en) 2021-04-26 2021-04-26 Method and device for predicting and tracing human behaviors and emotions

Publications (2)

Publication Number Publication Date
CN113254576A CN113254576A (en) 2021-08-13
CN113254576B true CN113254576B (en) 2022-07-26

Family

ID=77221712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110453104.8A Active CN113254576B (en) 2021-04-26 2021-04-26 Method and device for predicting and tracing human behaviors and emotions

Country Status (1)

Country Link
CN (1) CN113254576B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114676259B (en) * 2022-04-11 2022-09-23 哈尔滨工业大学 Conversation emotion recognition method based on causal perception interactive network
CN115221301B (en) * 2022-07-19 2024-01-23 重庆理工大学 Dialogue emotion classification and dialogue behavior recognition method combining multitask learning

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831184A (en) * 2012-08-01 2012-12-19 中国科学院自动化研究所 Method and system for predicating social emotions in accordance with word description on social event
US8346391B1 (en) * 2006-12-28 2013-01-01 Science Applications International Corporation Methods and systems for an autonomous robotic platform
CN112183064A (en) * 2020-10-22 2021-01-05 福州大学 Text emotion reason recognition system based on multi-task joint learning

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8209182B2 (en) * 2005-11-30 2012-06-26 University Of Southern California Emotion recognition system
CN104063427A (en) * 2014-06-06 2014-09-24 北京搜狗科技发展有限公司 Expression input method and device based on semantic understanding

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8346391B1 (en) * 2006-12-28 2013-01-01 Science Applications International Corporation Methods and systems for an autonomous robotic platform
CN102831184A (en) * 2012-08-01 2012-12-19 中国科学院自动化研究所 Method and system for predicating social emotions in accordance with word description on social event
CN112183064A (en) * 2020-10-22 2021-01-05 福州大学 Text emotion reason recognition system based on multi-task joint learning

Also Published As

Publication number Publication date
CN113254576A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
Zad et al. Emotion detection of textual data: An interdisciplinary survey
US20230419074A1 (en) Methods and systems for neural and cognitive processing
KR20190019962A (en) Architectures and processes for computer learning and understanding
Han et al. A review on sentiment discovery and analysis of educational big‐data
CN113254576B (en) Method and device for predicting and tracing human behaviors and emotions
Katz et al. Natural language processing in the legal domain
Sobol-Shikler et al. Classification of complex information: Inference of co-occurring affective states from their expressions in speech
Dsouza et al. Chat with bots intelligently: A critical review & analysis
Kusal et al. A systematic review of applications of natural language processing and future challenges with special emphasis in text-based emotion detection
Dhar et al. Understanding the evolution of an emerging technological paradigm and its impact: The case of Digital Twin
Qiu et al. Predicting the quality of answers with less bias in online health question answering communities
Hou et al. C-BDCLSTM: A false emotion recognition model in micro blogs combined Char-CNN with bidirectional dilated convolutional LSTM
Nacheva et al. Concept map mining approach based on the mental models retrieval
Azimi et al. Discovering associations among technologies using neural networks for tech-mining
Iovane et al. A computational model for managing emotions and affections in emotional learning platforms and learning experience in emotional computing context
Prieto et al. Comparing natural language processing approaches to scale up the automated coding of diaries in single-case learning analytics
YIN A compression-based BiLSTM for treating teenagers’ depression chatbot
Ghazi Identifying expressions of emotions and their stimuli in text
KR20200141863A (en) System for providing personal recording data based ai chatting service
Chataut et al. DEPRESSIKA: An Early Risk of Depression Detection through Opinions
Yang Analysis model of personality and psychological characteristics of network users under high-pressure working environment
CN115221301B (en) Dialogue emotion classification and dialogue behavior recognition method combining multitask learning
Alsayed Tracking and Characterizing Natural Language Semantic Dynamics of Conversations in Real-Time
Meszaros et al. Evaluating communication modality for improved human/autonomous system teaming
Park et al. Depression Emotion Multi-Label Classification Using Everytime Platform with DSM-5 Diagnostic Criteria

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant