Interaction method and device and electronic equipment

By introducing retrieval enhancement generation technology and long and short-term memory information into the large language model, adjusting interaction requests and generating responses, the misleading and outdated information in the interaction of the large language model is solved, and high-accurate user interaction is achieved.

CN119293190AInactive Publication Date: 2025-01-10DARK MATTER ARTIFICIAL INTELLIGENT (BEIJING) TECHNOLOGY CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411601929.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-01-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Large language models may produce misleading "illusions" during the interaction process, with outdated information, lack of in-depth insights in professional fields, lack of reasoning capabilities, and unable to achieve accurate interaction with users.

Method used

Retrieval enhancement generation technology (RAG) is used to combine long and short-term memory information, adjust interaction requests to meet expression requirements, determine interaction paths, and generate response information based on local and network resource libraries, and use users' historical interaction information and user portraits to achieve accurate interaction.

Benefits of technology

It significantly improves the accuracy and relevance of interactive information, ensures that the response information meets user needs and preferences, and achieves accurate interaction with users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293190A_ABST
    Figure CN119293190A_ABST
Patent Text Reader

Abstract

The invention discloses an interaction method and device and electronic equipment, and the interaction method comprises the steps: obtaining current interaction information and long and short-term memory information corresponding to the current interaction information, and the current interaction information and the long and short-term memory information belong to the same user; based on the long and short-term memory information, adjusting an interaction request included in the current interaction information so as to enable the interaction request to meet an expression requirement; determining an interaction path corresponding to the interaction request; and generating response information corresponding to the interaction request according to the interaction path.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of human-computer interaction technology, and in particular to an interaction method, device and electronic equipment. Background Art

[0002] Large Language Models (LLMs) have become part of our lives and work, changing the way we interact with information with their amazing versatility and intelligence. However, large language models have the following problems: they may produce misleading "hallucinations", rely on outdated information, lack deep insights into professional fields, and have insufficient reasoning capabilities.

[0003] To address the above issues, Retrieval-Augmented Generation (RAG) technology was born. Before the large language model generates answers, RAG is used to retrieve relevant information from an external database, and then use this information to guide the generation process, which greatly improves the accuracy and relevance of the answers and effectively alleviates the "hallucination" problem. However, it is still impossible to achieve accurate interaction with different users. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide an interaction method, device and electronic device.

[0005] In a first aspect, an embodiment of the present application provides an interaction method, including:

[0006] Obtaining current interaction information and long short-term memory information corresponding to the current interaction information, wherein the current interaction information and the long short-term memory information belong to the same user;

[0007] Based on the long and short-term memory information, adjusting the interaction request included in the current interaction information so that the interaction request meets the expression requirement;

[0008] Determining an interaction path corresponding to the interaction request;

[0009] Generate response information corresponding to the interaction request according to the interaction path.

[0010] In a possible implementation manner, the current interaction information further includes an interaction file, and the long-term and short-term memory information includes historical interaction information and the user portrait;

[0011] The adjusting the interaction request included in the current interaction information based on the long short-term memory information includes:

[0012] Based on the interaction file, the historical interaction information and the user portrait, the interaction request included in the current interaction information is adjusted.

[0013] In a possible implementation manner, determining the interaction path corresponding to the interaction request includes:

[0014] Performing semantic analysis on the interaction request to determine the interaction type of the interaction request;

[0015] The interaction path is determined based on the interaction type, and interaction requests of different interaction types correspond to different interaction paths.

[0016] In a possible implementation manner, generating response information corresponding to the interaction request according to the interaction path includes:

[0017] Extracting key information of the interaction request;

[0018] Based on the key information, the response information is generated by utilizing a local resource library and a network resource library.

[0019] In a possible implementation manner, the generating the response information based on the key information and using a local resource library and a network resource library includes:

[0020] Based on the key information, obtain N candidate information using a local resource library, and obtain M candidate information using a network resource library;

[0021] Determine multiple target information from the N candidate information and the M candidate information;

[0022] The response information is generated based on a plurality of target information.

[0023] In a possible implementation manner, determining multiple target information from the N candidate information and the M candidate information includes:

[0024] For each piece of candidate information, calculating the relevance between the candidate information and the interaction request;

[0025] According to the first order of the relevance from high to low, a plurality of target information are determined, each of the target information carries a unique identifier.

[0026] In a possible implementation manner, the generating the response information based on the multiple target information includes:

[0027] The response information is generated based on all or part of the target information in the multiple target information, the target information in the response information carries a unique identifier, and a second order in which the target information in the response information appears is different from the first order.

[0028] In a possible implementation manner, the interaction method further includes:

[0029] The long short-term memory information is updated based on the response information.

[0030] In a second aspect, an embodiment of the present application further provides an interactive device, including:

[0031] An acquisition module configured to obtain current interaction information and long short-term memory information corresponding to the current interaction information, wherein the current interaction information and the long short-term memory information belong to the same user;

[0032] an adjustment module, configured to adjust the interaction request included in the current interaction information based on the long short-term memory information, so that the interaction request meets the expression requirement;

[0033] A determination module configured to determine an interaction path corresponding to the interaction request;

[0034] A generating module is configured to generate response information corresponding to the interaction request according to the interaction path.

[0035] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via a bus, and when the machine-readable instructions are executed by the processor, the steps of any one of the above-mentioned interaction methods are performed.

[0036] In an embodiment of the present application, while obtaining the current interaction information, the long-term and short-term memory information corresponding to the current interaction information is obtained, so that the interaction request included in the current interaction information is adjusted based on the long-term and short-term memory information, thereby obtaining a more accurate interaction path. Thereafter, response information corresponding to the interaction request is generated according to the interaction path. Since the long-term and short-term memory information includes the user's historical interaction information and user portrait, accurate interaction can be achieved for different users. In other words, the interaction method of the present application is more targeted, and the generated response information is more in line with the needs and preferences of the current user, that is, the accuracy of the response information is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0038] Figure 1 A flow chart of an interaction method provided by the present application is shown;

[0039] Figure 2 A flowchart showing an interaction path corresponding to an interaction request in an interaction method provided by the present application is shown;

[0040] Figure 3 A flowchart showing a method for generating response information based on key information by using a local resource library and a network resource library in an interaction method provided by the present application is shown;

[0041] Figure 4 A schematic diagram of the structure of an interactive system provided by the present application is shown;

[0042] Figure 5 A schematic diagram of the structure of an interactive device provided by the present application is shown;

[0043] Figure 6 A structural schematic diagram of an electronic device provided by the present application is shown. DETAILED DESCRIPTION

[0044] Various aspects and features of the present application are described herein with reference to the accompanying drawings.

[0045] It should be understood that various modifications may be made to the embodiments of the present application. Therefore, the above description should not be considered as limiting, but only as an example of an embodiment. Other modifications within the scope and spirit of the present application will occur to those skilled in the art.

[0046] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0047] These and other characteristics of the present application will become apparent from the following description of a preferred form of embodiment given as a non-limiting example with reference to the accompanying drawings.

[0048] It should also be understood that, although the present application has been described with reference to some specific examples, those skilled in the art will be able to realize many other equivalent forms of the present application that have the features described in the claims and are therefore within the scope of protection defined thereby.

[0049] The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.

[0050] Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments applied for are merely examples of the present application, which may be implemented in a variety of ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that obscure the present application. Therefore, the specific structural and functional details applied for herein are not intended to be limiting, but merely serve as a basis and representative basis for the claims to teach those skilled in the art to use the present application in a variety of ways with substantially any suitable detailed structure.

[0051] This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," all of which may refer to one or more of the same or different embodiments according to the present application.

[0052] To facilitate understanding of the present application, an interaction method provided by the present application is first introduced in detail.

[0053] Figure 1 A flowchart of an interaction method provided in an embodiment of the present application is shown, wherein specific steps include S101-S104.

[0054] S101, obtaining current interaction information and long short-term memory information corresponding to the current interaction information, wherein the current interaction information and the long short-term memory information belong to the same user.

[0055] The embodiment of the present application is described by taking user query information as an example, wherein the current interaction information includes a query statement, and the current interaction information is determined by the user through an interaction device.

[0056] The current interaction information also includes the user's identity. After obtaining the user's identity, the corresponding long-term and short-term memory information is searched based on the identity, that is, the current interaction information and the long-term and short-term memory information belong to the same user. The long-term and short-term memory information can represent some personalized information of the user.

[0057] S102: Based on the long-short term memory information, adjust the interaction request included in the current interaction information so that the interaction request meets the expression requirement.

[0058] Here, the interaction request included in the current interaction information may have problems such as unclear intentions and failure to reflect the personalization of the current user. Based on this, after obtaining the long- and short-term memory information corresponding to the current interaction information, the interaction request included in the current interaction information is adjusted based on the long- and short-term memory information to make the interaction request meet the expression requirements, which at least includes clear intentions and reflecting the personalization of the current user.

[0059] For example, the current interaction information determined by the user is "What delicious food is there near my home", and the interaction request included therein is "What delicious food is there near my home". The long-term and short-term memory information corresponding to the current interaction information obtained based on the user's identity identification is: the user "lives in XX community, Nanshan District, Shenzhen". Afterwards, after adjusting the interaction request based on the long-term and short-term memory information, the interaction request that meets the expression requirements is "What delicious food is there near XX community, Nanshan District, Shenzhen".

[0060] Optionally, the interaction request is adjusted by a pre-trained adjustment model, that is, the current interaction information and the long short-term memory information are used as inputs of the adjustment model, so that the adjustment model outputs an interaction request that meets the expression requirements. Of course, the embodiments of the present application are not limited thereto.

[0061] In practical applications, the current interactive information also includes interactive files, such as quantum papers, instructions for a certain drug, etc. For example, in a medical consultation scenario, a user uploads the instructions for drug A and asks whether a patient with heart disease can take drug A. At this time, the current interactive information includes the instructions for drug A and whether a patient with heart disease can take drug A.

[0062] The long- and short-term memory information of the embodiment of the present application includes historical interaction information and user portraits. Among them, the historical interaction information includes the interaction information corresponding to the multiple rounds of interactions performed by the current user before the current interaction information is determined. Optionally, the historical interaction information is used as short-term memory information, and it is set to include the interaction information corresponding to the 5 rounds of interactions performed by the current user before the current interaction information is determined. That is, the historical interaction information needs to be continuously updated. Once new historical interaction information is generated, part of the original historical interaction information will be deleted, that is, the historical interaction information will not be permanently saved. As long-term memory information, the user portrait is permanently saved, but there are also situations where it is updated. For example, in a medical scenario, the user portrait includes the user's daily medication. When the patient completes a course of treatment or the condition changes and the medication needs to be adjusted, the medication situation can be updated to update the user portrait.

[0063] Based on this, when the interaction request included in the current interaction information is adjusted based on the long-short term memory information, specifically based on the interaction file, historical interaction information and user portrait, the interaction request included in the current interaction information is adjusted, that is, the current interaction information, interaction file, historical interaction information and user portrait are used as inputs of the adjustment model, so that the adjustment model outputs an interaction request that meets the expression requirements.

[0064] Of course, the current interaction information can also be subjected to compliance detection, that is, whether the current interaction information determined by the user is compliant. If compliant, the step of adjusting the interaction request included in the current interaction information is performed. If not compliant, a preset reply is generated and the interaction request is responded to using the preset reply. For example, the preset reply is "This question cannot be answered, please try another way of asking."

[0065] Optionally, the current interaction information is compared with the dirty word list, and if the current interaction information contains a phrase in the dirty word list, it is determined that the current interaction information is non-compliant.

[0066] S103: Determine an interaction path corresponding to the interaction request.

[0067] After obtaining an interaction request that meets the expression requirements, an interaction path corresponding to the interaction request is determined, wherein the interaction path includes the steps required to be executed in response to the interaction request and the order of each step.

[0068] Here, in the embodiment of the present application, two interaction paths are provided, namely, a search path and a chat path, and different interaction paths are used to respond to different interaction requests.

[0069] S104: Generate response information corresponding to the interaction request according to the interaction path.

[0070] After the interaction path corresponding to the interaction request is determined, response information corresponding to the interaction request is generated according to the interaction path.

[0071] In an embodiment of the present application, while obtaining the current interaction information, the long-term and short-term memory information corresponding to the current interaction information is obtained, so that the interaction request included in the current interaction information is adjusted based on the long-term and short-term memory information, thereby obtaining a more accurate interaction path. Thereafter, response information corresponding to the interaction request is generated according to the interaction path. Since the long-term and short-term memory information includes the user's historical interaction information and user portrait, accurate interaction can be achieved for different users. In other words, the interaction method of the present application is more targeted, and the generated response information is more in line with the needs and preferences of the current user, that is, the accuracy of the response information is higher.

[0072] Optionally, Figure 2 A flow chart of determining an interaction path corresponding to an interaction request is shown, wherein specific steps include S201 and S202.

[0073] S201, performing semantic analysis on an interaction request to determine an interaction type of the interaction request.

[0074] S202, determining an interaction path based on the interaction type, where interaction requests of different interaction types correspond to different interaction paths.

[0075] Optionally, the interaction path corresponding to the interaction request is determined by a pre-trained classification model. Specifically, the interaction request is input into the classification model so that the classification model performs semantic analysis on the interaction request to determine the interaction type to which the interaction request belongs; then, the interaction path is determined based on the interaction type to which the interaction request belongs, and the interaction path is output.

[0076] Among them, interaction requests of different interaction types correspond to different interaction paths, so that different interaction requests can be responded to in a targeted manner, that is, the accuracy of the response is higher.

[0077] For example, if the interaction type is search, the interaction path is determined to be the search path; if the interaction type is chat, the interaction path is determined to be the chat path.

[0078] In the scenario where the interaction type is small talk and the interaction path is a small talk path, when generating response information corresponding to the interaction request according to the interaction path, a pre-built and trained small talk generator is used to respond to the interaction request to output the corresponding response information. The small talk generator can be generated based on a large language model, which has the capabilities of semantic analysis, semantic understanding, and semantic generation, and can respond to the user's interaction request to generate the corresponding response information.

[0079] In the scenario where the interaction type is retrieval and the interaction path is a retrieval path, when generating response information corresponding to the interaction request according to the interaction path, the key information of the interaction request is extracted by generating the response information corresponding to the interaction request through the retrieval model according to the interaction path. For example, if the interaction request is "help me find some sixth grade math test papers", the key information extracted is "sixth grade math test papers".

[0080] Afterwards, based on the key information, the retrieval model uses the local resource library and the network resource library to generate response information. The embodiment of the present application obtains the response information by extracting the key information of the interactive request, which can reduce the retrieval operation of the retrieval model while ensuring that the response information has high accuracy.

[0081] As one example, Figure 3 A flow chart of generating response information based on key information by using a local resource library and a network resource library is shown, wherein specific steps include S301-S303.

[0082] S301, based on the key information, obtain N candidate information using the local resource library, and obtain M candidate information using the network resource library.

[0083] S302, determining a plurality of target information from N candidate information and M candidate information.

[0084] S303, generating response information based on multiple target information.

[0085] In a specific implementation, the search model can call the local resource library and the network resource library to generate response information corresponding to the interaction request based on the key information. Preferably, the search model calls the local resource library and the network resource library at the same time to improve the search efficiency, that is, to improve the interaction efficiency.

[0086] In one example, based on the key information, N candidate information is obtained using the local resource library, and M candidate information is obtained using the network resource library, wherein the candidate information is a knowledge fragment related to the key information, and the values ​​of N and M are determined according to actual needs.

[0087] Specifically, before using the local resource library to obtain N candidate information, the knowledge fragments in the local resource library are vectorized by the retrieval model to obtain the fragment vectors and stored. When using the local resource library to obtain N candidate information, the key information is vectorized by the retrieval model to obtain the key vector, and then the similarity between each fragment vector in the local resource library and the key vector is calculated respectively, and N fragment vectors are selected in descending order of similarity, and the knowledge fragments corresponding to the N fragment vectors are determined to be N candidate information.

[0088] When M candidate information is obtained by using the network resource library, the network application program interface (Application Program Interface, API), such as Google SearchAPI, is called through the retrieval model to filter and obtain multiple web page names or web page summaries based on the key information. The similarity between the web page name or web page summary and the key information is greater than a threshold. Similarly, in descending order of similarity, M web page names or web page summaries are selected as candidate information and returned to the retrieval model.

[0089] Thus, N+M candidate information is obtained through the search model. The embodiment of the present application uses both the local resource library and the network resource library to obtain candidate information, which not only improves the search efficiency, but also expands the search scope, ensuring the accuracy and real-time nature of generating response information.

[0090] Afterwards, multiple target information is further determined from the N candidate information and the M candidate information. Optionally, for each candidate information, the relevance between the candidate information and the interaction request is calculated, wherein the relevance can be calculated by a retrieval model or by other models or algorithms.

[0091] After obtaining the relevance corresponding to all candidate information, multiple target information are determined in a first order from high to low relevance, wherein the number of target information is less than or equal to the sum of N and M, and each target information carries a unique identifier, which is used to characterize the order of the target information in the first order.

[0092] After obtaining multiple target information, response information is generated based on the multiple target information. Optionally, the response information is generated based on all or part of the target information in the multiple target information, and the target information in the response information carries a unique identifier, which can be used to achieve the purpose of information tracing, thereby increasing the transparency and credibility of the response information.

[0093] The second order in which the target information appears in the response information is different from the first order.

[0094] Optionally, after the response information is generated, the response information may be subjected to security checks through a security identification model, such as checking whether the response information contains sensitive content. If so, the response information is regenerated to ensure that the response information complies with security checks.

[0095] After determining that the response information complies with the security check, the response information is output, thereby completing the interaction with the user.

[0096] Furthermore, after receiving the response information, the long short-term memory information is updated based on the response information to ensure that the interaction request adjusted based on the long short-term memory information is more intentional and reflects the personalization of the current user, thereby ensuring that the generated response information is more in line with the needs and preferences of the current user.

[0097] It is worth noting that the models in the embodiments of the present application, such as the adjustment model, classification model, retrieval model, and security identification model, do not require a lot of training, which effectively reduces the model training cost of the present application.

[0098] The interaction method provided in the embodiment of the present application can be applied to a variety of human-computer interaction scenarios. The following are two examples provided in the embodiment of the present application. The first example is an example in a medical scenario, and the second example is an example in an educational scenario.

[0099] First example

[0100] First round of dialogue:

[0101] The user inputs interaction information, including the interaction request "Can I take this medicine?" and the uploaded interaction file "Aspirin Enteric-coated Sustained-release Tablets Instructions.pdf". In this example, the user profile [name is Li Hua, with congenital heart disease] is assumed, but no historical interaction information is stored. The interaction request is adjusted to "I have congenital heart disease, can I take Aspirin Enteric-coated Sustained-release Tablets?" using the interaction file and user profile. After that, the adjusted interaction request is subjected to compliance detection to determine whether "I have congenital heart disease, can I take Aspirin Enteric-coated Sustained-release Tablets?" is compliant, and the detection result is that the interaction request is compliant. If the detection result is that the interaction request is compliant, the interaction request is The request is semantically analyzed to determine that the intention of "I have congenital heart disease, can I take enteric-coated aspirin sustained-release tablets?" is to chat, and thus the chat path is chosen; after entering the chat path, the response to "I have congenital heart disease, can I take enteric-coated aspirin sustained-release tablets" is generated, and the corresponding response information is generated: "Because you have congenital heart disease, you need to be cautious when using enteric-coated aspirin sustained-release tablets, and you must do so under the guidance of a doctor. Enteric-coated aspirin sustained-release tablets are mainly used to inhibit platelet adhesion and aggregation, and reduce the occurrence of myocardial infarction, transient cerebral ischemia or stroke in patients with atherosclerosis, so it may be beneficial for some heart disease patients. However, it also has some potential side effects. Effects and contraindications, especially for patients with a history of heart disease. According to the instructions you provided, the following are some things you need to pay special attention to: Contraindications: If you are known to be allergic to this product, or have a history of asthma, urticaria or allergic reactions after taking aspirin or other non-steroidal anti-inflammatory drugs, then you should not take this medicine. Precautions: This product may cause serious cardiovascular thrombotic adverse events, increased risk of myocardial infarction and stroke, especially for patients with cardiovascular disease or risk factors for cardiovascular disease. Drug interactions: If you are taking other drugs, such as anticoagulants, hypoglycemic drugs, diuretics or antihypertensive drugs, aspirin may interact with these drugs. Effect, affecting the efficacy or increasing the risk of side effects. Medication for the elderly: Elderly patients are prone to toxic reactions when taking this product due to decreased renal function. "; After that, check whether the above response information meets the safety test. Here, the test result is that the above response information meets the safety test. At this time, the response information is output to complete the interaction with the user; after the response information is output, the user portrait and interaction information are extracted according to the dialogue information of this round [user: (interaction request), assistant: (response information)}]. There is no user portrait that can be extracted and updated in this round of dialogue. Therefore, the user portrait included in the long-term and short-term memory information remains unchanged, which is [name is Li Hua, with congenital heart disease].

[0102] Second example

[0103] This example is described in conjunction with the interactive system provided by this application. Figure 4A schematic diagram of the structure of the interactive system is shown.

[0104] First round of dialogue:

[0105] The user inputs the interaction information "Hello, I am Li Hua, a junior high school student"; the interaction request included in the above interaction information enters the information integration module. Since the current dialogue is the first round of dialogue, there is no corresponding long-term and short-term memory information, that is, the personalized memory module does not transmit the long-term and short-term memory information to the information integration module. At the same time, the user has not uploaded the interaction file. Therefore, the information integration module adjusts the interaction request to obtain the interaction request as "Hello, I am Li Hua, a junior high school student"; the adjusted interaction request enters the sensitive detection module, the sensitive detection module performs a compliance check on the adjusted interaction request to determine whether the "Hello, I am Li Hua, a junior high school student" is compliant, and the detection result is that the interaction request is compliant; when the detection result is that the interaction request is compliant, the interaction request enters the routing distribution module, the routing distribution module performs a semantic analysis on the interaction request, and determines that the intention of "Hello, I am Li Hua, a junior high school student" is to chat, and therefore enters the chat path; the interaction request enters the chat generation module, and the chat generation module responds with "Hello , I am Li Hua, a student in the second grade of junior high school", generates the corresponding response information "Hello, how can I help you"; then, the above response information enters the post-processing detection module, and the post-processing detection module performs a security check on "Hello, how can I help you", and outputs "Hello, how can I help you" when it is determined that "Hello, how can I help you" meets the security check; after outputting the response information, the memory update module extracts the user portrait and interaction information according to the current round of dialogue information [{user:"Hello, I am Li Hua, a student in the second grade of junior high school", assistant:"Hello, how can I help you"}], and updates the long-term and short-term memory information stored in the personalized memory module. The updated long-term and short-term memory information includes the user portrait ["My name is Li Hua", "I am a student in the second grade of junior high school"], and the long-term and short-term memory information includes the historical interaction information [{user:"Hello, I am Li Hua, a student in the second grade of junior high school", assistant:"Hello, how can I help you"}].

[0106] Second round of dialogue:

[0107] The user inputs the interaction information "Help me find some math test papers"; the interaction request included in the above interaction information enters the information integration module. Since the current dialogue is not the first round of dialogue, the long-term and short-term memory information of the user is extracted from the personalized memory module, including the user portrait ["My name is Li Hua", "I am a junior high school student"] and the historical interaction information [{user: "Hello, I am Li Hua, a junior high school student", assistant: "Hello, how can I help you?"}], and the information integration module adjusts the interaction request to obtain the interaction request "Help me find some junior high school math test papers"; the above adjusted interaction request enters the sensitivity detection module, and the sensitivity detection module performs integration on the interaction request. The interactive request is checked for compliance, and the result of the check is that the interactive request is compliant; if the result of the check is that the interactive request is compliant, the interactive request enters the routing distribution module, and the routing distribution module performs semantic analysis on the interactive request, and determines that the intention of "help me find a few math test papers for the second grade of junior high school" is to search for questions, and then enters the retrieval path; after entering the retrieval path, the interactive request enters the information extraction module, and the information extraction module extracts the key information in "help me find a few math test papers for the second grade of junior high school", and the key information is "math test papers for the second grade of junior high school"; the key information enters the parallel retrieval module, and the parallel retrieval module calls the local resource library and the network resource library at the same time to search for questions based on the key information. Information retrieval is performed in the local resource library and the network resource library, and the retrieval result based on the local resource library is [a1, a2, a3, a4, a5], and the result based on the network resource library is [b1, b2, b3, b4, b5]; the retrieval result [a1, a2, a3, a4, a5, b1, b2, b3, b4, b5] enters the rearrangement module, the rearrangement module reorders [a1, a2, a3, a4, a5, b1, b2, b3, b4, b5], and filters out the information with low relevance to obtain the rearrangement result [b2, a3, a1, b4, a2], and each information in [b2, a3, a1, b4, a2] is marked respectively, so that each information carries a unique A mark; [b2, a3, a1, b4, a2] with a unique mark enters the traceability reference generation module, and the traceability reference generation module uses part of the information in [b2, a3, a1, b4, a2] to generate the corresponding response information. The response information is "Of course, you can provide some information about the math test paper. Here are a few options for your reference: \n Middle School Mathematics Beijing Normal University Edition Grade 8 Second Semester Unit 1 Test Paper [1] (unique mark), suitable for eighth grade students to conduct self-tests, and the content covers the teaching points of the first unit. You can refer to **People's Education Edition Mathematics Grade 8 Second Semester Monthly Exam One Standard Test Paper (Applicable to Yunnan Region)** [2] (unique mark), this test paper is based on the teaching progress of the first grade in Yunnan Region.\nFor eighth graders, you can use **2016-2017 Chongqing Key Middle School Eighth Grade Second Semester Midterm Mathematics Test Paper (Paper B)**[3](unique mark) as a review material. This test paper is a midterm exam for eighth graders in Chongqing. \nAnother test paper for eighth graders is **2016-2017 Chongqing Eighteenth Middle School Eighth Grade Second Semester Midterm Mathematics Test Paper**[4](unique mark). This test paper is from another key middle school in Chongqing and may be different in difficulty and question types. \nFinally, **2016-2017 Jiangsu Province Changzhou Wujin District Luoyang Junior Middle School Eighth Grade Second Semester Mathematics Midterm Exam Paper**[5](unique mark) is a math test paper for eighth graders that covers the main knowledge points of the second semester. \nPlease select the appropriate test paper according to your needs. If you have more specific needs, such as requiring a specific version of the test paper, please let me know. "; Afterwards, the response information enters the post-processing detection module, which detects whether the response information meets the security test. If the test result is that it meets the security test, the response information is output; Afterwards, the memory update module extracts the user portrait and interaction information according to the dialogue information of this round {user: "Help me find some math test papers for the second grade of junior high school", assistant: "Of course..." (response information)}, and updates the long-term and short-term memory information stored in the personalized memory module. There is no user portrait that can be extracted and updated in this round of dialogue. Therefore, the user portrait included in the long-term and short-term memory information remains unchanged, and is still ["My name is Li Hua", "I am a second-year junior high school student"].

[0108] certainly, Figure 4 The interactive system is only an example, and the modules included therein can be adjusted according to actual needs, and the embodiments of the present application do not specifically limit this.

[0109] Based on the same inventive concept, the second aspect of the present application also provides an interactive device corresponding to an interactive method. Since the principle of solving the problem by the interactive device in the present application is similar to the above-mentioned interactive method of the present application, the implementation of the interactive device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0110] Figure 5 The structure diagram of the interactive device provided in the embodiment of the present application is shown, which specifically includes:

[0111] An acquisition module 501 is configured to obtain current interaction information and long short-term memory information corresponding to the current interaction information, wherein the current interaction information and the long short-term memory information belong to the same user;

[0112] An adjustment module 502, configured to adjust the interaction request included in the current interaction information based on the long short-term memory information, so that the interaction request meets the expression requirement;

[0113] A determination module 503, configured to determine an interaction path corresponding to the interaction request;

[0114] The generating module 504 is configured to generate response information corresponding to the interaction request according to the interaction path.

[0115] In another example, the current interaction information also includes an interaction file, and the long-term and short-term memory information includes historical interaction information and the user portrait; the adjustment module 502 is specifically configured as follows:

[0116] Based on the interaction file, the historical interaction information and the user portrait, the interaction request included in the current interaction information is adjusted.

[0117] In another example, the determination module 503 is specifically configured as follows:

[0118] Performing semantic analysis on the interaction request to determine the interaction type of the interaction request;

[0119] The interaction path is determined based on the interaction type, and interaction requests of different interaction types correspond to different interaction paths.

[0120] In another example, the generating module 504 is specifically configured as follows:

[0121] Extracting key information of the interaction request;

[0122] Based on the key information, the response information is generated by utilizing a local resource library and a network resource library.

[0123] In yet another example, the generating module 504 is further configured to:

[0124] Based on the key information, obtain N candidate information using a local resource library, and obtain M candidate information using a network resource library;

[0125] Determine multiple target information from the N candidate information and the M candidate information;

[0126] The response information is generated based on a plurality of target information.

[0127] In yet another example, the generating module 504 is further configured to:

[0128] For each piece of candidate information, calculating the relevance between the candidate information and the interaction request;

[0129] According to the first order of the relevance from high to low, a plurality of target information are determined, each of the target information carries a unique identifier.

[0130] In yet another example, the generating module 504 is further configured to:

[0131] The response information is generated based on all or part of the target information in the multiple target information, the target information in the response information carries a unique identifier, and a second order in which the target information in the response information appears is different from the first order.

[0132] In yet another example, the interaction device further includes an updating module 505, which is configured to:

[0133] The long short-term memory information is updated based on the response information.

[0134] In an embodiment of the present application, while obtaining the current interaction information, the long-term and short-term memory information corresponding to the current interaction information is obtained, so that the interaction request included in the current interaction information is adjusted based on the long-term and short-term memory information, thereby obtaining a more accurate interaction path. Thereafter, response information corresponding to the interaction request is generated according to the interaction path. Since the long-term and short-term memory information includes the user's historical interaction information and user portrait, accurate interaction can be achieved for different users. In other words, the interaction method of the present application is more targeted, and the generated response information is more in line with the needs and preferences of the current user, that is, the accuracy of the response information is higher.

[0135] An embodiment of the present application provides a storage medium, which is a computer-readable medium and stores a computer program. When the computer program is executed by a processor, the method provided by any embodiment of the present application is implemented, including the following steps S11 to S14:

[0136] S11, obtaining current interaction information and long short-term memory information corresponding to the current interaction information, wherein the current interaction information and the long short-term memory information belong to the same user;

[0137] S12, based on the long short-term memory information, adjusting the interaction request included in the current interaction information so that the interaction request meets the expression requirement;

[0138] S13, determining an interaction path corresponding to the interaction request;

[0139] S14: Generate response information corresponding to the interaction request according to the interaction path.

[0140] An embodiment of the present application provides an electronic device. The structural diagram of the electronic device can be as follows: Figure 6As shown, at least a memory 601 and a processor 602 are included, the memory 601 stores a computer program, and the processor 602 implements the method provided by any embodiment of the present application when executing the computer program on the memory 601. Exemplarily, the steps of the electronic device computer program are as follows S21 to S24:

[0141] S21, obtaining current interaction information and long short-term memory information corresponding to the current interaction information, wherein the current interaction information and the long short-term memory information belong to the same user;

[0142] S22, adjusting the interaction request included in the current interaction information based on the long short-term memory information, so that the interaction request meets the expression requirement;

[0143] S23, determining an interaction path corresponding to the interaction request;

[0144] S24: Generate response information corresponding to the interaction request according to the interaction path.

[0145] In an embodiment of the present application, while obtaining the current interaction information, the long-term and short-term memory information corresponding to the current interaction information is obtained, so that the interaction request included in the current interaction information is adjusted based on the long-term and short-term memory information, thereby obtaining a more accurate interaction path. Thereafter, response information corresponding to the interaction request is generated according to the interaction path. Since the long-term and short-term memory information includes the user's historical interaction information and user portrait, accurate interaction can be achieved for different users. In other words, the interaction method of the present application is more targeted, and the generated response information is more in line with the needs and preferences of the current user, that is, the accuracy of the response information is higher.

[0146] Optionally, in this embodiment, the above-mentioned storage medium may include, but is not limited to, various media that can store program codes, such as a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk. Optionally, in this embodiment, the processor executes the method steps recorded in the above-mentioned embodiment according to the program code stored in the storage medium. Optionally, the specific examples in this embodiment can refer to the examples described in the above-mentioned embodiment and the optional implementation mode, and this embodiment is not repeated here. Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present application can be implemented with a general computing device, which can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. Optionally, they can be implemented with executable program codes of computing devices, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from here, or they can be made into individual integrated circuit modules respectively, or multiple modules or steps in them can be made into a single integrated circuit module to implement. In this way, the present application is not limited to any specific combination of hardware and software.

[0147] In addition, although exemplary embodiments have been described herein, the scope includes any and all embodiments based on the present application with equivalent elements, modifications, omissions, combinations (e.g., various embodiments intersecting schemes), adaptations or changes. The elements in the claims will be interpreted broadly based on the language adopted in the claims, and are not limited to the examples described in this specification or during the implementation of the application, and the examples will be interpreted as non-exclusive. Therefore, this specification and examples are intended to be considered as examples only, and the true scope and spirit are indicated by the following claims and the full scope of their equivalents.

[0148] The above description is intended to be illustrative rather than restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. For example, those of ordinary skill in the art can use other embodiments when reading the above description. In addition, in the above-mentioned specific embodiments, various features can be grouped together to simplify the application. This should not be interpreted as an intention that a disclosed feature that does not require protection is necessary for any claim. On the contrary, the subject matter of the present application may be less than all the features of a specific disclosed embodiment. Thus, the following claims are incorporated into the specific embodiments as examples or embodiments, wherein each claim is independently used as a separate embodiment, and it is considered that these embodiments can be combined with each other in various combinations or arrangements. The scope of the present application should be determined with reference to the attached claims and the full scope of equivalent forms granted by these claims.

[0149] Multiple embodiments of the present application are described in detail above, but the present application is not limited to these specific embodiments. Those skilled in the art can make various variations and modifications to the embodiments based on the concept of the present application, and these variations and modifications should all fall within the scope of protection required by the present application.

Claims

1. An interactive method, characterized in that: include: Obtaining current interaction information and long short-term memory information corresponding to the current interaction information, wherein the current interaction information and the long short-term memory information belong to the same user; Based on the long and short-term memory information, adjusting the interaction request included in the current interaction information so that the interaction request meets the expression requirement; Determining an interaction path corresponding to the interaction request; Generate response information corresponding to the interaction request according to the interaction path.

2. The interactive method according to claim 1, characterized in that: The current interaction information also includes interaction files, and the long-term and short-term memory information includes historical interaction information and the user portrait; The adjusting the interaction request included in the current interaction information based on the long short-term memory information includes: Based on the interaction file, the historical interaction information and the user portrait, the interaction request included in the current interaction information is adjusted.

3. The interactive method according to claim 1, characterized in that: The determining the interaction path corresponding to the interaction request includes: Performing semantic analysis on the interaction request to determine the interaction type of the interaction request; The interaction path is determined based on the interaction type, and interaction requests of different interaction types correspond to different interaction paths.

4. The interactive method according to claim 1, characterized in that: Generating response information corresponding to the interaction request according to the interaction path includes: Extracting key information of the interaction request; Based on the key information, the response information is generated by utilizing a local resource library and a network resource library.

5. The interactive method according to claim 4, characterized in that: The generating the response information based on the key information and utilizing the local resource library and the network resource library includes: Based on the key information, obtain N candidate information using a local resource library, and obtain M candidate information using a network resource library; Determine multiple target information from the N candidate information and the M candidate information; The response information is generated based on a plurality of target information.

6. The interactive method according to claim 5, characterized in that: The step of determining a plurality of target information from the N candidate information and the M candidate information includes: For each of the candidate information, calculating the relevance between the candidate information and the interaction request; According to the first order of the relevance from high to low, a plurality of target information are determined, each of the target information carries a unique identifier.

7. The interactive method according to claim 6, characterized in that: The generating the response information based on the multiple target information includes: The response information is generated based on all or part of the target information in the multiple target information, the target information in the response information carries a unique identifier, and a second order in which the target information in the response information appears is different from the first order.

8. The interactive method according to any one of claims 1 to 7, characterized in that: Also includes: The long short-term memory information is updated based on the response information.

9. An interactive device, characterized in that: include: An acquisition module configured to obtain current interaction information and long short-term memory information corresponding to the current interaction information, wherein the current interaction information and the long short-term memory information belong to the same user; an adjustment module, configured to adjust the interaction request included in the current interaction information based on the long short-term memory information, so that the interaction request meets the expression requirement; A determination module configured to determine an interaction path corresponding to the interaction request; A generating module is configured to generate response information corresponding to the interaction request according to the interaction path.

10. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via a bus, and when the machine-readable instructions are executed by the processor, the steps of the interaction method as described in any one of claims 1 to 8 are performed.

Citation Information

Patent Citations

  • Data processing method and server

    CN109582762A

  • Human-computer interaction method and device, electronic equipment and storage medium

    CN118098217A

  • Interaction method and device, equipment and storage medium

    CN118246540A

  • Initiating transportation requests

    US10349223B1