A knowledge base retrieval enhanced dialog method, system, device, and medium

By performing attribute selection and entity selection on entities in an external knowledge base, and configuring implicit knowledge tags and explicit knowledge text, the problem of the generative model's inability to distinguish similar entities is solved, improving the quality and accuracy of responses and enhancing the semantic understanding and personalized response capabilities of the dialogue system.

CN120045661BActive Publication Date: 2025-11-18XIDIAN UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510094365.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-11-18
Estimated Expiration
2045-01-21

AI Technical Summary

Technical Problem

Current generative models struggle to effectively distinguish subtle differences between similar entities when processing retrieved knowledge base entities, resulting in poor quality generated responses.

Method used

By performing attribute and entity selection on entities in an external knowledge base, configuring implicit knowledge tags and explicit knowledge text, and generating target responses, entity recognition and response accuracy are improved.

Benefits of technology

It improves the quality and accuracy of generated responses, and enhances the semantic understanding and personalized response capabilities of the dialogue system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045661B_ABST
    Figure CN120045661B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of dialogue processing, and discloses a dialogue method, system, device and medium with enhanced knowledge base retrieval, wherein the method comprises the following steps: in response to a dialogue context input by a user, performing attribute selection and entity selection on entities in an external knowledge base to obtain a target entity set; configuring corresponding implicit knowledge labels for entities in the target entity set to obtain an implicit knowledge enhanced entity set; wherein the implicit knowledge labels represent labels for distinguishing similar entities in the target entity set; configuring corresponding display knowledge texts for entities in the implicit knowledge enhanced entity set to obtain an explicit knowledge enhanced entity set; wherein the display knowledge texts represent descriptive texts of the entities in the implicit knowledge enhanced entity set; and generating a target response based on the explicit knowledge enhanced entity set and the dialogue context. The technical scheme provided by the application can improve the quality and accuracy of generated replies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of dialogue processing technology, and in particular to a dialogue method, system, device and medium for knowledge base retrieval enhancement. Background Technology

[0002] Task-oriented dialogue systems use modules such as semantic parsing, dialogue state tracking, dialogue strategy learning, and response generation, combined with entity information from an external knowledge base, to meet user needs and complete specific tasks.

[0003] However, current generative models (such as T5 and ChatGPT) have difficulty effectively distinguishing subtle differences between similar entities when processing retrieved knowledge base entities, resulting in poor quality of generated responses. Summary of the Invention

[0004] This application provides a knowledge base retrieval enhanced dialogue method, system, device, and medium, which achieves the technical effect of improving the quality and accuracy of generated responses.

[0005] To achieve the above objectives, the main technical solutions adopted in this application include:

[0006] In a first aspect, embodiments of this application provide a dialog method for enhancing knowledge base retrieval, the method comprising:

[0007] In response to the user's input dialogue context, attribute selection and entity selection are performed on entities in the external knowledge base to obtain the target entity set;

[0008] Implicit knowledge tags are configured for entities in the target entity set to obtain an implicit knowledge-enhanced entity set; wherein, the implicit knowledge tags represent tags that distinguish similar entities in the target entity set;

[0009] By configuring corresponding explicit knowledge text for entities in the implicit knowledge-enhanced entity set, an explicit knowledge-enhanced entity set is obtained; wherein, the explicit knowledge text represents the descriptive text of the entities in the implicit knowledge-enhanced entity set;

[0010] Based on the explicit knowledge-enhanced entity set and the dialogue context, a target response is generated.

[0011] This embodiment provides a knowledge base retrieval-enhanced dialogue method that accurately selects relevant entities and their attributes from an external knowledge base based on the user-input dialogue context, forming a target entity set. Furthermore, by configuring implicit knowledge tags for entities, similar entities are effectively distinguished, enhancing the recognizability between entities. Next, by configuring descriptive text for the implicit knowledge-enhanced entity set, implicit knowledge is transformed into explicit knowledge, making the entity knowledge clearer and easier to understand. Finally, based on the explicit knowledge-enhanced entity set and the dialogue context, accurate and user-relevant target responses can be generated, thereby improving the overall interactive experience.

[0012] In one implementation, the step of responding to the user-input dialogue context by performing attribute selection and entity selection on entities in an external knowledge base to obtain a target entity set includes:

[0013] In response to the dialogue context input by the user, a dialogue context dense vector corresponding to the dialogue context is determined, and an attribute dense vector corresponding to the entity in the external knowledge base is determined.

[0014] Based on the dialogue context dense vector and the attribute dense vector, attribute selection is performed on entities in the external knowledge base to obtain a first entity set containing the location entity attributes; wherein, the location entity attributes represent the attributes of entities directly located in the external knowledge base with the dialogue context.

[0015] Determine the entity density vector corresponding to the entity in the first entity set;

[0016] Based on the entity density vector and the dialogue context density vector, entity selection is performed on the entities in the first entity set to obtain the second entity set;

[0017] The target entity set is obtained by configuring non-location entity attributes in the second entity set; wherein, the non-location entity attributes represent attributes of entities that are not directly located in the external knowledge base and the dialogue context.

[0018] This embodiment responds to the user's input dialogue context by calculating the dense vector of the context and the dense vector of entity attributes in an external knowledge base, providing foundational data for the subsequent entity selection process. Next, based on the dialogue context dense vector and the entity attribute dense vector, attribute selection is performed on entities in the external knowledge base, resulting in a first entity set containing attributes of entities directly located within the dialogue context. Furthermore, the entity dense vector for each entity in the first entity set is calculated, and entity selection is performed based on these entity dense vectors and the dialogue context dense vector, resulting in a second entity set. Finally, according to the relationship between the dialogue context and the attributes of non-located entities, the attributes of non-located entities in the second entity set are configured, thus obtaining the final target entity set. This embodiment can accurately filter out entities that match the intent of the dialogue context, effectively reducing interference from irrelevant entities and improving the accuracy of semantic understanding and personalized response capabilities.

[0019] In one implementation, the external knowledge base includes multiple entities, each entity including multiple attribute value pairs; determining the attribute-dense vector corresponding to the entity in the external knowledge base includes:

[0020] The attribute value pairs corresponding to entities in the external knowledge base are encoded using an encoder to obtain the attribute dense vector.

[0021] In one implementation, the step of selecting attributes for entities in the external knowledge base based on the dialogue context dense vector and the attribute dense vector to obtain a first entity set containing the attributes of the located entities includes:

[0022] The attribute selection score is obtained by determining the dot product between the dialogue context dense vector and the attribute dense vector;

[0023] If the attribute selection score is greater than a preset threshold, the entity corresponding to the dense vector of the attribute is retained to obtain a first entity set containing the location entity attribute.

[0024] This embodiment calculates the dot product between the dense vector of the dialogue context and the dense vector of attributes to obtain an attribute selection score, which quantifies the matching degree between the dialogue context and entity attributes. When the attribute selection score exceeds a preset threshold, entities highly relevant to the context are retained, thus forming a first entity set containing the attributes of the located entities. This embodiment can accurately filter out entities related to the dialogue content according to the specific needs of the dialogue context, improving the accuracy and efficiency of entity filtering.

[0025] In one implementation, the step of selecting entities from the first entity set based on the entity density vector and the dialogue context density vector to obtain a second entity set includes:

[0026] The entity selection score is obtained by determining the dot product between the entity dense vector and the dialogue context dense vector.

[0027] The entities are selected and sorted from highest to lowest score, and the second entity set is obtained based on the sorting result.

[0028] This embodiment measures the similarity between entities and the dialogue by calculating the dot product between the dense vector of the dialogue context and the dense vector of entities, thereby improving the accuracy of entity selection. Dot product calculation is efficient, enabling rapid processing and improving response speed. Furthermore, this process enhances the system's ability to understand implicit information, contributing to the optimization of dialogue quality. Entities are sorted according to their selection scores, forming a second entity set. By filtering and sorting, redundant entities are reduced, improving response efficiency and accuracy.

[0029] In one implementation, the implicit knowledge tags include text tags, confidence tags, and co-occurrence information tags; configuring corresponding implicit knowledge tags on entities in the target entity set to obtain an implicit knowledge-enhanced entity set includes:

[0030] Based on the entity selection score, the sorting information of the entities in the first entity set is determined as the text label;

[0031] Based on the entity selection score, the confidence level of the entities in the first entity set is classified, and the classification result is determined as the confidence level label;

[0032] Determine the co-occurrence of entities in the first entity set in the dialogue context, and define the co-occurrence as the co-occurrence information label;

[0033] The implicit knowledge-enhanced entity set is obtained by configuring the corresponding text tags, confidence tags, and co-occurrence information tags for the entities in the second entity set.

[0034] This embodiment sorts entities in the first entity set according to priority based on entity selection scores, and uses this sorting result as text labels to provide a valid reference for subsequent entity selection. Next, the confidence level of entities in the first entity set is graded using the entity selection scores, and entities are classified according to their confidence level. This grading result is used as confidence labels to provide data support for further entity filtering and optimization. Then, the co-occurrence of entities in the first entity set in the dialogue context is analyzed. Through this co-occurrence analysis, co-occurrence information labels are generated. This information helps capture semantic relationships between entities, improving the coherence and accuracy of the dialogue. Finally, these labels are configured onto entities in the second entity set, resulting in an implicit knowledge-enhanced entity set. This embodiment, through precise label configuration, further improves the semantic understanding and interactive response quality of entities, achieving deep integration and intelligent enhancement of dialogue context and external knowledge base.

[0035] In one implementation, configuring corresponding explicit knowledge text for entities in the implicit knowledge-enhanced entity set to obtain an explicit knowledge-enhanced entity set includes:

[0036] The attribute value pairs corresponding to the entities in the implicit knowledge-enhanced entity set are parsed using a large language model to obtain the corresponding descriptive text;

[0037] The descriptive text corresponding to the entities in the implicit knowledge-enhanced entity set is configured to obtain the explicit knowledge-enhanced entity set.

[0038] This embodiment utilizes a large language model to parse entities and their attribute value pairs in an implicit knowledge-enhanced entity set. This enables a deep understanding of the relationships between entities and their attributes, generating corresponding descriptive text. This process transforms implicit knowledge information into explicit textual descriptions, providing valuable information for subsequent processing. Next, these descriptive texts are configured onto the entities, thereby generating an explicit knowledge-enhanced entity set, transforming latent knowledge into a directly applicable explicit knowledge form. In this way, the knowledge of entities is clearly identified and can be closely integrated with practical application tasks, improving semantic understanding and intelligent response capabilities.

[0039] Secondly, embodiments of this application provide a knowledge base retrieval enhanced dialogue device, the device comprising: an attribute and entity selection unit, used to select attributes and entities in an external knowledge base in response to a dialogue context input by a user, to obtain a target entity set;

[0040] An implicit tagging unit is configured to configure corresponding implicit knowledge tags for entities in the target entity set, thereby obtaining an implicit knowledge-enhanced entity set; wherein, the implicit knowledge tags represent tags that distinguish similar entities in the target entity set; an explicit text unit is configured to configure corresponding explicit knowledge text for entities in the implicit knowledge-enhanced entity set, thereby obtaining an explicit knowledge-enhanced entity set; wherein, the explicit knowledge text represents descriptive text of entities in the implicit knowledge-enhanced entity set;

[0041] The target response generation unit is used to generate a target response based on the explicit knowledge-enhanced entity set and the dialogue context.

[0042] Thirdly, embodiments of this application provide a computer device, including:

[0043] The system includes a memory and a processor, which are interconnected. The memory stores computer instructions, and the processor executes these computer instructions to perform the knowledge base retrieval-enhanced dialogue method described above.

[0044] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer instructions for causing a computer to execute the knowledge base retrieval enhanced dialogue method described above. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0046] Figure 1 A flowchart illustrating a knowledge base retrieval enhancement dialogue method provided in an embodiment of this application;

[0047] Figure 2 A flowchart of step S1 provided in the embodiments of this application;

[0048] Figure 3 A flowchart of step S13 provided in an embodiment of this application;

[0049] Figure 4 A flowchart of step S17 provided in an embodiment of this application;

[0050] Figure 5 A flowchart of step S3 provided in the embodiments of this application;

[0051] Figure 6 A flowchart of step S5 provided in an embodiment of this application;

[0052] Figure 7 A block diagram of a knowledge base retrieval enhanced dialog device provided for embodiments of this application;

[0053] Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0055] A task-oriented dialogue system is a technology designed to meet user needs and complete specific tasks, such as restaurant reservations, ticket purchases, and weather inquiries. The system generates responses using relevant information from an external knowledge base, user queries, and dialogue history. The system's main tasks include extracting user intent, slot filling, and combining this information with the knowledge base to generate accurate responses.

[0056] Task-oriented dialogue systems typically employ the following four main modules:

[0057] Semantic parsing: Transforming users' natural language input into structured information that computers can understand, and identifying users' intentions and related entities.

[0058] Dialogue state tracking: Records and updates the current state of the dialogue to ensure that the system can accurately understand the context and make appropriate responses during the dialogue.

[0059] Dialogue strategy learning: Determine the system's response strategy based on the current state of the dialogue, including selecting appropriate response strategies to guide the user to complete the task.

[0060] Response generation: Based on the selected strategy, structured semantic information is transformed into a natural and fluent language response.

[0061] In task-oriented dialogue systems, the role of external knowledge bases (KBs) is indispensable. They provide entity information relevant to user requests, such as restaurants, movies, and weather. When a system attempts to complete tasks like restaurant reservations or weather inquiries for a user, it typically needs to retrieve relevant entity information from the knowledge base and then combine this information to generate an effective system response. However, current generative models (such as T5 and ChatGPT) often struggle to distinguish subtle differences between retrieved entities when processing search results, leading to poor-quality generated responses.

[0062] To address the aforementioned technical problems, according to an embodiment of this application, a dialog method embodiment for knowledge base retrieval enhancement is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0063] This embodiment provides a dialog method for enhancing knowledge base retrieval. Figure 1 A flowchart of a knowledge base retrieval enhancement dialogue method provided for embodiments of this application is shown below. Figure 1 As shown, the process includes the following steps:

[0064] Step S1: In response to the user-input dialogue context, perform attribute selection and entity selection on entities in the external knowledge base to obtain the target entity set.

[0065] Specifically, by analyzing the user's input dialogue context and combining it with entities from an external knowledge base, the system intelligently selects attributes and entities, ultimately extracting a set of target entities relevant to the user's needs. This ensures accurate selection of the most relevant entities and attributes based on the context, thus providing precise knowledge support for subsequent task processing.

[0066] Step S3: Configure corresponding implicit knowledge tags for entities in the target entity set to obtain an implicit knowledge-enhanced entity set; wherein, the implicit knowledge tags represent tags that distinguish similar entities in the target entity set.

[0067] Specifically, each entity in the target entity set is assigned a corresponding implicit knowledge label. These labels are used to distinguish similar entities in the set. By assigning these implicit knowledge labels to entities, similar entities can be identified and distinguished during processing, thereby forming an implicit knowledge-enhanced entity set, providing a more accurate and targeted knowledge representation for further analysis and application.

[0068] Step S5: Configure the corresponding explicit knowledge text for the entities in the implicit knowledge augmentation entity set to obtain the explicit knowledge augmentation entity set; wherein, the explicit knowledge text represents the descriptive text of the entities in the implicit knowledge augmentation entity set.

[0069] Specifically, each entity in the implicit knowledge-enhanced entity set is configured with corresponding explicit knowledge text, which is descriptive text for the entity. By adding explicit knowledge text to the entities, implicit knowledge is transformed into a clear and understandable knowledge representation, thus forming an explicit knowledge-enhanced entity set. This process enhances the semantic understandability of the entities, providing more intuitive and accurate knowledge support for subsequent tasks.

[0070] Step S7: Based on explicit knowledge, enhance the entity set and dialogue context to generate the target response.

[0071] Specifically, the explicit knowledge-enhanced entity set and the dialogue context are input into the generator, which is a large language model such as chatgpt. The large language model generates an appropriate target response R based on this rich information. The large language model can comprehensively consider the dialogue context, entity information, and various knowledge-enhanced information to generate fluent, natural, accurate, and information-rich responses that meet the user's needs.

[0072] This embodiment provides a knowledge base retrieval-enhanced dialogue method that accurately selects relevant entities and their attributes from an external knowledge base based on the user-input dialogue context, forming a target entity set. Furthermore, by configuring implicit knowledge tags for entities, similar entities are effectively distinguished, enhancing the recognizability between entities. Next, by configuring descriptive text for the implicit knowledge-enhanced entity set, implicit knowledge is transformed into explicit knowledge, making the entity knowledge clearer and easier to understand. Finally, based on the explicit knowledge-enhanced entity set and the dialogue context, accurate and user-relevant target responses can be generated, thereby improving the overall interactive experience.

[0073] Figure 2 The flowchart for step S1 provided in the embodiments of this application may include the following steps:

[0074] Step S11: In response to the user-input dialogue context, determine the dialogue context dense vector corresponding to the dialogue context, and determine the attribute dense vector corresponding to the entity in the external knowledge base.

[0075] In one implementation, the external knowledge base includes multiple entities, each entity including multiple attribute value pairs; the attribute value pairs corresponding to the entities in the external knowledge base are encoded using an encoder to obtain an attribute-dense vector.

[0076] Specifically, using the context encoder Enc cThe dialogue context C is encoded. Dialogue context C contains the user's current request and previous dialogue history; this information is crucial for understanding the user's intent and generating an appropriate response. Context encoder Enc c Typically, a pre-trained language model (such as BERT, T5, etc.) is used to convert a text sequence into a fixed-length dense vector. This dense vector captures semantic information from the dialogue context, including the user's intent and mentioned key information. For example, if the user's dialogue context is "I want to find a reasonably priced Chinese restaurant on the east side of the city," then after passing through the context encoder Enc... c After encoding, a dense vector is obtained, which can represent the overall semantics of the sentence, including information such as the user wants to find a Chinese restaurant, its location is in the east of the city, and the appropriate price.

[0077] For each entity in the external knowledge base K, each entity contains multiple attribute value pairs E. i ={a 1 ,v 1 ,...,a N ,v N The attribute set of each entity is concatenated with its set of values ​​to form attribute-value pairs, and then the attribute encoder Enc is used. a Each attribute value pair is encoded to generate a dense attribute vector. For example, the attribute value pairs for a restaurant entity include "Location: East of the City", "Price: 100 yuan", and "Type: Chinese". These attribute value pairs are then input into the attribute encoder Enc. a In this process, a dense vector is obtained for each attribute value pair. These vectors can represent the semantic information of each attribute value pair.

[0078] Step S13: Based on the dialogue context dense vector and attribute dense vector, perform attribute selection on entities in the external knowledge base to obtain a first entity set containing the location entity attributes; wherein, the location entity attributes represent the attributes of entities directly located in the external knowledge base and the dialogue context.

[0079] Specifically, in the external knowledge base, attributes that directly locate entities within the dialogue context refer to the key attributes that can quickly filter out entities most relevant to the user's needs. For example, "location," "price," and "type" are entity-locating attributes because they directly reflect the user's needs. An attribute selection score is obtained by calculating the dot product of the dialogue context vector and the attribute density vector. This score reflects the similarity between the attribute and the dialogue context. If the score is higher than a preset threshold, it indicates that the attribute is highly relevant to the user's needs, and therefore the corresponding entity is retained. After attribute selection, the resulting entity set contains restaurants that match the user's needs in terms of key attributes. These entities are more likely to be of interest to the user because they are highly relevant to the user's request in key attributes such as "location," "price," and "type."

[0080] Step S15: Determine the dense vector of the entity corresponding to the entity in the first entity set.

[0081] Specifically, the first set of entities retained after attribute selection. These entities are highly relevant to user needs in terms of key attributes. The selected attribute value pairs in each entity are linearized into a sequence. Linearization refers to concatenating multiple attribute value pairs into a continuous text sequence. This is done using the entity encoder Enc. e The linearized attribute values ​​are encoded into the sequence to generate dense entity vectors. (Entity encoder Enc) e Typically, it is a pre-trained language model (such as BERT, T5, etc.) that can convert a text sequence into a dense vector of fixed length.

[0082] Step S17: Based on the entity dense vector and the dialogue context dense vector, perform entity selection on the entities in the first entity set to obtain the second entity set.

[0083] Specifically, the dot product between the dialogue context dense vector and the dense vector of each entity is calculated to obtain the entity selection score. The entities are then sorted from highest to lowest based on their calculated selection scores. The sorted entity selection scores reflect the similarity between each entity and the user's request. Finally, the top K entities are selected to obtain the final second entity set. These entities, after comprehensively considering all attributes, are most relevant to the user's needs and can provide the user with the options that best meet their requirements.

[0084] Step S19: Configure non-location entity attributes in the second entity set to obtain the target entity set; wherein, non-location entity attributes represent attributes of entities that are not directly located in the external knowledge base and the dialogue context.

[0085] Specifically, after attribute and entity selection, non-location attribute information is added to each selected entity. This results in an entity that contains both key location-specific attributes and non-location-specific attributes providing detailed information, providing more comprehensive entity content for subsequent response generation. Non-location-specific attribute information for each entity can be obtained from an external knowledge base. These attributes typically include phone numbers, detailed addresses, business hours, and signature dishes. For example, non-location-specific attribute information can be appended to the selected entities; that is, the entity's non-location-specific attributes (phone number, detailed address, business hours, signature dishes) are directly appended to the entity's suffix to generate the target entity.

[0086] It's important to note that when building an external knowledge base, experts familiar with the domain pre-define which attributes are used to locate entities and which are non-locating attributes based on entity characteristics and user query habits. For example, in the restaurant domain, experts might, based on years of industry experience and common user queries about restaurants, determine that attributes such as "location," "price range," and "cuisine type" are used to help users quickly locate restaurant entities that meet specific criteria, and therefore classify them as locating attributes. Attributes such as "phone number," "detailed address," and "opening hours" are classified as non-locating attributes, because these attributes are primarily used to obtain detailed information about a specific restaurant after the user has already decided to learn about it.

[0087] Analyzing large amounts of user query and behavioral data can also help determine location-specific and non-location-specific attributes. For example, by analyzing the most frequently used filters when users search for restaurants, and finding that users often filter restaurants based on criteria such as "location," "price," and "ratings," these attributes can be classified as location-specific attributes. On the other hand, attributes that users only view after deciding on a restaurant, such as "restaurant interior design" and "pictures of signature dishes," can be classified as non-location-specific attributes.

[0088] This embodiment responds to the user's input dialogue context by calculating the dense vector of the context and the dense vector of entity attributes in an external knowledge base, providing foundational data for the subsequent entity selection process. Next, based on the dialogue context dense vector and the entity attribute dense vector, attribute selection is performed on entities in the external knowledge base, resulting in a first entity set containing attributes of entities directly located within the dialogue context. Furthermore, the entity dense vector for each entity in the first entity set is calculated, and entity selection is performed based on these entity dense vectors and the dialogue context dense vector, resulting in a second entity set. Finally, according to the relationship between the dialogue context and the attributes of non-located entities, the attributes of non-located entities in the second entity set are configured, thus obtaining the final target entity set. This embodiment can accurately filter out entities that match the intent of the dialogue context, effectively reducing interference from irrelevant entities and improving the accuracy of semantic understanding and personalized response capabilities.

[0089] Figure 3 The flowchart for step S13 provided in the embodiments of this application may include the following steps:

[0090] Step S131: Determine the dot product between the dialogue context dense vector and the attribute dense vector to obtain the attribute selection score.

[0091] Specifically, the dot product is calculated between the dialogue context dense vector and the attribute dense vector for each attribute value pair. The dot product is a commonly used method for calculating vector similarity, measuring the degree of similarity between two vectors in a direction. The result of the dot product is a scalar value; the larger the value, the more similar the two vectors are. Attribute selection score. for:

[0092]

[0093] Among them, Enc c (C) is the dialogue context dense vector, Enc a (a i ) is the dense vector of attributes corresponding to the i-th attribute value pair.

[0094] The primary purpose of attribute selection scoring is to filter out the attributes from a large pool of attributes that are most relevant to the current dialogue context and most likely to help locate the entity the user needs. Here, "locating" does not mean directly locating a specific entity, but rather locating attributes with key characteristics that can guide more accurately in subsequent steps to find the relevant entity.

[0095] Step S133: If the attribute selection score is greater than the preset threshold, retain the entities corresponding to the dense attribute vector to obtain the first entity set containing the location entity attributes.

[0096] Specifically, when the attribute selection score exceeds a preset threshold, the entities corresponding to the dense vector of that attribute are retained. Here, "entity" actually refers to the set of entities that possess that attribute. This step does not directly determine the final entity result, but rather identifies which attributes are important, and then filters out the range that may contain the entities the user needs based on these important attributes. In other words, this is a process of indirectly locating entities through attributes. Therefore, the filtered attributes mainly locate entity attribute A. u By retaining the entities corresponding to these attributes, we are actually narrowing the search scope and focusing on the set of entities that are most likely to meet the user's needs.

[0097] This embodiment calculates the dot product between the dense vector of the dialogue context and the dense vector of attributes to obtain an attribute selection score, which quantifies the matching degree between the dialogue context and entity attributes. When the attribute selection score exceeds a preset threshold, entities highly relevant to the context are retained, thus forming a first entity set containing the attributes of the located entities. This embodiment can accurately filter out entities related to the dialogue content according to the specific needs of the dialogue context, improving the accuracy and efficiency of entity filtering.

[0098] Figure 4 The flowchart for step S17 provided in the embodiments of this application may include the following steps:

[0099] Step S171: Determine the dot product between the entity dense vector and the dialogue context dense vector to obtain the entity selection score.

[0100] Specifically, the dot product is calculated between the dialogue context dense vector and the entity dense vector corresponding to each entity. The dot product is a commonly used method for calculating vector similarity, measuring the degree of similarity between two vectors in a direction. The result of the dot product is a scalar value; the larger the value, the more similar the two vectors are. Entity selection score. for:

[0101]

[0102] Among them, Enc c (C) is the dialogue context dense vector, Enc e (e i ) is the entity dense vector corresponding to the i-th entity.

[0103] Step S173: Sort the entities from highest to lowest score, and obtain the second entity set based on the sorting result.

[0104] Specifically, select scores based on entities. Sort the entities from highest to lowest. Select the top K entities to obtain the final second set of entities. These entities are considered to be the candidate entities that best meet the user's needs. The value of K can be determined through model settings or experiments, and is usually a suitable range to ensure that it covers a sufficient number of candidate entities while avoiding the complexity of subsequent processing due to too many candidate entities.

[0105] This embodiment measures the similarity between entities and the dialogue by calculating the dot product between the dense vector of the dialogue context and the dense vector of entities, thereby improving the accuracy of entity selection. Dot product calculation is efficient, enabling rapid processing and improving response speed. Furthermore, this process enhances the system's ability to understand implicit information, contributing to the optimization of dialogue quality. Entities are sorted according to their selection scores, forming a second entity set. By filtering and sorting, redundant entities are reduced, improving response efficiency and accuracy.

[0106] Figure 5 The flowchart for step S3 provided in this application embodiment shows that the implicit knowledge tags include text tags, confidence tags, and co-occurrence information tags; the process may include the following steps:

[0107] Step S31: Based on the entity selection score, determine the sorting information of the entities in the first entity set as text labels.

[0108] Specifically, the ranking information obtained by sorting entities by their selection scores from highest to lowest is converted into text labels and added to the corresponding entities. For example, the entity with the highest selection score is labeled "Ranked First," the second highest is labeled "Ranked Second," and so on. Adding the ranking information as text labels to the entities allows the generator to directly utilize this information when generating the response without needing to perform a re-sorting check, reducing the computational burden on the generator and improving generation efficiency and quality.

[0109] Furthermore, when multiple entities share similar attributes and information, text labels can help the generator distinguish their relative importance, thereby enabling more accurate selection and description of entities. For example, when recommending hotels, if multiple hotels are located in the city center and have similar prices, text labels can help the generator determine which hotel is more favored by the model after considering various factors, and thus more likely to meet the user's needs.

[0110] Step S33: Based on the entity selection score, classify the confidence level of entities in the first entity set, and determine the classification result as the confidence level label.

[0111] Specifically, entity confidence is categorized into low, medium, and high levels based on the entity selection score, providing the generator with an assessment of the accuracy and reliability of entity information. For example, an entity selection score less than 0.25 indicates low confidence, a score greater than 0.25 and less than 0.75 indicates medium confidence, and a score greater than 0.75 indicates high confidence. Adding confidence labels to entity representations allows the generator to determine the degree of reference and representation of entity information based on its confidence level when generating responses. For instance, if an entity has a low confidence level, the generator can appropriately reduce its reliance on that entity or add suggestive or guiding statements to the response, letting the user know that this is a relatively uncertain recommendation, thereby improving the overall quality and credibility of the response.

[0112] Step S35: Determine the co-occurrence of entities in the first entity set in the dialogue context, and identify the co-occurrence as co-occurrence information tags.

[0113] Specifically, the co-occurrence of entities in the dialogue context is analyzed, categorized into three cases: co-occurred in the most recent dialogue, co-occurred previously, and never co-occurred. These co-occurrence cases are then transformed into co-occurrence information tags, such as "co-occurred in the most recent dialogue," "co-occurred previously," and "never co-occurred," and added to the entity representation. This allows the generator to consider the relationships between entities and the coherence of the dialogue when generating responses, resulting in more natural and reasonable replies.

[0114] Step S37: Configure corresponding text labels, confidence labels and co-occurrence information labels for the entities in the second entity set to obtain the implicit knowledge-enhanced entity set.

[0115] Specifically, the text labels, confidence labels, and co-occurrence information labels corresponding to the entities in the second entity set can be directly concatenated into the entities to obtain an implicit knowledge-enhanced entity set. These labels provide the generator with more contextual information.

[0116] This embodiment sorts entities in the first entity set according to priority based on entity selection scores, and uses this sorting result as text labels to provide a valid reference for subsequent entity selection. Next, the confidence level of entities in the first entity set is graded using the entity selection scores, and entities are classified according to their confidence level. This grading result is used as confidence labels to provide data support for further entity filtering and optimization. Then, the co-occurrence of entities in the first entity set in the dialogue context is analyzed. Through this co-occurrence analysis, co-occurrence information labels are generated. This information helps capture semantic relationships between entities, improving the coherence and accuracy of the dialogue. Finally, these labels are configured onto entities in the second entity set, resulting in an implicit knowledge-enhanced entity set. This embodiment, through precise label configuration, further improves the semantic understanding and interactive response quality of entities, achieving deep integration and intelligent enhancement of dialogue context and external knowledge base.

[0117] Figure 6 The flowchart for step S5 provided in the embodiments of this application may include the following steps:

[0118] Step S51: Use the large language model to parse the attribute value pairs corresponding to the entities in the implicit knowledge augmented entity set to obtain the corresponding descriptive text.

[0119] Specifically, a large language model is used to parse the attribute values ​​corresponding to entities in the implicit knowledge-enhanced entity set, generating more accurate descriptive text and obtaining the corresponding descriptive text.

[0120] Step S53: Configure the corresponding descriptive text for the entities in the implicit knowledge-enhanced entity set to obtain the explicit knowledge-enhanced entity set.

[0121] Specifically, the generated descriptive text is added to entities in the implicit knowledge-enhanced entity set to generate an explicit knowledge-enhanced entity set. Each entity comes with descriptive text, which provides the generator with richer and more accurate entity information, enabling more targeted and informative responses. For example, "2-star" is resolved as "moderate price, basic service, standard décor," and "4-star" is resolved as "expensive price, high-quality service, luxurious décor." In this way, it is possible to dynamically distinguish attribute value pairs that appear similar from a textual perspective but actually have different meanings, providing the generator with richer and more accurate entity information for more targeted and informative responses.

[0122] This embodiment utilizes a large language model to parse entities and their attribute value pairs in an implicit knowledge-enhanced entity set. This enables a deep understanding of the relationships between entities and their attributes, generating corresponding descriptive text. This process transforms implicit knowledge information into explicit textual descriptions, providing valuable information for subsequent processing. Next, these descriptive texts are configured onto the entities, thereby generating an explicit knowledge-enhanced entity set, transforming latent knowledge into a directly applicable explicit knowledge form. In this way, the knowledge of entities is clearly identified and can be closely integrated with practical application tasks, improving semantic understanding and intelligent response capabilities.

[0123] Accordingly, please refer to Figure 7 A block diagram of a knowledge base retrieval-enhanced dialog device provided in this application embodiment, the device comprising:

[0124] The attribute and entity selection unit 101 is used to select attributes and entities from an external knowledge base in response to the user's input dialogue context, and obtain a target entity set.

[0125] An implicit tagging unit 103 is configured to configure corresponding implicit knowledge tags for entities in the target entity set, thereby obtaining an implicit knowledge-enhanced entity set; wherein, the implicit knowledge tags represent tags that distinguish similar entities in the target entity set;

[0126] An explicit text unit 105 is configured to configure corresponding explicit knowledge text for entities in the implicit knowledge-enhanced entity set, thereby obtaining an explicit knowledge-enhanced entity set; wherein, the explicit knowledge text represents the descriptive text of the entities in the implicit knowledge-enhanced entity set;

[0127] The target response generation unit 107 is used to generate a target response based on the explicit knowledge-enhanced entity set and the dialogue context.

[0128] In some optional implementations, the attribute and entity selection unit 101 includes:

[0129] In response to the user's input dialogue context, determine the dialogue context dense vector corresponding to the dialogue context, and determine the attribute dense vector corresponding to the entity in the external knowledge base;

[0130] Based on the dialogue context dense vector and attribute dense vector, attribute selection is performed on entities in the external knowledge base to obtain a first entity set containing the attributes of the located entities; wherein, the attributes of the located entities represent the attributes of entities directly located in the external knowledge base in the dialogue context.

[0131] Determine the dense vector of the entities corresponding to the entities in the first entity set;

[0132] Based on the entity dense vector and the dialogue context dense vector, entity selection is performed on the entities in the first entity set to obtain the second entity set;

[0133] Configure non-location entity attributes in the second entity set to obtain the target entity set; where non-location entity attributes represent attributes of entities that are not directly located in the external knowledge base and the dialogue context.

[0134] In some optional implementations, the external knowledge base includes multiple entities, each entity including multiple attribute value pairs; determining the attribute-dense vector corresponding to the entities in the external knowledge base includes:

[0135] An encoder is used to encode the attribute value pairs corresponding to entities in an external knowledge base, resulting in an attribute-dense vector.

[0136] In some optional implementations, based on the dialogue context dense vector and attribute dense vector, attribute selection is performed on entities in an external knowledge base to obtain a first entity set containing the attributes of the located entities, including:

[0137] The attribute selection score is obtained by determining the dot product between the dialogue context dense vector and the attribute dense vector;

[0138] If the attribute selection score is greater than a preset threshold, the entities corresponding to the dense attribute vectors are retained to obtain the first entity set containing the location entity attributes.

[0139] In some optional implementations, entity selection is performed on entities in the first entity set based on entity dense vectors and dialogue context dense vectors to obtain a second entity set, including:

[0140] The entity selection score is obtained by determining the dot product between the entity dense vector and the dialogue context dense vector.

[0141] Sort the entities by their scores from highest to lowest, and obtain the second set of entities based on the sorting results.

[0142] In some optional implementations, implicit knowledge tags include text tags, confidence tags, and co-occurrence information tags; the implicit tag configuration unit 103 includes:

[0143] Based on the entity selection score, the ranking information of the entities in the first entity set is determined as text labels;

[0144] Based on the entity selection score, the confidence level of the entities in the first entity set is classified, and the classification result is determined as the confidence level label.

[0145] Determine the co-occurrence of entities in the first entity set within the dialogue context, and assign co-occurrence information labels to these entities. Then, assign corresponding text labels, confidence labels, and co-occurrence information labels to the entities in the second entity set to obtain the implicit knowledge-enhanced entity set.

[0146] In some alternative implementations, configuring the explicit text unit 105 includes:

[0147] The large language model is used to parse the attribute value pairs corresponding to entities in the implicit knowledge-enhanced entity set to obtain the corresponding descriptive text;

[0148] By configuring descriptive text corresponding to entities in the implicit knowledge-enhanced entity set, an explicit knowledge-enhanced entity set is obtained.

[0149] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0150] In this embodiment, a knowledge base retrieval enhanced dialog device is presented in the form of functional units. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0151] Please see Figure 8 , Figure 8 This application provides a schematic diagram of the structure of a computer device, as shown in the embodiment of the present application. Figure 8 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 8 Take a processor 10 as an example.

[0152] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0153] The memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.

[0154] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0155] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0156] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.

[0157] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the methods shown in the above embodiments are implemented.

[0158] The methods, apparatus, or units described in the above embodiments can be implemented by a computer chip or entity, or by a product with a certain function. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0159] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0160] Those skilled in the art will understand that embodiments of this application can be provided as methods or apparatus. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0161] This application is described with reference to flowchart illustrations and / or block diagrams of methods and apparatus according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0162] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0163] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0164] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0165] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0166] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

[0167] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A dialogic method for enhancing knowledge base retrieval, characterized in that, The method includes: In response to the dialogue context input by the user, a dialogue context dense vector corresponding to the dialogue context is determined, and an attribute dense vector corresponding to the entity in the external knowledge base is determined. Based on the dialogue context dense vector and the attribute dense vector, attribute selection is performed on entities in the external knowledge base to obtain a first entity set containing the location entity attributes; wherein, the location entity attributes represent the attributes of entities directly located in the external knowledge base with the dialogue context. Determine the entity density vector corresponding to the entity in the first entity set; The entity selection score is obtained by determining the dot product between the entity dense vector and the dialogue context dense vector. The entities are selected and sorted from high to low scores, and a second set of entities is obtained based on the sorting results. Configure non-location entity attributes in the second entity set to obtain the target entity set; wherein, the non-location entity attributes represent attributes of entities that are not directly located in the external knowledge base and the dialogue context; The implicit knowledge labels are configured for entities in the target entity set to obtain an implicit knowledge-enhanced entity set. The implicit knowledge labels represent tags that distinguish similar entities in the target entity set. The implicit knowledge labels include text labels, confidence labels, and co-occurrence information labels. The process of configuring the implicit knowledge labels for entities in the target entity set to obtain the implicit knowledge-enhanced entity set includes: determining the ranking information of entities in the first entity set as the text labels based on the entity selection score; classifying the confidence of entities in the first entity set based on the entity selection score and determining the classification result as the confidence label; determining the co-occurrence of entities in the first entity set in the dialogue context and determining the co-occurrence as the co-occurrence information label; and configuring the corresponding text labels, confidence labels, and co-occurrence information labels for entities in the second entity set to obtain the implicit knowledge-enhanced entity set. By configuring corresponding explicit knowledge text for entities in the implicit knowledge-enhanced entity set, an explicit knowledge-enhanced entity set is obtained; wherein, the explicit knowledge text represents the descriptive text of the entities in the implicit knowledge-enhanced entity set; Based on the explicit knowledge-enhanced entity set and the dialogue context, a target response is generated.

2. The method according to claim 1, characterized in that, The external knowledge base includes multiple entities, and each entity includes multiple attribute value pairs; determining the attribute-dense vector corresponding to the entity in the external knowledge base includes: The attribute value pairs corresponding to entities in the external knowledge base are encoded using an encoder to obtain the attribute dense vector.

3. The method according to claim 1, characterized in that, The step of selecting attributes for entities in the external knowledge base based on the dialogue context dense vector and the attribute dense vector to obtain a first entity set containing the attributes of the located entities includes: The attribute selection score is obtained by determining the dot product between the dialogue context dense vector and the attribute dense vector; If the attribute selection score is greater than a preset threshold, the entity corresponding to the dense vector of the attribute is retained to obtain a first entity set containing the location entity attribute.

4. The method according to claim 1, characterized in that, The step of configuring the corresponding explicit knowledge text for entities in the implicit knowledge-enhanced entity set yields an explicit knowledge-enhanced entity set, including: The attribute value pairs corresponding to the entities in the implicit knowledge-enhanced entity set are parsed using a large language model to obtain the corresponding descriptive text; The descriptive text corresponding to the entities in the implicit knowledge-enhanced entity set is configured to obtain the explicit knowledge-enhanced entity set.

5. An apparatus for implementing the knowledge base retrieval enhancement dialogue method according to any one of claims 1-4, characterized in that, The device includes: The attribute and entity selection unit is used to select attributes and entities from an external knowledge base in response to the user's input dialogue context, and obtain a target entity set. An implicit tagging unit is configured to configure corresponding implicit knowledge tags for entities in the target entity set, thereby obtaining an implicit knowledge-enhanced entity set; wherein, the implicit knowledge tags represent tags that distinguish similar entities in the target entity set; Configuring explicit text units for configuring corresponding explicit knowledge text for entities in the implicit knowledge-enhanced entity set, thereby obtaining an explicit knowledge-enhanced entity set; wherein, the explicit knowledge text represents the descriptive text of the entities in the implicit knowledge-enhanced entity set; The target response generation unit is used to generate a target response based on the explicit knowledge-enhanced entity set and the dialogue context.

6. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the knowledge base retrieval enhanced dialogue method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the knowledge base retrieval enhanced dialogue method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method for associating entities in text to knowledge base by using context

    CN115994199A

  • Visual question and answer processing method and system, storage medium and electronic equipment

    CN116401390A