Conversational processing method, apparatus, and electronic device

CN117421402BActive Publication Date: 2026-10-16BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311311439.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-10
Publication Date
2026-10-16
Estimated Expiration
2043-10-10

AI Technical Summary

Technical Problem

但目前的问答对话模型,在生成答案时,只考虑当前问题中的信息,导致生成的答案的准确度低

Benefits of technology

[0009] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117421402B_ABST
    Figure CN117421402B_ABST
Patent Text Reader

Abstract

The present disclosure provides a dialogue processing method and device and electronic equipment, relates to the technical field of artificial intelligence, in particular to the technical field of deep learning, natural language processing, intelligent search and the like. The specific implementation scheme is as follows: a current question in a current dialogue process is acquired, and a dialogue object corresponding to the current question is acquired; short-term historical dialogue in the current dialogue process is acquired; long-term historical dialogue matched with the current question in a historical dialogue process of the dialogue object is acquired; and an answer corresponding to the current question is determined according to the current question, the short-term historical dialogue and the long-term historical dialogue, so that when the answer is generated, relevant information in the current dialogue process and the historical dialogue process is considered in addition to information in the current question, and the accuracy of the generated answer is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, particularly to the fields of deep learning, natural language processing, and intelligent search, and especially to a dialogue processing method, apparatus, and electronic device. Background Technology

[0002] Current dialogue processing methods employ question-and-answer dialogue models. These models are complex systems built upon massive amounts of data and powerful algorithms, designed to simulate human intelligence. They learn to extract useful information and knowledge from large datasets to generate answers. However, current question-and-answer models only consider information from the current question when generating answers, resulting in low accuracy. Summary of the Invention

[0003] This disclosure provides a dialogue processing method, apparatus, and electronic device.

[0004] According to one aspect of this disclosure, a dialogue processing method is provided, the method comprising: obtaining a current question in a current dialogue process and a dialogue object corresponding to the current question; obtaining short-term historical dialogues in the current dialogue process; obtaining long-term historical dialogues in the historical dialogue process of the dialogue object that match the current question; and determining an answer corresponding to the current question based on the current question, the short-term historical dialogues, and the long-term historical dialogues.

[0005] According to another aspect of this disclosure, a dialogue processing apparatus is provided, the apparatus comprising: a first acquisition module, configured to acquire a current question in a current dialogue process and a dialogue object corresponding to the current question; a second acquisition module, configured to acquire short-term historical dialogues in the current dialogue process; a third acquisition module, configured to acquire long-term historical dialogues in the historical dialogue process of the dialogue object that match the current question; and a first determination module, configured to determine the answer corresponding to the current question based on the current question, the short-term historical dialogues, and the long-term historical dialogues.

[0006] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the dialogue processing method proposed above in this disclosure.

[0007] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the dialogue processing method described above.

[0008] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the dialogue processing method proposed above in this disclosure.

[0009] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0010] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0011] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure;

[0012] Figure 2 This is a schematic diagram according to the second embodiment of the present disclosure;

[0013] Figure 3 This is a flowchart illustrating the dialogue processing procedure;

[0014] Figure 4 This is a schematic diagram according to the third embodiment of the present disclosure;

[0015] Figure 5 This is a block diagram of an electronic device used to implement the dialogue processing method of the embodiments of this disclosure. Detailed Implementation

[0016] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0017] Current dialogue processing methods employ question-and-answer dialogue models. These models are complex systems built upon massive amounts of data and powerful algorithms, designed to simulate human intelligence. They learn to extract useful information and knowledge from large datasets to generate answers. However, current question-and-answer models only consider information from the current question when generating answers, resulting in low accuracy.

[0018] To address the aforementioned issues, this disclosure proposes a dialogue processing method, apparatus, and electronic device.

[0019] Figure 1This is a schematic diagram based on the first embodiment of the present disclosure. It should be noted that the dialogue processing method of the present disclosure can be applied to a dialogue processing device, which can be installed in an electronic device so that the electronic device can perform dialogue processing functions.

[0020] Among them, electronic devices can be any device with computing capabilities, such as personal computers (PCs), mobile terminals, servers, etc. Mobile terminals can be, for example, in-vehicle devices, mobile phones, tablets, personal digital assistants, wearable devices, smart speakers, robots, and other hardware devices with various operating systems, touch screens, and / or displays.

[0021] In addition, dialogue processing devices can also be software within electronic devices. Examples of such software include search engines, chat applications, and conversational applications. Users can log into the software using an account and engage in dialogue with it.

[0022] In the following embodiments, an electronic device is used as an example for illustration. The electronic device can be the hardware device used by the dialogue partner to log in to the software with an account, or the backend server corresponding to the software, etc.

[0023] like Figure 1 As shown, the dialogue processing method may include the following steps:

[0024] Step 101: Obtain the current question in the current dialogue process, and the dialogue object corresponding to the current question.

[0025] In this embodiment of the disclosure, the current dialogue process can refer to a dialogue process that is currently taking place between the dialogue parties and the electronic device. The current dialogue process may include one or more rounds of dialogue. The current question can be the question currently raised by the dialogue party.

[0026] Step 102: Obtain short-term historical dialogues during the current dialogue process.

[0027] In this embodiment of the disclosure, the electronic device may perform step 102 as follows: obtain multiple rounds of historical dialogue in the current dialogue process and the rounds of the historical dialogue; obtain the round of the current dialogue to which the current question belongs; for each round of historical dialogue, obtain the round difference between the round of the historical dialogue and the round of the current dialogue; if the round difference is within the range of the round difference, determine that the historical dialogue is a short-term historical dialogue.

[0028] A single round of historical dialogue can include a question from one of the dialogue partners and an answer from an electronic device. The round number of a historical dialogue refers to which dialogue in the current dialogue process it belongs to. It should be noted that the current dialogue to which the current question belongs is the last dialogue in the current dialogue process, representing the most recent dialogue.

[0029] In one example, the minimum round difference within the round difference range can be 1, and the maximum round difference can be a preset value. This preset value can be determined based on actual needs and the dialogue scenario. The dialogue scenario could be, for example, a chat scenario, a knowledge-sharing scenario, or a medical scenario, and can be set according to actual requirements.

[0030] Given that the minimum round difference is 1 and the maximum round difference is a preset value N, assuming the current round of the dialogue is M, the short-term historical dialogue can be the historical dialogue of MN rounds to the historical dialogue of M-1 rounds in the current dialogue process.

[0031] The aforementioned range of round differences can be set by combining historical dialogues from multiple rounds closer to the current dialogue to determine the answer to the current question. Since historical dialogues from multiple rounds closer to the current dialogue generally share the same topic as the current question, this further improves the matching degree between the determined answer and the current question.

[0032] In another example, the minimum round difference within the round difference range can be K, and the maximum round difference can be a preset value. Where the minimum round difference is K (K is greater than 1) and the maximum round difference is the preset value N, assuming the current dialogue round is M, the short-term historical dialogue can be the historical dialogue from MN rounds to MK rounds during the current dialogue.

[0033] In determining the answer to the current question, historical dialogues from the three or five rounds prior to the current conversation are typically considered. Therefore, based on the aforementioned range of round differences, the answer to the current question can be determined by combining historical dialogues from three or five rounds ago. This allows for the determination of the answer to the current question by incorporating historical dialogues from even more rounds, further improving the matching degree between the answer and the current question.

[0034] Step 103: Obtain the long-term historical dialogues of the dialogue object that match the current question during the dialogue process.

[0035] Among them, long-term historical dialogues can be historical dialogues selected by the electronic device from the dialogue partners' past conversations in conjunction with the current question. Long-term historical dialogues matching the current question can include at least one of the following: historical dialogues containing keywords from the current question, historical dialogues with the same topic as the current question, etc.

[0036] Step 104: Determine the answer to the current question based on the current question, short-term historical dialogues, and long-term historical dialogues.

[0037] In this embodiment of the disclosure, the electronic device may perform step 104 as follows: determine the prompt text corresponding to the current question based on short-term and long-term historical dialogues; input the prompt text and the current question into the question-and-answer dialogue model; and obtain the answer corresponding to the current question output by the question-and-answer dialogue model.

[0038] In one example, the process by which the electronic device determines the prompt text corresponding to the current question can be as follows: performing summary extraction processing on short-term historical dialogues to obtain short-term dialogue summaries corresponding to short-term historical dialogues; and concatenating the short-term dialogue summaries and long-term historical dialogues to obtain the prompt text corresponding to the current question.

[0039] Among them, there are generally more short-term historical dialogues, while there are generally fewer long-term historical dialogues that match the current question. In order to reduce the processing load when determining the answer and increase the weight of long-term historical dialogues, the short-term historical dialogues can be summarized to extract key information. This can reduce the processing load of short-term historical dialogues when determining the answer, further improve the speed of answer determination, and improve the accuracy of the determined answer.

[0040] In another example, the process by which the electronic device determines the prompt text corresponding to the current question can be as follows: performing summary extraction processing on short-term historical dialogues to obtain short-term dialogue summaries corresponding to short-term historical dialogues; performing summary extraction processing on long-term historical dialogues to obtain long-term dialogue summaries corresponding to long-term historical dialogues; and concatenating the short-term dialogue summaries and long-term dialogue summaries to obtain the prompt text corresponding to the current question.

[0041] In cases where both short-term and long-term historical dialogues are numerous, summarizing and extracting key information from both dialogues can further reduce the processing workload when determining the answer and improve the speed of answer determination.

[0042] In this process, the electronic device inputs the prompt text and the current question into the question-and-answer dialogue model. By combining the large computational load of the question-and-answer dialogue model with the external knowledge in the prompt text, the answer can be determined, which can further improve the matching degree between the determined answer and the current question.

[0043] The dialogue processing method of this disclosure obtains the current question in the current dialogue process and the dialogue object corresponding to the current question; obtains the short-term historical dialogue in the current dialogue process; obtains the long-term historical dialogue in the historical dialogue process of the dialogue object that matches the current question; and determines the answer corresponding to the current question based on the current question, the short-term historical dialogue, and the long-term historical dialogue. This allows the method to consider not only the information in the current question but also the relevant information in the current dialogue process and the historical dialogue process when generating the answer, thereby improving the accuracy of the generated answer.

[0044] In determining the long-term historical dialogues that match the current question within the context of the dialogue partner's historical dialogues, the first vector representation of the current question can be combined with the second vector representations of historical questions from each round of historical dialogues to identify the matching long-term historical dialogues. This further improves the accuracy of the identified long-term historical dialogues, and consequently, the accuracy of the determined answer. For example... Figure 2 As shown, Figure 2 This is a schematic diagram based on the second embodiment of the present disclosure. Figure 2 The illustrated embodiment may include the following steps:

[0045] Step 201: Obtain the current question in the current dialogue process, and the dialogue object corresponding to the current question.

[0046] Step 202: Obtain short-term historical dialogues during the current dialogue process.

[0047] Step 203: Vectorize the current problem to obtain the first vector representation of the current problem.

[0048] In this embodiment of the disclosure, the process of the electronic device performing step 203 may be, for example, inputting the current problem into a preset vectorization network, obtaining the vector representation output by the vectorization network, and determining the vector representation as the first vector representation of the current problem.

[0049] Step 204: Obtain the second vector representation of the historical questions in each round of historical dialogue during the dialogue process of the dialogue object.

[0050] In this embodiment of the disclosure, the electronic device pre-stores second vector representations of historical questions from each round of historical dialogue in the historical dialogue process of each dialogue object. The electronic device can query and retrieve the second vector representations of historical questions from each round of historical dialogue in the historical dialogue process of that dialogue object based on the object's identifier.

[0051] In the example above, correspondingly, before step 204, the electronic device may perform the following process: obtain the historical dialogues of each round in the historical dialogue process of the dialogue object; for each round of historical dialogue, perform vectorization processing on the historical questions in the historical dialogue to obtain the second vector representation of the historical questions; store the historical dialogues of each round in the historical dialogue process of the dialogue object, and the second vector representation of the historical questions in each round of historical dialogue.

[0052] It should be noted that the process of vectorizing historical questions in historical dialogues by electronic devices can be as follows: determine the number of words that the vectorization network can process; truncate the historical question according to the number of words that can be processed; input the truncated historical question into the vectorization network and obtain the vector representation output by the vectorization network; and determine the vector representation as the second vector representation of the historical question.

[0053] Among them, the advance acquisition and storage of the second vector representation of historical issues in each round of historical dialogue in the historical dialogue process of each dialogue object makes it convenient for electronic devices to obtain the second vector representation of historical issues in each round of historical dialogue in the historical dialogue process of the dialogue object by querying, shortening the acquisition time of the second vector representation, improving the acquisition efficiency, and thus improving the determination efficiency of long-term historical dialogue.

[0054] Step 205: Compare the second vector representation of each historical problem with the first vector representation of the current problem to determine the vector similarity between each second vector representation and the first vector representation.

[0055] Step 206: The second vector with a similarity greater than or equal to the similarity threshold represents the corresponding historical problem and is determined as the target historical problem.

[0056] Step 207: Determine long-term historical dialogues based on target historical dialogues, including target historical issues.

[0057] In this embodiment of the disclosure, the electronic device may perform step 207 as follows: when there are multiple target historical dialogues and the total number of characters in the target historical dialogues is greater than a preset character count threshold, sort the multiple target historical dialogues in descending order according to vector similarity to obtain a sorting result; select the target historical dialogue with the highest character count from the sorting result according to the preset character count threshold and determine it as a long-term historical dialogue.

[0058] In the case where there is only one target historical dialogue, or in the case where there are multiple target historical dialogues and the total number of characters in the target historical dialogues is less than or equal to a preset character threshold, the target historical dialogue is directly identified as a long-term historical dialogue.

[0059] Due to the word limit that question-answering dialogue models can process, it is necessary to truncate the target historical dialogue. Truncation based on vector similarity can preserve target historical dialogues with high vector similarity, thereby improving the matching degree between long-term historical dialogues and the current question.

[0060] Step 208: Determine the answer to the current question based on the current question, short-term historical dialogues, and long-term historical dialogues.

[0061] In this embodiment of the disclosure, when the long-term historical dialogue is determined by the electronic device in combination with the first vector representation of the current question and the second vector representation of each historical question, in order to update the stored second vector representations of each historical question in a timely manner, the first vector representation of the current question can be stored to determine the long-term historical dialogue and improve the accuracy of determining subsequent long-term historical dialogues. Correspondingly, after step 208, the electronic device can perform the following process: after processing the dialogue response based on the answer corresponding to the current question, determine the current dialogue to which the current question belongs based on the current question and the answer corresponding to the current question; store the current dialogue and the first vector representation of the current question in the current dialogue.

[0062] It should be noted that for details regarding steps 201 to 202 and step 208, please refer to [the relevant documentation / reference]. Figure 1 Steps 101 to 102 and step 104 in the illustrated embodiment will not be described in detail here.

[0063] The dialogue processing method of this disclosure embodiment obtains the current question in the current dialogue process and the dialogue object corresponding to the current question; obtains the short-term historical dialogue in the current dialogue process; performs vectorization processing on the current question to obtain a first vector representation of the current question; obtains the second vector representation of historical questions in each round of historical dialogue in the dialogue object's historical dialogue process; compares the second vector representation of each historical question with the first vector representation of the current question to determine the vector similarity between each second vector representation and the first vector representation; determines the historical question corresponding to the second vector representation whose vector similarity is greater than or equal to the similarity threshold as the target historical question; determines the long-term historical dialogue based on the target historical dialogue including the target historical question; determines the answer corresponding to the current question based on the current question, the short-term historical dialogue, and the long-term historical dialogue, thereby enabling the determination of the long-term historical dialogue of the current question by combining the vector representation; and further improves the accuracy of the generated answer by combining the long-term historical dialogue and the short-term historical dialogue.

[0064] The following example illustrates this. For example... Figure 3 The image shown is a flowchart illustrating the dialogue processing workflow. Figure 3The process may include the following steps: (1) Obtain the question (current question), perform embedding calculation on the question, and obtain the first vector representation of the question. (2) Perform dialogue segmentation on the historical dialogue of the dialogue object corresponding to the question to obtain multi-turn historical dialogue; perform embedding calculation on the historical questions in the multi-turn historical dialogue to obtain the second vector representation of the historical questions; establish a dialogue index based on the second vector representation of each historical question (the dialogue index includes the second vector representation of the historical questions in each turn of the historical dialogue process of the dialogue object). (3) Retrieve the dialogue index based on the first vector representation of the question and obtain the retrieval results (long-term historical dialogue). (4) Obtain the current n-turn dialogue in the current dialogue process to which the question belongs; organize the dialogue prompt (prompt text) based on the current n-turn dialogue and the retrieval results. (5) Request the large model based on the organized dialogue prompt and return the answer (the answer corresponding to the current question). (6) Update the current n-turn dialogue based on the answer and add the question and the answer to the current n-turn dialogue. (7) Build an index for the current dialogue based on the answer (update the stored second vector representation of each historical question based on the question and the answer).

[0065] To implement the above embodiments, this disclosure also provides a dialogue processing apparatus. For example... Figure 4 As shown, Figure 4 This is a schematic diagram according to a third embodiment of the present disclosure. The dialogue processing device 40 may include: a first acquisition module 401, a second acquisition module 402, a third acquisition module 403, and a first determination module 404.

[0066] The first acquisition module 401 is used to acquire the current question in the current dialogue process and the dialogue object corresponding to the current question; the second acquisition module 402 is used to acquire the short-term historical dialogue in the current dialogue process; the third acquisition module 403 is used to acquire the long-term historical dialogue in the historical dialogue process of the dialogue object that matches the current question; and the first determination module 404 is used to determine the answer corresponding to the current question based on the current question, the short-term historical dialogue and the long-term historical dialogue.

[0067] As one possible implementation of this disclosure, the second acquisition module 402 is specifically used to: acquire multiple rounds of historical dialogues in the current dialogue process, and the rounds of the historical dialogues; acquire the round of the current dialogue to which the current question belongs; for each round of historical dialogue, acquire the round difference between the round of the historical dialogue and the round of the current dialogue; and determine the historical dialogue as the short-term historical dialogue if the round difference is within the range of the round difference.

[0068] As one possible implementation of this disclosure, the third acquisition module 403 includes: a first acquisition unit, a second acquisition unit, a first determination unit, a second determination unit, and a third determination unit; the first acquisition unit is used to perform vectorization processing on the current question to obtain a first vector representation of the current question; the second acquisition unit is used to obtain second vector representations of historical questions in each round of historical dialogue during the historical dialogue of the dialogue object; the first determination unit is used to compare the second vector representations of each historical question with the first vector representation of the current question to determine the vector similarity between each second vector representation and the first vector representation; the second determination unit is used to determine the historical question corresponding to the second vector representation whose vector similarity is greater than or equal to a similarity threshold as the target historical question; the third determination unit is used to determine the long-term historical dialogue based on the target historical dialogue including the target historical question.

[0069] As one possible implementation of this disclosure, the third determining unit is specifically used to, when there are multiple target historical dialogues and the total number of characters in the target historical dialogues is greater than a preset character count threshold, sort the multiple target historical dialogues in descending order according to vector similarity to obtain a sorting result; and select the target historical dialogue that ranks higher from the sorting result according to the preset character count threshold to determine it as the long-term historical dialogue.

[0070] As one possible implementation of this disclosure, the apparatus further includes: a fourth acquisition module, a fifth acquisition module, and a first storage module; the fourth acquisition module is used to acquire each round of historical dialogue in the historical dialogue process of the dialogue object; the fifth acquisition module is used to perform vectorization processing on the historical questions in the historical dialogue for each round of historical dialogue to acquire a second vector representation of the historical questions; the first storage module is used to store each round of historical dialogue in the historical dialogue process of the dialogue object, and the second vector representation of the historical questions in each round of historical dialogue.

[0071] As one possible implementation of this disclosure, the apparatus further includes: a second determining module and a second storage module; the second determining module is configured to determine the current dialogue to which the current question belongs based on the current question and the answer corresponding to the current question after performing dialogue response processing according to the answer corresponding to the current question; the second storage module is configured to store the current dialogue and a first vector representation of the current question in the current dialogue.

[0072] As one possible implementation of this disclosure, the first determining module 404 is specifically configured to: determine the prompt text corresponding to the current question based on the short-term historical dialogue and the long-term historical dialogue; input the prompt text and the current question into a question-and-answer dialogue model; and obtain the answer corresponding to the current question output by the question-and-answer dialogue model.

[0073] As one possible implementation of this disclosure, the first determining module 404 is further configured to: perform summary extraction processing on the short-term historical dialogue to obtain a short-term dialogue summary corresponding to the short-term historical dialogue; and perform concatenation processing on the short-term dialogue summary and the long-term historical dialogue to obtain the prompt text corresponding to the current question.

[0074] The dialogue processing apparatus of this disclosure obtains the current question in the current dialogue process and the dialogue object corresponding to the current question; obtains the short-term historical dialogue in the current dialogue process; obtains the long-term historical dialogue in the historical dialogue process of the dialogue object that matches the current question; and determines the answer corresponding to the current question based on the current question, the short-term historical dialogue, and the long-term historical dialogue. In this way, when generating the answer, in addition to considering the information in the current question, relevant information in the current dialogue process and the historical dialogue process is also considered, thereby improving the accuracy of the generated answer.

[0075] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision, and disclosure of users' personal information are all carried out with the consent of the users, and all comply with the provisions of relevant laws and regulations, and do not violate public order and good morals.

[0076] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0077] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0078] like Figure 5As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. The RAM 503 may also store various programs and data required for the operation of the electronic device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0079] Multiple components in electronic device 500 are connected to I / O interface 505, including: input unit 506, such as keyboard, mouse, etc.; output unit 507, such as various types of monitors, speakers, etc.; storage unit 508, such as disk, optical disk, etc.; and communication unit 509, such as network card, modem, wireless transceiver, etc. Communication unit 509 allows electronic device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0080] The computing unit 501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as dialogue processing methods. For example, in some embodiments, the dialogue processing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the dialogue processing method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform dialogue processing methods by any other suitable means (e.g., by means of firmware).

[0081] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0082] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0083] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0084] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0085] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0086] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0087] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0088] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A dialogue processing method, the method comprising: Obtain the current question in the current dialogue process, and the dialogue object corresponding to the current question; Obtain the multiple rounds of historical dialogue during the current dialogue process, as well as the rounds of the historical dialogue; Obtain the current round of the dialogue to which the current question belongs; For each round of historical dialogue, obtain the round difference between the round number of the historical dialogue and the round number of the current dialogue; If the round difference is within the round difference range, the historical dialogue is determined to be a short-term historical dialogue in the current dialogue process; Obtain the long-term historical dialogues that match the current question during the historical dialogue process of the dialogue object, wherein the long-term historical dialogues that match the current question include historical dialogues with the same topic as the current question; The answer to the current question is determined based on the current question, the short-term historical dialogues, and the long-term historical dialogues.

2. The method according to claim 1, wherein, The process of obtaining the long-term historical dialogues that match the current question during the acquisition of the dialogue object's historical dialogues includes: The current problem is vectorized to obtain a first vector representation of the current problem; Obtain the second vector representation of the historical questions in each round of historical dialogue during the historical dialogue process of the dialogue object; The second vector representation of each historical problem is compared with the first vector representation of the current problem to determine the vector similarity between each second vector representation and the first vector representation. The second vector whose vector similarity is greater than or equal to the similarity threshold represents the corresponding historical problem and is determined as the target historical problem. The long-term historical dialogue is determined based on the target historical dialogue, which includes the target historical issue.

3. The method according to claim 2, wherein, The step of determining the long-term historical dialogue based on the target historical dialogue including the target historical question includes: When there are multiple target historical dialogues and the total number of characters in the target historical dialogues is greater than a preset character threshold, the multiple target historical dialogues are sorted in descending order according to vector similarity to obtain the sorting result. According to the preset word count threshold, the target historical dialogue that appears at the top of the sorting results is selected and determined as the long-term historical dialogue.

4. The method according to claim 2, wherein, Before obtaining the second vector representation of the historical questions in each round of the historical dialogue of the dialogue object, the method further includes: Obtain the historical dialogue of each round in the historical dialogue process of the dialogue object; For each round of historical dialogue, the historical questions in the historical dialogue are vectorized to obtain the second vector representation of the historical questions; The system stores the historical dialogues of the dialogue object, including each round of historical dialogues and a second vector representation of the historical questions in each round of historical dialogues.

5. The method according to claim 2, wherein, After determining the answer to the current question based on the current question, the short-term historical dialogues, and the long-term historical dialogues, the method further includes: After processing the dialogue response based on the answer to the current question, the current dialogue to which the current question belongs is determined based on the current question and the answer to the current question. Store the current dialogue and a first vector representation of the current question in the current dialogue.

6. The method according to claim 1, wherein, The step of determining the answer to the current question based on the current question, the short-term historical dialogue, and the long-term historical dialogue includes: Based on the short-term and long-term historical dialogues, determine the prompt text corresponding to the current question; Input the prompt text and the current question into the question-and-answer dialogue model, and obtain the answer corresponding to the current question output by the question-and-answer dialogue model.

7. The method according to claim 6, wherein, The step of determining the prompt text corresponding to the current question based on the short-term historical dialogue and the long-term historical dialogue includes: The short-term historical dialogues are processed to extract a summary of the short-term dialogues. The short-term dialogue summary and the long-term historical dialogue are concatenated to obtain the prompt text corresponding to the current question.

8. A dialogue processing apparatus, the apparatus comprising: The first acquisition module is used to acquire the current question in the current dialogue process, and the dialogue object corresponding to the current question; The second acquisition module is used to acquire the multiple rounds of historical dialogue in the current dialogue process, as well as the rounds of the historical dialogue; Obtain the current round of the current dialogue to which the current question belongs; for each round of historical dialogue, obtain the round difference between the round of the historical dialogue and the round of the current dialogue; If the round difference is within the round difference range, the historical dialogue is determined to be a short-term historical dialogue in the current dialogue process; The third acquisition module is used to acquire long-term historical dialogues that match the current question during the historical dialogue process of the dialogue object, wherein the long-term historical dialogues that match the current question include historical dialogues with the same topic as the current question; The first determining module is used to determine the answer to the current question based on the current question, the short-term historical dialogue, and the long-term historical dialogue.

9. The apparatus according to claim 8, wherein, The third acquisition module includes: a first acquisition unit, a second acquisition unit, a first determination unit, a second determination unit, and a third determination unit; The first acquisition unit is used to perform vectorization processing on the current problem to obtain a first vector representation of the current problem; The second acquisition unit is used to acquire the second vector representation of the historical questions in each round of historical dialogue during the historical dialogue process of the dialogue object; The first determining unit is used to compare the second vector representation of each historical problem with the first vector representation of the current problem to determine the vector similarity between each second vector representation and the first vector representation; The second determining unit is used to identify the corresponding historical problem as the target historical problem by representing the second vector whose vector similarity is greater than or equal to the similarity threshold. The third determining unit is used to determine the long-term historical dialogue based on the target historical dialogue including the target historical question.

10. The apparatus according to claim 9, wherein, The third determining unit is specifically used for, When there are multiple target historical dialogues and the total number of characters in the target historical dialogues is greater than a preset character threshold, the multiple target historical dialogues are sorted in descending order according to vector similarity to obtain the sorting result. According to the preset word count threshold, the target historical dialogue that appears at the top of the sorting results is selected and determined as the long-term historical dialogue.

11. The apparatus according to claim 9, wherein, The device further includes: a fourth acquisition module, a fifth acquisition module, and a first storage module; The fourth acquisition module is used to acquire each round of historical dialogue in the historical dialogue process of the dialogue object; The fifth acquisition module is used to perform vectorization processing on the historical questions in the historical dialogue for each round of historical dialogue, and obtain the second vector representation of the historical questions; The first storage module is used to store the historical dialogues of each round in the historical dialogue process of the dialogue object, as well as the second vector representation of the historical questions in each round of historical dialogue.

12. The apparatus according to claim 9, wherein, The device further includes: a second determining module and a second storage module; The second determining module is used to determine the current dialogue to which the current question belongs based on the current question and the answer corresponding to the current question after processing the dialogue response according to the answer corresponding to the current question; The second storage module is used to store the current dialogue and a first vector representation of the current question in the current dialogue.

13. The apparatus according to claim 8, wherein, The first determining module is specifically used for, Based on the short-term and long-term historical dialogues, determine the prompt text corresponding to the current question; Input the prompt text and the current question into the question-and-answer dialogue model, and obtain the answer corresponding to the current question output by the question-and-answer dialogue model.

14. The apparatus according to claim 13, wherein, The first determining module is further specifically used for, The short-term historical dialogues are processed to extract a summary of the short-term dialogues. The short-term dialogue summary and the long-term historical dialogue are concatenated to obtain the prompt text corresponding to the current question.

15. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 7.

17. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Multi-round dialogue text generation method, device and equipment and storage medium

    CN112527986A