A personalized emotional interaction method, system, electronic device and storage medium
By combining fast decision-making and slow decision-making mechanisms in the dialogue system, context semantic understanding and personalized emotional interaction are achieved, the limitations of traditional dialogue systems in semantic understanding and emotional interaction are solved, and the flexibility and personalization capabilities of the system are improved.
Patent Information
- Application Number
- CN202411008811.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-07-26
AI Technical Summary
Traditional dialogue systems have limitations in semantic understanding, flexibility and personalized emotional interactions, and are difficult to adapt to complex user intentions and emotional expressions, and lack the recognition of user fine particles and emotional stylized expressions.
By receiving long-term memory information and user input text, detecting and decision-making execution, combining fast decision-making and slow decision-making mechanisms, context semantic understanding and personalized emotional interaction are realized, asynchronous control is used for post-processing, and personalized emotional interaction data is generated.
It improves the semantic understanding and flexibility of the dialogue system, realizes personalized emotional interaction, enhances the recognition and expression of user emotions and security, and improves the response speed and content stability of the dialogue.
Smart Images

Figure CN118551847B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent agent dialogue interaction technology, and in particular to a personalized emotional interaction method, system, electronic device and storable medium. Background Art
[0002] An AI agent is generally considered to be an agent that can autonomously complete set goals through action capabilities. Traditional AI dialogue systems are usually based on rules and templates, and generate replies through predefined rules and templates. The advantages are fast response speed and relatively stable reply content. However, this system has the following limitations: 1) Traditional dialogue systems have limitations in semantic understanding, especially in multi-round dialogue interactions, it is difficult to accurately parse complex user intentions; 2) Because they are based on fixed rules and templates, traditional dialogue systems have limited flexibility and are difficult to adapt to changing dialogue needs; 3) Traditional dialogue systems are often unable to configure portraits, lack fine-grained emotion recognition and emotional stylized expression of users, and have poor personalized emotional interaction capabilities.
[0003] With the rapid development of intelligent agent technology in the era of large models, it is urgent to solve the above limitations of traditional dialogue systems. Summary of the invention
[0004] In order to overcome the problems existing in the related technologies, the present application provides a personalized emotional interaction method, system, electronic device and storable medium to solve the limitations of traditional dialogue systems and realize personalized emotional interaction based on contextual semantic understanding and flexible dialogue.
[0005] The first aspect of the present application provides a personalized emotional interaction method, comprising:
[0006] Receive long-term memory information M0, text information input by the user and current short-term memory information M1;
[0007] Detecting the text information input by the user and the current short-term memory information M1 to determine detection information, wherein the detection information includes: user emotion information, user safety information, and user semantic information expressed by the text input by the user;
[0008] Synchronously controlling the fast decision execution and the slow decision execution according to the short-term memory information M2 generated by the long-term memory information M0 and the detection information, and monitoring the decision status in real time to obtain the decision execution output result, wherein the decision execution output result includes the fast decision result and the slow decision result;
[0009] According to the decision execution output result, the long-term memory information M0 is retrieved to perform knowledge processing operation, and the knowledge processing output is determined, wherein the knowledge processing output includes: context information after knowledge processing, basic user profile information, basic machine profile information, and cognitive decision response configuration;
[0010] According to the decision execution output result and the short-term memory information M3, the fast decision response and the slow decision response are synchronously controlled, and the decision status is monitored in real time to obtain the cognitive decision response result, which includes: a fast decision response result and a slow decision response result;
[0011] According to the cognitive decision response result, the short-term memory information M4 is post-processed through an asynchronous control method to obtain personalized emotional interaction data, which includes: machine emotional information, machine safety information and machine output.
[0012] The second aspect of the present application provides a personalized emotional interaction system, comprising:
[0013] A pre-processing module is used to receive the long-term memory information M0, the text information input by the user and the current short-term memory information M1; and detect the text information input by the user and the current short-term memory information M1 to determine the detection information, wherein the detection information includes: user emotion information, user safety information and user semantic information expressed by the user input text;
[0014] A cognitive decision execution module, used for synchronously controlling fast decision execution and slow decision execution according to the short-term memory information M2 generated by the long-term memory information M0 and the detection information, and monitoring the decision status in real time to obtain a decision execution output result, wherein the decision execution output result includes a fast decision result and a slow decision result;
[0015] A knowledge processing module, used to retrieve the long-term memory information M0 according to the decision execution output result to perform knowledge processing operations and determine the knowledge processing output, wherein the knowledge processing output includes: context information after knowledge processing, basic user profile information, basic machine profile information and cognitive decision response configuration;
[0016] A cognitive decision response module is used to synchronously control the fast decision response and the slow decision response according to the decision execution output result and the short-term memory information M3, and monitor the decision status in real time to obtain the cognitive decision response result, which includes: a fast decision response result and a slow decision response result;
[0017] The post-processing module is used to post-process the short-term memory information M4 through an asynchronous control method according to the cognitive decision response result to obtain personalized emotional interaction data, and the personalized emotional interaction data includes: machine emotional information, machine safety information and machine output.
[0018] A third aspect of the present application provides an electronic device, including:
[0019] Processor; and
[0020] A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the personalized emotional interaction method as described above.
[0021] The fourth aspect of the present application provides a non-temporary machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor executes the personalized emotional interaction method as described above.
[0022] The technical solution provided by this application may have the following beneficial effects:
[0023] The technical solution of the present application provides a personalized emotional interaction method, system, electronic device and storage medium, which detects the text information input by the user and the current short-term memory information M1 to determine the detection information; performs synchronous control of fast decision execution and slow decision execution based on the short-term memory information M2 generated by the long-term memory information M0 and the detection information, and monitors the decision status in real time to obtain the decision execution output result; retrieves the long-term memory information M0 according to the decision execution output result to perform knowledge processing operations and determine the knowledge processing output; performs synchronous control of fast decision reply and slow decision reply based on the decision execution output result and short-term memory information M3, and monitors the decision status in real time to obtain the cognitive decision reply result; and performs post-processing of the short-term memory information M4 through asynchronous control according to the cognitive decision reply result to obtain personalized emotional interaction data. The present application realizes personalized emotional interaction based on contextual semantic understanding and flexible dialogue.
[0024] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The above and other objects, features and advantages of the present application will become more apparent through a more detailed description of exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.
[0026] Figure 1This is a flow chart of a personalized emotional interaction method shown in an embodiment of the present application;
[0027] Figure 2 is a structural schematic diagram of a personalized emotional interaction system shown in an embodiment of the present application;
[0028] Figure 3 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The preferred embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.
[0030] The applicant found in the research that the application of large model agents in dialogue systems has greatly improved the contextual semantic understanding and dialogue flexibility compared with traditional dialogue systems. The typical dialogue systems currently on the market have some shortcomings, such as the loop mechanism leading to a long decision chain; no independent security mechanism; lack of effective definition of long and short-term memory; no constraints on portrait configuration and emotional interaction, resulting in insufficient personalized emotional interaction capabilities.
[0031] In response to the above problems, the embodiments of the present application provide a personalized emotional interaction method and related devices to address the limitations of traditional dialogue systems and achieve personalized emotional interaction based on contextual semantic understanding and flexible dialogue.
[0032] The technical solution of the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0033] Figure 1 : is a flowchart of a personalized emotion interaction method shown in an embodiment of the present application. The embodiment of the present application is applicable to any emotion interaction situation, and the method can be executed by a personalized emotion interaction system provided in an embodiment of the present application, which can be integrated in various electronic devices such as computers and mobile phones.
[0034] See also Figure 1 The embodiment of the present application provides a personalized emotional interaction method, and designs a new Agent architecture to realize a safe and reliable personalized emotional interaction system, such as Figure 2 As shown, the architecture consists of a pre-processing module S1, a cognitive decision execution module S2, a knowledge processing module S3, a cognitive decision response module S4, a post-processing module S5, and long-term memory information M0, short-term memory information M1, M2, M3, M4. The method specifically includes the following steps:
[0035] S101: receiving long-term memory information M0, text information input by a user and current short-term memory information M1.
[0036] In an embodiment of the present application, the long-term memory information M0 is composed of basic user portrait information, basic machine portrait information, complete user portrait knowledge, complete machine portrait knowledge, massive context information, massive tool knowledge, cognitive decision execution configuration, and cognitive decision response configuration.
[0037] Basic user portrait information includes: basic user information (age, gender, occupation, hobbies, language style, etc.), user emotional information (personality, emotional state, etc.) and user security information. Complete user portrait knowledge includes: detailed information of the user (detailed biographical information, detailed resume, unique knowledge possessed by the user, etc.). Basic machine portrait information includes: basic machine information (age, gender, occupation, hobbies, language style, etc.), machine emotional information (personality, emotional state, emotional stylized configuration, etc.), and machine security information. Complete machine portrait knowledge includes: detailed information of the machine (detailed biographical information, detailed resume, unique knowledge possessed by the machine, etc.). Massive context information includes: massive context log information and related conversation summary information retained by the current user and the machine. Massive tool information includes: local knowledge search tools, external API tools, numerical calculation tools, etc. Among them, local knowledge search tools include but are not limited to question and answer library search, document search, table search, knowledge graph search, event graph search, etc. External API tools include but are not limited to calculation tools, text and image tools, weather query tools, web search tools, etc.
[0038] Cognitive decision execution configuration: Cognitive decision execution configuration consists of two parts: fast decision execution configuration and slow decision execution configuration. The design is inspired by the theory of the fast and slow dual process of human brain thinking activities. Among them, the fast decision execution configuration adopts a configuration method based on the finite state machine (FSM). The finite state machine (FSM) is a method used to describe a series of states and executions of a dialogue system. It can be used to represent different stages of a dialogue and possible transitions. Its core elements include state, state transition, execution action, initial state, and terminal state. As shown in Table 1, see Table 1 Fast decision execution dialogue state machine configuration example.
[0039] Table 1 Example of fast decision execution dialogue state machine configuration
[0040]
[0041] The slow decision execution configuration adopts the prompt configuration method based on the large model thinking chain causal decision mechanism. This configuration method coordinates thinking and execution actions. See Table 2 for an example of the slow decision execution prompt configuration.
[0042] Table 2 Slow decision execution prompt configuration example
[0043]
[0044] Cognitive decision response configuration: Cognitive decision response configuration consists of two parts: fast decision response configuration and slow decision response configuration. Fast decision response configuration is used together with fast decision execution configuration, and adopts the configuration method based on rule response template library. See Table 3 for an example of fast decision response configuration.
[0045] See Table 3 for an example of a quick decision response configuration.
[0046]
[0047] The slow decision reply configuration is used in conjunction with the slow decision execution configuration, and adopts the prompt configuration method based on the large model thinking chain causal decision-making mechanism. This configuration method coordinates thinking and reply actions. See Table 4 for an example of a slow decision reply prompt configuration.
[0048] Table 4 Slow decision reply prompt configuration example
[0049]
[0050] S102: Detect the text information input by the user and the current short-term memory information M1 to determine detection information, where the detection information includes: user emotion information, user safety information, and user semantic information expressed by the user input text.
[0051] In the embodiment of the present application, the current short-term memory information M1 generates context information m11 from the long-term memory information M0 while executing the pre-processing module S1. Specifically, the most recent 5 rounds of context conversations are read from the massive context information in the long-term memory information M0. In addition, if there is useful conversation summary information, it is also read.
[0052] In a specific embodiment, the above-mentioned detecting the text information input by the user and the current short-term memory information M1 to determine the detection information includes:
[0053] Identify the text information input by the user and the current short-term memory information M1 through the emotion multi-classification model to determine the user emotion information;
[0054] Based on the preset sensitive detection keyword library and combined with the professional external text content security review API, security detection is performed to determine user security information;
[0055] The text information input by the user and the semantics in the current short-term memory information M1 are identified through the intention classification model and the entity recognition model to determine the user semantic information expressed by the user input text.
[0056] It should be noted that the input of the pre-processing module S1 comes from the user text input S0 and the current short-term memory information M1 (working memory). The pre-processing module S1 consists of three parts: the pre-user emotion detection module S11, the pre-security detection module S12, and the pre-semantic detection module S13. Among them, the front user emotion detection module S11 outputs user emotion information M28, which mainly adopts the emotion multi-classification model (this method is not limited to the classification method using the traditional BERT small model or the classification method based on the large model fewshot mode), and can identify at least six emotions: like, anger, sadness, joy, complaint, and disgust; the front security detection module S12 outputs user security information M29, which adopts a method based on a self-built sensitive detection keyword library combined with a professional external text content security review API, and can identify at least 8 types of text security information: spam, advertising, sensitive content, violence and terrorism, pornography, insults, flooding, and prohibited; the front semantic detection module S13 outputs the user semantic information M2a expressed by the user text input S0, including intent and entity, etc., and mainly adopts the intent classification model (this method is not limited to the classification method using the traditional BERT small model or the classification method based on the large model fewshot mode) and the entity recognition model (this method is not limited to the keyword matching method, the traditional BERT small model or the named entity recognition method based on the large model fewshot capability), which mainly assists S2 in making decisions.
[0057] S103: Perform synchronous control of fast decision execution and slow decision execution based on the short-term memory information M2 generated by the long-term memory information M0 and the detection information, and monitor the decision status in real time to obtain a decision execution output result, which includes a fast decision result and a slow decision result.
[0058] In the embodiment of the present application, short-term memory information M2 is partially generated by long-term memory information M0 before executing cognitive decision execution module S2, namely basic user portrait information m22, basic machine portrait information m23, massive user portrait knowledge index m24, massive machine portrait knowledge index m25, massive tool knowledge index m26, cognitive decision execution configuration m27. Part of it is generated by the output of upstream pre-processing module S1, namely user emotion information m28, user security information m29, and user semantic information m2a.
[0059] It should be noted that the pre-processed context information m21 takes the output of the preceding pre-processing module S1, and integrates the state information of S1 pre-processing on the basis of the context information m11. The basic user portrait information m22 takes the basic user portrait information in the long-term memory information M0, including basic information, emotional state, and security information. The basic machine portrait information m23 takes the basic machine portrait information in the long-term memory information M0, including basic information, emotional state, and security information. The massive user portrait knowledge index m24 takes the index information of the massive user portrait knowledge in the long-term memory information M0. (Here, the concept of knowledge index is explained, just like knowledge is a book, and the limited chapters of each book and the limited chapter summary description are the index information of the chapter.) The massive machine portrait knowledge index m25 takes the index information of the massive machine portrait knowledge in the long-term memory information M0. The massive tool knowledge index m26 takes the index information of the massive tool knowledge in the long-term memory information M0. The cognitive decision execution configuration m27 takes the fast decision execution information and the slow decision execution information in the cognitive decision execution configuration in the long-term memory information M0. The user emotion information m28 is the user emotion information output by the preceding sequence S11. The user safety information m29 is the user safety information output by the preceding sequence S12. The user semantic information m2a is the user semantic detection information output by the preceding sequence S13.
[0060] In a specific embodiment, the short-term memory information M2 generated based on the long-term memory information M0 and the detection information perform synchronous control of fast decision execution and slow decision execution, and monitor the decision status in real time to obtain the decision execution output result, including:
[0061] Based on the fast decision mechanism of the finite state machine, a fast decision execution is performed on the short-term memory information M2 generated by the long-term memory information M0 and the detection information to obtain a fast decision execution result, wherein the fast decision execution result includes: the current finite state machine state and the execution action command;
[0062] Based on the large model thinking chain causal decision-making mechanism, a slow decision execution is performed on the short-term memory information M2 generated by the long-term memory information M0 and the detection information to obtain a slow decision execution result, which includes: the current thinking process and the execution action command;
[0063] When the quick decision execution result has a valid state and an execution action instruction, the knowledge processing operation is directly executed;
[0064] When the fast decision execution result does not have a valid state and an execution action instruction, the knowledge processing operation is entered after the slow decision execution process is completed.
[0065] It should be noted that the synchronous control adopted by the cognitive decision execution module S2 depends on the output of the preceding pre-processing module S1, and the data input comes from the short-term memory information M2 (working memory). The cognitive decision execution module S2 consists of a fast decision execution module S21 and a slow decision execution module S22.
[0066] Among them, the fast decision execution module S21 is based on the finite state machine (FSM) fast decision mechanism. The finite state machine (FSM) is a model used to describe a series of states and executions of a dialogue system. It can be used to represent different stages of a dialogue and possible transitions. Its core elements include state, state transition, execution action, initial state, and terminal state. Its output is the current finite state machine (FSM) state and execution action command s213. The slow decision execution module S22 is based on the large model thinking chain causal decision mechanism. Its principle is to make full use of the thinking chain (CoT) technology of the large model to coordinate thinking and execution actions. Its output is the current thinking process and execution action command s223.
[0067] In the embodiment, the specific decision-making process of the cognitive decision execution module S2 is to synchronously execute the fast decision execution module S21 and the slow decision execution module S22 and monitor the decision status. If the fast decision result has a valid status and an execution action command s213, it directly enters the next link knowledge processing module S3; if not, it waits for the slow decision process to end before entering the next link knowledge processing module S3.
[0068] S104: According to the decision execution output result, the long-term memory information M0 is retrieved to perform knowledge processing operations and determine the knowledge processing output, wherein the knowledge processing output includes: context information after knowledge processing, basic user portrait information, basic machine portrait information and cognitive decision response configuration.
[0069] In an embodiment of the present application, the input of the knowledge processing module S3 comes from the decision output of the cognitive decision execution module S2 and the massive knowledge stored in the long-term memory information M0. The decision output of the cognitive decision execution module S2 includes the current state machine state and execution command s213 based on the fast decision output and the current thinking process and execution command s223 based on the slow decision output. The massive knowledge stored in the long-term memory information M0 includes massive user portrait knowledge s31, massive machine portrait knowledge s32, and massive tool knowledge s33. The output of the knowledge processing module S3 is the context information m31 after knowledge processing, and its purpose is to splice the processed knowledge into the current context information for use by the downstream cognitive decision response module S4.
[0070] The specific process is to retrieve the corresponding massive knowledge (s31, s32, s33) according to the decision execution output result of the previous cognitive decision execution module S2 to complete the knowledge processing operation. It should be noted that the knowledge processing method is not limited to: vectorization of unstructured document knowledge and full-text retrieval of effective knowledge information; graph retrieval of effective knowledge information for structured graph and table knowledge; and retrieval of effective knowledge information by calling the API for external API knowledge.
[0071] S105: Perform synchronous control of fast decision response and slow decision response based on the decision execution output result and the short-term memory information M3, and monitor the decision status in real time to obtain cognitive decision response results, which include: fast decision response results and slow decision response results.
[0072] It should be noted that before executing the decision response module S4, the short-term memory information M3 is partially generated by the long-term memory information M0, namely the basic user portrait information m32, the basic machine portrait information m33, and the cognitive decision response configuration m34, and partially generated by the output of the upstream knowledge processing module S3, mainly the context information m31 after knowledge processing. Among them, the context information m31 after knowledge processing takes the output of the previous knowledge processing module S3, and integrates the processed knowledge information on the basis of the context information m21. The basic user portrait information m32 takes the basic information, emotional state, and security information in the basic user portrait information in the long-term memory information M0. The basic machine portrait information m33 takes the basic information and emotional stylized configuration in the basic machine portrait information in the long-term memory information M0. The cognitive decision response configuration m34 takes the fast decision response configuration and the slow decision response configuration in the cognitive decision response configuration in the long-term memory information M0.
[0073] In a specific embodiment, the synchronous control of fast decision response and slow decision response is performed based on the decision execution output result and the short-term memory information M3, and the decision status is monitored in real time to obtain the cognitive decision response result, including:
[0074] A decision method of mapping and selecting a rule reply template library is adopted to perform a fast decision reply on the decision execution output result and the short-term memory information M3 to obtain a fast decision reply result, wherein the fast decision reply result includes: the current finite state machine state and the reply content generated based on the mapped rule reply template;
[0075] Based on the big model thinking chain causal decision-making mechanism, and using the big model thinking chain technology to coordinate thinking and machine response, a slow decision response result is obtained, which includes: the current thinking process and response content;
[0076] When the quick decision reply result has a valid state and valid reply content, the post-processing operation is directly executed;
[0077] When the fast decision reply result does not have a valid state and valid reply content, wait until the slow decision reply process is completed before entering the post-processing operation.
[0078] In a specific embodiment, the cognitive decision response module S4 adopts synchronous control, and its synchronous control depends on the output of the cognitive decision execution module S2, and the data input comes from the short-term memory information M3 (working memory). The cognitive decision response module S4 consists of a fast decision response module S41 and a slow decision response module S42. Among them, the fast decision response module S41 is used in conjunction with the preceding fast decision execution module S21, and mainly adopts the decision method of mapping the selection rule response template library. Its output is the current finite state machine (FSM) state and the response content generated based on the mapped rule response template. The slow decision response module S42 is used in conjunction with the preceding slow decision execution module S22. It is also based on the large model thinking chain causal decision mechanism. Its principle is to make full use of the thinking chain (CoT) technology of the large model to coordinate thinking with machine response. Its output is the current thinking process and response content s223.
[0079] It should be noted that the specific decision-making process of the cognitive decision response module S4 is to synchronously execute the fast decision response module S41 and the slow decision response module S42 and monitor the decision status. If the fast decision result s415 has a valid status and valid response capacity, it will directly enter the next link post-processing module S5. If not, wait until the slow decision response process is completed before entering the next link.
[0080] S106: According to the cognitive decision response result, the short-term memory information M4 is post-processed through an asynchronous control method to obtain personalized emotional interaction data, and the personalized emotional interaction data includes: machine emotional information, machine safety information and machine output.
[0081] It should be noted that the short-term memory information M4 is generated by the output of the upstream cognitive decision response module S4 before the decision response module S4 is executed, which is mainly the context information m41 of the integrated response content. The short-term memory has three outputs: one is directly output to the S6 robot text output for machine response; one flows back to the long-term memory information M0 for storage, which includes the complete context information m01 (conversation record), basic user portrait information m02 (basic information, emotional state, safety information), basic machine portrait information m03 (basic information); one is input to the post-processing module S5.
[0082] In a specific embodiment, the short-term memory information M4 is post-processed by asynchronous control according to the cognitive decision response result to obtain personalized emotional interaction data, including:
[0083] Adopting an asynchronous control method, detecting the post-machine emotion according to the cognitive decision response result, and obtaining the machine response emotion information;
[0084] Performing a post-processing safety test based on the cognitive decision response result to obtain the machine safety response information;
[0085] A post-dialogue summary is performed on the cognitive decision response result to obtain the machine output.
[0086] In a specific embodiment, the post-processing module S5 adopts an asynchronous control method, and its control depends on the output of the cognitive decision response module S4, and its data input comes from the short-term memory information M4 (working memory). The post-processing module S5 consists of three parts: a post-machine emotion detection module S51, a post-safety detection module S52, and a post-dialogue summary module S53.
[0087] Among them, the post-machine emotion detection module S51 is technically consistent with the pre-user emotion detection module S11. The difference is that this module is mainly used for detecting the machine's response emotions and storing the machine's current emotional state. The post-safety detection module S52 is technically consistent with the pre-safety detection module S12. The difference is that this module is mainly used for detecting the safety of the machine's responses and monitoring the machine's safe response behavior. The post-dialogue summary module S53 summarizes recent dialogue records. This module mainly uses the summary capability of the large model.
[0088] It should be emphasized that the asynchronous output of the post-processing module S5 will flow back to the long-term memory information M0 for storage, which includes complete context information m04 (conversation records, conversation summaries), user portrait basic configuration m05 (basic information, emotional state, security information), and machine role basic configuration m06 (basic information, emotional state, security information).
[0089] In a specific embodiment, the large model selected by the slow decision module of S2 and S4 can be replaced at will, as long as the Agent architecture is adopted, it is applicable to the scope of patent protection. In addition, the fast decision execution configuration of S2 refers to the decision method based on the finite state machine (FSM), and the slow decision execution configuration refers to the causal decision method based on the large model thinking chain. It should be noted that all decision mechanisms that meet the fusion of these two fast and slow systems are applicable to the scope of patent protection.
[0090] In a specific embodiment, the emotion detection modules of S11 and S51 are not limited to the use of small models, rules, large model detection methods and external APIs, and can identify six emotions: like, anger, sadness, joy, complaint and disgust. It should be noted that as long as the Agent architecture is adopted, it is applicable within the scope of patent protection.
[0091] In a specific embodiment, the security detection modules of S12 and S52 are not limited to the use of small models, rules, large model detection methods and external APIs, and the recognition range is within eight categories of text security detection, including spam, advertisements, sensitive content, violence and terrorism, pornography, insults, spamming, and prohibited content. It should be noted that as long as the Agent architecture is adopted, it is applicable within the scope of patent protection.
[0092] In a specific embodiment, the semantic detection module S13 is not limited to the use of small models, rules, large model detection methods and external APIs, and the recognition scope is determined according to the actual business scenario. It should be noted that as long as the Agent architecture is adopted, it is applicable within the scope of patent protection.
[0093] In a specific embodiment, the knowledge processing module S3 is not limited to the form of knowledge organization. Unstructured knowledge, structured knowledge, and semi-structured knowledge all fall within the scope of knowledge processing. It should be noted that as long as the Agent architecture is adopted, it is applicable within the scope of patent protection.
[0094] In a specific embodiment, the massive tool knowledge in the long-term memory information M0 is not limited to local knowledge search tools, external API tools, numerical calculation tools, etc. Among them, local knowledge search tools include but are not limited to question and answer library search, document search, table search, knowledge graph search, event graph search, etc. External API tools include but are not limited to text map tools, weather check tools, web search tools, etc. It should be noted that as long as the Agent architecture is adopted, it is applicable to the scope of patent protection.
[0095] Through the description of the above embodiments of the present application, the advantages are:
[0096] 1) Drawing on the theory of the fast and slow dual-process of human brain thinking activities, a fast and slow dual cognitive decision-making module is proposed. As for slow decisions, the dual decision-making mode ensures that it will not fall into a decision-making dead loop like the existing agent mode, thus taking into account the advantages of fast response speed and stable reply content of the traditional dialogue system, and taking into account the flexibility and generalization performance of the large model agent dialogue system.
[0097] 2) Thanks to the long-term and short-term memory capabilities of the dialogue system, the dual portrait information of the user and the machine is integrated in a standardized manner. The portrait contains security-related information of the user and the machine. At the same time, a security detection module is introduced in the pre- and post-processing. Therefore, there is a qualitative improvement in terms of secure dialogue compared to traditional dialogue systems and existing agent dialogue systems.
[0098] 3) Thanks to the long-term and short-term memory capabilities of the dialogue system, a large amount of tool knowledge, complete user portrait knowledge, and complete machine portrait knowledge are standardized and integrated, and the knowledge processing module is cleverly introduced after the cognitive decision-making execution module. More importantly, both cognitive decisions adopt a causal decision-making mechanism with a thinking chain, so the credibility has also been qualitatively improved compared to the existing Agent dialogue system.
[0099] 4) Thanks to the long-term and short-term memory capabilities of the dialogue system, the user and machine dual portrait information is standardized and integrated. The portrait not only contains the emotional state information of the user and the machine and the emotional stylized configuration of the machine, but also introduces an emotion detection module in both pre- and post-processing. Therefore, compared with traditional dialogue systems and existing agent dialogue systems, there has been a qualitative improvement in personalized emotional interaction.
[0100] Corresponding to the aforementioned application function implementation method embodiment, the present application also provides a personalized emotional interaction system, an electronic device and corresponding embodiments.
[0101] Figure 2 is a structural diagram of a personalized emotional interaction system shown in an embodiment of the present application. Figure 2 , the embodiment of the present application provides a personalized emotional interaction system, the device specifically includes:
[0102] The pre-processing module S1 is used to receive the long-term memory information M0, the text information input by the user and the current short-term memory information M1; and detect the text information input by the user and the current short-term memory information M1 to determine the detection information, wherein the detection information includes: user emotion information, user safety information and user semantic information expressed by the user input text;
[0103] The cognitive decision execution module S2 is used to synchronously control the fast decision execution and the slow decision execution according to the short-term memory information M2 generated by the long-term memory information M0 and the detection information, and to monitor the decision status in real time to obtain the decision execution output result, wherein the decision execution output result includes the fast decision result and the slow decision result;
[0104] The knowledge processing module S3 is used to retrieve the long-term memory information M0 according to the decision execution output result to perform knowledge processing operations and determine the knowledge processing output, wherein the knowledge processing output includes: context information after knowledge processing, basic user profile information, basic machine profile information and cognitive decision response configuration;
[0105] The cognitive decision response module S4 is used to synchronously control the fast decision response and the slow decision response according to the decision execution output result and the short-term memory information M3, and monitor the decision status in real time to obtain the cognitive decision response result, which includes: the fast decision response result and the slow decision response result;
[0106] The post-processing module S5 is used to post-process the short-term memory information M4 through asynchronous control according to the cognitive decision response result to obtain personalized emotional interaction data, and the personalized emotional interaction data includes: machine emotional information, machine safety information and machine output.
[0107] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated again here.
[0108] Figure 3 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application.
[0109] See also Figure 3 , the electronic device 300 includes a memory 310 and a processor 320.
[0110] The processor 320 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0111] The memory 310 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, ROM can store static data or instructions required by the processor 320 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In some other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at runtime. In addition, the memory 310 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 310 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (such as a DVD-ROM, a double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (such as an SD card, a mini SD card, a Micro-SD card, etc.), a magnetic floppy disk, etc. The computer-readable storage medium does not contain carrier waves and transient electronic signals transmitted wirelessly or wired.
[0112] The memory 310 stores executable codes, and when the executable codes are processed by the processor 320 , the processor 320 can execute part or all of the methods described above.
[0113] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0114] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing the following method steps:
[0115] Receive long-term memory information M0, text information input by the user and current short-term memory information M1;
[0116] Detecting the text information input by the user and the current short-term memory information M1 to determine detection information, wherein the detection information includes: user emotion information, user safety information, and user semantic information expressed by the text input by the user;
[0117] Synchronously controlling the fast decision execution and the slow decision execution according to the short-term memory information M2 generated by the long-term memory information M0 and the detection information, and monitoring the decision status in real time to obtain the decision execution output result, wherein the decision execution output result includes the fast decision result and the slow decision result;
[0118] According to the decision execution output result, the long-term memory information M0 is retrieved to perform knowledge processing operation, and the knowledge processing output is determined, wherein the knowledge processing output includes: context information after knowledge processing, basic user profile information, basic machine profile information, and cognitive decision response configuration;
[0119] According to the decision execution output result and the short-term memory information M3, the fast decision response and the slow decision response are synchronously controlled, and the decision status is monitored in real time to obtain the cognitive decision response result, which includes: a fast decision response result and a slow decision response result;
[0120] According to the cognitive decision response result, the short-term memory information M4 is post-processed through an asynchronous control method to obtain personalized emotional interaction data, which includes: machine emotional information, machine safety information and machine output.
[0121] The detecting of the text information input by the user and the current short-term memory information M1 to determine the detection information includes:
[0122] Identify the text information input by the user and the current short-term memory information M1 through the emotion multi-classification model to determine the user emotion information;
[0123] Based on the preset sensitive detection keyword library and combined with the professional external text content security review API, security detection is performed to determine user security information;
[0124] The text information input by the user and the semantics in the current short-term memory information M1 are identified through the intention classification model and the entity recognition model to determine the user semantic information expressed by the user input text.
[0125] The short-term memory information M2 generated based on the long-term memory information M0 and the detection information perform synchronous control of fast decision execution and slow decision execution, and monitor the decision status in real time to obtain the decision execution output result, including:
[0126] Based on the fast decision mechanism of the finite state machine, a fast decision execution is performed on the short-term memory information M2 generated by the long-term memory information M0 and the detection information to obtain a fast decision execution result, wherein the fast decision execution result includes: the current finite state machine state and the execution action command;
[0127] Based on the large model thinking chain causal decision-making mechanism, a slow decision execution is performed on the short-term memory information M2 generated by the long-term memory information M0 and the detection information to obtain a slow decision execution result, which includes: the current thinking process and the execution action command;
[0128] When the quick decision execution result has a valid state and an execution action instruction, the knowledge processing operation is directly executed;
[0129] When the fast decision execution result does not have a valid state and an execution action instruction, the knowledge processing operation is entered after the slow decision execution process is completed.
[0130] Among them, the synchronous control of fast decision response and slow decision response is performed based on the decision execution output result and the short-term memory information M3, and the decision status is monitored in real time to obtain the cognitive decision response result, including:
[0131] A decision method of mapping and selecting a rule reply template library is adopted to perform a fast decision reply on the decision execution output result and the short-term memory information M3 to obtain a fast decision reply result, wherein the fast decision reply result includes: the current finite state machine state and the reply content generated based on the mapped rule reply template;
[0132] Based on the big model thinking chain causal decision-making mechanism, and using the big model thinking chain technology to coordinate thinking and machine response, a slow decision response result is obtained, which includes: the current thinking process and response content;
[0133] When the quick decision reply result has a valid state and valid reply content, the post-processing operation is directly executed;
[0134] When the fast decision reply result does not have a valid state and valid reply content, wait until the slow decision reply process is completed before entering the post-processing operation.
[0135] Wherein, the M4 short-term memory information is post-processed by asynchronous control according to the cognitive decision response result to obtain personalized emotional interaction data, including:
[0136] Adopting an asynchronous control method, detecting the post-machine emotion according to the cognitive decision response result, and obtaining the machine response emotion information;
[0137] Performing a post-processing safety test based on the cognitive decision response result to obtain the machine safety response information;
[0138] A post-dialogue summary is performed on the cognitive decision response result to obtain the machine output.
[0139] Among them, the method of knowledge processing operation includes but is not limited to: vectorizing unstructured document knowledge and full-text retrieval of effective knowledge information; performing graph retrieval of effective knowledge information for structured graph and table knowledge; and retrieving effective knowledge information by calling the API for external API knowledge.
[0140] Among them, the emotion multi-classification model, the intention classification model and the entity recognition model include but are not limited to BERT small model classification or a classification method based on a large model fewshot mode.
[0141] The scheme of the present application has been described in detail above with reference to the accompanying drawings. In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. Those skilled in the art should also be aware that the actions and modules involved in the description are not necessarily required for the present application. In addition, it can be understood that the steps in the method of the embodiment of the present application can be adjusted in order, merged and deleted according to actual needs, and the modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0142] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.
[0143] Alternatively, the present application can also be implemented as a non-temporary machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) on which executable code (or computer program, or computer instruction code) is stored. When the executable code (or computer program, or computer instruction code) is executed by a processor of an electronic device (or electronic device, server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.
[0144] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the application herein may be implemented as electronic hardware, computer software, or combinations of both.
[0145] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system and method according to multiple embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a part of a module, a program segment or a code, and the part of the module, the program segment or the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or the flow chart, and the combination of the square boxes in the block diagram and / or the flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0146] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0147] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0148] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A personalized emotional interaction method, characterized in that: include: Receive long-term memory information M0, text information input by the user and current short-term memory information M1; Detecting the text information input by the user and the current short-term memory information M1 to determine detection information, wherein the detection information includes: user emotion information, user safety information, and user semantic information expressed by the text input by the user; Synchronously controlling the fast decision execution and the slow decision execution according to the short-term memory information M2 generated by the long-term memory information M0 and the detection information, and monitoring the decision status in real time to obtain the decision execution output result, wherein the decision execution output result includes the fast decision result and the slow decision result; According to the decision execution output result, the long-term memory information M0 is retrieved to perform knowledge processing operation, and the knowledge processing output is determined, wherein the knowledge processing output includes: context information after knowledge processing, basic user profile information, basic machine profile information, and cognitive decision response configuration; According to the decision execution output result and the short-term memory information M3, the fast decision response and the slow decision response are synchronously controlled, and the decision status is monitored in real time to obtain the cognitive decision response result, which includes: a fast decision response result and a slow decision response result; According to the cognitive decision response result, the short-term memory information M4 is post-processed by asynchronous control to obtain personalized emotional interaction data, wherein the personalized emotional interaction data includes: machine emotional information, machine safety information and machine output; Among them, the synchronous control of fast decision response and slow decision response is performed based on the decision execution output result and the short-term memory information M3, and the decision status is monitored in real time to obtain the cognitive decision response result, including: A decision method of mapping and selecting a rule reply template library is adopted to perform a fast decision reply on the decision execution output result and the short-term memory information M3 to obtain a fast decision reply result, wherein the fast decision reply result includes: the current finite state machine state and the reply content generated based on the mapped rule reply template; Based on the big model thinking chain causal decision-making mechanism, and using the big model thinking chain technology to coordinate thinking and machine response, a slow decision response result is obtained, which includes: the current thinking process and response content; When the quick decision reply result has a valid state and valid reply content, the post-processing operation is directly executed; When the fast decision reply result does not have a valid state and valid reply content, wait until the slow decision reply process is completed before entering the post-processing operation.
2. The method according to claim 1, characterized in that: The detecting of the text information input by the user and the current short-term memory information M1 to determine the detection information includes: Identify the text information input by the user and the current short-term memory information M1 through the emotion multi-classification model to determine the user emotion information; Based on the preset sensitive detection keyword library and combined with the professional external text content security review API, security detection is performed to determine user security information; The text information input by the user and the semantics in the current short-term memory information M1 are identified through the intention classification model and the entity recognition model to determine the user semantic information expressed by the user input text.
3. The method according to claim 1, characterized in that The short-term memory information M2 generated based on the long-term memory information M0 and the detection information perform synchronous control of fast decision execution and slow decision execution, and monitor the decision status in real time to obtain the decision execution output result, including: Based on the fast decision mechanism of the finite state machine, a fast decision execution is performed on the short-term memory information M2 generated by the long-term memory information M0 and the detection information to obtain a fast decision execution result, wherein the fast decision execution result includes: the current finite state machine state and the execution action command; Based on the large model thinking chain causal decision-making mechanism, a slow decision execution is performed on the short-term memory information M2 generated by the long-term memory information M0 and the detection information to obtain a slow decision execution result, which includes: the current thinking process and the execution action command; When the quick decision execution result has a valid state and an execution action instruction, the knowledge processing operation is directly executed; When the fast decision execution result does not have a valid state and an execution action instruction, the knowledge processing operation is entered after the slow decision execution process is completed.
4. The method according to claim 1, characterized in that: The short-term memory information M4 is post-processed in an asynchronous control manner according to the cognitive decision response result to obtain personalized emotional interaction data, including: Adopting an asynchronous control method, detecting the post-machine emotion according to the cognitive decision response result, and obtaining the machine emotion information; Performing post-safety detection according to the cognitive decision response result to obtain the machine safety information; A post-dialogue summary is performed on the cognitive decision response result to obtain the machine output.
5. The method according to claim 1, characterized in that The method of the knowledge processing operation includes but is not limited to: vectorizing unstructured document knowledge and performing full-text retrieval of effective knowledge information; performing graph retrieval of effective knowledge information for structured graph and table knowledge; and retrieving effective knowledge information by calling the API for external API knowledge.
6. The method according to claim 2, characterized in that The emotion multi-classification model, the intent classification model and the entity recognition model include but are not limited to BERT small model classification or a classification method based on a large model fewshot mode.
7. A personalized emotional interaction system, characterized in that: include: A pre-processing module, used for receiving long-term memory information M0, text information input by the user and current short-term memory information M1; and detecting the text information input by the user and the current short-term memory information M1 to determine detection information, wherein the detection information includes: user emotion information, user safety information and user semantic information expressed by the text input by the user; A cognitive decision execution module, used for synchronously controlling fast decision execution and slow decision execution according to the short-term memory information M2 generated by the long-term memory information M0 and the detection information, and monitoring the decision status in real time to obtain a decision execution output result, wherein the decision execution output result includes a fast decision result and a slow decision result; A knowledge processing module, used to retrieve the long-term memory information M0 according to the decision execution output result to perform knowledge processing operations and determine the knowledge processing output, wherein the knowledge processing output includes: context information after knowledge processing, basic user profile information, basic machine profile information and cognitive decision response configuration; A cognitive decision response module is used to synchronously control the fast decision response and the slow decision response according to the decision execution output result and the short-term memory information M3, and monitor the decision status in real time to obtain the cognitive decision response result, which includes: a fast decision response result and a slow decision response result; A post-processing module, used to post-process the short-term memory information M4 through an asynchronous control method according to the cognitive decision response result to obtain personalized emotional interaction data, wherein the personalized emotional interaction data includes: machine emotional information, machine safety information and machine output; Wherein, the cognitive decision execution module is specifically used for: The synchronous control of fast decision response and slow decision response is performed based on the decision execution output result and the short-term memory information M3, and the decision status is monitored in real time to obtain the cognitive decision response result, including: A decision method of mapping and selecting a rule reply template library is adopted to perform a fast decision reply on the decision execution output result and the short-term memory information M3 to obtain a fast decision reply result, wherein the fast decision reply result includes: the current finite state machine state and the reply content generated based on the mapped rule reply template; Based on the big model thinking chain causal decision-making mechanism, and using the big model thinking chain technology to coordinate thinking and machine response, a slow decision response result is obtained, which includes: the current thinking process and response content; When the quick decision reply result has a valid state and valid reply content, the post-processing operation is directly executed; When the fast decision reply result does not have a valid state and valid reply content, wait until the slow decision reply process is completed before entering the post-processing operation.
8. An electronic device, characterized in that: include: processor; and a memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the personalized emotional interaction method as described in any one of claims 1-6.
9. A non-transitory machine-readable storage medium, characterized in that: An executable code is stored thereon, and when the executable code is executed by a processor of an electronic device, the processor is caused to execute the personalized emotional interaction method as described in any one of claims 1-6.
Citation Information
Patent Citations
System and method of active chat robot with composite finite-state machine
CN116775834A
Intelligent agent thinking device, method and equipment based on language model tree
CN117556046A
Emotion-guided dialogue content generation method based on crowd intelligence strategy
CN117668208A
Conversation method and system based on adaptive learning and context awareness AI proxy
CN117786079A
Emotion support man-machine conversation method and system for mixing cognitive and reply strategies
CN118132725A
