Method and computer program product for tracking a dialog state
By combining contextual information from dialogue records with prior data, and utilizing multi-head attention mechanisms and classifiers to generate feature vectors, the problem of insufficient accuracy in dialogue state tracking in the real estate field is solved, achieving a more accurate representation of user preferences.
Patent Information
- Application Number
- CN202210313609.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-03-28
AI Technical Summary
In dialogue scenarios such as real estate, existing technologies struggle to accurately track users' conversational states, especially given the diverse types of property attributes and the lack of clear connections between them, resulting in insufficient accuracy in tracking conversational states.
By combining contextual information from dialogue records with prior data, the first and second probabilities of the target state slot are determined. Using a multi-head attention mechanism and a pre-trained classifier, feature vectors are generated. Combined with user profiles, item attributes, and intent information, the matching degree and accuracy of dialogue state slots are improved.
The accuracy of dialogue state tracking is improved, which can more accurately represent the user's preference for tracking state information and enhance the targetedness of the dialogue system.
Smart Images

Figure CN114780674B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to a method and a computer program product for tracking a dialogue state. BACKGROUND
[0002] In the field of instant messaging, by tracking the dialogue state of a user, the dialogue intention of the user can be obtained in real time, which helps to improve the pertinence of the dialogue. Dialogue state tracking is to infer the current dialogue state of the user from the dialogue record, and the dialogue state can be represented by the probability distribution of the slot value. In the dialogue state tracking system, the state information related to the dialogue state can be represented by the combination of multiple sets of slot-value pairs, wherein the slot name can represent the attribute type, and the slot value can represent the specific attribute value. For example, in the field of real estate, the state information related to the dialogue state can include attributes such as the price of a house, the house type, and the decoration type, and the state slot can include "price", "house type", and "decoration type". The slot value of "price" can be a number representing the price, and the slot value of "decoration type" can be a predefined vocabulary, such as "deluxe" and "simple".
[0003] In related technologies, natural language understanding models are usually used to analyze dialogue records to obtain dialogue states. SUMMARY
[0004] The embodiments of the present disclosure provide a method and a computer program product for tracking a dialogue state to improve the accuracy of tracking the dialogue state.
[0005] In one aspect of the embodiments of the present disclosure, a method for tracking a dialogue state is provided, including: determining state information to be tracked and prior data based on a dialogue record; determining a target state slot from preset state slots based on the state information to be tracked, the state slot representing attribute information of an item; determining a first probability of the target state slot based on context information in the dialogue record; determining a second probability of the target state slot based on the prior data; and determining a target probability of the target state slot based on the first probability and the second probability, the target probability representing a preference degree of a user for the state information to be tracked.
[0006] In some embodiments, determining the target state slot from the preset state slots based on the state information to be tracked includes: extracting target attribute information of an item from the state information to be tracked; determining a target slot name matching the target attribute information; determining a state slot pointed to by the target slot name as the target state slot; or, extracting an attribute value in the target attribute information; determining the attribute value as a target slot value; and determining the target state slot based on the target slot name and the target slot value.
[0007] In some embodiments, the first probability of the target state slot is determined based on the context information in the dialogue record, including: inputting the target slot value of the target state slot and the dialogue record into a pre-trained first probability model; using the first probability model to: determine embedding vectors of the target slot value and the dialogue record; generate a feature vector based on the embedding vectors of the target slot value and the dialogue record using a multi-head attention mechanism; and determine the first probability based on the feature vector.
[0008] In some embodiments, the first probability is determined based on the feature vector, including: using a pre-trained classifier to determine, based on the feature vector, a confidence degree of the target slot value corresponding to each preset behavior type, the behavior type including: inquiry, statement and reply; and determining the first probability based on the confidence degree.
[0009] In some embodiments, the prior data includes user prior data, slot prior data and intent prior data; the user prior data includes a user-associated state slot determined based on a user portrait and a first preset probability of the user-associated state slot; the slot prior data includes an object-associated state slot determined based on attribute information of an object included in the dialogue record and a second preset probability of the object-associated state slot; and the intent prior data includes an intent-associated state slot determined based on a user intent and a third preset probability of the intent-associated state slot.
[0010] In some embodiments, the second probability of the target state slot is determined based on the prior data, including: using the second probability model to perform the following comparison steps on the target state slot and the comparison data by taking the user prior data as the comparison data: determining a target embedding vector of the target state slot and a reference embedding vector of a state slot included in the comparison data; if the target embedding vector is the same as the reference embedding vector, determining a dot product of the target embedding vector and the reference embedding vector as an association feature value; if the target embedding vector is different from the reference embedding vector, determining a dot product of the target embedding vector and a weighted vector as the association feature value, the weighted vector being a weighted sum of a preset probability of the state slot corresponding to the reference embedding vector in the comparison data and the reference embedding vector; inputting the association feature value into a fully connected layer to obtain a first prior probability; taking the slot prior data as the comparison data and performing the comparison steps to obtain a second prior probability; taking the intent prior data as the comparison data and performing the comparison steps to obtain a third prior probability; and fusing the first prior probability, the second prior probability and the third prior probability to obtain the second probability.
[0011] In some embodiments, the first preset probability is obtained via the following steps: obtaining a user portrait of the user in the dialogue record; determining a user-associated state slot from the preset state slots based on the user portrait and obtaining an initial probability of the user-associated state slot; if the dialogue record contains an item attribute corresponding to the user-associated state slot, increasing the initial probability of the user-associated state slot to obtain a first preset probability of the user-associated state slot; and if the dialogue record does not contain an item attribute corresponding to the user-associated state slot, decreasing the initial probability of the user-associated state slot to obtain a first preset probability of the user-associated state slot.
[0012] In some embodiments, the slot prior data is obtained via the following steps: obtaining an initial probability of a preset state slot; determining a target-associated state slot corresponding to an item attribute contained in the dialogue record; updating the initial probability of the target-associated state slot based on the number of times the item attribute corresponding to the target-associated state slot appears in the dialogue record and the dialogue object sending the item attribute to obtain a second preset probability of the target-associated state slot.
[0013] In some embodiments, the intent prior data is obtained via the following steps: performing intent recognition on dialogue information sent by the user in the dialogue record to determine the intent of the user; determining an intent-associated state slot from the preset state slots based on a pre-constructed correspondence between intents and state slots; and increasing the initial probability of the intent-associated state slot to obtain a third preset probability of the intent-associated state slot.
[0014] In yet another aspect of the embodiments of the present disclosure, a computer program product is provided, including computer programs / instructions which, when executed by a processor, implement the method for tracking dialogue states in any of the above embodiments.
[0015] The method for tracking dialogue states provided by the embodiments of the present disclosure can determine state information to be tracked and prior data based on a dialogue record, and determine a target state slot according to the state information to be tracked. Then, a first probability of the target state slot is determined according to context information of the dialogue record, and a second probability of the target state slot is determined according to the prior data. Finally, a target probability of the target state slot is determined based on the first probability and the second probability to represent the preference degree of the user for the state information to be tracked. In combination with the context information and the prior data to determine the probability of the state information, the accuracy of dialogue state tracking can be improved.
[0016] The technical solutions of the present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0018] The present disclosure can be more clearly understood and appreciated from the following detailed description, taken in conjunction with the following drawings of which:
[0019] Figure 1 Flow chart for one embodiment of the method for tracking dialogue state of the present disclosure;
[0020] Figure 2 Flow chart for determining the first probability in one embodiment of the method for tracking dialogue state of the present disclosure;
[0021] Figure 3 Flow chart for determining the second probability in one embodiment of the method for tracking dialogue state of the present disclosure;
[0022] Figure 4 Flow chart for determining the first preset probability in one embodiment of the method for tracking dialogue state of the present disclosure;
[0023] Figure 5 Flow chart for generating slot prior data in one embodiment of the method for tracking dialogue state of the present disclosure;
[0024] Figure 6 Flow chart for generating intent prior data in one embodiment of the method for tracking dialogue state of the present disclosure;
[0025] Figure 7 Structural schematic diagram of the apparatus for tracking dialogue state of the present disclosure;
[0026] Figure 8 Structural schematic diagram of one application embodiment of the electronic device of the present disclosure. DETAILED DESCRIPTION
[0027] Various exemplary embodiments of the present disclosure will now be described in detail below with reference to the accompanying drawings. Note that the relative arrangement, numerical expressions, and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0028] Those skilled in the art can understand that the terms "first", "second", and the like in the embodiments of the present disclosure are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they represent the inevitable logical sequence between them.
[0029] It should also be understood that in the embodiments of the present disclosure, "a plurality of" can mean two or more, and "at least one" can mean one, two, or more.
[0030] It should also be understood that, for any components, data, or structures mentioned in the embodiments of the present disclosure, one or more can be generally understood unless specifically limited or contrary implications are given in the context.
[0031] In addition, the term "and / or" in the present disclosure is merely a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " in the present disclosure generally represents an "or" relationship between the front and rear associated objects.
[0032] It should also be understood that the description of the embodiments of the present disclosure emphasizes the differences between the embodiments, and the same or similar parts can be referred to each other, and for the sake of brevity, will not be repeated.
[0033] At the same time, it should be understood that, for the convenience of description, the size of each part shown in the drawings is not drawn according to the actual proportion relationship.
[0034] The following description of at least one example embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0035] Techniques, methods, and devices known to those of ordinary skill in the relevant art can not be discussed in detail, but should be considered part of the specification where appropriate.
[0036] It should be noted that similar reference numbers and letters in the following drawings represent similar items, and therefore, once an item is defined in one drawing, it need not be discussed further in subsequent drawings.
[0037] The embodiments of the present disclosure can be applied to terminal devices, computer systems, servers, and other electronic devices, which can operate with many other general-purpose or special-purpose computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with terminal devices, computer systems, servers, and other electronic devices include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the above systems, and the like.
[0038] Electronic devices such as terminal devices, computer systems, servers, and the like can be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules can include routines, programs, objects, components, logic, data structures, and the like that perform particular tasks or implement particular abstract data types. Computer systems / server can be practiced in distributed cloud computing environments with remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules can be located in local and / or remote computer system storage media including memory storage devices.
[0039] Summary of the disclosure
[0040] In the process of implementing the present disclosure, the inventors found that the uncertainty of the dialogue state in some dialogue scenarios is large, for example, in the real estate field, there are many attribute types of houses involved in the dialogue process, for example, it can include the price, house type, location, additional attributes of the house, and the like, and there is no explicit association between the attributes. For such dialogue scenarios, it is difficult to guarantee the accuracy of tracking the dialogue state only by relying on the analysis of the natural language understanding model.
[0041] Exemplary methods
[0042] The following will be described in combination with Figure 1 The method for tracking the dialogue state of the present disclosure is exemplarily illustrated. Figure 1 A flowchart of one embodiment of the method for tracking the dialogue state of the present disclosure is shown, as shown in the figure, the flow includes the following steps. Figure 1
[0043] In the embodiment of the present disclosure, the way of obtaining the dialogue record includes but is not limited to obtaining the dialogue record provided by the user and the like. The dialogue record or other information obtained in the embodiment of the present disclosure is data information provided by the user with authorization and consent.
[0044] Step 110, based on the dialogue record, determining the state information to be tracked and the prior data.
[0045] In this embodiment, the state information is used to represent the user's demand, which can include the attribute of one or more items.
[0046] Taking a dialogue scenario in the real estate field as an example, the state information of the user can represent the user's demand for a house, which can include price, house type, location, and the like. The user can express his / her demand in a dialogue application provided by a real estate agent to obtain corresponding information. The execution subject can be a server of the real estate agent, which can parse the price, house type, location, and the like from the dialogue record through a natural language model, and then can take the price, house type, location, and the like as state information to be tracked.
[0047] In the present embodiment, the prior data represents data other than the dialogue record for predicting the user demand, and the prior data can include a predicted state slot and a prior probability of the state slot. The prior data is, for example, a user portrait, and can also be constructed based on historical dialogue records or browsing records of the user in other applications.
[0048] In step 120, a target state slot is determined from preset state slots based on the state information to be tracked.
[0049] In the present embodiment, the state slot represents attribute information of an item, and the target state slot represents attribute information of the item corresponding to the state information to be tracked. The state slot includes a slot name and a slot value, wherein the slot name represents an attribute name of the item, and the slot value represents a specific attribute value. Each slot name can correspond to multiple slot values, and each slot value and the corresponding slot name form a state slot.
[0050] It should be noted that the slot value of the state slot in the present disclosure can be a number or a descriptive word.
[0051] Continuing to combine the example in step 110, the target state slot can include the following three: "price: 3 million", "house type: two-bedroom-one-living-room", and "location: city center", wherein "price", "house type", and "location" are slot names of the target state slot; and "3 million", "two-bedroom-one-living-room", and "city center" are corresponding slot values, respectively.
[0052] In some optional implementations of the present embodiment, the target state slot can also be determined in the following manner: target attribute information of an item is extracted from the state information to be tracked; a target slot name that matches the target attribute information is determined; a state slot pointed to by the target slot name is determined as the target state slot; or, an attribute value in the target attribute information is extracted; the attribute value is determined as a target slot value; and the target state slot is determined based on the target slot name and the target slot value.
[0053] In a specific example, the state information parsed by the execution subject from the dialogue record is "400 million for the price", and the execution subject can determine "price" as the target slot name, and then determine all state slots corresponding to "price" as target state slots, thereby obtaining multiple target state slots; or the execution subject can directly determine "400 million" as the target slot value, and determine a target state slot based on the target slot name "price" and the target slot value "400 million".
[0054] In the implementation, based on the item attribute contained in the dialogue record, the target state slot can be determined in the form of selection or enumeration, and the matching degree of the target state slot and the user demand can be improved.
[0055] In step 130, a first probability of the target state slot is determined based on the context information in the dialogue record.
[0056] In the embodiment, the first probability represents the matching degree of the target state slot and the context information in the dialogue record, and the higher the matching degree, the greater the value of the first probability.
[0057] As an example, the execution subject can input the target state slot and the dialogue record into a pre-trained long short term memory network (LSTM), determine the matching degree between the target state slot and the context of the dialogue record, and map the matching degree to the first probability.
[0058] In step 140, a second probability of the target state slot is determined based on prior data.
[0059] In the embodiment, the second probability represents the matching degree of the target state slot and the prior data, and the higher the matching degree, the greater the value of the second probability.
[0060] As an example, the prior data can be a user portrait, and if the state slot corresponding to the user portrait includes the target state slot, the prior probability of the state slot in the user portrait can be determined as the second probability of the target state slot.
[0061] For another example, the prior data can also be constructed based on user browsing records, and the prior probability of a state slot can be predicted according to the number of times the state slot appears in the browsing records, and if the target state slot exists in the browsing records, the prior probability in the browsing records is determined as the second probability of the target state slot.
[0062] If there is no state slot matching the target state slot in the prior data, the second probability of the target state slot can be determined as a preset value, for example, 0 or a value close to 0.
[0063] Step 150, determining a target probability of the target state slot based on the first probability and the second probability.
[0064] In the embodiment, the target probability represents the preference degree of the user for the state information to be tracked, and the target probability values of the plurality of target state slots can reflect the current state distribution of the user. For example, a weighted sum of the first probability and the second probability can be determined as the target probability of the target state slot based on a predetermined weight.
[0065] In a specific example, the state information to be tracked includes a price of 3 million, a fine decoration, and a school district house, which correspond to target state slot 1 "price: 3 million", target state slot 2 "decoration: fine decoration", and target state slot 3 "type: school district house", respectively. After step 150, the execution subject obtains a target probability of 0.9 for target state slot 1, a target probability of 0.3 for target state slot 2, and a target probability of 0.5 for target state slot 3, and the user's dialogue state can be represented as a higher preference degree for the price, a lower preference degree for the decoration, and a general preference degree for the location.
[0066] The method for tracking dialogue state provided in the embodiment can determine the state information to be tracked and prior data based on the dialogue record, and determine the target state slot according to the state information to be tracked. Then, the first probability of the target state slot is determined according to the context information of the dialogue record, and the second probability of the target state slot is determined according to the prior data. Finally, the target probability of the target state slot is determined based on the first probability and the second probability, so as to represent the preference degree of the user for the state information to be tracked. In combination with the context information and the prior data to determine the probability of the state information, the accuracy of the dialogue state tracking can be improved.
[0067] Reference is made next to Figure 2 , Figure 2 A flowchart illustrating the determination of the first probability in one embodiment of the method for tracking dialogue state of the present disclosure is shown in FIG. 13A. Figure 2 As shown in FIG. 13A, step 130 can further include the following steps.
[0068] Step 210, inputting the target slot value of the target state slot and the dialogue record into a pre-trained first probability model.
[0069] As an example, the first probability model can be a language model constructed based on a bert model. The execution subject can first extract the target slot value from the target state slot, and then input the target slot value and the dialogue record into the first probability model to determine the embedding vector of the target slot value and the embedding vector of the dialogue record, respectively.
[0070] After that, steps 220 to 240 are performed by using the first probability model.
[0071] Step 220, determining the embedding vector of the target slot value and the dialogue record.
[0072] Step 230, generating a feature vector based on the embedding vector of the target slot value and the dialogue record by using a multi-head attention mechanism.
[0073] In the embodiment, the first probability model can first extract the word embedding vector of the keyword from the embedding vector of the dialogue record based on the multi-head attention mechanism, and then concatenate the embedding vector of the target slot value and the word embedding vector of the keyword as the feature vector.
[0074] Step 240, determining the first probability based on the feature vector.
[0075] In the embodiment, the first probability model can map the feature vector obtained in step 230 to the first probability according to the learned mapping strategy.
[0076] From Figure 2 It can be seen that, Figure 2 The flowchart shown embodies the step of calculating the first probability by using the second probability model, and the feature vector of the target slot value and the dialogue record is generated by using the multi-head attention mechanism, which can extract the relevance feature of the target slot value and the context information in the dialogue record, and the first probability obtained in this way can more accurately represent the relevance of the target state slot and the context in the dialogue record.
[0077] In some optional implementations of the above embodiment, the above step 240 can further include: determining, by using a pre-trained classifier, a confidence degree of the target slot value corresponding to each preset behavior type based on the feature vector, the behavior type including: inquiry, statement and reply; and determining the first probability based on the confidence degree.
[0078] Generally, the demand of the user in the dialogue is not only related to the dialogue content, but also related to the behavior type of the user when expressing, and under different behavior types, the determination degree of the user demand represented by the same dialogue content is also different.
[0079] As an example, the classifier can be a softmax function, and the execution subject can input the feature vector into the classifier to obtain the confidence degree of the feature vector corresponding to three behavior types, and then determine the weighted sum of the three confidence degrees as the first probability.
[0080] In the implementation, the confidence degree of the feature vector corresponding to different behavior types can be estimated by the classifier, and then the first probability is determined based on each confidence degree, which can introduce the behavior feature of the user expressing the dialogue content in the dialogue record into the calculation process of the first probability, thereby improving the accuracy of the first probability.
[0081] In a further embodiment of the method for tracking the state of the conversation of the present disclosure, the priori data can include user priori data, slot priori data and intent priori data, wherein the user priori data includes a user-associated state slot determined based on a user profile and a first preset probability of the user-associated state slot; the slot priori data includes an object-associated state slot determined based on attribute information of an object included in the conversation record and a second preset probability of the object-associated state slot; and the intent priori data includes an intent-associated state slot determined based on a user intent and a third preset probability of the intent-associated state slot.
[0082] In the present embodiment, the user priori data represents data obtained by prediction based on the preferences of the user, the slot priori data represents data obtained by analysis based on the conversation information of the user, and the intent priori data represents data obtained by prediction based on the conversation intent of the user. The demand of the user can be predicted from the three dimensions of the historical behavior of the user, the current conversation record and the conversation intent, which can improve the accuracy of the priori data representing the demand of the user.
[0083] Reference is then made to Figure 3 , Figure 3 Fig. 6 shows a flowchart of determining the first preset probability in one embodiment of the method for tracking the state of the conversation of the present disclosure. In some optional implementations of the present embodiment, the first preset probability can be determined by the flow shown in Fig. 7, which includes the following steps. Figure 3
[0084] Step 310: Obtain a user profile of the user in the conversation record.
[0085] In the present implementation, the execution subject can extract the user identification from the conversation record and determine the corresponding user profile according to the user identification.
[0086] As an example, the execution subject can obtain the historical conversation record of the user or the browsing record of the user in other applications in advance, then estimate the behavior habit of the user from the historical conversation record or the browsing record, and construct the user profile according to the behavior habit and generate the user identification uniquely corresponding to the user profile.
[0087] Step 320: Determine the user-associated state slot from the preset state slots and obtain the initial probability of the user-associated state slot based on the user profile.
[0088] In the present implementation, the execution subject can map the user preferences represented by the user profile to the state slots to obtain the user-associated state slot, and determine the initial probability of the user-associated state slot according to the degree of the user preferences.
[0089] Step 330, if the dialogue record contains the item attribute corresponding to the user-associated state slot, the initial probability of the user-associated state slot is increased to obtain the first preset probability of the user-associated state slot.
[0090] Step 340, if the dialogue record does not contain the item attribute corresponding to the user-associated state slot, the initial probability of the user-associated state slot is decreased to obtain the first preset probability of the user-associated state slot.
[0091] In the present implementation, if the dialogue record contains the item attribute corresponding to the user-associated state slot, it indicates that the user currently has a higher degree of preference for the item attribute corresponding to the user-associated state slot, and in this case, the initial probability of the user-associated state slot can be increased; if the dialogue record does not contain the item attribute corresponding to the user-associated state slot, it indicates that the user currently has a lower degree of preference for the item attribute corresponding to the user-associated state slot, and in this case, the initial probability of the user-associated state slot can be decreased.
[0092] As an example, the execution subject can preset an adjustment coefficient to increase or decrease the initial probability by the adjustment coefficient.
[0093] In the present implementation, the initial probability of the user-associated state slot can be corrected according to the dialogue record to obtain the first preset probability, which can improve the timeliness and accuracy of the user priori data.
[0094] Reference is made next to Figure 4 , Figure 4 An embodiment of the method for tracking dialogue state of the present disclosure is shown to generate a flowchart of slot priori data, in some optional implementations of the present embodiment, the flowchart shown in Figure 5 may also be used to generate slot priori data, as shown in Figure 4 The flowchart includes the following steps.
[0095] Step 410, obtaining the initial probability of the preset state slot.
[0096] In the present implementation, the initial probability of the state slot can be determined in the following manner: the execution subject can obtain the data related to the item in advance, which can include the browsing records, dialogue records, purchase records, etc. of different users, and then determine the distribution rule of each state slot in the data through statistical analysis, and determine the initial probability of the state slot according to the distribution rule.
[0097] Step 420, determining the state slot corresponding to the item attribute contained in the dialogue record as the object-associated state slot.
[0098] As an example, the execution subject can parse the dialogue record by using the natural language understanding model, extract the item attribute from the dialogue record, and then determine the state slot corresponding to the item attribute as the object-related state slot.
[0099] Step 430, updating the initial probability of the object-related state slot based on the number of times the item attribute corresponding to the object-related state slot appears in the dialogue record and the dialogue object sending the item attribute, to obtain a second preset probability of the object-related state slot.
[0100] Taking a dialogue scenario in the real estate field as an example, the dialogue parties are a real estate agent and a user, and the item involved in the dialogue can be a house source, and the item attribute can be an attribute of the house source, such as price, house type, etc. The execution subject can set a first weight according to the number of times the house source appears in the dialogue record. The more the number of times the house source appears, the greater the degree of preference of the user to the house source, and the greater the value of the first weight. At the same time, the execution subject can also set a second weight according to the dialogue object sending the house source. If the house source is sent by the real estate agent, the value of the second weight is smaller, and if the house source is sent by the user, the value of the second weight is larger. Further, the execution subject can also determine the second weight according to the context when the real estate agent sends the house source. For example, when the user asks about the house source, the house source sent by the real estate agent can be given a larger value of the second weight, and if the user does not ask about the house source, the real estate agent directly pushes the house source, which can be given a smaller value of the second weight. Then, the execution subject can adjust the initial probability of the object-related state slot according to the first weight and the second weight to obtain the second preset probability of the object-related state slot.
[0101] Further, the execution subject can also predict the user's preference according to the differences between different house sources pushed by the real estate agent, and adjust the initial probability of the object-related state slot accordingly.
[0102] In the present implementation, the object-related state slot can be determined according to the item attribute contained in the dialogue record, and the initial probability of the state slot can be adjusted to obtain the second preset probability. By predicting the user's demand from the dialogue record, the accuracy of the slot prior data representing the user's demand can be improved.
[0103] Reference is then made to Figure 5 , Figure 5 shows a flowchart for generating intent prior data in one embodiment of the method for tracking dialogue state of the present disclosure. In some optional implementations of the present embodiment, the intent prior data can be generated by using the flowchart shown in Figure 5 , which includes the following steps.
[0104] Step 510, performing intent recognition on the dialogue information sent by the user in the dialogue record to determine the intent of the user.
[0105] Step 520, determining the intent-associated state slot from the preset state slots based on the pre-constructed correspondence between the intent and the state slot.
[0106] Step 530, improving the initial probability of the intent-associated state slot to obtain a third preset probability of the intent-associated state slot.
[0107] In the implementation manner, the execution subject can determine the intent-associated state slot according to the intent of the user, and improve the initial probability of the intent-associated state slot to obtain the third preset probability. By predicting the demand of the user through the intent, the accuracy of the intent priori data can be improved.
[0108] Reference is made to Figure 6 , Figure 6 A flowchart for determining the second probability in one embodiment of the method for tracking the dialogue state of the present disclosure is shown, as shown in Figure 6 , the flow includes the following steps.
[0109] Step 610, taking the user priori data as the comparison data, and performing the following comparison steps on the target state slot and the comparison data by using the second probability model.
[0110] In the embodiment, the priori data can include the user priori data, the slot priori data, and the intent priori data.
[0111] As an example, the second probability model can be constructed based on the bert model. The execution subject can first input the user priori data and the target state slot into the pre-trained second probability model, and then perform the comparison steps on the user priori data and the target state slot by using the second probability model to obtain the first priori probability. The comparison steps can include steps 620 to 650.
[0112] Step 620, determining the target embedding vector of the target state slot and the reference embedding vector of the state slot included in the comparison data.
[0113] In the embodiment, the execution subject can convert the target slot name and the target slot value of the target state slot into the target embedding vector, and convert the slot name and the slot value of the user-associated state slot into the reference embedding vector by using the second probability model.
[0114] Step 630, if the target embedding vector is the same as the reference embedding vector, determining the dot product of the target embedding vector and the reference embedding vector as the association feature value.
[0115] In the embodiment, the association feature value can represent the relevance of the target state slot and the user association state slot. The target embedding vector is the same as the reference embedding vector, indicating that the target state slot is included in the user prior data. In this case, the association feature value is the length of the target embedding vector, i.e., the maximum value of the association feature value.
[0116] In step 640, if the target embedding vector is different from the reference embedding vector, the dot product of the target embedding vector and the weighted vector is determined as the association feature value.
[0117] In the embodiment, the weighted vector is the weighted sum of the reference embedding vector and the preset probability of the state slot corresponding to the reference embedding vector in the comparison data.
[0118] In the embodiment, if the target embedding vector is different from the reference embedding vector, the association feature value is the conditional probability value that satisfies both the target state slot and the user association state slot.
[0119] As an example, the target state slot is "price: 3 million", the target embedding vector is A; the user association state slot 1 is "price: 3 million", the reference embedding vector is A; the user association state slot 2 is "decoration: simple decoration", the reference embedding vector is B, and the preset probability is 0.3. The association feature value 1 of the target state slot and the user association state slot 1 is the length of the vector A, the weighted vector of the user association state slot 2 is 0.3·B, and the association feature value 2 of the target state slot and the user association state slot 2 is A*(0.3·B). The association feature value 2 represents the probability that the house source is "price: 3 million and decoration type: simple decoration".
[0120] In step 650, the association feature value is input into the full connection layer to obtain the first prior probability.
[0121] As an example, sigmoid can be used as the activation function of the full connection layer to map the plurality of association feature values obtained in step 640 to the first prior probability.
[0122] In step 660, the slot prior data is used as the comparison data, and the comparison step is performed to obtain the second prior probability.
[0123] In step 670, the intent prior data is used as the comparison data, and the comparison step is performed to obtain the third prior probability.
[0124] In the embodiment, the execution subject can sequentially input the user prior data, the slot prior data, and the intent prior data into the second probability model to determine the first prior probability, the second prior probability, and the third prior probability through steps 620 to 650.
[0125] Step 680, fusing the first prior probability, the second prior probability and the third prior probability to obtain the second probability.
[0126] As an example, the execution subject can determine a weighted sum of the first prior probability, the second prior probability and the third prior probability as the second probability based on preset weights. For example, the second probability can be determined by the following formula (1).
[0127] P = a1 * P1 + a2 * P2 + a3 * P3 (1)
[0128] In the formula, P represents the second probability, a1, a2 and a3 represent the weights, and P1, P2 and P3 represent the first prior probability, the second prior probability and the third prior probability respectively.
[0129] From Figure 6 It can be seen that Figure 6 The embodiment shown embodies the step of comparing the target state slot with the user prior data, the slot prior data and the intent prior data respectively by using the second probability model, and fusing the comparison results to obtain the second probability. The internal correlation between the target state slot and the prior data can be mined by the second probability model, and the internal correlation is introduced into the calculation process of the second probability, so that the accuracy of the second probability in predicting user demand is improved.
[0130] Exemplary devices
[0131] Next, reference is made to Figure 7 , Figure 7 shows a structural schematic diagram of an apparatus for tracking dialogue state of the present disclosure, as Figure 7 shown, the apparatus comprises: a record analysis unit 710 configured to determine state information to be tracked and prior data based on dialogue records; a slot determination unit 720 configured to determine a target state slot from preset state slots based on the state information to be tracked, the state slot representing attribute information of an item; a first probability unit 730 configured to determine a first probability of the target state slot based on context information in the dialogue records; a second probability unit 740 configured to determine a second probability of the target state slot based on the prior data; and a probability fusion unit 750 configured to determine a target probability of the target state slot based on the first probability and the second probability, the target probability representing a preference degree of a user for the state information to be tracked.
[0132] In this embodiment, the slot determination unit 720 further includes: an attribute extraction module configured to extract target attribute information of the article from the state information to be tracked; a slot name determination module configured to determine a target slot name matching the target attribute information; a first determination module or a second determination module, wherein the first determination module is configured to determine the state slot pointed to by the target slot name as the target state slot; and the second determination module is configured to extract an attribute value in the target attribute information, determine the attribute value as a target slot value, and determine the target state slot based on the target slot name and the target slot value.
[0133] In this embodiment, the first probability unit 730 further includes: a first input module configured to input the target slot value of the target state slot and the dialogue record into the pre-trained first probability model; a first embedding module configured to determine embedding vectors of the target slot value and the dialogue record by using the first probability model; a feature vector module configured to generate a feature vector based on the embedding vectors of the target slot value and the dialogue record by using a multi-head attention mechanism; and a first prediction module configured to determine the first probability based on the feature vector.
[0134] In this embodiment, the first prediction module is further configured to determine, by using a pre-trained classifier, a confidence degree of the target slot value corresponding to each preset behavior type based on the feature vector, the behavior types including: asking, stating, and replying; and determine the first probability based on the confidence degree.
[0135] In this embodiment, the prior data includes user prior data, slot prior data, and intent prior data; the user prior data includes a user-associated state slot determined based on a user portrait and a first preset probability of the user-associated state slot; the slot prior data includes an object-associated state slot determined based on attribute information of an article included in the dialogue record and a second preset probability of the object-associated state slot; and the intent prior data includes an intent-associated state slot determined based on a user intent and a third preset probability of the intent-associated state slot.
[0136] In this embodiment, the second probability unit 740 is further configured to: take the user priori data as the comparison data, and perform the following comparison steps on the target state slot and the comparison data by using the second probability model: determining a target embedding vector of the target state slot and a reference embedding vector of a state slot included in the comparison data; if the target embedding vector is the same as the reference embedding vector, determining a dot product of the target embedding vector and the reference embedding vector as a correlation feature value; if the target embedding vector is different from the reference embedding vector, determining a dot product of the target embedding vector and a weighted vector as the correlation feature value, the weighted vector being a weighted sum of a preset probability of the state slot corresponding to the reference embedding vector in the comparison data and the reference embedding vector; inputting the correlation feature value into a full connection layer to obtain a first priori probability; taking the slot priori data as the comparison data and performing the comparison steps to obtain a second priori probability; taking the intent priori data as the comparison data and performing the comparison steps to obtain a third priori probability; and fusing the first priori probability, the second priori probability and the third priori probability to obtain the second probability.
[0137] In this embodiment, the device further includes a first preset probability generation unit configured to: obtain a user portrait of the user in the dialogue record; determine a user-associated state slot from the preset state slots based on the user portrait and obtain an initial probability of the user-associated state slot; if the dialogue record contains an item attribute corresponding to the user-associated state slot, increase the initial probability of the user-associated state slot to obtain a first preset probability of the user-associated state slot; and if the dialogue record does not contain an item attribute corresponding to the user-associated state slot, decrease the initial probability of the user-associated state slot to obtain a first preset probability of the user-associated state slot.
[0138] In this embodiment, the device further includes a slot priori data generation unit configured to: obtain an initial probability of a preset state slot; determine an object-associated state slot corresponding to an item attribute contained in the dialogue record; update the initial probability of the object-associated state slot based on a number of times that the item attribute corresponding to the object-associated state slot appears in the dialogue record and a dialogue object that sends the item attribute to obtain a second preset probability of the object-associated state slot.
[0139] In this embodiment, the device further includes an intent priori data generation unit configured to: perform intent recognition on dialogue information sent by the user in the dialogue record to determine an intent of the user; determine an intent-associated state slot from the preset state slots based on a pre-constructed correspondence between intents and state slots; and increase an initial probability of the intent-associated state slot to obtain a third preset probability of the intent-associated state slot.
[0140] In addition, the embodiments of the present disclosure also provide an electronic device, comprising:
[0141] a memory for storing a computer program;
[0142] a processor for executing the computer program stored in the memory, and the computer program, when executed, implements the method for tracking a dialogue state according to any one of the embodiments of the present disclosure.
[0143] Figure 8 Fig. 1 shows a schematic diagram of an electronic device according to an embodiment of the present disclosure. Figure 8 The electronic device can be either one or both of the first device and the second device, or a stand-alone device independent of them, which can communicate with the first device and the second device to receive the acquired input signals therefrom.
[0144] As shown in Fig. 1, the electronic device includes one or more processors and a memory. Figure 8
[0145] The processor can be a central processing unit (CPU) or other form of processing unit having data processing and / or instruction execution capabilities, and can control other components in the electronic device to perform desired functions.
[0146] The memory can include one or more computer program products, which can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory, for example, can include random access memory (RAM), cache, and / or the like. The non-volatile memory, for example, can include read-only memory (ROM), hard disk, flash memory, and / or the like. One or more computer program instructions can be stored on the computer-readable storage media, and the processor can execute the program instructions to implement the method for tracking a dialogue state according to various embodiments of the present disclosure described above and / or other desired functions.
[0147] In one example, the electronic device can further include input and output devices, which are interconnected through a bus system and / or other forms of connection mechanism (not shown).
[0148] In addition, the input device can further include, for example, a keyboard, a mouse, and / or the like.
[0149] The output device can output various information to the outside, including the determined distance information, direction information, and / or the like. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and / or the like.
[0150] Of course, in order to simplify, Figure 8 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, the electronic device may further include any other appropriate components according to specific application scenarios.
[0151] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps in the method for tracking the conversation status according to various embodiments of the present disclosure described in the above part of this specification.
[0152] The computer program product may be written in any combination of one or more programming languages to implement the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0153] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enable the processor to execute the steps of the method for tracking conversation status according to various embodiments of the present disclosure described in the above part of this specification.
[0154] The computer-readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can, for example, include but is not limited to a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0155] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk, etc. Various media that can store program codes.
[0156] The above generally describes the basic principles of the present disclosure in conjunction with specific embodiments, but it should be noted that the advantages, benefits, effects and the like mentioned in the present disclosure are only examples and are not limiting, and these advantages, benefits, effects and the like cannot be considered as necessary for each embodiment of the present disclosure. In addition, the above specific details of the disclosure are only for the purpose of example and for the purpose of understanding, and are not limiting, and the above details do not limit the present disclosure to be necessarily implemented with the above specific details.
[0157] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between each embodiment can be mutually referred to. For system embodiments, since they basically correspond to method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0158] The block diagrams of the devices, apparatuses, equipment, systems involved in the present disclosure are only illustrative examples and are not intended to require or imply the connection, arrangement, configuration shown in the block diagram. As those skilled in the art will recognize, these devices, apparatuses, equipment, systems can be connected, arranged, configured in any manner. Words such as "include", "contain", "have" and the like are open-ended words, which mean "including but not limited to", and can be used interchangeably. The words "or" and "and" used herein mean the word "and / or", and can be used interchangeably unless the context clearly indicates otherwise. The word "such as" used herein means the phrase "such as but not limited to", and can be used interchangeably.
[0159] The methods and devices of the present disclosure can be implemented in many ways. For example, the methods and devices of the present disclosure can be implemented by software, hardware, firmware, or any combination of software, hardware, firmware. The above order of steps for the method is only for illustration, and the steps of the method of the present disclosure are not limited to the above specific description, unless otherwise specifically described. In addition, in some embodiments, the present disclosure can also be implemented as programs recorded in recording media, which include machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers the recording media storing the programs for executing the method according to the present disclosure.
[0160] It should also be noted that in the devices, equipment and methods of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions of the present disclosure.
[0161] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0162] The above description has been presented for the purpose of illustration and description. Furthermore, this description is not intended to limit the embodiments of the disclosure to the forms disclosed herein. Although several example aspects and embodiments have been discussed above, those of ordinary skill in the art will appreciate a variety of modifications, alternatives, permutations, additions, and sub-combinations of the described aspects and features.
Claims
1. A method for tracking a conversation state, characterized in that: include: Based on the conversation records, determine the state information to be tracked and prior data, wherein the prior data represents data outside the conversation records used to predict user needs, the prior data including the predicted state slots and the prior probabilities of the state slots; the state information is used to represent the user needs; Based on the state information to be tracked, determining a target state slot from preset state slots, wherein the state slot represents attribute information of the item; Determining a first probability of the target state slot based on context information in the conversation record; Determining a second probability of the target state slot based on the prior data, wherein if a state slot matching the target state slot exists in the prior data, determining the second probability based on the prior probability corresponding to the state slot matching the target state slot; if a state slot matching the target state slot does not exist in the prior data, determining the second probability to be a preset value; Based on the first probability and the second probability, a target probability of the target state slot is determined, where the target probability represents a user's preference for the state information to be tracked.
2. The method according to claim 1, characterized in that Determining a target state slot from preset state slots based on the state information to be tracked includes: extracting target attribute information of the item from the status information to be tracked; Determine a target slot name that matches the target attribute information; Determine the state slot pointed to by the target slot name as the target state slot; or Extracting attribute values from the target attribute information; Determining the attribute value as a target slot value; The target state slot is determined based on the target slot name and the target slot value.
3. The method according to claim 1 or 2, characterized in that Determining a first probability of the target state slot based on context information in the conversation record includes: Inputting the target slot value of the target state slot and the conversation record into a pre-trained first probability model; Using the first probability model: determining the target slot value and the embedding vector of the conversation record; using a multi-head attention mechanism to generate a feature vector based on the target slot value and the embedding vector of the conversation record; and determining the first probability based on the feature vector.
4. The method according to claim 3, characterized in that Determining the first probability based on the feature vector includes: Using a pre-trained classifier, based on the feature vector, determining the confidence level of the target slot value corresponding to each preset behavior type, the preset behavior types including: inquiry, statement, and reply; Based on the confidence level, the first probability is determined.
5. The method according to any one of claims 1 to 4, characterized in that The prior data includes user prior data, slot prior data and intention prior data; The user prior data includes a user association status slot determined based on the user portrait and a first preset probability of the user association status slot; The slot priori data includes an object association state slot determined based on attribute information of an item included in the conversation record and a second preset probability of the object association state slot; The intention prior data includes an intention-associated state slot determined based on the user intention and a third preset probability of the intention-associated state slot.
6. The method according to claim 5, characterized in that Determining a second probability of the target state slot based on the prior data includes: Using the user prior data as comparison data, the second probability model is used to perform the following comparison steps on the target state slot and the comparison data: determining a target embedding vector for the target state slot and a reference embedding vector for the state slot included in the comparison data; if the target embedding vector is the same as the reference embedding vector, determining the dot product of the target embedding vector and the reference embedding vector as an associated eigenvalue; if the target embedding vector is different from the reference embedding vector, determining the dot product of the target embedding vector and a weighted vector as an associated eigenvalue, where the weighted vector is the product of a preset probability of the state slot corresponding to the reference embedding vector in the comparison data and the reference embedding vector; inputting the associated eigenvalue into a fully connected layer to obtain a first prior probability; Using the slot prior data as comparison data, and performing the comparison step to obtain a second prior probability; Using the intention prior data as comparison data and performing the comparison step to obtain a third prior probability; The first prior probability, the second prior probability, and the third prior probability are integrated to obtain the second probability.
7. The method according to claim 5 or 6, characterized in that The first preset probability is obtained through the following steps: Obtaining a user profile of the user in the conversation record; Based on the user profile, determining the user-associated state slot from the preset state slots and obtaining an initial probability of the user-associated state slot; If the conversation record contains an item attribute corresponding to the user-associated status slot, then increasing the initial probability of the user-associated status slot to obtain a first preset probability of the user-associated status slot; If the conversation record does not include the item attribute corresponding to the user-associated status slot, the initial probability of the user-associated status slot is reduced to obtain a first preset probability of the user-associated status slot.
8. The method according to any one of claims 5 to 7, characterized in that The slot prior data is obtained through the following steps: Obtaining the initial probability of the preset state slot; Determining the state slot corresponding to the item attribute contained in the conversation record as the object-associated state slot; Based on the number of times the item attribute corresponding to the object association status slot appears in the conversation record and the conversation object that sent the item attribute, the initial probability of the object association status slot is updated to obtain a second preset probability of the object association status slot.
9. The method according to any one of claims 5 to 8, characterized in that The intention prior data is obtained through the following steps: Performing intent recognition on the conversation information sent by the user in the conversation record to determine the user's intention; Based on the pre-established correspondence between intent and state slots, determining the intent-associated state slot from the preset state slots; The initial probability of the intention-associated state slot is increased to obtain a third preset probability of the intention-associated state slot.
10. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Dialogue-state tracking method, system, electronic device and storage medium
CN109299231A
Slot Filling in Spoken Language Understanding with Joint Pointer and Attention
CN110555097A