Intelligent question and answer method and system

By performing emotion recognition on user input questions and adjusting the tone and wording of prompt sentences, the problem that existing intelligent question and answer methods cannot identify users' emotional tendencies is solved, achieving emotional matching of answer content and improving user experience.

CN119336878APending Publication Date: 2025-01-21SHANDONG INSPUR SCI RES INST CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411158516.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing intelligent question-and-answer methods cannot effectively identify the emotional tendency of users to enter questions, resulting in the answer content being unable to meet the emotional needs of users and reduce the user experience.

Method used

By conducting emotion recognition on the current question content input by the user, the emotion type and emotion intensity are obtained. Based on this information, the tone and wording of the prompt sentence are adjusted to generate answer content that is more in line with the user's emotional tendency, and the answer content is optimized through the reward function until convergence.

Benefits of technology

Emotional matching of answer content is achieved, which can better meet users' emotional needs and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336878A_ABST
    Figure CN119336878A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent questioning and answering, and provides an intelligent questioning and answering method and system. The method comprises the steps of performing emotion recognition on current question content to obtain an emotion type and emotion intensity; adjusting the current prompt sentence based on the emotion type and the emotion intensity to obtain a target prompt sentence; generating current answer content based on the target prompt sentence and the current question content; and generating a reward value of the current answer content based on the reward function, and if the reward value is not converged, returning to the step of adjusting the mood prompt and the word prompt in the current prompt sentence based on the emotion type and the emotion intensity to obtain the target prompt sentence until the reward value is converged, and determining the current answer content at the moment as the target answer content. The emotion tendency of the user question can be effectively identified, and the answer content is generated and adjusted based on the emotion tendency of the user, so that the target answer content meets the emotion demand of the user to the greatest extent while accurately answering the user question, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent question answering technology, and specifically to an intelligent question answering method and system. Background Art

[0002] Intelligent question answering is one of the core sub-fields in the field of natural language processing. It is mainly used to parse, understand and answer natural language questions raised by users. It provides accurate answers to user questions through key technologies such as semantic understanding, knowledge base and database access, context awareness, dynamic learning and adaptation. It is widely used in online customer service, educational assistance, smart home, medical health and other fields.

[0003] Existing intelligent question-answering methods usually include three main steps: question analysis, information retrieval, and answer generation. First, the user's question is preprocessed and the intention is identified, then relevant information is retrieved based on the analysis results, and finally the answer is generated based on the comprehensive retrieval results.

[0004] However, most of the existing intelligent question-answering methods are unable to effectively identify the emotional tendencies of user input questions, and thus are unable to generate and adjust the answer content based on the user's emotional tendencies, making the answer content relatively stiff and unable to meet the user's emotional needs, thereby reducing the user experience. Summary of the invention

[0005] The embodiments of the present application provide an intelligent question-answering method and system to solve the technical problem that most existing intelligent question-answering methods are unable to effectively identify the emotional tendencies of user input questions, and thus are unable to generate and adjust answer content based on the user's emotional tendencies, making the answer content relatively stiff and unable to meet the user's emotional needs, thereby reducing the user experience.

[0006] In a first aspect, an embodiment of the present application provides an intelligent question-answering method, comprising: Perform emotion recognition on the current question content input by the user to obtain the emotion type and emotion intensity; Adjust the tone prompt and wording prompt in the current prompt sentence based on the emotion type and the emotion intensity to obtain a target prompt sentence; Generate current answer content based on the target prompt sentence and the current question content; A reward value for the current answer content is generated based on the reward function. If the reward value does not converge, the step of adjusting the tone prompts and wording prompts in the current prompt sentence based on the emotion type and the emotion intensity to obtain the target prompt sentence is returned until the reward value converges, and the current answer content at this time is determined as the target answer content.

[0007] In one embodiment, the reward function is generated based on the emotional fitness of the answer content, the user's immediate feedback on the answer content, and the user's historical feedback on similar answer contents.

[0008] In one embodiment, generating a reward value for the current answer content based on a reward function includes: The emotional fitness of the current answer content, the user's immediate feedback on the current answer content, and the user's historical feedback on similar current answer content are input into the reward function to obtain the reward value.

[0009] In one embodiment, the emotional fitness is determined based on the following method: Calculating the similarity between the emotion type of the current question content and the emotion type of the current answer content to obtain a first fitness; Calculating the similarity between the sentiment intensity of the current question content and the sentiment intensity of the current answer content to obtain a second fitness; Calculating the similarity between the tone of the current question content and the tone of the current answer content to obtain a third fitness; The emotional fitness is obtained based on the first fitness, the second fitness and the third fitness.

[0010] In one embodiment, the instant feedback includes current explicit feedback and current implicit feedback, and the historical feedback includes historical explicit feedback and historical implicit feedback; The current explicit feedback includes whether the user likes, comments, rates, and rates the current answer; The current implicit feedback includes whether the user continues to interact with the current answer content, and when the user stops interacting with the current answer content, whether the problem solving rate of the interaction process is scored and the score; The historical explicit feedback includes whether the user liked, commented on, rated, and rated similar content to the current answer in the historical period; The historical invisible feedback includes whether the user continues to interact with content similar to the current answer in the historical period, and when the user stops interacting with content similar to the current answer, whether the problem solving rate of the interaction process is scored and the scoring score.

[0011] In one embodiment, the step of performing emotion recognition on the current question content input by the user to obtain the emotion type and emotion intensity includes: Segmenting and encoding the current question content to obtain a target text in a target input format; Inputting the target text into a sentiment recognition model to obtain the sentiment type and the sentiment intensity; The target input format is an input format acceptable to the emotion recognition model. The emotion recognition model is obtained by training historical target texts and their emotion labels based on any classification model. The emotion labels include emotion type labels and emotion intensity labels.

[0012] In a second aspect, an embodiment of the present application provides an intelligent question-answering system, including: The emotion recognition module is used to: perform emotion recognition on the current question content input by the user to obtain the emotion type and emotion intensity; An emotional prompt adjustment module, used to: adjust the tone prompt and wording prompt in the current prompt sentence based on the emotional type and the emotional intensity to obtain a target prompt sentence; An answer content generating module, used to: generate current answer content based on the target prompt sentence and the current question content; The emotional reinforcement learning module is used to: generate a reward value for the current answer content based on a reward function; if the reward value does not converge, return to the step of adjusting the tone prompts and wording prompts in the current prompt sentence based on the emotional type and the emotional intensity to obtain a target prompt sentence, until the reward value converges, and determine the current answer content at this time as the target answer content.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory storing a computer program, wherein the processor implements the steps of the intelligent question-answering method described in the first aspect when executing the program.

[0014] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the intelligent question-answering method described in the first aspect.

[0015] In a fifth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium, including a computer program, which, when executed by a processor, implements the steps of the intelligent question-answering method described in the first aspect.

[0016] The intelligent question-answering method and system provided by the present application perform emotion recognition on the current question content input by the user, obtain the emotion type and emotion intensity, adjust the tone prompt and wording prompt in the current prompt sentence based on the emotion type and emotion intensity, obtain the target prompt sentence, generate the current answer content based on the target prompt sentence and the current question content, generate the reward value of the current answer content based on the reward function, and if the reward value does not converge, return to the step of adjusting the tone prompt and wording prompt in the current prompt sentence based on the emotion type and emotion intensity to obtain the target prompt sentence, until the reward value converges, and the current answer content at this time is determined as the target answer content. On the one hand, since the emotion type and emotion intensity of the user can be effectively identified when generating the answer content, the answer content can better meet the emotional needs of the user. On the other hand, since after the answer content is generated, the tone prompt and wording prompt in the prompt sentence will be readjusted based on the reward value of the answer content to match the emotion type and emotion intensity, so as to optimize the answer content until the target answer content is obtained when the reward value converges, so that the target answer content can meet the emotional tendency of the user to the greatest extent, thereby better meeting the emotional needs of the user. To sum up, the present application can effectively identify the emotional tendencies of user questions, and generate and adjust the answer content based on the user's emotional tendencies, so that the target answer content can accurately answer the user's questions while maximally satisfying the user's emotional needs and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 This is one of the flow charts of the intelligent question-answering method provided in the embodiment of the present application; Figure 2 This is the second flow chart of the intelligent question-answering method provided in the embodiment of the present application; Figure 3 is an internal flow chart of the intelligent question-answering system provided in an embodiment of the present application; Figure 4 This is an internal flow chart of the emotion reinforcement learning module in the intelligent question-answering system provided in the embodiment of the present application; Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0020] It should be noted that in the description of the embodiments of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The orientation or position relationship indicated by the terms "upper", "lower" and the like is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. Unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those skilled in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0021] The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0022] Figure 1 This is one of the flow charts of the intelligent question-answering method provided in the embodiment of the present application. Figure 1 , the embodiment of the present application provides an intelligent question-answering method, which may include: 101. Perform emotion recognition on the current question content input by the user to obtain the emotion type and emotion intensity; 102. Adjust the tone prompt and wording prompt in the current prompt sentence based on the emotion type and emotion intensity to obtain a target prompt sentence; 103. Generate current answer content based on the target prompt sentence and current question content; 104. Generate a reward value for the current answer content based on the reward function; 105. If the reward value does not converge, return to step 102; 106. If the reward value converges, the current answer content at this time is determined as the target answer content.

[0023] In step 101, the emotion type may include happiness, sadness, anger, surprise, disgust, fear, neutral, etc., and the emotion intensity may include mild, moderate, strong, extreme, etc. The combination of emotion type and emotion intensity may form a variety of emotional tendencies. For example, mild is combined with happiness to form mild happiness, moderate is combined with sadness to form moderate sadness, strong is combined with anger to form strong anger, extreme is combined with disgust to form extreme disgust, etc.

[0024] In step 102, the tone prompt and wording prompt in the current prompt sentence are adjusted based on the emotion type and emotion intensity, so that the target prompt sentence can effectively guide the generation of the answer content with the corresponding emotion tendency, so that the answer content is more adapted to the user's emotion tendency.

[0025] Among them, the target prompt sentence can be obtained through the emotion-language mapping mechanism, which can provide clear rules and examples to ensure the coherence and consistency of emotion adjustment, rather than relying solely on the adaptive ability of the large language model. Through one-to-one mapping, one emotion tendency corresponds to one adjustment strategy to generate a target prompt sentence, for example: 1. Current question content: Today is a really beautiful day. What should I wear to go out today? User emotional tendency: moderately happy; Target prompt: Please answer user questions with a moderately happy tone and moderately happy wording.

[0026] 2. Current question content: I broke up with my boyfriend today. Can you write me some copywriting suitable for posting on WeChat Moments? User emotional tendency: extreme sadness; Target prompt sentence: Please answer user questions with an extremely sad tone and extremely sad wording.

[0027] In step 103, the Transformer architecture of the large language model can be used to capture the contextual information of the target prompt sentence and the current question content through a multi-layer attention mechanism, so as to generate accurate current answer content based on considering longer contextual relationships.

[0028] In step 104 to step 106, the emotional response strategy can be continuously optimized using reinforcement learning methods, that is, the tone prompts and wording prompts in the current prompt sentence are adjusted based on the emotion type and emotion intensity to obtain a new target prompt sentence, and new answer content is generated based on this, so that the reward value for the new answer content reaches the highest, thereby obtaining the target answer content that best meets the user's emotional needs.

[0029] In practical applications, there is no strict timing relationship between step 105 and step 106; that is, they can be executed simultaneously, or any one of the steps can be executed first, depending on actual needs and is not limited here.

[0030] The intelligent question-answering method provided in this embodiment performs emotion recognition on the current question content input by the user to obtain the emotion type and emotion intensity, adjusts the tone prompt and wording prompt in the current prompt sentence based on the emotion type and emotion intensity to obtain the target prompt sentence, generates the current answer content based on the target prompt sentence and the current question content, generates the reward value of the current answer content based on the reward function, and if the reward value does not converge, returns to the step of adjusting the tone prompt and wording prompt in the current prompt sentence based on the emotion type and emotion intensity to obtain the target prompt sentence, until the reward value converges, and determines the current answer content at this time as the target answer content. On the one hand, since the emotion type and emotion intensity of the user can be effectively identified when generating the answer content, the answer content can better meet the emotional needs of the user. On the other hand, since after the answer content is generated, the tone prompt and wording prompt in the prompt sentence will be readjusted to match the emotion type and emotion intensity based on the reward value of the answer content, so as to optimize the answer content until the target answer content is obtained when the reward value converges, so that the target answer content can meet the emotional tendency of the user to the greatest extent, thereby better meeting the emotional needs of the user. In summary, this embodiment can effectively identify the emotional tendencies of user questions, and generate and adjust answer content based on the user's emotional tendencies, so that the target answer content can accurately answer the user's questions while maximally satisfying the user's emotional needs and improving the user experience.

[0031] In one embodiment, the reward function is generated based on the emotional fitness of the answer content, the user's immediate feedback on the answer content, and the user's historical feedback on similar answer content. Generating a reward value for the current answer content based on the reward function may include: The emotional fitness of the current answer content, the user's immediate feedback on the current answer content, and the user's historical feedback on similar current answer content are input into the reward function to obtain the reward value.

[0032] For example, if the current question input by the user is "I am very sad today, what should I do?", the intelligent question-answering process is as follows: 1. Emotion recognition: The user's emotional tendency is "moderate sadness"; 2. Emotional prompt adjustment: Based on the emotion-language mapping mechanism, generate the target prompt sentence "Please answer the user's question with a moderately sad tone and moderately sad comforting words"; 3. Answer content generation: Generate the current answer content based on the target prompt sentence: "I'm sorry to hear this, I hope you get better soon"; 4. Emotional reinforcement learning: Collect emotional fitness, user's immediate feedback and historical feedback to calculate the reward value of the reward function, return the updated prompt sentence adjustment strategy to generate the target answer content.

[0033] In the process of optimizing the emotional response strategy, this embodiment continuously collects emotional fitness, users' immediate feedback and users' historical feedback, calculates the reward value of the reward function, and when the reward value has not reached the maximum value, based on the balance between trial and exploitation, continuously tries new prompt sentence adjustment strategies to generate new answer content, and finally obtains the answer content corresponding to the maximum reward value, that is, the target answer content. By continuously interacting with users to improve the emotional processing ability, the embodiment provides users with personalized emotional responses that meet their emotional needs, thereby improving user experience, user stickiness and user satisfaction.

[0034] Figure 2 This is the second flow chart of the intelligent question-answering method provided in the embodiment of the present application. Figure 2 In one embodiment, the emotional fitness can be determined based on: 201. Calculate the similarity between the emotion type of the current question content and the emotion type of the current answer content to obtain a first fitness; 202. Calculate the similarity between the sentiment intensity of the current question content and the sentiment intensity of the current answer content to obtain a second fitness; 203. Calculate the similarity between the tone of the current question content and the tone of the current answer content to obtain a third fitness; 204. Obtain emotional fitness based on the first fitness, the second fitness, and the third fitness.

[0035] In step 201 to step 202, the emotion type and emotion intensity of the current answer content can also be obtained by emotion recognition in the same way as the current question content.

[0036] In step 204, different weights may be set for the first fitness, the second fitness, and the third fitness according to different requirements, and then the three are weightedly summed to obtain the emotional fitness, or the emotional fitness may be obtained by other methods, which are not limited here.

[0037] In practical applications, there is no strict timing relationship between step 201, step 202 and step 203; that is, they can be executed simultaneously, or any one step can be executed first, depending on actual needs and is not limited here.

[0038] In this embodiment, since the emotion type, emotion intensity and tone of the current answer content are generated based on the emotion type, emotion intensity and corresponding adjusted tone prompts of the current question content, the emotion fitness can be calculated based on the similarity between the current answer content and the corresponding part of the current question content to measure whether the effect of the prompt sentence adjustment is conducive to increasing the reward value, so as to optimize the adjustment strategy and generate the target answer content that meets the user's emotional needs more quickly.

[0039] In one embodiment, the immediate feedback includes current explicit feedback and current implicit feedback, and the historical feedback includes historical explicit feedback and historical implicit feedback; The current explicit feedback includes whether the user likes, comments, rates, and rates the current answer; The current implicit feedback includes whether the user continues to interact with the current answer content, and when the user stops interacting with the current answer content, whether the problem solving rate of the interaction process is rated and the rating score; Historical explicit feedback includes whether the user liked, commented, rated, and rated similar content to the current answer in the historical period; Historical invisible feedback includes whether the user continues to interact with content similar to the current answer in the historical period, and when the user stops interacting with content similar to the current answer, whether the problem-solving rate of the interaction process is scored and the scoring score.

[0040] In this embodiment, instant feedback can measure the user's current comprehensive evaluation of the current answer content, and historical feedback can measure the user's historical comprehensive evaluation of previous answer contents similar to the current one. Since the evaluation behavior of the same user usually has the same behavioral paradigm, using the user's current comprehensive evaluation and historical comprehensive evaluation as variables in the reward function can make the two correct each other. While expanding the reward function variables to cover more comprehensive influencing factors, the consistency of the user's previous and subsequent behaviors is also taken into consideration, so that the generated reward value can better represent the user's evaluation tendency, which helps to iterate the reward function as soon as possible to generate target answer content that meets the user's emotional needs.

[0041] In one embodiment, emotion recognition is performed on the current question content input by the user to obtain the emotion type and emotion intensity, which may include: The current question content is segmented and encoded to obtain the target text in the target input format, and the target text is input into the emotion recognition model to obtain the emotion type and emotion intensity.

[0042] The target input format is an input format acceptable to the emotion recognition model. The emotion recognition model is obtained by training the historical target text and its emotion labels based on any classification model. The emotion labels include emotion type labels and emotion intensity labels.

[0043] The classification model can be selected according to actual conditions and is not limited here. In this embodiment, the classification model can be a BERT (Bidirectional Encoder Representations from Transformers) model, which can capture rich contextual information in the text through bidirectional encoder representation to ensure the accuracy of emotion recognition.

[0044] After the target text is input into the emotion recognition model, the emotion vector representation is first obtained, and then the emotion vector is mapped to the corresponding emotion type label and emotion intensity label through the classifier in the model to obtain the emotion type and emotion intensity.

[0045] This embodiment uses the BERT model for high-precision emotion recognition, which can more accurately capture subtle changes in the user's emotions and further improve the accuracy and sophistication of emotion recognition based on the adaptive capabilities of the large language model.

[0046] The intelligent question and answer system provided in an embodiment of the present application is described below. The intelligent question and answer system described below and the intelligent question and answer method described above can be referenced to each other.

[0047] Figure 3 is an internal flow chart of the intelligent question-answering system provided in an embodiment of the present application; Figure 4 It is an internal flow chart of the emotion reinforcement learning module in the intelligent question-answering system provided in the embodiment of the present application.

[0048] Reference Figure 3 , the embodiment of the present application provides an intelligent question-answering system, which may include: The emotion recognition module is used to: perform emotion recognition on the current question content input by the user to obtain the emotion type and emotion intensity; An emotional prompt adjustment module, used to: adjust the tone prompt and wording prompt in the current prompt sentence based on the emotional type and the emotional intensity to obtain a target prompt sentence; An answer content generating module, used to: generate current answer content based on the target prompt sentence and the current question content; The emotional reinforcement learning module is used to: generate a reward value for the current answer content based on a reward function; if the reward value does not converge, return to the step of adjusting the tone prompts and wording prompts in the current prompt sentence based on the emotional type and the emotional intensity to obtain a target prompt sentence, until the reward value converges, and determine the current answer content at this time as the target answer content.

[0049] Reference Figure 4 ,The emotional reinforcement learning module continuously collects emotional fitness, user’s immediate feedback and user’s historical feedback, calculates the reward value of the reward function, and returns to the emotional prompt adjustment module based on the reward value, and readjusts the tone prompts and wording prompts in the prompt sentence to generate new answer content, until the reward value converges and the target answer content is obtained.

[0050] Reference Figure 3 , the intelligent question-answering process based on this system can be as follows: 1. The user interaction module receives the current question content input by the user: "It's too sunny today. I'm tanned. Please help me write a message for my Moments. I want to complain about this terrible weather." 2. The emotion recognition module uses the BERT model to identify the emotion of the current question content and obtains the emotion type "anger" and the emotion intensity "strong"; 3. The emotional prompt adjustment module adjusts the target prompt sentence "Please answer the user's question with a strong angry tone and strong angry wording" according to the emotion-language mapping mechanism; 4. The answer content generation module generates the current answer content according to the target prompt sentence: "It's so hot today! In this horrible weather, is the sun going to bake people directly? I went out for a minute and it got ten degrees darker. Even the sunscreen couldn't withstand it! This is such a speechless summer. Please give me a rainy day soon." 5. The user interaction module returns the current answer content to the user; 6. The emotional reinforcement learning module collects emotional fitness, user's immediate feedback and user's historical feedback, calculates the reward value based on the collected data, and returns it to the emotional prompt adjustment module to continuously optimize the emotional impact of the prompt sentence until the reward value converges and obtains the target answer content.

[0051] The intelligent question-answering system provided in this embodiment performs emotion recognition on the current question content input by the user to obtain the emotion type and emotion intensity, adjusts the tone prompt and wording prompt in the current prompt sentence based on the emotion type and emotion intensity to obtain the target prompt sentence, generates the current answer content based on the target prompt sentence and the current question content, generates the reward value of the current answer content based on the reward function, and if the reward value does not converge, returns to the step of adjusting the tone prompt and wording prompt in the current prompt sentence based on the emotion type and emotion intensity to obtain the target prompt sentence, until the reward value converges, and determines the current answer content at this time as the target answer content. On the one hand, since the emotion type and emotion intensity of the user can be effectively identified when generating the answer content, the answer content can better meet the emotional needs of the user. On the other hand, since after the answer content is generated, the tone prompt and wording prompt in the prompt sentence will be readjusted to match the emotion type and emotion intensity based on the reward value of the answer content, so as to optimize the answer content until the target answer content is obtained when the reward value converges, so that the target answer content can meet the emotional tendency of the user to the greatest extent, thereby better meeting the emotional needs of the user. In summary, this embodiment can effectively identify the emotional tendencies of user questions, and generate and adjust answer content based on the user's emotional tendencies, so that the target answer content can accurately answer the user's questions while maximally satisfying the user's emotional needs and improving the user experience.

[0052] Furthermore, this embodiment adopts a modular design, which makes the system more maintainable and extensible, and each module can be independently upgraded or replaced as needed. For example, the emotion recognition module can be upgraded separately to use a more advanced classification model, the emotion prompt adjustment module can introduce new mapping rules and strategies, and the answer content generation module can be integrated with the latest language model. This design not only improves the flexibility and extensibility of the system, but also facilitates the collaborative optimization between modules.

[0053] FIG5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call a computer program in the memory 530 to execute the steps of the intelligent question-answering method, for example, including: Perform emotion recognition on the current question content input by the user to obtain the emotion type and emotion intensity; Adjust the tone prompt and wording prompt in the current prompt sentence based on the emotion type and the emotion intensity to obtain a target prompt sentence; Generate current answer content based on the target prompt sentence and the current question content; A reward value for the current answer content is generated based on the reward function. If the reward value does not converge, the step of adjusting the tone prompts and wording prompts in the current prompt sentence based on the emotion type and the emotion intensity to obtain the target prompt sentence is returned until the reward value converges, and the current answer content at this time is determined as the target answer content.

[0054] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0055] On the other hand, an embodiment of the present application further provides a computer program product, the computer program product comprising a computer program, the computer program may be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can perform the steps of the intelligent question-answering method provided in the above embodiments, for example, including: Perform emotion recognition on the current question content input by the user to obtain the emotion type and emotion intensity; Adjust the tone prompt and wording prompt in the current prompt sentence based on the emotion type and the emotion intensity to obtain a target prompt sentence; Generate current answer content based on the target prompt sentence and the current question content; A reward value for the current answer content is generated based on the reward function. If the reward value does not converge, the step of adjusting the tone prompts and wording prompts in the current prompt sentence based on the emotion type and the emotion intensity to obtain the target prompt sentence is returned until the reward value converges, and the current answer content at this time is determined as the target answer content.

[0056] On the other hand, an embodiment of the present application further provides a non-transitory computer-readable storage medium on which a computer program is stored, wherein the computer program is used to enable a processor to execute the steps of the intelligent question-answering method provided in the above embodiments, for example, including: Perform emotion recognition on the current question content input by the user to obtain the emotion type and emotion intensity; Adjust the tone prompt and wording prompt in the current prompt sentence based on the emotion type and the emotion intensity to obtain a target prompt sentence; Generate current answer content based on the target prompt sentence and the current question content; A reward value for the current answer content is generated based on the reward function. If the reward value does not converge, the step of adjusting the tone prompts and wording prompts in the current prompt sentence based on the emotion type and the emotion intensity to obtain the target prompt sentence is returned until the reward value converges, and the current answer content at this time is determined as the target answer content.

[0057] The non-transitory computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)), etc.

[0058] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0059] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An intelligent question-answering method, characterized in that: include: Perform emotion recognition on the current question content input by the user to obtain the emotion type and emotion intensity; Adjust the tone prompt and wording prompt in the current prompt sentence based on the emotion type and the emotion intensity to obtain a target prompt sentence; Generate current answer content based on the target prompt sentence and the current question content; A reward value for the current answer content is generated based on the reward function. If the reward value does not converge, the step of adjusting the tone prompts and wording prompts in the current prompt sentence based on the emotion type and the emotion intensity to obtain the target prompt sentence is returned until the reward value converges, and the current answer content at this time is determined as the target answer content.

2. The intelligent question-answering method according to claim 1, characterized in that: The reward function is generated based on the emotional fitness of the answer content, the user's immediate feedback on the answer content, and the user's historical feedback on similar answer contents.

3. The intelligent question-answering method according to claim 1, characterized in that: The step of generating a reward value for the current answer content based on the reward function includes: The emotional fitness of the current answer content, the user's immediate feedback on the current answer content, and the user's historical feedback on similar current answer content are input into the reward function to obtain the reward value.

4. The intelligent question-answering method according to claim 3, characterized in that: The emotional fitness is determined based on the following method: Calculating the similarity between the emotion type of the current question content and the emotion type of the current answer content to obtain a first fitness; Calculating the similarity between the sentiment intensity of the current question content and the sentiment intensity of the current answer content to obtain a second fitness; Calculating the similarity between the tone of the current question content and the tone of the current answer content to obtain a third fitness; The emotional fitness is obtained based on the first fitness, the second fitness and the third fitness.

5. The intelligent question-answering method according to claim 3, characterized in that: The instant feedback includes current explicit feedback and current implicit feedback, and the historical feedback includes historical explicit feedback and historical implicit feedback; The current explicit feedback includes whether the user likes, comments, rates, and rates the current answer; The current implicit feedback includes whether the user continues to interact with the current answer content, and when the user stops interacting with the current answer content, whether the problem solving rate of the interaction process is scored and the score; The historical explicit feedback includes whether the user liked, commented on, rated, and rated similar content to the current answer in the historical period; The historical invisible feedback includes whether the user continues to interact with content similar to the current answer in the historical period, and when the user stops interacting with content similar to the current answer, whether the problem solving rate of the interaction process is scored and the scoring score.

6. The intelligent question-answering method according to claim 1, characterized in that: The emotion recognition of the current question content input by the user to obtain the emotion type and emotion intensity includes: Segmenting and encoding the current question content to obtain a target text in a target input format; Inputting the target text into a sentiment recognition model to obtain the sentiment type and the sentiment intensity; The target input format is an input format acceptable to the emotion recognition model. The emotion recognition model is obtained by training historical target texts and their emotion labels based on any classification model. The emotion labels include emotion type labels and emotion intensity labels.

7. An intelligent question-answering system, characterized in that: include: The emotion recognition module is used to: perform emotion recognition on the current question content input by the user to obtain the emotion type and emotion intensity; An emotional prompt adjustment module, used to: adjust the tone prompt and wording prompt in the current prompt sentence based on the emotional type and the emotional intensity to obtain a target prompt sentence; An answer content generating module, used to: generate current answer content based on the target prompt sentence and the current question content; The emotional reinforcement learning module is used to: generate a reward value for the current answer content based on a reward function; if the reward value does not converge, return to the step of adjusting the tone prompts and wording prompts in the current prompt sentence based on the emotional type and the emotional intensity to obtain a target prompt sentence, until the reward value converges, and determine the current answer content at this time as the target answer content.

8. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the steps of the intelligent question-answering method according to any one of claims 1 to 6 are implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the intelligent question-answering method according to any one of claims 1 to 6 are implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the intelligent question-answering method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Intelligent question answering method and device based on emotional tendency and storage medium

    CN120030134A

  • Industrial material dialogue recommendation method and system based on large model and ElasticSearch

    CN121257699A