Question answering method and system
By constructing a knowledge graph, entities in standard question information are used as attribute values of nodes or relationship edges, recalling subgraphs related to user input questions, and selecting highly matching answers as output, solving the problem of question and answer errors in online question and answer systems. It improves the quality of answers and user experience by matching questions with inconsistent answer granularity.
Patent Information
- Application Number
- CN202211522222.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-11-30
AI Technical Summary
In existing online question and answer systems, FAQ technology leads to a high probability of mismatching between questions and standard answers, making it difficult to provide users with accurate answers, and the inconsistent granularity of the knowledge graph affects user experience.
By constructing a knowledge graph, the entities in the standard question information are used as attribute values of nodes or relationship edges, recalling subgraphs related to the user's input questions, and selecting answers with high matching degrees as output to avoid entity matching errors and inconsistent answer granularity. .
It improves the quality and accuracy of answers, reduces the probability of mismatches, improves users’ online Q&A experience, and reduces map construction and maintenance costs.
Smart Images

Figure CN116303919B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a question-answering method and system. Background Art
[0002] In an online question-and-answer scenario, an electronic device can receive questions input by a user, automatically analyze and process the questions, and obtain answers to the questions. A typical technology for analyzing and processing questions is frequently-asked questions (FAQ) technology: using FAQ technology, standard question information and standard answers for various common questions can be stored in a corpus; the electronic device outputs the standard answers corresponding to the standard question information in the corpus that has a high semantic similarity to the question input by the user to the user. However, in practice, the probability of mismatch between questions and standard answers is high in this way, that is, standard answers in the corpus that are not related to the questions are output, resulting in irrelevant answers, making it difficult to provide accurate answers to users. Summary of the invention
[0003] Based on this, an embodiment of the present application provides a question-and-answer method and system, which recalls a set of answers in a corpus that are associated with the first entity in the question information input by the user, and filters the first answer from the answer set to provide it to the user, thereby reducing problems caused by mismatched entities and problems with a high probability of mismatching the first answer, improving the quality and accuracy of the first answer, and providing users with a good online question-and-answer experience.
[0004] In a first aspect, an embodiment of the present application provides a question-and-answer method, which is applied to a server, wherein the server pre-sets multiple sets of question-and-answer pairs, each set of question-and-answer pairs includes a standard question information and a corresponding standard answer, and the method includes: obtaining first question information, wherein the first question information includes a first entity; if it is determined that the first entity is included in at least one standard question information, obtaining a standard answer corresponding to at least one standard question information as an alternative answer; and determining a first answer among the alternative answers whose matching degree with the first question information meets a preset condition.
[0005] In this solution, when generating an answer for the first question information, only when the question-answer pair includes standard question information related to the first entity in the first question information, the standard answer corresponding to the standard question information is obtained as an alternative answer. This avoids the problem of low answer accuracy caused by entity matching errors. Among the alternative answers, an alternative answer whose matching degree meets the preset conditions is selected as the first answer corresponding to the first question information. The first answer has a high matching degree with the first question information and is related to the first entity, so the matching accuracy is high.
[0006] In a possible design manner of the first aspect, a server is provided with a first graph, the first graph including nodes and relationship edges, wherein the nodes represent second entities in standard question information, and the relationship edges represent that two second entities are associated; determining that the first entity is included in at least one standard question information includes: determining that the first entity matches at least one second entity in the first graph.
[0007] In this design, the standard answer expressed in natural language is used as the attribute value of the edge or node, thus avoiding the extraction of relationships between multiple entities, which is more efficient and less prone to errors. After the first graph is constructed, the standard question information is converted into entities with consistent granularity, thus avoiding the granularity of the standard question information in the question and answer pair being too coarse or too fine, affecting the granularity of the response and giving users a bad online question and answer service experience.
[0008] In a possible design of the first aspect, a standard answer corresponding to at least one standard question information is obtained as an alternative answer, including: recalling from the first graph the nodes of the second entity that matches the first entity and the relationship edges that have a connection relationship with the nodes to obtain a target subgraph; obtaining the attribute values of the nodes and the attribute values of the relationship edges of the target subgraph as alternative answers.
[0009] In this design, the question-answer pairs are graphed, so the alternative answers obtained from the standard answer can be converted into a method of recalling the target subgraph, thereby improving the recall rate of the alternative answers.
[0010] In a possible design of the first aspect, the method also includes: identifying a second entity in the standard question information in the question-answer pair; taking the second entity as a node and the standard answer corresponding to the standard question information in the question-answer pair as an attribute value, and generating a first graph, wherein the standard answer is represented in the first graph by the attribute value of the node corresponding to the second entity, or by the attribute value of the relationship edge between nodes corresponding to multiple second entities.
[0011] In this design, the first graph is constructed with the second entity and the standard answer. The advantage of only identifying the core entity during the construction process is that it has low requirements on the recognition performance of the algorithm and is less likely to cause entity recognition errors. Compared with constructing a knowledge graph with "entity-relationship-entity" triples, this construction method does not require the relationship between two entities to be identified as an attribute relationship, so the graph construction cost is low and it is more conducive to maintenance.
[0012] In a possible design method of the first aspect, the second entity is taken as a node, and the standard answer corresponding to the standard question information in the question and answer pair is taken as an attribute value, including: taking the second entity as a node, if the standard question information includes multiple second entities, then the standard answer corresponding to the standard question information is used as the attribute value of the relationship edge between the nodes corresponding to the multiple second entities included in the standard question information; if the standard question information has only one second entity, the standard answer corresponding to the standard question information is used as the attribute value of the node corresponding to the second entity included in the standard question information.
[0013] In this design, the standard question information is classified into one-hop question information and two-hop question information according to whether the standard question information contains multiple second entities. The answer to the one-hop question information is only related to the entity in the question information, so the corresponding standard answer is stored in the node, and the answer to the two-hop question information involves two entities, so the corresponding standard answer is stored on the relationship edge of the nodes corresponding to the two entities.
[0014] Furthermore, according to whether the standard answer needs to distinguish multiple situations for answering, the single-hop question and the two-hop question can be further subdivided into "single-hop constrained question information", "single-hop unconstrained question information", "two-hop constrained question information" and "two-hop unconstrained question information". Among them, the constraint means that the presentation form of the standard answer does not need to distinguish the situation, and one answer can answer it, so the attribute value can be stored in the form of a string. The unconstrained means that the presentation form of the standard answer needs to be analyzed according to the specific situation, so the attribute value can be stored in the form of a dictionary.
[0015] In a possible design manner of the first aspect, a first entity includes multiple entities, and nodes of a second entity matching the first entity and relationship edges having a connection relationship with the nodes are recalled from a first graph to obtain a target subgraph, including: recalling from the first graph nodes corresponding to multiple second entities matching the first entity and relationship edges having a connection relationship with the nodes; determining from the nodes and relationship edges corresponding to the multiple second entities that the nodes corresponding to the multiple second entities and the relationship edges having a connection relationship only with the nodes corresponding to the first entity to obtain the target subgraph.
[0016] In this design, the server removes the relationship edges from the node corresponding to the first entity to the nodes corresponding to other entities, and only retains the relationship edges between the nodes corresponding to multiple first entities, thereby reducing the computational complexity of subsequent matching.
[0017] In a possible design of the first aspect, a first answer whose matching degree with the first question information satisfies a preset condition is determined among the alternative answers, including: combining the first question information and each alternative answer to obtain multiple alternative question and answer pairs; comparing the alternative question and answer pairs with the standard question and answer pairs for similarity to obtain similarity information of each alternative question and answer pair, wherein the standard question and answer pair is obtained by combining the alternative answers and the standard questions corresponding to the alternative answers; determining the similarity between the alternative question and answer pairs and the standard question and answer pair based on the similarity information; and obtaining, as the first answer, an alternative answer among the alternative question and answer pairs whose similarity with the standard question and answer pair satisfies the preset condition.
[0018] In this design, text similarity is used to determine whether the candidate answer matches the first question information. The matching process does not involve structured processing of the first question information or the candidate answer, thereby improving matching efficiency.
[0019] In a possible design manner of the first aspect, the preset condition includes: the similarity with the standard question and answer pair is the highest, or the preset condition also includes: the similarity with the standard question and answer pair is greater than a threshold.
[0020] In a possible design manner of the first aspect, obtaining the first question information includes: obtaining the first question information from the electronic device; the method also includes: sending the first answer to the electronic device.
[0021] In a possible design of the first aspect, the method further includes: if it is determined that the first entity is not included in at least one standard question information, generating a second answer, the second answer indicating that a standard answer related to the first entity is not matched.
[0022] In a possible design of the first aspect, the method further includes: if it is determined that the degree of match between the alternative answer and the first question information does not meet a preset condition, generating a third answer, the third answer indicating that a standard answer related to the first question information is not matched.
[0023] This design avoids distracting users by generating a second answer.
[0024] In a possible design of the first aspect, a standard answer corresponding to at least one standard question information is obtained as an alternative answer, including: triggering a recall instruction, the recall instruction including a first field and a second field, the first field is used to indicate that a first entity is queried from a first graph, and the second field is used to indicate that nodes and relationship edges are recalled; in response to the recall instruction, nodes of a second entity that matches the first entity and relationship edges that have a connection relationship with the nodes are recalled from the first graph to obtain a target subgraph.
[0025] Under this design method, if no alternative answer is found that matches the preset conditions, the wrong standard answer will not be fed back to the user, avoiding misleading the user.
[0026] In a second aspect, an embodiment of the present application provides a question-and-answer method, which is applied to an electronic device. In the method, the electronic device receives a first question message, which includes a first entity. If the first entity is included in at least one standard question message, and the standard answer corresponding to at least one standard question message meets a preset condition, the electronic device displays a first answer, which is a standard answer corresponding to the standard question message that includes the first entity in a preset plurality of question-and-answer pairs, and the first answer meets the preset condition.
[0027] In a possible design of the second aspect, the method further includes: if it is determined that the first entity is not included in at least one standard question information, the electronic device displays a second answer, and the second answer indicates that no standard answer related to the first entity is matched.
[0028] In a possible design of the second aspect, the method further includes: if it is determined that the degree of match between the alternative answer and the first question information does not meet a preset condition, the electronic device generates a third answer, and the third answer indicates that a standard answer related to the first question information is not matched.
[0029] In a possible design manner of the second aspect, a first entity is included in at least one standard question information, including: the first entity matches at least one second entity in a first graph; wherein the second entity is identified from the standard question information, a node in the first graph represents the second entity, and a relationship edge in the first graph represents that the two second entities are associated.
[0030] In a possible design of the second aspect, the first graph is generated with the second entity as a node and the standard answer corresponding to the standard question information in the question-answer pair as the attribute value, wherein the standard answer is represented in the first graph by the attribute value of the node corresponding to the second entity, or by the attribute value of the relationship edge between nodes corresponding to multiple second entities.
[0031] In a third aspect, an embodiment of the present application provides a question-and-answer device, comprising a memory and one or more processors, wherein the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the question-and-answer device executes the method described in the first aspect and any possible design thereof, or executes the method described in any possible design of the second aspect.
[0032] In a fourth aspect, an embodiment of the present application provides a question-answering system, comprising a server and an electronic device, wherein the server executes the method as described in the first aspect, and the electronic device executes the method as described in the second aspect.
[0033] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising computer instructions. When the computer instructions are executed on the electronic device, the electronic device executes the method described in the first aspect or the method described in the second aspect.
[0034] In a sixth aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method described in the first aspect and any possible design thereof, or to execute the method described in the second aspect and any possible design thereof.
[0035] It can be understood that the beneficial effects that can be achieved by the second aspect and the method described therein, the question-and-answer device described in the third aspect, the question-and-answer system described in the fourth aspect, the computer-readable storage medium described in the fifth aspect, and the computer program product described in the sixth aspect can be referred to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A mobile phone interface diagram for online question and answer provided in an embodiment of the present application;
[0037] Figure 2 A schematic diagram of similarity matching between a user question and standard question information provided in an embodiment of the present application;
[0038] Figure 3 is a schematic diagram of a knowledge graph provided in an embodiment of the present application;
[0039] Figure 4 is a schematic diagram of another knowledge graph provided in an embodiment of the present application;
[0040] Figure 5 Schematic diagram of multiple subgraph recall schemes provided by the prior art;
[0041] Figure 6 A schematic diagram of the hardware structure of a question-answering system provided in an embodiment of the present application;
[0042] Figure 7 A schematic diagram of the software structure of a question-and-answer system provided in an embodiment of the present application;
[0043] Figure 8 An interactive diagram for constructing a FAQ map provided in an embodiment of the present application;
[0044] Fig. 9 A schematic diagram of the classification of standard question information provided in an embodiment of the present application;
[0045] Fig.10 An interactive diagram of a recall subgraph provided in an embodiment of the present application;
[0046] Fig.11 Another mobile phone interface diagram for online question and answer provided in an embodiment of the present application;
[0047] Fig.12 A schematic diagram of a sub-graph provided in an embodiment of the present application;
[0048] Fig.13 A schematic diagram of another sub-graph provided in an embodiment of the present application;
[0049] Fig.14 A schematic diagram of outputting an answer provided in an embodiment of the present application;
[0050] Fig.15 A schematic diagram of screening a target subgraph from a subgraph provided in an embodiment of the present application;
[0051] Fig.16 A schematic diagram of an attribute value of a target subgraph provided in an embodiment of the present application;
[0052] Fig.17 A schematic diagram of the structure of a matching model provided in an embodiment of the present application;
[0053] Fig.18 A diagram of another mobile phone interface for online question and answer provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
[0055] Reference Figure 1 ,In the online question and answer scenario, the electronic device can receive ,questions input by the user, such as Figure 1 The question in the question is "What is the CPU model of Honor 70?" Then the question is matched with the standard question information in the FAQ corpus (or corpus), and the standard answer corresponding to the standard question information with high similarity to the question is obtained, such as "Snapdragon TM778G Plus", and reply to the user, so that the user's questions can be answered at any time, rather than being limited to answering the user's questions during the customer service staff's working hours.
[0056] The online question-answering system based on FAQ corpus can provide users with convenient and satisfactory service quality when the accuracy of the reply answer is high, especially in the early stage of the development of the online question-answering system, such as the cold start stage, when there are fewer question-answer pairs in the corpus, the mismatch probability between the user's question and the standard answer in the question-answer pair is low, and the answer quality is high. However, with the development of the online question-answering system, there are more question-answer pairs in the corpus, and the number of standard question information similar to the user's question is large, so the matching difficulty is greatly increased, resulting in an increase in the mismatch probability, and often giving irrelevant answers.
[0057] like Figure 2 As shown, in some embodiments, when there is no question-answer pair related to the question in the corpus, the online question-answering system outputs a standard answer corresponding to the standard question information with high similarity, which is based on the similarity matching between the user's question and the standard question information in the corpus, resulting in the standard answer misleading the user. For example, the QA method of text matching will match two semantically unrelated but similarly expressed question information together. For example, the question input by the user is "the CPU model of Honor 70", and the two standard question information closest to the question input by the user in the corpus queried by the online question-answering system are "the CPU model of Honor 50", with a similarity of 0.8, and "the CPU model of Honor 60", with a similarity of 0.8. In this example, although the standard question information and the user's question have a high similarity, the products they target are completely different. Therefore, using the CPU model of Honor 50 or the CPU model of Honor 60 as the standard answer not only does not answer the question, but also easily makes the user mistakenly believe that Honor 70 uses the same model of CPU as Honor 50 or Honor 60, causing interference to the user.
[0058] Continue to refer to Figure 2In other embodiments, the standard question information in the corpus that is actually close to the user's question semantics is far from the user's question expression; and the standard question information that is actually close to the user's question expression is far from the user's question semantics; resulting in the online question-answering system mismatching the user's question to the standard question information that is similar in expression but far in semantics, and the output standard answer does not match the user's question accurately. For example, the question input by the user is "Can the goods purchased from Honor Mall be returned or exchanged?" The standard question information that the online question-answering system finds in the corpus that is closest to the user's question input is "Can the goods purchased from JD.com be returned or exchanged?" Although the standard question information is close to the user's question in expression, with a similarity of 0.8, it actually expresses two different semantics from the user's question. The standard question information that is close to the user's question semantics is "Honor Mall After-sales Strategy". Since the standard question information is very different from the user's question in form (or expression), the similarity is only 0.6, and it cannot be queried by the online question-answering system, which ultimately leads to the inability to accurately feedback the answer the user wants.
[0059] Based on the technical problem that the FAQ technology used to implement online Q&A cannot accurately give a standard answer that actually matches the user's question, the embodiment of the present application provides a question-and-answer method, which can be applied to scenarios such as online customer service, intelligent voice interaction, and knowledge acquisition (such as WeChat TM public accounts). The method is applied to a server, and the server presets multiple groups of question-and-answer pairs, each group of question-and-answer pairs includes a standard question information and a corresponding standard answer. In this method, the server obtains a first question information, and the first question information includes a first entity. If it is determined that the first entity is included in at least one standard question information, the standard answer corresponding to at least one standard question information is obtained as an alternative answer. Determine the first answer whose matching degree with the first question information meets the preset conditions in the alternative answers. Applying this method can avoid the problem of a high probability of mismatch between the first question information and the first answer due to mismatched entities, improve the quality of the first answer, and provide users with a good online Q&A experience.
[0060] Moreover, the method can be used for online question-and-answer sessions on knowledge in various fields, such as character knowledge, e-commerce knowledge, financial knowledge, medical knowledge, etc. In this article, the knowledge in the 3C field is mainly used as an example to illustrate the solution of the embodiment of the present application. The 3C field refers to the three major fields of computer, communication and electronic consumer goods.
[0061] Before introducing the question-answering method provided in the embodiment of the present application, a brief description of the relevant terms involved in the method is given here:
[0062] 1.FAQ.
[0063] FAQ (or FAQ technology) can be used to store frequently asked questions and answer pairs in a corpus, which include standard questions and standard answers. On the one hand, users can directly browse the corpus to find answers to their questions; on the other hand, users can also use the online question-and-answer system implemented by FAQ to ask questions online.
[0064] In order to improve the response accuracy of the online question-answering system, each standard question information can correspond to multiple extended questions, thereby improving the hit rate of user questions and questions in the corpus and improving the recall rate of standard answers.
[0065] Use FAQ in addition to the above Figure 2 In addition to the high mismatch probability and low accuracy rate mentioned in the relevant instructions, which lead to poor practicality, there is also the problem of inconsistent answer granularity. For example, in response to "Honor 50 repair price" and "Honor 50 mail-in repair price", the former has a low response granularity, while the latter has a high response granularity. If the corpus only stores the former, the granularity is too coarse, which can easily lead to problems such as broad responses, long answers, and high reading difficulty; if the corpus only stores the latter, the granularity is too fine, which can easily lead to mismatches between users' questions and standard answers. In this way, different standard answers need to be stored in the corpus for questions of different granularities, resulting in high maintenance costs for question-answer pairs, large storage volume, and large matching calculation volume, which is not conducive to long-term use.
[0066] 2. Knowledge Graph.
[0067] See also Figure 3 In (a), the knowledge graph is a structured knowledge base consisting of nodes and edges. Figure 3 The circles shown in (a) are nodes, the arrows between nodes are edges, and, Figure 3 The nodes shown in (a) represent entities, and the edges represent the semantic relationships between entities. The basic building blocks of knowledge graphs are mainly in two forms:
[0068] One is the "entity-relationship-entity" triple, which can represent two things in the physical world and their relationship. Figure 3 As shown in (a) in the figure, “Alipay TM " and "fast power consumption" and the relationship between them "failure" can form a triple, which can represent "causing Alipay TM The reason for the fast power consumption is a malfunction". The two entities "Honor 60" and "fast power consumption" and the relationship between them "high screen refresh rate" can form another triple, which can indicate that "the reason for the fast power consumption of Honor 60 is the high screen refresh rate".
[0069] The other is the entity and its attributes and attribute values. Each entity in the knowledge graph can have some attributes. Attributes refer to the characteristics of the entity that will not change with time and space, such as the color, CPU model, product number and other characteristics of the product. The attributes and attribute values of the entity can be bound to the entity. Figure 3 As shown in (a), the entity "Honor 60" is bound to color attributes and attribute values (such as white, black) and launch time attributes and attribute values (such as 2021.12).
[0070] In some scenarios, an entity may have many attributes. For example, in addition to the color attribute and the time of market launch attribute, the "Honor 60" also has a large number of parameter attributes such as screen size, CPU model, battery capacity, and a large number of functional attributes such as calling and taking pictures. In this case, if both the attributes and attribute values are bound to the corresponding nodes, it may result in too much information to be bound to the nodes, which is not conducive to maintenance. Based on this, in some embodiments, see Figure 3 In (b), some or all of the attributes and attribute values of the entity can also be stored in the form of triples. Figure 3 The screen size, CPU model, battery capacity and other parameter attributes and their attribute values of "Honor 60" shown in (b) are all stored in the form of triples. "Honor 60" is one entity in the triple, and the screen size, CPU model, battery capacity and other parameter attributes are another entity in the triple. The relationship between the two entities is an attribute relationship (such as "of"), which points from the entity to the attribute of the entity, and the attribute value is also recorded on the edge between the two nodes corresponding to the two entities. Figure 3 As shown in (b), the edge between the node corresponding to "Honor 60" and the node corresponding to "Screen size" records the attribute value of the screen size attribute of Honor 60, which is 6.67 inches. The edge between the node corresponding to "Honor 60" and the node corresponding to "CPU model" records the attribute value of the CPU model attribute of Honor 60, which is Snapdragon TM 778. The edge between the node corresponding to "Honor 60" and the node corresponding to "Battery capacity" records the attribute value of the battery capacity attribute of Honor 60, that is, 4800mAh. In this way, on the one hand, the information bound to the node can be reduced, and on the other hand, when other entities also have the same attribute, a triple with other entities and corresponding attributes can be directly established. This is conducive to maintenance.
[0071] In the knowledge graph, structured knowledge is used to represent things and their relationships. For a common problem of a product, it is only necessary to use a triple or entity and its attributes and attribute values to represent it, without having to maintain multiple problems. This simplifies the data that needs to be maintained. Moreover, as the number of products and / or common problems increases, only a small amount of maintenance data needs to be added.
[0072] For example, as the number of products increases, it is only necessary to add nodes corresponding to the products in the knowledge graph, and then establish associations between the nodes and other nodes in the knowledge graph. Figure 4 As shown in (a) in Figure 3 Based on (a) in the figure, add the node "Honor 70" and add an edge between "Honor 70" and "fast power consumption", which records the attribute of high screen refresh rate and its attribute value. It means "the reason why Honor 70 consumes power quickly is the high screen refresh rate". In addition, Honor 70 itself also has certain attributes, such as Figure 4 The color attributes and attribute values (such as white, flowing gold) and the launch time attributes and attribute values (such as 2022.3) in (a).
[0073] As another example, as the number of common product problems increases, it is only necessary to add nodes corresponding to the common problems in the knowledge graph, and then establish the relationship between the node and other nodes. TM How to transfer data between 12 and Honor 70? Figure 4 As shown in (b) in Figure 4 Based on (a), add the node "Apple TM 12", and at nodes "Honor 70" and "Apple TM 12”, and the data transmission attributes and their attribute values are recorded on the edges.
[0074] 3. Knowledge-based question answering (KBQA).
[0075] Knowledge graph question answering is an intelligent question answering method based on knowledge graph. The knowledge graph question answering system semantically understands the natural language expression (or unstructured) questions input by the user, and further converts them into knowledge graph query statements, and then performs queries and reasoning on the knowledge graph based on the knowledge graph query statements, and returns the results. Finally, the electronic device converts the results into natural language and outputs them to the user. There are two main implementation methods of common knowledge graph question answering:
[0076] One is the template-based sub-graph recall scheme. Figure 5As shown in (a), the solution pre-sets multiple query templates to match the query input by the user with the query template that is closest to the query template, and then decomposes the question input by the user into sentence blocks according to the query template, and substitutes the sentence blocks into the query sentence template corresponding to the query template to convert them into query sentences.
[0077] For example, the question input by the user is "Honor 60's CPU model", and the closest query template matched to the question is "[product model]'s [parameter]". According to the query template, the question is decomposed into the sentence block "Honor 60" and the sentence block "CPU model", and the sentence block is substituted into the query statement template 1 "gV("product model").has("product sub-level").out("parameter query").hasId("parameter")" corresponding to the query template, thereby converting it into query statement 1 "gV("Honor 60").has("product sub-level").out("parameter query").hasId("CPU model")".
[0078] The following describes the meaning of each field in the query statement template:
[0079] gV() means obtaining graph vertices, where g represents graph and V represents vertex.
[0080] has() means search.
[0081] Product sub-levels represent further subdivisions of products. For example, the product sub-levels of Honor 60 include "Honor 60, 8G+256G" and "Honor 60, 8G+128G". The attribute values of different product sub-levels may be different. For example, the storage capacities of "Honor 60, 8G+256G" and "Honor 60, 8G+128G" are different. Therefore, when querying, query nodes from the graph based on the subdivided product model.
[0082] out() means output.
[0083] hasId() means obtaining the vertex id and edge id, where id represents identity.
[0084] For another example, the question entered by the user is "Can the products purchased from Honor Mall be returned or exchanged?" The query template that matches the question the most closely is "Can the products purchased from [channel] receive [after-sales service]?" The question is broken down into the sentence blocks "Honor Mall" and "return or exchange" according to the query template, and the sentence blocks are substituted into the query statement template 2 "gV("channel").out("after-sales policy query").hasId("after-sales service")" corresponding to the query template, thereby converting it into query statement 2 "gV("Honor Mall").out("after-sales policy query").hasId("return or exchange")".
[0085] From the comparison of the above two examples, it can be seen that the adoption of this solution requires the preset of a large number of query templates to deal with questions in different scenarios. For example, for questions about product parameters, query template 1 is used, and for questions about product after-sales, query template 2 is used. Due to the poor versatility of query templates, the template maintenance cost is high, which is not conducive to long-term use. In addition, the degree of matching between the question and the template determines the reliability of the query result. Therefore, when the natural language understanding (NLU) ability of the model is poor, the template matching degree is low, which affects the reliability of the query result. To improve the reliability of the query result, a large number of samples are required to train the NLU model, which is costly to implement.
[0086] The other is a subgraph recall solution based on entity recognition and relationship recognition. Figure 5 As shown in (b), the method first performs entity recognition and relationship recognition on the question input by the user to obtain the entities and attribute relationships in the question, and then substitutes the entities and attribute relationships into the query statement template respectively to convert them into query statements.
[0087] For example, the question input by the user is "Honor 60's CPU model", and entity recognition is performed on the question to obtain that the first entity is Honor 60 and the second entity is the CPU model; relationship recognition is performed on the question to obtain that the attribute relationship is parameter query. Then the first entity, attribute relationship, and second entity are substituted into the query statement template 3 "gV("first entity").has("product sub-level").out("attribute relationship").hasId("second entity")", thereby converting it into query statement 3 "gV("Honor 60").has("product sub-level").out("parameter query").hasId("CPU model")".
[0088] For another example, the question input by the user is "Can the goods purchased from Honor Mall be returned or exchanged?" Entity recognition is performed on this question, and the first entity is "Honor Mall" and the second entity is "Return or Exchange." Relationship recognition is performed on this question, and the attribute relationship is after-sales policy query. Then the first entity, attribute relationship, and second entity are substituted into the query statement template 4 "gV("First Entity").out("Attribute Relationship").hasId("Second Entity")", thereby converting it into query statement 4 "gV("Honor Mall").out("After-sales Policy Query").hasId("Return or Exchange")".
[0089] From the above two examples, it can be seen that although the adoption of this solution does not involve matching questions and query templates, it involves multiple query templates. For example, for questions about product parameters, query template 3 is used, and for questions about product after-sales, query template 4 is used. The query templates have poor versatility. In addition, the adoption of this solution requires the identification of attribute relationships in questions, which is difficult; and the recognition accuracy of attribute relationships is not high, which will lead to a low recall rate of the subgraph (the graph composed of the aforementioned V() and E()), and it is difficult to obtain valid answers from the recalled subgraph. The quality of the answers fed back to the user is low, affecting the user's experience of using the online question-answering system.
[0090] Figure 5 The KBQA scheme shown in its description makes the granularity of FAQ basically consistent by graphing FAQ; when inserting a new standard answer, it is only necessary to establish a triple with other entities and corresponding attributes, which is not only more conducive to the maintenance of FAQ, but also compared with directly comparing the user's questions with the standard question information in the corpus, the accuracy of subgraph recall using the KBQA scheme is higher. However, the KBQA schemes shown above all have the problems of poor versatility, the need to preset different query statement templates for different scenarios, and the high implementation cost due to reliance on NLU for relationship recognition accuracy. In view of this, the method provided in the embodiment of the present application can accurately obtain answers to questions while reducing the amount of template maintenance and subgraph recall costs.
[0091] Before explaining the method provided in the embodiment of the present application in detail, the execution subject of the question-and-answer method is first explained. The question-and-answer method provided in the embodiment of the present application can realize online question-and-answer through an application installed on the system.
[0092] The above applications can be embedded applications (or system applications) installed on electronic devices, or they can be downloadable applications (such as third-party applications). Among them, system applications are applications provided as part of the implementation of electronic devices (such as mobile phones); third-party applications are applications connected through their own Internet protocol multimedia subsystem (IMS).
[0093] The above system includes an electronic device, that is, the electronic device can directly process the first question information to generate a first answer. For example, the electronic device builds a corpus, and when the electronic device receives the first question information, the electronic device searches the corpus for a standard answer related to the first entity of the first question information and matching the first question information. Then the electronic device displays the standard answer as the first answer.
[0094] The above system may also include a server, such as a server constructing a corpus, when the electronic device receives the first question information, the electronic device sends the first question information to the server, and the server searches the corpus for a standard answer related to the first entity of the first question information and matching the first question information. The server then sends the standard answer to the electronic device, and the electronic device displays the standard answer as the first answer.
[0095] The electronic device may be a portable device such as a mobile phone, a tablet computer, a wearable electronic device (such as a watch), or a vehicle-mounted device, an intelligent robot, or a computing device such as a personal computer (PC), a personal digital assistant (PDA), or a netbook. The specific form of the electronic device is not particularly limited in the embodiments of the present application.
[0096] The server may be a server of a manufacturer of an electronic device, and the server may be a cluster or multiple clusters, or may include one or more types of servers. Typically, the server is a server of the maintainer of the knowledge graph.
[0097] The following is an explanation of the system's hardware structure. Figure 6 As shown, the question-answering system 60 includes a processor 61 , a memory 62 , a communication device 63 , and a bus 64 .
[0098] The processor 61 , the memory 62 and the communication device 63 may be connected via a bus 64 .
[0099] The processor 61 is the control center of the question-answering system 60, and can be a general-purpose central processing unit (CPU) or other general-purpose processors, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0100] As an example, the processor 61 may include one or more CPUs, such as Figure 6 CPU 0 and CPU1 are shown in .
[0101] The memory 62 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0102] In a possible implementation, the memory 62 may exist independently of the processor 61. The memory 62 may be connected to the processor 61 via a bus 64 and used to store data, instructions, or program codes. When the processor 61 calls and executes the instructions or program codes stored in the memory 62, the question-and-answer method provided in the embodiment of the present application can be implemented.
[0103] In another possible implementation, the memory 62 may also be integrated with the processor 61 .
[0104] The communication device 63 is used for connecting the question-answering system 60 with other devices (such as a client, a server, etc.) through a communication network, and the communication network may be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication device 63 is specifically used for receiving data or sending data, such as "obtaining the first question information" in the embodiment of the present application.
[0105] When the question-answering system is a computing device (such as a server), the communication device 63 may be a network interface or the like.
[0106] When the question-answering system is a portable device (such as a mobile phone), the communication device 63 may be an antenna, a touch screen, a microphone, a speaker, etc. The touch screen may specifically include a touch panel and a display screen.
[0107] The bus 64 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0108] It should be pointed out that Figure 6 The structure shown in the figure does not constitute a limitation on the question-answering system. Figure 6 In addition to the components shown, the question-answering system may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0109] See also Figure 7 , the question-answering system includes an electronic device and a server, and the electronic device is Figure 7 The mobile phone 700 shown, the server is Figure 7 Taking the server 710 as an example, the software system of the mobile phone 700 and the server 710 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture or a cloud architecture. In the following embodiments, the software architecture of the mobile phone 700 and the server 710 will be mainly illustrated by taking the layered architecture as an example.
[0110] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the software system of the mobile phone 700 may include an application layer, an application framework layer, a system library, and a kernel layer.
[0111] Various applications (application, APP) can be installed in the application layer, such as call, memo, browser, contact and other applications. In the embodiment of the present application, an application supporting online Q&A is also installed in the application layer. For example, applications that provide online customer service such as mobile malls and AlipayTM. The application supporting online Q&A can receive questions input by users (such as the first question information) and display answers to the questions (such as the first answer).
[0112] The application framework layer provides an application programming interface (API) and a programming framework for the application programs of the application layer. In some embodiments, the application framework layer includes a preset API, and the target application calls the preset API to request the server 710 to obtain the answer to the question.
[0113] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0114] The surface manager is used to manage the display subsystem and provide the fusion of two-dimensional and three-dimensional layers for multiple applications.
[0115] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, etc.
[0116] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, layer processing, etc.
[0117] A 2D graphics engine is a drawing engine for 2D drawings.
[0118] The kernel layer is a layer between hardware and software. The kernel layer at least includes a camera driver, an audio driver, etc., and the present application embodiment does not impose any restrictions on this.
[0119] Continue to see Figure 7 The software system of server 710 may include a semantic parsing layer, a KBQA service layer and a data layer.
[0120] The semantic parsing layer includes a semantic parsing engine, which can receive questions from the target application of the mobile phone 700 and perform annotation processing on the questions, such as removing stop words, replacing synonyms, etc.
[0121] The KBQA service layer can query the knowledge graph based on the results of the annotation processing performed by the semantic parsing engine, obtain a subgraph related to the first entity in the question, obtain the first answer matching the question from the answer set in the subgraph, and feed back the first answer to the target application in the mobile phone 700.
[0122] In some embodiments, the KBQA service layer includes a graph construction module, an entity recognition module, a subgraph recall module, and an answer output module. Among them, the graph construction module can construct a first graph based on the question and answer pairs in the corpus, and the standard answers in the first graph are stored in the form of attribute values in the edges or nodes of the graph. The entity recognition module can identify the first entity in the question. The subgraph recall module can recall the subgraph related to the first entity in the first graph. The answer output module can compare the attribute value (i.e., the standard answer) in the subgraph with the user's question for matching, and use the matching standard answer as the first answer to the first question information, and feed it back to the target application in the mobile phone 700.
[0123] The data layer includes a corpus. The corpus is used to store question-answer pairs of common questions exclusive to the 3C field. For example, a standard question information and a standard answer of Honor 60 are stored in the corpus as a question-answer pair. The corpus stores relevant questions and answers in the 3C field in natural language (or unstructured) language. In some embodiments, the question-answer pairs in the corpus can be used to train a matching model, and the matching model obtained by training is used to compare the matching degree of the attribute value (i.e., the standard answer) in the subgraph with the user's question, so as to quickly and accurately return the matching results.
[0124] At this point, it should be noted that the above Figure 7 The division of software functions of server 710 is only exemplary. In actual implementation, functional modules may be added or reduced. For example, a screening module may be added to the KBQA service layer to screen out a target subgraph that only contains paths between multiple first entities from the recalled subgraph when the number of extracted first entities is not unique, thereby reducing the number of attribute values in the subgraph and facilitating the improvement of subsequent matching efficiency. For another example, the semantic parsing layer may be omitted. The embodiments of the present application do not specifically limit this.
[0125] The following will Figure 7 The software architecture of the mobile phone 700 and the server 710 is taken as an example to illustrate the method of the embodiment of the present application.
[0126] The question-answering method provided in the embodiment of the present application includes three parts: constructing a FAQ graph, recalling a subgraph, and outputting answers, which are introduced in turn below.
[0127] like Figure 8 As shown, constructing the FAQ graph includes:
[0128] S801. The server obtains a question-answer pair, where the question-answer pair includes standard question information and a standard answer.
[0129] Question-answer pairs can be obtained from the FAQ corpus. The standard answer in a question-answer pair is the answer to the standard question information in the question-answer pair. For example, the standard question information "CPU model of Honor Band 5" and the standard answer "Apollo3" are a set of question-answer pairs. The standard question information "CPU model of Honor 60" and the standard answer "Apollo3" are not a set of question-answer pairs.
[0130] In some embodiments, the question-answer pair further includes at least one extended question, and the standard answer in the question-answer pair may also be a solution to the extended question in the question-answer pair. For example, the extended question of the standard question information "CPU model of Honor Band 5" may be "What is the processor of Honor Band 5", "Specifications of Honor Band 5 processor", etc. The above questions can all be answered by the standard answer "Apollo3".
[0131] S802: The server identifies the second entity in the standard question information.
[0132] An entity, also called an object, can be an interactive, operable, objective object, concept or virtual object. For example, computers, mobile phones, servers, etc. are objective objects, while virtual objects in the electronic information field such as databases, middleware, and software programs can also be entities. In some embodiments, behaviors, phenomena, etc. can also be entities. In the 3C field, entities include product models, channels, application logos, returns and exchanges, invoicing, and no sound.
[0133] For example, the standard question information is "Honor 60 CPU model", and the server obtains the second entity "Honor 60" from the standard question information. "Honor 60" is a product model. For another example, the standard question information is "How to apply for an electronic invoice for a mobile phone purchased online", and the server obtains the second entity "Issuing an electronic invoice" from the standard question information. "Issuing an electronic invoice" is a behavior. For another example, the standard question information is "Alipay TM The server obtains the second entity "Alipay" from the standard question information. TM ” and “fast power consumption”, among which, “Alipay TM " is an application logo, and "fast power consumption" is a phenomenon.
[0134] In this step, there are many ways to identify the second entity. For example, the server performs word segmentation on the standard question information to obtain multiple phrases. The product model, channel, application identifier, behavior, phenomenon, etc. are used as the second entity; or the subject and object are used as the second entity; or the second entity can be identified by a machine learning algorithm, and this application does not impose any special restrictions on this.
[0135] S803: The server uses the second entity as a node of the first graph.
[0136] The number of second entities in the standard question information may be one or more. When the number of second entities is one, the server creates a node in the first graph to represent the second entity. When the number of second entities is multiple, the server creates nodes in the first graph equal to the number of second entities, where one node represents one second entity.
[0137] S804: The server detects whether the number of the second entity involves multiple ones.
[0138] For example, the standard question information is "CPU model of Honor 60", and the second entity has only one "Honor 60", that is, the standard answer is only related to the second entity "Honor 60", and does not involve other second entities such as "Honor 70" and "Honor Band 5". Therefore, the server needs to detect whether there is only one second entity in the standard question information, so as to determine whether the standard answer corresponding to the standard question information is only related to one second entity.
[0139] Another example is that the standard question information is "Apple TM How to transfer data between 12 and Honor 70”, the second entity includes: Apple TM 12 and Honor 70, that is, the standard answer is related to both of the second entities. Therefore, the server needs to detect whether there are multiple (such as two) second entities in the standard question information, so as to determine whether the standard answer corresponding to the standard question information is related to multiple second entities.
[0140] After the server identifies the second entity and detects the number of the second entities, the server may execute steps S805-S806 below to map the standard answer. For details, please refer to the introduction of S805-S806 below.
[0141] S805. If yes, the server uses the standard answer as the attribute value of the relationship edge between the multiple nodes.
[0142] For example, obtaining standard question information such as "Apple TM How to transfer data between 12 and Honor 70? The corresponding standard answer is "In Apple TM 12 Download the data migration app, open the app, select "This is your old phone"; then TM 12Scan the QR code of Honor 70 and wait for the connection; after the connection is successful, select the option to start the migration to start the data transfer. TM On the relationship edge between the 12 node and the Honor 70 node, query the data transmission attribute and use the standard answer as the attribute value of the data transmission attribute.
[0143] In some embodiments, the attributes and attribute values may be stored in a key-value pair. For example, the data transmission attribute and the standard answer are stored as: "Data transmission": "On Apple TM 12 Download the data migration app, open the app, select "This is your old phone"; then TM 12Scan the QR code of Honor 70 and wait for the connection; after it shows that the connection is successful, select the Start Migration option to start the data transfer.
[0144] S806: If not, the server uses the standard answer as the attribute value of the node.
[0145] For example, the standard question information such as "CPU model of Honor 60" is obtained, and the standard answer "Snapdragon TM778" is obtained. In the Honor 60 node in the first graph, the CPU model attribute is queried, and the standard answer is used as the attribute value of the CPU model attribute. For example, the CPU model attribute and the standard answer are stored as: "CPU model": "Snapdragon TM778".
[0146] It is worth mentioning that, according to the number of second entities, the standard question information can be classified into one-hop questions and two-hop questions. Among them, one-hop questions refer to standard question information involving only one second entity, and the standard answer is stored in an attribute under the node. Two-hop questions refer to standard question information involving the relationship between two entities (or involving multiple entities, where the relationship between entities is between two entities), and the standard answer is stored in an attribute under the edge representing the relationship.
[0147] Furthermore, according to whether the standard answer needs to distinguish multiple situations for answering, the single-hop question and the two-hop question can be further subdivided into "single-hop constrained question", "single-hop unconstrained question", "two-hop constrained question" and "two-hop unconstrained question". Among them, the constraint means that the presentation form of the standard answer does not need to distinguish the situation, and one answer can answer it, so the attribute value can be stored in the form of a string. The unconstrained means that the presentation form of the standard answer needs to be analyzed according to the specific situation, so the attribute value can be stored in the form of a dictionary.
[0148] like Fig. 9 As shown, the standard question information without constraints for a single hop is "CPU model of Honor Band 5", and the standard answer is stored in the "CPU model" attribute of the node, and the "CPU model" attribute and "Apollo3" are stored as a key-value pair, and "Apollo3" is a string.
[0149] The standard query message without constraints for two hops is "Alipay TM The standard answer is stored under the "failure" attribute of the relationship edge, and the "failure" attribute is related to "Alipay TMThe power consumption has increased significantly, you can check first..." Stored in key-value pairs, "Alipay TM The power consumption has increased significantly, you can check first..." is a string.
[0150] The standard question information with constraints for a single hop is "How to apply for an electronic invoice for a mobile phone purchased online?" The standard answer is stored under the "issuance process" attribute of the node, and the "issuance process" attribute and {"online shopping": "...", "offline": "..."} are stored in the form of key-value pairs. {"online shopping": "...", "offline": "..."} includes multiple groups of key-value pairs, such as "online shopping": "..." is one group of key-value pairs, and "offline": "..." is another group of key-value pairs.
[0151] The standard question message with two-hop constraints is "Log in to QQ on both computer and mobile phone at the same time TM ,QQ TM The standard answer is stored under the "failure" attribute of the relationship edge, and the "failure" attribute is related to {"The computer and mobile phone are logged in to QQ at the same time TM ”: “This is QQ TM Self-designed, QQ TM The message will be prompted on the computer, but not on the mobile phone. "Single login": "..."} is stored in key-value pairs, {"Log in to QQ on both the computer and the mobile phone at the same time TM ”: “This is QQ TM Self-designed, QQ TM The message will be prompted on the computer, but not on the mobile phone", "Single login": "..."} contains multiple key-value pairs, such as "Log in to QQ on both the computer and the mobile phone at the same time TM ”: “This is QQ TM Self-designed, QQ TM The message will be prompted on the computer, but not on the mobile phone" is a set of key-value pairs, and "Single login": "..." is another set of key-value pairs.
[0152] In the above example, by decomposing the standard question information into multiple second entities, the granularity of the standard question information is associated with the granularity of the entity. Since the granularity of the entity is relatively consistent, the granularity of the standard question information is also relatively consistent, thereby avoiding the granularity of the standard question information in the FAQ corpus being too coarse or too fine, affecting the granularity of the response and bringing a bad online question-and-answer service experience to users.
[0153] In the method provided in this embodiment, the knowledge graph is not constructed with "entity-relationship-entity" triples, but the second entity of the standard question information in the question-answer pair is used as a node, and the standard answer is used as the attribute value of the node or the attribute value of the edge, so as to construct the first graph. The advantage of only identifying entities during the construction process is that the recognition performance requirements of the algorithm are low, and entity recognition errors are not prone to occur. Compared with constructing a knowledge graph with "entity-relationship-entity" triples, the construction method of this embodiment does not need to identify the relationship between two entities as an attribute relationship, so the graph construction cost is low and it is more conducive to maintenance.
[0154] After constructing the first graph, the server can recall the subgraph related to the first question information according to the first question information input by the user, such as Fig.10 As shown, the recall subgraph includes:
[0155] S1001. A target application in a mobile phone receives first question information.
[0156] Taking the target application as a mobile phone mall, when a user uses the online customer service of the mobile phone mall, Figure 1 The first question information is entered in the text edit box shown, such as "CPU model of Honor 70". Then, the target application responds to the user's operation of confirming the question, such as the mobile phone mall responding to the user's operation of clicking the send button, and the first question information can be received. In addition, the first question information can be displayed in the target application, such as Figure 1 The dialog box shown displays the first question information "CPU model of Honor 70".
[0157] It should be understood that the form of questioning is not limited to text. In some embodiments, questions can also be input in the form of voice, pictures, etc. For example, in the voice assistant application of a mobile phone, a user can input questions in the form of voice.
[0158] S1002: The target application sends a first question message to an entity recognition module in a server.
[0159] The target application may call a preset API to send the first question information to the entity recognition module of the server, so that the entity recognition module can complete the recognition processing of the first question information.
[0160] In some embodiments, the target application sends the first question information to the semantic parsing engine in the server, and the semantic parsing engine performs standard processing on the first question information to obtain a labeling result, and sends the labeling result to the entity recognition module.
[0161] The annotation process may include removing stop words. Stop words refer to words that are widely used but have no practical meaning. Removing stop words from the first question information can avoid interference from stop words in subsequent queries and improve query performance. The annotation process may also include replacing synonyms. When a user enters a question, the words they can think of are very limited, and these words may not necessarily correspond completely to the corresponding entities and / or attributes in the first graph. By replacing synonyms, some words in the first question information can be replaced with their synonyms, and when querying the first graph later, they will not be restricted to the words in the first question information. The annotation process may also include word segmentation processing. Word segmentation processing is to split the first question information expressed in natural language into words to facilitate subsequent entity identification.
[0162] S1003: The entity recognition module recognizes a first entity in the first question information, wherein the first entity matches at least one second entity.
[0163] For the introduction on identifying the first entity, please refer to the above S802, which will not be elaborated here.
[0164] In this step, if the first entity is not included in the standard question information, that is, the first entity does not match any second entity, the entity recognition module sends a second answer to the target application, and the second answer is used to indicate that no information related to the first entity is found in the first graph. Fig.11 As shown in the figure, when the first graph does not contain the Honor 70 node, the "Honor 70" identified by the entity recognition module from the first question information does not match the second entity in the first graph, and the relevant data of the second entity unrelated to Honor 70, such as Honor 60 and Honor 50, will not be fed back to the user to avoid misleading the user. Fig.11 In the question, the target application displays the second answer "The relevant information of the Honor 70's CPU model has not been entered yet" to avoid answering irrelevant questions and causing interference to users.
[0165] In this step, if the first entity is identified and the first entity matches at least one second entity, it means that the standard answer related to the second entity of the first question information may be stored in the first graph, so the server executes the following S1004-S1005 to obtain the standard answer.
[0166] This step does not require sentence component analysis or dependency analysis, and the only NLU task involved is entity recognition, so it is more efficient and has a higher recognition accuracy.
[0167] S1004. The entity recognition module sends the first entity to the sub-graph recall module in the server.
[0168] S1005. The subgraph recall module recalls the subgraph related to the first entity from the first graph.
[0169] Subgraph recall, or outputting the subgraph in the first graph, can be understood as calling out the subgraph from the first graph. The subgraph is a subset of the first graph, in other words, the subgraph is a graph composed of some nodes and edges in the first graph.
[0170] Related to the first entity can be understood as a node corresponding to the first entity and a relationship edge having a connection relationship with the node corresponding to the first entity.
[0171] In some embodiments, a query statement (or recall instruction) can be used to recall the subgraph related to the first entity, and the query statement template is "gV("first entity").bothE().otherV().path()". The template has a first field and a second field, and the first field is used to indicate that the first entity is queried from the first graph, and the second field is used to indicate that the nodes and relationship edges are recalled. In response to the recall instruction, the subgraph recall module can recall the nodes of the second entity that matches the first entity and the relationship edges that have a connection relationship with the nodes from the first graph to obtain the target subgraph. For example, the first question information is "Honor 60's CPU model", and query statement 5 is: gV("Honor 60", "CPU model").bothE().otherV().path(). For another example, the first question information is "Apple TM How to transfer data between 12 and Honor 70", query statement 6 is: gV("Apple TM 12", "Honor 70").bothE().otherV().path(). As shown in Table 1, by comparing query statements 1 to query statements 6, the query statements of the template-based subgraph recall scheme and the subgraph recall scheme based on entity recognition and relationship recognition have poor universality. Different query statements need to be used for different scenarios. The query statement used in this embodiment is a query for the first entity. Therefore, it is only necessary to input the first entity parameter into the same query statement template to convert it into a query statement, which is more efficient and more universal. It also avoids the low subgraph recall rate caused by query statement template matching errors, and can achieve better recall effect.
[0172] Table 1
[0173]
[0174] For example, the first question information is Fig.12 The “CPU model of Honor 60” is shown in the figure. Accordingly, the nodes and edges related to Honor 60 are recalled from the first graph, such as Fig.12 The bold lines in the figure represent the recalled edges or nodes. This step recalls only the data related to Honor 60 from the first graph, so Fig.12 Honor 70, Honor Band 5, AppleTM Entities such as 12 will not be recalled, thus avoiding irrelevant answers due to mismatched entities, thereby improving the subgraph recall rate and subsequent answer accuracy.
[0175] In another exemplary embodiment, the first question information is Fig.13 The "Apple TM 12 and Honor 70 how to transfer data", accordingly, recall the first map with Apple TM 12 related nodes and edges, as well as nodes and edges related to Honor 70, such as Fig.13 The bold lines in the graph represent the recalled edges or nodes. The only nodes recalled from the first graph are those related to apples. TM 12 and Honor 70 related data, so Fig.13 The second entity such as Honor 60 and Honor Band 5 will not be recalled, thereby increasing the recall rate.
[0176] In the aforementioned embodiment, after adopting this method, the recalled subgraph is only the nodes and edges related to the first entity in the first question information, so the first entity in the first question information will not be mismatched as other entities, thereby increasing the probability of recalling the standard answer corresponding to the standard question information that is actually semantically similar to the first question information but has a different expression; and reducing the probability of recalling the standard answer corresponding to the standard question information that is similar in expression to the first question information but has a different semantics.
[0177] After the subgraph is recalled, a variety of matching methods can be used to determine the first answer that matches the first question information as the output, such as the first answer can be determined by matching the attributes (or attribute names) with the first question information in similarity. Exemplarily, the first question information is "CPU model of Honor 60", and the attribute names include "CPU model", "color", "size", etc. Then, "CPU model of Honor 60" and "CPU model", "color", and "size" are matched one by one, and the similarity results are 0.9, 0.4, and 0.4 respectively. The attribute value corresponding to the "CPU model" attribute with high similarity is used as the first answer.
[0178] The disadvantage of this matching method is that if the first question information does not contain a description word similar to the attribute name, the method of determining the first answer based on the similarity matching between the attribute name and the first question information is inaccurate and prone to mismatch.
[0179] For another example, the first answer can be determined by calculating the vector similarity. For example, the first question information is "the price of Honor 60 spare parts", and the first question information is represented as an entity-attribute-attribute value structure, which is Honor 60-spare parts-price. Correspondingly, the attributes and attribute values related to Honor 60 in the first graph are represented as Honor 60-store spare parts price-A yuan, Honor 60-store business hours-9:00, Honor 60-mailing spare parts price-B yuan. The vector similarities of the three vectors {Honor 60, spare parts, price} in the first question information and the vectors of the alternative triples in the first graph {Honor 60, store spare parts price, A yuan}, {Honor 60, store business hours, 9:00}, {Honor 60, mailing spare parts price, B yuan} are calculated respectively, such as calculating the similarity of "spare parts" with "store spare parts price", "store business hours", and "mailing spare parts price". The attribute value of the triple with high similarity is taken as the first answer.
[0180] The disadvantage of this matching method is that it is necessary to convert the entity-relationship-entity or entity-attribute-attribute value in the first graph and the first question information into structured language, which increases the matching cost. Secondly, the accuracy of the matching result depends on the accuracy of the similarity calculation, so the accuracy of the similarity calculation is required to be high. In order to improve the accuracy of the similarity calculation, a large number of samples need to be provided to train the similarity calculation algorithm. Therefore, this matching method is not suitable for use in the cold start phase and has limitations.
[0181] Based on this, the present application embodiment provides a question-answering method, including the above S801-S806, S1001-S1005 and the following Fig.14 The scheme shown.
[0182] like Fig.14 As shown, the output answers include:
[0183] S1401. The sub-graph recall module sends the sub-graph to the screening module in the server.
[0184] S1402: The screening module screens out a target subgraph that only contains paths between a plurality of first entities from the subgraph.
[0185] The path means that the relationship edge is a relationship between multiple first entities, rather than a relationship between the first entity and other entities.
[0186] For example, the first question information is Fig.15 The "Apple TM How to transfer data between 12 and Honor 70", except for Apple TM 12 node attribute values, Honor 70 node attribute values, and Apple TMIn addition to the attribute values between the 12 and Honor 70 paths, it also includes the attribute values between the Honor 70 and Honor 60 paths, the attribute values between the Honor 70 and the power consumption fast path, and the attribute values between the Honor 70 and QQ TM The attribute values between the first and second entities are related to other second entities, and the matching degree with the first question information is low. If they are involved in the matching, it will bring unnecessary computational cost. Therefore, the screening module further screens the edges of the subgraph, removes the path between the first entity and the second entity, and only retains the path between the first entities, thereby reducing the computational cost of subsequent matching. Fig.15 The bold lines in the figure represent the nodes and edges of the target subgraph. It can be seen that compared with the subgraph, the target subgraph involves fewer edges, which is conducive to improving the matching speed.
[0187] S1403. The screening module sends the target subgraph to the answer output module in the server.
[0188] S1404. The answer output module obtains the attribute values in the target subgraph to obtain alternative answers.
[0189] As mentioned above Figure 8 As can be seen from the description, the standard answer in the FAQ question-answer pair is stored under the attributes of the node or the attributes of the edge. Therefore, this step obtains the attribute value corresponding to the attribute of the node and the attribute value corresponding to the attribute of the edge to obtain the alternative answer. Exemplarily, the alternative answer includes standard answer 1, standard answer 2...standard answer n.
[0190] For example, Fig.16 As shown, the attribute values in the target subgraph include: Attribute value 1: In apple TM 12 Download the data migration app, open the app, select "This is your old phone"; then TM 12Scan the QR code of Honor 70 and wait for the connection. After the connection is successful, select the option to start the migration to transfer data. Attribute value 2: Lower the screen refresh rate in the settings of Honor 70. Attribute value 3: Considering that it may be a mobile phone failure, you can apply for warranty in offline malls or online after-sales platforms. Attribute value 4: Apple TM The dimensions of the 12-inch body are 71.5mm (2.82 inches) in width, 146.7mm (5.78 inches) in height, 7.4mm (0.29 inches) in thickness, and a 6.1-inch screen size.
[0191] S1405. The answer output module combines the first question information and each candidate answer to obtain multiple candidate question and answer pairs.
[0192] For example, the first question information and each alternative answer can be concatenated separately, and the string obtained by concatenating the first question information and standard answer 1 can be output as alternative question and answer pair 1, and the string obtained by concatenating the first question information and standard answer 2 can be output as alternative question and answer pair 2... and the string obtained by concatenating the first question information and standard answer n can be output as alternative question and answer pair n.
[0193] Different from the vector similarity calculation mentioned above, the format of the original natural language is not adjusted by combining the first question information and the alternative answers, so the processing volume is small and it is not easy to make mistakes.
[0194] S1406. The answer output module inputs multiple candidate question-answer pairs into the matching model to obtain the matching degree of each candidate question-answer pair output by the matching model.
[0195] The matching model is trained by a text similarity algorithm, which includes but is not limited to bidirectional encoder representation from transformers (BERT), Sentence-BERT (SBERT), and BERT-flow. Taking BERT as an example, the matching model adds a softmax fully connected layer on the basis of BERT to output the matching degree (such as similarity score) of the candidate question and answer pairs. The server concatenates the standard question information and standard answers in the FAQ through the [SEP] operation to obtain candidate sentence pairs as the input of the BERT pre-training model, and also labels each candidate sentence pair, such as the label of standard question information 1 and standard answer 1 is 1, the label of standard question information 1 and standard answer 2 is 0, the label of standard question information 2 and standard answer 1 is 0, etc., and trains BERT to obtain a matching model.
[0196] In the embodiment of the present application, the BERT pre-trained model is used as a skeleton to encode candidate sentence pairs expressed in natural language to obtain sufficient semantic information. After the training is completed, the matching model has the ability to output the matching degree of the candidate question-answer pairs.
[0197] For example, Fig.17 As shown in Figure 1, the standard question information "This is the first sentence" and the standard answer "This is the second sentence" are concatenated through [SEP] and input into the BERT layer to obtain a 10*768 feature matrix, where the first row of the feature matrix is <cls>The feature information of the feature matrix is the feature information of the standard question information, and the 6th row of the feature matrix is <sep>The feature information of the feature matrix is the feature information of the standard answer in rows 7-10. In this feature matrix, H represents the dimension, or it can be understood as the number of model nodes, such as Fig.17 As shown, the number of model nodes H = 768. The higher the number of model nodes, the higher the accuracy of the model, and the more model consumption. N represents the number of phrases. For example, the standard question information "This is the first sentence" contains 4 phrases, so N = 4.
[0198] S1407: The answer output module selects a first answer from multiple candidate answers based on the matching degree.
[0199] In some embodiments, the matching degrees of multiple candidate answers are ranked, and the candidate answer with the highest matching degree is used as the first answer, thereby improving the quality of the first answer.
[0200] In other embodiments, the matching degree of the alternative answers is greater than or equal to a threshold, that is, the answer output module sets a threshold to eliminate alternative answers with a matching degree less than the threshold, and obtains the alternative answer with the highest matching degree from the alternative answers with a matching degree greater than or equal to the threshold as the first answer.
[0201] For example, if the threshold is 0.6, the matching degree of alternative answer 1 is 0.8, and the matching degree of alternative answer 2 is 0.6, the answer output module selects alternative answer 1 with a higher matching degree from alternative answer 1 and alternative answer 2 as the first answer.
[0202] In some embodiments, when the degree of match is less than a threshold, the answer output module may send a third answer to the target application, where the third answer is used to indicate that the degree of match of the candidate answer does not meet a preset condition.
[0203] For example, the threshold is 0.6, the matching degree of alternative answer 2 is 0.5, and the matching degree of alternative answer 2 is 0.3. The answer output module sends the third answer to the target application, and the third answer can be displayed in the dialog box of the target application, such as Fig.18 As shown, the third answer is: Sorry, no relevant information was found. In this embodiment, if no alternative answer with a matching degree that meets the preset conditions is found, no wrong standard answer will be fed back to the user, thereby avoiding misleading the user.
[0204] S1408. The answer output module sends the first answer to the target application in the mobile phone.
[0205] S1409. The target application displays the first answer.
[0206] For example, corresponding Figure 1 The first question information shown is "Honor 70 CPU model", and the answer output module will output the first answer "Snapdragon TM 778G Plus" to the target application, and displays "Snapdragon TM 778GPlus” so that users can obtain product information online.
[0207] The method of this embodiment is used to train a matching model to output the matching degree of alternative question and answer pairs, where the alternative question and answer pairs are a combination of the first question information expressed in natural language and the screened alternative answers. The alternative question and answer pairs are input into the matching model, and the matching degree of each alternative question and answer pair is output. The first answer that matches the first question information is determined based on the matching degree, and then fed back to the user. The matching process does not involve structured processing of the first question information or the alternative answers, thereby improving the matching efficiency. In addition, the training samples used in the training algorithm stage can be directly obtained from the FAQ corpus, and there is no need to structure or segment the training samples, so the number of training samples can be greatly increased, thereby improving the matching accuracy of the matching model.
[0208] In summary, the method provided in the embodiment of the present application can be used to improve the accuracy of the output answers in three aspects: constructing FAQ graphs, recalling subgraphs, and outputting answers. In this method, the standard answers expressed in natural language are used as attribute values of edges or nodes on the FAQ graph (equivalent to the first graph above), thereby avoiding the extraction of relationships between multiple entities, being more efficient, and less prone to errors. After the FAQ graph is constructed, if the user inputs the first question information, the subgraph related to the first entity of the first question information is recalled in the FAQ graph. Since the recalled subgraph only contains the edges and nodes related to the first entity in the first question information, and does not include the second entity that does not match the first entity, the probability of subsequent answer mismatches is greatly reduced. Since the standard answer has been stored as an attribute value before, the standard answer can be obtained from the attribute value of the subgraph, and the first question information and each standard answer are combined into an alternative question and answer pair. By calculating the matching degree of the alternative question and answer pair, it is determined whether the first question information and the alternative answer match, and the first answer matching the first question information is obtained from the alternative answers, and fed back to the user, so that the user can obtain product-related information online. In addition, the end-to-end KBQA solution provided by this method does not require too many samples to train the model, so the cold start cost is low. This method does not rely on complex relationship recognition methods to locate the path, but recalls nodes or edges that are similar in the topological structure and then sorts the answers themselves.
[0209] Some other embodiments of the present application provide an electronic device, which may include: a display screen (such as a touch screen), a memory, and one or more processors. The display screen, the memory, and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can execute the various functions or steps executed by the mobile phone in the above method embodiment. The structure of the electronic device can refer to Figure 6 The structure of the question-answering system 60 is shown.
[0210] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the mobile phone in the above-mentioned method embodiment.
[0211] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step executed by the mobile phone in the above method embodiment.
[0212] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0213] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0214] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0215] In addition, each functional unit in each embodiment of the present application 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0216] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0217] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.< / sep> < / cls>
Claims
1. A question-answering method, characterized in that: Applied to a server and an electronic device, the server pre-sets a plurality of question-answer pairs, each of which includes a standard question information and a corresponding standard answer, and the standard question information includes at least one second entity; The server includes a graph construction module, an entity recognition module, a subgraph recall module and an answer output module; the electronic device includes a target application and a preset API; The target application is an application that supports online question and answer, and the preset API is an interface for the electronic device to communicate with the server; The method comprises: The graph construction module of the server constructs a first graph, including: identifying the second entity in the standard question information in the question-answer pair; taking the second entity as a node, and if the standard question information includes multiple second entities, taking the standard answer corresponding to the standard question information as the attribute value of the relationship edge between the nodes corresponding to the multiple second entities included in the standard question information; if the standard question information has only one second entity, taking the standard answer corresponding to the standard question information as the attribute value of the node corresponding to the second entity included in the standard question information; if the standard answer includes a solution in one case, storing the standard answer in the form of a character string; if the standard answer includes solutions in multiple cases, storing the standard answer in the form of a dictionary; The target application of the electronic device receives first question information, and sends the first question information to the server through the preset API, where the first question information includes a first entity; The entity recognition module of the server obtains the first question information, identifies a first entity in the first question information, and sends the first entity to the subgraph recall module of the server; The subgraph recall module of the server recalls the target subgraph corresponding to the first entity from the first graph, including: if the subgraph recall module determines that the first entity matches at least one of the second entities in the first graph, when the first entity includes multiple entities, recalling from the first graph at least one node corresponding to the second entity that matches each entity, and a relationship edge that has a connection relationship with the node corresponding to the at least one second entity that matches each entity; determining, from the nodes corresponding to the at least one second entity that matches each entity and the relationship edges, a relationship edge that has a connection relationship between the node corresponding to the at least one second entity that matches each entity and the node corresponding to the second entity that only matches the first entity, to obtain the target subgraph; The subgraph recall module of the server sends the target subgraph to the answer output module of the server; The answer output module of the server obtains the attribute values of the nodes and the attribute values of the relationship edges of the target subgraph as candidate answers, and determines a first answer whose matching degree with the first question information satisfies a preset condition among the candidate answers; The answer output module of the server sends the first answer to the target application of the electronic device through the preset API of the electronic device.
2. The method according to claim 1, characterized in that The step of determining a first answer from the candidate answers whose matching degree with the first question information satisfies a preset condition comprises: The answer output module combines the first question information and each of the candidate answers to obtain a plurality of candidate question-answer pairs; The answer output module compares the candidate question-answer pairs with the standard question-answer pairs to obtain similarity information of each candidate question-answer pair, wherein the standard question-answer pair is obtained by combining the candidate answers and the standard questions corresponding to the candidate answers; The answer output module determines the similarity between the candidate question-answer pair and the standard question-answer pair based on the similarity information; The answer output module obtains, as the first answer, an alternative answer from the alternative question and answer pair whose similarity with the standard question and answer pair meets the preset condition.
3. The method according to claim 2, characterized in that The preset condition includes: the similarity with the standard question-answer pair is the highest, or the preset condition also includes: the similarity with the standard question-answer pair is greater than a threshold.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: If the entity recognition module determines that the first entity does not match any of the second entities, a second answer is generated, wherein the second answer indicates that no standard answer related to the first entity is matched.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: If the answer output module determines that the matching degree between the candidate answer and the first question information does not meet a preset condition, a third answer is generated, wherein the third answer indicates that a standard answer related to the first question information is not matched.
6. A question-answering method, characterized in that: Applied to an electronic device and a server, the electronic device includes a target application and a preset API, the target application is an application supporting online question and answer, and the preset API is an interface for the electronic device to communicate with the server; The method comprises: The target application of the electronic device receives first question information, where the first question information includes a first entity; The target application sends the first question information to the server through the preset API; The server sends the first answer to the target application of the electronic device through a preset API of the electronic device when the first entity matches with at least one second entity in the first graph and the matching degree between the standard answer corresponding to the at least one standard question information and the first question information meets a preset condition; The electronic device displays a first answer, where the first answer is a standard answer corresponding to the standard question information containing the first entity in a plurality of preset question-answer pairs, and a matching degree between the first answer and the first question information satisfies a preset condition; The server presets multiple groups of question-answer pairs, each group of the question-answer pairs includes a standard question information and a corresponding standard answer, and the server constructs the first graph, including: identifying the second entity in the standard question information in the question-answer pair; taking the second entity as a node, if the standard question information includes multiple second entities, taking the standard answer corresponding to the standard question information as the attribute value of the relationship edge between the nodes corresponding to the multiple second entities included in the standard question information; if the standard question information has only one second entity, taking the standard answer corresponding to the standard question information as the attribute value of the node corresponding to the second entity included in the standard question information; if the standard answer includes a solution for one case, storing the standard answer in the form of a character string; if the standard answer includes solutions for multiple cases, storing the standard answer in the form of a dictionary; Among them, the server determines the first answer from the alternative answers whose matching degree with the first question information meets the preset conditions; the process of determining the alternative answers includes: the server identifies the first entity in the first question information, and if it is determined that the first entity matches at least one of the second entities in the first graph, when the first entity includes multiple entities, recalls from the first graph the nodes corresponding to at least one of the second entities that matches each entity, and the relationship edges that have a connection relationship with the nodes corresponding to at least one of the second entities that matches each entity; determines from the nodes corresponding to at least one of the second entities that matches each entity and the relationship edges, the relationship edges that have a connection relationship between the nodes corresponding to at least one of the second entities that matches each entity and the nodes corresponding to the second entities that only match the first entity, to obtain a target subgraph; obtains the attribute values of the nodes of the target subgraph and the attribute values of the relationship edges as the alternative answers.
7. The method according to claim 6, characterized in that The method further comprises: If the server determines that the first entity does not match any of the second entities, sending a second answer to the target application of the electronic device; The electronic device displays the second answer, where the second answer indicates that no standard answer related to the first entity is matched.
8. The method according to claim 6 or 7, characterized in that: The method further comprises: If the server determines that the matching degree between the candidate answer and the first question information does not meet a preset condition, sending a third answer to the target application of the electronic device; The electronic device displays the third answer, where the third answer indicates that no standard answer related to the first question information is matched.
9. A question-answering device, characterized in that: The question-and-answer device includes a memory and one or more processors, and the memory is coupled to the processor; wherein the memory stores computer program code, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the question-and-answer device executes the method as described in any one of claims 1-8.
10. A question-answering system, characterized in that: The question-answering system comprises a server and an electronic device, and the server and the electronic device execute the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on the electronic device, cause the electronic device to execute the method according to any one of claims 1 to 8.
