Interaction model training method and device, electronic equipment and readable storage medium
By acquiring multimodal user data and training it with pre-trained emotion recognition and interaction models, virtual pets can understand users' emotions in real time and provide personalized interactions, solving the problem that virtual pets cannot resonate at a deep level and achieving deeper emotional interaction.
Patent Information
- Application Number
- CN202411145428.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2026-03-03
Smart Images

Figure CN121598069A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, specifically to training methods, devices, electronic devices, and readable storage media for interactive models. Background Technology
[0002] Digital social relationships are supplementing or replacing traditional face-to-face social relationships. Virtual pets are a common type of social application that provides virtual companionship. Users can interact with virtual pets on websites or mobile applications, such as adopting and raising virtual pets, caring for their health and well-being, including feeding, cleaning, playing, and training, and experiencing companionship and joy in the process.
[0003] Currently, virtual pets primarily interact with users through user-initiated actions. Users are typically responsible for caring for, feeding, cleaning, and playing with their pets. The virtual pets' responses are usually based on pre-set rules and scripts; for example, if the pet is hungry, it might display a specific facial expression or make a sound. However, these reactions are fixed, rather than based on real-time analysis of specific user behavior. While virtual pets can exhibit a range of emotions, such as happiness, sadness, or anger, these emotions are often superficial and lack the complexity and depth of human emotions. Virtual pets cannot understand the user's true feelings or achieve deep emotional resonance, thus failing to provide a more personalized interactive experience. Summary of the Invention
[0004] This application provides a training method, apparatus, electronic device, and readable storage medium for an interactive model, which solves the problem that virtual pets cannot understand the user's real feelings or achieve deep emotional resonance, and thus cannot provide the user with a more personalized interactive experience.
[0005] In a first aspect, embodiments of this application provide a method for training an interactive model, the method comprising:
[0006] A training sample set is obtained, which includes multiple training samples. The training samples include at least first training data, second training data, and third training data. The first training data is used to represent the user emotion corresponding to the user's user state. The second training data is used to represent the role behavior performed by the virtual character corresponding to the user under the user emotion. The third training data is used to represent the user behavior performed by the user under the user emotion. The first training data is the output data obtained by a pre-trained emotion recognition model with the user's user state as input data.
[0007] The first training data and the second training data are input into the interaction model to be trained to obtain the predicted user behavior output by the interaction model to be trained.
[0008] The interaction model to be trained is trained based on the predicted user behavior and the third training data to obtain the trained interaction model.
[0009] Secondly, embodiments of this application also provide a method for virtual pet interaction, which provides a graphical user interface through a terminal device, wherein the graphical user interface displays a virtual character, and the method includes:
[0010] Get the user's user status;
[0011] The user's state is input into the emotion recognition model to obtain the predicted user emotion output by the emotion recognition model;
[0012] Based on the predicted user sentiment, the virtual character is controlled to perform character behaviors that match the predicted user sentiment.
[0013] The predicted user sentiment and the character behavior are input into the interaction model to obtain the predicted user behavior output by the interaction model, wherein the interaction model is trained by the method according to any one of claims 1 to 10;
[0014] The predicted user behavior is presented on the graphical user interface in a manner that allows interaction with the virtual character.
[0015] Thirdly, embodiments of this application also provide a training device for an interactive model, the device comprising:
[0016] The first acquisition module is used to acquire a training sample set, which includes multiple training samples. The training samples include at least first training data, second training data, and third training data. The first training data is used to characterize the user emotion corresponding to the user's user state. The second training data is used to characterize the role behavior performed by the virtual character corresponding to the user under the user emotion. The third training data is used to characterize the user behavior performed by the user under the user emotion. The first training data is the output data obtained by a pre-trained emotion recognition model with the user's user state as input data.
[0017] The first training module is used to input the first training data and the second training data into the interactive model to be trained, and obtain the predicted user behavior output by the interactive model to be trained.
[0018] The second training module is used to train the interaction model to be trained based on the predicted user behavior and the third training data, so as to obtain the trained interaction model.
[0019] Fourthly, embodiments of this application also provide a device for virtual pet interaction, which provides a graphical user interface through a terminal device, wherein the graphical user interface displays a virtual character, and the device includes:
[0020] The second acquisition module is used to acquire the user's user status;
[0021] The user sentiment acquisition module is used to input the user's state into the sentiment recognition model and obtain the predicted user sentiment output by the sentiment recognition model.
[0022] The character behavior acquisition module is used to control the virtual character to perform character behaviors that match the predicted user emotions based on the predicted user emotions.
[0023] The user behavior prediction module is used to input the predicted user emotion and the role behavior into the interaction model to obtain the predicted user behavior output by the interaction model, wherein the interaction model is trained by the method according to any one of claims 1 to 10.
[0024] The display module is used to present the predicted user behavior on the graphical user interface in a manner that allows interaction with the virtual character.
[0025] Fifthly, embodiments of this application also provide an electronic device, including:
[0026] Processor; and
[0027] A memory for storing a data processing program, which, when the electronic device is powered on and runs by the processor, performs the method as described in either the first or second aspect.
[0028] Sixthly, embodiments of this application also provide a computer-readable storage medium storing a data processing program that is executed by a processor to perform the method described in either the first or second aspect.
[0029] Compared with the prior art, this application has the following advantages:
[0030] The training method for the interactive model provided in this application involves acquiring first training data representing user emotions corresponding to user states, second training data representing the character behaviors performed by a virtual character corresponding to the user under the user emotions, and third training data representing the user behaviors performed by the user under the user emotions, obtained from the output data of a pre-trained emotion recognition model using the user states as input data. The first and second training data are then input into the interactive model to be trained to obtain the predicted user behavior output by the interactive model. The interactive model is then trained based on the predicted user behavior and the third training data to obtain the trained interactive model. The interactive model obtained by this method can provide users with a more personalized interactive experience. Attached Figure Description
[0031] Figure 1 A schematic diagram illustrating a process for obtaining a training sample set, provided as an embodiment of this application;
[0032] Figure 2 A flowchart illustrating a training method for an interactive model provided in an embodiment of this application;
[0033] Figure 3 This is a schematic diagram illustrating the training process of another interactive model according to an embodiment of this application;
[0034] Figure 4 A structural block diagram of a training device for an interactive model provided in an embodiment of this application;
[0035] Figure 5 A structural block diagram of a virtual pet interaction device provided in an embodiment of this application;
[0036] Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0037] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0038] It should be noted that the terms "first," "second," "third," etc., in the claims, specification, and drawings of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. Such data are interchangeable where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown or described herein. Furthermore, the terms "comprising," "having," and their variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.
[0039] Digital social relationships are supplementing or replacing traditional face-to-face social relationships. Against this backdrop, virtual companionship applications for digital social relationships are emerging in large numbers, utilizing virtual characters, intelligent assistants, games, social media, chatbots, or AI-driven applications to simulate interpersonal interactions and emotional support. Virtual pets are a common application of virtual companionship, referring to digital creatures that simulate the appearance, behavior, and interactions of real pets through electronic devices or internet technology. They can exist in video games, mobile applications, social platforms, or other forms of digital media. Virtual pets typically have virtual avatars, which can be two-dimensional virtual avatars based on video data of real pets, or three-dimensional virtual avatars designed using modeling software. Two-dimensional virtual avatars are generated using deep neural networks based on real pet video data; while three-dimensional virtual avatars are generated by first creating a drivable three-dimensional virtual avatar model using modeling software, and then using deep neural networks to control the model's expressions and body movements.
[0040] The implementation of virtual pets involves defining their physical characteristics, such as color, shape, and texture; constructing their basic form, including body, head, and limbs; rigging the skeletal structure within the 3D model to control movement; pre-setting basic motion sequences, such as standing, walking, and jumping; designing facial muscle movements to express the pet's emotional states; designing the interaction logic between the virtual pet and the user; and integrating the designed virtual pet model, animations, and interaction logic into the application. Examples include electronic pets embedded in small video games on specific hardware devices; online pet simulation games running on the internet; and AI companion robots created using artificial intelligence technology. Users can interact with virtual pets through web pages or applications, such as adopting and raising virtual pets in web or mobile applications, caring for their health and well-being through feeding, cleaning, playing, and training, experiencing companionship and joy.
[0041] Currently, virtual pets primarily interact with users through user-initiated actions. Users are typically responsible for caring for, feeding, cleaning, and playing with their pets. The virtual pets' responses are usually based on pre-set rules and scripts; for example, if the pet is hungry, it might display a specific facial expression or make a sound. However, these reactions are fixed and not based on real-time analysis of the user's emotional state. While virtual pets can exhibit a range of emotions, such as happiness, sadness, or anger, these emotions are often superficial and lack the complexity and depth of human emotions. Virtual pets cannot understand the user's true feelings or achieve deep emotional resonance, thus failing to provide a more personalized interactive experience.
[0042] To address the aforementioned problems in related technologies, embodiments of this application provide a method for training an interactive model. The implementation entity of the solution provided in this application can be an electronic device, such as a desktop computer, laptop computer, mobile device, smartwatch, smart TV, tablet computer, server, or other devices with data processing and display functions.
[0043] The interactive model trained using the training method provided in this application can be used to analyze users' emotional states in real time, understand users' true feelings, and thus provide users with a more personalized interactive experience. Those skilled in the art can set specific representations of the interactive experience according to actual needs.
[0044] like Figure 1 The diagram shown is a flowchart illustrating a process for obtaining a training sample set according to an embodiment of this application. Obtaining the training sample set includes:
[0045] Step S101: Obtain the user status of the user;
[0046] In this embodiment, user state refers to the collection of data used to analyze user emotional state. User emotional state refers to the inner feelings and emotional reactions experienced by the user at a specific moment or over a period of time. Emotional state can be instantaneous, such as sudden surprise or anger, or it can be continuous, such as long-term stress or happiness. User state can be at least one of the following: facial expressions, body language, vocal emotions, and input text content.
[0047] It should be noted that user states can be multi-modal data, meaning that a single user state can include information from different sensory experiences (visual, auditory, textual) at the same point in time. A modality refers to different types or forms of data representation; each modality represents an independent data channel or mode of perception. Table 1 shows some modalities and corresponding examples:
[0048] Table 1 shows some modes and their corresponding examples.
[0049]
[0050] Using multimodal data as user state allows for the combination of the strengths of different modalities to obtain richer and more comprehensive information than a single modality. For example, in natural language processing, combining text and audio data helps AI models better understand and generate human language; in computer vision, fusing images and text can improve the accuracy of image descriptions; and in biometrics, using multimodal data such as fingerprints and facial recognition can enhance the security of identity verification.
[0051] The user states in this application embodiment include, but are not limited to: (1) text data, which is extracted from the user's social media, forums, emails, chat logs, etc., and analyzed using natural language processing technology to determine the user's emotional tendencies. (2) voice data, which identifies the user's emotional state through features such as tone, speech rate, and volume in recordings or real-time voice calls. (3) facial expressions, which are captured by camera equipment to capture facial images or videos, and analyzed to determine the user's emotions by analyzing facial muscle activity and expression changes. (4) behavioral data, which observes the user's behavioral patterns, such as body movements, gestures, and eye contact, to obtain the user's emotional state.
[0052] Obtaining a user's state can be achieved by collecting multimodal emotional data from various user terminal devices (such as virtual reality (VR) devices, computers, or mobile phones); for example, capturing facial expressions such as happiness, surprise, anger, or frustration through a camera; acquiring body movements such as gestures when excited or postures when nervous using VR devices; acquiring voice data through recording devices; and reading or listening to text input data entered by the user through input boxes or text input controls in social media, forums, emails, chat logs, etc.
[0053] In some embodiments, after obtaining the user's state, all data corresponding to the user state is preprocessed. Preprocessing includes cleaning and removing noise, outliers, and incomplete data from all data in the user state, such as removing noise and interference from voice data; removing inaccurate data caused by occlusion or poor posture in facial expression or behavior data; removing duplicate information from text data; and standardizing the input format of text data (such as standardizing capitalization).
[0054] In some embodiments, the data corresponding to the preprocessed user states are time-aligned. Since the data in the user states comes from different sensors or devices, it may be collected at different rates and timestamps. Time alignment can make data from different modalities correspond to the same moment or the same time period, thereby obtaining the user's emotional state at the same point in time from the multimodal data of the user states.
[0055] It should be noted that time alignment involves synchronizing the timestamps of all data sources. For example, facial expressions captured by the camera, voice recorded by the microphone, and text input recorded by the keyboard should be based on the same time base. If there is a time offset between user terminal devices, calibration should be performed first to eliminate the differences.
[0056] Different modalities of user states may have different sampling frequencies. For user states of a particular modality whose sampling frequency does not match that of other modalities, resampling can be performed to match the sampling frequency of the other modalities, or a common time resolution can be found for aggregation. Alternatively, specific event markers can be used during data acquisition to aid alignment. For example, a synchronization signal can be emitted at the start and end of data recording, or a marker can be recorded when a user performs a specific action. These markers serve as reference points on the timeline, helping to align data from different modalities onto the same time axis. For continuous signals, such as speech and facial expressions, a sliding window technique can be used to process the data. Within a certain time window, data from different modalities are analyzed synchronously, and the window can slide as needed to cover the entire dataset.
[0057] Feature extraction is performed on the user states after time alignment. Features that can effectively represent the essential attributes or patterns of the user states in each modality are identified and selected. The features of each modality data are obtained and represented by vectors to obtain the feature vectors of each modality data.
[0058] When extracting features from user states, different feature extraction methods can be used for data from different modalities.
[0059] For example, when extracting features from facial expressions, color histograms can be used to record the frequency of different colors in an image, and filters (such as Sobel or Laplacian filters) can be used to detect edges in the image. Key points in the image can be described using SIFT (Scale Invariant Feature Transform), SURF (Speed Robust Feature Transform), or ORB (Oriented Fast and Rotated BRIEF), and multi-level features of the image can be automatically learned through a convolutional neural network (CNN) to extract the user's facial features.
[0060] For behavioral data, the trajectory method can be used to extract the motion trajectory of limb movements. Key joint positions or markers are identified from the preprocessed behavioral data. These key joint positions or markers are usually predefined, such as the shoulder, elbow, and wrist. The position of each identified key joint position or marker is recorded in each frame to form a time series. Smoothing algorithms, such as moving average or spline interpolation, are applied to reduce the irregularity of the trajectory. The trajectory is converted into parametric form, such as polynomial or Bézier curve, for easy analysis and comparison. Key parameters that help describe the characteristics of the movement are extracted from the constructed trajectory. Key parameters include (1) trajectory length, the total length of the entire movement path; (2) velocity and acceleration, the rate of change of velocity on the trajectory; (3) direction change, the degree of change of direction of the trajectory; (4) joint angle, the angle change of a specific joint during the movement; and (5) periodic features, such as stride length and stride frequency in gait analysis.
[0061] For speech data, the continuous audio signal is divided into a series of overlapping short time windows (frames). A short-time Fourier transform is performed on each frame to obtain its spectral information. Spectral feature information is then extracted from the spectral information of each frame.
[0062] For text data, the text can be decomposed into individual words or tags, and unique words appearing in all documents can be collected to form a vocabulary. For each document, the frequency of each word in the vocabulary is calculated, and each document is represented as a vector with a length equal to the size of the vocabulary. The value at each position represents the frequency of the corresponding word in the document or the TF-IDF weight, thereby extracting text features. Alternatively, the text can be segmented and cleaned to remove punctuation and stop words. The Word2Vec CBOW or Skip-gram model can be used to train the text corpus, and the model parameters (such as vector dimension and context window size) can be adjusted to optimize the quality of word vectors. After training, the Word2Vec model can generate a vector representation for each word in the vocabulary, thereby extracting text features. Alternatively, a word co-occurrence matrix can be constructed to record the frequency of each pair of words in the vocabulary appearing together in the text. The GloVe model can be used to train the co-occurrence matrix, and the word vectors can be optimized to minimize the prediction error between words. After training, the GloVe model generates a vector representation for each word, and these vectors can reflect the semantic and grammatical characteristics of the words.
[0063] In some embodiments, after obtaining the multimodal feature vector, data fusion is performed, that is, the sentiment feature data at each moment is fused into an integrated multimodal feature vector, or the sentiment feature data in each time period is fused into an integrated multimodal feature vector.
[0064] It should be noted that during data fusion, the feature vectors of each modality are concatenated sequentially into a larger vector to obtain an integrated multimodal feature vector. Alternatively, an attention layer can be designed for the feature vectors of each modality, and the calculated attention weights can be used to perform a weighted summation of the features to obtain a fused feature vector.
[0065] For example, when analyzing a video of a user playing a game, the camera captures the user smiling (indicating happiness) at a certain moment, while the microphone records the user making a cheerful sound, and the text input shows the user typing "Awesome!" in the chat box. After preprocessing, temporally aligning, and extracting features from the acquired data, the extracted features are fused to obtain an integrated multimodal feature vector of the user at that moment.
[0066] It should be noted that standardizing the integrated multimodal feature vectors, using Z-score standardization or zero-mean unit variance scaling, ensures that the numerical ranges of different features are uniform, which helps with model convergence and training stability.
[0067] Step S102: Input the user's state into the pre-trained emotion recognition model to obtain the predicted user emotion output by the pre-trained emotion recognition model, and use the predicted user emotion as the first training data.
[0068] In this embodiment, user emotion refers to the inner feelings and emotional reactions experienced by a user at a specific moment or within a certain period of time, such as happiness, sadness, anger, fear, etc. After obtaining the user's state, the user state is input into a pre-trained emotion recognition model, and the pre-trained emotion recognition model outputs the predicted user emotion corresponding to the user state.
[0069] For example, suppose user emotions include user emotion 1, user emotion 2, user emotion 3, ..., user emotion N, where N is a positive integer. User emotion 1, user emotion 2, user emotion 3, ..., user emotion N are sequentially input into a pre-trained emotion recognition model. The pre-trained emotion recognition model identifies user emotion 1, user emotion 2, user emotion 3, ..., user emotion N, and outputs the corresponding predicted user emotion 1, predicted user emotion 2, predicted user emotion 3, ..., predicted user emotion N.
[0070] It should be noted that, prior to the step of inputting the user's state into the pre-trained sentiment recognition model, the method further includes:
[0071] Obtain a pre-trained emotion recognition model.
[0072] In some embodiments, obtaining a pre-trained emotion recognition model includes:
[0073] Obtain training samples, which include at least one user state and a label for the user state, wherein the label represents the actual user sentiment corresponding to the user state;
[0074] The user's state is input into an initial emotion recognition model to obtain the predicted user emotion output by the initial emotion recognition model;
[0075] Based on the actual user sentiment and the predicted user sentiment, the loss of the training samples is obtained;
[0076] Based on the loss of the training samples, the parameters of the initial emotion recognition model are adjusted to obtain a pre-trained emotion recognition model.
[0077] In this embodiment, the initial sentiment recognition model can be a deep learning model based on convolutional neural networks or recurrent neural networks, such as VGG or ResNet. The actual user sentiment corresponding to each user state is obtained. The user state is used as the input to the initial sentiment recognition model, and the actual user sentiment corresponding to the user state is used as the output. The parameters of the initial sentiment recognition model are adjusted, and training continues until the initial sentiment recognition model converges, thus obtaining a pre-trained sentiment recognition model.
[0078] It should be noted that when training the initial emotion recognition model, optimizers such as cross-entropy loss function, Adam and SDG can be selected to optimize the model parameters.
[0079] For example, when training the initial emotion recognition model using training samples, the training samples can be divided into a training set, a validation set, and a test set in a certain ratio, such as a ratio of 7:2:1. Using the training set as the input to the initial emotion recognition model and the actual user emotions in the training set as the output of the initial emotion recognition model, the initial emotion recognition model is trained to obtain a preliminary emotion recognition model.
[0080] It's important to note that the initial sentiment recognition model learns features and weights by fitting data to the training set, establishing a mapping from input to output. During training, the parameters of the initial sentiment recognition model (such as weights and biases) are continuously adjusted based on the input training data to minimize prediction error.
[0081] The user state of each training sample in the validation set is used as the input to the preliminary emotion recognition model, and the actual user emotion corresponding to the user state of each training sample in the validation set is used as the output to train the preliminary emotion recognition model to obtain the optimized emotion recognition model.
[0082] It should be noted that the hyperparameters (such as learning rate, batch size, network structure, etc.) of the initial sentiment recognition model are adjusted using the validation set, and overfitting is monitored during the initial sentiment recognition model training process. After each hyperparameter adjustment, the initial sentiment recognition model is evaluated on the validation set to select the optimal model configuration.
[0083] The optimized emotion recognition model is trained by taking the user state of each training sample in the test set as the input and the actual user emotion corresponding to the user state of each training sample in the validation set as the output.
[0084] It should be noted that the test set is used to evaluate the performance of the optimized sentiment recognition model on data completely independent of the training and validation processes. It provides an unbiased estimate of the model's final performance, used to confirm the model's ability to generalize to new data.
[0085] Step 103: Obtain the role behavior that matches the predicted user sentiment, and use the role behavior that matches the predicted user sentiment as the second training data;
[0086] In this embodiment, the character behavior matching the predicted user emotion is the virtual pet's response to the user's emotion. This response can be visual, auditory, or textual, designed to mimic the behavior of a real pet—that is, how the virtual pet should react in each user emotion. Table 2 shows some character behaviors and corresponding examples:
[0087] Table 2 lists some character behaviors and corresponding examples.
[0088]
[0089] Acquiring character behavior that matches predicted user emotions can be based on pre-defined rules and algorithms to determine how a virtual pet should react to a specific user's emotional state. For example, if a user is detected to be depressed, the virtual pet can offer comforting words or actions; if the user is happy, the virtual pet can share jokes or games to enhance that positive emotion.
[0090] In some embodiments, prior to the step of obtaining the user's user status, the method further includes:
[0091] Construct a primary matching relationship between various user emotions and various role behaviors;
[0092] The acquisition of role behaviors that match the predicted user sentiment includes:
[0093] Based on the first matching relationship and the predicted user sentiment, a role behavior to be executed is matched for the virtual character corresponding to the user.
[0094] In this embodiment, obtaining the character behavior that matches the predicted user emotion can also involve pre-establishing a first matching relationship between the virtual pet's character behavior and the user's emotion. After obtaining the user's emotion, the character behavior corresponding to that emotional state can be obtained based on the user's emotion and the first matching relationship. For example, when it is identified that the user's emotion is negative, the digital pet exhibits friendly and comforting character behavior; while when the user's emotion is positive, the digital pet exhibits active and happy character behavior.
[0095] Step 104: Obtain user behavior that matches the predicted user sentiment, and use the user behavior that matches the predicted user sentiment as the third training data.
[0096] In this embodiment of the application, the user behavior that matches the predicted user emotion is the user's reaction or behavior when in each user emotion state.
[0097] It should be noted that when obtaining user behavior that matches the predicted user sentiment, a pattern sequence of user behavior can be obtained, that is, user behavior is arranged in time series.
[0098] For example, when users are happy or excited, they are more willing to share and communicate; when users are sad or depressed, they typically reduce social activities and online interactions, or seek comfort, such as watching movies, listening to music, or reading; when users are angry or irritable, they express dissatisfaction, make negative comments, or provide feedback; when users are anxious or tense, they frequently check information sources, such as news websites or social media; and when users are calm or relaxed, they are more inclined to enjoy leisure activities, such as games, reading, or meditation apps.
[0099] In some embodiments, prior to the step of obtaining the user's user status, the method further includes:
[0100] Construct a second matching relationship between various user emotions and various user behaviors;
[0101] The acquisition of user behavior that matches the predicted user sentiment includes:
[0102] Based on the second matching relationship and the predicted user sentiment, a user behavior to be performed is matched for the user.
[0103] In this embodiment, obtaining user behavior that matches the predicted user sentiment can be achieved by pre-establishing a second matching relationship between user sentiment and user behavior. After obtaining user sentiment, user behavior corresponding to that sentiment state can be obtained based on the user sentiment and the second matching relationship.
[0104] like Figure 2 The diagram shown is a flowchart illustrating a training method for an interactive model provided in an embodiment of this application. The method includes:
[0105] Step 201: Obtain a training sample set, which includes multiple training samples. The training samples include at least first training data, second training data, and third training data. The first training data is used to represent the user emotion corresponding to the user's user state. The second training data is used to represent the role behavior performed by the virtual character corresponding to the user under the user emotion. The third training data is used to represent the user behavior performed by the user under the user emotion. The first training data is the output data obtained based on a pre-trained emotion recognition model with the user's user state as input data.
[0106] In this embodiment, through steps 101-104 above, the acquired user state is input into a pre-trained emotion recognition model, and the pre-trained emotion recognition model outputs the user emotion corresponding to the user state, using the user emotion as the first training data. Based on the first matching relationship between user emotion and role behavior, role behavior matching the user emotion is obtained, and this role behavior is used as the second training data. Based on the second matching relationship between user emotion and user behavior, user behavior matching the user emotion is obtained, and this user behavior is used as the third training data. A training sample set is obtained through the first, second, and third training data described above.
[0107] In some embodiments, after the step of obtaining the training sample set, the method further includes:
[0108] The second training data is preprocessed, which includes obtaining the emotional state of the virtual character corresponding to the character's behavior, the scene in which the character's behavior is performed, and the response speed of the character's behavior.
[0109] In this embodiment, after obtaining the character behavior of the virtual character corresponding to the user, the emotional state of the virtual character corresponding to the character behavior, the scene in which the character behavior is performed, and the response speed of the character behavior are obtained to expand the dimensions of the second training data. Expanding the dimensions of the second training data increases its diversity and richness, helping the model learn more features and patterns, thus performing better on unseen data. Expanding the dimensions of the second training data effectively increases the size of the training set, allowing the model to face more data points and reducing the risk of overfitting. It enables the model to learn to handle inputs under different conditions, thereby enhancing its robustness in practical applications. Providing richer second training data allows the model to find the global optimum faster, thus accelerating the convergence of the training process overall.
[0110] Step 202: Input the first training data and the second training data into the interaction model to be trained to obtain the predicted user behavior output by the interaction model to be trained.
[0111] In this embodiment of the application, after obtaining the training sample set, the user emotion corresponding to the user state and the role behavior performed by the virtual character corresponding to the user under the user emotion are used as inputs to the interaction model to be trained. The interaction model to be trained outputs predicted user behavior based on the input user emotion and role behavior.
[0112] In some embodiments, the interactive model to be trained includes a long short-term memory network and a multi-head attention mechanism.
[0113] In the embodiments of this application, the Long Short-Term Memory Network (LSTM) is a neural network structure with memory units. It can capture the sequence patterns and emotional changes of user emotions, character behavior and user behavior during the interaction between the user and the virtual character. This allows the virtual character to better understand and remember the user's emotional state, laying the groundwork for subsequent intelligent responses.
[0114] It should be noted that LSTM focuses on processing sequential data and performing sequence modeling. Because it can handle time series data and has memory units, it can remember past information, giving it an advantage in situations where long-term dependencies need to be considered.
[0115] Multi-head attention allows a model to focus on different parts of the input sequence simultaneously during the learning process, thus enabling a more comprehensive understanding and processing of information. For example, if a user inputs audio data and facial expression data at the same time, it is necessary to focus on these two different parts simultaneously, and multi-head attention is well-suited for this scenario.
[0116] It should be noted that multi-head attention mechanisms generate multiple sets of attention weights by creating combinations of multiple linear transformations. These different attention weights allow the model to focus on different features or dimensions, thereby achieving attention to multiple aspects.
[0117] like Figure 3 The diagram shown illustrates the training process of another interactive model according to an embodiment of this application. When the Long Short-Term Memory (LSTM) network and the multi-head attention mechanism are used in combination, the input first and second training data first pass through the LSTM, and then through the multi-head attention mechanism, specifically as follows:
[0118] (1) The input sequence is encoded by LSTM.
[0119] The first and second training data are encoded through an LSTM layer. The LSTM can capture the temporal dependencies and long-term information in the sequences of the first and second training data.
[0120] (2) After sequence encoding, the multi-head attention mechanism helps the model to pay attention to different parts of the first and second training data from different perspectives in parallel and generate multiple representations.
[0121] (3) Merge the outputs of multi-head attention, combining the multiple representations obtained by the multi-head attention mechanism into a single comprehensive representation. This merging process may employ methods such as weighted averaging or concatenation.
[0122] (4) The comprehensive representation will enter the output layer of the neural network and be used by the interactive model to predict user behavior.
[0123] It's worth noting that by combining Long Short-Term Memory (LSTM) networks and multi-head attention mechanisms, it can both store long-term data over a period of time and process data from multiple sources simultaneously at a given moment. This allows virtual pets to become more intelligent and natural, closely mimicking the behavior of real pets and better simulating the interaction between pet owners and their pets in real life.
[0124] It should be noted that the second model can also be other types of neural network structures, such as convolutional neural networks (CNN), recurrent neural networks (RNN), etc.
[0125] Step 203: Train the interaction model to be trained based on the predicted user behavior and the third training data to obtain the trained interaction model.
[0126] In this embodiment of the application, after the interaction model to be trained outputs the predicted user behavior, the interaction model to be trained is trained using the loss between the predicted user behavior and the user behavior performed by the user under the user's emotion. That is, the interaction model to be trained is trained using the loss between the predicted user behavior and the user behavior performed by the user under the user's emotion as the loss function of the interaction model to be trained.
[0127] It should be noted that by using technological means, virtual characters can learn user preferences and behavioral habits from user emotions and the corresponding user behaviors when the user is in those emotions. This allows virtual characters to predict user behavior under different emotional states, increasing interaction between the virtual character and the user. Simultaneously, virtual characters can provide personalized interactions for users.
[0128] For example, users are used to giving the command "turn on music" while exercising, but the type of music played varies depending on the user's mood. If the user is happy, the music played is usually cheerful; if the user is sad, the music played is usually melancholic. After the pet learns the user's habitual action, it can proactively prompt, "The workout timer has started. Do you want to play music of type XX?"
[0129] In some embodiments, after the step of training the interaction model to be trained based on the predicted user behavior and the third training data to obtain the trained interaction model, the method further includes:
[0130] Based on the preset training objectives, determine whether the training of the interactive model is complete;
[0131] In response to the completion of training of the interaction model, the trained interaction model is used as the pre-trained interaction model;
[0132] In response to the fact that the training of the interaction model is not completed, the trained interaction model is used as the interaction model to be trained, and iterative training continues until the training objective is achieved.
[0133] In this embodiment, the preset training objective may be to determine whether the number of training iterations has reached a preset threshold. If the number of training iterations of the training model reaches the preset threshold, the interactive model after the preset threshold is used as the pre-trained interactive model; if the number of training iterations has not yet reached the preset threshold, model training continues.
[0134] Alternatively, the preset training objective could be to determine whether the loss function has converged. If the loss function converges, the interactive model with converged loss function is used as the pre-trained interactive model; if the loss function does not converge, model training continues.
[0135] In some embodiments, the method further includes:
[0136] The user's emotional state, the actual user behavior performed by the user under the user's emotional state, and the role behavior that matches the user's emotional state are obtained, with the actual user behavior performed by the user under the user's emotional state being used as the second test data.
[0137] The user's emotional state and the role behavior that matches the user's emotional state are input into the interaction model to obtain the predicted user behavior output by the interaction model. The consistency comparison result between the predicted user behavior and the actual user behavior is used as the first test data.
[0138] In some embodiments, after the step of using the trained interaction model as a pre-trained interaction model in response to the completion of training of the interaction model, the method further includes:
[0139] A test sample set is obtained, which includes first test data and second test data. The first test data is used to characterize the preset reward value corresponding to the predicted user behavior. The predicted user behavior is the output data obtained based on the interaction model with the user's emotional state as input data. The second test data is used to characterize the actual user behavior performed by the user under the user's emotional state.
[0140] In response to the preset reward value represented by the first test data being a negative reward value, the parameters of the interaction model are optimized using the actual user behavior and the predicted user behavior.
[0141] In some embodiments, the predicted user behavior is consistent with the actual user behavior, and the preset reward value is a positive reward value;
[0142] If the predicted user behavior is inconsistent with the actual user behavior, the preset reward value is a negative reward value.
[0143] In this embodiment, user feedback data on the predicted user behavior output by the pre-trained interaction model is collected. If the user's behavior after receiving the predicted behavior is consistent with the predicted behavior, a positive reward value is given to the model; if the user's behavior after receiving the predicted behavior is inconsistent with the predicted behavior, a negative reward value is given to the model. Table 3 shows an example of a reward function provided in this embodiment:
[0144] Table 3 shows some examples of reward functions.
[0145]
[0146] It should be noted that after designing the reward function, no model optimization is performed when the reward value is positive. However, when the reward value is negative, the interaction model is optimized based on the user's emotions, the virtual character's behavior, and the actual user behavior. This ensures that the final interaction model outputs predicted user behavior that is more closely related to actual user behavior, achieving a more personalized and considerate interaction.
[0147] It should be noted that positive reward values represent data that affirms the prediction result of the interaction model, such as scores greater than or equal to a preset threshold. Negative reward values represent data that negates the prediction result of the interaction model, such as scores less than a preset threshold.
[0148] The training method for the interactive model provided in this application involves acquiring first training data representing user emotions corresponding to user states, second training data representing the character behaviors performed by a virtual character corresponding to the user under the user emotions, and third training data representing the user behaviors performed by the user under the user emotions, obtained from the output data of a pre-trained emotion recognition model using the user states as input data. The first and second training data are then input into the interactive model to be trained to obtain the predicted user behavior output by the interactive model. The interactive model is then trained based on the predicted user behavior and the third training data to obtain the trained interactive model. The interactive model obtained by this method can provide users with a more personalized interactive experience.
[0149] This application embodiment also provides a method for virtual pet interaction, which provides a graphical user interface through a terminal device, wherein the graphical user interface displays a virtual character, and the method includes:
[0150] Get the user's user status;
[0151] The user's state is input into the emotion recognition model to obtain the predicted user emotion output by the emotion recognition model;
[0152] Based on the predicted user emotions, the virtual character is controlled to perform character behaviors that match the predicted user emotions;
[0153] The predicted user sentiment and the character behavior are input into the interaction model to obtain the predicted user behavior output by the interaction model, wherein the interaction model is trained by the method according to any one of claims 1 to 10;
[0154] The predicted user behavior is presented on the graphical user interface in a manner that allows interaction with the virtual character.
[0155] In this embodiment, after acquiring multimodal data representing the user's state, such as text data, voice data, facial expression data, and behavioral data, this multimodal data is input into an emotion recognition model to obtain predicted user emotions. Then, based on the predicted user emotions, the role behavior performed by the virtual character and the user's behavior are matched, and the predicted user emotions, role behavior, and user behavior are input into the interaction model obtained in the above embodiment to obtain the predicted user behavior output by the interaction model. Next, the predicted user behavior is presented on the graphical user interface in a manner that interacts with the virtual character. For example, the predicted user behavior is presented on the graphical user interface through virtual character voice broadcast, or through virtual character output dialogue.
[0156] In some embodiments, after the step of presenting the predicted user behavior on the graphical user interface in a manner that interacts with the virtual character, the method further includes:
[0157] In response to the user receiving the predicted user behavior, the behavior content corresponding to the predicted user behavior is played on the graphical user interface;
[0158] In response to the user not receiving the predicted user behavior, the predicted user behavior is removed from the graphical user interface.
[0159] In this embodiment of the application, after obtaining the predicted user behavior, the corresponding behavior content is played; if the user agrees with the behavior content, the user can agree to play the corresponding behavior content; if the user does not agree with the behavior content, the predicted user behavior is controlled to disappear from the graphical user interface.
[0160] For example, if the interaction model outputs a predicted user behavior of "playing upbeat music," it will display that type of music on the graphical user interface. If the user agrees to play the music, it will be played. If the user disagrees, the music displayed on the graphical user interface will disappear.
[0161] Optionally, the method further includes:
[0162] Obtain the virtual image of the virtual pet;
[0163] A dynamic model of the virtual pet is generated based on the virtual image;
[0164] Real-time data collection of the real environment is used to create a virtual pet and a virtual scene in which the virtual pet resides, based on the dynamic model of the virtual pet and the real environment data.
[0165] In this embodiment, virtual reality technology can be used to create virtual pets and virtual scenes of virtual pets in a metaverse. Augmented reality applications allow users to interact with digital pets in the real world using relevant devices (such as mobile phones / AR glasses), enhancing the realism and immersion of the digital pets.
[0166] For example, using augmented reality development tools (such as ARKit, ARCore, etc.), an application can be developed to enable virtual pets to appear in the real world and interact with users. The application needs to implement functions such as virtual projection of the virtual pet and interaction with real-world objects. When designing the virtual pet's real-world interaction, it's necessary to ensure that the virtual pet can interact with real-world objects, such as playing, touching, and moving, to enhance realism and immersion. When designing the virtual pet to appear in the real world and interact with users, the virtual pet's model and animation can be optimized to ensure a realistic and smooth effect in the augmented reality environment.
[0167] Virtual reality technologies and engines (such as Unity3D and Unreal Engine) can also be used to design and create realistic virtual pets and the virtual scenes in which they reside, including the models, animations, and interactive functions of the digital pets. This allows augmented reality applications to be integrated with virtual reality pet scenes, enabling users to interact with virtual pets in the real world through augmented reality devices and experience a more realistic and richer virtual pet interaction experience in the metaverse.
[0168] Corresponding to the training method for the interactive model provided in the embodiments of this application, the embodiments of this application also provide a training apparatus for the interactive model, such as... Figure 4 As shown, the device includes:
[0169] The first acquisition module 401 is used to acquire a training sample set, which includes multiple training samples. The training samples include at least first training data, second training data, and third training data. The first training data is used to characterize the user emotion corresponding to the user's user state. The second training data is used to characterize the role behavior performed by the virtual character corresponding to the user under the user emotion. The third training data is used to characterize the user behavior performed by the user under the user emotion. The first training data is the output data obtained by a pre-trained emotion recognition model with the user's user state as input data.
[0170] The first training module 402 is used to input the first training data and the second training data into the interactive model to be trained, and obtain the predicted user behavior output by the interactive model to be trained.
[0171] The second training module 403 is used to train the interaction model to be trained based on the predicted user behavior and the third training data, so as to obtain the trained interaction model.
[0172] In some embodiments, the apparatus further includes:
[0173] The judgment module is used to determine whether the training of the interactive model is complete based on the preset training objective.
[0174] In response to the completion of training of the interaction model, the trained interaction model is used as the pre-trained interaction model;
[0175] In response to the fact that the training of the interaction model is not completed, the trained interaction model is used as the interaction model to be trained, and iterative training continues until the training objective is achieved.
[0176] In some embodiments, the apparatus further includes:
[0177] The data acquisition module is used to acquire the user's user status;
[0178] The user's state is input into the pre-trained emotion recognition model to obtain the predicted user emotion output by the pre-trained emotion recognition model, and the predicted user emotion is used as the first training data.
[0179] Obtain the role behavior that matches the predicted user sentiment, and use the role behavior that matches the predicted user sentiment as the second training data;
[0180] Obtain user behaviors that match the predicted user sentiment, and use the user behaviors that match the predicted user sentiment as the third training data.
[0181] In some embodiments, the apparatus further includes:
[0182] The first building module is used to construct the initial matching relationship between various user emotions and various role behaviors;
[0183] The acquisition of role behaviors that match the predicted user sentiment includes:
[0184] Based on the first matching relationship and the predicted user sentiment, a role behavior to be executed is matched for the virtual character corresponding to the user.
[0185] In some embodiments, the apparatus further includes:
[0186] The second building module is used to construct a second matching relationship between various user emotions and various user behaviors;
[0187] The acquisition of user behavior that matches the predicted user sentiment includes:
[0188] Based on the second matching relationship and the predicted user sentiment, a user behavior to be performed is matched for the user.
[0189] In some embodiments, the device includes:
[0190] The optimization module is used to obtain a test sample set, which includes first test data and second test data. The first test data is used to characterize the preset reward value corresponding to the predicted user behavior. The predicted user behavior is the output data obtained based on the interaction model with the user's emotional state as input data. The second test data is used to characterize the actual user behavior performed by the user under the user's emotional state.
[0191] In response to the preset reward value represented by the first test data being a negative reward value, the parameters of the interaction model are optimized using the actual user behavior and the predicted user behavior.
[0192] In some embodiments, the apparatus further includes:
[0193] The data acquisition module is optimized to acquire the user's emotional state, the actual user behavior performed by the user under the user's emotional state, and the role behavior that matches the user's emotional state, and the actual user behavior performed by the user under the user's emotional state is used as the second test data.
[0194] The user's emotional state and the role behavior that matches the user's emotional state are input into the interaction model to obtain the predicted user behavior output by the interaction model. The consistency comparison result between the predicted user behavior and the actual user behavior is used as the first test data.
[0195] In some embodiments, the predicted user behavior is consistent with the actual user behavior, and the preset reward value is a positive reward value;
[0196] If the predicted user behavior is inconsistent with the actual user behavior, the preset reward value is a negative reward value.
[0197] In some embodiments, the interactive model to be trained includes a long short-term memory network and a multi-head attention mechanism.
[0198] In some embodiments, the apparatus further includes:
[0199] The preprocessing module is used to preprocess the second training data. The preprocessing includes obtaining the emotional state of the virtual character corresponding to the character's behavior, the scene in which the character's behavior is performed, and the response speed of the character's behavior.
[0200] Corresponding to the virtual pet interaction method provided in the embodiments of this application, the embodiments of this application also provide a virtual pet interaction device, which provides a graphical user interface through a terminal device, wherein the graphical user interface displays virtual characters, such as... Figure 5 As shown, the device includes:
[0201] The second acquisition module 501 is used to acquire the user's user status;
[0202] The user sentiment acquisition module 502 is used to input the user's user state into the sentiment recognition model and obtain the predicted user sentiment output by the sentiment recognition model.
[0203] The role behavior acquisition module 503 is used to control the virtual character to perform role behaviors that match the predicted user emotions based on the predicted user emotions.
[0204] User behavior prediction module 504 is used to input the predicted user emotion and the role behavior into the interaction model to obtain the predicted user behavior output by the interaction model, wherein the interaction model is trained by the method described in any of the above embodiments;
[0205] Display module 505 is used to present the predicted user behavior on the graphical user interface in a manner that interacts with the virtual character.
[0206] In some embodiments, the apparatus further includes:
[0207] A playback module is configured to, in response to the user receiving the predicted user behavior, play the behavior content corresponding to the predicted user behavior on the graphical user interface.
[0208] In response to the user not receiving the predicted user behavior, the predicted user behavior is removed from the graphical user interface.
[0209] Corresponding to the training method of the interactive model provided in the embodiments of this application, the embodiments of this application also provide an electronic device. For example... Figure 6 As shown, the electronic device includes: a processor 601; and a memory 602 for storing a program for training the interactive model. After the electronic device is powered on and runs the program storing the training method for the interactive model through the processor, it performs the following steps:
[0210] A training sample set is obtained, which includes multiple training samples. The training samples include at least first training data, second training data, and third training data. The first training data is used to represent the user emotion corresponding to the user's user state. The second training data is used to represent the role behavior performed by the virtual character corresponding to the user under the user emotion. The third training data is used to represent the user behavior performed by the user under the user emotion. The first training data is the output data obtained by a pre-trained emotion recognition model with the user's user state as input data.
[0211] The first training data and the second training data are input into the interaction model to be trained to obtain the predicted user behavior output by the interaction model to be trained.
[0212] The interaction model to be trained is trained based on the predicted user behavior and the third training data to obtain the trained interaction model.
[0213] Corresponding to the training method for the interactive model provided in the embodiments of this application, the embodiments of this application also provide a computer-readable storage medium storing a program for training the interactive model, which is executed by a processor to perform the following steps:
[0214] A training sample set is obtained, which includes multiple training samples. The training samples include at least first training data, second training data, and third training data. The first training data is used to represent the user emotion corresponding to the user's user state. The second training data is used to represent the role behavior performed by the virtual character corresponding to the user under the user emotion. The third training data is used to represent the user behavior performed by the user under the user emotion. The first training data is the output data obtained by a pre-trained emotion recognition model with the user's user state as input data.
[0215] The first training data and the second training data are input into the interaction model to be trained to obtain the predicted user behavior output by the interaction model to be trained.
[0216] The interaction model to be trained is trained based on the predicted user behavior and the third training data to obtain the trained interaction model.
[0217] Corresponding to the training method of the interactive model provided in the embodiments of this application, the embodiments of this application also provide a computer program product, the program product including: a computer program, the computer program being stored in a readable storage medium, at least one processor of an electronic device being able to read the computer program from the readable storage medium, and the at least one processor executing the computer program causing the electronic device to perform the following steps:
[0218] A training sample set is obtained, which includes multiple training samples. The training samples include at least first training data, second training data, and third training data. The first training data is used to represent the user emotion corresponding to the user's user state. The second training data is used to represent the role behavior performed by the virtual character corresponding to the user under the user emotion. The third training data is used to represent the user behavior performed by the user under the user emotion. The first training data is the output data obtained by a pre-trained emotion recognition model with the user's user state as input data.
[0219] The first training data and the second training data are input into the interaction model to be trained to obtain the predicted user behavior output by the interaction model to be trained.
[0220] The interaction model to be trained is trained based on the predicted user behavior and the third training data to obtain the trained interaction model.
[0221] It should be noted that for a detailed description of the apparatus, electronic device, computer-readable storage medium and computer program product provided in the embodiments of this application, please refer to the relevant description of the method in the embodiments of this application, which will not be repeated here.
[0222] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.
[0223] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0224] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) or a processor to execute some steps of the methods described in the various embodiments of this application.
[0225] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0226] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0227] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0228] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.
[0229] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0230] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A training method for an interactive model, characterized in that, The method includes: A training sample set is obtained, which includes multiple training samples. The training samples include at least first training data, second training data, and third training data. The first training data is used to represent the user emotion corresponding to the user's user state. The second training data is used to represent the role behavior performed by the virtual character corresponding to the user under the user emotion. The third training data is used to represent the user behavior performed by the user under the user emotion. The first training data is the output data obtained by a pre-trained emotion recognition model with the user's user state as input data. The first training data and the second training data are input into the interaction model to be trained to obtain the predicted user behavior output by the interaction model to be trained. The interaction model to be trained is trained based on the predicted user behavior and the third training data to obtain the trained interaction model.
2. The training method for the interactive model according to claim 1, characterized in that, After the step of training the interaction model to be trained based on the predicted user behavior and the third training data to obtain the trained interaction model, the method further includes: Based on the preset training objectives, determine whether the training of the interactive model is complete; In response to the completion of training of the interaction model, the trained interaction model is used as the pre-trained interaction model; In response to the fact that the training of the interaction model is not completed, the trained interaction model is used as the interaction model to be trained, and iterative training continues until the training objective is achieved.
3. The training method for the interactive model according to claim 1, characterized in that, Prior to the step of obtaining the training sample set, the method further includes: Obtain the user's user status; The user's state is input into the pre-trained emotion recognition model to obtain the predicted user emotion output by the pre-trained emotion recognition model, and the predicted user emotion is used as the first training data. Obtain the role behavior that matches the predicted user sentiment, and use the role behavior that matches the predicted user sentiment as the second training data; Obtain user behaviors that match the predicted user sentiment, and use the user behaviors that match the predicted user sentiment as the third training data.
4. The training method for the interactive model according to claim 3, characterized in that, Prior to the step of obtaining the user's user status, the method further includes: Construct a primary matching relationship between various user emotions and various role behaviors; The acquisition of role behaviors that match the predicted user sentiment includes: Based on the first matching relationship and the predicted user sentiment, a role behavior to be executed is matched for the virtual character corresponding to the user.
5. The training method for the interactive model according to claim 3, characterized in that, Prior to the step of obtaining the user's user status, the method further includes: Construct a second matching relationship between various user emotions and various user behaviors; The acquisition of user behavior that matches the predicted user sentiment includes: Based on the second matching relationship and the predicted user sentiment, a user behavior to be performed is matched for the user.
6. The training method for the interactive model according to claim 2, characterized in that, After the step of using the trained interaction model as a pre-trained interaction model in response to the completion of training of the interaction model, the method further includes: A test sample set is obtained, which includes first test data and second test data. The first test data is used to characterize the preset reward value corresponding to the predicted user behavior. The predicted user behavior is the output data obtained based on the interaction model with the user's emotional state as input data. The second test data is used to characterize the actual user behavior performed by the user under the user's emotional state. In response to the preset reward value represented by the first test data being a negative reward value, the parameters of the interaction model are optimized using the actual user behavior and the predicted user behavior.
7. The training method for the interactive model according to claim 6, characterized in that, Prior to the step of obtaining the test sample set, the method further includes: The user's emotional state, the actual user behavior performed by the user under the user's emotional state, and the role behavior that matches the user's emotional state are obtained, with the actual user behavior performed by the user under the user's emotional state being used as the second test data. The user's emotional state and the role behavior that matches the user's emotional state are input into the interaction model to obtain the predicted user behavior output by the interaction model. The consistency comparison result between the predicted user behavior and the actual user behavior is used as the first test data.
8. The training method for the interactive model according to claim 6, characterized in that, The predicted user behavior is consistent with the actual user behavior, and the preset reward value is a positive reward value; If the predicted user behavior is inconsistent with the actual user behavior, the preset reward value is a negative reward value.
9. The training method for the interactive model according to claim 1, characterized in that, The interactive model to be trained includes a long short-term memory network and a multi-head attention mechanism.
10. The training method for the interactive model according to claim 1, characterized in that, After obtaining the training sample set, the method further includes: The second training data is preprocessed, which includes obtaining the emotional state of the virtual character corresponding to the character's behavior, the scene in which the character's behavior is performed, and the response speed of the character's behavior.
11. A method for virtual pet interaction, characterized in that, The method includes providing a graphical user interface (GUI) via a terminal device, wherein the GUI displays virtual characters. Get the user's user status; The user's state is input into the emotion recognition model to obtain the predicted user emotion output by the emotion recognition model; Based on the predicted user sentiment, the virtual character is controlled to perform character behaviors that match the predicted user sentiment. The predicted user sentiment and the character behavior are input into the interaction model to obtain the predicted user behavior output by the interaction model, wherein the interaction model is trained by the method according to any one of claims 1 to 10; The predicted user behavior is presented on the graphical user interface in a manner that allows interaction with the virtual character.
12. The method for virtual pet interaction according to claim 11, characterized in that, After the step of presenting the predicted user behavior on the graphical user interface in a manner that allows interaction with the virtual character, the method further includes: In response to the user receiving the predicted user behavior, the behavior content corresponding to the predicted user behavior is played on the graphical user interface; In response to the user not receiving the predicted user behavior, the predicted user behavior is removed from the graphical user interface.
13. A training device for an interactive model, characterized in that, The device includes: The first acquisition module is used to acquire a training sample set, which includes multiple training samples. The training samples include at least first training data, second training data, and third training data. The first training data is used to characterize the user emotion corresponding to the user's user state. The second training data is used to characterize the role behavior performed by the virtual character corresponding to the user under the user emotion. The third training data is used to characterize the user behavior performed by the user under the user emotion. The first training data is the output data obtained by a pre-trained emotion recognition model with the user's user state as input data. The first training module is used to input the first training data and the second training data into the interactive model to be trained, and obtain the predicted user behavior output by the interactive model to be trained. The second training module is used to train the interaction model to be trained based on the predicted user behavior and the third training data, so as to obtain the trained interaction model.
14. A device for virtual pet interaction, characterized in that, The device provides a graphical user interface (GUI) via a terminal device, wherein the GUI displays virtual characters, and the device includes: The second acquisition module is used to acquire the user's user status; The user sentiment acquisition module is used to input the user's state into the sentiment recognition model and obtain the predicted user sentiment output by the sentiment recognition model. The character behavior acquisition module is used to control the virtual character to perform character behaviors that match the predicted user emotions based on the predicted user emotions. The user behavior prediction module is used to input the predicted user emotion and the role behavior into the interaction model to obtain the predicted user behavior output by the interaction model, wherein the interaction model is trained by the method according to any one of claims 1 to 10. The display module presents the predicted user behavior on the graphical user interface in a manner that allows interaction with the virtual character.
15. An electronic device, characterized in that, include: processor; as well as A memory for storing a data processing program, which, when the electronic device is powered on and runs through the processor, executes the method as described in any one of claims 1-12.
16. A computer-readable storage medium, characterized in that, The system contains a data processing program that is executed by a processor to perform the method as described in any one of claims 1-12.
Citation Information
Patent Citations
Data processing method and device, electronic equipment and storage medium
CN117018635A
AIGC-based interaction method, apparatus and device, and storage medium
CN117520489A
Intelligent mobile AI digital human interaction method and system based on transparent display device
CN117908683A
Network conference interaction method and device, computer equipment and storage medium
CN117978953A
Model training method, virtual object action generation method, electronic equipment and storage medium
CN118154772A
Cited By
Metacosm player behavior off-line hosting method and system
CN122020409A