Question and answer method, electronic equipment, storage medium and program product

By obtaining user questions in the intelligent question-and-answer system, determining search keywords and conditions, and using knowledge graphs and language models to process results, the existing question-and-answer system cannot cover different questions of users, and the answer rate is improved.

CN119719303APending Publication Date: 2025-03-28INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411869635.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the existing intelligent question-and-answer system, the standard questions in the question-and-answer knowledge base cannot cover the different questions of users, resulting in a low answer rate of user questions.

Method used

By obtaining the initial questions entered by the user, determining the corresponding multiple search keywords and search conditions, using the preset knowledge graph for searching, and combining the preset language model to process the problems and search results, and generating the target answer.

Benefits of technology

By converting the question into search keywords and search conditions, covering multiple question-asking methods can significantly improve the answer rate of the question.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719303A_ABST
    Figure CN119719303A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a question and answer method, electronic equipment, a storage medium and a program product. Relates to the big data field. The method comprises the steps of obtaining an initial question input by a user; determining a plurality of retrieval keywords corresponding to the initial question; a plurality of retrieval conditions are determined according to the retrieval keywords, the retrieval conditions comprise at least two retrieval keywords and role types of the retrieval keywords in the retrieval conditions, and the role types are node types or relation types; according to the plurality of retrieval conditions, performing retrieval in a preset knowledge graph to obtain a retrieval result; and processing the initial question and the detection result through a preset language model to obtain a target answer corresponding to the initial question. And the answering rate of questions and answers is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data, and in particular to a question-answering method, an electronic device, a storage medium, and a program product. Background Art

[0002] In some scenarios, the intelligent question-and-answer system can provide users with information query functions. For example, in financial scenarios, the intelligent question-and-answer system can answer questions raised by users and provide users with more intelligent services.

[0003] In related technologies, users can input question statements into the intelligent question-and-answer system. The intelligent question-and-answer system recognizes the user's intention through the intention understanding module, searches for the question that best matches the user's question from the question-and-answer knowledge base, and returns the answer to the question to the user.

[0004] However, in the above method, since the standard questions in the question-answering knowledge base can only cover a part of the positive questions, it cannot cover the different ways of asking questions by users, resulting in a low answer rate for user questions. Summary of the invention

[0005] The embodiments of the present application provide a question-answering method, an electronic device, a storage medium, and a program product to achieve the effect of improving the answer rate.

[0006] In a first aspect, an embodiment of the present application provides a question-answering method, comprising:

[0007] Get the initial question from the user;

[0008] Determine a plurality of search keywords corresponding to the initial question;

[0009] Determine a plurality of search conditions according to the plurality of search keywords, wherein the search conditions include at least two search keywords and a role type of each search keyword in the search conditions, wherein the role type is a node type or a relationship type;

[0010] According to the multiple search conditions, searching in a preset knowledge graph to obtain search results;

[0011] The initial question and the detection result are processed through a preset language model to obtain a target answer corresponding to the initial question.

[0012] In a second aspect, an embodiment of the present application provides a question-answering device, including: an acquisition module, a first determination module, a second determination module, a retrieval module, and a first processing module, wherein:

[0013] The acquisition module is used to obtain the initial question input by the user;

[0014] The first determination module is used to determine a plurality of search keywords corresponding to the initial question;

[0015] The second determination module is used to determine a plurality of search conditions according to the plurality of search keywords, wherein the search conditions include at least two search keywords and a role type of each search keyword in the search conditions, wherein the role type is a node type or a relationship type;

[0016] The retrieval module is used to search in a preset knowledge graph according to the multiple retrieval conditions to obtain retrieval results;

[0017] The first processing module is used to process the initial question and the detection result through a preset language model to obtain a target answer corresponding to the initial question.

[0018] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the question-and-answer method described in the first aspect and various possible designs of the first aspect.

[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the question-and-answer method described in the first aspect and various possible designs of the first aspect is implemented.

[0020] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the question-and-answer method described in the first aspect and various possible designs of the first aspect.

[0021] The embodiments of the present application provide a question-answering method, electronic device, storage medium, and program product. When it is necessary to generate an answer corresponding to a question based on a question, the question can be matched with the answer in the knowledge base. If the answer cannot be matched, multiple search keywords and multiple search conditions are determined according to the question, and the search results are determined in the preset knowledge graph according to the search conditions. Finally, the question and the search results are processed by a preset language model to obtain the answer corresponding to the question. Through the above method, the question can be converted into search keywords and search conditions, thereby covering a variety of questioning methods and improving the answer rate of the question. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0023] Figure 1 A schematic diagram of the system architecture provided for an embodiment of the present application;

[0024] Figure 2 A flowchart of a question-and-answer method provided in an embodiment of the present application;

[0025] Figure 3 A schematic diagram of a visual operation window of a question-and-answer system provided in an embodiment of the present application;

[0026] Figure 4 A schematic diagram of the process of determining the search results provided in the embodiment of the present application;

[0027] Figure 5 A schematic diagram of the structure of a question-and-answer device provided in an embodiment of the present application;

[0028] Figure 6 A schematic diagram of the structure of another question-and-answer device provided in an embodiment of the present application;

[0029] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0030] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0031] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0033] In addition, this application involves conducting big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and using artificial intelligence technology to make automated decisions, and making technical solutions that have a significant impact on personal rights and interests based on the results of automated decisions. The application provides users with corresponding operation entrances for them to choose to agree or reject the results of automated decisions; if the user chooses to reject, the expert decision-making process will be entered.

[0034] It should be noted that the question-and-answer method, electronic device, storage medium and program product provided in the present application can be used in the field of big data, and can also be used in any field other than the field of big data. The application field of the question-and-answer method, electronic device, storage medium and program product in the present application is not limited.

[0035] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0036] For ease of understanding, the following Figure 1 , the system architecture applicable to the embodiments of the present application is described.

[0037] Figure 1 This is a schematic diagram of the system architecture provided by the embodiment of this application. Figure 1 , including a terminal device 101 and a storage device 102. The terminal device 101 may be a local device of the user, and an intelligent question-and-answer system may be provided in the terminal device 101. Question-and-answer data may be stored in the storage device 102, and the question-and-answer data may include preset questions and answers corresponding to the preset questions. The user may input a user question into the intelligent question-and-answer system in the terminal device 101, and the terminal device 101 may obtain the question-and-answer data in the storage device 102. According to the user question and the question-and-answer data, the terminal device 101 may return the answer corresponding to the user question.

[0038] In the related art, users can input question statements into the intelligent question-answering system, which recognizes the user's intention through the intention understanding module, searches for the question that best matches the user's question from the question-answering knowledge base, and returns the answer to the question to the user. However, in the above method, since the standard questions in the question-answering knowledge base can only cover a part of the positive questions, it cannot cover the different ways of asking questions by users, resulting in a low answer rate for user questions.

[0039] In view of the above technical problems, in an embodiment of the present application, when it is necessary to generate an answer corresponding to a question based on a question, the question can be matched with the answer in the knowledge base. If the answer cannot be matched, multiple search keywords and multiple search conditions are determined according to the question, and the search results are determined in the preset knowledge graph according to the search conditions. Finally, the question and the search results are processed by a preset language model to obtain the answer corresponding to the question. Through the above method, the question can be converted into search keywords and search conditions, thereby covering a variety of questioning methods and improving the answer rate of the question.

[0040] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0041] Figure 2 A flowchart of a question-and-answer method provided in an embodiment of the present application. Figure 2 As shown, the method may include the following steps:

[0042] S201: Obtain an initial question input by a user.

[0043] The execution subject of the embodiment of the present application may be a terminal device, or a question-answering device arranged in the terminal device. The question-answering device may be implemented by software, or by a combination of software and hardware.

[0044] A question-and-answer system may be provided in the terminal device, and the user may input an initial question in the question-and-answer system and generate a question-and-answer instruction by clicking the "Submit" control. After receiving the question-and-answer instruction, the terminal device may match the answer in the knowledge base according to the initial question.

[0045] Next, combine Figure 3 ,Through specific examples, the visual operation window of the question-answering system is explained.

[0046] Figure 3 For a schematic diagram of the visual operation window of the question-answering system provided in the embodiment of the present application, see Figure 3 , including an initial question input module, an answer output module and a "submit" control. The user can input the initial question in the initial question input module, click the "submit" control, and obtain the answer corresponding to the initial question in the answer output module.

[0047] The initial question may refer to a question entered by a user in the question-answering system. For example, the initial question may be "What are the conditions for withdrawing personal pension funds?"

[0048] S202: Determine multiple search keywords corresponding to the initial question.

[0049] Search keywords may refer to words determined based on the initial question.

[0050] The multiple search keywords corresponding to the initial question can be determined in the following manner: perform keyword extraction processing on the initial question to obtain multiple initial keywords; determine the keyword vector corresponding to each initial keyword to obtain multiple keyword vectors; match the target vector corresponding to each keyword vector in the vector library corresponding to the knowledge graph to obtain multiple target vectors, wherein the similarity between the keyword vector and the corresponding target vector is greater than or equal to a preset threshold; perform keyword conversion processing on the multiple target vectors to obtain multiple search keywords.

[0051] Among them, the keyword extraction process can refer to keyword extraction of the initial question. For example, assuming the initial question is "What are the conditions for withdrawing personal pension", the multiple initial keywords obtained after keyword extraction of the initial question are "personal pension" and "withdrawal conditions".

[0052] The initial keyword may be input into a preset language model to obtain a keyword vector corresponding to the initial keyword. The keyword conversion process may refer to inputting a target vector into a preset language model to obtain a search keyword corresponding to the target vector.

[0053] The vector library can be determined in the following manner: obtaining a plurality of keywords and a connection relationship between the plurality of keywords in a preset knowledge graph, and determining the connection relationship between the plurality of keywords and the plurality of keywords as a plurality of initial words; inputting the plurality of initial words into a preset language model, thereby obtaining a plurality of vectors corresponding to the plurality of initial words, and storing the plurality of vectors in the vector library, which may be located in the storage space of a storage device.

[0054] The preset knowledge graph may refer to a graph describing the relationship between keywords in the knowledge base. The preset knowledge graph may be located in the storage space of the storage device.

[0055] Before determining the multiple search keywords corresponding to the initial question, the initial question may be matched in the knowledge base to determine whether there is a target question matching the initial question in the knowledge base. The knowledge base may refer to a database including multiple questions and answers corresponding to each question, and the knowledge base may be stored in the storage space of a storage device.

[0056] The initial question can be matched in the knowledge base in the following manner: perform semantic analysis on the initial question to obtain semantic information corresponding to the initial question; perform normalization and correction on the initial question based on the semantic information to obtain multiple normalized questions; for any normalized question, obtain the similarity between the normalized question and each question in the knowledge base to obtain multiple similarities, and determine the maximum similarity among the multiple similarities as the matching degree corresponding to the normalized question; determine that there is no target question among the multiple normalized questions, and the matching degree corresponding to the target question is greater than or equal to the preset matching degree.

[0057] Semantic analysis processing may refer to extracting the original question to obtain the true intention of the original question. Semantic information may include entities, relationships, topics, etc. Standardization correction processing may include grammatical correction of the original question, replacing non-standard terms in the original question with standard terms, deleting redundant information in the original question, etc. The preset matching degree may be a value set by the user in advance in the terminal device.

[0058] S203: Determine multiple search conditions based on multiple search keywords.

[0059] The search condition may include at least two search keywords and the role type of each search keyword in the search condition, wherein the role type may include a node type and a relationship type.

[0060] Multiple search conditions can be determined in the following manner: determine at least one role type corresponding to each search keyword; determine at least one search condition template, the search condition template including at least two fill-in positions and a role type corresponding to each fill-in position; generate multiple search conditions based on at least one role type corresponding to each search keyword and at least one search condition template.

[0061] The search condition template may refer to a template statement pre-set by a user in a terminal device. For example, the search condition template may be: match (role type 1: fill position 1) - (role type 2: fill position 2).

[0062] S204: Based on multiple search conditions, search in a preset knowledge graph to obtain search results.

[0063] The preset knowledge graph can be obtained from the storage space of the storage device.

[0064] The knowledge graph can be determined in the following way: obtain a knowledge base in a storage device, determine multiple questions and the answer corresponding to each question in the knowledge base; perform keyword extraction processing on the multiple questions and the answer corresponding to each question to obtain multiple keywords and the connection relationship between the multiple keywords; use the multiple keywords as nodes and the connection relationship between two keywords as edges to determine the knowledge graph; store the knowledge graph in the storage space of the storage device.

[0065] The search result may include at least one triple information, and the triple information may include two nodes in the knowledge graph and the connection relationship between the two nodes. For example, assuming that node 1 is "personal pension", node 2 is "retirement", and the connection relationship between node 1 and node 2 is "withdrawal conditions", the triple information may be (personal pension, withdrawal conditions, retirement).

[0066] S205: Process the initial question and the detection result through a preset language model to obtain a target answer corresponding to the initial question.

[0067] The target answer can be determined in the following way: obtain the initial question and the detection result, determine the initial question as the user question, and determine the detection result as the reference knowledge; generate the question language according to the user question and the reference knowledge; input the question language into the preset language model to obtain the output reply language; determine the reply language as the target answer corresponding to the initial question.

[0068] The questioning language may refer to questions generated based on user questions and reference knowledge. The replying language may refer to the reply answer output by a preset language model according to the questioning language. The terminal device may obtain the replying language and display the replying language in the answer module of the visual interface of the question-answering system.

[0069] For example, the question line could be: "User question: Must personal pension be collected after retirement? Reference knowledge: (personal pension, withdrawal conditions, retirement). Please respond to the user's question based on the reference knowledge." The corresponding response line could be: "Yes, the withdrawal condition for personal pension is to collect it after retirement."

[0070] In an embodiment of the present application, when it is necessary to generate an answer corresponding to a question based on a question, the initial question input by the user can be obtained first, and the initial question can be matched with an answer in the knowledge base. If the answer cannot be matched, multiple search keywords are determined based on the initial question, and multiple search conditions are determined based on the multiple search keywords. Search results are obtained by searching in a preset knowledge graph based on the multiple search conditions, and finally the initial question and the detection results are processed by a preset language model to obtain the target answer corresponding to the initial question. Through the above method, questions can be converted into search keywords and search conditions, thereby covering a variety of questioning methods and improving the answer rate of questions.

[0071] Based on any of the above embodiments, Figure 4 , the process of determining the search results ( Figure 2 S202-S204) in the embodiment are described in detail.

[0072] Figure 4 Schematic diagram of the process of determining the search results provided in the embodiment of the present application. Figure 4 , the method may include:

[0073] S401. Determine multiple search keywords corresponding to the initial question based on the initial question.

[0074] It should be noted that the execution process of the above S401 can refer to S202 and will not be repeated here.

[0075] S402: Determine at least one role type corresponding to each search keyword.

[0076] Role types can include node types and relationship types.

[0077] The role type can be determined in the following manner: obtain a preset knowledge graph, and for any search keyword, if there is a node corresponding to the search keyword in the knowledge graph and a connection relationship corresponding to the search keyword in the knowledge graph, then determine that at least one role type corresponding to the search keyword includes a node type and a relationship type; if there is a node corresponding to the search keyword in the knowledge graph and a connection relationship corresponding to the search keyword does not exist in the knowledge graph, then determine that at least one role type corresponding to the search keyword is a node type; if there is no node corresponding to the search keyword in the knowledge graph and a connection relationship corresponding to the search keyword exists in the knowledge graph, then determine that at least one role type corresponding to the search keyword is a relationship type.

[0078] For example, assuming that the search keywords are names, places, etc., then at least one corresponding role type is a node type; assuming that the search keywords are causal relationship words, position relationship words, and inheritance relationship words, then at least one corresponding role type is a node type; assuming that the search keywords are leaders and friends, then at least one corresponding role type is a node type and a relationship type.

[0079] S403: Determine at least one search condition template, and for any search condition template, determine at least one keyword group corresponding to the search condition template from a plurality of search keywords according to the role type corresponding to each fill position in the search condition template.

[0080] The search condition template includes at least two filling positions and a role type corresponding to each filling position.

[0081] For example, assuming that the search condition template includes a node-type filler and a relationship-type filler, the keyword group also includes a node-type keyword and a relationship-type keyword.

[0082] S404: Generate at least one search condition corresponding to the search condition template according to each keyword group.

[0083] After filling the keyword group into the search condition template, the search condition can be obtained.

[0084] The search condition can be determined in the following manner: for any search condition template, determine at least one keyword group corresponding to the search condition template; fill at least one keyword group into the search condition template according to the role type, and obtain at least one search condition corresponding to the search condition template.

[0085] For example, assuming that the search condition template is: Match (node ​​type: fill position 1)-(relationship type: fill position 2), and the keyword group determined among multiple search keywords is (retirement, condition), then the search condition corresponding to the search condition template can be obtained as: Match (node ​​type: retirement)-(relationship type: retirement).

[0086] S405: Determine multiple search conditions according to each search condition template.

[0087] The multiple search conditions include at least one search condition corresponding to each search condition template.

[0088] S406. Obtain a sub-knowledge graph corresponding to each search condition in the knowledge graph to obtain multiple sub-knowledge graphs.

[0089] The sub-knowledge graph includes at least two nodes and a connection relationship between at least two nodes.

[0090] A sub-knowledge graph can be determined in the knowledge graph in the following manner: for any search condition, determine the keyword group of the search condition and the role type corresponding to the keyword group; if the role types corresponding to the keywords in the keyword group are all node types, then search the knowledge graph for the nodes corresponding to the keyword group and the connection relationships corresponding to the nodes, and determine the nodes corresponding to the keyword group and the connection relationships corresponding to the nodes as the sub-knowledge graph; if the role types corresponding to the keywords in the keyword group are all relationship types, then search the knowledge graph for the connection relationships corresponding to the keyword group and the multiple nodes connected by the connection relationships, and determine the connection relationships corresponding to the keyword group and the multiple nodes connected by the connection relationships as the sub-knowledge graph; if the role types corresponding to the keywords in the keyword group have both node types and relationship types, then search the knowledge graph for the nodes corresponding to the keywords of the node type and the connection relationships corresponding to the keywords of the relationship type, and determine the nodes corresponding to the keywords of the node type and the connection relationships corresponding to the keywords of the relationship type as the sub-knowledge graph.

[0091] S407. For any sub-knowledge graph, determine at least one triple information corresponding to the sub-knowledge graph.

[0092] The triplet information includes two nodes and the connection relationship between the two nodes.

[0093] The triple information can be determined in the following way: obtain any sub-knowledge graph and determine multiple connection relationships; for any connection relationship, determine the two nodes connected by the connection relationship; and determine the connection relationship and the two nodes connected by the connection relationship as a triple information.

[0094] S408. Determine the search result based on at least one triple information corresponding to each sub-knowledge graph.

[0095] The retrieval result may refer to at least one triple information corresponding to each sub-knowledge graph.

[0096] In an embodiment of the present application, when it is necessary to generate an answer corresponding to a question according to a question, the search results of the search in the preset knowledge graph can be determined first. According to the initial question, multiple search keywords corresponding to the initial question can be determined; according to multiple search keywords, at least one role type corresponding to each search keyword can be determined, and the role type can include a node type and a relationship type; at least one search condition template is determined, and for any search condition template, at least one keyword group corresponding to the search condition template can be determined in multiple search keywords according to the role type corresponding to each fill position in the search condition template; according to each keyword group, at least one search condition corresponding to the search condition template can be generated; determine multiple search conditions corresponding to each search condition template, obtain the sub-knowledge graph corresponding to each search condition in the knowledge graph, and obtain multiple sub-knowledge graphs; for any sub-knowledge graph, determine at least one triple information corresponding to the sub-knowledge graph; determine the search results, and the search results include at least one triple information corresponding to each sub-knowledge graph. Through the above method, the initial question can be converted into a search condition, so as to determine the search results corresponding to the search condition in the knowledge graph, thereby covering a variety of questioning methods and improving the answer rate of the question.

[0097] Figure 5 This is a schematic diagram of the structure of a question-answering device provided in an embodiment of the present application. Figure 5 The question-answering device 10 includes: an acquisition module 11, a first determination module 12, a second determination module 13, a retrieval module 14 and a first processing module 15, wherein:

[0098] The acquisition module 11 is used to acquire the initial question input by the user;

[0099] The first determination module 12 is used to determine a plurality of search keywords corresponding to the initial question;

[0100] The second determination module 13 is used to determine a plurality of search conditions according to the plurality of search keywords, wherein the search conditions include at least two search keywords and a role type of each search keyword in the search conditions, wherein the role type is a node type or a relationship type;

[0101] The retrieval module 14 is used to search in a preset knowledge graph according to the multiple retrieval conditions to obtain retrieval results;

[0102] The first processing module 15 is used to process the initial question and the detection result through a preset language model to obtain a target answer corresponding to the initial question.

[0103] A question-and-answer device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0104] In a possible design, the second determining module 13 is specifically configured to:

[0105] Determine at least one role type corresponding to each search keyword;

[0106] Determine at least one search condition template, wherein the search condition template includes at least two fill-in positions and a role type corresponding to each fill-in position;

[0107] The multiple search conditions are generated according to at least one role type corresponding to each search keyword and the at least one search condition template.

[0108] In a possible design, the second determining module 13 is specifically configured to:

[0109] For any search condition template, according to the role type corresponding to each fill position in the search condition template, determine at least one keyword group corresponding to the search condition template from the multiple search keywords, and generate at least one search condition corresponding to the search condition template according to each keyword group;

[0110] Determining the multiple search conditions includes at least one search condition corresponding to each search condition template.

[0111] In a possible design, the second determining module 13 is specifically configured to:

[0112] If there is a node corresponding to the search keyword in the knowledge graph, and there is a connection relationship corresponding to the search keyword in the knowledge graph, determining that at least one role type corresponding to the search keyword includes a node type and a relationship type;

[0113] If a node corresponding to the search keyword exists in the knowledge graph and a connection relationship corresponding to the search keyword does not exist in the knowledge graph, determining that at least one role type corresponding to the search keyword is a node type;

[0114] If there is no node corresponding to the search keyword in the knowledge graph, and there is a connection relationship corresponding to the search keyword in the knowledge graph, then at least one role type corresponding to the search keyword is determined to be a relationship type.

[0115] In a possible design, the first determining module 12 is specifically configured to:

[0116] Performing keyword extraction processing on the initial question to obtain a plurality of initial keywords;

[0117] Determine a keyword vector corresponding to each initial keyword to obtain multiple keyword vectors;

[0118] Matching a target vector corresponding to each keyword vector in a vector library corresponding to the knowledge graph to obtain multiple target vectors, wherein the similarity between the keyword vector and the corresponding target vector is greater than or equal to a preset threshold;

[0119] Keyword conversion processing is performed on the multiple target vectors to obtain the multiple search keywords.

[0120] In a possible design, the retrieval module 14 is specifically used for:

[0121] Obtaining a sub-knowledge graph corresponding to each search condition in the knowledge graph to obtain a plurality of sub-knowledge graphs, wherein the sub-knowledge graphs include at least two nodes and a connection relationship between the at least two nodes;

[0122] For any sub-knowledge graph, determine at least one triple information corresponding to the sub-knowledge graph, where the triple information includes two nodes and a connection relationship between the two nodes;

[0123] Determine that the retrieval result includes at least one triple information corresponding to each sub-knowledge graph.

[0124] Figure 6 A schematic diagram of the structure of another question-answering device provided in an embodiment of the present application. Figure 5 Based on the examples shown, see Figure 6 , the acquisition module 11 also includes: a second processing module 16 and a third determination module 17,

[0125] The second processing module 16 is used to perform semantic analysis on the initial question to obtain semantic information corresponding to the initial question;

[0126] Performing normalization and correction processing on the initial question according to the semantic information to obtain a plurality of normalized questions;

[0127] The third determination module 17 is used to obtain, for any normalized question, the similarity between the normalized question and each question in the knowledge base, obtain multiple similarities, and determine the maximum similarity among the multiple similarities as the matching degree corresponding to the normalized question, wherein the knowledge base includes multiple questions and answers corresponding to each question;

[0128] It is determined that there is no target question among the multiple normalized questions, and the matching degree corresponding to the target question is greater than or equal to a preset matching degree.

[0129] A question-and-answer device provided in an embodiment of the present application can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0130] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device 20 may include: a transceiver 21 , a processor 22 , and a memory 23 .

[0131] The processor 22 executes the computer execution instructions stored in the memory, so that the processor 22 executes the scheme in the above embodiment. The processor 22 can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be 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.

[0132] The memory 23 is connected to the processor 22 via a system bus and completes communication between them. The memory 23 is used to store computer program instructions.

[0133] The transceiver 21 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.

[0134] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.

[0135] The electronic device provided in the embodiment of the present application may be the terminal device of the above embodiment.

[0136] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution of the question-and-answer method in the above embodiment.

[0137] An embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the question-and-answer method in the above embodiment.

[0138] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the question-and-answer method in the above embodiment.

[0139] 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 modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, 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 an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0140] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0141] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0142] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.

[0143] It should be understood that the above processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.

[0144] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0145] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0146] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0147] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a main control device.

[0148] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A question-answering method, characterized in that: include: Get the initial question from the user; Determine a plurality of search keywords corresponding to the initial question; Determine a plurality of search conditions according to the plurality of search keywords, wherein the search conditions include at least two search keywords and a role type of each search keyword in the search conditions, wherein the role type is a node type or a relationship type; According to the multiple search conditions, searching in a preset knowledge graph to obtain search results; The initial question and the detection result are processed through a preset language model to obtain a target answer corresponding to the initial question.

2. The method according to claim 1, characterized in that Determining multiple search conditions based on the multiple search keywords includes: Determine at least one role type corresponding to each search keyword; Determine at least one search condition template, wherein the search condition template includes at least two fill-in positions and a role type corresponding to each fill-in position; The multiple search conditions are generated according to at least one role type corresponding to each search keyword and the at least one search condition template.

3. The method according to claim 2, characterized in that Generating the plurality of search conditions according to at least one role type corresponding to each search keyword and the at least one search condition template includes: For any search condition template, according to the role type corresponding to each fill position in the search condition template, determine at least one keyword group corresponding to the search condition template from the multiple search keywords, and generate at least one search condition corresponding to the search condition template according to each keyword group; Determining the multiple search conditions includes at least one search condition corresponding to each search condition template.

4. The method according to claim 2 or 3, characterized in that: For any search keyword, determining at least one role type corresponding to the search keyword includes: If there is a node corresponding to the search keyword in the knowledge graph, and there is a connection relationship corresponding to the search keyword in the knowledge graph, determining that at least one role type corresponding to the search keyword includes a node type and a relationship type; If a node corresponding to the search keyword exists in the knowledge graph and a connection relationship corresponding to the search keyword does not exist in the knowledge graph, determining that at least one role type corresponding to the search keyword is a node type; If there is no node corresponding to the search keyword in the knowledge graph, and there is a connection relationship corresponding to the search keyword in the knowledge graph, then at least one role type corresponding to the search keyword is determined to be a relationship type.

5. The method according to any one of claims 1 to 4, characterized in that: Determine multiple search keywords corresponding to the initial question, including: Performing keyword extraction processing on the initial question to obtain a plurality of initial keywords; Determine a keyword vector corresponding to each initial keyword to obtain multiple keyword vectors; Matching a target vector corresponding to each keyword vector in a vector library corresponding to the knowledge graph to obtain multiple target vectors, wherein the similarity between the keyword vector and the corresponding target vector is greater than or equal to a preset threshold; Keyword conversion processing is performed on the multiple target vectors to obtain the multiple search keywords.

6. The method according to any one of claims 1 to 5, characterized in that: According to the multiple search conditions, a search is performed in a preset knowledge graph to obtain search results, including: Obtaining a sub-knowledge graph corresponding to each search condition in the knowledge graph to obtain a plurality of sub-knowledge graphs, wherein the sub-knowledge graphs include at least two nodes and a connection relationship between the at least two nodes; For any sub-knowledge graph, determine at least one triple information corresponding to the sub-knowledge graph, where the triple information includes two nodes and a connection relationship between the two nodes; Determine that the retrieval result includes at least one triple information corresponding to each sub-knowledge graph.

7. The method according to any one of claims 1 to 6, characterized in that: Before determining a plurality of search keywords corresponding to the initial question, the method further includes: Performing semantic analysis on the initial question to obtain semantic information corresponding to the initial question; Performing normalization and correction processing on the initial question according to the semantic information to obtain a plurality of normalized questions; For any normalized question, obtain the similarity between the normalized question and each question in the knowledge base, obtain multiple similarities, and determine the maximum similarity among the multiple similarities as the matching degree corresponding to the normalized question, wherein the knowledge base includes multiple questions and answers corresponding to each question; It is determined that there is no target question among the multiple normalized questions, and the matching degree corresponding to the target question is greater than or equal to a preset matching degree.

8. A question-answering device, characterized in that: include: an acquisition module, a first determination module, a second determination module, a retrieval module and a first processing module, wherein: The acquisition module is used to obtain the initial question input by the user; The first determination module is used to determine a plurality of search keywords corresponding to the initial question; The second determination module is used to determine a plurality of search conditions according to the plurality of search keywords, wherein the search conditions include at least two search keywords and a role type of each search keyword in the search conditions, wherein the role type is a node type or a relationship type; The retrieval module is used to search in a preset knowledge graph according to the multiple retrieval conditions to obtain retrieval results; The first processing module is used to process the initial question and the detection result through a preset language model to obtain a target answer corresponding to the initial question.

9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.