Question and answer method, device and storage medium

Through the combination of the intention recognition model and historical question-and-answer, the knowledge graph interface is determined, which solves the problem of insufficient ability to understand the input semantics of the knowledge graph during the question-and-answer process, and improves the accuracy of the answer.

CN118690006BActive Publication Date: 2024-11-29ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411200806.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-11-29
Estimated Expiration
2044-08-29

AI Technical Summary

Technical Problem

The existing knowledge graph has limited ability to understand input semantics during the Q&A process, which leads to the inability to accurately identify the Q&A intention, which in turn affects the accuracy of the answer, especially when calling the knowledge graph interface in a chat scenario or in a non-chat scenario.

Method used

The intent recognition model is used to process the input problem, determine its intent, and determine the knowledge graph interface related to the current question based on the intent and historical question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and-answer question-and

Benefits of technology

By combining the intent recognition model and multiple historical question and answers, the call accuracy of the knowledge graph interface is improved, making the answer more accurate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690006B_ABST
    Figure CN118690006B_ABST
Patent Text Reader

Abstract

The present application discloses a question-and-answer method, device, and storage medium. The question-and-answer method includes: obtaining the current question input; processing the current question using an intent recognition model to obtain the intent of the current question, where the intent is a knowledge graph interface call or small talk; responding to the intent of the question being a knowledge graph interface call, determining the knowledge graph interface related to the current question based on several historical questions and answers corresponding to the intent, where different knowledge graph interfaces have different corresponding functions; calling the knowledge graph interface related to the current question to generate an answer to the current question. The above scheme can improve the accuracy of answering questions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a question-answering method, device, and storage medium. Background Art

[0002] At this stage, the rapid development of digitalization in all walks of life in society has resulted in an unprecedented amount of data, which has far exceeded the processing capabilities of existing traditional computer technology and information systems. In addition, there are a large number of isolated and heterogeneous data between data, and there is a lack of efficient processing, storage and computing methods, making it impossible to truly mine the value of data. Knowledge graphs organically organize fragmented data by establishing connections between data, making data easier to understand and process, and facilitating upper-level applications such as search, mining and analysis.

[0003] However, a simple knowledge graph has limited ability to understand the input semantics, which makes it impossible to identify question-answering intentions or needs, and ultimately leads to inaccurate answers. For example, if the current question-answering scenario is just chatting, no matter which interface in the knowledge graph is called after semantic analysis of the chat content, a relatively accurate output cannot be obtained; or the current question-answering is not chatting, but the knowledge graph has limited ability to understand the input semantics, and the knowledge graph interface cannot be accurately called, resulting in inaccurate output results. Summary of the invention

[0004] This application at least provides a question-answering method, device, and storage medium.

[0005] The present application provides a question-and-answer method, including: obtaining a current question as input; processing the current question using an intent recognition model to obtain the intent of the current question, where the intent is a knowledge graph interface call or small talk; in response to the intent of the question being a knowledge graph interface call, determining a knowledge graph interface related to the current question based on a number of historical questions and answers corresponding to the intent; and calling the knowledge graph interface related to the current question to generate an answer to the current question, where different knowledge graph interfaces correspond to different functions.

[0006] The present application provides a question-and-answer device, including: a question acquisition module, an intention recognition module, an interface determination module and an answer generation module; the question acquisition module is used to obtain the current question input; the intention recognition module is used to process the current question using an intention recognition model to obtain the intention of the current question, where the intention is a knowledge graph interface call or chatting; the interface determination module is used to respond to the intention of the question being a knowledge graph interface call, and determine the knowledge graph interface related to the current question based on several historical questions and answers corresponding to the intention, wherein different knowledge graph interfaces correspond to different functions; the answer generation module is used to call the knowledge graph interface related to the current question to generate an answer to the current question.

[0007] The present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned question-and-answer method.

[0008] The present application provides a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, the above-mentioned question-and-answer method is implemented.

[0009] In the above scheme, after obtaining the input current question, the current question is first processed according to the trained intent recognition model to obtain the intent of the current question. If the intent of the current question is to call the knowledge graph interface, the knowledge graph interface corresponding to the current question can be first determined based on several historical questions and answers related to the intent, and then the interface related to the current question is called to generate the answer to the current question. That is, compared with the simple use of the knowledge graph, combining the intent recognition model, multiple historical questions and answers, and the knowledge graph in the question and answer process can make the call to the knowledge graph interface more accurate.

[0010] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0012] Figure 1 It is a flowchart of an embodiment of the question-answering method of the present application;

[0013] Figure 2 yes Figure 1 Schematic diagram of the sub-process of step S12;

[0014] Figure 3 It is another flow chart showing an embodiment of the question-answering method of the present application;

[0015] Figure 4 yes Figure 3 Schematic diagram of the sub-process of step S22;

[0016] Figure 5 yes Figure 3 Schematic diagram of the sub-process of step S23;

[0017] Figure 6 It is a schematic diagram of an interactive interface shown in an embodiment of the question-answering method of the present application;

[0018] Figure 7 It is a structural diagram of an embodiment of the question-answering device of the present application;

[0019] Figure 8 It is a structural schematic diagram of an embodiment of the electronic device of the present application;

[0020] Fig. 9 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0021] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0022] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0023] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0024] In the present application, the execution subject for implementing the question-answering method described in the present application may be a question-answering device, an electronic device, etc. For example, the question-answering device may be set in a terminal device or a server or other processing device, wherein the terminal device may be a security inspection device, an electronic device, a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the question-answering method may be implemented by a processor calling a computer-readable instruction stored in a memory.

[0025] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the question-answering method of this application. Figure 1 As shown, the question-answering method provided by the embodiment of the present disclosure may include the following steps:

[0026] Step S11: Get the input current question.

[0027] Exemplarily, the execution device may include a question input interface, through which the input current question may be obtained. For example, a question input box may be set on the display interface of the execution subject, and the question input box may serve as the question input interface.

[0028] Step S12: Use the intention recognition model to process the current question and obtain the intention of the current question.

[0029] Among them, the specific way for the intent recognition model to process the current question can be: the current question is used as the input of the intent recognition model, and the output of the intent recognition model is the intent of the current question, that is, the intent recognition model can be an end-to-end classification model, and through pre-training, the intent recognition model can obtain the intent corresponding to the question based on the input question. Or the specific way for the intent recognition model to process the current question can be: the intent recognition model determines the similarity between the current question and historical questions and answers, and uses the intent corresponding to the historical question and answer with the highest similarity as the intent of the current question. There are many ways for the intent recognition model to recognize the intent of the current question, which are not specifically limited here.

[0030] The intent is a knowledge graph interface call or small talk. Optionally, the knowledge graph can be constructed based on data within a preset field. If the current question input is related to the preset field, the intent may be a knowledge graph interface call. If the question input is not related to the preset field, the intent may be small talk. For example, if the knowledge graph is a relationship graph constructed for the panda family, and if the current question input is "Please expand the first-degree relationship of panda a", it is obvious that in order to obtain the first-degree relationship of panda a, it is necessary to call the knowledge graph interface to implement it. The intent of the current question obtained by the intent recognition model is a knowledge graph interface call. If the current question input is "What do pandas generally eat", it is obvious that this question has nothing to do with the relationship between pandas, and even if the knowledge graph interface is called, it cannot be answered. The intent of the current question obtained by the intent recognition model is small talk.

[0031] Step S13: In response to the knowledge graph interface call of the question intent, determine the knowledge graph interface related to the current question based on several historical questions and answers corresponding to the intent.

[0032] Optionally, the number of knowledge graph interfaces may include multiple. Different knowledge graph interfaces correspond to different functions. For example, the function of a certain knowledge graph interface is a retrieval function, and the function of another knowledge graph interface is a relationship identification function. Optionally, different knowledge graph interfaces may correspond to one knowledge graph. In other embodiments, a corresponding knowledge graph may be selected from multiple knowledge graphs in response to the intention of the question, and a corresponding knowledge graph interface may be selected from multiple knowledge graph interfaces. The contents recorded in different knowledge graphs are different, for example, one of the knowledge graphs records the relationship between multiple pandas, and another knowledge graph records the relationship between multiple monkeys. Each knowledge graph may correspond to multiple knowledge graph interfaces with different functions. Among them, the number of knowledge graph interfaces related to the current question may be one or more, for example, the current question is "Please expand the first-degree relationship of panda a, and help me retrieve the name of panda b's mother", wherein "Please expand the first-degree relationship of panda a" may correspond to one knowledge graph interface, and "Help me retrieve the name of panda b's mother" may correspond to one knowledge graph interface.

[0033] The method of determining the knowledge graph interface related to the current question based on several historical questions and answers can be to select the knowledge graph interface related to the current question from the knowledge graph interfaces used by the historical questions and answers, or to adjust the current question using the historical questions and answers, and determine the corresponding knowledge graph interface using the adjusted question. For example, the information carried in each historical question and answer enriches the current question, so that the current question can carry more information, thereby making the knowledge graph interface determined according to the adjusted question more accurate.

[0034] Step S14: Call the knowledge graph interface related to the current question to generate an answer to the current question.

[0035] In some embodiments, in response to the intention of the question being small talk, the knowledge graph interface is not called, and the answer to the current question is directly generated by the question-answering model.

[0036] In some application scenarios, the knowledge graph interface can be called by the question-answering model, or by the processor in the question-answering device. Exemplarily, the question-answering model can determine the knowledge graph interface that needs to be called based on the current question. Among them, the result output by the knowledge graph interface can be directly used as the answer to the current question, or the question-answering model can also combine the output result of the knowledge graph interface with the current question as the answer to the current question, that is, the answer to the current question will carry some information in the current question. For example, if the current question is "Help me retrieve the name of Panda B's mother", the answer can be "Panda B's mother's name is Panda C" or directly return "Panda C".

[0037] In the above scheme, after obtaining the input current question, the current question is first processed according to the trained intent recognition model to obtain the intent of the current question. If the intent of the current question is to call the knowledge graph interface, the knowledge graph interface corresponding to the current question can be first determined based on several historical questions and answers related to the intent, and then the interface related to the current question is called to generate the answer to the current question. That is, compared with the simple use of the knowledge graph, combining the intent recognition model, multiple historical questions and answers, and the knowledge graph in the question and answer process can make the call to the knowledge graph interface more accurate.

[0038] In some embodiments, the intent recognition model includes a similarity matching sub-model and an intent recognition sub-model. Figure 2 , the above step S12 may include the following steps:

[0039] Step S121: Determine the second similarity between the current question and the plurality of sample data using the similarity matching sub-model.

[0040] The similarity matching sub-model can be a text semantic vector similarity model, such as the M3E (Moka Massive MixedEmbedding) model, which calculates the similarity after vectorizing the current question. Each sample data has a corresponding relationship with the knowledge graph interface call or the chat. Exemplarily, in some application scenarios, the sample data can be predefined data, and in some application scenarios, the predefined data can be data related to the field in which the knowledge graph is located, such as data related to the panda relationship field. In some application scenarios, each predefined data can be a word and / or question and answer related to each knowledge graph interface, or can also include words and / or questions and answers related to chat, for example, the knowledge graph interface includes super search, relationship collision, relationship expansion and gang mining, and the words related to each knowledge graph interface can include: retrieval, expansion, mining, relationship expansion, relationship identification, identification relationship, relationship determination, determination relationship, etc. There is a corresponding relationship between the words related to the knowledge graph interface and the knowledge graph interface call. The words related to the chat can be any words that are not related to the knowledge graph interface. Among them, the predefined data can be trained according to the customized scenario, that is, the predefined data is adjusted through the loss between the output of the intent recognition sub-model and the annotation result. In some application scenarios, the sample data can be historical questions and answers, that is, the historical questions and historical answers are collected to obtain sample data. That is, after answering the question, the correspondence between each historical question and answer and the intent can be recorded.

[0041] Step S122: determining a set of sample data from the plurality of sample data according to the magnitudes of the second similarities.

[0042] For example, the similarity matching sub-model can return the top K results that are most similar to the current question, and output the second similarity corresponding to the K results. In some application scenarios, the results with similarity higher than the preset similarity threshold can be selected from the K results to form a sample data group. In some application scenarios, considering that the output results may not all be positive sample data, and there may also be negative sample data, the K output results can be subjected to outlier detection to obtain a sample data group. The purpose of outlier detection is to remove sample data with unreasonable second similarity. Taking K as 5 as an example, if the second similarity is lower than the similarity mean of 0.1, it is identified as an outlier and filtered. The similarity mean can be obtained from the second similarity of the K results. For example, the sample similarities of the top 5 are as follows: [0.91, 0.91, 0.90, 0.89, 0.74], where the similarity of the last sample data is 0.74, which is quite different from the similarity of other sample data. The sample data is very likely to be a negative sample. If the sample data is added to the sample data group, it is likely to affect the generated results, so it needs to be removed.

[0043] Step S123: Determine prompt words based on the sample data set.

[0044] Generally speaking, the similarity between the first four sample data and the current sample data is close to 0.9, and one of them can be randomly selected to fill the prompt frame to obtain a prompt word. The intention obtained based on the prompt word is relatively accurate. Alternatively, each sample data in the sample data group can be filled into the prompt frame to obtain a prompt word. That is, one or more sample data in the sample data is used as a small sample, and the generated small sample is filled into the prompt text (prompt).

[0045] Step S124: Use the prompt word as the input of the intention recognition sub-model to obtain the intention of the current question.

[0046] The intent recognition sub-model can be a large model. The intent recognition sub-model is trained in advance so that the trained intent recognition sub-model can be an end-to-end model, that is, after the prompt word is input, the intent of the current question can be output.

[0047] As mentioned above, the knowledge graph interface can include super search, relationship collision, relationship expansion and gang mining. Different knowledge graph interfaces have different corresponding functions. For example, super search: It is mainly used for searching and querying content, which can help the query determine clear objects. Given unclear information, after passing through the system, a certain result is obtained, including various specific condition searches, fuzzy condition searches, relationship searches, etc. The input is a text in natural language form. At present, the main function is to solve the search scenarios related to entities such as target objects, vehicles, places, events, relationships, numbers, etc. The target object can be any entity, such as the above-mentioned panda. Relationship collision: Perform relationship collision on the specified target object entity list to identify the relationship between the target objects. Relationship expansion: Expand all first-degree relationships of the specified entity, that is, starting from the specified entity, find first-degree relationships and related entities. Gang mining: Perform gang analysis on the specified target object entity list to identify potential gangs, such as identifying whether the pandas in the list are from the same family or in the same region.

[0048] Among them, see Figure 3 The above step S13 specifically determines which knowledge graph interface to call, which may include the following steps:

[0049] Step S21: Select several historical questions and answers corresponding to the intention from multiple historical questions and answers.

[0050] Each historical question and answer includes historical questions and historical answers corresponding to the historical questions. In some application scenarios, the questions and answers input in each round, as well as the intention of the questions, are stored in the database. If the number of historical questions and answers to be selected is N, it means that after the intention is determined, the database is directly called to return the first N rounds of questions and answers that meet the current intention. Optionally, if the intention of the current question is to chat, several historical questions and answers corresponding to the intention can be selected from multiple historical questions and answers, and then the answer to the current question can be determined by combining the historical questions and answers. For example, the answer to the current question can be generated by considering the context of the question and answer and finding the most recent N rounds of questions and answers with the intention of chatting from the database. If the intention of the current question is to call the knowledge graph interface, the most recent N rounds of questions and answers with the intention of calling the knowledge graph interface are found from the database.

[0051] Step S22: Determine at least one reference question and answer based on the first similarity between the current question and the selected historical questions and answers.

[0052] The question-answer model may include a semantic similarity sub-model, and the structure of the semantic similarity sub-model may be the same as or different from the similarity matching sub-model. The semantic similarity sub-model determines the similarity between the current question and the historical questions and answers, and obtains the first similarity between the current question and each historical question and answer.

[0053] Optionally, see Figure 4 , step S22 may include the following steps:

[0054] Step S221: Based on each first similarity, a preset number of historical questions and answers are selected from a number of historical questions and answers as candidate questions and answers.

[0055] For example, according to the level of the first similarity, a preset number of historical questions and answers with higher first similarities may be selected in sequence as candidate questions and answers.

[0056] Step S222: determining outlier candidate questions and answers from the candidate questions and answers according to the first similarities corresponding to the candidate questions and answers.

[0057] The method of determining outlier candidate questions and answers may be to perform outlier detection on each candidate question and answer, and the purpose of performing outlier detection is to remove candidate questions and answers with unreasonable first similarities. For example, the preset number may be 5, and the first similarity is lower than the similarity mean of 0.1, then the candidate question and answer is identified as an outlier and filtered, and the similarity mean may be obtained from the preset number of first similarities.

[0058] Step S223: taking the other candidate questions and answers except the outlier candidate questions and answers as reference questions and answers.

[0059] If the number of outlier candidate questions and answers is 1, the number of reference questions and answers is the preset number minus 1.

[0060] Step S23: Determine a knowledge graph interface related to the current question in combination with the current question and at least one reference question and answer.

[0061] In some application scenarios, at least one reference question and answer can be used to enrich the content of the current question, and then the corresponding knowledge graph interface can be determined using the enriched current question. Content enrichment can be considered as adding the entity's restricted information to the current question if the same entity is not restricted in the current question but has restricted information in the reference question and answer. In other words, if the entity in the current question does not consider the context, the entity may have more than one explanation, but after considering the context, it can have a unique explanation or a more accurate explanation, making the subsequent answer more accurate.

[0062] Optionally, see Figure 5 , step S23 may include the following steps:

[0063] Step S231: Use at least one reference question and answer to perform entity disambiguation on the current question to obtain identification information of at least some entities in the current question.

[0064] The specific entity disambiguation method can be: extract information from the current question, extract the identity of the target object in the text, such as name, identification number, affiliated unit, etc. For example, for a panda, the name can be Panda A, the identification number can be Panda A's ID number, and the affiliated unit can be the panda house or zoo where Panda A is located. Match the extracted name, identification number, and affiliated unit with the information in each reference question and answer, and return the identification information of at least part of the matched entity. The identification information can be identity information, such as the above-mentioned name, identification number or affiliated unit, etc. Map the entity in the current question (for example, target object, car) to the corresponding unique identifier. The unique identifier of the target object is the identification number, and the unique identifier of the car is the license plate number.

[0065] Step S232: Use the identification information of at least part of the entity obtained by entity disambiguation to modify the current question to obtain the target question.

[0066] The target question includes identification information of at least some entities. After entity disambiguation, the input current question is modified to add the mapped identification number, license plate number, etc. Exemplarily, the identification information of at least some of the returned entities is added after the corresponding entity in the current question. For example, if the current question is: "Help me expand the first-degree relationship of panda a?", the identification number of panda a after matching is "33010121", and after replacement, it is "Help me expand the first-degree relationship of panda a (identification number: 33010121)". Since the input of some interfaces needs to specify a clear target object, the input can be modified according to the result after disambiguation.

[0067] Step S233: Based on the target problem, determine the knowledge graph interface related to the current problem.

[0068] Specifically, the corresponding knowledge graph interface can be selected according to the question-answering model, or an interface determination model with a question as input and a knowledge graph interface as output can be pre-selected and trained, so as to directly use the interface determination model to determine the knowledge graph interface related to the current question.

[0069] Among them, the implementation method of step S233 can be: taking the target question as the input of the question-answering model, and obtaining the calling result output by the question-answering model, the calling result includes the knowledge graph interface and interface parameters related to the current question, and the interface parameters are extracted from the target question. Exemplarily, the question-answering model includes an interface selection sub-model, which can be obtained by fine-tuning the large model according to the domain. The input of the interface selection sub-model is the target question, and the output is the calling result. On this basis, the above step S13 may include the following steps: taking the interface parameters as the input of the knowledge graph interface, and obtaining the output data of the knowledge graph interface. The question-answering model generates an answer to the current question based on the output data.

[0070] In some application scenarios, the results output by the knowledge graph interface can be cached. For example, the main cached contents are as follows: ["Current question", "Intent", "Called interface", "Interface parameters", "Results of interface output"].

[0071] In some embodiments, the question-answering method may further include the following steps: in response to the knowledge graph interface not obtaining output data, based on the target question, determining a new knowledge graph interface related to the current question, and then calling the new knowledge graph interface to generate an answer to the current question.

[0072] Exemplarily, the knowledge graph interface uses the question-and-answer model or the above-mentioned interface to determine the result of the model interface call, executes the interface call, and determines whether the interface call is successful based on the return status. If the interface call is successful, the call result is cached. If the interface call fails, execute the above-mentioned step S233, let the question-and-answer model or the above-mentioned interface determination model reselect the interface, and then execute again. If the number of iterations reaches the maximum number, the call failure is returned. If the maximum number is 4, that is, after the question-and-answer model or the above-mentioned interface determination model reselects the interface 3 times, the interface still fails to call, then the answer to this question and answer can be a preset answer, such as "I don't understand, please re-enter".

[0073] In some embodiments, the current question includes a query question about the relationship between the target object and several other objects, and the answer includes information about the relationship between the target object and the several other objects. The question-answering method may also include the following steps: generating a relationship canvas between the target object and the several other objects based on the relationship information. Displaying the relationship canvas in a preset display area.

[0074] In some application scenarios, canvas calls can be classified and replied according to the intent, mainly divided into "knowledge graph interface call" and "chat". If the intent is "chat", the canvas call will not be executed. If the intent is "knowledge graph interface call", the canvas will be called and displayed according to the interface call result. If the interface call fails, the canvas call will not be executed. If the interface call succeeds, the interface call result will be displayed in the canvas to achieve a linkage effect.

[0075] For the specific interactive interface, please refer to Figure 6 As shown in the figure, the left column is the "knowledge graph agent", which can be considered as an application, which includes a similarity matching model and a question-answering model. It can call various functional interfaces inside the knowledge graph and generate replies based on the current question input. The right side is the "knowledge graph relationship canvas", which is controlled by the "knowledge graph agent". According to the current question input, the agent calls the internal interface of the knowledge graph, generates an answer on the left, and changes the canvas on the right, thereby achieving a linkage effect between the answer and the canvas. Figure 6As shown, historical questions and answers can also be displayed on the display interface.

[0076] This solution combines the intelligent agent of the big model with the knowledge graph application system, and proposes a knowledge graph intelligent agent based on the big model. It can understand the intention of the input question and automatically call the functional interface plug-in of the knowledge graph system. It can not only generate anthropomorphic answers, but also display the results on the canvas, achieving the linkage effect of the entire system.

[0077] Furthermore, the dynamic prompt technology of the knowledge graph agent is optimized, and the prompt can be dynamically filled with small samples according to the user's input. When filling the small samples, the outlier sample analysis technology is used to eliminate outlier samples, so that the semantics of the filled small samples are similar to the current input question, thereby improving the accuracy of intent recognition and tool selection.

[0078] In the above scheme, after obtaining the input current question, the current question is first processed according to the trained intent recognition model to obtain the intent of the current question. If the intent of the current question requires calling the knowledge graph interface, the question and answer model will call the interface related to the current question to generate an answer to the current question. That is, compared with simply using the knowledge graph, combining the intent recognition model, the question and answer model and the knowledge graph in the question and answer process can make the call to the knowledge graph interface more accurate.

[0079] See also Figure 7 , Figure 7 It is a structural diagram of an embodiment of the question-answering device of the present application. The question-answering device 30 can execute the above-mentioned question-answering method. The question-answering device 30 includes a question acquisition module 31, an intention recognition module 32, an interface determination module 33 and an answer generation module 34; the question acquisition module 31 is used to obtain the input current question; the intention recognition module 32 is used to process the current question using the intention recognition model to obtain the intention of the current question, and the intention is a knowledge graph interface call or chatting; the interface determination module 33 is used to respond to the intention of the question as a knowledge graph interface call, and determine the knowledge graph interface related to the current question based on several historical questions and answers corresponding to the intention, wherein different knowledge graph interfaces correspond to different functions; the answer generation module 34 is used to call the knowledge graph interface related to the current question to generate an answer to the current question.

[0080] In the above scheme, after obtaining the input current question, the current question is first processed according to the trained intent recognition model to obtain the intent of the current question. If the intent of the current question is to call the knowledge graph interface, the knowledge graph interface corresponding to the current question can be first determined based on several historical questions and answers related to the intent, and then the interface related to the current question is called to generate the answer to the current question. That is, compared with the simple use of the knowledge graph, combining the intent recognition model, multiple historical questions and answers, and the knowledge graph in the question and answer process can make the call to the knowledge graph interface more accurate.

[0081] Among them, the functions of each module can be found in the description of the question-and-answer method embodiment, and will not be repeated here.

[0082] See also Figure 8 , Figure 8 4 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 40 includes a memory 41 and a processor 42, and the processor 42 is used to execute program instructions stored in the memory 41 to implement the steps in any of the above-mentioned question-answering method embodiments. In a specific implementation scenario, the electronic device 40 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 40 may also include a carrier device such as a laptop computer and a tablet computer, which is not limited here.

[0083] Specifically, the processor 42 is used to control itself and the memory 41 to implement the steps in any of the above-mentioned question-answer method embodiments. The processor 42 can also be called a CPU (Central Processing Unit). The processor 42 may be an integrated circuit chip with signal processing capabilities. The processor 42 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 42 can be implemented by an integrated circuit chip.

[0084] In the above scheme, after obtaining the input current question, the current question is first processed according to the trained intent recognition model to obtain the intent of the current question. If the intent of the current question is to call the knowledge graph interface, the knowledge graph interface corresponding to the current question can be first determined based on several historical questions and answers related to the intent, and then the interface related to the current question is called to generate the answer to the current question. That is, compared with the simple use of the knowledge graph, combining the intent recognition model, multiple historical questions and answers, and the knowledge graph in the question and answer process can make the call to the knowledge graph interface more accurate.

[0085] See also Fig. 9 , Fig. 9 The computer-readable storage medium 50 stores program instructions 51, which implement the steps in any of the above-mentioned question-answering method embodiments when executed by a processor.

[0086] In the above scheme, after obtaining the input current question, the current question is first processed according to the trained intent recognition model to obtain the intent of the current question. If the intent of the current question is to call the knowledge graph interface, the knowledge graph interface corresponding to the current question can be first determined based on several historical questions and answers related to the intent, and then the interface related to the current question is called to generate the answer to the current question. That is, compared with the simple use of the knowledge graph, combining the intent recognition model, multiple historical questions and answers, and the knowledge graph in the question and answer process can make the call to the knowledge graph interface more accurate.

[0087] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0088] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0089] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed. In another image position, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0090] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. 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 computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

Claims

1. A question-answering method, characterized in that: include: Get the current question for input; The current question is processed using an intent recognition model to obtain the intent of the current question, where the intent is a knowledge graph interface call or small talk; In response to the intention of the question being a call to the knowledge graph interface, determining a knowledge graph interface related to the current question based on a number of historical questions and answers corresponding to the intention, wherein different knowledge graph interfaces correspond to different functions; Calling a knowledge graph interface related to the current question to generate an answer to the current question; The determining of a knowledge graph interface related to the current question based on a plurality of historical questions and answers corresponding to the intention includes: Select a knowledge graph interface related to the current question from the knowledge graph interfaces used by the historical questions and answers, or use the historical questions and answers to adjust the current question, and use the adjusted current question to determine the corresponding knowledge graph interface.

2. The method according to claim 1, characterized in that The determining of a knowledge graph interface related to the current question based on a plurality of historical questions and answers corresponding to the intention includes: Selecting the plurality of historical questions and answers corresponding to the intention from a plurality of historical questions and answers, each of the historical questions and answers comprising a historical question and a historical answer corresponding to the historical question; Determining at least one reference question and answer according to a first similarity between the current question and each of the selected historical questions and answers; In combination with the current question and the at least one reference question and answer, a knowledge graph interface related to the current question is determined.

3. The method according to claim 2, characterized in that The step of combining the current question and the at least one reference question and answer to determine a knowledge graph interface related to the current question includes: Using the at least one reference question and answer, perform entity disambiguation on the current question to obtain identification information of at least some entities in the current question; Using identification information of at least part of the entities obtained by entity disambiguation, modifying the current question to obtain a target question, wherein the target question includes identification information of at least part of the entities; Based on the target problem, determine a knowledge graph interface related to the current problem.

4. The method according to claim 3, characterized in that The step of determining a knowledge graph interface related to the current problem based on the target problem includes: Taking the target question as the input of the question-answering model, obtaining a call result output by the question-answering model, wherein the call result includes the knowledge graph interface and interface parameters related to the current question, wherein the interface parameters are extracted from the target question; The calling of the knowledge graph interface related to the current question to generate an answer to the current question includes: Using the interface parameters as input of the knowledge graph interface to obtain output data of the knowledge graph interface; The question-answering model generates an answer to the current question based on the output data.

5. The method according to claim 4, characterized in that The method further comprises: In response to the knowledge graph interface not obtaining the output data, determining a new knowledge graph interface related to the current problem based on the target problem; The new knowledge graph interface is called to generate an answer to the current question.

6. The method according to any one of claims 2 to 5, characterized in that The step of determining at least one reference question and answer according to the first similarity between the current question and each of the selected historical questions and answers comprises: Based on each of the first similarities, selecting a preset number of historical questions and answers from the plurality of historical questions and answers as candidate questions and answers; Determining outlier candidate questions and answers from the candidate questions and answers according to the first similarities corresponding to the candidate questions and answers; The other candidate questions and answers except the outlier candidate questions and answers are used as the reference questions and answers.

7. The method according to any one of claims 1 to 5, characterized in that The intention recognition model includes a similarity matching sub-model and an intention recognition sub-model. The current question is processed using the intention recognition model to obtain the intention of the current question, including: Determine a second similarity between the current question and a plurality of sample data using the similarity matching sub-model, each of the sample data having a corresponding relationship with the knowledge graph interface call or the small talk; Determining a set of sample data groups from the plurality of sample data according to the magnitude of each of the second similarities; Based on the sample data set, determining a prompt word; The prompt word is used as the input of the intention recognition sub-model to obtain the intention of the current question.

8. The method according to any one of claims 1 to 5, characterized in that The current question includes a query question about the relationship between the target object and several other objects, the answer includes information about the relationship between the target object and the several other objects, and the method further includes: Based on the relationship information, generating a relationship canvas between the target object and the plurality of other objects; The relationship canvas is displayed in a preset display area.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the method according to any one of claims 1 to 8.

10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Man-machine conversation processing method and device

    CN111708869A