Entity tracking method, device, electronic device and storage medium
By using entity tracking models in the dialogue system, combining the time difference and characteristics of dialogue sessions, the problem of inaccurate simulation of the real situation of dialogue in the prior art is solved, and the accuracy and user experience of entity tracking are improved.
Patent Information
- Application Number
- CN202210325699.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-29
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2042-03-29
AI Technical Summary
The prior art is difficult to accurately simulate the real situation of the conversation, resulting in inaccurate entity tracking.
By obtaining the time difference between the historical round session and the current round session, combining the historical round session characteristics and the current round session characteristics, input it into the preset entity tracking model, and inheritance judgment of slot value pairs is performed to achieve dialogue semantic understanding.
Improve the accuracy of entity tracking, making conversation management more in line with real scenarios and better user experience.
Smart Images

Figure CN114896376B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an entity tracking method, device, electronic device and non-transitory computer-readable storage medium. Background Art
[0002] At present, dialogue systems are attracting more and more attention in various fields, and the continuous advancement of deep learning technology has greatly promoted the development of dialogue systems.
[0003] When managing multi-round conversations, it is necessary to decide the reply content to the user at this moment based on the conversation history information. Conversation state tracking means tracking the current conversation state based on the historical conversation state and previous system actions. The slot value pair information tracking in conversation state tracking models the historical conversation information and the current user information, that is, judging whether the slot is updated based on the context information and the current information.
[0004] In the process of slot-value pair information tracking, some solutions directly splice historical information as context features, which ignores the time sequence information of historical information. Other solutions consider the order of speech, use the relationship between the previous and next conversations as time sequence information, and use the distance between the current conversation and the start of the conversation as the time sequence feature as a parameter to track slot-value pair information, but they still cannot accurately simulate the actual situation of the conversation. Summary of the invention
[0005] The present disclosure provides an entity tracking method, device, electronic device and non-transitory computer-readable storage medium, which are used to solve the problem in the prior art that the actual situation of the conversation cannot be accurately simulated, and improve the accuracy of entity tracking.
[0006] The present disclosure provides an entity tracking method, comprising: obtaining a first slot-value pair in a historical round conversation according to an acquired historical round conversation feature; obtaining a current round conversation intention of a current round conversation according to an acquired current round conversation feature; obtaining a timing feature, wherein the timing feature is obtained according to a time difference between the historical round conversation and the current round conversation; inputting the first slot-value pair, the current round conversation intention and the timing feature into a preset entity tracking model to obtain an inheritance judgment result of the first slot-value pair, so as to perform semantic understanding of the current round conversation according to the inheritance judgment result, wherein the inheritance judgment result represents whether the first slot-value pair needs to be inherited to the current round conversation.
[0007] According to an entity tracking method provided by the present disclosure, the training method of the entity tracking model includes: obtaining a sample conversation data set, the sample conversation data in the sample conversation data set includes at least two rounds of conversations; the sample conversation data in the sample conversation data set includes at least conversation data of two rounds of conversations, and the sample conversation data includes the following labeled training labels: slot-value pairs in a previous round of conversations, conversation intents in a subsequent round of conversations, and a time difference between the previous round of conversations and the subsequent round of conversations; training an initial entity tracking model according to the sample conversation data set and the training labels to obtain the entity tracking model.
[0008] According to an entity tracking method provided by the present disclosure, the obtaining of timing features includes: obtaining the time difference between the historical round conversation and the current round conversation; obtaining a predetermined time bucket; and obtaining the timing features corresponding to the time difference according to the time bucket, wherein the timing features represent the time region in the time bucket corresponding to the time difference.
[0009] According to an entity tracking method provided by the present disclosure, before obtaining the first slot-value pair in the historical round conversation according to the acquired historical round conversation features, the method also includes: text encoding the first user text and the system reply text of the historical round conversation to obtain the historical round conversation features; and text encoding the second user text of the current round conversation to obtain the current round conversation features.
[0010] According to an entity tracking method provided by the present disclosure, the current round conversation intention of the current round conversation is obtained according to the acquired current round conversation features, including: obtaining the intention word vector of the second user text according to the current round conversation features; encoding the intention word vector using a one-hot encoding method to obtain the current round conversation intention.
[0011] According to an entity tracking method provided by the present disclosure, the first slot-value pair in the historical round conversation is obtained according to the acquired historical round conversation features, including: using a preset word vector model to obtain the slot value information of the first user text according to the historical round conversation features; generating the first slot-value pair according to the acquired slot information and the slot value information.
[0012] According to an entity tracking method provided by the present disclosure, after obtaining the inheritance judgment result of the first slot-value pair, the method further includes: obtaining the semantic understanding result of the current round conversation according to the inheritance judgment result, the historical round conversation features and the current round conversation features.
[0013] The present disclosure also provides an entity tracking device, including: a slot-value pair acquisition unit, used to acquire a first slot-value pair in a historical round conversation according to the acquired historical round conversation features; an intention acquisition unit, used to acquire a current round conversation intention of a current round conversation according to the acquired current round conversation features; a timing acquisition unit, used to acquire a timing feature, wherein the timing feature is obtained according to the time difference between the historical round conversation and the current round conversation; and a tracking unit, used to input the first slot-value pair, the current round conversation intention and the timing feature into a preset entity tracking model to obtain an inheritance judgment result of the first slot-value pair, so as to perform semantic understanding of the current round conversation according to the inheritance judgment result, wherein the inheritance judgment result represents whether the first slot-value pair needs to be inherited to the current round conversation.
[0014] According to an entity tracking device provided by the present disclosure, the device also includes a training unit for training an entity tracking model, and the training unit is used to: obtain a sample conversation data set, the sample conversation data in the sample conversation data set at least includes conversation data of two rounds of conversations, and the sample conversation data includes the following labeled training labels: the first slot-value pair in the previous round of conversation, the conversation intent of the next round of conversation, and the time difference between the previous round of conversation and the next round of conversation; train an initial entity tracking model according to the sample conversation data set and the training labels to obtain the entity tracking model.
[0015] According to an entity tracking device provided by the present disclosure, the timing acquisition unit is also used to obtain the timing features, including: obtaining the time difference between the historical round conversation and the current round conversation; obtaining a predetermined time bucket; and obtaining the timing features corresponding to the time difference according to the time bucket, wherein the timing features characterize the time region in the time bucket corresponding to the time difference.
[0016] According to an entity tracking device provided by the present disclosure, the device also includes an encoding unit, which is used to: text encode the first user text and the system reply text of the historical round conversation to obtain the historical round conversation features; text encode the second user text of the current round conversation to obtain the current round conversation features.
[0017] According to an entity tracking device provided by the present disclosure, the intention acquisition unit is also used to: obtain the intention word vector of the second user text according to the current round conversation characteristics; encode the intention word vector using One-Hot encoding to obtain the current round conversation intention.
[0018] According to an entity tracking device provided by the present disclosure, the slot-value pair acquisition unit is also used to: use a preset word vector model to obtain the slot value information of the first user text according to the historical round conversation characteristics; and generate the first slot-value pair according to the acquired slot information and the slot value information.
[0019] According to an entity tracking device provided by the present disclosure, the device also includes a semantic acquisition unit, which is used to: acquire a semantic understanding result of the current round conversation according to the inheritance judgment result, the historical round conversation feature and the current round conversation feature.
[0020] The present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned entity tracking methods are implemented.
[0021] The present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of any of the entity tracking methods described above are implemented.
[0022] The entity tracking method, device, electronic device and non-transitory computer-readable storage medium provided by the present disclosure manage conversations through the time difference between historical round conversations and current round conversations, and track the first slot value pair information in combination with historical round conversations and current round conversations, which can improve the accuracy of entity tracking, thereby better understanding the user's semantics and giving more accurate system responses. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0024] Figure 1 One of the flowcharts of the entity tracking method provided by the present disclosure;
[0025] Figure 2 The second flowchart of the entity tracking method provided by the present disclosure;
[0026] Figure 3 is a flowchart of a training method for an entity tracking model provided by the present disclosure;
[0027] Figure 4 is a schematic diagram of the structure of the entity tracking device provided by the present disclosure;
[0028] Figure 5It is a schematic diagram of the structure of an electronic device provided by the present disclosure. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions in the present disclosure will be clearly and completely described below in conjunction with the drawings in the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0030] The terms used in one or more embodiments of the present disclosure are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present disclosure. The singular forms of "a", "said" and "the" used in one or more embodiments of the present disclosure and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present disclosure refers to and includes any or all possible combinations of one or more associated listed items.
[0031] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present disclosure, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present disclosure, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0032] In a dialogue system, the interaction between the user and the system often requires multiple rounds of interaction to achieve the user's goal. For example, in a ticket booking system, the system needs to interact with the user multiple times to confirm the user's departure point, destination, departure time and other information.
[0033] The main function of dialogue management in a dialogue system is to update the system status based on the results of natural language understanding and generate corresponding system actions. The main contents of dialogue management include dialogue status tracking and dialogue strategy learning. The main function of natural language understanding is to process the sentences input by the user or the results of speech recognition, extract the user's dialogue intention and the information conveyed by the user. In multi-round dialogues, the correct management of dialogue status can make the dialogue between the user and the system more real and reasonable.
[0034] The dialogue state can be understood as a data structure that represents user intent and slot-value pairs. In a multi-round dialogue system, dialogue information is an important feature of entity tracking, but modeling with only the order of speech cannot fully simulate the actual situation of the dialogue. For example, if the user's first sentence is "How long does it take to drive to Chengdu?" and the second sentence is "What's the weather like today?", there may be two situations: In the first situation, the second sentence is said 10 seconds after the first sentence, then the slot-value pair in the second sentence should inherit the "address-Chengdu" in the first sentence, which means that the user is expressing "Chengdu's weather today." In the second situation, the second sentence is said 1 minute after the first sentence, then the user is likely not interested in "Chengdu's weather today" but "the weather at your location today."
[0035] In the second case, the slot value pair inherited from the above "Address—Chengdu" obviously does not conform to the actual situation of the conversation and will directly give the user an incorrect answer. At this time, processing the conversation only according to the conversation order cannot fully cover the real scene. Once the conversation status is incorrectly confirmed, it will directly cause errors or redundancy in the conversation, resulting in a bad user experience.
[0036] To solve these problems, embodiments of the present disclosure provide an entity tracking method, apparatus, electronic device, and non-transitory computer-readable storage medium.
[0037] The exemplary embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0038] like Figure 1 FIG. 1 is a flow chart of an entity tracking method according to an embodiment of the present disclosure. The method provided by the embodiment of the present disclosure can be executed by any electronic device with computer processing capabilities, such as a terminal or a server. Figure 1 As shown, the entity tracking method includes:
[0039] Step 102: Obtain the first slot-value pair in the historical round conversation according to the acquired historical round conversation feature.
[0040] Specifically, the historical round session refers to the session before the current round session. The historical round session features include the features of the user question text and the system reply text in the historical round session. The first slot value pair includes slot position information and slot value information, and the first slot value pair is obtained according to the user question text and is used to characterize the session state.
[0041] Step 104: Acquire the current round conversation intention of the current round conversation according to the acquired current round conversation feature.
[0042] Specifically, the current round conversation feature includes the feature of the user question text in the current round conversation. The conversation intention is obtained according to the user question text and is used to characterize the conversation state.
[0043] Step 106, obtaining a time series feature, where the time series feature is obtained based on the time difference between the historical round conversation and the current round conversation.
[0044] Specifically, the system can obtain the time difference between different rounds of sessions according to the user session start time of different rounds of sessions in the session log, and then encode the time difference in the form of time buckets to obtain the time series feature.
[0045] Step 108, input the first slot-value pair, the current round conversation intention and the timing characteristics into the preset entity tracking model to obtain the inheritance judgment result of the first slot-value pair, so as to perform semantic understanding of the current round conversation according to the inheritance judgment result, wherein the inheritance judgment result represents whether the first slot-value pair needs to be inherited into the current round conversation.
[0046] Specifically, the entity tracking model can give a judgment result on whether the first slot-value pair needs to be inherited. If inheritance is required, the semantic understanding of the current round of conversation should be combined with the information in the first slot-value pair.
[0047] The technical solution of the disclosed embodiment proposes an entity tracking method based on time intervals, and manages the dialogue by referring to the time difference between different rounds of dialogue. Specifically, the technical solution of the disclosed embodiment uses the time interval between dialogues as a temporal feature, integrates it with the historical round dialogue features and the current round dialogue features, trains an entity tracking model, and decides whether to inherit the previous entity. This solution can accurately judge the user's purpose and make multi-round human-computer dialogue more in line with human-human dialogue.
[0048] The technical solution of the embodiment of the present disclosure performs inheritance judgment based on an entity tracking model, so it is necessary to pre-train the entity tracking model. The entity tracking model can be a deep learning model, but is not limited thereto.
[0049] like Figure 3 As shown, the training method of the entity tracking model of the embodiment of the present disclosure includes:
[0050] Step 302, obtaining a sample conversation data set, wherein the sample conversation data in the sample conversation data set includes conversation data of at least two rounds of conversations, and the sample conversation data includes the following annotated training labels: the first slot-value pair in the previous round of conversation, the conversation intent of the next round of conversation, and the time difference between the previous round of conversation and the next round of conversation.
[0051] Step 304 , training the initial entity tracking model according to the sample session data set and the training labels to obtain an entity tracking model.
[0052] Specifically, when training the entity tracking model, you can obtain the time-bound conversation logs in the multi-round conversation system and then manually annotate them. During the manual annotation process, you need to annotate the conversation state corresponding to each round of user speech, including user intent and slot value pair information. The annotation results can tell whether the slot value information mentioned above will be inherited in the current round, and construct the data required for training the entity tracking model.
[0053] During the training of the initial entity tracking model, by constructing a loss function, the entity tracking model can be adjusted according to the loss function value until the loss function converges, thereby completing the training of the entity tracking model.
[0054] Before step 102, the entity tracking method further includes: performing text encoding on the first user text and the system reply text of the historical round conversation to obtain the historical round conversation features; performing text encoding on the second user text of the current round conversation to obtain the current round conversation features.
[0055] like Figure 2 As shown, text 201 and text 202 in the dotted box are historical round conversation information, including the first user text and the system reply text. Text encoding of the historical round conversation information can be converted into a text vector, that is, a historical round conversation feature as a context feature. Text 203 is the second user text of the current round. Similarly, text encoding of the second user text can be converted into a text vector, that is, a current round conversation feature.
[0056] In the present embodiment, the text encoder may be LSTM (Long Short Term Memory networks) or BERT (Bidirectional Encoder Representations from Transformers), but is not limited thereto.
[0057] In step 102, a preset word vector model is used to obtain slot value information of a first user text according to historical round conversation features; and a first slot-value pair is generated according to the obtained slot position information and slot value information.
[0058] like Figure 2 As shown, the candidate slot value pair 204 includes slot position information: address and slot value information: Chengdu. The slot value encoder is used to align the slot encoding to obtain a slot value pair vector.
[0059] The slot value encoder can realize the concatenation of the word vectors of the slot position and the slot value, and the slot value can be obtained by inputting the first user text into the word vector model word2vec. Word2vec is a model used to generate word vectors, which can perform unsupervised text clustering to generate word vectors.
[0060] In step 104, an intent word vector of the second user text is obtained according to the current round of conversation features; the intent word vector is encoded by using the One-Hot encoding method to obtain the current round of conversation intent.
[0061] It can be seen that the intent of the second user text 203 is to inquire about the weather. Encoding the current intent 205 by using an intent encoder can obtain an intent vector. By using the One-Hot encoding method for intent encoding, a one-dimensional all-zero vector of the intent length can be constructed, and then the value at the corresponding intent position is set to 1. Here, the value at the weather position is set to 1.
[0062] One-Hot encoding is also known as one-hot effective encoding. It mainly uses an N-bit status register to encode N states. Each state consists of an independent register bit, and only one bit is valid at any time. One-Hot encoding is the representation of categorical variables as binary vectors.
[0063] Taking a conversation about inquiring about the weather as an example, for instance, the user inputs: "What's the weather like in Shenzhen today?" At this time, what the user expresses is to query the weather. It can be considered that querying the weather is an intent. Then specifically, which place's weather and which day's weather are being queried? Here, the user conveys the following information: location = Shenzhen, date = today. This location and date are slot information, and correspondingly, Shenzhen and today are slot value information. If there are multiple intents and slot values in a dialogue system, intent recognition belongs to the task of text classification, and slot value filling belongs to the task of sequence labeling.
[0064] In step 106, the time difference between the historical round of conversation and the current round of conversation is obtained; a pre-determined time bucket is obtained; according to the time bucket, the time series feature corresponding to the time difference is obtained, and the time series feature characterizes the time region in the time bucket corresponding to the time difference.
[0065] Specifically, the time difference 206 represents the time difference between two rounds of user conversations. Because the system responds quickly, the time difference is the time difference for different rounds of user conversations. Then, the time encoder is used to convert the time difference into a time vector. Time encoding can be represented in the form of bucketing, that is, setting the bucket information, such as buckets of 0 - 10s, 10s - 30s, 30s - 60s, >60s, and then putting the actual value into these buckets. The time vector has only one dimension, indicating the interval where the time difference is located.
[0066] Such as Figure 2The entire entity tracking process shown in the figure consists of three parts. The first part is to build the context features of the conversation, including the user text, user entity, and system response of the historical rounds. The second part is to build the current round conversation features, including the user text and user intent of the current round. The last part is to build the temporal features, which are mainly the time difference of the conversation.
[0067] After obtaining these feature vectors, they can be concatenated and input into the fully connected neural network layer 207 to finally obtain a prediction result, that is, whether the candidate slot value pair needs to be inherited.
[0068] In step 108, the semantic understanding result of the current round conversation is obtained according to the inheritance judgment result, the historical round conversation features and the current round conversation features.
[0069] In one embodiment, the user text of the historical round session is: How long does it take to drive to Shanghai, the system session text is: It takes two hours, the second slot value pair is address-Shanghai, and the user text of the current round session is: How is the weather today. If the inheritance judgment result corresponding to the second slot value pair is no, the semantic understanding result of the user text of the current round session is: How is the local weather today. If the inheritance judgment result corresponding to the second slot value pair is yes, the semantic understanding result of the user text of the current round session is: How is the weather in Shanghai today.
[0070] Based on the semantic understanding results of the user text in the current round of conversation, the dialogue system can generate corresponding system answer utterances to provide feedback to the user, for example, it is sunny locally today, or it is drizzling in Shanghai today.
[0071] When semantic understanding is performed on the user text of the current round of conversation, the inherited slot-value pairs may not be limited to one. If there are two or more inherited slot-value pairs, the slot-value pairs may come from the same round of historical conversations or from different rounds of historical conversations.
[0072] In one example, for the historical conversation text: How is the weather in Shenzhen today, there are two slot-value pairs, location-Shenzhen, date-today. Current conversation text: How is the traffic condition? The current conversation intention is: traffic. The time interval between the two conversations is 60s. The technical solution of the embodiment of the present disclosure is adopted. It can be obtained that both slot-value pairs need to be inherited, that is, the semantic understanding result of the current conversation is: How is the traffic condition in Shenzhen today?
[0073] The entity tracking method provided by the present disclosure manages the dialogue through the time difference between the historical round conversation and the current round conversation, and tracks the slot value pair information in combination with the historical round conversation and the current round conversation, which can improve the accuracy of entity tracking, thereby better understanding the user's semantics and giving a more accurate system response.
[0074] The entity tracking device provided by the present disclosure is described below. The entity tracking device described below and the entity tracking method described above can be referenced to each other.
[0075] like Figure 4 As shown, an entity tracking device according to an embodiment of the present disclosure includes:
[0076] The slot-value pair acquisition unit 402 may be configured to acquire a first slot-value pair in a historical round conversation according to the acquired historical round conversation feature.
[0077] The intention acquisition unit 404 may be configured to acquire the current round conversation intention of the current round conversation according to the acquired current round conversation features.
[0078] The time series acquisition unit 406 may be used to acquire a time series feature, where the time series feature is acquired based on a time difference between a historical round of conversations and a current round of conversations.
[0079] The tracking unit 408 can be used to input the first slot-value pair, the current round conversation intention and the timing characteristics into a preset entity tracking model to obtain the inheritance judgment result of the first slot-value pair, so as to perform semantic understanding of the current round conversation based on the inheritance judgment result, wherein the inheritance judgment result represents whether the first slot-value pair needs to be inherited into the current round conversation.
[0080] The technical solution of the disclosed embodiment proposes an entity tracking method based on time intervals, and manages the dialogue by referring to the time difference between different rounds of dialogue. Specifically, the technical solution of the disclosed embodiment uses the time interval between dialogues as a temporal feature, integrates it with the historical round dialogue features and the current round dialogue features, trains an entity tracking model, and decides whether to inherit the previous entity. This solution can accurately judge the user's purpose and make multi-round human-computer dialogue more in line with human-human dialogue.
[0081] In an embodiment of the present disclosure, the entity tracking device may further include a training unit for training an entity tracking model, the training unit being used to: obtain a sample conversation data set, the sample conversation data in the sample conversation data set including conversation data of at least two rounds of conversations, the sample conversation data including the following labeled training labels: the first slot value pair in a previous round of conversation, the conversation intent of a subsequent round of conversation, and the time difference between a previous round of conversation and a subsequent round of conversation; train an initial entity tracking model according to the sample conversation data set and the training labels to obtain an entity tracking model.
[0082] In the embodiment of the present disclosure, the timing acquisition unit can also be used to obtain timing features, including: obtaining the time difference between the historical round conversation and the current round conversation; obtaining a predetermined time bucket; and obtaining the timing features corresponding to the time difference according to the time bucket, the timing features representing the time area in the time bucket corresponding to the time difference.
[0083] In the disclosed embodiment, the entity tracking device may further include an encoding unit for: performing text encoding on the first user text and the system reply text of the historical round conversation to obtain the historical round conversation features; performing text encoding on the second user text of the current round conversation to obtain the current round conversation features.
[0084] In the disclosed embodiment, the intention acquisition unit may be further used to: obtain the intention word vector of the second user text according to the current round conversation feature; encode the intention word vector using One-Hot encoding to obtain the current round conversation intention.
[0085] In the embodiment of the present disclosure, the slot-value pair acquisition unit can also be used to: use a preset word vector model to acquire slot value information of the first user text according to historical round conversation features; and generate a first slot-value pair according to the acquired slot position information and slot value information.
[0086] In the disclosed embodiment, the entity tracking device may further include a semantic acquisition unit, which is used to acquire a semantic understanding result of a current round of conversation according to the inheritance judgment result, historical round conversation features, and current round conversation features.
[0087] Since the functional modules of the entity tracking device of the exemplary embodiment of the present disclosure correspond to the steps of the exemplary embodiment of the entity tracking method described above, for details not disclosed in the embodiment of the device of the present disclosure, please refer to the embodiment of the entity tracking method described above in the present disclosure.
[0088] The entity tracking device provided by the present disclosure manages the dialogue through the time difference between the historical round conversation and the current round conversation, and tracks the slot value pair information in combination with the historical round conversation and the current round conversation, which can improve the accuracy of entity tracking, thereby better understanding the user's semantics and giving a more accurate system response.
[0089] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the entity tracking method, which includes: obtaining a first slot value pair in a historical round conversation according to the obtained historical round conversation feature; obtaining a current round conversation intention of a current round conversation according to the obtained current round conversation feature; obtaining a timing feature, wherein the timing feature is obtained according to the time difference between the historical round conversation and the current round conversation; inputting the first slot value pair, the current round conversation intention and the timing feature into a preset entity tracking model, obtaining an inheritance judgment result of the first slot value pair, so as to perform semantic understanding of the current round conversation according to the inheritance judgment result, wherein the inheritance judgment result indicates whether the first slot value pair needs to be inherited to the current round conversation.
[0090] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0091] On the other hand, the present disclosure further provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the entity tracking method provided by the above methods, the method including: obtaining a first slot-value pair in a historical round conversation according to the acquired historical round conversation features; obtaining a current round conversation intention of a current round conversation according to the acquired current round conversation features; obtaining a timing feature, wherein the timing feature is obtained according to the time difference between the historical round conversation and the current round conversation; inputting the first slot-value pair, the current round conversation intention and the timing feature into a preset entity tracking model to obtain an inheritance judgment result of the first slot-value pair, so as to perform semantic understanding of the current round conversation according to the inheritance judgment result, wherein the inheritance judgment result represents whether the first slot-value pair needs to be inherited to the current round conversation.
[0092] On the other hand, the present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented by a processor to execute the above-mentioned entity tracking methods, the method comprising: obtaining a first slot-value pair in a historical round conversation according to the acquired historical round conversation features; obtaining a current round conversation intention of a current round conversation according to the acquired current round conversation features; obtaining a timing feature, wherein the timing feature is obtained according to a time difference between the historical round conversation and the current round conversation; inputting the first slot-value pair, the current round conversation intention and the timing feature into a preset entity tracking model to obtain an inheritance judgment result of the first slot-value pair, so as to perform semantic understanding of the current round conversation according to the inheritance judgment result, wherein the inheritance judgment result represents whether the first slot-value pair needs to be inherited to the current round conversation.
[0093] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0094] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. An entity tracking method, It is characterized in that The method comprises: Acquire the first slot value pair in the historical round session according to the acquired historical round session feature; Acquire the current round conversation intention of the current round conversation according to the acquired current round conversation feature; Acquire a time series feature, where the time series feature is obtained according to a time difference between the historical round conversation and the current round conversation; Inputting the first slot-value pair, the current round conversation intention and the timing feature into a preset entity tracking model to obtain an inheritance judgment result of the first slot-value pair, so as to perform semantic understanding of the current round conversation according to the inheritance judgment result, wherein the inheritance judgment result indicates whether the first slot-value pair needs to be inherited into the current round conversation; Before acquiring the first slot-value pair in the historical round session according to the acquired historical round session feature, the method further includes: The second user text of the current round of conversation is encoded and converted into a text vector to obtain the current round of conversation features.
2. The method according to claim 1, It is characterized in that The training method of the entity tracking model includes: Acquire a sample conversation data set, wherein the sample conversation data in the sample conversation data set includes conversation data of at least two rounds of conversations, and the sample conversation data includes the following annotated training labels: the first slot-value pair in a previous round of conversation, the conversation intent of a next round of conversation, and a time difference between the previous round of conversation and the next round of conversation; An initial entity tracking model is trained according to the sample session data set and the training labels to obtain the entity tracking model.
3. The method according to claim 1, It is characterized in that The acquiring of the timing characteristics comprises: Obtaining a time difference between the historical round of conversations and the current round of conversations; Get a predetermined time bucket; A time series feature corresponding to the time difference is acquired according to the time bucket, where the time series feature represents a time region in the time bucket corresponding to the time difference.
4. The method according to claim 1, It is characterized in that Before acquiring the first slot-value pair in the historical round session according to the acquired historical round session feature, the method further includes: Text encoding is performed on the first user text and the system reply text of the historical round conversation to obtain the historical round conversation feature.
5. The method according to claim 4, It is characterized in that The obtaining of the current round conversation intention of the current round conversation according to the obtained current round conversation feature includes: Obtaining an intention word vector of the second user text according to the current round conversation feature; The intent word vector is encoded using a one-hot encoding method to obtain the current round of conversation intent.
6. The method according to claim 4, It is characterized in that The step of acquiring the first slot-value pair in the historical round session according to the acquired historical round session feature includes: Using a preset word vector model to obtain slot value information of the first user text according to the historical round conversation features; The first slot-value pair is generated according to the acquired slot information and the slot value information.
7. The method according to claim 1, It is characterized in that After obtaining the inheritance judgment result of the first slot-value pair, the method further includes: The semantic understanding result of the current round conversation is obtained according to the inheritance judgment result, the historical round conversation feature and the current round conversation feature.
8. A physical tracking device, It is characterized in that The device comprises: A slot-value pair acquisition unit, configured to acquire a first slot-value pair in a historical round conversation according to the acquired historical round conversation feature; An intention acquisition unit, used to acquire a current round conversation intention of a current round conversation according to the acquired current round conversation features; A timing acquisition unit, configured to acquire a timing feature, wherein the timing feature is obtained according to a time difference between the historical round conversation and the current round conversation; A tracking unit, configured to input the first slot-value pair, the current round conversation intention, and the timing feature into a preset entity tracking model, and obtain an inheritance judgment result of the first slot-value pair, so as to perform semantic understanding of the current round conversation according to the inheritance judgment result, wherein the inheritance judgment result indicates whether the first slot-value pair needs to be inherited into the current round conversation; It also includes an encoding unit, which is used to perform text encoding on the second user text of the current round of conversation, convert it into a text vector, and obtain the current round of conversation features.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Dialogue control method and device
CN109815326A
State tracking method and device in task-driven multi-round conversation system
CN113590769A