AI role interaction method and system based on user emotional tendency and expression preference recognition
By setting specific roles for AI characters and combining emotional recognition technology, the output content is adjusted to match the user's emotions, the problem of lack of emotional resonance in traditional intelligent interaction systems is solved, and a natural and friendly interactive experience is achieved.
Patent Information
- Application Number
- CN202311712044.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-13
- Publication Date
- 2025-07-22
AI Technical Summary
Traditional intelligent interactive systems lack emotional resonance, and the user communication process is too mechanical and indifferent, ignoring emotional and humanized factors.
By setting specific roles for AI characters and combining emotional recognition technology, analyzing user input content and adjusting output content to fit the user's emotions and tone, achieving natural and friendly interaction.
It enhances the emotional resonance between users and AI, improves the fun and personalized experience of interaction, and enhances the user's participation and satisfaction.
Smart Images

Figure CN120353882A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent AI character interaction, and particularly to an AI character interaction method and system based on the recognition of user emotional tendency and expression preference. Background Art
[0002] Traditional intelligent interaction systems often lack emotional resonance, and users may feel that the communication process is too mechanical and cold. Specifically, traditional intelligent interaction systems mainly focus on task completion and information transmission, and often ignore emotional and humanized factors.
[0003] In order to enhance users' trust and dependence on intelligent interaction systems, improve users' participation and satisfaction, and promote the establishment of long-term relationships between users and systems, an AI character interaction method and system based on the recognition of user emotional tendency and expression preference are expected. Summary of the Invention
[0004] An embodiment of the present invention provides an AI character interaction method and system based on the recognition of user emotional tendency and expression preference, which obtains user input interaction content; performs semantic encoding on the user input interaction content at different granularities to obtain a sequence of user input interaction content word granularity semantic encoding feature vectors and a sequence of user input interaction content sentence granularity semantic encoding feature vectors; performs feature interaction on the sequence of user input interaction content word granularity semantic encoding feature vectors and the sequence of user input interaction content sentence granularity semantic encoding feature vectors to obtain a user input interaction content multi-granularity semantic encoding feature vector; and, based on the user input interaction content multi-granularity semantic encoding feature vector, adjusts the answer content of the AI character. In this way, the AI character can adjust its answer content according to the user's emotional state and personality characteristics, so as to achieve a more natural, friendly and emotional interaction.
[0005] An embodiment of the present invention also provides an AI character interaction method based on the recognition of user emotional tendency and expression preference, which includes: Obtain user input interaction content; Perform semantic encoding on the user input interaction content at different granularities to obtain a sequence of user input interaction content word granularity semantic encoding feature vectors and a sequence of user input interaction content sentence granularity semantic encoding feature vectors; Perform feature interaction on the sequence of user input interaction content word granularity semantic encoding feature vectors and the sequence of user input interaction content sentence granularity semantic encoding feature vectors to obtain a user input interaction content multi-granularity semantic encoding feature vector; and Based on the user input interaction content multi-granularity semantic encoding feature vector, adjust the answer content of the AI character.
[0006] An embodiment of the present invention further provides an AI character interaction system based on user emotion tendency and expression preference recognition, which includes: An input interaction content acquisition module, configured to acquire user input interaction content; A semantic encoding module, configured to perform semantic encoding on the user input interaction content at different granularities to obtain a sequence of word-level semantic encoding feature vectors of the user input interaction content and a sequence of sentence-level semantic encoding feature vectors of the user input interaction content; A feature interaction module, configured to perform feature interaction on the sequence of word-level semantic encoding feature vectors of the user input interaction content and the sequence of sentence-level semantic encoding feature vectors of the user input interaction content to obtain a multi-granularity semantic encoding feature vector of the user input interaction content; and An answer content adjustment module of the AI character, configured to adjust the answer content of the AI character based on the multi-granularity semantic encoding feature vector of the user input interaction content. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings. In the drawings: Figure 1 is a flowchart of an AI character interaction method based on user emotion tendency and expression preference recognition provided in an embodiment of the present invention.
[0008] Figure 2 is a schematic diagram of the system architecture of an AI character interaction method based on user emotion tendency and expression preference recognition provided in an embodiment of the present invention.
[0009] Figure 3 is a block diagram of an AI character interaction system based on user emotion tendency and expression preference recognition provided in an embodiment of the present invention.
[0010] Figure 4 is an application scenario diagram of an AI character interaction method based on user emotion tendency and expression preference recognition provided in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0011] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following further describes the embodiments of the present invention in detail with reference to the drawings. Herein, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but not to limit the present invention.
[0012] Unless otherwise specified, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by those skilled in the technical field of this application. The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit the scope of this application.
[0013] In the description of the embodiments of this application, it should be noted that unless otherwise specified and defined, the term "connection" should be understood in a broad sense. For example, it can be an electrical connection or the connection inside two components. It can be directly connected or indirectly connected through an intermediate medium. For those of ordinary skill in the art, the specific meaning of the above terms can be understood according to specific circumstances.
[0014] It should be noted that the terms "first / second / third" involved in the embodiments of this application are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged in a specific order or sequence under allowable circumstances. It should be understood that the objects distinguished by "first / second / third" can be interchanged under appropriate circumstances so that the embodiments of this application described here can be implemented in an order other than those illustrated or described here.
[0015] This application discloses an AI character interaction method based on the recognition of user emotional tendencies and expression preferences. By assigning a specific role setting to the AI during the interaction and combining emotion recognition technology, it enables the AI to adjust the output content according to the user's emotion and tone, providing users with a more emotionally resonant and personalized interaction experience. This method has broad application prospects in the field of intelligent interaction.
[0016] In an embodiment of this application, an AI character interaction method based on the recognition of user emotional tendencies and expression preferences is provided. First, a large language model is used to assign a specific role setting to the AI, which can be a character in a fictional story, enabling it to have a conversation with the user in the identity of that character. Then, this method combines emotion recognition technology to analyze the sentences input by the user and identify the emotional tendencies and tones therein. Based on the results of emotion recognition, the AI adjusts its output content to fit the user's emotion and tone, thereby enhancing the emotional resonance and personalized experience of the interaction.
[0017] The specific steps include: Role setting: In the algorithm initialization stage, select a role setting from a predefined role library and apply it to the AI. This role setting will guide the AI's expression mode, word - using style, etc. during the interaction.
[0018] Emotion recognition: When a user inputs text, the algorithm uses emotion recognition technology to analyze the emotions in the text, such as joy, anger, sadness, and emotional intensity. Emotion recognition can be based on natural language processing technology, such as emotional vocabulary, sentiment analysis models, etc.
[0019] Content Adjustment: Based on the results of emotion recognition, AI adjusts its output content. For example, if the user expresses a happy emotion, AI will respond with positive words; if the user expresses anxiety, AI will provide a comforting response.
[0020] Interaction iteration: As the interaction progresses, AI continuously perceives the user's tone and emotional changes and adjusts its expression content in real time. This can be achieved through continuous emotion recognition and dynamic content generation.
[0021] In one embodiment of the present invention, Figure 1 The present invention provides a flowchart of an AI character interaction method based on user emotional tendency and expression preference recognition in an embodiment of the present invention. Figure 2 Schematic diagram of the system architecture of an AI role interaction method based on user emotional tendency and expression preference recognition provided in an embodiment of the present invention. Figure 1 and Figure 2 As shown, the AI character interaction method based on user emotion tendency and expression preference recognition according to an embodiment of the present invention includes: 110, obtaining user input interaction content; 120, performing semantic encoding based on different granularities on the user input interaction content to obtain a sequence of word-granularity semantic encoding feature vectors of the user input interaction content and a sequence of sentence-granularity semantic encoding feature vectors of the user input interaction content; 130, performing feature interaction on the sequence of word-granularity semantic encoding feature vectors of the user input interaction content and the sequence of sentence-granularity semantic encoding feature vectors of the user input interaction content to obtain a multi-granularity semantic encoding feature vector of the user input interaction content; and, 140, adjusting the answer content of the AI character based on the multi-granularity semantic encoding feature vector of the user input interaction content.
[0022] In response to the above technical problems, the technical concept of this application is to use natural language processing technology to construct an AI character interaction solution that can identify users' emotional tendencies and expression preferences, so that the AI character can adjust its own answer content according to the user's emotional state and personality characteristics, thereby achieving a more natural, friendly and emotional interaction.
[0023] Based on this, in the technical solution of this application, first, user input interaction content is obtained. It should be understood that when a user converses or communicates with an intelligent interaction system, the user usually expresses their intentions, needs, and emotional states through text input. These text inputs can contain rich semantic and emotional information, such as the emotional color of words, the emotional tendency of sentences, the expression of tone, etc. By analyzing the semantic and emotional characteristics of the user input text, the emotional tendency and expression preferences of the user can be inferred, thereby identifying the user's emotional category.
[0024] Then, after performing word segmentation processing on the user input interaction content, a semantic encoder including a word embedding layer is used to obtain a sequence of word-level semantic encoding feature vectors of the user input interaction content; at the same time, after performing sentence segmentation processing on the user input interaction content, a semantic encoder including a sentence embedding layer is used to obtain a sequence of sentence-level semantic encoding feature vectors of the user input interaction content. Here, through word segmentation processing and sentence segmentation processing, the user input interaction content is divided into text representations at different levels, and then the semantic encoder is used to capture the lexical semantic feature information and the overall semantic meaning of the text at the sentence level respectively, so as to more comprehensively capture the emotional features and guide the model to understand the user's emotional needs and emotional expressions.
[0025] In a specific embodiment of this application, performing semantic encoding on the user input interaction content based on different granularities to obtain a sequence of word-level semantic encoding feature vectors of the user input interaction content and a sequence of sentence-level semantic encoding feature vectors of the user input interaction content includes: performing word segmentation processing on the user input interaction content and then using a semantic encoder including a word embedding layer to obtain the sequence of word-level semantic encoding feature vectors of the user input interaction content; and, performing sentence segmentation processing on the user input interaction content and then using a semantic encoder including a sentence embedding layer to obtain the sequence of sentence-level semantic encoding feature vectors of the user input interaction content.
[0026] Specifically, performing word segmentation processing on the user input interaction content and then using a semantic encoder including a word embedding layer to obtain the sequence of word-level semantic encoding feature vectors of the user input interaction content includes: performing word segmentation processing on the user input interaction content to convert the user input interaction content into a word sequence composed of multiple words; using the word embedding layer of the semantic encoder including the word embedding layer to map each word in the word sequence to a word vector to obtain a sequence of word vectors; and, using the semantic encoder including the word embedding layer to perform global context semantic encoding on the sequence of word vectors to obtain the sequence of word-level semantic encoding feature vectors of the user input interaction content.
[0027] More specifically, using the semantic encoder including the word embedding layer to perform global context semantic encoding on the sequence of the word vectors to obtain the sequence of the word granularity semantic encoding feature vectors of the user input interaction content, including: arranging the sequence of the word vectors in one dimension to obtain the global word vector; calculating the product between the global word vector and the transposed vectors of each word vector in the sequence of the word vectors to obtain a plurality of self-attention correlation matrices; respectively performing normalization processing on each self-attention correlation matrix in the plurality of self-attention correlation matrices to obtain a plurality of normalized self-attention correlation matrices; passing each normalized self-attention correlation matrix in the plurality of normalized self-attention correlation matrices through the Softmax classification function to obtain a plurality of probability values; and respectively using each probability value in the plurality of probability values as a weight to weight each word vector in the sequence of the word vectors to obtain the sequence of the word granularity semantic encoding feature vectors of the user input interaction content.
[0028] Next, use the multi-granularity interaction semantic encoder to process the sequence of the sentence granularity semantic encoding feature vectors of the user input interaction content and the sequence of the word granularity semantic encoding feature vectors of the user input interaction content to obtain the multi-granularity semantic encoding feature vectors of the user input interaction content.
[0029] That is, through the multi-granularity interaction semantic encoder, the lexical semantic representation expressed by the sequence of the sentence granularity semantic encoding feature vectors of the user input interaction content and the overall sentence granularity semantic representation expressed by the word granularity semantic encoding feature vectors of the user input interaction content are fused to synthesize semantic information at different levels, providing accurate and comprehensive context information for the subsequent model to understand and recognize the user's intention and emotional state.
[0030] In a specific embodiment of the present application, performing feature interaction on the sequence of the word granularity semantic encoding feature vectors of the user input interaction content and the sequence of the sentence granularity semantic encoding feature vectors of the user input interaction content to obtain the multi-granularity semantic encoding feature vectors of the user input interaction content, including: using the multi-granularity interaction semantic encoder to process the sequence of the sentence granularity semantic encoding feature vectors of the user input interaction content and the sequence of the word granularity semantic encoding feature vectors of the user input interaction content to obtain the multi-granularity semantic encoding feature vectors of the user input interaction content.
[0031] Specifically, a multi-granularity interaction semantic encoder is used to process the sequence of sentence-level semantic encoding feature vectors of the user input interaction content and the sequence of word-level semantic encoding feature vectors of the user input interaction content to obtain the multi-granularity semantic encoding feature vectors of the user input interaction content, including: calculating the correlation between each sentence-level semantic encoding feature vector in the sequence of sentence-level semantic encoding feature vectors of the user input interaction content and each word-level semantic encoding feature vector in the sequence of word-level semantic encoding feature vectors of the user input interaction content; based on the correlation between each sentence-level semantic encoding feature vector in the sequence of sentence-level semantic encoding feature vectors of the user input interaction content and all word-level semantic encoding feature vectors in the sequence of word-level semantic encoding feature vectors of the user input interaction content, and all word-level semantic encoding feature vectors in the sequence of word-level semantic encoding feature vectors of the user input interaction content, performing interactive update on each sentence-level semantic encoding feature vector in the sequence of sentence-level semantic encoding feature vectors of the user input interaction content to obtain an updated sequence of sentence-level semantic encoding feature vectors of the user input interaction content; based on the correlation between each word-level semantic encoding feature vector in the sequence of word-level semantic encoding feature vectors of the user input interaction content and all sentence-level semantic encoding feature vectors in the sequence of sentence-level semantic encoding feature vectors of the user input interaction content, and all sentence-level semantic encoding feature vectors in the sequence of sentence-level semantic encoding feature vectors of the user input interaction content, performing interactive update on each word-level semantic encoding feature vector in the sequence of word-level semantic encoding feature vectors of the user input interaction content to obtain an updated sequence of word-level semantic encoding feature vectors of the user input interaction content; and fusing the sequence of sentence-level semantic encoding feature vectors of the user input interaction content, the updated sequence of sentence-level semantic encoding feature vectors of the user input interaction content, the sequence of word-level semantic encoding feature vectors of the user input interaction content, and the updated sequence of word-level semantic encoding feature vectors of the user input interaction content to obtain the multi-granularity semantic encoding feature vectors of the user input interaction content.
[0032] Among them, in a specific embodiment of the present application, calculating the correlation degree between each user input interaction content sentence-level semantic encoding feature vector in the sequence of user input interaction content sentence-level semantic encoding feature vectors and each user input interaction content word-level semantic encoding feature vector in the sequence of user input interaction content word-level semantic encoding feature vectors includes: calculating the correlation degree between each user input interaction content sentence-level semantic encoding feature vector in the sequence of user input interaction content sentence-level semantic encoding feature vectors and each user input interaction content word-level semantic encoding feature vector in the sequence of user input interaction content word-level semantic encoding feature vectors according to the following correlation degree formula, where the correlation degree formula is: Among them, represents the correlation degree between the th user input interaction content sentence-level semantic encoding feature vector in the sequence of user input interaction content sentence-level semantic encoding feature vectors and the th user input interaction content word-level semantic encoding feature vector in the sequence of user input interaction content word-level semantic encoding feature vectors. represents the th user input interaction content sentence-level semantic encoding feature vector in the sequence of user input interaction content sentence-level semantic encoding feature vectors, and represents the th user input interaction content word-level semantic encoding feature vector in the sequence of user input interaction content word-level semantic encoding feature vectors.
[0033] In a specific embodiment of the present application, fusing the sequence of user input interaction content sentence-level semantic encoding feature vectors, the sequence of updated user input interaction content sentence-level semantic encoding feature vectors, the sequence of user input interaction content word-level semantic encoding feature vectors, and the sequence of updated user input interaction content word-level semantic encoding feature vectors to obtain the user input interaction content multi-granularity semantic encoding feature vector includes: fusing the sequence of user input interaction content sentence-level semantic encoding feature vectors and the sequence of updated user input interaction content sentence-level semantic encoding feature vectors to obtain a sequence of interaction-fused user input interaction content sentence-level semantic encoding feature vectors; fusing the sequence of user input interaction content word-level semantic encoding feature vectors and the sequence of updated user input interaction content word-level semantic encoding feature vectors to obtain a sequence of interaction-fused user input interaction content word-level semantic encoding feature vectors; and splicing the sequence of interaction-fused user input interaction content sentence-level semantic encoding feature vectors and the sequence of interaction-fused user input interaction content word-level semantic encoding feature vectors to obtain the user input interaction content multi-granularity semantic encoding feature vector.
[0034] In one embodiment of the present application, based on the multi-granularity semantic encoding feature vector of the user input interaction content, adjusting the response content of the AI role includes: performing feature distribution correction on the multi-granularity semantic encoding feature vector of the user input interaction content to obtain a corrected multi-granularity semantic encoding feature vector of the user input interaction content; passing the corrected multi-granularity semantic encoding feature vector of the user input interaction content through a classifier to obtain a classification result, where the classification result is used to represent the sentiment category label of the user input interaction content; and adjusting the response content of the AI role based on the classification result.
[0035] In the above technical solution, the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content and the sequence of the word-level semantic encoding feature vectors of the user input interaction content are respectively used to express the encoded text semantic features of the user input interaction content based on the word level and the sentence level. Thus, when using the multi-granularity interaction semantic encoder to process the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content and the sequence of the word-level semantic encoding feature vectors of the user input interaction content, considering that the semantic feature encoding granularity difference between the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content and the sequence of the word-level semantic encoding feature vectors of the user input interaction content may lead to sparsity in the multi-granularity interaction corresponding to the semantic features, thereby affecting the expression effect of the multi-granularity semantic encoding feature vector of the user input interaction content obtained by the multi-granularity semantic interaction fusion. Therefore, it is desired to optimize the feature correspondence based on the feature expression significance and key points of the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content and the sequence of the word-level semantic encoding feature vectors of the user input interaction content respectively, so as to improve the expression effect of the multi-granularity semantic encoding feature vector of the user input interaction content.
[0036] Based on this, the applicant of the present application corrects the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content and the sequence of the word-level semantic encoding feature vectors of the user input interaction content, which is specifically expressed as: correcting the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content and the sequence of the word-level semantic encoding feature vectors of the user input interaction content with the following optimization formula to obtain corrected feature vectors; where the optimization formula is: Where is the first concatenated feature vector obtained by concatenating the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content, and is the second concatenated feature vector obtained by concatenating the sequence of the word-level semantic encoding feature vectors of the user input interaction content, represents the element-wise square root of the feature vector, and are respectively the feature vectors and the reciprocal of the maximum eigenvalue, and are weight hyperparameters, is the corrected eigenvector, represents subtraction by position, represents multiplication by position; then the corrected eigenvector is fused with the multi-granularity semantic encoding feature vector of the user input interaction content to obtain the corrected multi-granularity semantic encoding feature vector of the user input interaction content.
[0037] Here, a pre-segmented local group of the eigenvalue set is obtained by taking the square root of each eigenvalue of the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content and the sequence of the word-level semantic encoding feature vectors of the user input interaction content, and the key maximum features of the sentence-level semantic encoding feature vectors of the user input interaction content and the word-level semantic encoding feature vectors of the user input interaction content are regressed from them. In this way, the position-wise significance distribution of the eigenvalues can be enhanced based on the idea of farthest point sampling, so that the sparse correspondence control between the eigenvectors can be performed through the key features with significant distribution to realize the corrected eigenvector for the restoration of the original manifold geometry of the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content and the sequence of the word-level semantic encoding feature vectors of the user input interaction content. In this way, the corrected eigenvector is fused with the multi-granularity semantic encoding feature vector of the user input interaction content, and the expression effect of the corrected multi-granularity semantic encoding feature vector of the user input interaction content can be enhanced, thereby enhancing the accuracy of the classification result obtained by the classifier.
[0038] Further, the corrected multi-granularity semantic encoding feature vector of the user input interaction content is passed through a classifier to obtain a classification result, and the classification result is used to represent the sentiment category label of the user input interaction content; and based on the classification result, the response content of the AI role is adjusted. In a specific example of the present application, the sentiment category label is positive / positive sentiment, negative / negative sentiment, and neutral sentiment. In another specific example of the present application, the sentiment category label is anxious / nervous sentiment, excited / excited sentiment, and disgusted / disgusted sentiment. In particular, the response content of the AI role is adjusted according to the sentiment category of the classification result. For example, for the positive sentiment category, a positive and optimistic tone and content can be used for the response; for the negative sentiment category, a tone and content of understanding and comfort can be used for the response.
[0039] It should be understood that the beneficial effects that can be produced by the AI role interaction method based on user sentiment tendency and expression preference recognition of the present application include: Provide emotional resonance: This algorithm enables AI to make personalized responses according to the user's emotions and tones, enhancing the emotional resonance between the user and AI and improving the humanization of the interaction experience.
[0040] Increase interest: By playing specific roles, the communication of AI becomes more interesting, making it easier for users to engage and improving the attractiveness and entertainment of the interaction.
[0041] Provide a personalized experience: Through the combination of role-playing and emotion recognition, users can experience an interaction that is more in line with their emotional state and obtain more personalized services.
[0042] In summary, the AI role interaction method based on the recognition of user emotional tendencies and expression preferences according to the embodiments of the present invention is elucidated. It uses natural language processing technology to construct an AI role interaction solution that can recognize user emotional tendencies and expression preferences, enabling the AI role to adjust its response content according to the user's emotional state and personality characteristics, thereby achieving a more natural, friendly, and emotional interaction.
[0043] Figure 3 This is a block diagram of an AI role interaction system provided in an embodiment of the present invention. As Figure 3 shown, the AI role interaction system 200 based on the recognition of user emotional tendencies and expression preferences includes: an input interaction content acquisition module 210 for acquiring user input interaction content; a semantic encoding module 220 for performing semantic encoding on the user input interaction content at different granularities to obtain a sequence of user input interaction content word granularity semantic encoding feature vectors and a sequence of user input interaction content sentence granularity semantic encoding feature vectors; a feature interaction module 230 for performing feature interaction on the sequence of user input interaction content word granularity semantic encoding feature vectors and the sequence of user input interaction content sentence granularity semantic encoding feature vectors to obtain a multi-granularity semantic encoding feature vector of the user input interaction content; and an answer content adjustment module 240 of the AI role for adjusting the answer content of the AI role based on the multi-granularity semantic encoding feature vector of the user input interaction content.
[0044] Those skilled in the art can understand that the specific operations of each step in the above AI role interaction system based on the recognition of user emotional tendencies and expression preferences have been introduced in detail in the description of the above Figures 1 to 2 AI role interaction method based on the recognition of user emotional tendencies and expression preferences, and therefore, the repeated description thereof will be omitted.
[0045] As described above, the AI character interaction system 200 based on user sentiment tendency and expression preference recognition according to an embodiment of the present invention can be implemented in various terminal devices, such as a server for AI character interaction based on user sentiment tendency and expression preference recognition. In one example, the AI character interaction system 200 based on user sentiment tendency and expression preference recognition according to an embodiment of the present invention can be integrated into a terminal device as a software module and / or a hardware module. For example, the AI character interaction system 200 based on user sentiment tendency and expression preference recognition can be a software module in the operating system of the terminal device, or can be an application program developed for the terminal device; of course, the AI character interaction system 200 based on user sentiment tendency and expression preference recognition can also be one of many hardware modules of the terminal device.
[0046] Alternatively, in another example, the AI character interaction system 200 based on user sentiment tendency and expression preference recognition and the terminal device can also be separate devices, and the AI character interaction system 200 based on user sentiment tendency and expression preference recognition can be connected to the terminal device through a wired and / or wireless network and transmit interaction information in accordance with a predefined data format.
[0047] Figure 4 It is an application scenario diagram of an AI character interaction method based on user sentiment tendency and expression preference recognition provided in an embodiment of the present invention. As Figure 4 shown, in this application scenario, first, user input interaction content is obtained (for example, C as illustrated in Figure 4 ); then, the obtained user input interaction content is input into a server deployed with an AI character interaction algorithm based on user sentiment tendency and expression preference recognition (for example, S as illustrated in Figure 4 ), where the server can process the user input interaction content based on the AI character interaction algorithm based on user sentiment tendency and expression preference recognition to adjust the response content of the AI character.
[0048] The specific embodiments described above further elaborate on the purpose, technical solutions, and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An AI character interaction method based on the recognition of user emotional tendencies and expression preferences, characterized in that, Including: Obtain user input interaction content; Perform semantic encoding on the user input interaction content based on different granularities to obtain a sequence of word granularity semantic encoding feature vectors of the user input interaction content and a sequence of sentence granularity semantic encoding feature vectors of the user input interaction content; Perform feature interaction on the sequence of word granularity semantic encoding feature vectors of the user input interaction content and the sequence of sentence granularity semantic encoding feature vectors of the user input interaction content to obtain a multi-granularity semantic encoding feature vector of the user input interaction content; And Based on the multi-granularity semantic encoding feature vector of the user input interaction content, adjust the response content of the AI role.
2. The AI character interaction method based on the recognition of user emotional tendency and expression preference according to claim 1, characterized in that, Performing semantic encoding on the user input interaction content based on different granularities to obtain a sequence of word granularity semantic encoding feature vectors of the user input interaction content and a sequence of sentence granularity semantic encoding feature vectors of the user input interaction content includes: Performing word segmentation on the user input interaction content and then passing it through a semantic encoder including a word embedding layer to obtain a sequence of word granularity semantic encoding feature vectors of the user input interaction content; and Performing sentence segmentation on the user input interaction content and then passing it through a semantic encoder including a sentence embedding layer to obtain a sequence of sentence granularity semantic encoding feature vectors of the user input interaction content.
3. The AI character interaction method based on the recognition of user emotional tendency and expression preference according to claim 2, wherein, Performing word segmentation on the user input interaction content and then passing it through a semantic encoder including a word embedding layer to obtain a sequence of word granularity semantic encoding feature vectors of the user input interaction content includes: Perform word segmentation on the user input interaction content to convert the user input interaction content into a word sequence composed of multiple words; Use the word embedding layer of the semantic encoder including the word embedding layer to map each word in the word sequence to a word vector to obtain a sequence of word vectors; and Use the semantic encoder including the word embedding layer to perform global context semantic encoding on the sequence of word vectors to obtain a sequence of word granularity semantic encoding feature vectors of the user input interaction content.
4. The AI character interaction method based on the recognition of user emotional tendency and expression preference according to claim 3, wherein, Using the semantic encoder including the word embedding layer to perform global context semantic encoding on the sequence of word vectors to obtain a sequence of word granularity semantic encoding feature vectors of the user input interaction content includes: Arrange the sequence of word vectors in one dimension to obtain a global word vector; Calculate the product between the global word vector and the transposed vectors of each word vector in the sequence of word vectors to obtain a plurality of self-attention correlation matrices; Perform normalization processing on each self-attention correlation matrix in the plurality of self-attention correlation matrices to obtain a plurality of normalized self-attention correlation matrices; Pass each normalized self-attention correlation matrix in the plurality of normalized self-attention correlation matrices through a Softmax classification function to obtain a plurality of probability values; and Respectively use each probability value in the plurality of probability values as a weight to weight each word vector in the sequence of word vectors to obtain a sequence of word granularity semantic encoding feature vectors of the user input interaction content.
5. The AI character interaction method based on user emotion tendency and expression preference recognition according to claim 4, wherein Perform feature interaction on the sequence of the word-level semantic encoding feature vectors of the user input interaction content and the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content to obtain the multi-granularity semantic encoding feature vectors of the user input interaction content, including: Use a multi-granularity interaction semantic encoder to process the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content and the sequence of the word-level semantic encoding feature vectors of the user input interaction content to obtain the multi-granularity semantic encoding feature vectors of the user input interaction content.
6. The AI character interaction method based on the recognition of user emotional tendency and expression preference according to claim 5, wherein, Use a multi-granularity interaction semantic encoder to process the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content and the sequence of the word-level semantic encoding feature vectors of the user input interaction content to obtain the multi-granularity semantic encoding feature vectors of the user input interaction content, including: Calculate the correlation degree between each sentence-level semantic encoding feature vector in the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content and each word-level semantic encoding feature vector in the sequence of the word-level semantic encoding feature vectors of the user input interaction content; Based on the correlation degree between each sentence-level semantic encoding feature vector in the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content and all word-level semantic encoding feature vectors in the sequence of the word-level semantic encoding feature vectors of the user input interaction content, and all word-level semantic encoding feature vectors in the sequence of the word-level semantic encoding feature vectors of the user input interaction content, perform interactive update on each sentence-level semantic encoding feature vector in the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content to obtain a sequence of updated sentence-level semantic encoding feature vectors of the user input interaction content; Based on the correlation degree between each word-level semantic encoding feature vector in the sequence of the word-level semantic encoding feature vectors of the user input interaction content and all sentence-level semantic encoding feature vectors in the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content, and all sentence-level semantic encoding feature vectors in the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content, perform interactive update on each word-level semantic encoding feature vector in the sequence of the word-level semantic encoding feature vectors of the user input interaction content to obtain a sequence of updated word-level semantic encoding feature vectors of the user input interaction content; and Fuse the sequence of the sentence-level semantic encoding feature vectors of the user input interaction content, the sequence of the updated sentence-level semantic encoding feature vectors of the user input interaction content, the sequence of the word-level semantic encoding feature vectors of the user input interaction content, and the sequence of the updated word-level semantic encoding feature vectors of the user input interaction content to obtain the multi-granularity semantic encoding feature vectors of the user input interaction content.
7. The AI character interaction method based on user sentiment tendency and expression preference recognition according to claim 6, wherein Calculating the correlation between each user input interaction content sentence-level semantic encoding feature vector in the sequence of user input interaction content sentence-level semantic encoding feature vectors and each user input interaction content word-level semantic encoding feature vector in the sequence of user input interaction content word-level semantic encoding feature vectors includes: Calculate the relevance between each user input interaction sentence granularity semantic encoding feature vector in the sequence of the user input interaction sentence granularity semantic encoding feature vectors and each user input interaction word granularity semantic encoding feature vector in the sequence of the user input interaction word granularity semantic encoding feature vectors according to the following relevance formula, where the relevance formula is: Wherein, represents the relevance between the -th user input interaction sentence granularity semantic encoding feature vector in the sequence of the user input interaction sentence granularity semantic encoding feature vectors and the -th user input interaction word granularity semantic encoding feature vector in the sequence of the user input interaction word granularity semantic encoding feature vectors, represents the -th user input interaction sentence granularity semantic encoding feature vector in the sequence of the user input interaction sentence granularity semantic encoding feature vectors, and represents the -th user input interaction word granularity semantic encoding feature vector in the sequence of the user input interaction word granularity semantic encoding feature vectors.
8. The AI character interaction method based on the recognition of user emotional tendency and expression preference according to claim 7, characterized in that, Fusing the sequence of user input interaction content sentence-level semantic encoding feature vectors, the sequence of updated user input interaction content sentence-level semantic encoding feature vectors, the sequence of user input interaction content word-level semantic encoding feature vectors, and the sequence of updated user input interaction content word-level semantic encoding feature vectors to obtain the user input interaction content multi-granularity semantic encoding feature vector, including: Fusing the sequence of user input interaction content sentence-level semantic encoding feature vectors and the sequence of updated user input interaction content sentence-level semantic encoding feature vectors to obtain a sequence of interaction-fused user input interaction content sentence-level semantic encoding feature vectors; Fusing the sequence of user input interaction content word-level semantic encoding feature vectors and the sequence of updated user input interaction content word-level semantic encoding feature vectors to obtain a sequence of interaction-fused user input interaction content word-level semantic encoding feature vectors; and Concatenating the sequence of interaction-fused user input interaction content sentence-level semantic encoding feature vectors and the sequence of interaction-fused user input interaction content word-level semantic encoding feature vectors to obtain the user input interaction content multi-granularity semantic encoding feature vector.
9. The AI character interaction method based on the recognition of user emotional tendency and expression preference according to claim 8, wherein, Based on the user input interaction content multi-granularity semantic encoding feature vector, adjusting the response content of the AI role, including: Performing feature distribution correction on the user input interaction content multi-granularity semantic encoding feature vector to obtain a corrected user input interaction content multi-granularity semantic encoding feature vector; Passing the corrected user input interaction content multi-granularity semantic encoding feature vector through a classifier to obtain a classification result, where the classification result is used to represent the sentiment category label of the user input interaction content; Based on the classification result, adjusting the response content of the AI role.
10. An AI character interaction system based on user sentiment tendency and expression preference recognition, characterized in that, Including: An input interaction content acquisition module for acquiring user input interaction content; A semantic encoding module for performing semantic encoding on the user input interaction content at different granularities to obtain a sequence of user input interaction content word-level semantic encoding feature vectors and a sequence of user input interaction content sentence-level semantic encoding feature vectors; A feature interaction module for performing feature interaction on the sequence of user input interaction content word-level semantic encoding feature vectors and the sequence of user input interaction content sentence-level semantic encoding feature vectors to obtain a user input interaction content multi-granularity semantic encoding feature vector; And An AI role response content adjustment module for adjusting the response content of the AI role based on the user input interaction content multi-granularity semantic encoding feature vector.
Citation Information
Cited By
Intelligent interaction method and system based on AIGC
CN120996212A
Intelligent interaction method and system based on AIGC
CN120996212B
Natural language processing-based senior comfort accompanying semantic understanding method and system
CN122113929A
A semantic understanding method and system for elderly companionship based on natural language processing
CN122113929B
AI-based method and device for generating personalized companion dialogue content
CN122570716A