A method, apparatus and electronic device for multi-round conversation

By generating a knowledge matrix and generating responses based on knowledge types, the problem of multi-turn conversations in complex scenarios is solved, enabling effective information positioning and content output in the field of government affairs.

CN114328849BActive Publication Date: 2025-11-11BEIJING CAIZHI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202011058270.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-30
Publication Date
2025-11-11
Estimated Expiration
2040-09-30

AI Technical Summary

Technical Problem

Existing multi-turn conversation technologies are difficult to apply to complex scenarios, especially in knowledge-intensive and specialized fields such as government affairs, where users struggle to accurately provide the required information, making it impossible to locate the correct answer.

Method used

The knowledge matrix approach is used to generate a matrix containing multiple items and knowledge types, extract the knowledge points input by the user, generate a response based on the knowledge type, and so on until the target item is located and the corresponding content is output.

Benefits of technology

Even in complex scenarios, multi-turn dialogues can still be effectively achieved through the knowledge matrix, simplifying the generation process, eliminating the need to accurately determine entity relationships, and ensuring that deviations in knowledge point extraction do not affect the final result.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114328849B_ABST
    Figure CN114328849B_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, and electronic device for multi-turn conversations. The method includes: generating a knowledge matrix comprising multiple items, where each element represents a knowledge point corresponding to a specific knowledge type within that item; extracting the target knowledge point from the current round of information; generating a response for the current round when the target item in the knowledge matrix cannot be located based on the target knowledge points from all current rounds, until the target item is located based on the target knowledge points from all current rounds; and outputting the content result corresponding to the target item. The multi-turn conversation method, apparatus, and electronic device provided by this invention can generate a knowledge matrix with a simple structure; it does not require accurate entity identification, nor does it require attention to the relationships between entities, making the generation process simple. Even in complex application scenarios involving a large number of items, multi-turn dialogues can still be effectively implemented based on this knowledge matrix.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of multi-turn conversation technology, and more specifically, to a method, apparatus, electronic device, and computer-readable storage medium for multi-turn conversations. Background Technology

[0002] In the realm of multi-turn conversations, the most common application is still task-driven multi-turn dialogue, where users have a clear purpose, such as ordering food or tickets. Existing multi-turn conversations almost entirely rely on manually configuring each step of the dialogue, such as: setting keywords (or commands), creating slots, determining whether slots are selectable, selecting the corresponding dictionary, setting clarification phrases, and setting context change strategies. If complex logic is involved, careful planning is required for AND, OR, and NOT logic conditions. When dealing with multiple similar tasks, the debugging cost is extremely high.

[0003] To accommodate complex logic, multi-turn conversations can currently be implemented using knowledge graphs. However, knowledge graphs essentially represent relationships between entities; therefore, multi-turn conversation solutions based on knowledge graphs require extracting entities and determining the relationships between them. For simple scenarios like ordering food or tickets, entities are keywords or slots, and the relationships between entities are easy to define. In complex scenarios, however, it is difficult to determine the relationships between entities, and even more difficult to extract the entities themselves.

[0004] In some knowledge-intensive and specialized fields, such as government affairs, there are many complex matters. Users may not know what effective information they need to provide, which can lead to a certain degree of blindness in the questions they ask. Users may hit the wrong entity and fail to locate the answer they need. Summary of the Invention

[0005] To address the technical problem that existing multi-turn conversations are not applicable to complex scenarios, embodiments of the present invention provide a method, apparatus, electronic device, and computer-readable storage medium for multi-turn conversations.

[0006] In a first aspect, embodiments of the present invention provide a method for multi-turn conversations, including:

[0007] Generate a knowledge matrix, which includes multiple items, each item containing one or more knowledge points divided according to knowledge type, and the elements of the knowledge matrix represent the knowledge points in the corresponding item that correspond to the corresponding knowledge type;

[0008] Obtain the current round information input by the user in the current round, and extract the target knowledge points in the current round information; when the target knowledge points of all current rounds cannot locate the required target item in the knowledge matrix, generate the current round response based on other knowledge types besides the knowledge type to which the target knowledge point belongs;

[0009] Obtain the next round information input by the user based on the current round's reply, and extract the target knowledge points from the next round's information until the target matter is located based on the target knowledge points of all current rounds;

[0010] Output the content results corresponding to the target item.

[0011] Secondly, embodiments of the present invention also provide an apparatus for multi-turn conversations, comprising:

[0012] A matrix generation module is used to generate a knowledge matrix, which includes multiple items, each item containing one or more knowledge points divided according to knowledge type, and the elements of the knowledge matrix represent the knowledge points in the corresponding item that correspond to the corresponding knowledge type;

[0013] A multi-turn conversation module is used to obtain the current round information input by the user in the current round, extract the target knowledge points in the current round information; when the target knowledge points of all current rounds cannot locate the required target item in the knowledge matrix, generate the current round reply according to other knowledge types besides the knowledge type to which the target knowledge point belongs; obtain the next round information input by the user based on the current round reply, and extract the target knowledge points in the next round information, until the target item is located based on the target knowledge points of all current rounds;

[0014] The output module is used to output the content results corresponding to the target item.

[0015] Thirdly, embodiments of the present invention provide an electronic device, including a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor. The transceiver, the memory, and the processor are connected via the bus. When the computer program is executed by the processor, it implements the steps of the multi-turn session method described in any of the above.

[0016] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the multi-turn session method described in any one of the preceding claims.

[0017] The multi-turn dialogue method, apparatus, electronic device, and computer-readable storage medium provided in this invention record knowledge points of items according to matters and knowledge types, thereby generating a simple knowledge matrix. When generating the knowledge matrix, it is not necessary to accurately determine entities, nor is it necessary to focus on the relationships between entities, making the generation process simple. Furthermore, even if there are deviations in extracting knowledge points of items and determining the knowledge types of those knowledge points, it does not affect the final content determined for the user. Therefore, even in complex application scenarios involving a large number of items, where it is difficult to extract knowledge points according to a unified standard or accurately classify and determine knowledge types, multi-turn dialogue can still be effectively implemented based on this knowledge matrix. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the background art, the accompanying drawings used in the embodiments of the present invention or the background art will be described below.

[0019] Figure 1 A flowchart of a multi-turn conversation method provided by an embodiment of the present invention is shown;

[0020] Figure 2a This diagram illustrates a structural schematic of the knowledge matrix in the multi-turn conversation method provided by an embodiment of the present invention.

[0021] Figure 2b This illustration shows another structural diagram of the knowledge matrix in the multi-turn conversation method provided by an embodiment of the present invention;

[0022] Figure 3 A schematic diagram of the structure of a multi-turn conversation device provided in an embodiment of the present invention is shown;

[0023] Figure 4 A schematic diagram of an electronic device for performing a multi-turn session, provided by an embodiment of the present invention, is shown. Detailed Implementation

[0024] In the description of the embodiments of the present invention, those skilled in the art should understand that the embodiments of the present invention can be implemented as methods, apparatuses, electronic devices, and computer-readable storage media. Therefore, the embodiments of the present invention can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software. Furthermore, in some embodiments, the embodiments of the present invention can also be implemented as a computer program product in one or more computer-readable storage media, the computer-readable storage media containing computer program code.

[0025] The aforementioned computer-readable storage medium may be any combination of one or more computer-readable storage media. Computer-readable storage media include: electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, optical disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any combination thereof. In embodiments of the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0026] The computer program code contained in the aforementioned computer-readable storage medium may be transmitted using any suitable medium, including wireless, wire, optical fiber, radio frequency (RF), or any suitable combination thereof.

[0027] Computer program code for performing the operations of the embodiments of the present invention can be written in assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, integrated circuit configuration data, or in one or more programming languages ​​or combinations thereof. The programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The computer program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer or an external computer via any type of network, including a local area network (LAN) or a wide area network (WAN).

[0028] The embodiments of the present invention describe the provided methods, apparatus, and electronic devices through flowcharts and / or block diagrams.

[0029] It should be understood that each block of a flowchart and / or block diagram, as well as combinations of blocks in a flowchart and / or block diagram, can be implemented by computer-readable program instructions. These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine that, when executed by a computer or other programmable data processing apparatus, creates means for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.

[0030] These computer-readable program instructions may also be stored in a computer-readable storage medium that enables a computer or other programmable data processing device to function in a particular manner. In this way, the instructions stored in the computer-readable storage medium produce an instruction apparatus product that includes the functions / operations specified in the blocks of a flowchart and / or block diagram.

[0031] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus or other device to produce a computer-implemented process, such that the instructions that execute on the computer or other programmable data processing apparatus provide a process for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.

[0032] The embodiments of the present invention will now be described with reference to the accompanying drawings.

[0033] Figure 1 A flowchart illustrating a multi-turn session method provided by an embodiment of the present invention is shown. Figure 1 As shown, the method includes:

[0034] Step 101: Generate a knowledge matrix. The knowledge matrix includes multiple items, and each item contains one or more knowledge points divided according to knowledge type. The elements of the knowledge matrix represent the knowledge points in the corresponding item that correspond to the corresponding knowledge type.

[0035] In this embodiment of the invention, keywords involved in multi-turn conversations are represented in matrix form. Specifically, in complex scenarios such as government affairs, users essentially need to find the content they require, and this content generally has a corresponding title or summary. In this embodiment, the title or summary of the content is referred to as a "matter," meaning each matter corresponds to one piece of content. When the user's input information determines which matter the user is interested in, the content corresponding to that matter, i.e., the content result, can be output. In this embodiment, each matter contains one or more key pieces of information, i.e., knowledge points. The knowledge points of each matter are represented by an array structure, so a matrix formed by multiple array structures can represent all knowledge points of all matters. Simultaneously, each knowledge point has a knowledge type attribute. Knowledge points with the same knowledge type are placed as a row or column of the matrix, thus forming a knowledge matrix. One form of this knowledge matrix can be found in [reference needed]. Figure 2a As shown.

[0036] Figure 2aThe knowledge matrix is ​​formed by using items as rows and knowledge points as columns. This matrix contains 8 items, with each row corresponding to one item. All knowledge points for each item are categorized into five types: A, B, C, D, and E, resulting in an 8×5 knowledge matrix. The elements of this knowledge matrix represent the knowledge points within each item that correspond to the specific knowledge type. Figure 2a The element a1 in the first row and first column represents the knowledge point in item 1 that corresponds to knowledge type A. If an element is empty, it means that the item does not have a knowledge point belonging to the corresponding knowledge type; for example, if the element in the first row and second column is empty, it means that item 1 does not have a knowledge point belonging to knowledge type B. In addition, under the same knowledge type, different items can have the same knowledge points; for example, a1, a2, and a3 can be the same.

[0037] This embodiment uses a matrix of information (i.e., a knowledge matrix) to achieve multi-turn conversations. This knowledge matrix records corresponding knowledge points according to items and knowledge types, resulting in a simple structure. Furthermore, during the generation of the knowledge matrix, knowledge points for each item can be determined through word segmentation and semantic recognition, allowing for the summarization of different knowledge types. The process of generating the knowledge matrix is ​​also simple. Unlike knowledge graphs, generating a knowledge matrix does not require accurate entity identification or consideration of relationships between entities. Moreover, even if differences in extraction methods lead to different extracted knowledge points, it does not affect the subsequent unique location of the corresponding item based on the knowledge points. Two similar knowledge points from different items, even if not classified into the same knowledge type, do not affect the multi-turn conversation results. For example, see [link to example]. Figure 2a As shown, if the difference between item 3 and item 4 lies in the difference between a3 and a4, i.e., b3 = b4 and c3 = c4, then even if d3 and e4 are two similar knowledge points, although they are classified into knowledge type D and knowledge type E, it is still possible to determine whether the knowledge point the user is interested in is a3 or a4 based on the user's input information, i.e., whether the user is interested in item 3 or item 4. Therefore, even if there are deviations in extracting the knowledge points of items and determining the knowledge type of knowledge points, it will not affect the final content determined by the user. In complex application scenarios, because there are many items, it is difficult to extract the knowledge points of items according to a unified standard, and it is also difficult to accurately classify the knowledge points to determine the knowledge type. However, multi-turn dialogue can still be well implemented based on this knowledge matrix.

[0038] Step 102: Obtain the current round information input by the user in the current round, and extract the target knowledge points in the current round information; if the target item required in the knowledge matrix cannot be located based on the target knowledge points of all rounds in the current round, generate the current round response based on other knowledge types besides the knowledge type to which the target knowledge point belongs.

[0039] Step 103: Obtain the information for the next round based on the user's reply in the current round, and extract the target knowledge points from the next round of information until the target matter is located based on the target knowledge points of all rounds.

[0040] In this embodiment of the invention, users can obtain the content they need through multi-round conversations. In each round, the user inputs relevant information, such as a question. Specifically, in the current round, the user inputs the current round's information. At this time, the knowledge points contained in the current round's information, i.e., the target knowledge points, can be extracted based on word segmentation, semantic recognition, and other methods. These target knowledge points are then matched against a knowledge matrix. If the required target item in the knowledge matrix can be located, it means that the required content can be located based on all the target knowledge points input by the user, and the user does not need to submit any more information, i.e., there is no need to continue the multi-round conversation. Conversely, if the target item in the knowledge matrix cannot be located based on all the target knowledge points obtained so far, it means that the information provided by the user is insufficient. In the current round, a response can be generated to instruct and guide the user to input information based on this response, i.e., the next round's information. Similar to the current round's information, the next round's information can also contain target knowledge points, and it is again determined whether the target item can be located. This multi-round conversation process is repeated until the target item in the knowledge matrix is ​​located.

[0041] In this embodiment of the invention, the target item is the item currently needed by the user. The target item is not predetermined and may differ in different multi-round sessions. Specifically, the determination of whether the required target item has been located can be based on the number of items that can be located currently. In this embodiment, when the number of items located based on the target knowledge points across all rounds exceeds a preset threshold, it is considered that the required target item in the knowledge matrix cannot be located at present. For example, if the preset threshold is set to 2, and the user can still identify more than two items after inputting information in the current round, it indicates that the user's input information is insufficient, and another round of session is needed to guide the user to input more information; if the user can locate fewer than two items after inputting information in the current round, or even locate a unique item, it can be considered that the target item has been located, and the multi-round session ends. If the preset threshold is 1, the multi-round session can only end when a unique item in the knowledge matrix is ​​located.

[0042] Alternatively, among the items located based on the target knowledge points across all rounds, if at least two (or all) knowledge points in other knowledge types (excluding the target knowledge point's own knowledge type) correspond to overlapping items, then it is also considered that the target item required in the knowledge matrix cannot be located based on the target knowledge points across all rounds. Otherwise, if there is no overlap, meaning that at least two (or all) knowledge points in other knowledge types correspond to completely different items, then it indicates that generating the current round's response based on one knowledge type is insufficient to cover all possibilities. In this case, it is not suitable to continue with multiple rounds of conversation, and therefore, it is considered that the target item has been located. Figure 2a As shown, if the knowledge points corresponding to items 3, 4, and 7 of knowledge types A, B, and C are all the same (i.e., a3, a4, and a7 are the same; b3, b4, and b7 are the same; c3, c4, and c7 are the same), and items 3, 4, and 7 can be located based on knowledge types A, B, and C, but no current round of responses has been generated based on knowledge types D and E yet; since knowledge points d3 and d7 of knowledge type D correspond to items 3 and 7, while knowledge point e4 of knowledge type E corresponds to item 4, meaning that the knowledge points of knowledge types D and E correspond to different items, the session ends, and items 3, 4, and 7 become the target items. Simultaneously, when "generating the current round of responses based on knowledge types other than the knowledge type to which the target knowledge point belongs," it is necessary to generate the current round of responses based on knowledge types other than the knowledge type to which the target knowledge point belongs, excluding knowledge types whose knowledge points correspond to items that are distinct from those of another knowledge type. In another example, if knowledge points a3, a4, and a7 are the same, and knowledge points b3, b4, and b7 are the same, and the current items 3, 4, and 7 are located based on knowledge types A and B, then since the knowledge points of knowledge types D and E correspond to different items, the current round of responses can only be generated based on knowledge type C.

[0043] Furthermore, when generating the current round of responses, it is necessary to base it on a knowledge type other than the knowledge type to which the target knowledge point belongs. Specifically, when determining the knowledge type, a semantically meaningful name can be defined for that knowledge type. The current round of responses can then be generated based on this semantically meaningful knowledge type. For example, if a knowledge point belonging to a certain knowledge type is "adult" or "minor," which is related to age, the knowledge type can be defined as "age." When generating the current round of responses based on this knowledge type, the current round of responses could be "How old are you?" Alternatively, the current round of responses can also be generated based on knowledge points corresponding to other knowledge types. In this case, the knowledge type can only have an ID representation. Again, using the knowledge points "adult" and "minor" as an example, the knowledge type could be "Knowledge Type A," and the current round of responses could be a selection-based response, such as "Are you an adult or a minor?".

[0044] Step 104: Output the content results corresponding to the target item.

[0045] In this embodiment of the invention, after multiple rounds of conversation, i.e., after the user has input multiple times of information, if the target item can be located, the content result corresponding to the target item can then be input and displayed to the user. The content result corresponding to the target item can be the target item itself, or more detailed content related to the target item.

[0046] This invention provides a method for multi-turn conversations that records knowledge points of items according to matters and knowledge types, thereby generating a simple knowledge matrix. When generating the knowledge matrix, it is not necessary to accurately determine entities or focus on the relationships between entities, making the generation process simple. Furthermore, even if there are deviations in extracting knowledge points of items and determining the knowledge types of those knowledge points, it does not affect the final content determined for the user. Therefore, even in complex application scenarios with a large number of items, where it is difficult to extract knowledge points according to a unified standard or accurately classify and determine knowledge types, this knowledge matrix can still effectively facilitate multi-turn conversations.

[0047] Based on the above embodiments, step 101 "generating a knowledge matrix" specifically includes:

[0048] Step A1: Obtain multiple items and extract one or more knowledge points contained in each item.

[0049] In this embodiment of the invention, multiple user-focused items are acquired, and the knowledge points contained in each item are extracted based on keyword extraction, semantic recognition, and other methods. To simplify the structure of the knowledge matrix, a knowledge matrix can be defined for items under the same theme, i.e., one knowledge matrix corresponds to one subject. Specifically, all items can be clustered to classify them, so that each category corresponds to a theme. Then, a knowledge matrix for each theme can be generated based on all items corresponding to that theme.

[0050] For example, the topic of social assistance involves 17 items, as shown in Table 1 below. Taking the first item as an example, the knowledge points can include "identification", "minimum living allowance recipients", and "urban; rural". In addition, the knowledge points can be expanded with synonyms. For example, "confirmation" is a synonym of "identification", so the knowledge point "identification" can be expanded to "identification / confirmation".

[0051] Table 1

[0052] Item ID matter 1 Identification of urban and rural minimum living allowance recipients 2 Identification of low-income families in urban and rural areas 3 Identification of people in extreme poverty 4 Identification of Temporary Assistance Recipients 5 Confirmation of those receiving urban residents' living allowance for those in financial difficulty 6 Rescue and management of homeless and begging people in cities 7 Special relief allowance payment 8 Minimum living allowance payment 9 Special hardship assistance and support fund payment 10 Distribute living allowances to urban residents in financial difficulty 11 Increase, decrease, or suspend minimum living allowance payments and stop social assistance. 12 Payments will be made to social assistance recipients for higher education enrollment. 13 Clean energy self-heating subsidies will be provided to eligible social assistance recipients. 14 Eligible social assistance recipients will receive subsidies for coal-fired self-heating. 15 Central heating subsidies will be provided to low-income and scattered destitute individuals. 16 Price subsidies, gas subsidies, and relief funds for people in need 17 Regularly verify the social assistance recipients

[0053] Step A2: Classify all knowledge points and determine the knowledge type corresponding to each category of knowledge points.

[0054] In this embodiment of the invention, knowledge types can be preset, and knowledge points can be classified based on these knowledge types; or, in complex scenarios where it is difficult to define knowledge types, knowledge points can be directly classified, for example, by using clustering; after classification, the corresponding knowledge types can be determined.

[0055] Step A3: Generate an M×N or N×M knowledge matrix, where M is the number of items and N is the number of knowledge types.

[0056] In this embodiment, after determining the knowledge points of all items and the knowledge types to which the knowledge points belong, a knowledge matrix can be generated. In this embodiment, an M×N knowledge matrix can be generated with items as rows and knowledge types as columns, or an N×M knowledge matrix can be generated with knowledge types as rows and items as columns. A representation of a knowledge matrix corresponding to Table 1 above is shown in Table 2, where rows represent items and columns represent knowledge types. Furthermore, in this embodiment, the knowledge types in the knowledge matrix are only used to distinguish different categories of knowledge points, such as knowledge type 1, knowledge type 2, etc.; the knowledge type can also have semantic meaning, such as knowledge type 3 in Table 2 being "social security object". In addition, Table 2 uses aspect descriptions, grouping some different types of knowledge points into the same knowledge type, such as grouping "urban; rural" and "subsidy" into knowledge type 4. Generally, only knowledge points with lower priority or importance can be grouped into the same knowledge type.

[0057] Table 2

[0058]

[0059]

[0060] Optionally, if a corresponding knowledge matrix is ​​generated for each topic, then after step 101 "generating the knowledge matrix" above, the method further includes:

[0061] Step B1: Determine the matrix entry point for each knowledge matrix. The matrix entry point includes multiple keywords extracted from the knowledge matrix.

[0062] After step 102, "extracting the target knowledge points from the current round of information", the method further includes:

[0063] Step B2: When the current round of information is the first round of information, match the target knowledge points of the first round of information with each matrix entry, and use the knowledge matrix corresponding to the matched matrix entry as the basis for generating the current round of responses.

[0064] In this embodiment of the invention, when multiple knowledge matrices exist, a simplified matrix entry is set for each knowledge matrix. Based on this matrix entry, it is determined which knowledge matrix best matches the user's input information, facilitating the rapid location of the required knowledge matrix from multiple knowledge matrices. Specifically, in the first round (i.e., the initial round) of a multi-round conversation, the user inputs valid information for the first time, i.e., the initial round information. At this time, the matching knowledge matrix can be located based on this initial round information. If the user inputs useless information, such as "hello," this process is not considered part of the multi-round conversation in this embodiment; that is, the invalid information input by the user at this time is not the initial round information.

[0065] Based on the above embodiments, step 102, "generating the current round response based on knowledge types other than the knowledge type to which the target knowledge point belongs," includes:

[0066] Step C1: Treat all knowledge types other than the knowledge type to which the target knowledge point belongs as undetermined knowledge types.

[0067] Step C2: Determine the priority of each pending knowledge type, take the pending knowledge type with the highest priority as the target knowledge type, and generate the current round of responses based on the target knowledge type.

[0068] In this embodiment of the invention, the priority of each knowledge type can be predetermined. For example, the fewer text types corresponding to a knowledge type, the higher the probability that users will exclude more knowledge points they are not interested in when inputting knowledge points under that knowledge type. Fewer text types also make it easier for users to select, thus the priority of that knowledge type can be higher. Here, the text types of knowledge points refer to the categories determined by classifying knowledge points according to their textual similarities and differences. For example, in knowledge type 3 of Table 2, the knowledge points of items 1 and 8 are both "minimum living allowance recipients," and since their texts are identical, they belong to the same text category. Accordingly, knowledge type 3 can be divided into multiple text categories such as "minimum living allowance," "low-income families," "people in extreme poverty," and "temporary assistance recipients." Alternatively, the more easily understood the knowledge points corresponding to a knowledge type, the easier it is for users to accurately input the knowledge points under that knowledge type, thus the higher the priority of that knowledge type. Other methods can also be used to determine the priority of knowledge types, and are not limited here. In this embodiment, the highest priority pending knowledge type is used as the target knowledge type to generate the current round of response, making it easier for users to input key knowledge points in the next round, facilitating quick location of the target matter, and simplifying the number of rounds and process of multi-round conversations.

[0069] Furthermore, those skilled in the art will understand that when determining the type of knowledge to be determined, it is necessary to exclude all knowledge types to which the target knowledge points belong in all current rounds. For example... Figure 2aAs shown, in a multi-round conversation, if knowledge type A is determined in the first round, and knowledge type B is taken as the target knowledge type in the second round, then in the third round, knowledge types other than knowledge types A and B (i.e., knowledge types C, D, and E) can all be taken as undetermined knowledge types.

[0070] by Figure 2b For example, Figure 2b Different letters and symbols represent different knowledge points. In the first round, if the user inputs knowledge point a1, the current round's response can be generated as knowledge type C, and [c1, c2] can be output for the user to choose from; if the user inputs knowledge point a2, [b4, b6, b7] can be output; if the user inputs both a2 and b4 at once, item 5 can be uniquely located, and the conversation ends. If the user's input does not contain any knowledge points, [a1, a2, a3] can be output for the user to choose from. To illustrate with a complete conversation process: in the first round, if the user inputs knowledge point a1, the output is [c1, c2]; in the second round, if the user inputs knowledge point c2, the output is [b3, b4]; in the third round, if the user inputs knowledge point b3, item 3 can be located, which is the user's target item.

[0071] Optionally, after step C2 "Generate the current round response based on the target knowledge type" above, the method further includes:

[0072] Step C3: Select some or all of the knowledge points corresponding to the target knowledge type as candidate options and display the candidate options.

[0073] In this embodiment of the invention, by displaying knowledge points of the target knowledge type, users can input information in a selective manner, which reduces the requirements for users and allows them to input more accurate information.

[0074] This invention provides a method for multi-turn conversations that records knowledge points of items according to matters and knowledge types, thereby generating a simple knowledge matrix. When generating the knowledge matrix, it is not necessary to accurately determine entities or focus on the relationships between entities, making the generation process simple. Furthermore, even if there are deviations in extracting knowledge points of items and determining the knowledge types of those knowledge points, it does not affect the final content determined for the user. Therefore, even in complex application scenarios with a large number of items, where it is difficult to extract knowledge points according to a unified standard or accurately classify knowledge points to determine their types, this knowledge matrix can still effectively facilitate multi-turn conversations. The highest-priority pending knowledge type is used as the target knowledge type to generate the current round's response, making it easier for the user to input key knowledge points in the next round, facilitating quick location of the target matter, and simplifying the number of rounds and the process of multi-turn conversations.

[0075] The method for multi-turn conversations provided by the embodiments of the present invention has been described in detail above. This method can also be implemented by a corresponding device. The device for multi-turn conversations provided by the embodiments of the present invention will be described in detail below.

[0076] Figure 3 A schematic diagram of the structure of a multi-turn conversation device provided by an embodiment of the present invention is shown. Figure 3 As shown, the apparatus for this multi-turn session includes:

[0077] The matrix generation module 31 is used to generate a knowledge matrix, which includes multiple items, each item containing one or more knowledge points divided according to knowledge type, and the elements of the knowledge matrix represent the knowledge points in the corresponding item that correspond to the corresponding knowledge type.

[0078] The multi-turn conversation module 32 is used to obtain the current round information input by the user in the current round, extract the target knowledge points in the current round information; when the target knowledge points of all current rounds cannot locate the target item in the knowledge matrix, generate the current round reply according to other knowledge types besides the knowledge type to which the target knowledge point belongs; obtain the next round information input by the user based on the current round reply, and extract the target knowledge points in the next round information, until the target item is located based on the target knowledge points of all current rounds;

[0079] Output module 33 is used to output the content result corresponding to the target item.

[0080] Based on the above embodiments, the matrix generation module 31 generates a knowledge matrix including:

[0081] Retrieve multiple items and extract one or more knowledge points contained in each item;

[0082] All the knowledge points are classified, and the knowledge type corresponding to each category is determined;

[0083] Generate an M×N or N×M knowledge matrix, where M is the number of items and N is the number of knowledge types.

[0084] Based on the above embodiments, the multi-turn conversation module 32 generates the current round response based on knowledge types other than the knowledge type to which the target knowledge point belongs, including:

[0085] Other knowledge types besides the knowledge type to which the target knowledge point belongs are designated as undetermined knowledge types.

[0086] Determine the priority of each of the pending knowledge types, take the pending knowledge type with the highest priority as the target knowledge type, and generate the current round of responses based on the target knowledge type.

[0087] Based on the above embodiments, after generating the current round response according to the target knowledge type, the multi-turn conversation module 32 is further configured to:

[0088] Select some or all of the knowledge points corresponding to the target knowledge type as candidate options and display the candidate options.

[0089] Based on the above embodiments, the matrix generation module 31 generates a knowledge matrix including:

[0090] Multiple items are acquired and clustered to determine the theme of each category of items; a knowledge matrix corresponding to the theme is generated based on all items in each category.

[0091] Based on the above embodiments, after generating the knowledge matrix, the matrix generation module 31 is further configured to:

[0092] Determine the matrix entry point for each of the knowledge matrices, wherein the matrix entry point includes multiple keywords extracted from the knowledge matrix;

[0093] After extracting the target knowledge points from the current round of information, the multi-round conversation module 32 is further used for:

[0094] When the current round of information is the first round of information, the target knowledge points of the first round of information are matched with each of the matrix entries, and the knowledge matrix corresponding to the matched matrix entry is used as the basis for generating the current round of response.

[0095] This invention provides a multi-turn conversation apparatus that records knowledge points of items according to matters and knowledge types, thereby generating a simple knowledge matrix. When generating the knowledge matrix, it is not necessary to accurately determine entities or focus on the relationships between entities, making the generation process simple. Furthermore, even if there are deviations in extracting knowledge points of matters and determining the knowledge types of those knowledge points, it does not affect the final content determined for the user. Therefore, even in complex application scenarios with a large number of matters, where it is difficult to extract knowledge points according to a unified standard or accurately classify knowledge points to determine their types, this knowledge matrix can still effectively facilitate multi-turn conversations. By using the highest-priority pending knowledge type as the target knowledge type to generate the current round's response, it makes it easier for the user to input key knowledge points in the next round, facilitating quick location of the target matter and simplifying the number of rounds and the process of multi-turn conversations.

[0096] Furthermore, embodiments of the present invention also provide an electronic device, including a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor. The transceiver, the memory, and the processor are respectively connected via the bus. When the computer program is executed by the processor, it implements the various processes of the above-described multi-turn session method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0097] For details, see Figure 4 As shown, this embodiment of the invention also provides an electronic device, which includes a bus 1110, a processor 1120, a transceiver 1130, a bus interface 1140, a memory 1150, and a user interface 1160.

[0098] In this embodiment of the invention, the electronic device further includes a computer program stored in a memory 1150 and executable on a processor 1120, wherein the computer program, when executed by the processor 1120, implements the various processes of the method embodiment described above for multi-turn sessions.

[0099] Transceiver 1130 is used to receive and send data under the control of processor 1120.

[0100] In this embodiment of the invention, a bus architecture (represented by bus 1110) is used. Bus 1110 may include any number of interconnected buses and bridges. Bus 1110 connects various circuits, including one or more processors represented by processor 1120 and memory represented by memory 1150.

[0101] Bus 1110 represents one or more of several types of bus architectures, including memory buses and memory controllers, peripheral buses, Accelerated Graphics Port (AGP), processors, or local buses using any bus architecture from various bus architectures. As an example and not a limitation, such architectures include: Industry Standard Architecture (ISA) buses, Micro Channel Architecture (MCA) buses, Enhanced ISA (EISA) buses, Video Electronics Standards Association (VESA) buses, and Peripheral Component Interconnect (PCI) buses.

[0102] The processor 1120 can be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor hardware or by instructions in software form. The processors mentioned above include: general-purpose processors, central processing units (CPUs), network processors (NPs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), complex programmable logic devices (CPLDs), programmable logic arrays (PLAs), microcontroller units (MCUs) or other programmable logic devices, discrete gates, transistor logic devices, and discrete hardware components. They can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. For example, the processor can be a single-core processor or a multi-core processor, and the processor can be integrated on a single chip or located on multiple different chips.

[0103] Processor 1120 can be a microprocessor or any conventional processor. The method steps disclosed in the embodiments of the present invention can be directly executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in readable storage media known in the art, such as Random Access Memory (RAM), Flash Memory, Read-Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), registers, etc. The readable storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.

[0104] Bus 1110 can also connect various other circuits, such as peripheral devices, voltage regulators, or power management circuits. Bus interface 1140 provides an interface between bus 1110 and transceiver 1130, all of which are well known in the art. Therefore, embodiments of the present invention will not be described further.

[0105] Transceiver 1130 can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. For example, transceiver 1130 receives external data from other devices, and transceiver 1130 is used to send data processed by processor 1120 to other devices. Depending on the nature of the computer system, a user interface 1160 may also be provided, such as a touchscreen, physical keyboard, monitor, mouse, speaker, microphone, trackball, joystick, or stylus.

[0106] It should be understood that, in embodiments of the present invention, memory 1150 may further include memory remotely configured relative to processor 1120, and such remotely configured memory can be connected to a server via a network. One or more portions of the aforementioned network may be an ad hoc network, intranet, extranet, virtual private network (VPN), local area network (LAN), wireless local area network (WLAN), wide area network (WAN), wireless wide area network (WWAN), metropolitan area network (MAN), Internet, public switched telephone network (PSTN), ordinary old-style telephone service (POTS), cellular telephone network, wireless network, Wi-Fi network, and combinations of two or more of the aforementioned networks. For example, cellular telephone networks and wireless networks can be Global System for Mobile Communications (GSM), Code Division Multiple Access (CDMA), WiMAX, General Packet Radio Service (GPRS), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), LTE Frequency Division Duplex (FDD), LTE Time Division Duplex (TDD), Advanced Long Term Evolution (LTE-A), Universal Mobile Telecommunications System (UMTS), Enhanced Mobile Broadband (eMBB), Massive Machine Type Communication (mMTC), Ultra Reliable Low Latency Communications (uRLLC), etc.

[0107] It should be understood that the memory 1150 in the embodiments of the present invention may be volatile memory or non-volatile memory, or may include both volatile memory and non-volatile memory. Non-volatile memory includes: read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory.

[0108] Volatile memory includes random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1150 of the electronic device described in this embodiment includes, but is not limited to, the above-described and any other suitable types of memory.

[0109] In this embodiment of the invention, the memory 1150 stores the following elements of the operating system 1151 and the application 1152: executable modules, data structures, or subsets thereof, or extended sets thereof.

[0110] Specifically, the operating system 1151 includes various system programs, such as a framework layer, a core library layer, and a driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 1152 includes various applications, such as a media player and a browser, used to implement various application functions. Programs implementing the methods of this embodiment of the invention can be included in the application program 1152. The application program 1152 includes applets, objects, components, logic, data structures, and other computer system executable instructions that perform specific tasks or implement specific abstract data types.

[0111] Furthermore, embodiments of the present invention also provide a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the various processes of the above-described multi-turn session method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0112] Computer-readable storage media include: permanent and non-permanent, removable and non-removable media, which are tangible devices capable of retaining and storing instructions for use by an instruction execution device. Computer-readable storage media include: electronic storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, and any suitable combination thereof. Computer-readable storage media include: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, optical disc read-only memory (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape storage, magnetic disk storage or other magnetic storage devices, memory sticks, mechanical encoding devices (e.g., punched cards or raised structures in grooves on which instructions are recorded), or any other non-transfer medium that can be used to store information accessible by a computing device. As defined in the embodiments of the present invention, computer-readable storage media do not include temporary signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses passing through fiber optic cables), or electrical signals transmitted through wires.

[0113] In the several embodiments provided in this application, it should be understood that the disclosed apparatus, electronic devices, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, or it may be an electrical, mechanical, or other form of connection.

[0114] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to solve the problems addressed by the embodiments of the present invention, depending on actual needs.

[0115] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0116] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (including: a personal computer, a server, a data center, or other network device) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media listed above that can store program code.

[0117] The above description is merely a specific implementation of the embodiments of the present invention, but the protection scope of the embodiments of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of the present invention should be included within the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention should be determined by the protection scope of the claims.

Claims

1. A method for multi-turn conversations, characterized in that, include: Generate a knowledge matrix, which includes multiple items, each item containing one or more knowledge points divided according to knowledge type, and the elements of the knowledge matrix represent the knowledge points in the corresponding item that correspond to the corresponding knowledge type; The generated knowledge matrix includes: Retrieve multiple items and extract one or more knowledge points contained in each item; All the knowledge points are classified, and the knowledge type corresponding to each category is determined; Generate an M×N or N×M knowledge matrix, where M is the number of items and N is the number of knowledge types; Obtain the current round information input by the user in the current round, and extract the target knowledge points in the current round information; if the target knowledge points in all current rounds cannot locate the required target item in the knowledge matrix, other knowledge types besides the knowledge type to which the target knowledge point belongs are regarded as undetermined knowledge types; The priority of each pending knowledge type is determined based on the number of text types corresponding to the knowledge points of the knowledge type, or based on the semantic clarity of the knowledge points corresponding to the knowledge type. The pending knowledge type with the highest priority is taken as the target knowledge type, and the current round of responses is generated based on the target knowledge type. The text types are categories determined by classifying the text differences of the knowledge points. Obtain the next round information input by the user based on the current round's reply, and extract the target knowledge points from the next round's information until the target matter is located based on the target knowledge points of all current rounds; Output the content results corresponding to the target item.

2. The method according to claim 1, characterized in that, After generating the current round response based on the target knowledge type, the method further includes: Select some or all of the knowledge points corresponding to the target knowledge type as candidate options and display the candidate options.

3. The method according to claim 1 or 2, characterized in that, The generated knowledge matrix includes: Multiple items are acquired and clustered to determine the theme of each category of items; a knowledge matrix corresponding to the theme is generated based on all items in each category.

4. The method according to claim 3, characterized in that, Following the generation of the knowledge matrix, the following is also included: Determine the matrix entry point for each of the knowledge matrices, wherein the matrix entry point includes multiple keywords extracted from the knowledge matrix; After extracting the target knowledge points from the current round of information, the process further includes: When the current round of information is the first round of information, the target knowledge points of the first round of information are matched with each of the matrix entries, and the knowledge matrix corresponding to the matched matrix entry is used as the basis for generating the current round of response.

5. A device for multi-turn conversations, characterized in that, include: A matrix generation module is used to generate a knowledge matrix, which includes multiple items, each item containing one or more knowledge points divided according to knowledge type, and the elements of the knowledge matrix represent the knowledge points in the corresponding item that correspond to the corresponding knowledge type; The generated knowledge matrix includes: Retrieve multiple items and extract one or more knowledge points contained in each item; All the knowledge points are classified, and the knowledge type corresponding to each category is determined; Generate an M×N or N×M knowledge matrix, where M is the number of items and N is the number of knowledge types; The multi-turn conversation module is used to obtain the current-turn information input by the user in the current turn, and extract the target knowledge points from the current-turn information; when the target knowledge points from all current turns cannot locate the required target item in the knowledge matrix... Other knowledge types besides the knowledge type to which the target knowledge point belongs are designated as undetermined knowledge types. Based on the number of text types corresponding to the knowledge points of a knowledge type, or based on the semantic clarity of the knowledge points corresponding to the knowledge type, the priority of each pending knowledge type is determined. The pending knowledge type with the highest priority is taken as the target knowledge type, and the current round of responses is generated based on the target knowledge type. The text types are categories determined by classifying the text differences of knowledge points. The next round of information input by the user based on the current round of responses is obtained, and the target knowledge points in the next round of information are extracted until the target matter is located based on the target knowledge points of all current rounds. The output module is used to output the content results corresponding to the target item.

6. An electronic device comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory, and the processor are connected via the bus, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for a multi-turn session as described in any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for a multi-turn session as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and device for implementation of intelligent robot applicable to multiple service scenes

    CN107247726A

  • Multi-round conversation process configuration unit, method and intelligent robot interaction system

    CN108804643A

  • Data processing method and device based on multiple rounds of conversations

    CN110222049A