Apparatus and method for selecting reply entity of knowledge base
By encoding and subgraph selection of queries, combined with machine learning models, the response entity selection problem on sparse and incomplete knowledge graphs is solved, and fast and scalable response entity selection is achieved, suitable for search applications in the industrial field.
Patent Information
- Application Number
- CN202280096235.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-19
- Publication Date
- 2024-12-27
AI Technical Summary
The prior art is difficult to effectively select response entities on sparse and incomplete knowledge graphs, and relies on low-quality static or high-delay subgraph selection, making it difficult to use in industry applications.
By encoding the query using text encoder and key attribute value encoder, selecting subgraphs of the knowledge graph, combining the encoded entity and attribute value, the selection of response entities is realized, and a machine learning model such as neural network is used for prediction, ensuring low Delay and multi-reply return.
Fast and scalable answer entity selection on incomplete and sparse knowledge graphs, solving the problems of graph incompleteness and high latency, able to return multiple responses and handle geolocation encoding, suitable for search applications in the industrial field .
Smart Images

Figure CN119213423A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to information processing technology. More specifically, the present invention relates to a device and method for selecting one or more answer entities from a plurality of entities of a knowledge base implemented as a knowledge graph to respond to a query. Background Art
[0002] Search systems are at the heart of any solution to the information seeking problem. Such systems take natural language as input and strive to satisfy the user's information needs by returning a set of relevant answers. Answer retrieval is popular in open domain Question Answering (QA) applications. This is especially true in the context of Knowledge Base Question Answering (KBQA) systems, which answer natural language questions by extracting answers from a knowledge base. However, prior art methods assume a high-quality data source and are therefore prone to errors on sparse and incomplete knowledge graphs. In addition, prior art methods rely on low-quality static subgraph selection or high-latency subgraph selection, making them difficult to use in industry applications. Summary of the invention
[0003] The object is to provide an improved apparatus and method for selecting a response entity of a knowledge base.
[0004] The above and other objects are achieved by the subject matter claimed in the independent claims. Other implementations are apparent from the dependent claims, the description and the drawings.
[0005] According to a first aspect, a device is provided, the device being used to: select one or more answer entities from a plurality of entities of a knowledge base implemented as a potentially incomplete and sparse knowledge graph based on a knowledgebase question answering (KBQA) framework to respond to a user query, wherein each entity of the knowledge graph is associated with a corresponding key attribute value. The device comprises a processing circuit, the processing circuit being used to: encode the query using a text encoder to obtain an encoded query text, and encode the query key attribute value associated with the query using a key attribute value encoder to obtain the encoded query key attribute value. The processing circuit is also used to: select a subgraph of the knowledge graph based on the encoded query text, wherein the subgraph includes one or more candidate answer entities. The processing circuit is also used to: encode each of the one or more candidate answer entities into an encoded candidate answer entity, and encode the key attribute value of each of the one or more candidate answer entities into an encoded key attribute value. The processing circuit is further configured to select the one or more answering entities from the selected subgraph based on the one or more encoded candidate answering entities, the encoded query text, the encoded query key attribute value, and the one or more encoded key attribute values.
[0006] In another possible implementation, the processing circuit is used to: select the one or more response entities from the selected subgraph by determining whether the corresponding candidate response entity is one of the one or more response entities for each of the one or more candidate response entities based on the corresponding encoded candidate response entity, the encoded query text, the encoded query key attribute value and the one or more encoded key attribute values.
[0007] In another possible implementation, the processing circuit is used to select the subgraph of the knowledge graph by predicting the maximum distance metric value between the one or more candidate response entities and a reference key attribute value based on the encoded query text and the distance metric, wherein the subgraph includes the one or more candidate response entities, and the distance metric is used to determine the corresponding distance metric values between the key attribute values of corresponding pairs of one or more entities.
[0008] In another possible implementation, the processing circuit is used to: further select the subgraph of the knowledge graph by predicting a corresponding type for each of the one or more candidate response entities based on the encoded query text, wherein the subgraph includes the one or more candidate response entities.
[0009] In another possible implementation, the key attribute value of each entity includes the geographic location of the entity. The processing circuit is used to select the subgraph of the knowledge graph by predicting the maximum spatial distance between the one or more candidate answer entities and a reference geographic location based on the encoded query text, wherein the subgraph includes the one or more candidate answer entities.
[0010] In another possible implementation manner, the processing circuit is configured to determine the reference geographic location based on a query text.
[0011] In another possible implementation, the processing circuit is used to: implement a machine learning model, in particular one or more neural networks, to select the one or more response entities.
[0012] In another possible implementation manner, the encoded query text includes a query text feature vector and / or the encoded query key attribute includes a query key attribute feature vector.
[0013] In another possible implementation, the device includes a cloud server.
[0014] In another possible implementation manner, the apparatus further includes a communication interface, where the communication interface is configured to receive the query from the user equipment and return the one or more response entities to the user equipment.
[0015] According to a second aspect, a method is provided for: selecting one or more answering entities from a plurality of entities of a knowledge base implemented as a potentially incomplete and sparse knowledge graph to respond to a user query based on a knowledgebase question answering (KBQA) framework, wherein each entity of the knowledge graph is associated with a corresponding key attribute value (especially a geographic location of the corresponding entity). The method comprises the following steps:
[0016] Encode the query using a text encoder to obtain an encoded query text, and encode the query key attribute value associated with the query using a key attribute value encoder to obtain an encoded query key attribute value;
[0017] Selecting a subgraph of the knowledge graph based on the encoded query text, wherein the subgraph includes one or more candidate answer entities;
[0018] Based on the one or more encoded candidate response entities, the encoded query text, the encoded query key attribute value and the one or more encoded key attribute values, the one or more response entities are selected from the selected subgraph including the one or more candidate response entities.
[0019] The method according to the second aspect of the present invention can be performed by the device according to the first aspect of the present invention. Therefore, other features of the method according to the second aspect of the present invention are directly implemented by the functions of the device according to the first aspect of the present invention and the above and below different implementation methods.
[0020] According to a third aspect, a computer program product is provided, comprising a computer-readable storage medium for storing program code, which, when executed by a computer or a processor, causes the computer or the processor to perform the method according to the second aspect.
[0021] The following drawings and descriptions set forth one or more embodiments in detail. Other features, objects, and advantages are apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the accompanying drawings:
[0023] Figure 1 A schematic diagram of an apparatus provided by an embodiment is shown, the apparatus being used to select one or more answering entities from a plurality of entities in a knowledge base;
[0024] Figure 2 A schematic diagram showing the main paradigm of an exemplary search method;
[0025] Figure 3a A schematic diagram showing a flow of processing steps implemented by a device provided by an embodiment;
[0026] Figure 3b A schematic diagram showing a more detailed flow of processing steps implemented by a device provided by an embodiment;
[0027] Figure 4 A schematic diagram showing a system architecture of an apparatus 100 provided in an embodiment;
[0028] Figure 5 A flowchart of a method for operating a device provided by an embodiment is shown.
[0029] In the following, identical reference signs refer to identical or at least functionally equivalent features. DETAILED DESCRIPTION
[0030] In the following description, reference is made to the accompanying drawings that form a part of the present invention, which illustrate specific aspects of embodiments of the present invention or specific aspects in which embodiments of the present invention may be used by way of illustration. It should be understood that embodiments of the present invention may be used in other aspects and include structural or logical changes that are not depicted in the accompanying drawings. Therefore, the following detailed description should not be understood in a restrictive sense, and the scope of the present invention is defined by the appended claims.
[0031] For example, it should be understood that the disclosure related to the described method is also applicable to the corresponding device or system for performing the method, and vice versa. For example, if one or more specific method steps are described, the corresponding device may include one or more units, such as functional units, to perform the one or more method steps described (e.g., one unit performs one or more steps, or multiple units perform one or more of the multiple steps respectively), even if the one or more units are not explicitly described or shown in the drawings. On the other hand, for example, if a specific device is described based on one or more units, such as functional units, the corresponding method may include a step to perform the function of one or more units (e.g., one step performs the function of one or more units, or multiple steps perform the function of one or more of the multiple units respectively), even if the one or more units are not explicitly described or shown in the drawings. In addition, it should be understood that unless otherwise explicitly stated, the features of the various exemplary embodiments and / or aspects described herein may be combined with each other.
[0032] Figure 1 FIG. 1 is a schematic diagram of an apparatus 100 provided in an embodiment, wherein the apparatus 100 is used to select one or more answering entities from a plurality of entities in a knowledge base. In one embodiment, the apparatus 100 may be implemented as a cloud server 100. Figure 1 As shown, the device 100 includes a processing circuit 101 and a communication interface 103. The processing circuit 101 can be implemented in hardware and / or software, and can include a digital circuit, or both analog and digital circuits. The digital circuit can include components such as an application-specific integrated circuit (ASIC), a field-programmable array (FPGA), a digital signal processor (DSP), or a general-purpose processor. The device 100 may also include a memory 105, which is used to store executable program code. When the executable program code is executed by the processing circuit 101, the device 100 performs the functions and methods described herein.
[0033] The user 110 can access the apparatus 100 via the communication network 120 using a user device 111a, 111b (particularly a user mobile phone 111a or any other computing device 111b). The apparatus 100 may include a cloud server 100 and implement a search platform or a search mobile application. The natural language query typed by the user 110 is received by the apparatus 100, which performs a response search process and returns a result list to the user device 111a, 111b.
[0034] Before describing different embodiments of the apparatus 100 in detail, some technical background and terms related to the search system are introduced below using one or more of the following abbreviations:
[0035] GPU graphics processor;
[0036] KB knowledge base, a technology for storing structured and unstructured information;
[0037] KBQA: Knowledge Base Question Answering, which is a task to answer user questions by searching for answers in the knowledge graph;
[0038] KG knowledge graph, a knowledge base conceptualized as a graph and possibly stored as a graph;
[0039] POI Point of Interest, a specific point location that someone may find useful or interesting. POI is a structural element of the result set of a geographic search system, where all entities are POIs;
[0040] QA question answering is the problem of providing answers to user questions expressed in natural language.
[0041] Search systems are at the heart of any solution to the information seeking problem. Such systems take natural language as input and strive to satisfy the user's information needs by returning a set of relevant answers. Depending on the context and the type of application, the answers can be documents (document search, such as in cloud storage interfaces), web pages (generic search, such as in web search engines), product lists (product search, such as in shopping platforms), or POIs (geographic search, such as in interactive map applications).
[0042] Geo-search is a very popular search application, as indicated by the recent increase in the number of smartphones and online applications (examples include Google Maps, Bing Maps, Baidu Maps, and Huaban Maps). In addition, the adoption of travel technologies such as driverless cars and travel smart assistants is expected to play a major role in further increasing the demand for location-based services.
[0043] Figure 2The main paradigms of exemplary search methods 11, 13, 15 and 17 are schematically shown. The general problem of search has been extensively studied in both academia and industry. Broadly speaking, search schemes can be viewed as belonging to one of the following paradigms:
[0044] (i) Information retrieval11, where the core of related methods is the inverted index; data points are indexed in the inverted index, and after initial text analysis (which may include tokenization, stemming, and other preprocessing steps), user queries are split into terms that are looked up in the inverted index.
[0045] (ii) Intent detection and slot filling 13 is performed by a natural language understanding module that attempts to classify the user query within a predefined set of intents and subsequently customizes the templated intents to meet the user needs by filling in the specified slot values. The intents and their slot values are in turn used to construct formal queries to an inverted index, query engine, or database.
[0046] (iii) Semantic parsing15 is a more formal approach to natural language understanding: a semantic parser creates a machine-executable representation of the user query, which in turn is executed on a query engine.
[0047] (iv) Answer retrieval 17 is an alternative to the aforementioned methods 11, 13, and 15, seeking to solve the problem without relying on a detailed query of the query engine; alternatively, the answer retrieval method first obtains a set of candidate answers and then selects from the set the answer that best meets the original requirements of the user's query.
[0048] like Figure 2 As shown, in the first three methods 11, 13, 15, the goal is to generate a search query that satisfies the user's information needs, while answer retrieval 17 attempts to directly generate an answer list.
[0049] All paradigms have advantages and disadvantages, which may make the implementation attractive for use in industrial systems, depending on the maturity of the corresponding technology. Specifically, the information retrieval paradigm11 has been prevalent in search engines for a long time and still plays a core role in search engines today. However, with the maturity of natural language processing technology, users are keen to use natural language to express their information needs, moving away from the paradigm of pure keyword-based search.
[0050] The paradigm that relies on creating search queries (i.e., information retrieval11, intent detection and slot filling13, and semantic parsing15 performed as the final step to retrieve relevant results) must handle the queries and the logic of the query engine. Such queries are quite complex, and generating such queries is a costly and therefore inefficient process. Such queries are also often difficult to debug, since even a small change to the desired output query or the underlying database schema requires a series of complex updates to many related components, making the corresponding systems more difficult to maintain. In addition, since tuples of the form "question_in_natural_language, machine_executable_query" must be obtained, the cost of obtaining training data for such systems is high. In the case of intent detection and slot filling13, extensive annotations (i.e., golden data about intent and slot values) are also required as training data.
[0051] In contrast, the answer retrieval paradigm17 does not require the creation of such complex, last-stage queries and can be a more efficient option: since the system can be trained using only click data available from query and click logs, complex query engineering is not required and training data is more readily available. In addition, the answer retrieval approach includes an answer selection process that evaluates candidate answers one by one, taking into account individual answer information, such as specific properties and attribute values. Other approaches require a post-processing (sorting or filtering) step to accomplish the same operation, which costs system runtime.
[0052] Answer retrieval17 is popular in open-domain Question Answering (QA) applications. This is especially true in the context of Knowledge Base Question Answering (KBQA) systems, which answer natural language questions by extracting answers from a knowledge base. While community-maintained benchmarks often use densely connected subgraphs of popular knowledge bases (e.g., Wikidata), in the industrial domain, knowledge graphs are often incomplete and sparse. This has implications for porting methods to industrial products.
[0053] Interestingly, answer retrieval paradigm 17 is not widely used in search applications. One important reason is that answer retrieval paradigm 17 has a series of technical characteristics that make it difficult to implement in scalable industrial systems. As detailed in the embodiments below, device 100 includes features that make answer retrieval 17 fast and scalable, thereby enabling answer retrieval 17 to be deployed in geographic search products. Although device 100 is described below based on a POI search environment, device 100 can be easily adjusted to meet the needs of other search scenarios (e.g., advertising or product searches).
[0054] The challenges associated with prior art search methods can be summarized as follows:
[0055] (i) Graph incompleteness problem. Graph incompleteness refers to the fact that the underlying knowledge graph (KG) is often incomplete. In the case of a KG with geographic information (or a product KG, respectively), one may face the problem of missing facts (entities are not connected), missing attributes (e.g., addresses or product materials are missing), or the presence of partial values (e.g., having a partial address or a partial list of supported operating systems instead of a complete address or a complete list of compatible operating systems). Since many QA methods are based on the existence of relations and the information these relations carry, graph incompleteness plays an important role in the applicability of the answer retrieval paradigm17 to the search system.
[0056] (ii) The challenge of returning only one answer. While supporting multiple answers is not an important requirement for open domain (QA), the requirement of providing multiple results to users is crucial for search applications. For domains involving exploratory search scenarios (e.g., POI or product search), this difference makes it more difficult for open domain (QA) methods to extend to product service requirements.
[0057] (iii) The high latency challenge. Methods with a relaxed candidate selection process are very slow to deploy because subsequent steps (after candidate selection) have to look through the full candidate list, which for some queries may consist of thousands of entries.
[0058] (iv) The challenge of lack of geolocation encoding is a special requirement of geographic search systems, which is usually not taken into account by QA methods.
[0059] As described in the following embodiments, the apparatus 100 solves the above-mentioned difficulties associated with the prior art that make question answering undeployable in prior art search methods.
[0060] Figure 3a A schematic diagram of a process flow of processing steps implemented by the apparatus 100 provided by an embodiment is shown. The apparatus 100 can be implemented as a search system that provides a list of answers consisting of entities and their corresponding information. The user 110 can interact with the apparatus 100 by providing a query to the apparatus 100 as input 201.
[0061] The apparatus 100 is used to select one or more answering entities from among a plurality of entities of a knowledge base implemented as a knowledge graph 209 to respond to a query, wherein each entity of the knowledge graph 209 is associated with a corresponding key attribute value. Figure 3bAs further shown, the processing circuit 101 of the device 100 is used to: encode the query using a text encoder 204a to obtain an encoded query text, and encode the query key attribute values associated with the query using a key attribute value encoder 204b (also called a query coordinate encoder 204b) to obtain the encoded query key attribute values. The processing circuit 101 is also used to: select a subgraph of the knowledge graph 209 based on the encoded query text, wherein the subgraph includes one or more candidate response entities. The processing circuit 101 is also used to: encode each candidate response entity of the one or more candidate response entities into an encoded candidate response entity, and encode the key attribute value of each candidate response entity of the one or more candidate response entities into an encoded key attribute value. As described in detail below, encoding the key attribute value of each candidate response entity into an encoded key attribute value can be performed by a response coordinate encoder 208b (such as Figure 3b The processing circuit 101 is also used to select one or more answer entities from the selected subgraph based on the one or more encoded candidate answer entities, the encoded query text, the encoded query key attribute value and the one or more encoded key attribute values.
[0062] The processing circuit 101 can be used to: select one or more response entities from the selected subgraph by determining whether the corresponding candidate response entity is a response entity among the one or more response entities for each candidate response entity among the one or more candidate response entities based on the corresponding encoded candidate response entity, the encoded query text, the encoded query key attribute value and the one or more encoded key attribute values.
[0063] To process the query of the user 110, the processing circuit 101 of the apparatus 100 may be used to implement a query encoder 203, which may process the query by implementing modules for a text encoder 204a and a key attribute value encoder 204b, as described in detail below.
[0064] The processed query may then flow via the subgraph selector 205 to the answer selector 207, which may implement a corresponding processing module, as described in detail below. Both the subgraph selector 205 and the answer selector 207 may communicate with the knowledge graph 209 implemented by the processing circuit 101 of the apparatus 100. The answer list may then be provided to the user 110 as an output 211 of the apparatus 100.
[0065] Figure 3bA schematic diagram of a more detailed flow of processing steps implemented by the apparatus 100 in the case of a geographic search system provided by one embodiment is shown. In this embodiment, the corresponding key attribute value of each entity of the knowledge graph 209 is the geographic location of the corresponding entity (the geographic location can be represented as a 2D coordinate). The answer can be presented to the user 110 in the form of a marked point on the map and POI information associated with the marked point, for example, transmitted to the user device 111a, 111b via the communication network 120.
[0066] In the case where the geographic search system is implemented by the apparatus 100, the user 110 may first enter a query of the user 110 in a search box of the user device 111a, 111b. For example, the query may be transmitted to the communication interface 103 of the apparatus 100 via the communication network 120 through the communication interface of the user device 111a, 111b. Then, the query may be pre-processed and encoded by the query encoder 203 through the text encoder 204a and the key attribute value encoder 204b.
[0067] The encoded query representation is then fed to the subgraph selector 205, which performs query understanding to identify the most suitable answer candidates to be considered. In the case of geographic search, the processing circuit 101 can perform two predictions. The processing circuit 101 can implement a prediction module 206a for predicting the answer type and a prediction module 206b for predicting the distance to a reference geographic location.
[0068] The processing circuit 101 can be used to: determine a reference geographic location based on the query text. In one embodiment, the reference point of the input query (i.e., the coordinates of the input query) can be determined by an entity linker, which can be an external system. The external system can identify the POI mentioned in the input. For example, for the query "Parking around London Heathrow Airport", the external system can identify the mention of "London Heathrow Airport" and link "London Heathrow Airport" to the entity of the corresponding airport. The external system can also be used to retrieve the corresponding coordinates, which are then provided to the device 100 as a reference input point. In one embodiment, the entity linker can be implemented by the processing circuit 101 of the device 100. If no reference entity is identified in the input query, the user coordinates can be used instead. The user coordinates can be provided to the device 100 together with the input query.
[0069] In the case of product search, the prediction modules 206a, 206b can implement predictions for different key attribute values (eg, product type and price range). The predictions of the prediction modules 206a, 206b are used to obtain candidate items from the underlying knowledge graph 209.
[0070] The list of candidates is then forwarded to the answer selector 207. The answer selector 207 checks each candidate through the answer text encoder 208a corresponding to the query text encoder 204a and the answer coordinate encoder 208b corresponding to the query coordinate encoder 204b (mentioned above). The answer selector 207 can make a binary decision on whether the candidate should be returned to the user 110 through the decision module 208c, thereby achieving multiple answers. The output 211 of the answer selector is a list of candidates, annotated with 0 for "not suitable" or 1 for "suitable". Then, the subset of answers annotated with 1 (i.e. suitable) is returned to the user 110. In the case of geographic search, the results can be presented through a map interface (e.g., through a marked point) and a list interface to display POI information.
[0071] Figure 4 A schematic diagram of the system architecture of the device 100 provided by an embodiment is shown. The role of the subgraph selector 205 is to generate a complete and compact list of candidate answer entities using dynamic subgraph selection. Therefore, the subgraph selector 205 can be used to limit the search space as much as possible while ensuring that the subgraph selector 205 does not reject suitable candidates. The operation of the subgraph selector 205 can be based on two predictions provided by the corresponding prediction modules 206a and 206b. Both the prediction modules 206a and 206b can accept the input embedding 401 calculated for the input text as input. The predicted values of the two prediction modules 206a and 206b can be used to query the KG 209 and obtain candidate answers. The attributes used in the subgraph predictor may generate a small number of candidates when used in combination without causing a loss in QA performance. Specifically, in the case of geographic search, distance and answer type attributes can be used. In different cases, the same architecture of the device 100 can be used, and other attributes can be used within the same framework, such as product type and price range in the case of a product search system. The following describes the distance prediction module 206b and the answer type prediction module 206a by taking a geographic search situation as an example operating environment.
[0072] The distance prediction module 206b may be used to predict the maximum distance between the head entity mentioned in the query and the expected response. The distance predictor may make discrete predictions for distances (e.g., 1 km, 5 km, 10 km, 20 km, etc.). A prediction of 1 km may indicate that the candidate response should be within a circle with a radius of 1 km around the head entity.
[0073] The answer type prediction module 206a can be used to predict the expected type of entity that should be returned as an answer. In the case of a geographic search, the type of the resulting POI can be predicted. The possible types can be all POI types included in the underlying knowledge graph 209. For example, in the query "cafes in Edinburgh", the answer type predictor can predict that the answer should be a POI of type "restaurant / bars & cafes". Similarly, in the case of a product search, for the query "mobile phones under £500", "phones & telecoms / mobile phones" may be predicted as the expected type of answer.
[0074] Both predictions made by the prediction modules 206a, 206b can be used to obtain a candidate set from the knowledge graph 209. In the case of geographic search, the candidate set includes all POIs whose types are consistent with the predictions of the answer type prediction module 206a and are in a circle around the head entity with a radius indicated by the prediction of the distance prediction module 206b.
[0075] like Figure 4 As shown, an input question (i.e., an input query "London Heathrow parking") may be given as input to the apparatus 100. Figure 4 In the example of “London Heathrow”, the text input embedding 401 can be calculated by the query encoder module 204a and then forwarded to the two prediction modules 206a, 206b of the subgraph selector 205, which calculates the expected type of answer and the radius relative to the position of the head entity in the query, which is used to retrieve relevant candidates from the KG 209.
[0076] The dynamic subgraph selector 205 ensures that incompleteness and sparsity issues are irrelevant in the candidate selection process, since the selection can be based solely on the predictions of the prediction modules 206a, 206b.
[0077] For example, if a query includes "parking near London Heathrow Airport", and there is a knowledge graph 209 that contains POIs that can answer this question, but these POIs are not directly connected to a node for London Heathrow Airport with a "parking" relationship, then any system that relies on the existence of a relationship instance will fail. However, the search system implemented by the device 100 will consider such candidates. In another example, if the query includes "show Premier Inn hotels in Greater London", an approach that relies on matching the text of the query with the values of entity attributes will fail to include entities that are located in the Greater London area but do not contain the string "Greater London" in the address value. However, the search system implemented by the device 100 will consider these entities in the list of candidates.
[0078] To ensure that multiple answers can be returned, the answer selector 207 may not impose any limit on the number of answers. In one embodiment, such a search system can be trained with the goal of not selecting the highest scoring answer, but rather considering each candidate individually and separately from other candidates in the list (decision module 208c). It should be noted that this may be advantageous in applications such as geographic or product searches where there is no concept of ranking of correct answers. It will be appreciated that the two cafes north of Trafalgar Square perfectly respond to the query "cafes north of Trafalgar Square" and there is no case where one cafe is more correct than the other. The same is true for having two separate iPhone 13 listings as responses to the query "iPhone 13".
[0079] like Figure 4 As further shown, after executing the subgraph selector 205, a list of candidate entities can be formed. For each candidate in the list, the query text encoder 204a and the answer text encoder 208a can encode the input question (e.g., "Parking at Heathrow, London") and the name, address, and type label of the candidate. The resulting feature vector is concatenated with the vectors calculated by the coordinate encoders 204b, 208b, and the dimensions of the resulting representation are restored to the dimensions of the two relevant representations. The output vector of the above operation 401 is provided to the decision module 208c of the answer selector 207, which performs a final binary decision on whether the candidate successfully answers the original input question.
[0080] like Figure 4 As shown in the example of , the coordinate encoders 204b, 208b can be customized for geographic search and can be implemented as separate encoders that take as input the coordinates of the head entity and the candidate entities mentioned in the query. These two sets of coordinates can be fed into the coordinate encoders 204b, 208b as raw numbers, and the coordinate encoders 204b, 208b can include a series of fully connected layers so that no complex transformations or projections are performed. The output vector of the coordinate encoders 204b, 208b is concatenated with the representation created by the text encoder for the answer. The classifier can use the concatenated representation to make decisions about the appropriateness of each candidate answer.
[0081] The coordinate encoders 204b, 208b ensure the relevance of specific types of queries to specific relationships between coordinates. Thus, on queries including directional tags such as "cafes north of Trafalgar Square", the performance of the device 100 equipped with coordinate encoders 204b, 208b is better than that of a system without such encoders. The coordinate encoders 204b, 208b can be used in other methods of the device 100 (e.g., intent detection and slot filling and semantic parsing) to support such queries.
[0082] In one embodiment, the processing circuit 101 of the device 100 can be used to implement a machine learning model, in particular one or more neural networks, to select one or more response entities. The machine learning model can obtain a training data set consisting of a natural language query and its corresponding response, and can be trained on natural language understanding and response retrieval tasks. In order to utilize transfer learning, such a machine learning model can be jointly trained to simultaneously predict the response type, distance, and response appropriateness. Specifically, the multi-task implementation of the subgraph selector 205 and the response selector 207 can have a composite target consisting of a binary cross entropy loss term for response selection, a cross entropy loss for distance prediction, and a cross entropy loss for response type prediction.
[0083] In one embodiment, the apparatus 100 may include separate encoders for question and answer (e.g., query text encoder 204a and answer text encoder 208a) or a common encoder that can be used to encode sentences as a first step before subgraph selection and answering, or alternatively to link question and answer together as part of answer selection to potentially exploit cross attention. Depending on the requirements and available technology (i.e., processing circuit 101), such encoders can be recurrent neural networks with or without attention, self-attention encoders, encoders based on pre-trained language models, or combinations thereof.
[0084] Given the input embedding 401, the subgraph selector 205 and the response selector 207 can output a prediction. Therefore, the subgraph selector 205 and the response selector 207 can be implemented as separately trained models, or in the case of the above-mentioned joint learning, as part of an overall architecture, which can be a joint machine learning model. In one embodiment, the decision module 208c of the subgraph selector 205 and the response selector 207 can be implemented as a feed-forward neural network.
[0085] In one embodiment, the apparatus 100 includes a knowledge graph 209, which includes POIs and information associated with the POIs. In addition, the apparatus 100 may include a corresponding communication channel to access the KG 209, perform filtering queries against the KG 209, and obtain responses from the KG 209.
[0086] Therefore, advantageously, the two predictors implemented in the subgraph selector 205 (i.e., the distance prediction module 206b and the answer type prediction module 206a) help achieve low latency. Specifically, in the test data set, by filtering using the two prediction modules 206a, 206b, the device 100 considered four times fewer candidates than when filtering using only distance, without a decrease in recall. In addition, the subgraph selector 205 ensures that the search system implemented by the processing circuit 101 of the device 100 is suitable for sparse and incomplete knowledge graphs. Therefore, potential relationship loss does not affect the candidate selection process. In addition, the coordinate encoders 204b, 208b help improve accuracy, especially for queries including directions such as "cafes north of Trafalgar Square". In the test data set, the addition of coordinate encoders 204b, 208b improved the accuracy of the QA task.
[0087] As described above, the processing circuit 101 may be used to implement a neural network. The technical details involved in the architecture implementation may have an impact on the performance and latency of the device 100. Figure 4 In the example shown, the processing circuit 101 of the apparatus 100 can use a pre-trained model based on a self-attention encoder layer as the backbone of the encoder. The processing circuit 101 can also use the output vector of the CLS position (i.e., a special token with a prefix for each input sequence) as a vector to represent the text input, and the answer type predictor module 206a, the distance predictor module 206b (together with the subgraph selector 205 in Figure 4 ) and the response selector 207 are implemented as a feed-forward neural network, where the output dimension is tailored to the output range.
[0088] In addition, since the training and inference time of neural networks are affected by the underlying hardware technology, GPUs are often used to speed up the runtime of neural networks. If a GPU is available at the time of inference, or hardware improvements or code optimizations reduce runtime latency, the inference process can be accelerated.
[0089] Therefore, the device 100 is able to answer questions about incomplete and sparse knowledge graphs, thereby solving the problem of graph incompleteness. Incomplete and sparse knowledge graphs are quite common in industry applications, given the cost of creating and maintaining complete and high-quality knowledge graphs, and the need to reason about data sources including a small number of relationship instances makes the search system implemented by the device 100 conducive to searching on knowledge graphs.
[0090] Question answering systems are generally promising for search applications, but usually the high latency introduced by question answering systems makes them difficult to deploy in industry applications. However, the search system implemented by the apparatus 100 considers a reduced number of candidates, thereby providing a fast question answering capability, thereby solving the high latency problem and enabling deployment in more industry applications.
[0091] In addition, because the search system implemented by the device can return multiple answers but not in any order (when multiple answers are equally correct), the device 100 is suitable for real-life search scenarios. In addition, the search system of the device 100 can answer geographic queries with directions, thereby solving the problem of encoding geographic location information. This coordinate encoding enables the search system to answer directional questions that are important to some users, such as "cafes north of Trafalgar Square", which are not currently supported by commercial geographic search systems.
[0092] Figure 5 A flow chart of a method 500 is shown, and the method 500 is used to select one or more answer entities from a plurality of entities of a knowledge base implemented as a potentially incomplete and sparse knowledge graph 209 to respond to a user query based on a knowledge base question answering (KBQA) framework, and each entity of the knowledge graph 209 is associated with a corresponding key attribute value (especially the geographic location of the corresponding entity). The method 500 includes the following steps:
[0093] Encode 501 the query using the text encoder 204a to obtain an encoded query text, and encode 501 the query key attribute value associated with the query using the key attribute value encoder 204b to obtain an encoded query key attribute value;
[0094] Selecting 503 a subgraph of the knowledge graph 209 based on the encoded query text, wherein the subgraph includes one or more candidate answer entities;
[0095] encoding 505 each candidate response entity of the one or more candidate response entities as an encoded candidate response entity, and encoding 505 a key attribute value of each candidate response entity of the one or more candidate response entities as an encoded key attribute value;
[0096] One or more answer entities are selected 507 from the selected subgraph based on the one or more encoded candidate answer entities, the encoded query text, the encoded query key attribute value, and the one or more encoded key attribute values.
[0097] Since the method 500 can be implemented by the apparatus 100 , other features of the method 500 are directly implemented by the functions of the apparatus 100 and the different embodiments thereof described above and below.
[0098] Those skilled in the art will understand that the "blocks" ("units") in the various figures (methods and devices) represent or describe the functions of an embodiment of the present invention (and not necessarily independent "units" in hardware or software), thereby equally describing the functions or features of the device embodiments and the method embodiments (unit = step).
[0099] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The described device embodiments are merely exemplary. For example, unit division is only a logical function division, and other division methods can be used in actual implementation. For example, multiple units or components can be merged or integrated into another system, or some features can be ignored or not performed. In addition, the mutual coupling or direct coupling or communication connection shown or described can be implemented through some interfaces. The indirect coupling or communication connection between devices or units can be implemented in electronic, mechanical or other forms.
[0100] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one location, or may be distributed across multiple network units. Some or all of the units may be selected as needed to achieve the purpose of the embodiment.
[0101] In addition, the functional units in the various embodiments disclosed herein may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
Claims
1. A device (100), characterized in that: The apparatus (100) is used to select one or more answering entities from a plurality of entities implemented as a knowledge base of a knowledge graph (209) to respond to a query, wherein each entity of the knowledge graph (209) is associated with a corresponding key attribute value, and the apparatus (100) comprises a processing circuit (101), wherein the processing circuit (101) is used to: Encoding the query using a text encoder (204a) to obtain an encoded query text, and encoding a query key attribute value associated with the query using a key attribute value encoder (204b) to obtain an encoded query key attribute value; Selecting a subgraph of the knowledge graph (209) based on the encoded query text, wherein the subgraph includes one or more candidate answer entities; Encoding each candidate response entity of the one or more candidate response entities into an encoded candidate response entity, and encoding a key attribute value of each candidate response entity of the one or more candidate response entities into an encoded key attribute value; The one or more answering entities are selected from the selected subgraph based on the one or more encoded candidate answering entities, the encoded query text, the encoded query key attribute value, and the one or more encoded key attribute values.
2. The device (100) according to claim 1, characterized in that The processing circuit (101) is used to select the one or more response entities from the selected subgraph by determining whether the corresponding candidate response entity is a response entity among the one or more response entities for each candidate response entity among the one or more response entities based on the corresponding encoded candidate response entity, the encoded query text, the encoded query key attribute value and the one or more encoded key attribute values.
3. The device (100) according to claim 1 or 2, characterized in that The processing circuit (101) is used to select the subgraph of the knowledge graph (209) by predicting the maximum distance metric value between the one or more candidate response entities and a reference key attribute value based on the encoded query text and the distance metric, wherein the subgraph includes the one or more candidate response entities, and the distance metric is used to determine the corresponding distance metric values between the key attribute values of corresponding pairs of the one or more candidate response entities.
4. The device (100) according to claim 3, characterized in that The processing circuit is used to select the subgraph of the knowledge graph by predicting a type for each of the one or more candidate response entities based on the encoded query text, wherein the subgraph includes the one or more candidate response entities.
5. The device (100) according to claim 3 or 4, characterized in that The key attribute value of each entity includes the geographic location of the entity, and the processing circuit (101) is used to select the subgraph of the knowledge graph (209) by predicting the maximum spatial distance between the one or more candidate response entities and a reference geographic location based on the encoded query text, wherein the subgraph includes the one or more candidate response entities.
6. The device (100) according to claim 5, characterized in that The processing circuit (101) is used to determine the reference geographical location based on the query text.
7. The device (100) according to any one of the preceding claims, characterized in that The processing circuit (101) is used to implement a machine learning model to select the one or more response entities.
8. The device (100) according to any one of the preceding claims, characterized in that The encoded query text includes a query text feature vector and / or the encoded query key attribute includes a query key attribute feature vector.
9. The device (100) according to any one of the preceding claims, characterized in that The device (100) includes a cloud server.
10. The device (100) according to claim 9, characterized in that The apparatus (100) further comprises a communication interface (103) for receiving the query from the user equipment (111a, 111b) and returning the one or more answering entities to the user equipment (111a, 111b).
11. A method (500), characterized in that The method (500) is used to select one or more answering entities from a plurality of entities of a knowledge base implemented as a knowledge graph (209) to respond to a query, wherein each entity of the knowledge graph (209) is associated with a corresponding key attribute value, and the method (500) comprises: Encoding (501) the query using a text encoder (204a) to obtain an encoded query text, and encoding (501) a query key attribute value associated with the query using a key attribute value encoder (204b) to obtain an encoded query key attribute value; Selecting (503) a subgraph of the knowledge graph (209) based on the encoded query text, wherein the subgraph includes one or more candidate answer entities; encoding (505) each of the one or more candidate response entities as an encoded candidate response entity, and encoding (505) a key attribute value of each of the one or more candidate response entities as an encoded key attribute value; The one or more answering entities are selected (507) from the selected subgraph based on the one or more encoded candidate answering entities, the encoded query text, the encoded query key attribute value, and the one or more encoded key attribute values.
12. A computer program product, characterized in that A computer-readable storage medium is included for storing program code, which, when executed by a computer or a processor, causes the computer or the processor to perform the method of claim 11.
Citation Information
Patent Citations
Entity alignment method in four-insurance-one-fund domain knowledge graphs
CN112131404A