CN117421400A - Dialogue interaction method and device and electronic equipment - Google Patents

Dialogue interaction method and device and electronic equipment Download PDF

Info

Publication number
CN117421400A
CN117421400A CN202311311359.6A CN202311311359A CN117421400A CN 117421400 A CN117421400 A CN 117421400A CN 202311311359 A CN202311311359 A CN 202311311359A CN 117421400 A CN117421400 A CN 117421400A
Authority
CN
China
Prior art keywords
dialogue
history
keyword
current
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311311359.6A
Other languages
Chinese (zh)
Inventor
李涛
苗彩敬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202311311359.6A priority Critical patent/CN117421400A/en
Publication of CN117421400A publication Critical patent/CN117421400A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/335Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Machine Translation (AREA)

Abstract

The disclosure provides a dialogue interaction method, a dialogue interaction device and electronic equipment, relates to the technical field of artificial intelligence, and particularly relates to the technical fields of deep learning, natural language processing, intelligent searching and the like. The specific implementation scheme is as follows: acquiring a current problem in a current dialogue process and a dialogue object corresponding to the current problem; acquiring target keywords matched with the current problem in the history dialogue process of the dialogue object; according to the current question and the target keyword, determining an answer corresponding to the current question, so that when the answer is generated, the information in the current question is considered, the related keywords in the history dialogue process of the dialogue object are considered, the accuracy of the generated answer is improved, and the dialogue efficiency is further improved.

Description

Dialogue interaction method and device and electronic equipment
Technical Field
The disclosure relates to the technical field of artificial intelligence, in particular to the technical fields of deep learning, natural language processing, intelligent searching and the like, and particularly relates to a dialogue interaction method, a dialogue interaction device and electronic equipment.
Background
Currently, with the development of artificial intelligence, a dialogue interactive system based on a question-answer dialogue model is widely applied in various fields. The question-answer dialogue model in the dialogue interactive system is a complex model constructed based on a large amount of data and a powerful algorithm, and can be used for generating answers and the like by learning to extract useful information and knowledge from the large amount of data. However, in the current question-answer dialogue model, only information in the current question is considered when generating an answer, so that the generated answer is difficult to meet the preference, intention and the like of a dialogue object for raising the question, and the dialogue efficiency is poor.
Disclosure of Invention
The disclosure provides a dialogue interaction method, a dialogue interaction device and electronic equipment.
According to an aspect of the present disclosure, there is provided a dialogue interaction method, the method including: acquiring a current problem in a current dialogue process and a dialogue object corresponding to the current problem; acquiring target keywords matched with the current problem in the history dialogue process of the dialogue object; and determining an answer corresponding to the current question according to the current question and the target keyword.
According to another aspect of the present disclosure, there is provided a dialogue interaction apparatus, the apparatus comprising: the first acquisition module is used for acquiring a current problem in a current dialogue process and a dialogue object corresponding to the current problem; the second acquisition module is used for acquiring target keywords matched with the current problem in the history dialogue process of the dialogue object; and the first determining module is used for determining an answer corresponding to the current question according to the current question and the target keyword.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the dialog interaction method set forth above in the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the dialogue interaction method proposed above by the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of the proposed conversational interaction method of the present disclosure.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram according to a first embodiment of the present disclosure;
FIG. 2 is a schematic diagram according to a second embodiment of the present disclosure;
FIG. 3 is a flow diagram of a conversational interaction;
FIG. 4 is a schematic diagram according to a third embodiment of the present disclosure;
fig. 5 is a block diagram of an electronic device for implementing a conversational interaction method of embodiments of the disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Currently, with the development of artificial intelligence, a dialogue interactive system based on a question-answer dialogue model is widely applied in various fields. The question-answer dialogue model in the dialogue interactive system is a complex model constructed based on a large amount of data and a powerful algorithm, and can be used for generating answers and the like by learning to extract useful information and knowledge from the large amount of data. However, in the current question-answer dialogue model, only information in the current question is considered when generating an answer, so that the generated answer is difficult to meet the preference, intention and the like of a dialogue object for raising the question, and the dialogue efficiency is poor.
In view of the above problems, the present disclosure provides a dialogue interaction method, a dialogue interaction device, and an electronic device.
Fig. 1 is a schematic diagram of a first embodiment of the present disclosure, and it should be noted that the dialogue interaction method according to the embodiment of the present disclosure may be applied to a dialogue interaction device, where the device may be disposed in an electronic device, so that the electronic device may perform a dialogue interaction function.
The electronic device may be any device with computing capability, for example, may be a personal computer (Personal Computer, abbreviated as PC), a mobile terminal, a server, etc., and the mobile terminal may be, for example, a vehicle-mounted device, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, a smart speaker, a robot, etc., and have various hardware devices such as an operating system, a touch screen, and/or a display screen.
In addition, the dialogue interaction device may be software in the electronic device. For example, search software, chat software, dialogue software, etc. The dialogue object can log in the software through account numbers and the like to perform dialogue with the software.
In the following embodiments, an execution body is described as an example of an electronic device. The electronic device may be a hardware device used when the dialogue object logs in the software through the account, or a background server corresponding to the software, etc.
As shown in fig. 1, the dialogue interaction method may include the steps of:
step 101, obtaining a current problem in a current dialogue process and a dialogue object corresponding to the current problem.
In the embodiments of the present disclosure, the current session may refer to a session in which a session object is ongoing with an electronic device. The current dialogue process may include one or more rounds of dialogue. The current question may be a question currently posed by the dialog object.
Step 102, obtaining target keywords matched with the current problem in the history dialogue process of the dialogue object.
In the embodiment of the disclosure, the historical dialog process of the dialog object may be a historical dialog process between the dialog object and the electronic device. Wherein, the history dialogue process of the dialogue object can comprise a plurality of rounds of history dialogue, and each round of history dialogue can comprise at least one keyword.
The target keyword matched with the current problem may be a keyword in a history dialogue matched with the current problem, or a keyword having the same meaning or similar meaning as a word in the current problem in the history dialogue.
In an embodiment of the present disclosure, the types of the target keywords may include at least one of: hobbies, behavioral habits, landmark events, dialog object attributes. The interest refers to the interest of the dialogue object. Behavior habit refers to the behavior habit of a dialog object. A landmark event refers to a landmark event related to a dialog object. The session object attribute refers to the self attribute of the session object, and the like. Wherein the own attributes are, for example, gender, alias, age, etc.
The method comprises the steps of obtaining interest, behavior habit, marking event, attribute of a dialogue object and the like related to the dialogue object, and determining an answer corresponding to the current question, so that the answer obtained by determination can reflect preference, intention and the like of the dialogue object, the matching degree between the answer obtained by determination and the current question is improved, and further the dialogue efficiency is improved.
And step 103, determining an answer corresponding to the current question according to the current question and the target keyword.
In the embodiment of the present disclosure, the process of executing step 103 by the electronic device may be, for example, determining, according to the target keyword, a prompt text corresponding to the current problem; and inputting the current question and the prompt text corresponding to the current question into a question-answer dialogue model, and obtaining an answer corresponding to the current question output by the question-answer dialogue model.
When the number of the target keywords is multiple and is greater than or equal to the preset number threshold, the process of determining the prompt text corresponding to the current problem by the electronic device may be, for example, inputting the multiple target keywords into the abstract generating model, and obtaining the keyword abstract output by the abstract generating model; and taking the keyword abstract as a prompt text corresponding to the current problem. The preset quantity threshold value can be determined according to word number limitation of the question-answer dialogue model on the prompt text and the like.
In the case that the number of the target keywords is multiple and is smaller than the preset number threshold, the process of determining the prompt text corresponding to the current problem by the electronic device may be, for example, performing a splicing process on the multiple target keywords to obtain a spliced text; and taking the spliced text as a prompt text corresponding to the current problem.
The electronic device determines a prompt text corresponding to the current question according to the target keyword, inputs the prompt text and the current question into the question-answer dialogue model, and combines the large calculation amount of the question-answer dialogue model and the external knowledge in the prompt text to perform answer determination processing, so that the matching degree between the answer obtained by determination and the current question can be further improved.
According to the dialogue interaction method, the current problem in the current dialogue process and the dialogue object corresponding to the current problem are obtained; acquiring target keywords matched with the current problem in the history dialogue process of the dialogue object; according to the current question and the target keyword, determining an answer corresponding to the current question, so that when the answer is generated, the information in the current question is considered, the related keywords in the history dialogue process of the dialogue object are considered, the accuracy of the generated answer is improved, and the dialogue efficiency is further improved.
In the process of acquiring the target keywords matched with the current problem in the history dialogue process of the dialogue object, word segmentation words in the current problem and keywords in the history dialogue process of the dialogue object can be combined to determine the target keywords matched with the word segmentation words, so that the accuracy of determining the obtained target keywords is further improved, and the accuracy of determining the obtained answers is further improved. As shown in fig. 2, fig. 2 is a schematic diagram of a second embodiment according to the present disclosure, and the embodiment shown in fig. 2 may include the following steps:
step 201, obtaining a current problem in a current dialogue process and a dialogue object corresponding to the current problem.
Step 202, word segmentation processing is carried out on the current problem, and each word segmentation word in the current problem is obtained.
Step 203, acquiring a keyword set corresponding to a dialogue object; the keyword set comprises keywords in the history dialogue process of the dialogue object.
In an example of the embodiment of the present disclosure, the electronic device performs the process of step 203 may be, for example, acquiring a keyword database; the keyword database comprises keyword sets corresponding to each candidate dialogue object; and inquiring a keyword database to obtain a keyword set corresponding to the dialogue object in the keyword database.
Wherein, before acquiring the keyword database, the electronic device may determine the keyword database in combination with the history dialogs in the history dialogs of each candidate dialog object. Correspondingly, the process of determining the keyword database by the electronic device may be, for example, to obtain, for each candidate session object, each round of history session in the history session process of the candidate session object; aiming at each round of history dialogue, performing word segmentation processing and keyword extraction processing on the history dialogue to obtain keywords in the history dialogue; determining a keyword set corresponding to the candidate dialogue object according to keywords in each round of history dialogue in the history dialogue process of the candidate dialogue object; and determining a keyword database according to the keyword set corresponding to each candidate dialogue object.
The electronic equipment is combined with the historical dialogue in the historical dialogue process of each candidate dialogue object in advance to determine the keyword set corresponding to each candidate dialogue object, so that a keyword database is generated, direct query and acquisition are facilitated when the electronic equipment is used, the calculated amount when determining the target keywords is reduced, the speed of determining the target keywords is improved, the speed of determining answers is further improved, and the dialogue efficiency is further improved.
After each round of history dialogue in the history dialogue process of the candidate dialogue object is acquired, in order to ensure that the extracted keywords are keywords with practical meaning, the electronic device may further execute the following processes: determining, for each round of history dialogs, whether the history dialogs are invalid dialogs; in the case where the history dialogue is an invalid dialogue, the history dialogue is filtered.
The filtering processing of the electronic equipment on the invalid history dialogue can ensure that the extracted keywords are keywords with practical significance, further ensure that the target keywords are keywords with practical significance, and further improve the matching degree between the answer obtained by determination and the current question.
In another example, the electronic device may perform the step 203 in the embodiment of the present disclosure, for example, may be to obtain each round of history session in the history session process of the session object; aiming at each round of history dialogue, word segmentation processing and keyword extraction processing are carried out on the history dialogue, and keywords in the history dialogue are obtained; and determining a keyword set corresponding to the dialogue object according to keywords in each round of history dialogue in the history dialogue process of the dialogue object.
The electronic device determines a keyword set corresponding to the dialogue object according to each round of historical dialogue in the historical dialogue process of the dialogue object in real time, so that the determined keyword set is the latest keyword set, and the accuracy of determining the obtained keyword set is ensured.
Step 204, obtaining keywords matched with word segmentation words in the keyword set.
In the embodiment of the present disclosure, the electronic device performs the step 204, for example, may be configured to obtain a first vector representation of each word segment word in the current problem; obtaining a second vector representation of each keyword in the keyword set; for each word segmentation word, determining a vector similarity between a first vector representation of the word segmentation word and a second vector representation of the respective keyword; and determining the keywords with the corresponding vector similarity greater than or equal to the vector similarity threshold as keywords matched with the word segmentation words.
The first vector representation of each word in the current problem is determined in the same manner as the second vector representation of each keyword in the keyword set. For example, the first vector representation of the word segmentation word in the current problem may be determined by inputting the word segmentation word into a vectorization network to obtain a vector representation output by the vectorization network; the vector representation is determined as a first vector representation of the word segmentation term.
The electronic equipment combines the first vector representation of the word segmentation words in the current questions and the second vector representation of each keyword to determine the keywords matched with the word segmentation words, so that the matching degree between the determined keywords and the current questions is further improved, and the accuracy of determining the answers is further improved.
Step 205, determining the keywords matched with the word segmentation words as target keywords matched with the current problem in the history dialogue process of the dialogue object.
Step 206, determining an answer corresponding to the current question according to the current question and the target keyword.
In the embodiment of the present disclosure, after step 206, in order to ensure accuracy of keywords in the keyword set corresponding to the dialogue object, the electronic device may generate a current dialogue according to the current question and an answer corresponding to the current question; performing word segmentation processing and keyword extraction processing on the current dialogue to obtain keywords in the current dialogue; and adding the keywords in the current dialogue into the keyword set corresponding to the dialogue object.
It should be noted that, for details of step 201 and step 206, reference may be made to step 101 and step 103 in the embodiment shown in fig. 1, and detailed description thereof will not be provided here.
According to the dialogue interaction method, the current problem in the current dialogue process and the dialogue object corresponding to the current problem are obtained; performing word segmentation processing on the current problem to obtain each word segmentation word in the current problem; acquiring a keyword set corresponding to a dialogue object; the keyword set comprises keywords in the history dialogue process of the dialogue object; acquiring keywords matched with word segmentation words in a keyword set; determining keywords matched with word segmentation words as target keywords matched with the current problem in the history dialogue process of the dialogue object; according to the current question and the target keyword, determining an answer corresponding to the current question, so that when the answer is generated, the information in the current question is considered, the related keywords in the history dialogue process of the dialogue object are considered, the accuracy of the generated answer is improved, and the dialogue efficiency is further improved.
The following examples are illustrative. As shown in fig. 3, a flow chart of the dialogue interaction is shown. In fig. 3, the following steps may be included: (1) acquisition problem (current problem). (2) And organizing conversation prompt, namely acquiring target keywords matched with the current problem in the historical conversation as prompt texts corresponding to the problem. (3) Requesting a large model and returning answers, namely inputting the questions and the corresponding prompt texts into the large model (question-answer dialogue model) and acquiring the answers corresponding to the questions output by the large model. (4) And generating a current dialogue according to the questions and the corresponding answers, and performing dialogue filtering processing (filtering when the current dialogue is invalid). (5) And when the current dialogue is effective, part-of-speech tagging and word segmentation are carried out, and word segmentation results are obtained. (6) And extracting keywords by combining the word segmentation result, namely acquiring target keywords matched with the word segmentation words in the word segmentation result. (7) Information arrangement is performed, that is, the type of a target keyword, such as personal information (dialogue object attribute), hobbies, behavior habits, and landmark events, is determined, and a history dialogue and keywords in the history dialogue are updated.
In order to implement the above embodiment, the present disclosure further provides a dialogue interaction device. As shown in fig. 4, fig. 4 is a schematic diagram according to a third embodiment of the present disclosure. The dialogue interaction device 40 may include: a first acquisition module 401, a second acquisition module 402, and a first determination module 403.
The first obtaining module 401 is configured to obtain a current problem in a current dialogue process and a dialogue object corresponding to the current problem; a second obtaining module 402, configured to obtain a target keyword that matches the current problem in a history dialogue process of the dialogue object; a first determining module 403, configured to determine an answer corresponding to the current question according to the current question and the target keyword.
As one possible implementation of the embodiment of the present disclosure, the second obtaining module 402 includes: the device comprises a first acquisition unit, a second acquisition unit, a third acquisition unit and a determination unit; the first obtaining unit is used for carrying out word segmentation processing on the current problem and obtaining each word segmentation word in the current problem; the second obtaining unit is used for obtaining a keyword set corresponding to the dialogue object; the keyword set comprises keywords in the history dialogue process of the dialogue object; the third obtaining unit is used for obtaining keywords matched with the word segmentation words in the keyword set; and the determining unit is used for determining the keywords matched with the word segmentation words as target keywords matched with the current problem in the history dialogue process of the dialogue object.
As one possible implementation manner of the embodiments of the present disclosure, the second obtaining unit is specifically configured to obtain a keyword database; the keyword database comprises keyword sets corresponding to each candidate dialogue object; and inquiring the keyword database to obtain a keyword set corresponding to the dialogue object in the keyword database.
As one possible implementation manner of the embodiments of the present disclosure, the apparatus further includes: the device comprises a third acquisition module, a fourth acquisition module, a second determination module and a third determination module; the third obtaining module is configured to obtain, for each candidate dialog object, each round of history dialog in a history dialog process of the candidate dialog object; the fourth obtaining module is configured to perform word segmentation processing and keyword extraction processing on the history dialogue for each round of history dialogue, to obtain keywords in the history dialogue; the second determining module is configured to determine a keyword set corresponding to the candidate dialog object according to keywords in each round of history dialog in the history dialog process of the candidate dialog object; and the third determining module is used for determining the keyword database according to the keyword set corresponding to each candidate dialogue object.
As one possible implementation manner of the embodiments of the present disclosure, the apparatus further includes: a fourth determining module and a filtering processing module; the fourth determining module is configured to determine, for each round of history dialogue, whether the history dialogue is an invalid dialogue; and the filtering processing module is used for filtering the history dialogue under the condition that the history dialogue is invalid.
As a possible implementation manner of the embodiment of the present disclosure, the third obtaining unit is specifically configured to obtain a first vector representation of each word segmentation word in the current problem; acquiring a second vector representation of each keyword in the keyword set; for each word-segmentation term, determining a vector similarity between a first vector representation of the word-segmentation term and a second vector representation of the respective keyword; and determining the keywords with the corresponding vector similarity greater than or equal to the vector similarity threshold as keywords matched with the word segmentation words.
As one possible implementation of the embodiments of the present disclosure, the type of the target keyword includes at least one of the following: hobbies, behavioral habits, landmark events, dialog object attributes.
As a possible implementation manner of the embodiment of the present disclosure, the first determining module 403 is specifically configured to determine, according to the target keyword, a prompt text corresponding to the current question; and inputting the current question and a prompt text corresponding to the current question into a question-answer dialogue model, and obtaining an answer corresponding to the current question output by the question-answer dialogue model.
According to the dialogue interaction device, the current problem in the current dialogue process and the dialogue object corresponding to the current problem are obtained; acquiring target keywords matched with the current problem in the history dialogue process of the dialogue object; according to the current question and the target keyword, determining an answer corresponding to the current question, so that when the answer is generated, the information in the current question is considered, the related keywords in the history dialogue process of the dialogue object are considered, the accuracy of the generated answer is improved, and the dialogue efficiency is further improved.
In the technical scheme of the disclosure, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the user are performed on the premise of proving the consent of the user, and all the processes accord with the regulations of related laws and regulations, and the public welfare is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 5 illustrates a schematic block diagram of an example electronic device 500 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the electronic device 500 includes a computing unit 501 that 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. In the RAM 503, various programs and data required for the operation of the electronic device 500 may also be stored. The computing unit 501, ROM 502, and RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in electronic device 500 are connected to I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, etc.; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508 such as a magnetic disk, an optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized 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 a conversational interaction method. For example, in some embodiments, the conversational interaction method may be implemented as a computer software program tangibly embodied on 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 onto the electronic device 500 via the ROM 502 and/or the 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 dialog interaction method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the dialog interaction method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These 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 the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (19)

1. A method of conversational interaction, the method comprising:
acquiring a current problem in a current dialogue process and a dialogue object corresponding to the current problem;
acquiring target keywords matched with the current problem in the history dialogue process of the dialogue object;
and determining an answer corresponding to the current question according to the current question and the target keyword.
2. The method of claim 1, wherein the obtaining the target keywords of the conversation object that match the current question during the historical conversation process comprises:
performing word segmentation processing on the current problem to obtain each word segmentation word in the current problem;
acquiring a keyword set corresponding to the dialogue object; the keyword set comprises keywords in the history dialogue process of the dialogue object;
acquiring keywords matched with the word segmentation words in the keyword set;
and determining the keywords matched with the word segmentation words as target keywords matched with the current problem in the history dialogue process of the dialogue object.
3. The method of claim 2, wherein the obtaining the keyword set corresponding to the dialog object includes:
acquiring a keyword database; the keyword database comprises keyword sets corresponding to each candidate dialogue object;
and inquiring the keyword database to obtain a keyword set corresponding to the dialogue object in the keyword database.
4. A method according to claim 3, wherein the method further comprises:
for each candidate dialogue object, acquiring each round of history dialogue in the history dialogue process of the candidate dialogue object;
aiming at each round of history dialogue, word segmentation processing and keyword extraction processing are carried out on the history dialogue, and keywords in the history dialogue are obtained;
determining a keyword set corresponding to the candidate dialogue object according to keywords in each round of history dialogue in the history dialogue process of the candidate dialogue object;
and determining the keyword database according to the keyword set corresponding to each candidate dialogue object.
5. The method of claim 4, wherein, after acquiring the history conversations of each candidate conversation object for each round of history conversations in the history conversations of the candidate conversation object, the method further comprises:
for each round of history conversations, determining whether the history conversation is an invalid conversation;
and filtering the history dialogue under the condition that the history dialogue is an invalid dialogue.
6. The method of claim 2, wherein the obtaining keywords in the set of keywords that match the segmented words comprises:
acquiring a first vector representation of each word segmentation word in the current problem;
acquiring a second vector representation of each keyword in the keyword set;
for each word-segmentation term, determining a vector similarity between a first vector representation of the word-segmentation term and a second vector representation of the respective keyword;
and determining the keywords with the corresponding vector similarity greater than or equal to the vector similarity threshold as keywords matched with the word segmentation words.
7. The method of any one of claims 1 to 6, wherein the type of target keyword comprises at least one of: hobbies, behavioral habits, landmark events, dialog object attributes.
8. The method of claim 1, wherein the determining an answer corresponding to the current question according to the current question and the target keyword comprises:
determining a prompt text corresponding to the current problem according to the target keyword;
and inputting the current question and a prompt text corresponding to the current question into a question-answer dialogue model, and obtaining an answer corresponding to the current question output by the question-answer dialogue model.
9. A dialog interaction device, the device comprising:
the first acquisition module is used for acquiring a current problem in a current dialogue process and a dialogue object corresponding to the current problem;
the second acquisition module is used for acquiring target keywords matched with the current problem in the history dialogue process of the dialogue object;
and the first determining module is used for determining an answer corresponding to the current question according to the current question and the target keyword.
10. The apparatus of claim 9, wherein the second acquisition module comprises: the device comprises a first acquisition unit, a second acquisition unit, a third acquisition unit and a determination unit;
the first obtaining unit is used for carrying out word segmentation processing on the current problem and obtaining each word segmentation word in the current problem;
the second obtaining unit is used for obtaining a keyword set corresponding to the dialogue object; the keyword set comprises keywords in the history dialogue process of the dialogue object;
the third obtaining unit is used for obtaining keywords matched with the word segmentation words in the keyword set;
and the determining unit is used for determining the keywords matched with the word segmentation words as target keywords matched with the current problem in the history dialogue process of the dialogue object.
11. The device according to claim 10, wherein the second acquisition unit is in particular adapted to,
acquiring a keyword database; the keyword database comprises keyword sets corresponding to each candidate dialogue object;
and inquiring the keyword database to obtain a keyword set corresponding to the dialogue object in the keyword database.
12. The apparatus of claim 11, wherein the apparatus further comprises: the device comprises a third acquisition module, a fourth acquisition module, a second determination module and a third determination module;
the third obtaining module is configured to obtain, for each candidate dialog object, each round of history dialog in a history dialog process of the candidate dialog object;
the fourth obtaining module is configured to perform word segmentation processing and keyword extraction processing on the history dialogue for each round of history dialogue, to obtain keywords in the history dialogue;
the second determining module is configured to determine a keyword set corresponding to the candidate dialog object according to keywords in each round of history dialog in the history dialog process of the candidate dialog object;
and the third determining module is used for determining the keyword database according to the keyword set corresponding to each candidate dialogue object.
13. The apparatus of claim 12, wherein the apparatus further comprises: a fourth determining module and a filtering processing module;
the fourth determining module is configured to determine, for each round of history dialogue, whether the history dialogue is an invalid dialogue;
and the filtering processing module is used for filtering the history dialogue under the condition that the history dialogue is invalid.
14. The apparatus of claim 10, wherein the third acquisition unit is configured to,
acquiring a first vector representation of each word segmentation word in the current problem;
acquiring a second vector representation of each keyword in the keyword set;
for each word-segmentation term, determining a vector similarity between a first vector representation of the word-segmentation term and a second vector representation of the respective keyword;
and determining the keywords with the corresponding vector similarity greater than or equal to the vector similarity threshold as keywords matched with the word segmentation words.
15. The apparatus of any of claims 9 to 14, wherein the type of target keyword comprises at least one of: hobbies, behavioral habits, landmark events, dialog object attributes.
16. The apparatus of claim 9, wherein the first determining means is specifically configured to,
determining a prompt text corresponding to the current problem according to the target keyword;
and inputting the current question and a prompt text corresponding to the current question into a question-answer dialogue model, and obtaining an answer corresponding to the current question output by the question-answer dialogue model.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 8.
18. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1 to 8.
19. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 8.
CN202311311359.6A 2023-10-10 2023-10-10 Dialogue interaction method and device and electronic equipment Pending CN117421400A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311311359.6A CN117421400A (en) 2023-10-10 2023-10-10 Dialogue interaction method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311311359.6A CN117421400A (en) 2023-10-10 2023-10-10 Dialogue interaction method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN117421400A true CN117421400A (en) 2024-01-19

Family

ID=89521973

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311311359.6A Pending CN117421400A (en) 2023-10-10 2023-10-10 Dialogue interaction method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN117421400A (en)

Similar Documents

Publication Publication Date Title
CN112487173B (en) Man-machine conversation method, device and storage medium
CN113407850B (en) Method and device for determining and acquiring virtual image and electronic equipment
CN113590776A (en) Text processing method and device based on knowledge graph, electronic equipment and medium
CN114548110A (en) Semantic understanding method and device, electronic equipment and storage medium
CN112528641A (en) Method and device for establishing information extraction model, electronic equipment and readable storage medium
CN115481227A (en) Man-machine interaction dialogue method, device and equipment
CN115905497B (en) Method, device, electronic equipment and storage medium for determining reply sentence
CN114969195B (en) Dialogue content mining method and dialogue content evaluation model generation method
CN114722171B (en) Multi-round dialogue processing method and device, electronic equipment and storage medium
CN114490969B (en) Question and answer method and device based on table and electronic equipment
CN114238611B (en) Method, apparatus, device and storage medium for outputting information
CN116049370A (en) Information query method and training method and device of information generation model
CN113704256B (en) Data identification method, device, electronic equipment and storage medium
CN115840867A (en) Generation method and device of mathematical problem solving model, electronic equipment and storage medium
CN117421400A (en) Dialogue interaction method and device and electronic equipment
CN114118937A (en) Information recommendation method and device based on task, electronic equipment and storage medium
CN112817463A (en) Method, equipment and storage medium for acquiring audio data by input method
CN116257611B (en) Question-answering model training method, question-answering processing device and storage medium
CN117421402A (en) Dialogue processing method and device and electronic equipment
CN116244432B (en) Pre-training method and device for language model and electronic equipment
CN113344405B (en) Method, device, equipment, medium and product for generating information based on knowledge graph
CN116049372B (en) Man-machine conversation method and device and electronic equipment
CN116069914B (en) Training data generation method, model training method and device
CN114416937B (en) Man-machine interaction method, device, equipment, storage medium and computer program product
CN113572679B (en) Account intimacy generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination