CN117807200A - Construction method and device of dialogue labels - Google Patents

Construction method and device of dialogue labels Download PDF

Info

Publication number
CN117807200A
CN117807200A CN202311735972.0A CN202311735972A CN117807200A CN 117807200 A CN117807200 A CN 117807200A CN 202311735972 A CN202311735972 A CN 202311735972A CN 117807200 A CN117807200 A CN 117807200A
Authority
CN
China
Prior art keywords
dialogue
label
tag
conversation
dialog
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
CN202311735972.0A
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.)
Jingdong City Beijing Digital Technology Co Ltd
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong City Beijing Digital Technology Co Ltd
Jingdong Technology Information 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 Jingdong City Beijing Digital Technology Co Ltd, Jingdong Technology Information Technology Co Ltd filed Critical Jingdong City Beijing Digital Technology Co Ltd
Priority to CN202311735972.0A priority Critical patent/CN117807200A/en
Publication of CN117807200A publication Critical patent/CN117807200A/en
Pending legal-status Critical Current

Links

Landscapes

  • Machine Translation (AREA)

Abstract

The invention discloses a method and a device for constructing a dialogue label, and relates to the technical field of computers. One embodiment of the method comprises the following steps: responding to a dialogue tag construction request, and constructing a first dialogue tag according to the current round dialogue sentences of the current dialogue; generating an upper intention flow according to the intention corresponding to each round of dialogue sentences in the current dialogue, and constructing a second dialogue label according to the upper intention flow; acquiring a history dialogue tag corresponding to the history dialogue according to the information of the interaction parties of the current dialogue, and constructing a third dialogue tag according to the history dialogue tag and the above intention flow; and generating a dialogue tag of the current dialogue according to the first dialogue tag, the second dialogue tag and the third dialogue tag. The embodiment combines the dialogue information of the current dialogue context, the history dialogue and the current round dialogue sentences together to construct the dialogue label, and can combine more dialogue characteristic information to efficiently generate the dialogue label, so that the generated dialogue label is more comprehensive and accurate.

Description

Construction method and device of dialogue labels
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for constructing a dialog label.
Background
Intelligent human-machine conversations, an important interaction mode, have been increasingly applied in numerous business scenarios. When the man-machine interaction occurs or after the interaction is finished, the dialogue information is highly summarized into one or more phrases, namely, dialogue labels are built, which are an important component of the intelligent man-machine interaction and are the essential basis for the subsequent re-interaction.
In the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
the current construction method of the dialogue labels is mostly constructed based on the current dialogue, and focuses on the current dialogue sentences. But relies primarily on the current dialog sentence for dialog tag construction, making the constructed dialog tag less accurate and comprehensive.
Disclosure of Invention
In view of this, the embodiment of the invention provides a method and a device for constructing a dialogue tag, which can construct the dialogue tag by combining the dialogue information of the current dialogue context, the history dialogue and the current round dialogue statement, and can efficiently generate the dialogue tag by combining more dialogue characteristic information, so that the generated dialogue tag is more comprehensive and accurate, and redundancy is avoided.
To achieve the above object, according to an aspect of the embodiments of the present invention, there is provided a method for constructing a dialog tag, including:
responding to a dialogue tag construction request, and constructing a first dialogue tag according to the current round dialogue sentences of the current dialogue;
generating an upper intention flow according to the intention corresponding to each round of dialogue sentences in the current dialogue, and constructing a second dialogue label according to the upper intention flow;
acquiring a history dialogue tag corresponding to a history dialogue according to the information of the interaction parties of the current dialogue, and constructing a third dialogue tag according to the history dialogue tag and the above intention flow;
and generating the dialogue tag of the current dialogue according to the first dialogue tag, the second dialogue tag and the third dialogue tag.
Optionally, constructing the first dialog tag according to the current round dialog sentence of the current dialog includes: extracting keywords from the current round dialogue sentences of the current dialogue through the set regular expression, and taking the extracted keywords as a first dialogue label; or, carrying out intention recognition on the current round dialogue sentence of the current dialogue to obtain the intention of the current round dialogue sentence, and generating a first dialogue label according to the intention of the current round dialogue sentence.
Optionally, generating a context intention stream according to the intention corresponding to each turn of dialogue statement in the current dialogue, and constructing a second dialogue tag according to the context intention stream, including: respectively carrying out intention recognition on each round of dialogue sentences in the current dialogue to obtain the intention of each round of dialogue sentences; splicing the intention of each round of dialogue sentences according to the sequence of each round of dialogue sentences in the current dialogue to generate an intention stream; and generating a second dialog label according to the above intent flow based on the mapping relation between the preset intent flow and the dialog label.
Optionally, constructing a third dialog tag according to the historical dialog tag and the above intent stream includes: splicing the history dialogue tag and the above intention stream to obtain a spliced intention stream; and generating a third dialog label according to the spliced intent flow based on the mapping relation between the preset intent flow and the dialog label.
Optionally, the intention corresponding to each turn of dialogue statement is obtained by intention recognition through a pre-constructed intention recognition model, and the intention recognition model is constructed by the following ways: acquiring a training data set, wherein each training data in the training data set comprises a dialogue sentence and an intention type label thereof; model training is performed using the training dataset to construct the intent recognition model based on a classification model structure.
Optionally, generating a dialog tag of the current dialog according to the first dialog tag, the second dialog tag, and the third dialog tag includes: performing semantic analysis on the first dialogue tag, the second dialogue tag and the third dialogue tag to obtain mutually exclusive dialogue tags; determining a dialogue tag to be deleted from the mutually exclusive dialogue tags according to a preset dialogue tag screening rule; deleting the label to be deleted from the first conversation label, the second conversation label and the third conversation label to obtain a first conversation label set, and taking the first conversation label set as the conversation label of the current conversation.
Optionally, generating a dialog tag of the current dialog according to the first dialog tag, the second dialog tag, and the third dialog tag includes: performing semantic analysis on the first dialogue tag, the second dialogue tag and the third dialogue tag to obtain similar dialogue tags; fusion processing is carried out on the similar conversation labels according to a preset conversation label fusion rule to generate fusion conversation labels; and replacing the similar conversation label in the first conversation label, the second conversation label and the third conversation label with the fusion conversation label to obtain a second conversation label set, and taking the second conversation label set as the conversation label of the current conversation.
Optionally, generating a dialog tag of the current dialog according to the first dialog tag, the second dialog tag, and the third dialog tag includes: performing semantic analysis on the first conversation label, the second conversation label and the third conversation label to obtain a mutual exclusion conversation label and a similar conversation label; determining a dialogue tag to be deleted from the mutually exclusive dialogue tags according to a preset dialogue tag screening rule, and fusing the similar dialogue tags according to a preset dialogue tag fusion rule to generate a fusion dialogue tag; deleting the label to be deleted from the first conversation label, the second conversation label and the third conversation label, replacing the similar conversation label with the fusion conversation label to obtain a third conversation label set, and taking the third conversation label set as the conversation label of the current conversation.
According to another aspect of the embodiment of the present invention, there is provided a device for constructing a dialog tag, including:
the first label construction module is used for responding to the dialogue label construction request and constructing a first dialogue label according to the current round dialogue sentences of the current dialogue;
The second label construction module generates an intention flow according to the intention corresponding to each round of dialogue sentences in the current dialogue, and constructs a second dialogue label according to the intention flow;
the third label construction module acquires a history dialogue label corresponding to the history dialogue according to the information of the interaction parties of the current dialogue, and constructs a third dialogue label according to the history dialogue label and the above intention flow;
and the conversation label generating module is used for generating the conversation label of the current conversation according to the first conversation label, the second conversation label and the third conversation label.
According to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus including: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors realize the construction method of the dialogue labels provided by the embodiment of the invention.
According to still another aspect of the embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the method for constructing a dialog tag provided by the embodiments of the present invention.
One embodiment of the above invention has the following advantages or benefits: constructing a first dialog tag according to a current round dialog sentence of a current dialog by responding to a dialog tag construction request; generating an upper intention flow according to the intention corresponding to each round of dialogue sentences in the current dialogue, and constructing a second dialogue label according to the upper intention flow; acquiring a history dialogue tag corresponding to the history dialogue according to the information of the interaction parties of the current dialogue, and constructing a third dialogue tag according to the history dialogue tag and the above intention flow; according to the technical scheme that the first dialogue label, the second dialogue label and the third dialogue label generate the dialogue label of the current dialogue, the dialogue label is constructed by combining the dialogue information of the current dialogue context, the history dialogue and the current round dialogue statement, and the dialogue label can be efficiently generated by combining more dialogue characteristic information, so that the generated dialogue label is more comprehensive and accurate, and redundancy is avoided.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a method of constructing a dialog tag according to an embodiment of the invention;
FIG. 2 is a schematic diagram of the main blocks of a construction apparatus of a dialog tag according to an embodiment of the present invention;
FIG. 3 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
fig. 4 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those 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 invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the technical scheme disclosed by the invention, the aspects of acquisition, collection, updating, analysis, processing, use, transmission, storage and the like of the related user personal information all conform to the rules of related laws and regulations, are used for legal purposes, and do not violate the popular public order. Necessary measures are taken for the personal information of the user, illegal access to the personal information data of the user is prevented, and the personal information security, network security and national security of the user are maintained.
The extraction or generation of the current dialog labels is mostly based on the dialog that is currently occurring, and the emphasis is focused on the current dialog sentence. However, in many conversations, especially in the case of complex conversations, the important labels that need to be built are closely related to the context of the conversation, including both the context of the current conversation and the content of the historical conversation if present. Therefore, constructing a dialog tag in combination with the dialog context and the current dialog statement is an important research direction of the present invention.
Accordingly, the invention provides a method and a device for realizing efficient, comprehensive and accurate construction of the dialogue labels by utilizing the current dialogue text and combining the previous history dialogue information. By combining the current sentence in the current dialogue, the intention flow information in the current dialogue and the dialogue labels of the history dialogue (in the case of the history dialogue), the dialogue labels of the current dialogue are constructed, and more dialogue characteristic information can be combined to generate the dialogue labels, so that the generated dialogue labels are more comprehensive and accurate.
Fig. 1 is a schematic diagram of main steps of a method for constructing a dialog tag according to an embodiment of the present invention. As shown in fig. 1, the method for constructing a dialog tag according to the embodiment of the present invention mainly includes the following steps S101 to S104.
Step S101: in response to the dialog tag construction request, a first dialog tag is constructed from the current round dialog statements of the current dialog. After the user enters man-machine interaction, the dialogue label construction request can be triggered to be generated so as to construct the dialogue label. Because the current round of dialogue sentences can contain rich information, the invention constructs the first dialogue labels according to the current round of dialogue sentences of the current dialogue in real time in the process of man-machine dialogue.
According to one embodiment of the present invention, constructing a first dialog tag according to a current round dialog sentence of a current dialog may specifically include: extracting keywords from the current round dialogue sentences of the current dialogue through the set regular expression, and taking the extracted keywords as a first dialogue label; or, carrying out intention recognition on the current round dialogue sentence of the current dialogue to obtain the intention of the current round dialogue sentence, and generating a first dialogue label according to the intention of the current round dialogue sentence. The regular expression can be set according to service requirements, and when intention recognition is performed on the current round of sentences, the regular expression can be performed based on a pre-constructed intention recognition model.
In an embodiment of the present invention, the intent recognition model is constructed by: acquiring a training data set, wherein each training data in the training data set comprises a dialogue sentence and an intention type label thereof; model training is performed using the training dataset to construct the intent recognition model based on a classification model structure. Specifically, for a certain dialog scene, a plurality of categories of intentions are predefined, and the definition of the categories is generally self-defined according to manual experience. Training by using a training data set of dialogue sentences labeled with each intention category in advance to obtain parameters of a model. The model structure in the embodiment of the invention is a classification model, and can adopt but not limited to a classification model structure commonly used by TextCNN (text classification model, using convolutional neural network for text classification), biLSTM (bidirectional long and short term memory network, which is a deep neural network architecture), BERT (pre-trained language characterization model) and the like. After model parameter training is completed, the intention recognition model can be obtained.
By inputting the current round of dialogue sentences into the intention recognition model, the most probable one of the predefined intention categories can be output, namely the intention of the current round of dialogue sentences. When the first dialog label is generated according to the intention of the dialog sentence of the current turn, the intention may be directly used as the first dialog label, or the first dialog label may be generated according to the mapping relation between the intention and the dialog label, which is established in advance.
In one embodiment of the present invention, it is assumed that the robot has performed two dialogues with the same user, the contents of which are shown in tables 1 and 2, respectively, below.
TABLE 1 st dialog
TABLE 2 dialog 2. 2
The label "1) in the dialog 1 shown in the above tables 1 and 2 has indicated the purpose" that is, one first dialog label concerning the current dialog obtained according to the intention after the intention recognition by the intention recognition model.
Step S102: generating an intention flow according to the intention corresponding to each round of dialogue sentences in the current dialogue, and constructing a second dialogue label according to the intention flow. Construction of dialog tags is most often tightly coupled to the context of the current dialog, so that dialog tags can be constructed here by way of the context stream. The intention flow is defined as a way of converting the dialogue sentence of each turn in the current dialogue into a predefined intention category and then representing the dialogue information together in the order of the dialogue sentence.
According to one embodiment of the present invention, generating a context intention flow according to the intention corresponding to each turn of dialogue statement in the current dialogue, and constructing a second dialogue tag according to the context intention flow may specifically include: respectively carrying out intention recognition on each round of dialogue sentences in the current dialogue to obtain the intention of each round of dialogue sentences; splicing the intention of each round of dialogue sentences according to the sequence of each round of dialogue sentences in the current dialogue to generate an intention stream; and generating a second dialog label according to the above intent flow based on the mapping relation between the preset intent flow and the dialog label. The intention corresponding to each turn of dialogue statement is obtained by carrying out intention recognition through a pre-constructed intention recognition model, and the intention recognition model is constructed by the following steps of: acquiring a training data set, wherein each training data in the training data set comprises a dialogue sentence and an intention type label thereof; model training is performed using the training dataset to construct the intent recognition model based on a classification model structure.
After the intention corresponding to each round of dialogue sentences is obtained, the intention flow can be generated, and then, a second dialogue label is generated according to the intention flow according to the preset mapping relation between the intention flow of different dialogue scenes and the dialogue label. As in the embodiments shown in tables 1 and 2, the label "2) user himself" in the 1 st dialog is the intention "robot" according to the dialog sentence of dialog round 1: greeting and confirm identity "and intent of dialog statement of dialog round 2" user: confirm and ask for the idea "the above intention flow after splicing" robot: greetings and confirm identity + user: confirm and ask for the meaning ", the preset phrase" user himself "obtained by conversion is used as a second dialog tag of the current dialog.
Step S103: and acquiring a history dialogue tag corresponding to the history dialogue according to the information of the interaction parties of the current dialogue, and constructing a third dialogue tag according to the history dialogue tag and the above intention flow. If the two parties to the interaction have a history of the conversation before the current conversation, the high probability in the current conversation can involve a lot of information contained in the history conversation, which is not explicitly mentioned in the current conversation and belongs to implicit information. In this step a third dialog tag will be constructed by means of the history dialog tag in combination with the above-mentioned intention flow of the current dialog.
According to one embodiment of the present invention, constructing a third dialog tag according to the historical dialog tag and the above intent stream may specifically include: splicing the history dialogue tag and the above intention stream to obtain a spliced intention stream; and generating a third dialog label according to the spliced intent flow based on the mapping relation between the preset intent flow and the dialog label. In the embodiment of the invention, when intention recognition is needed, the intention recognition model constructed in the embodiment can be used for carrying out the intention recognition.
As in the embodiments shown in tables 1 and 2, the tag "3) itself in the 2 nd dialogue has processed the notification service", that is, the tag "robot" according to the history dialogue: the purpose "and the above intent flow of the current dialog" robot has been shown: confirm identity + user: informing the robot of the processed splicing intention flow obtained by splicing and combining: purpose + robot has been shown: confirm identity + user: informing that the process "generated. In particular implementations, a series of mappings of intent streams to dialog tags may be predefined, and a third dialog tag may be generated in conjunction with all or part of the above intent streams, in combination with one or more of the historical dialog tags. Therefore, the dialogue labels can be generated by combining the key dialogue labels and the intention flow in the business scene, and the dialogue labels can be generated by combining more characteristic information, so that the generated dialogue labels are more comprehensive and accurate.
Step S104: and generating a dialogue tag of the current dialogue according to the first dialogue tag, the second dialogue tag and the third dialogue tag.
In one embodiment of the present invention, after the first session tag, the second session tag, and the third session tag are obtained, the set of these session tags may be used as the session tag of the current session. Therefore, the dialogue labels can be generated according to various characteristics of the current dialogue and the history dialogue, so that the dialogue labels are more comprehensive and accurate.
According to one embodiment of the present invention, generating the session tag of the current session according to the first session tag, the second session tag, and the third session tag may specifically include: performing semantic analysis on the first dialogue tag, the second dialogue tag and the third dialogue tag to obtain mutually exclusive dialogue tags; determining a dialogue tag to be deleted from the mutually exclusive dialogue tags according to a preset dialogue tag screening rule; deleting the label to be deleted from the first conversation label, the second conversation label and the third conversation label to obtain a first conversation label set, and taking the first conversation label set as the conversation label of the current conversation. In this embodiment, after obtaining the first session tag, the second session tag, and the third session tag, the session tags may be semantically analyzed by an existing semantic analysis model to obtain mutually exclusive session tags, and then the mutually exclusive session tags are processed to obtain the first session tag set. Wherein, mutually exclusive dialog labels refer to two dialog labels whose semantics are mutually exclusive or contradictory. For example: the dialogue labels 'user himself' and 'robot' are mutually exclusive dialogue labels, wherein the dialogue label 'robot' refers to the fact that the dialogue labels are generated by means of robot operation according to dialogue statement analysis of the user, and the main body of the current dialogue is either 'user himself' or 'robot', so that the two dialogue labels are mutually exclusive.
For the mutually exclusive dialog tag, determining the dialog tag to be deleted from the mutually exclusive dialog tag according to a set dialog tag screening rule, where the dialog tag screening rule is, for example: and determining the dialogue label with the previous generation time as the dialogue label to be deleted, and flexibly setting according to specific service requirements.
Then, deleting the dialogue label to be deleted from the first dialogue label, the second dialogue label and the third dialogue label, and taking the first dialogue label set formed by all the rest dialogue labels as the dialogue label of the current dialogue, so that the dialogue label can be generated more accurately.
According to another embodiment of the present invention, when generating the dialog tag of the current dialog according to the first dialog tag, the second dialog tag and the third dialog tag, the method may specifically include: performing semantic analysis on the first dialogue tag, the second dialogue tag and the third dialogue tag to obtain similar dialogue tags; fusion processing is carried out on the similar conversation labels according to a preset conversation label fusion rule to generate fusion conversation labels; and replacing the similar conversation label in the first conversation label, the second conversation label and the third conversation label with the fusion conversation label to obtain a second conversation label set, and taking the second conversation label set as the conversation label of the current conversation. In this embodiment, after the first session tag, the second session tag, and the third session tag are obtained, these session tags may be subjected to semantic analysis by an existing semantic analysis model to obtain similar session tags, and then the similar session tags are processed to obtain the second session tag set. Wherein, similar dialog labels refer to a plurality of dialog labels whose semantic similarity reaches a set threshold. For example: the conversation labels are similar conversation labels, namely 'user physical health' and 'health good'.
For similar dialog labels, fusion processing is performed on the similar dialog labels according to set dialog label fusion rules to generate fusion dialog labels, where the dialog label fusion rules are, for example: and determining the dialogue labels with later generation time as fusion dialogue labels, or determining the dialogue labels with larger semantic scope in the two dialogue labels as fusion dialogue labels, and flexibly setting according to specific service requirements.
And then, replacing similar conversation tags in the first conversation tag, the second conversation tag and the third conversation tag with fusion conversation tags to obtain a second conversation tag set, and taking the second conversation tag set as the conversation tag of the current conversation. Here, when similar conversation tags are replaced, the plurality of similar conversation tags may be replaced with one fusion conversation tag. Correspondingly, if the similar conversation labels have a plurality of groups, respectively determining the fusion conversation label corresponding to each group of similar conversation labels, and then replacing each group of similar conversation labels with a corresponding fusion conversation label. In this way, the dialog labels can be generated more accurately, and redundant dialog labels are avoided.
According to yet another embodiment of the present invention, generating the session tag of the current session according to the first session tag, the second session tag, and the third session tag may specifically include: performing semantic analysis on the first conversation label, the second conversation label and the third conversation label to obtain a mutual exclusion conversation label and a similar conversation label; determining a dialogue tag to be deleted from the mutually exclusive dialogue tags according to a preset dialogue tag screening rule, and fusing the similar dialogue tags according to a preset dialogue tag fusion rule to generate a fusion dialogue tag; deleting the label to be deleted from the first conversation label, the second conversation label and the third conversation label, replacing the similar conversation label with the fusion conversation label to obtain a third conversation label set, and taking the third conversation label set as the conversation label of the current conversation.
When generating the session tag of the current session according to the first session tag, the second session tag and the third session tag, the session tag of the current session may be specifically obtained by processing, according to the description of the previous embodiment, not only the mutually exclusive session tag but also the similar session tag, and processing the two tags in no sequence. Specifically, when generating the dialog tag of the current dialog according to the first dialog tag, the second dialog tag and the third dialog tag, it may include: performing semantic analysis on the first conversation label, the second conversation label and the third conversation label to obtain a mutual exclusion conversation label and a similar conversation label; determining a dialogue tag to be deleted from the mutually exclusive dialogue tags according to a preset dialogue tag screening rule, and fusing the similar dialogue tags according to a preset dialogue tag fusion rule to generate a fusion dialogue tag; deleting the label to be deleted from the first conversation label, the second conversation label and the third conversation label to obtain a fourth conversation label set, replacing the similar conversation label in the fourth conversation label set with the fusion conversation label to obtain a third conversation label set, and taking the third conversation label set as the conversation label of the current conversation; or replacing the similar conversation label in the first conversation label, the second conversation label and the third conversation label with the fusion conversation label to obtain a fifth conversation label set, deleting the label to be deleted from the fifth conversation label set to obtain a third conversation label set, and taking the third conversation label set as the conversation label of the current conversation.
According to the method for constructing the dialogue labels introduced in the above embodiments of the present invention, the dialogue labels can be constructed by combining the dialogue information of the current dialogue context, the history dialogue and the dialogue sentences of the current round, and the dialogue labels can be efficiently generated by combining more dialogue characteristic information, so that the generated dialogue labels are more comprehensive and accurate, and redundancy is avoided.
The method for constructing the dialogue labels provided by the embodiment of the invention can efficiently and accurately construct a standardized predefined dialogue label system under the complex condition, and is used for highly summarizing dialogue contents and then transmitting important information for other scenes related to the dialogue. In the embodiments shown in the foregoing tables 1 and 2, in the 2 nd dialogue, the history dialogue tag "indicated target" (i.e. the dialogue related business) has been obtained from the 1 st dialogue, and after the user directly informs that the history has been processed in combination with the 2 nd dialogue, the robot does not need to repeatedly indicate the target, and directly confirms the on-hook. For another example, after the session tag of "the person already processes the notification service" is obtained in the 2 nd session, the background is triggered to check whether the user really processes the corresponding service, and these are all the usage modes of the session tag.
Fig. 2 is a schematic diagram of main modules of a construction apparatus of a dialog tag according to an embodiment of the present invention. As shown in fig. 2, the dialog tag construction device 200 according to the embodiment of the present invention mainly includes a first tag construction module 201, a second tag construction module 202, a third tag construction module 203, and a dialog tag generation module 204.
A first tag construction module 201, configured to construct a first dialog tag according to a current round dialog sentence of a current dialog in response to a dialog tag construction request;
the second label construction module 202 generates a context intention flow according to the intention corresponding to each turn of dialogue statement in the current dialogue, and constructs a second dialogue label according to the context intention flow;
a third label construction module 203, configured to obtain a history dialogue label corresponding to the history dialogue according to the information of the two interaction parties of the current dialogue, and construct a third dialogue label according to the history dialogue label and the above intent flow;
and a dialog tag generating module 204, configured to generate a dialog tag of the current dialog according to the first dialog tag, the second dialog tag, and the third dialog tag.
According to one embodiment of the invention, the first tag construction module 201 may also be configured to: extracting keywords from the current round dialogue sentences of the current dialogue through the set regular expression, and taking the extracted keywords as a first dialogue label; or, carrying out intention recognition on the current round dialogue sentence of the current dialogue to obtain the intention of the current round dialogue sentence, and generating a first dialogue label according to the intention of the current round dialogue sentence.
According to another embodiment of the invention, the second tag construction module 202 may also be configured to: respectively carrying out intention recognition on each round of dialogue sentences in the current dialogue to obtain the intention of each round of dialogue sentences; splicing the intention of each round of dialogue sentences according to the sequence of each round of dialogue sentences in the current dialogue to generate an intention stream; and generating a second dialog label according to the above intent flow based on the mapping relation between the preset intent flow and the dialog label.
According to yet another embodiment of the present invention, the third tag construction module 203 may further be configured to: splicing the history dialogue tag and the above intention stream to obtain a spliced intention stream; and generating a third dialog label according to the spliced intent flow based on the mapping relation between the preset intent flow and the dialog label.
According to a further embodiment of the present invention, the intent corresponding to each turn of dialogue sentence is obtained by performing intent recognition through a pre-constructed intent recognition model, wherein the intent recognition model is constructed by the following ways: acquiring a training data set, wherein each training data in the training data set comprises a dialogue sentence and an intention type label thereof; model training is performed using the training dataset to construct the intent recognition model based on a classification model structure.
According to yet another embodiment of the present invention, the dialog tag generation module 204 may also be configured to: performing semantic analysis on the first dialogue tag, the second dialogue tag and the third dialogue tag to obtain mutually exclusive dialogue tags; determining a dialogue tag to be deleted from the mutually exclusive dialogue tags according to a preset dialogue tag screening rule; deleting the label to be deleted from the first conversation label, the second conversation label and the third conversation label to obtain a first conversation label set, and taking the first conversation label set as the conversation label of the current conversation.
According to yet another embodiment of the present invention, the dialog tag generation module 204 may also be configured to: performing semantic analysis on the first dialogue tag, the second dialogue tag and the third dialogue tag to obtain similar dialogue tags; fusion processing is carried out on the similar conversation labels according to a preset conversation label fusion rule to generate fusion conversation labels; and replacing the similar conversation label in the first conversation label, the second conversation label and the third conversation label with the fusion conversation label to obtain a second conversation label set, and taking the second conversation label set as the conversation label of the current conversation.
According to yet another embodiment of the present invention, the dialog tag generation module 204 may also be configured to: performing semantic analysis on the first conversation label, the second conversation label and the third conversation label to obtain a mutual exclusion conversation label and a similar conversation label; determining a dialogue tag to be deleted from the mutually exclusive dialogue tags according to a preset dialogue tag screening rule, and fusing the similar dialogue tags according to a preset dialogue tag fusion rule to generate a fusion dialogue tag; deleting the label to be deleted from the first conversation label, the second conversation label and the third conversation label, replacing the similar conversation label with the fusion conversation label to obtain a third conversation label set, and taking the third conversation label set as the conversation label of the current conversation.
According to the technical scheme of the embodiment of the invention, the first dialogue tag is constructed according to the current round dialogue sentences of the current dialogue by responding to the dialogue tag construction request; generating an upper intention flow according to the intention corresponding to each round of dialogue sentences in the current dialogue, and constructing a second dialogue label according to the upper intention flow; acquiring a history dialogue tag corresponding to the history dialogue according to the information of the interaction parties of the current dialogue, and constructing a third dialogue tag according to the history dialogue tag and the above intention flow; according to the technical scheme that the first dialogue label, the second dialogue label and the third dialogue label generate the dialogue label of the current dialogue, the dialogue label is constructed by combining the dialogue information of the current dialogue context, the history dialogue and the current round dialogue statement, and the dialogue label can be efficiently generated by combining more dialogue characteristic information, so that the generated dialogue label is more comprehensive and accurate, and redundancy is avoided.
Fig. 3 illustrates an exemplary system architecture 300 of a dialog tag construction method or dialog tag construction apparatus to which embodiments of the present invention may be applied.
As shown in fig. 3, the system architecture 300 may include terminal devices 301, 302, 303, a network 304, and a server 305. The network 304 is used as a medium to provide communication links between the terminal devices 301, 302, 303 and the server 305. The network 304 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 305 via the network 304 using the terminal devices 301, 302, 303 to receive or send messages or the like. Various communication client applications may be installed on the terminal devices 301, 302, 303, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 301, 302, 303 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 305 may be a server providing various services, such as a background management server (by way of example only) providing support for human interaction-like websites browsed by the user using the terminal devices 301, 302, 303. The background management server can respond to the received dialogue label construction request and other data to construct a first dialogue label according to the current round dialogue statement of the current dialogue; generating an upper intention flow according to the intention corresponding to each round of dialogue sentences in the current dialogue, and constructing a second dialogue label according to the upper intention flow; acquiring a history dialogue tag corresponding to a history dialogue according to the information of the interaction parties of the current dialogue, and constructing a third dialogue tag according to the history dialogue tag and the above intention flow; and generating a conversation label of the current conversation according to the first conversation label, the second conversation label and the third conversation label, and feeding back a processing result (such as the generated conversation label-only an example) to the terminal device.
It should be noted that, the method for constructing a dialog tag according to the embodiment of the present invention is generally executed by the server 305, and accordingly, the apparatus for constructing a dialog tag is generally disposed in the server 305.
It should be understood that the number of terminal devices, networks and servers in fig. 3 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 4, there is illustrated a schematic diagram of a computer system 400 suitable for use in implementing a terminal device or server in accordance with an embodiment of the present invention. The terminal device or server shown in fig. 4 is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present invention.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU) 401, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In RAM 403, various programs and data required for the operation of system 400 are also stored. The CPU 401, ROM 402, and RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output portion 407 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage section 408 including a hard disk or the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. The drive 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 409 and/or installed from the removable medium 411. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 401.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having 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. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described units or modules may also be provided in a processor, for example, as: a processor includes a first label construction module, a second label construction module, a third label construction module, and a dialog label generation module. Where the names of these units or modules do not constitute a limitation on the unit or module itself in some cases, for example, the first tag construction module may also be described as "a module for constructing a first dialog tag from a current round dialog sentence of a current dialog" in response to a dialog tag construction request.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: responding to a dialogue tag construction request, and constructing a first dialogue tag according to the current round dialogue sentences of the current dialogue; generating an upper intention flow according to the intention corresponding to each round of dialogue sentences in the current dialogue, and constructing a second dialogue label according to the upper intention flow; acquiring a history dialogue tag corresponding to a history dialogue according to the information of the interaction parties of the current dialogue, and constructing a third dialogue tag according to the history dialogue tag and the above intention flow; and generating the dialogue tag of the current dialogue according to the first dialogue tag, the second dialogue tag and the third dialogue tag.
According to the technical scheme of the embodiment of the invention, the first dialogue tag is constructed according to the current round dialogue sentences of the current dialogue by responding to the dialogue tag construction request; generating an upper intention flow according to the intention corresponding to each round of dialogue sentences in the current dialogue, and constructing a second dialogue label according to the upper intention flow; acquiring a history dialogue tag corresponding to the history dialogue according to the information of the interaction parties of the current dialogue, and constructing a third dialogue tag according to the history dialogue tag and the above intention flow; according to the technical scheme that the first dialogue label, the second dialogue label and the third dialogue label generate the dialogue label of the current dialogue, the dialogue label is constructed by combining the dialogue information of the current dialogue context, the history dialogue and the current round dialogue statement, and the dialogue label can be efficiently generated by combining more dialogue characteristic information, so that the generated dialogue label is more comprehensive and accurate, and redundancy is avoided.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (11)

1. A method of constructing a dialog tag, comprising:
responding to a dialogue tag construction request, and constructing a first dialogue tag according to the current round dialogue sentences of the current dialogue;
generating an upper intention flow according to the intention corresponding to each round of dialogue sentences in the current dialogue, and constructing a second dialogue label according to the upper intention flow;
acquiring a history dialogue tag corresponding to a history dialogue according to the information of the interaction parties of the current dialogue, and constructing a third dialogue tag according to the history dialogue tag and the above intention flow;
and generating the dialogue tag of the current dialogue according to the first dialogue tag, the second dialogue tag and the third dialogue tag.
2. The method of claim 1, wherein constructing a first dialog tag from a current round dialog sentence of a current dialog comprises:
Extracting keywords from the current round dialogue sentences of the current dialogue through the set regular expression, and taking the extracted keywords as a first dialogue label;
or, carrying out intention recognition on the current round dialogue sentence of the current dialogue to obtain the intention of the current round dialogue sentence, and generating a first dialogue label according to the intention of the current round dialogue sentence.
3. The method of claim 1, wherein generating a context intent stream from the intent corresponding to each turn of dialog statement of the context in the current dialog and constructing a second dialog tag from the context intent stream comprises:
respectively carrying out intention recognition on each round of dialogue sentences in the current dialogue to obtain the intention of each round of dialogue sentences;
splicing the intention of each round of dialogue sentences according to the sequence of each round of dialogue sentences in the current dialogue to generate an intention stream;
and generating a second dialog label according to the above intent flow based on the mapping relation between the preset intent flow and the dialog label.
4. The method of claim 1, wherein constructing a third dialog tag from the historical dialog tag and the contextual intent stream comprises:
Splicing the history dialogue tag and the above intention stream to obtain a spliced intention stream;
and generating a third dialog label according to the spliced intent flow based on the mapping relation between the preset intent flow and the dialog label.
5. The method according to any one of claims 1 to 4, wherein the intent corresponding to each turn of dialogue sentence is obtained by performing intent recognition by means of a pre-built intent recognition model, the intent recognition model being constructed by:
acquiring a training data set, wherein each training data in the training data set comprises a dialogue sentence and an intention type label thereof;
model training is performed using the training dataset to construct the intent recognition model based on a classification model structure.
6. The method of claim 1, wherein generating the dialog tag for the current dialog from the first dialog tag, the second dialog tag, and the third dialog tag comprises:
performing semantic analysis on the first dialogue tag, the second dialogue tag and the third dialogue tag to obtain mutually exclusive dialogue tags;
determining a dialogue tag to be deleted from the mutually exclusive dialogue tags according to a preset dialogue tag screening rule;
Deleting the label to be deleted from the first conversation label, the second conversation label and the third conversation label to obtain a first conversation label set, and taking the first conversation label set as the conversation label of the current conversation.
7. The method of claim 1, wherein generating the dialog tag for the current dialog from the first dialog tag, the second dialog tag, and the third dialog tag comprises:
performing semantic analysis on the first dialogue tag, the second dialogue tag and the third dialogue tag to obtain similar dialogue tags;
fusion processing is carried out on the similar conversation labels according to a preset conversation label fusion rule to generate fusion conversation labels;
and replacing the similar conversation label in the first conversation label, the second conversation label and the third conversation label with the fusion conversation label to obtain a second conversation label set, and taking the second conversation label set as the conversation label of the current conversation.
8. The method of claim 1, wherein generating the dialog tag for the current dialog from the first dialog tag, the second dialog tag, and the third dialog tag comprises:
Performing semantic analysis on the first conversation label, the second conversation label and the third conversation label to obtain a mutual exclusion conversation label and a similar conversation label;
determining a dialogue tag to be deleted from the mutually exclusive dialogue tags according to a preset dialogue tag screening rule, and fusing the similar dialogue tags according to a preset dialogue tag fusion rule to generate a fusion dialogue tag;
deleting the label to be deleted from the first conversation label, the second conversation label and the third conversation label, replacing the similar conversation label with the fusion conversation label to obtain a third conversation label set, and taking the third conversation label set as the conversation label of the current conversation.
9. A dialog tag construction device, comprising:
the first label construction module is used for responding to the dialogue label construction request and constructing a first dialogue label according to the current round dialogue sentences of the current dialogue;
the second label construction module generates an intention flow according to the intention corresponding to each round of dialogue sentences in the current dialogue, and constructs a second dialogue label according to the intention flow;
The third label construction module acquires a history dialogue label corresponding to the history dialogue according to the information of the interaction parties of the current dialogue, and constructs a third dialogue label according to the history dialogue label and the above intention flow;
and the conversation label generating module is used for generating the conversation label of the current conversation according to the first conversation label, the second conversation label and the third conversation label.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-8.
11. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-8.
CN202311735972.0A 2023-12-15 2023-12-15 Construction method and device of dialogue labels Pending CN117807200A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311735972.0A CN117807200A (en) 2023-12-15 2023-12-15 Construction method and device of dialogue labels

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311735972.0A CN117807200A (en) 2023-12-15 2023-12-15 Construction method and device of dialogue labels

Publications (1)

Publication Number Publication Date
CN117807200A true CN117807200A (en) 2024-04-02

Family

ID=90421115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311735972.0A Pending CN117807200A (en) 2023-12-15 2023-12-15 Construction method and device of dialogue labels

Country Status (1)

Country Link
CN (1) CN117807200A (en)

Similar Documents

Publication Publication Date Title
US10552544B2 (en) Methods and systems of automated assistant implementation and management
US10958598B2 (en) Method and apparatus for generating candidate reply message
US8516052B2 (en) Dynamically managing online communication groups
CN109036425B (en) Method and device for operating intelligent terminal
US11934394B2 (en) Data query method supporting natural language, open platform, and user terminal
CN110019742B (en) Method and device for processing information
CN108268450B (en) Method and apparatus for generating information
CN111368551B (en) Method and device for determining event main body
CN113239204A (en) Text classification method and device, electronic equipment and computer-readable storage medium
CN110738056B (en) Method and device for generating information
CN111639162A (en) Information interaction method and device, electronic equipment and storage medium
CN112929253A (en) Virtual image interaction method and device
CN113407677A (en) Method, apparatus, device and storage medium for evaluating quality of consultation session
CN112861529A (en) Method and device for managing error codes
CN113407851A (en) Method, device, equipment and medium for determining recommendation information based on double-tower model
CN111538817B (en) Man-machine interaction method and device
CN110990527A (en) Automatic question answering method and device, storage medium and electronic equipment
CN110852057A (en) Method and device for calculating text similarity
CN110740212B (en) Call answering method and device based on intelligent voice technology and electronic equipment
AU2022204669B2 (en) Disfluency removal using machine learning
CN117807200A (en) Construction method and device of dialogue labels
CN114691850A (en) Method for generating question-answer pairs, training method and device of neural network model
CN112632241A (en) Method, device, equipment and computer readable medium for intelligent conversation
CN112487765A (en) Method and device for generating notification text
CN111782776A (en) Method and device for realizing intention identification through slot filling

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