CN117009469A - Intelligent dialogue method, device, equipment and storage medium - Google Patents

Intelligent dialogue method, device, equipment and storage medium Download PDF

Info

Publication number
CN117009469A
CN117009469A CN202211017859.4A CN202211017859A CN117009469A CN 117009469 A CN117009469 A CN 117009469A CN 202211017859 A CN202211017859 A CN 202211017859A CN 117009469 A CN117009469 A CN 117009469A
Authority
CN
China
Prior art keywords
dialogue
knowledge
dialog
state data
slot
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
CN202211017859.4A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202211017859.4A priority Critical patent/CN117009469A/en
Publication of CN117009469A publication Critical patent/CN117009469A/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/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • 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
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses an intelligent dialogue method, device, equipment and storage medium, and belongs to the technical field of artificial intelligence. The application introduces additional information, namely a dialogue management knowledge base; wherein the dialogue management knowledge base comprises dialogue state knowledge and dialogue behavior knowledge; in the dialogue process of the current round, after the input sentence of the target object is obtained, the application firstly carries out a series of processing on the input sentence to obtain the initial dialogue state data of the current round; then, correcting the initial dialogue state data based on the dialogue management knowledge base, and further obtaining dialogue behavior data of the current round based on the corrected dialogue state data, the input sentences and the dialogue management knowledge base; by introducing the additional information, the dialogue state and the dialogue behavior can be identified more reasonably and accurately, and based on a reasonable and accurate dialogue state identification result and a dialogue behavior identification result, more reasonable reply sentences can be generated, so that the dialogue quality is remarkably improved.

Description

Intelligent dialogue method, device, equipment and storage medium
Technical Field
The present application relates to the field of artificial intelligence, and in particular, to an intelligent dialogue method, apparatus, device, and storage medium.
Background
With the rapid development of science and technology and economic level, today's society is gradually changing to a service type society to better serve objects. Based on the above concepts, artificial intelligence technology plays an important role in a variety of fields. The intelligent dialogue is an important application field of artificial intelligence technology, and the object can realize man-machine dialogue with intelligent equipment with intelligent interaction function.
Typically, the intelligent dialog is implemented based on an intelligent dialog system (dialog system for short). Illustratively, the dialog system relies on AI technology to provide services such as information queries, emotion chats, knowledge questions and answers, task dialogs, etc. to objects.
The dialog system can output accurate reply sentences to the object, which is a key factor affecting the quality of man-machine dialog. At present, because the available information is too little when a reply sentence is generated in the dialogue process, a plurality of conditions exist for answering questions, and the dialogue quality is poor. Therefore, how to output high-quality reply sentences to the object in the intelligent dialogue process becomes a problem to be solved by those skilled in the art.
Disclosure of Invention
The embodiment of the application provides an intelligent dialogue method, device, equipment and storage medium, which can improve dialogue quality. The technical scheme is as follows:
In one aspect, an intelligent dialog method is provided, the method comprising:
acquiring an input sentence of a target object in a current round;
identifying the dialogue intention of the target object in the current round based on the input sentence;
carrying out named entity recognition on the input sentence to obtain a named entity appearing in the input sentence;
according to the dialogue intention of the target object in the current round and the named entity appearing in the input sentence, filling the slot to obtain initial dialogue state data of the current round; wherein the initial dialog state data includes a slot determined based on the input statement and a slot value that matches the slot;
correcting the initial dialogue state data based on a dialogue management knowledge base to obtain corrected dialogue state data; wherein the dialogue management knowledge base comprises dialogue state knowledge and dialogue behavior knowledge; the dialogue state knowledge is used for restraining relations among different dialogue states; the dialogue action knowledge is used for restraining the relation among different dialogue actions;
based on the corrected dialogue state data, the input sentences and the dialogue management knowledge base, acquiring dialogue behavior data of the current round; the dialogue action data are used for representing dialogue intentions of the dialogue system in the current round;
Generating a reply sentence of which the current round is matched with the input sentence based on the corrected dialogue state data and the dialogue behavior data;
and outputting the reply sentence to the target object.
In another aspect, there is provided an intelligent dialog device, the device comprising:
the acquisition unit is configured to acquire an input sentence of a target object in a current round;
a first processing unit configured to identify a dialog intention of the target object at a current round based on the input sentence; carrying out named entity recognition on the input sentence to obtain a named entity appearing in the input sentence; according to the dialogue intention of the target object in the current round and the named entity appearing in the input sentence, filling the slot to obtain initial dialogue state data of the current round; wherein the initial dialog state data includes a slot determined based on the input statement and a slot value that matches the slot;
the second processing unit is configured to correct the initial dialogue state data based on a dialogue management knowledge base to obtain corrected dialogue state data; wherein the dialogue management knowledge base comprises dialogue state knowledge and dialogue behavior knowledge; the dialogue state knowledge is used for restraining relations among different dialogue states; the dialogue action knowledge is used for restraining the relation among different dialogue actions;
A third processing unit configured to acquire dialogue behavior data of a current round based on the corrected dialogue state data, the input sentence, and the dialogue management knowledge base; the dialogue action data are used for representing dialogue intentions of the dialogue system in the current round;
a generation unit configured to generate a reply sentence in which a current round matches the input sentence, based on the corrected dialogue state data and the dialogue behavior data;
and a transmitting unit configured to output the reply sentence to the target object.
In some possible implementations, the first processing unit is configured to:
performing intention recognition, named entity recognition and slot filling on the input sentence based on a natural language understanding model to obtain the initial dialogue state data; the natural language understanding model is obtained by retraining a pre-trained deep learning model based on dialogue corpus;
wherein the updating process of the natural language understanding model comprises the following steps:
acquiring dialogue state data after multiple rounds of correction in the dialogue process;
and updating model parameters of the natural understanding model according to the dialogue state data after the multi-round correction.
In some possible implementations, the second processing unit is configured to:
in response to the initial dialog state data not retrieving an instance matching the input statement, replacing slot values in the initial dialog state data in a target priority order to obtain updated dialog state data;
in response to not retrieving an instance matching the input sentence based on the updated dialog state data, continuing to perform slot value replacement until an instance matching the input sentence is retrieved;
determining satisfaction of dialogue state knowledge in the dialogue management knowledge base as rules of the deduction reasoning and expressed in a first order logical language with the retrieved instance as an explanation of the deduction reasoning;
and responding to the satisfaction value of the target dialogue state knowledge as a target numerical value, and taking the dialogue state data updated last as the corrected dialogue state data.
In some possible implementations, the second processing unit is configured to:
determining a first type of slot with an empty slot value in the initial dialogue state data, and preferentially assigning the slot value for the first type of slot to obtain updated dialogue state data;
In response to not retrieving an instance matching the input statement based on the updated dialog state data, continuing to assign a new slot value to the first class of slots in an enumerated manner;
and in response to the fact that the instance matched with the input statement is not retrieved by designating the slot value for the first type of slot, continuing to replace the slot value of the second type of slot until the instance matched with the input statement is retrieved, wherein the second type of slot is a slot with a non-empty slot value in the initial dialogue state data.
In another aspect, a computer device is provided, the device comprising a processor and a memory, the memory having stored therein at least one program code that is loaded and executed by the processor to implement the intelligent dialog method described above.
In another aspect, a computer readable storage medium having stored therein at least one program code loaded and executed by a processor to implement the intelligent dialog method described above is provided.
In another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer program code stored in a computer readable storage medium, the computer program code being read from the computer readable storage medium by a processor of a computer device, the computer program code being executed by the processor, causing the computer device to perform the intelligent conversation method described above.
The intelligent dialogue scheme provided by the embodiment of the application introduces additional information, namely a dialogue management knowledge base; wherein the dialogue management knowledge base comprises dialogue state knowledge and dialogue behavior knowledge; the dialogue state knowledge is used for restraining the relation between different dialogue states; the dialogue action knowledge is used for restraining the relation among different dialogue actions; in the dialogue process of the current round, after an input sentence of a target object is acquired, the embodiment of the application firstly carries out a series of processing on the input sentence to obtain initial dialogue state data of the current round, wherein the initial dialogue state data comprises a slot position determined based on the input sentence and a slot position value matched with the slot position; then, correcting the initial dialogue state data based on the dialogue management knowledge base, and further obtaining dialogue action data of the current round based on the corrected dialogue state data, the input sentences and the dialogue management knowledge base, wherein the dialogue action data is used for representing dialogue intention of a dialogue system in the current round; the dialogue state and the dialogue behavior can be identified more reasonably and accurately by introducing the additional information, and more reasonable reply sentences can be generated based on reasonable and accurate dialogue state identification results and dialogue behavior identification results, so that the situation of answering questions is avoided, and the dialogue quality is remarkably improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an implementation environment involved in an intelligent dialog, according to an example embodiment;
FIG. 2 is a block diagram of a system architecture involved in an intelligent dialog scheme, shown in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating an intelligent dialog according to an exemplary embodiment;
FIG. 4 is a schematic illustration of a dialog shown in accordance with an exemplary embodiment;
FIG. 5 is another dialog schematic diagram illustrating an exemplary embodiment;
FIG. 6 is a flowchart illustrating a method of intelligent dialog, according to an exemplary embodiment;
FIG. 7 is a schematic diagram of an intelligent dialog device, according to an exemplary embodiment;
fig. 8 is a schematic diagram of a computer device, according to an example embodiment.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
The terms "first," "second," and the like in this disclosure are used for distinguishing between similar elements or items having substantially the same function and function, and it should be understood that there is no logical or chronological dependency between the terms "first," "second," and "n," and that there is no limitation on the amount and order of execution. It will be further understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms.
These terms are only used to distinguish one element from another element. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of the various examples. The first element and the second element may both be elements, and in some cases, may be separate and distinct elements.
Wherein at least one means one or more, for example, at least one element may be an integer number of elements of one or more of any one element, two elements, three elements, and the like. The plurality means two or more, and for example, the plurality of elements may be any integer number of elements equal to or greater than two, such as two elements and three elements.
It should be noted that, the information (including, but not limited to, object device information, object personal information, etc.), data (including, but not limited to, data for analysis, stored data, presented data, etc.), and signals related to the present application are all subject authorized or fully authorized by each party, and the collection sample set, use, and processing of the related data are required to comply with the relevant laws and regulations and standards of the relevant country and region.
The intelligent dialogue scheme provided by the embodiment of the application relates to an artificial intelligence technology.
Artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use the knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision.
The artificial intelligence technology is a comprehensive subject, and relates to the technology with wide fields, namely the technology with a hardware level and the technology with a software level. Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
Natural language processing (Nature Language Processing, NLP) is an important direction in the fields of computer science and artificial intelligence. It is studying various theories and methods that enable effective communication between a person and a computer in natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Thus, the research in this field will involve natural language, i.e. language that people use daily, so it has a close relationship with the research in linguistics. Natural language processing techniques typically include text processing, semantic understanding, machine translation, robotic questions and answers, knowledge graph techniques, and the like.
Machine Learning (ML) is a multi-domain interdisciplinary, involving multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, etc. It is specially studied how a computer simulates or implements learning behavior of a human to acquire new knowledge or skills, and reorganizes existing knowledge structures to continuously improve own performance. Machine learning is the core of artificial intelligence, a fundamental approach to letting computers have intelligence, which is applied throughout various areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, induction learning, teaching learning, and the like.
With research and advancement of artificial intelligence technology, research and application of artificial intelligence technology is being developed in various fields, such as common smart home, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned, automatic driving, unmanned aerial vehicles, robots, smart medical treatment, smart customer service, etc., and it is believed that with the development of technology, artificial intelligence technology will be applied in more fields and with increasing importance value.
The intelligent dialogue scheme provided by the embodiment of the application may relate to artificial intelligence natural language processing, machine learning and other technologies, and is specifically described by the following embodiments.
Some key terms or abbreviations involved in the embodiments of the present application are first described below.
Dialog behavior (dialog Act): is inspired by behavioral characteristics in the dialog between humans.
Illustratively, the behavioral characteristics described above fall broadly into four categories, answer, instruction, guide, and greeting. Wherein the dialogue acts are used to represent the intent of each sentence in the dialogue process. In another expression, the dialog behavior is used to represent dialog intents of an object in the dialog process or dialog intents of a dialog system. In addition, classification of dialogue acts may be set according to specific dialogue tasks, and the present application is not limited herein.
Slot filling (Slot-filling): the dialogue context is understood, and according to the dialogue intention of the current round of objects, slots are determined based on the input sentences of the objects in the current round and slot value filling is carried out on the slots.
Wheel (turn): typically, a round of dialog consists of a sentence entered by the object and a sentence followed by a reply by the dialog system.
Dialog State (dialog State): the slot and corresponding slot value determined based on the sentence input by the object are referred to herein.
The following describes an implementation environment related to an intelligent dialogue scheme provided by an embodiment of the present application.
The implementation environment related to the intelligent dialogue scheme provided by the embodiment of the application comprises a terminal, a server and a knowledge base. FIG. 1 is a schematic diagram illustrating an implementation environment involved in an intelligent dialog, according to an example embodiment. Referring to fig. 1, the implementation environment includes: a terminal 101, a dialogue system server 102, a data management server 103, a dialogue management repository 104, and a public repository 105.
The terminal 101 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart robot, etc. The terminal 101 and the dialog system server 102 are directly or indirectly connected by a communication network (e.g., the internet) in a wired or wireless communication manner, which is not limited in this regard.
Illustratively, the terminal 101 has installed thereon an application (also referred to as a client) that supports intelligent conversations. In some possible implementations, the application includes, but is not limited to, the following classes: applications dedicated to intelligent conversations; or, a social class application supporting intelligent conversations; alternatively, an applet supporting intelligent conversations is an application that can be used without downloading and installing, and the applet is embedded as a child application in other applications (also called parent applications), and provides diversified services by running the child application implementation in the parent application.
In the embodiment of the application, the server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and can also be a cloud server for providing cloud computing services, a cloud database, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network), and cloud servers for basic cloud computing services such as big data and artificial intelligent platforms.
The dialogue system server 102 and the data management server 103 are connected to the dialogue management repository 104, and the public repository 105 is connected to the data management server 103. Wherein the dialog system server 102 and the data management server 103 each comprise at least one processor, a memory and at least two I/O (Input/Output) devices.
In some possible implementations, the terminal 101 includes systems and techniques described here that can be implemented on a computer having: and a display device for displaying information to the object. Such as a CRT (Cathode Ray Tube) or LCD (Liquid Crystal Display ), and a keyboard and a pointing device (e.g., a mouse or a trackball) by which an object can provide input to a computer. Other kinds of devices may also be used to provide for interaction with an object; for example, the feedback provided to the subject may be any form of sensory feedback. For example, visual feedback, auditory feedback, or tactile feedback, and input from the subject may be received in any form, including acoustic input, speech input, or tactile input. The systems and techniques described here can be implemented with a computing system that includes a front-end component. For example, a user computer having a graphical user interface or web browser through which objects can interact with each other.
The following describes an application scenario of the intelligent dialogue scheme provided by the embodiment of the application.
In some possible implementations, the intelligent dialogue method provided by the embodiment of the application is applied to task scenes. The task-type dialogue is to complete a specific task, for example, to order an air ticket, not only need to answer an object, but also need to query the air ticket condition and execute corresponding actions. That is, the task dialog has a task objective. For a task dialogue, the sentence input by the subject may be "help me order an air ticket from tomorrow a to B".
In combination with the above description, the following detailed explanation will be given for the intelligent dialogue scheme provided by the embodiment of the present application.
Fig. 2 is a block diagram illustrating a system architecture involved in an intelligent dialog scheme, according to an exemplary embodiment. Fig. 2 is a further detailed description of the structures of the dialog system server 102 (abbreviated as dialog system), the data management server 103 and the dialog management repository 104 in fig. 1.
Referring to fig. 2, the dialog system server 102 includes a processor 1021, a memory 1022, and two I/O devices. Wherein the dialogue system server 102 is connected to the terminal 101 through the I/O device 1023, the dialogue system server 102 is connected to the dialogue management knowledge base 104 through the I/O device 1024, and the processor 1021 and the memory 1022 are connected through the data bus 1025.
In some possible implementations, the memory 1022 includes a natural language understanding module 11, a dialog management module 12, a natural language generation module 13, an output module 14, and a first update module 15. Wherein the first update module is also referred to herein as a dictionary update module. The dialog management module 12 includes an entity linking module 121, an deduction learning module 122, a second updating module 123 and a dialog behavior optimization module 124.
With continued reference to FIG. 2, the data management server 103 includes a processor 1031, a memory 1032, and two I/O devices. The data management server 103 is connected to the dialogue management repository 104 through the I/O device 1033, the data management server 103 is connected to the public repository 105 through the I/O device 1034, and the processor 1031 and the memory 1032 are connected through the data bus 1035.
In some possible implementations, the memory 1032 includes a knowledge multiplexing module 21, a knowledge combining module 22, and a knowledge version management module 23.
Wherein the function and function of each of the above modules will be explained in detail later.
In other possible implementations, the dialog management repository 104 includes a dialog state repository and a dialog behavior repository. Wherein the dialogue state knowledge base comprises dialogue state knowledge expressed in a first-order logic language; the dialogue action knowledge base includes dialogue action knowledge expressed in a propositional logic language.
In the embodiment of the application, dialogue state knowledge is used for restraining the relation among different dialogue states; in another expression, dialog state knowledge is a specification of relationships between dialog behaviors. The dialogue action knowledge is used for restraining the relation between different dialogue states; in another expression, the dialogue-action knowledge is a specification of relationships between dialogue actions.
FIG. 3 is a flow diagram illustrating an intelligent dialog, according to an example embodiment. The flow of the intelligent session is described below with reference to the system architecture diagram shown in fig. 2, and by way of fig. 3.
301. A dialogue corpus and a multi-source public knowledge base are obtained.
In some possible implementation manners, the intelligent dialogue scheme provided by the embodiment of the application is applied in a task dialogue scene, and the dialogue corpus is a task related topic corpus, so that the application is not limited herein. The small number of samples of the conversation corpus is also referred to as its own data set, relative to a large-scale public conversation corpus.
The knowledge base is a basic data resource of many natural language processing tasks, the public knowledge base refers to a network open source knowledge base, and the network open source knowledge base with multiple sources can be obtained through a web crawler technology by way of example, so that the multi-source public knowledge base is formed.
302. The data management server imports the multi-source public knowledge base and runs the knowledge multiplexing module of the data management server.
After the multi-source public knowledge base is acquired, namely knowledge from a plurality of data sources is acquired, the acquired knowledge is subjected to data preprocessing by running a knowledge multiplexing module of the data management server. Wherein the data preprocessing includes, but is not limited to, data cleansing, the application is not limited herein. Then classifying the preprocessed dialogue state knowledge according to the subject words in different fields to obtain the dialogue state knowledge in different fields; wherein the dialogue state knowledge is also referred to as dialogue state common knowledge. Further, a first-order logic language is adopted, and dialog state knowledge which is described by natural language after pretreatment is respectively re-described according to the field to form a dialog state knowledge base; and re-describing the dialogue action knowledge which is described by natural language after preprocessing by adopting a propositional logic language to form a dialogue action knowledge base.
Taking data preprocessing as an example of data cleaning, a knowledge multiplexing module of the data management server firstly cleans the data of the multi-source public knowledge base, then retrieves related knowledge according to subject terms in different fields, and rewrites the preprocessed knowledge by a specified logic language. The dialogue state knowledge is rewritten by a first-order logic language, and the dialogue behavior knowledge is rewritten by a propositional logic language. Sample dialogue state knowledge about a dialogue state knowledge base is shown in fig. 4, and sample dialogue action knowledge about a dialogue action knowledge base is shown in fig. 5.
In some possible implementations, the dialog behavior includes object-side dialog behavior and dialog system-side dialog behavior; the dialogue acts on the dialogue system side can be roughly divided into: question, notice, request, notice success, notice failure, guidance, acknowledgement, negation, correction, and tattooing. The dialogue acts on the object side can be roughly divided into: notification, request, negative intent, negative proposition, confirmation proposition, selection, thank you, and tattooing.
For dialogue behavior on the dialogue system side, notification refers to a specific slot and a corresponding slot value in a certain field, and is a response to notification/request/negative intention/negative proposition of an object. And notification success and notification failure are responses to an object to determine a proposition. In addition, the negative intent may be to cancel a previously made reservation; is a negative proposition that a BB restaurant, such as "AA place, given in a dialogue system meets your requirements, can be? "reply to the object or condition is followed by a negative determination of the proposition of the object or condition. The confirmation proposition is a request after the slot value is changed for the dialogue state where the slot value is not null. A request generally refers to a proposition that fills a slot value for a dialog state with a slot value of empty.
303. And a knowledge merging module of the data management server is operated.
Since knowledge from different sources may have different representations of the same concept, for example, "university a" and "S province a da" refer to one concept but different representations, i.e. the two have the same meaning but different expressions, the embodiment of the application achieves conceptual unification and alignment of knowledge from different sources through the knowledge merging module.
In some possible implementations, the conceptual set of the dialog state knowledge base is a superset of the set of slots and corresponding set of slot values for the dialog state; the conceptual set of the conversational behavior knowledge base is a superset of the set of conversational behavior instances. Here, intent is an instance of conversational behavior, and conversational behavior is a top-level concept of intent.
In addition, the concept set for the dialog state knowledge base includes other concepts in addition to the above-described slot set and corresponding slot value set, which are used to connect slots and slot values of different domains. For example, for a slot such as "restaurant-place", the corresponding slot value is innumerable, but must belong to a certain "province", a certain "city", a certain "street", where "province", "city" and "street" are concepts outside the two sets but still belong to the concept set of the dialog state knowledge base.
In other possible implementations, when conceptually unifying and aligning knowledge of different sources, a small number of aligned concept pairs may be collected in advance by way of manual judgment as alignment seeds, for example, to determine a small number of concept pairs regarding dialogue states and a small number of concept pairs of dialogue acts; and then automatically mining more alignment concept pairs according to the alignment seeds to realize the concept of aligning different source knowledge about dialogue states and dialogue behaviors.
In other possible implementations, the automatic mining of more alignment concept pairs based on alignment seeds may be implemented as follows: utilizing the alignment seeds to embed concepts of different source knowledge about dialogue states and dialogue behaviors into a unified vector space, and further completing alignment in the unified vector space according to semantic distances among the concepts; furthermore, each new alignment concept will contribute to the next alignment as an alignment seed. Alternatively, the concept pairs to be aligned may be determined based on the alignment seed, for example, by replacing a concept in the alignment seed, so as to obtain the concept pairs to be aligned, which is not limited herein. Then, for both concepts in the concept pair to be aligned, it is determined whether or not they belong to the concept pair to be aligned based on the similarity in structure of both concepts. Illustratively, structural similarity may be measured by whether the two have similar neighbor concepts in the respective knowledge base, as the application is not limited in this regard.
In summary, the embodiment of the application realizes the concept of aligning knowledge of different sources about dialogue states and dialogue behaviors by adopting a semi-supervised learning mode.
304. And operating a knowledge version management module of the data management server.
The knowledge version management module is responsible for realizing the updating of the dialogue management knowledge base, namely checking the logic difference between the knowledge of the new version and the knowledge of the old version, and uploading the updated part of the knowledge of the new version compared with the updated part of the knowledge of the old version to the dialogue management knowledge base. It should be noted that this step of knowledge updating is implemented on the data management server. The difference from checking the version of knowledge in step 307 described below is that the dialog system server is used to run a dialog system service, on which is stored a version of knowledge, which is not updated in real time, is checked only during maintenance by polling the open thread and in case a new version of knowledge is present, the new version of knowledge is obtained from the data management server.
305. The dialogue system server utilizes the dialogue corpus to fine tune the natural language understanding module and the natural language generating module.
In some possible implementations, the natural language understanding module and the natural language generating module perform training in a pretraining and trimming manner. Illustratively, the natural language understanding module and the natural language generating module are deep learning models pre-trained on a large-scale public dialogue corpus, such as BERT (Bidirectional Encoder Representation from Transformers, bi-directional coded representation based on a converter) models; and then, fine-tuning the two BERT models by utilizing a pre-marked dialogue corpus, thereby obtaining a natural language understanding module and a natural language generating module.
In other possible implementations, the input of the natural language understanding module is natural language text, for example, the speaking of the object in the current round is output as the speaking intention and the proposition entity recognition result of the object in the current round; and filling slots according to the speaking intention of the current round object and the named entity recognition result to obtain a dialogue state recognition result. The input of the natural language generation module is the dialogue behavior and dialogue state recognition result of the dialogue system in the current round, and the input is the reasonable reply aiming at the current round object speaking.
306. The dialog system server initiates a dialog system service.
Wherein the dialog system service is started, also called enabling the dialog system service or running the dialog system service. As shown in fig. 2, after the natural language text input by the object passes through the natural language understanding module and the dialogue management module, dialogue state data and dialogue behavior data after being corrected by knowledge are obtained, and then the dialogue state data and the dialogue behavior data are transmitted into the natural language generating module to generate reasonable replies aiming at the current round of object speaking, and then the generated reasonable replies are returned to the object in a natural language form through the output module.
307. The dialogue system server starts a thread to poll and check knowledge version, and judges whether new version knowledge exists; in response to not detecting the new version knowledge, running a dialog system service; in response to detecting the new version knowledge, determining whether an ongoing conversation exists; in response to there being no ongoing session, suspending the session system service, running the first update module; in response to the presence of an ongoing dialog, the dialog system service is prompted to pause for a time, and after the time is reached, the dialog system service is paused and the first update module is run.
In an embodiment of the application, in response to checking new version knowledge by thread polling and there is currently an ongoing conversation, the time to pause the conversation system service is set and the object is notified. And after the set time is reached, suspending the dialogue system service, running a first updating module, and updating the dialogue management knowledge base. And after the knowledge base is updated, continuing to operate the dialogue system server.
In summary, the embodiment of the application discloses an intelligent dialogue scheme based on knowledge base and deduction learning, and the embodiment of the application firstly generates a knowledge base which is applicable to open domain dialogue under weak supervision, namely the dialogue management knowledge base through a knowledge multiplexing module, a knowledge merging module and an acquired multisource public knowledge base. Then, the anti-deduction learning module performs anti-deduction reasoning operation on the output of the natural language understanding module in combination with the dialogue management knowledge base to obtain a corrected dialogue state recognition result; and further, the dialogue behavior optimization module infers the dialogue behavior of the current round of dialogue system according to the corrected dialogue state recognition result, the current round of input sentences and the dialogue management knowledge base. The intelligent dialogue scheme combines an external knowledge base, so that the dependence of a model on annotation data can be reduced, more reasonable dialogue states and dialogue behaviors can be obtained through deduction reasoning, more reasonable reply sentences can be finally obtained, and the dialogue quality is improved. In addition, the dialogue state knowledge expressed by the first-order logic language and the dialogue behavior knowledge expressed by the propositional logic language are used, so that the method has the characteristics of high expressive force, high reasoning performance and low multiplexing and maintenance cost. In other words, the robustness and the interpretability of the dialogue state recognition and the dialogue behavior recognition in the case of weak supervision can be improved.
In addition, the natural language understanding module and the natural language generating module may also use other sequence-to-sequence deep learning models, and the application is not limited herein.
FIG. 6 is a flowchart illustrating a method of intelligent dialog, according to an exemplary embodiment. The method is executed by a dialogue system server, and referring to fig. 6, the method includes:
601. the dialogue system server obtains the input sentence of the target object in the current round.
During a conversation, a target object enters natural language text, referred to herein as an input sentence, through a terminal. Alternatively, the input sentence is in a natural language form.
602. The dialogue system server identifies dialogue intention of the target object in the current round based on the input sentence; carrying out named entity recognition on the input sentence to obtain a named entity appearing in the input sentence; according to the dialogue intention of the target object in the current round and the named entity appearing in the input sentence, filling the slot to obtain initial dialogue state data, and obtaining the initial dialogue state data of the current round; wherein the initial dialog state data includes a slot determined based on the input statement and a slot value matching the slot.
This step is accomplished by the natural language understanding module 11 shown in fig. 2. In some possible implementations, the natural language understanding module 11 performs a series of processes on the input sentence in the following manner, so as to obtain initial dialog state data of the current round.
Wherein, prior to intent recognition, a good intent category needs to be predefined. By way of example, the definition of intent categories may be set according to a particular task or a particular scenario, such as intent may include categories such as take-out, hotel reservation, entrance ticket reservation, movie ticket reservation, or air ticket reservation, to name a few.
In other possible implementations, in performing intent recognition, the intent of the target object in the current round may be recognized based on the input sentence alone, or the intent of the target object in the current round may be recognized based on the input sentence and the related history dialog, which is not limited herein. Wherein, the history dialogue refers to dialogue between the target object and the dialogue system server before the current round.
The named entity recognition is also called special name recognition, and refers to the recognition of entities with specific meaning in text, such as a person name, a place name, an organization name or a proper noun.
In the embodiment of the present application, after the natural language understanding module 11 obtains the intention recognition result and the named entity, slot filling can be performed. Illustratively, the slots corresponding to each intent category may be predefined, and the application is not limited in this regard. After determining the slot, slot filling may be completed based on the identified named entity. In addition, in the slot filling process, a situation that some slot values are not recognized may occur, and at this time, slot filling may be completed based on a slot prediction, where a dialog system server first needs to make a prediction when some slot values are not recognized in an input sentence, instead of directly obtaining the slot values by interacting with a target object.
In other possible implementations, after the named entity is identified, in order to generate a more reasonable reply sentence later, word disambiguation may also be completed by the entity linking module 121 shown in fig. 2 through an entity linking manner, so that the dialog system server can more accurately understand the semantics of the input sentence, which is not limited in this disclosure.
603. The dialogue system server corrects the initial dialogue state data based on the dialogue management knowledge base to obtain corrected dialogue state data; the dialogue management knowledge base comprises dialogue state knowledge and dialogue behavior knowledge; the dialogue state knowledge is used for restraining the relation between different dialogue states; the dialogue-behavior knowledge is used to constrain the relationships between different dialogue behaviors.
This step is accomplished by the deduction learning module 122 shown in fig. 2. In the embodiment of the present application, the inputs of the deduction learning module 122 are the dialogue management knowledge base (which represents knowledge by using a logic language) and the initial dialogue state data (the initial dialogue state recognition result), and the outputs are corrected dialogue state data, that is, the corrected dialogue state recognition result. Illustratively, the deduction learning module 122 is a model combining machine learning and logical reasoning methods in an embodiment of the present application. Illustratively, the deductive learning module 122 corrects the natural language understanding model using the dialogue state knowledge base, wherein the direct correction is the dialogue state recognition result output by the natural language understanding model, but in the learning process, the correction uses a back propagation manner to correct the model parameters of the natural language understanding model.
Where the deductive learning is also called deductive reasoning, given the observation facts and the background knowledge, a hypothesis is found that can interpret the observation facts and agree with the background knowledge, which is logically called deductive reasoning. In another expression, the deductive meaning refers to the process of selectively deducing certain hypotheses explaining a phenomenon according to background knowledge. By way of example, the reasoning mode of the deductive reasoning can be described as α→β, where α→β belongs to a rule in the knowledge base, i.e. corresponds to the background knowledge described above; beta belongs to a phenomenon, namely corresponds to the observation fact; alpha is an explanation for beta, a hypothetical explanation that can explain the phenomenon. Deductive learning can be regarded as a special weakly supervised learning, the supervised information of which comes not only from the real labels, but also from logical reasoning. Further, the anti-deductive learning can be regarded as a weakly supervised learning of the enhanced version, through which a good model can be learned even without sufficient marked or unmarked data if there is good knowledge.
In some possible implementations, the initial dialog state data is modified based on the dialog management knowledge base to obtain modified dialog state data, including but not limited to, the following:
6031. and replacing slot values in the initial dialogue state data according to the target priority order to obtain updated dialogue state data in response to the fact that the instance matched with the input sentence is not retrieved based on the initial dialogue state data.
For example, an instance that matches the input statement may be retrieved in a database. Wherein the database stores knowledge in the form of (concept, attribute, instance) triples, the application is not limited in this regard.
6032. In response to not retrieving an instance matching the input sentence based on the updated dialog state data, continuing to perform slot value substitution until an instance matching the input sentence is retrieved; with the retrieved instance as an interpretation of the deductive reasoning, the satisfaction of the dialog state knowledge in the dialog management knowledge base as rules of the deductive reasoning and expressed in the first order logical language is determined.
Illustratively, replacing slot values in the initial dialog state data in the target priority order includes, but is not limited to, the following: determining a first type of slot with an empty slot value in the initial dialogue state data, and preferentially assigning the slot value for the first type of slot; accordingly, in response to not retrieving an instance matching the input statement based on the updated dialog state data, continuing the slot value replacement until an instance matching the input statement is retrieved, including: in response to not retrieving an instance matching the input statement based on the updated dialog state data, continuing to assign new slot values to the first class of slots in an enumerated manner; and in response to not retrieving the instance matching the input sentence by assigning the slot value to the first type of slot, continuing to replace the slot value of the second type of slot until retrieving the instance matching the input sentence, wherein the second type of slot is a slot with a non-null slot value in the initial dialog state data.
It should be noted that, if a proposition formula is not a perpetual one, it is called satisfiable, and the satisfiability problem is used to determine whether a proposition formula is satisfiable.
6033. And responding to the satisfaction value of the target dialogue state knowledge as a target numerical value, and taking the dialogue state data updated last as corrected dialogue state data.
Illustratively, the target value in the embodiment of the present application is 1, which is not limited herein.
The function and function of the deduction learning module 122 is illustrated below in connection with fig. 4.
The intent of the session listed in fig. 4 is to reserve a restaurant, and the relevant slots are determined and slot filling is initially completed (box Bian Xuxian left in fig. 4), i.e., corresponding to the initial session state data described above; thereafter, the dialog state shown in the left Bian Xuxian box in fig. 4 is used to retrieve the eligible instance. However, due to errors caused by the lack of knowledge by the natural language understanding module in identifying dialog states, it is likely that satisfactory instances are not retrieved. For example, with respect to fig. 4, the natural language understanding module recognizes that the requirement is to find "restaurant environment" with "parking lot", and because of the lack of knowledge, the natural language understanding module does not understand that "restaurant has the same meaning as" restaurant has parking lot "and" restaurant location (e.g., mall) has parking lot ", so that" location environment "in fig. 4 is recognized as" NULL ", and no satisfactory example is retrieved using such dialogue state recognition result, but example AA restaurant is actually satisfactory as shown in fig. 4. Since no satisfactory examples are retrieved, the satisfaction of the calculation is 0.
In the case that the dialogue system server cannot retrieve the satisfactory example, the embodiment of the application solves the problem that the satisfactory example cannot be retrieved through the deduction learning module.
For example, the slot value in the dialog state recognition result may be replaced by an enumeration method, for example, a slot with a null slot value is preferentially replaced, that is, a slot "location environment" may be enumerated for the slot, for example, a slot with a parking lot or a slot without a parking lot may be enumerated for the slot; if the slot position value is designated as 'no parking lot', no satisfactory example is still searched based on the updated dialogue state recognition result; if a slot value is designated as ' having a parking lot ', an instance AA restaurant meeting the requirements can be retrieved based on the updated dialogue state recognition result, and then, the satisfaction of dialogue state knowledge serving as a rule of the anti-deduction reasoning In a dialogue state knowledge base is calculated by utilizing the retrieved instance AA restaurant as an explanation of the anti-deduction reasoning, wherein the knowledge related to the parking lot is ' In (restaurant, mall) & gtHas (restaurant, parking lot) & gt, wherein, V is a conjunctive word similar to ' and '; the "implication" word is similar to "push" and 1 a 1 indicates that the satisfaction of the knowledge is 1 and the condition is satisfied. Thus, the current dialog state recognition result can be reasonably corrected.
In (restaurant, mall) "means that the place of the restaurant is a mall, and" Has (restaurant, parking lot) "means that the" restaurant environment "of the restaurant Has a parking lot. It should be noted that In (restaurant, mall) →has (restaurant, parking lot) is a compound proposition, where Has (restaurant, parking lot) is a conclusion, in (restaurant, mall) →has (shopping lot, parking lot) is a precondition, and the compound proposition is true In the case where both the precondition and conclusion are true. In addition, the premise itself is also a form of coincidence proposition linked by conjunctions; if and only if both propositions associated with the conjunctions are true, the corresponding compound proposition is true.
In the embodiment of the application, the natural language understanding model is obtained by retraining a pre-trained deep learning model based on dialogue corpus. Illustratively, the natural language understanding module is a pre-trained and fine-tuned BERT model. Wherein the updating process of the natural language understanding model includes, but is not limited to, adopting the following modes: acquiring dialogue state data after multiple rounds of correction in the dialogue process; and updating the model parameters of the natural understanding model according to the dialogue state data after the correction of the plurality of rounds. This update process is completed by the second update module 123 in fig. 4. That is, the second updating module 123 inputs the dialog state recognition result after the current modification, and the natural language understanding module is updated together during the update of the knowledge of the dialog system server by starting the fine tuning thread for the natural language understanding module, which is not limited herein.
604. The dialogue system server acquires dialogue behavior data of the current round based on the corrected dialogue state data, the input sentences and the dialogue management knowledge base; wherein, the dialogue action data is used for representing the dialogue intention of the dialogue system at the current round.
This step is accomplished by the dialog behavior optimization module 124 shown in fig. 2. Illustratively, the dialogue action optimization module 124 inputs the corrected dialogue state recognition result of the current round, the input sentence of the target object of the current round and the dialogue action knowledge base, and outputs the dialogue action as the current round dialogue system server. In the embodiment of the present application, the dialogue action knowledge is if-then dialogue action knowledge, where if-then represents a logic formula, indicating that if condition a occurs, action B is performed.
The function and function of the dialog behavior optimization module 124 is illustrated below in connection with fig. 5.
As shown in fig. 5, in the first round of dialogue, "help me reserve a sichuan museum within 1km from here" comes from the object, the corresponding object side dialogue action is "request", the dialogue system server cannot retrieve the example meeting the condition, reply "sorry, no sichuan museum within 1 km" according to the retrieval result, the corresponding object side dialogue action is "notify failure". In connection with the dialog behavior knowledge "notification failure→boot" shown in fig. 5, the dialog behavior optimization module 124 determines that the dialog behavior on the dialog system side of the round is "boot" and therefore the dialog system follows the boot statement "do need to relax condition".
In the second round of dialogue, the user modifies the condition and notifies the new condition of the dialogue system that the new condition is within 5km, the corresponding object side dialogue action is "confirm proposition", the dialogue action optimization module 124 determines that the dialogue action on the dialogue system side of the round is "correct" and "confirm" in combination with the dialogue action knowledge "confirm proposition→correct" and "confirm" shown in fig. 5, so that the dialogue system replies "well, and the tendril-leaved museum within 5km is? Is not required. Finally, confirm again "do with demand" to the object, the object replies "yes. Without "the corresponding object side dialog behavior is" confirm intent ".
605. The dialogue system server generates a reply sentence of which the current round matches the input sentence based on the corrected dialogue state data and dialogue behavior data.
The step is completed by the natural language generating module 13 shown in fig. 2, wherein the reply sentence is in a natural language form, and is a reasonable reply to the input sentence input by the target object through the terminal.
In some possible implementations, the natural language generation module is a deep learning model pre-trained on a large-scale public conversation corpus, such as the deep learning model is a BERT model; and then, fine-tuning the BERT model by utilizing a pre-marked dialogue corpus, thereby obtaining the natural language generation module. Illustratively, the labels used to train the dialog corpus of the natural language generation module are dialog corpora labeled with dialog states and dialog behaviors.
606. The dialog system server outputs a reply sentence to the target object.
This step is completed by the output module 14 shown in fig. 2, and the output module 14 is responsible for converting the reply sentence into a corresponding output format and outputting the corresponding output format to the terminal of the target object.
In other possible implementations, fig. 2 further includes a first updating module 15, also referred to as a dictionary updating module, where, illustratively, the first updating module 15 is responsible for updating the named entity dictionary, the intention dictionary, and the dialogue-action dictionary, and after the updating, the dialogue-system service is started. In addition, the dictionary used by the dialog system server is static prior to the next update.
The intelligent dialogue scheme provided by the embodiment of the application introduces additional information, namely a dialogue management knowledge base; wherein the dialogue management knowledge base comprises dialogue state knowledge and dialogue behavior knowledge; the dialogue state knowledge is used for restraining the relation between different dialogue states; the dialogue action knowledge is used for restraining the relation among different dialogue actions; in the dialogue process of the current round, after an input sentence of a target object is acquired, the embodiment of the application firstly carries out a series of processing on the input sentence to obtain initial dialogue state data of the current round, wherein the initial dialogue state data comprises a slot position determined based on the input sentence and a slot position value matched with the slot position; then, correcting the initial dialogue state data based on the dialogue management knowledge base, and further obtaining dialogue action data of the current round based on the corrected dialogue state data, the input sentences and the dialogue management knowledge base, wherein the dialogue action data is used for representing dialogue intention of a dialogue system in the current round; the dialogue state and the dialogue behavior can be identified more reasonably and accurately by introducing the additional information, and more reasonable reply sentences can be generated based on reasonable and accurate dialogue state identification results and dialogue behavior identification results, so that the situation of answering questions is avoided, and the dialogue quality is remarkably improved.
In summary, the embodiment of the application discloses an intelligent dialogue scheme based on knowledge base and deduction learning, and the embodiment of the application firstly generates a knowledge base which is applicable to open domain dialogue under weak supervision, namely the dialogue management knowledge base through a knowledge multiplexing module, a knowledge merging module and an acquired multisource public knowledge base. Then, the anti-deduction learning module performs anti-deduction reasoning operation on the output of the natural language understanding module in combination with the dialogue management knowledge base to obtain a corrected dialogue state recognition result; and further, the dialogue behavior optimization module infers the dialogue behavior of the current round of dialogue system according to the corrected dialogue state recognition result, the current round of input sentences and the dialogue management knowledge base. The intelligent dialogue scheme combines an external knowledge base, so that the dependence of a model on annotation data can be reduced, more reasonable dialogue states and dialogue behaviors can be obtained through deduction reasoning, more reasonable reply sentences can be finally obtained, and the dialogue quality is improved. In addition, the dialogue state knowledge expressed by the first-order logic language and the dialogue behavior knowledge expressed by the propositional logic language are used, so that the method has the characteristics of high expressive force, high reasoning performance and low multiplexing and maintenance cost. In other words, the robustness and the interpretability of the dialogue state recognition and the dialogue behavior recognition in the case of weak supervision can be improved.
Fig. 7 is a schematic diagram illustrating a structure of an intelligent dialog device according to an exemplary embodiment. Referring to fig. 7, the apparatus includes:
an obtaining unit 701 configured to obtain an input sentence of a target object at a current round;
a first processing unit 702 configured to identify a dialog intention of the target object at a current round based on the input sentence; carrying out named entity recognition on the input sentence to obtain a named entity appearing in the input sentence; according to the dialogue intention of the target object in the current round and the named entity appearing in the input sentence, filling the slot to obtain initial dialogue state data of the current round; wherein the initial dialog state data includes a slot determined based on the input statement and a slot value that matches the slot;
a second processing unit 703 configured to modify the initial session state data based on a session management knowledge base, to obtain modified session state data; wherein the dialogue management knowledge base comprises dialogue state knowledge and dialogue behavior knowledge; the dialogue state knowledge is used for restraining relations among different dialogue states; the dialogue action knowledge is used for restraining the relation among different dialogue actions;
A third processing unit 704 configured to obtain dialogue action data of a current round based on the revised dialogue state data, the input sentence, and the dialogue management knowledge base; the dialogue action data are used for representing dialogue intentions of the dialogue system in the current round;
a generating unit 705 configured to generate a reply sentence in which a current round matches the input sentence, based on the corrected dialogue state data and the dialogue behavior data;
a sending unit 706 configured to output the reply sentence to the target object.
The intelligent dialogue scheme provided by the embodiment of the application introduces additional information, namely a dialogue management knowledge base; wherein the dialogue management knowledge base comprises dialogue state knowledge and dialogue behavior knowledge; the dialogue state knowledge is used for restraining the relation between different dialogue states; the dialogue action knowledge is used for restraining the relation among different dialogue actions; in the dialogue process of the current round, after an input sentence of a target object is acquired, the embodiment of the application firstly carries out a series of processing on the input sentence to obtain initial dialogue state data of the current round, wherein the initial dialogue state data comprises a slot position determined based on the input sentence and a slot position value matched with the slot position; then, correcting the initial dialogue state data based on the dialogue management knowledge base, and further obtaining dialogue action data of the current round based on the corrected dialogue state data, the input sentences and the dialogue management knowledge base, wherein the dialogue action data is used for representing dialogue intention of a dialogue system in the current round; the dialogue state and the dialogue behavior can be identified more reasonably and accurately by introducing the additional information, and more reasonable reply sentences can be generated based on reasonable and accurate dialogue state identification results and dialogue behavior identification results, so that the situation of answering questions is avoided, and the dialogue quality is remarkably improved.
In some possible implementations, the dialog management repository includes a dialog state repository and a dialog behavior repository; the apparatus further comprises:
a data management unit configured to acquire knowledge from a plurality of data sources, and perform data preprocessing on the acquired knowledge; classifying the preprocessed dialogue state knowledge according to the subject matters in different fields to obtain the dialogue state knowledge in different fields; adopting a first-order logic language to respectively re-describe the dialogue state knowledge which is pre-processed and then described by natural language according to the field to form the dialogue state knowledge base; and re-describing the dialogue action knowledge which is described by natural language after preprocessing by adopting a propositional logic language to form the dialogue action knowledge base.
In some possible implementations, the first processing unit is configured to:
performing intention recognition, named entity recognition and slot filling on the input sentence based on a natural language understanding model to obtain the initial dialogue state data; the natural language understanding model is obtained by retraining a pre-trained deep learning model based on dialogue corpus;
Wherein the updating process of the natural language understanding model comprises the following steps:
acquiring dialogue state data after multiple rounds of correction in the dialogue process;
and updating model parameters of the natural understanding model according to the dialogue state data after the multi-round correction.
In some possible implementations, the second processing unit is configured to:
in response to the initial dialog state data not retrieving an instance matching the input statement, replacing slot values in the initial dialog state data in a target priority order to obtain updated dialog state data;
in response to not retrieving an instance matching the input sentence based on the updated dialog state data, continuing to perform slot value replacement until an instance matching the input sentence is retrieved;
determining satisfaction of dialogue state knowledge in the dialogue management knowledge base as rules of the deduction reasoning and expressed in a first order logical language with the retrieved instance as an explanation of the deduction reasoning;
and responding to the satisfaction value of the target dialogue state knowledge as a target numerical value, and taking the dialogue state data updated last as the corrected dialogue state data.
In some possible implementations, the second processing unit is configured to:
determining a first type of slot with an empty slot value in the initial dialogue state data, and preferentially assigning the slot value for the first type of slot to obtain updated dialogue state data;
in response to not retrieving an instance matching the input statement based on the updated dialog state data, continuing to assign a new slot value to the first class of slots in an enumerated manner;
and in response to the fact that the instance matched with the input statement is not retrieved by designating the slot value for the first type of slot, continuing to replace the slot value of the second type of slot until the instance matched with the input statement is retrieved, wherein the second type of slot is a slot with a non-empty slot value in the initial dialogue state data.
Any combination of the above-mentioned optional solutions may be adopted to form an optional embodiment of the present disclosure, which is not described herein in detail.
It should be noted that: in the intelligent dialogue device provided in the above embodiment, only the division of the above functional modules is used for illustration, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the intelligent dialogue device and the intelligent dialogue method provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the intelligent dialogue device and the intelligent dialogue method are detailed in the method embodiments and are not repeated here.
Fig. 8 is a schematic structural diagram of a computer device 800 according to an embodiment of the present application. The computer 800 may be the aforementioned dialog system server or data management server. The computer device 800 may be configured or configured to vary greatly, and may include one or more processors (Central Processing Units, CPU) 801 and one or more memories 802, where the memories 802 store at least one program code that is loaded and executed by the processors 801 to implement the intelligent dialog method provided by the various method embodiments described above. Of course, the computer device 800 may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
In an exemplary embodiment, a computer readable storage medium, e.g. a memory comprising program code, executable by a processor in a computer device to perform the intelligent dialog method of the above-described embodiment, is also provided. For example, the computer readable storage medium may be Read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), compact disc Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM), magnetic tape, floppy disk, optical data storage device, and the like.
In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or computer program comprising computer program code stored in a computer readable storage medium, the computer program code being read from the computer readable storage medium by a processor of a computer device, the computer program code being executed by the processor, causing the computer device to perform the above-described intelligent dialog method.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the present application is not intended to limit the application, but rather, the application is to be construed as limited to the appended claims.

Claims (10)

1. A method of intelligent dialog, the method comprising:
acquiring an input sentence of a target object in a current round;
Identifying the dialogue intention of the target object in the current round based on the input sentence;
carrying out named entity recognition on the input sentence to obtain a named entity appearing in the input sentence;
according to the dialogue intention of the target object in the current round and the named entity appearing in the input sentence, filling the slot to obtain initial dialogue state data of the current round; wherein the initial dialog state data includes a slot determined based on the input statement and a slot value that matches the slot;
correcting the initial dialogue state data based on a dialogue management knowledge base to obtain corrected dialogue state data; wherein the dialogue management knowledge base comprises dialogue state knowledge and dialogue behavior knowledge; the dialogue state knowledge is used for restraining relations among different dialogue states; the dialogue action knowledge is used for restraining the relation among different dialogue actions;
based on the corrected dialogue state data, the input sentences and the dialogue management knowledge base, acquiring dialogue behavior data of the current round; the dialogue action data are used for representing dialogue intentions of the dialogue system in the current round;
Generating a reply sentence of which the current round is matched with the input sentence based on the corrected dialogue state data and the dialogue behavior data;
and outputting the reply sentence to the target object.
2. The method of claim 1, wherein the dialog management repository comprises a dialog state repository and a dialog behavior repository; the method further comprises the steps of:
acquiring knowledge from a plurality of data sources, and performing data preprocessing on the acquired knowledge;
classifying the preprocessed dialogue state knowledge according to the subject matters in different fields to obtain the dialogue state knowledge in different fields;
adopting a first-order logic language to respectively re-describe the dialogue state knowledge which is pre-processed and then described by natural language according to the field to form the dialogue state knowledge base;
and re-describing the dialogue action knowledge which is described by natural language after preprocessing by adopting a propositional logic language to form the dialogue action knowledge base.
3. The method according to claim 1, wherein the method further comprises:
performing intention recognition, named entity recognition and slot filling based on a natural language understanding model to obtain the initial dialogue state data; the natural language understanding model is obtained by retraining a pre-trained deep learning model based on dialogue corpus;
Wherein the updating process of the natural language understanding model comprises the following steps:
acquiring dialogue state data after multiple rounds of correction in the dialogue process;
and updating model parameters of the natural understanding model according to the dialogue state data after the multi-round correction.
4. The method of claim 1, wherein modifying the initial dialog state data based on a dialog management knowledge base to obtain modified dialog state data comprises:
in response to the initial dialog state data not retrieving an instance matching the input statement, replacing slot values in the initial dialog state data in a target priority order to obtain updated dialog state data;
in response to not retrieving an instance matching the input sentence based on the updated dialog state data, continuing to perform slot value replacement until an instance matching the input sentence is retrieved;
determining satisfaction of dialogue state knowledge in the dialogue management knowledge base as rules of the deduction reasoning and expressed in a first order logical language with the retrieved instance as an explanation of the deduction reasoning;
and responding to the satisfaction value of the target dialogue state knowledge as a target numerical value, and taking the dialogue state data updated last as the corrected dialogue state data.
5. The method of claim 4, wherein replacing slot values in the initial dialog state data in a target priority order comprises:
determining a first type of slot with an empty slot value in the initial dialogue state data, and preferentially assigning a slot value for the first type of slot;
and in response to not retrieving an instance matching the input sentence based on the updated dialog state data, continuing to perform slot value replacement until an instance matching the input sentence is retrieved, including:
in response to not retrieving an instance matching the input statement based on the updated dialog state data, continuing to assign a new slot value to the first class of slots in an enumerated manner;
and in response to the fact that the instance matched with the input statement is not retrieved by designating the slot value for the first type of slot, continuing to replace the slot value of the second type of slot until the instance matched with the input statement is retrieved, wherein the second type of slot is a slot with a non-empty slot value in the initial dialogue state data.
6. An intelligent dialog device, the device comprising:
the acquisition unit is configured to acquire an input sentence of a target object in a current round;
A first processing unit configured to identify a dialog intention of the target object at a current round based on the input sentence; carrying out named entity recognition on the input sentence to obtain a named entity appearing in the input sentence; according to the dialogue intention of the target object in the current round and the named entity appearing in the input sentence, filling the slot to obtain initial dialogue state data of the current round; wherein the initial dialog state data includes a slot determined based on the input statement and a slot value that matches the slot;
the second processing unit is configured to correct the initial dialogue state data based on a dialogue management knowledge base to obtain corrected dialogue state data; wherein the dialogue management knowledge base comprises dialogue state knowledge and dialogue behavior knowledge; the dialogue state knowledge is used for restraining relations among different dialogue states; the dialogue action knowledge is used for restraining the relation among different dialogue actions;
a third processing unit configured to acquire dialogue behavior data of a current round based on the corrected dialogue state data, the input sentence, and the dialogue management knowledge base; the dialogue action data are used for representing dialogue intentions of the dialogue system in the current round;
A generation unit configured to generate a reply sentence in which a current round matches the input sentence, based on the corrected dialogue state data and the dialogue behavior data;
and a transmitting unit configured to output the reply sentence to the target object.
7. The method of claim 6, wherein the dialog management repository comprises a dialog state repository and a dialog behavior repository; the apparatus further comprises:
a data management unit configured to acquire knowledge from a plurality of data sources, and perform data preprocessing on the acquired knowledge; classifying the preprocessed dialogue state knowledge according to the subject matters in different fields to obtain the dialogue state knowledge in different fields; adopting a first-order logic language to respectively re-describe the dialogue state knowledge which is pre-processed and then described by natural language according to the field to form the dialogue state knowledge base; and re-describing the dialogue action knowledge which is described by natural language after preprocessing by adopting a propositional logic language to form the dialogue action knowledge base.
8. A computer device, characterized in that it comprises a processor and a memory in which at least one program code is stored, said at least one program code being loaded and executed by said processor to implement the intelligent dialog method according to any of claims 1 to 5.
9. A computer readable storage medium having stored therein at least one program code loaded and executed by a processor to implement the intelligent dialog method of any of claims 1 to 5.
10. A computer program product or computer program, characterized in that the computer program product or computer program comprises computer program code, which is stored in a computer-readable storage medium, from which computer program code a processor of a computer device reads, which processor executes the computer program code, so that the computer device performs the intelligent dialog method as claimed in any of claims 1 to 5.
CN202211017859.4A 2022-08-24 2022-08-24 Intelligent dialogue method, device, equipment and storage medium Pending CN117009469A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211017859.4A CN117009469A (en) 2022-08-24 2022-08-24 Intelligent dialogue method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211017859.4A CN117009469A (en) 2022-08-24 2022-08-24 Intelligent dialogue method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117009469A true CN117009469A (en) 2023-11-07

Family

ID=88569765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211017859.4A Pending CN117009469A (en) 2022-08-24 2022-08-24 Intelligent dialogue method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117009469A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117972069A (en) * 2024-04-01 2024-05-03 南京信人智能科技有限公司 Method for carrying out active dialogue and knowledge base vector search based on artificial intelligence

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117972069A (en) * 2024-04-01 2024-05-03 南京信人智能科技有限公司 Method for carrying out active dialogue and knowledge base vector search based on artificial intelligence
CN117972069B (en) * 2024-04-01 2024-05-28 南京信人智能科技有限公司 Method for carrying out active dialogue and knowledge base vector search based on artificial intelligence

Similar Documents

Publication Publication Date Title
US10909152B2 (en) Predicting intent of a user from anomalous profile data
US10891956B2 (en) Customizing responses to users in automated dialogue systems
Scheutz et al. An overview of the distributed integrated cognition affect and reflection diarc architecture
Brézillon Context in problem solving: A survey
US9361884B2 (en) Communicating context across different components of multi-modal dialog applications
US20140257794A1 (en) Semantic Re-Ranking of NLU Results in Conversational Dialogue Applications
CN114429133A (en) Relying on speech analysis to answer complex questions through neuro-machine reading understanding
US11016740B2 (en) Systems and methods for virtual programming by artificial intelligence
US20230305822A1 (en) Machine-Learning Assisted Natural Language Programming System
de Bayser et al. A hybrid architecture for multi-party conversational systems
Burgan Dialogue systems and dialogue management
CN116662522B (en) Question answer recommendation method, storage medium and electronic equipment
Pan et al. Automatically generating and improving voice command interface from operation sequences on smartphones
Malandri et al. ConvXAI: a system for multimodal interaction with any black-box explainer
Longo et al. Caspar: Towards decision making helpers agents for IoT, based on natural language and first order logic reasoning
Matějů et al. An empirical assessment of deep learning approaches to task-oriented dialog management
Chu Recipe bot: The application of conversational ai in home cooking assistant
CN117009469A (en) Intelligent dialogue method, device, equipment and storage medium
KS et al. Conversational Chatbot Builder–Smarter Virtual Assistance with Domain Specific AI
Wang et al. A survey of the evolution of language model-based dialogue systems
Zhao The state-of-art applications of nlp: Evidence from chatgpt
US11847575B2 (en) Knowledge representation and reasoning system and method using dynamic rule generator
CN117971420A (en) Task processing, traffic task processing and task processing model training method
Walker et al. Dialogue management as graph transformations
Raut A virtual chatbot for ITSM application

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