Question answer generation method and device, computer equipment and storage medium

By obtaining and processing Q&A data, using pre-trained Q&A models to generate and verify solutions, the problem of incomplete entry of online problem systems is solved, and more comprehensive question and answer entry is achieved.

CN119719293APending Publication Date: 2025-03-28CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, the online problems and solutions of online problems systems are incomplete or unreasonable, resulting in users being unable to find the corresponding processing method through the system.

Method used

By obtaining the input Q&A data, including the problem, problem root cause and problem solution, using the pre-trained Q&A model to generate candidate solutions, and determining the priority of the candidate solutions through problem solving verification, and finally entering it into the online problem system.

Benefits of technology

It improves the entry integrity of questions and answers of the online question system, making the online questions and corresponding target solutions more comprehensive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719293A_ABST
    Figure CN119719293A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a question answer generation method and device, computer equipment and a storage medium, and belongs to the technical field of artificial intelligence. The method comprises the steps of obtaining input question and answer data, wherein the question and answer data comprises questions, question root causes and question solutions; inputting the problem, the problem root cause and the problem solution into a preset prompt template, and outputting a prompt text; inputting the prompt text into a pre-trained question and answer model, and outputting candidate solutions corresponding to the questions; performing problem solving verification on the candidate solutions to determine the priority of each candidate solution; and determining a target solution of the problem in the candidate solutions according to the priority, and inputting the problem and the target solution into an online problem system. According to the embodiment of the invention, the input integrity of questions and answers of an online question system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, computer device and storage medium for generating answers to questions. Background Art

[0002] With the development of computer technology, some applications or web interfaces currently provide rich application functions, but users may encounter some problems during use. In order to improve the efficiency of problem solving, online problems and corresponding solutions to online problems will be set up so that users can actively solve problems.

[0003] However, in the related technologies, online problems are often entered manually, and the person entering the problem outputs solutions based on his or her understanding of the online problem. However, there are limitations in manually entering online problems and solutions, which may result in incomplete or unreasonable solutions to online problems entered into the online problem system. For example, when a user encounters a problem, he or she is unable to find a corresponding solution among the solutions provided by the online problem system. Therefore, the related technologies may cause incomplete entry of online problems and solutions to the online problem system. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to propose a question and answer generation method, apparatus, computer equipment and storage medium, aiming to improve the input integrity of questions and answers to an online question system.

[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a method for generating a question answer, the method comprising:

[0006] Obtaining input question-and-answer data, wherein the question-and-answer data includes a question, a root cause of the question, and a solution to the question;

[0007] Input the problem, the root cause of the problem and the solution to the problem into a preset prompt template, and output a prompt text;

[0008] Inputting the prompt text into a pre-trained question-answering model, and outputting candidate solutions corresponding to the question;

[0009] Performing problem-solving verification on the candidate solutions to determine the priority of each candidate solution;

[0010] A target solution to the problem is determined from among the candidate solutions according to the priority, and the problem and the target solution are entered into an online problem system.

[0011] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a question answer generating device, the device comprising:

[0012] An acquisition module is used to acquire input question and answer data, wherein the question and answer data includes questions, root causes of the questions, and solutions to the questions;

[0013] A prompt module, used for inputting the problem, the root cause of the problem and the solution to the problem into a preset prompt template and outputting a prompt text;

[0014] An input module, used to input the prompt text into a pre-trained question-answering model and output a candidate solution corresponding to the question;

[0015] A verification module, used for verifying the problem solving of the candidate solutions to determine the priority of each candidate solution;

[0016] An input module is used to determine a target solution to the problem from among the candidate solutions according to the priority, and input the problem and the target solution into an online problem system.

[0017] In some implementations, the question answer generating apparatus further includes a matching module, which is used to:

[0018] Before inputting the problem, the root cause of the problem and the solution to the problem into a preset prompt template, performing word segmentation processing on the problem to obtain at least one word segmentation text;

[0019] Matching the at least one segmented text with an entity in a preset knowledge graph to obtain a matching target entity;

[0020] Generate an extended question corresponding to the question according to the target entity;

[0021] Prompt module for:

[0022] The expanded question, the problem, the root cause of the problem and the solution to the problem are input into a preset prompt template, and a prompt text is output.

[0023] In some embodiments, the matching module is used to:

[0024] Obtaining a segmentation text vector corresponding to each segmentation text in the at least one segmentation text;

[0025] Determine the similarity between the word segmentation text vector and the entity vector of any entity in the preset knowledge graph;

[0026] The entity corresponding to the entity vector having the highest similarity to the word segmentation text vector is determined as the matching target entity.

[0027] In some embodiments, the matching module is used to:

[0028] Determine the text attribute corresponding to each of the segmented texts in the question;

[0029] Determine a text attribute combination corresponding to the question according to the text attributes corresponding to each of the segmented texts;

[0030] According to the text attribute combination, a target entity with the same text attribute combination is determined in the target entity, and an extended question corresponding to the question is generated according to the target entity with the same text attribute combination.

[0031] In some embodiments, the verification module is used to:

[0032] Determine the processing time for each candidate solution to solve the problem;

[0033] A corresponding priority is set for each of the candidate solutions according to the processing time, and the processing time is negatively correlated with the priority.

[0034] In some embodiments, the verification module is used to:

[0035] Selecting the first three candidate solutions from the candidate solutions in descending order of priority;

[0036] The first three of the candidate solutions are determined as target solutions to the problem.

[0037] In some embodiments, the acquisition module is used to:

[0038] Obtain target historical issues whose occurrence frequency is higher than a preset occurrence frequency threshold;

[0039] Determine the historical solutions and root causes of the historical problems corresponding to the target historical problems;

[0040] Question and answer data is generated according to the target historical problem, the historical solution, and the root cause of the historical problem.

[0041] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the question answer generating method described in the first aspect above when executing the computer program.

[0042] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores multiple instructions, and the instructions are suitable for a processor to load and implement the question answer generation method described in the first aspect when executed.

[0043] The question and answer generation method, device, computer equipment and storage medium proposed in the present application obtain input question and answer data, which includes questions, root causes of problems and solutions to problems; input the questions, root causes of problems and solutions to problems into a pre-set prompt template and output prompt text; input the prompt text into a pre-trained question and answer model and output candidate solutions corresponding to the problem; verify the candidate solutions to solve the problem to determine the priority of each candidate solution; determine the target solution to the problem from the candidate solutions according to the priority, and enter the problem and the target solution into the online problem system. In this way, the input question and answer data is understood through the pre-trained question and answer model to obtain multiple candidate solutions corresponding to the problem, and then find a target solution with a higher priority from the multiple candidate solutions, and finally enter the problem and the target solution into the online problem system, so that the online problems and the corresponding target solutions are more comprehensive, and the entry integrity of the questions and answers of the online problem system is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a scenario diagram of the question answer generation method provided in an embodiment of the present application;

[0045] Figure 2 It is a flowchart of a method for generating answers to questions provided in an embodiment of the present application;

[0046] Figure 3 is another flowchart of the method for generating answers to questions provided in an embodiment of the present application;

[0047] Figure 4 It is another flowchart of the method for generating answers to questions provided in the embodiment of the present application;

[0048] Figure 5 is a schematic diagram of the structure of a question answer generating device provided in an embodiment of the present application;

[0049] Figure 6 It is a schematic diagram of the hardware structure of the computer device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0051] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0053] First, some nouns involved in this application are analyzed:

[0054] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0055] The Large Language Model (LLM) is an artificial intelligence program based on the Transformer architecture in deep learning. It is trained on large-scale text data sets to understand language patterns, semantics, and grammatical rules, and can generate natural and fluent text.

[0056] Entity: In a knowledge graph, an entity is the basic unit of knowledge. It represents an object or concept in the real world. For example, in a movie knowledge graph, "movie" is an entity, and "director" is also an entity. The movie entity may have attributes such as movie name, release date, rating, etc., and the director entity has attributes such as name and nationality. The movie and the director are connected through a relationship such as "directed by", thus building a knowledge network containing entities, attributes and relationships for knowledge representation and reasoning.

[0057] Knowledge Graph (KG) is a structured knowledge base, which is essentially a directed graph with labels. Each node in the graph represents an entity, and each edge represents a relationship, which is represented by a standard triple (s, r, o), where s and o are the head entity and the tail entity respectively, and r is the relationship between s and o. Knowledge graphs are widely used in many scenarios, such as semantic search, intelligent question and answer, and decision support. However, although the creation and maintenance of knowledge graphs cost a lot of money, even the largest knowledge graphs face problems such as data sparsity and data missing. Therefore, in order to make the knowledge graph more complete and accurate, it must be continuously expanded and improved so that the knowledge graph model can be continuously constructed. It should be pointed out that the initial text in the embodiment of the present application can query the corresponding entity in the pre-set knowledge graph.

[0058] Prompt Engineering is an important concept in the field of natural language processing, which refers to the text or sentence fragments used to trigger and guide the artificial intelligence language model to generate specific outputs. Prompt can be a word, a phrase, a question or a complete sentence, which can be used to guide the model to generate specific answers, text, summaries or other outputs.

[0059] Pre-training model, also known as cornerstone model or big model, refers to a deep neural network (DNN) with large parameters. It is trained on massive unlabeled data. The function approximation ability of large-parameter DNN is used to enable PTM to extract common features from the data. After fine tuning, parameter efficient fine tuning (PEFT), prompt-tuning and other technologies, it is suitable for downstream tasks. Therefore, the pre-training model can achieve ideal results in few-shot or zero-shot scenarios. PTM can be divided into language models (ELMO, BERT, GPT), visual models (swin-transformer, ViT, V-MOE), speech models (VALL-E), multimodal models (ViBERT, CLIP, Flamingo, Gato), etc. according to the data modality processed. Among them, the multimodal model refers to a model that establishes two or more data modality feature representations. The pre-training model is an important tool for outputting artificial intelligence generated content (AIGC), and can also be used as a general interface to connect multiple specific task models.

[0060] Next, describe the technical problems existing in the relevant technologies:

[0061] With the development of computer technology, some applications or web interfaces currently provide rich application functions, but users may encounter some problems during use. In order to improve the efficiency of problem solving, online problems and corresponding solutions to online problems will be set up so that users can actively solve problems.

[0062] However, in the related technologies, online problems are often entered manually, and the person entering the problem outputs solutions based on his or her understanding of the online problem. However, there are limitations in manually entering online problems and solutions, which may result in incomplete or unreasonable solutions to online problems entered into the online problem system. For example, when a user encounters a problem, he or she is unable to find a corresponding solution among the solutions provided by the online problem system. Therefore, the related technologies may cause incomplete entry of online problems and solutions to the online problem system.

[0063] In order to solve the technical problems in the related technology, based on this, the embodiments of the present application provide a question and answer generation method, device, computer equipment and storage medium, aiming to improve the input integrity of questions and answers to the online question system.

[0064] The question answer generation method, apparatus, computer device and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the question answer generation method in the embodiments of the present application is described.

[0065] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0066] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0067] The question answer generation method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The question answer generation method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the question answer generation method, etc., but is not limited to the above forms.

[0068] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer computer devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0069] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to the user's identity or characteristics such as questions, answers, solutions, etc., the user's permission or consent will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0070] For a more detailed understanding of the method for generating answers to questions provided in the embodiments of the present application, please refer to Figure 1 , Figure 1 It is a scenario diagram of the question answer generation method provided in an embodiment of the present application.

[0071] Among them, in the online question system, there are some popular questions, each question has a corresponding solution, that is, the answer to each question. In the related technology, the entry of questions and corresponding solutions is mainly based on human understanding. Due to certain limitations of human thinking and understanding, different people have different ways of thinking, which will lead to incomplete entry of answers to questions in the online question system.

[0072] In this application, a pre-trained question-answering model is introduced. The pre-trained question-answering model can specifically be a large language model. The pre-trained question-answering model is trained based on questions and answers in corresponding scenarios, and can output corresponding accurate answers to questions input in corresponding scenarios. For example, the application scenario is the return and exchange scenario of a shopping platform. For various return and exchange issues, solutions and root causes related to return and exchange issues can be input into the pre-trained question-answering model, and the pre-trained question-answering model can output a more comprehensive solution. The above is just a description of a scenario, and the solution in this application is also applicable to other scenarios.

[0073] In this application, you can first obtain input question and answer data, which includes questions, root causes of problems, and solutions to problems. For example, the question is: Why did the data upload fail? The root cause of the problem is: network fluctuations, and the solution is: change the current network. These three pieces of data constitute the question and answer data.

[0074] Then input the problem, root cause and solution into the preset prompt template, and output the prompt text. The prompt template is generated based on the prompt project. For example, the prompt template is:

[0075] PromptTemplate="""

[0076] {Detailed description of the problem}

[0077] {Repair solution description}

[0078] {Root cause analysis}

[0079] Based on the above problems, improvement measures are given and limited to 3 items.

[0080] """

[0081] In the "Detailed description of the problem" column, you can enter the specific problem, in the "Repair solution description" column, you can enter the problem solution, in the "Problem root cause analysis" column, enter the problem root cause, and then combine the instruction "Give improvement measures based on the above problems, limited to 3" to generate a prompt text, and then input the prompt text into the pre-trained question-answering model, which can input the candidate solutions corresponding to the problem based on the prompt text. The candidate solutions are richer and richer than the original solutions, and have more ideas and methods for solving problems.

[0082] The candidate solutions are then verified for problem solving to determine the priority of each candidate solution. For example, the priority of each candidate solution can be determined based on the processing time it takes for each candidate solution to solve the problem. The shorter the processing time, the higher the priority, and the longer the processing time, the lower the priority.

[0083] Finally, the target solution to the problem is determined from the candidate solutions according to the priority, and the problem and the target solution are entered into the online question system. For example, the candidate solution with the highest priority can be selected as the target solution, and finally the problem and the target solution are entered into the online question system. In this way, the target solution is determined by screening multiple candidate solutions, and has more reasonable and complete measures to solve the problem. Therefore, the above method can achieve a higher integrity of the questions and answers entered into the online question system.

[0084] For a more detailed understanding of the method for generating answers to questions provided in the embodiments of the present application, please continue to refer to Figure 2 , Figure 2 : is a flow chart of a method for generating a question answer provided in an embodiment of the present application. The method for generating a question answer may include the following steps:

[0085] Step 110: obtaining input question and answer data, where the question and answer data includes questions, root causes of the questions, and solutions to the questions;

[0086] Step 120: input the problem, the root cause of the problem and the solution to the problem into a preset prompt template, and output a prompt text;

[0087] Step 130: input the prompt text into the pre-trained question-answering model, and output candidate solutions corresponding to the question;

[0088] Step 140: verify the problem solving of the candidate solutions to determine the priority of each candidate solution;

[0089] Step 150: Determine a target solution to the problem from the candidate solutions based on the priority, and enter the problem and the target solution into the online problem system.

[0090] Steps 110 to 150 will be described in detail below.

[0091] In step 110, input question and answer data is obtained, and the question and answer data includes questions, root causes of the questions, and solutions to the questions.

[0092] The input question and answer data may be directly manually input question and answer data, for example, the developer of the application program inputs the question and answer data into a computer device based on his or her own understanding, wherein the question and answer data includes questions, root causes of the questions, and solutions to the questions.

[0093] For example, the question is: Why did the data upload fail? The root cause of the problem is: network fluctuation, and the solution is: change the current network. These three pieces of data constitute the question and answer data.

[0094] In some implementations, obtaining input question and answer data includes:

[0095] (1.1) Obtain target historical issues whose occurrence frequency is higher than a preset occurrence frequency threshold;

[0096] (1.2) Determine the historical solutions and root causes of the historical problems corresponding to the target historical problems;

[0097] (1.3) Generate question-answering data based on the target historical problems, historical solutions, and historical root causes of the problems.

[0098] Among them, in the online question system, some questions will be asked repeatedly by users. The frequency of occurrence of each historical question can be obtained based on the number of times users ask, such as the number of times users click on the question, and historical questions with an occurrence frequency higher than a preset occurrence frequency threshold can be identified as target historical questions.

[0099] Then determine the historical solutions and root causes of the target historical problems, and finally generate question-and-answer data based on the target historical problems, historical solutions, and root causes of the historical problems. For example, the target historical problems, historical solutions, and root causes of the historical problems can be used to generate key-value pair structure data, such as using the target historical problems as keys and the historical solutions and root causes of the historical problems as values, thereby generating key-value pair data, and determining the key-value pair data as question-and-answer data.

[0100] See also Figure 3 , Figure 3 It is another flowchart of the question answer generation method provided in an embodiment of the present application.

[0101] In some implementations, before inputting the problem, the root cause of the problem, and the solution to the problem into the preset prompt template, the following steps are also included:

[0102] Step 201: perform word segmentation processing on the question to obtain at least one word segmentation text;

[0103] Step 202: Match at least one segmented text with an entity in a preset knowledge graph to obtain a matching target entity;

[0104] Step 203: Generate an extended question corresponding to the question based on the target entity.

[0105] Steps 201 to 203 are described in detail below.

[0106] In step 201, the question is segmented to obtain at least one segmented text.

[0107] The question may be segmented by semantic segmentation to obtain at least one segmented text. For example, the semantics of each sentence in the question may be determined, and then the sentence may be segmented according to the semantics to obtain at least one segmented text. For example, the corresponding nouns, verbs, etc. may be selected by semantics to obtain the segmented text.

[0108] For another example, in order to further improve the efficiency of word segmentation of questions, the question can be input into a pre-trained text segmentation model, and the text segmentation model can be used to segment the entire question, thereby obtaining at least one segmented text. Specifically, the language corresponding to the question can be determined first, and then the text segmentation model that best suits the question can be determined based on the language, and finally the question can be input into the text segmentation model, thereby outputting at least one segmented text.

[0109] It is understandable that other text segmentation methods may be used to perform word segmentation on questions, and the above examples do not limit the present application.

[0110] In step 202, at least one segmented text is matched with an entity in a preset knowledge graph to obtain a matching target entity.

[0111] Among them, keyword matching can be used to achieve matching between segmented text and entities in the knowledge graph. For example, a segmented text is matched with all entities in a preset knowledge graph. When an entity that is the same as the segmented text is matched, the entity is determined as the target entity.

[0112] For example, the corresponding application scenario can be inferred based on the semantics of the segmented text. For example, if the segmented text contains words such as "cat food", "cat", "cat grass", and "return", the semantic text can be used to determine that it may be a cat food return scenario. Then, based on the application scenario, all entities corresponding to the scenario are circled in the preset knowledge graph, and finally the segmented text is matched with all entities in the scenario to match the target entity.

[0113] In some implementations, matching at least one segmented text with an entity in a preset knowledge graph to obtain a matching target entity includes:

[0114] (1.1) Obtaining a segmentation text vector corresponding to each segmentation text in at least one segmentation text;

[0115] (1.2) Determine the similarity between the word segmentation text vector and the entity vector of any entity in the preset knowledge graph;

[0116] (1.3) The entity corresponding to the entity vector with the highest similarity to the word segmentation text vector is determined as the matching target entity.

[0117] Specifically, a preset encoding method can be used to encode each word segmentation text, so as to obtain a word segmentation text vector corresponding to each word segmentation text. It should be noted that the word segmentation text vectors corresponding to all word segmentation texts can be understood as being in the same spatial dimension, which can ensure the reliability of subsequent matching between the word segmentation text vectors and entities in the preset knowledge graph, and can ensure that the similarity obtained by matching is reliable.

[0118] Then, the similarity between the word segmentation text vector and the entity vector of any entity in the preset knowledge graph is matched to obtain the similarity between the two. Among them, the preset knowledge graph contains not only entities, but also entity vectors corresponding to the entities. These entity vectors are also obtained by encoding the entities in a preset encoding method. Therefore, the spatial dimensions corresponding to these entity vectors are consistent with the spatial dimensions corresponding to the target text, thereby ensuring the reliability of the matching between the word segmentation text vector and the entity vector.

[0119] When the word segmentation text vector is matched with the entity vector of any entity in the preset knowledge graph for similarity, the cosine distance between the word segmentation text vector and the entity vector of any entity in the preset knowledge graph can be obtained, and then the similarity between the word segmentation text vector and the entity vector of any entity in the preset knowledge graph can be determined based on the cosine distance.

[0120] For example, when the cosine distance between the word segmentation text vector and the entity vector of any entity in the preset knowledge graph is within a preset cosine distance range, the associated similarity value can be determined based on the cosine distance range, and finally the similarity value is determined as the similarity between the word segmentation text vector and the entity vector.

[0121] After obtaining the similarity between the word segmentation text vector and the entity vector, the entity corresponding to the entity vector with the highest similarity to the word segmentation text vector can be determined as the target entity. For example, the similarity between the entity vector and the word segmentation text vector of entity 1 is 91%, the similarity between the entity vector and the word segmentation text vector of entity 2 is 95%, and the similarity between the entity vector and the word segmentation text vector of entity 3 is 99.9%. Then entity 3 is determined as the target entity.

[0122] It should be noted that the target entity can be a text that is exactly the same as the segmented text, or a text that is highly similar to the segmented text. By retaining the text that is highly similar to the segmented text, it can be ensured that the segmented text will not be directly filtered out.

[0123] In step 203, an extended question corresponding to the question is generated according to the target entity.

[0124] Among them, the target entities can be combined according to certain semantics to generate extended questions corresponding to the problem.

[0125] In some implementations, the extended question corresponding to the target entity generation question includes:

[0126] (1.1) Determine the text attributes corresponding to each segmented text in the question;

[0127] (1.2) Determine the text attribute combination corresponding to the question based on the text attributes corresponding to each segmented text;

[0128] (1.3) According to the text attribute combination, the target entity with the same text attribute combination is determined in the target entity, and the extended question corresponding to the question is generated according to the target entity with the same text attribute combination.

[0129] For example, a question is: "After returning or exchanging the product, when can I receive a refund?" In this question, "return or exchange" is a product attribute, "time" is a time attribute, and "refund" is a financial attribute. The text attribute combination of this question is product attribute + time attribute + financial attribute. Then, based on this text attribute combination, the target entity with the same text attribute combination can be determined in the target entity, such as the three target entities of "after-sales", "date", and "return". The expanded question based on the text attribute combination is: "How long does it take to return and refund the product after sales?"

[0130] It can be seen from step 201 to step 203 that by expanding the question to obtain multiple expanded questions, the richness of the question can be increased.

[0131] In step 120, the problem, the root cause of the problem, and the solution to the problem are input into a preset prompt template, and a prompt text is output.

[0132] The preset prompt templates are as follows:

[0133] PromptTemplate="""

[0134] {Detailed description of the problem}

[0135] {Repair solution description}

[0136] {Root cause analysis}

[0137] Based on the above problems, improvement measures are given and limited to 3 items.

[0138] """

[0139] Among them, you can enter the specific problem in the "Detailed Description of the Problem" column, enter the problem solution in the "Repair Plan Description" column, enter the root cause of the problem in the "Root Cause Analysis of the Problem", and then combine the instruction "Give improvement measures based on the above problems, limited to 3 items" to generate a prompt text.

[0140] There may be multiple pre-set prompt templates, which are not limited here.

[0141] In some implementations, the problem, the root cause of the problem, and the solution to the problem are input into a preset prompt template, and a prompt text is output, including:

[0142] Input the expanded question, problem, root cause of the problem and solution to the problem into the pre-set prompt template and output the prompt text.

[0143] For example, each problem has a root cause and a solution, and the root cause and solution of each problem can be used as the root cause and solution of the extended problem corresponding to each problem. This can increase the richness of the data input to the prompt template, thereby improving the richness of the generated prompt text.

[0144] In step 130, the prompt text is input into the pre-trained question-answering model, and candidate solutions corresponding to the question are output.

[0145] The prompt text is input into the pre-trained question-answering model, which can input candidate solutions to the question based on the prompt text. The candidate solutions are richer and more complete than the original solutions, and have more ideas and methods to solve the problem.

[0146] In step 140 , the candidate solutions are validated for problem solving to determine the priority of each candidate solution.

[0147] Among them, each candidate solution is verified for problem solving, and the candidate solutions that cannot solve the problem are first deleted, and then the candidate solutions that can solve the problem are retained. Then the priority of each retained candidate solution is determined.

[0148] In some implementations, problem solving validation is performed on candidate solutions to determine the priority of each candidate solution, including:

[0149] (1.1) Determine the processing time for each candidate solution to solve the problem;

[0150] (1.2) Set a corresponding priority for each candidate solution based on the processing time, and the processing time is negatively correlated with the priority.

[0151] For example, if the processing time of candidate solution 1 to solve the problem is 5 seconds, and the processing time of candidate solution 2 to solve the problem is 3 seconds, then candidate solution 2 has a higher priority, while candidate solution 1 has a lower priority.

[0152] In step 150 , a target solution to the problem is determined from the candidate solutions according to the priority, and the problem and the target solution are entered into the online problem system.

[0153] In some implementations, determining a target solution to a problem from candidate solutions according to priority includes:

[0154] (1.1) Select the top three candidate solutions from the candidate solutions in descending order of priority;

[0155] (1.2) The top three candidate solutions are identified as the target solutions to the problem.

[0156] Among them, assuming that the candidate solutions ranked from high to low in priority are candidate solution 1, candidate solution 3, candidate solution 4, candidate solution 2, and candidate solution 5, then the first three candidate solutions are candidate solution 1, candidate solution 3, and candidate solution 4. Candidate solution 1, candidate solution 3, and candidate solution 4 are taken as the target solutions for the problem.

[0157] In this way, the best solution can be selected, improving the speed and efficiency of problem solving.

[0158] It can be seen from the above content that in an embodiment of the present application, by obtaining input question and answer data, the question and answer data includes a problem, a root cause of the problem, and a solution to the problem; the problem, the root cause of the problem, and the solution to the problem are input into a pre-set prompt template, and a prompt text is output; the prompt text is input into a pre-trained question and answer model, and a candidate solution corresponding to the problem is output; the candidate solution is verified for problem solving to determine the priority of each candidate solution; the target solution to the problem is determined from the candidate solutions according to the priority, and the problem and the target solution are entered into the online problem system. In this way, the input question and answer data is understood through a pre-trained question and answer model, so as to obtain multiple candidate solutions corresponding to the problem, and then a target solution with a higher priority is found from the multiple candidate solutions, and finally the problem and the target solution are entered into the online problem system, so that the online problems and the corresponding target solutions are more comprehensive, and the entry completeness of the questions and answers of the online problem system is improved.

[0159] See also Figure 4 , Figure 4 : is another flow chart of the method for generating answers to questions provided in an embodiment of the present application. The method for generating answers to questions may include the following steps:

[0160] Step 301: perform word segmentation processing on the question to obtain at least one word segmentation text;

[0161] Step 302: Obtain a segmentation text vector corresponding to each segmentation text in at least one segmentation text;

[0162] Step 303: Determine the similarity between the word segmentation text vector and the entity vector of any entity in the preset knowledge graph;

[0163] Step 304: determine the entity corresponding to the entity vector having the highest similarity to the segmented text vector as a matching target entity;

[0164] Step 305: determine the text attribute corresponding to each segmented text in the question;

[0165] Step 306: Determine a text attribute combination corresponding to the question based on the text attributes corresponding to each segmented text;

[0166] Step 307: determining target entities with the same text attribute combination in the target entities according to the text attribute combination, and generating an extended question corresponding to the question according to the target entities with the same text attribute combination;

[0167] Step 308: input the expanded problem, problem, root cause of the problem and solution to the problem into a preset prompt template, and output a prompt text;

[0168] Step 309: determine the processing time for each candidate solution to solve the problem;

[0169] Step 310: setting a corresponding priority for each candidate solution according to the processing time, where the processing time is negatively correlated with the priority;

[0170] Step 311: Determine a target solution to the problem from the candidate solutions based on the priority, and enter the problem and the target solution into the online problem system.

[0171] The specific implementation of the question answer generation method corresponding to this embodiment is basically the same as the specific implementation of the above-mentioned question answer generation method, and will not be repeated here.

[0172] See also Figure 5 , Figure 5 400 is a schematic diagram of the structure of the question answer generation device provided in the embodiment of the present application. The question answer generation method can be implemented, and the question answer generation device 400 includes:

[0173] An acquisition module 410 is used to acquire input question and answer data, where the question and answer data includes questions, root causes of the questions, and solutions to the questions;

[0174] The prompt module 420 is used to input the problem, the root cause of the problem and the solution to the problem into a preset prompt template and output a prompt text;

[0175] An input module 430 is used to input the prompt text into the pre-trained question-answering model and output candidate solutions corresponding to the question;

[0176] A verification module 440 is used to verify the problem solving of the candidate solutions to determine the priority of each candidate solution;

[0177] The input module 450 is used to determine the target solution of the problem from the candidate solutions according to the priority, and input the problem and the target solution into the online problem system.

[0178] In some implementations, the question answer generating apparatus further includes a matching module 460, which is used to:

[0179] Before inputting the problem, the root cause of the problem and the solution to the problem into a preset prompt template, performing word segmentation processing on the problem to obtain at least one word segmentation text;

[0180] Match at least one segmented text with an entity in a preset knowledge graph to obtain a matching target entity;

[0181] Generate an extended question corresponding to the target entity;

[0182] The prompt module 420 is used to:

[0183] Input the expanded question, problem, root cause of the problem and solution to the problem into the pre-set prompt template and output the prompt text.

[0184] In some implementations, the matching module 460 is configured to:

[0185] Obtain a segmented text vector corresponding to each segmented text in at least one segmented text;

[0186] Determine the similarity between the word segmentation text vector and the entity vector of any entity in the preset knowledge graph;

[0187] The entity corresponding to the entity vector with the highest similarity to the word segmentation text vector is determined as the matching target entity.

[0188] In some implementations, the matching module 460 is configured to:

[0189] Determine the text attributes corresponding to each word segmentation text in the question;

[0190] Determine the text attribute combination corresponding to the question according to the text attributes corresponding to each segmented text;

[0191] According to the text attribute combination, the target entity with the same text attribute combination is determined in the target entity, and the extended question corresponding to the question is generated according to the target entity with the same text attribute combination.

[0192] In some implementations, the verification module 440 is configured to:

[0193] Determine how long it will take for each candidate solution to solve the problem;

[0194] A corresponding priority is set for each candidate solution according to the processing time, and the processing time is negatively correlated with the priority.

[0195] In some implementations, the verification module 440 is configured to:

[0196] Select the top three candidate solutions from the candidate solutions in descending order of priority;

[0197] The top three candidate solutions are identified as the target solutions to the problem.

[0198] In some implementations, the acquisition module 410 is configured to:

[0199] Obtain target historical issues whose occurrence frequency is higher than a preset occurrence frequency threshold;

[0200] Determine the historical solutions and root causes of the historical problems corresponding to the target historical problems;

[0201] Generate question-answering data based on target historical problems, historical solutions, and historical root causes of problems.

[0202] The specific implementation of the question answer generation device is basically the same as the specific implementation of the above-mentioned question answer generation method, and will not be repeated here.

[0203] As can be seen from the above, in the embodiment of the present application, the acquisition module 410 is used to obtain the input question and answer data, and the question and answer data includes the problem, the root cause of the problem and the solution to the problem; the prompt module 420 is used to input the problem, the root cause of the problem and the solution to the problem into a pre-set prompt template and output the prompt text; the input module 430 is used to input the prompt text into the pre-trained question and answer model and output the candidate solution corresponding to the problem; the verification module 440 is used to verify the problem solving of the candidate solution to determine the priority of each candidate solution; the entry module 450 is used to determine the target solution to the problem in the candidate solution according to the priority, and enter the problem and the target solution into the online problem system. In this way, the input question and answer data is understood by the pre-trained question and answer model to obtain multiple candidate solutions corresponding to the problem, and then the target solution with a higher priority is found from the multiple candidate solutions, and finally the problem and the target solution are entered into the online problem system, so that the online problems and the corresponding target solutions are more comprehensive, and the entry integrity of the questions and answers of the online problem system is improved.

[0204] The embodiment of the present application also provides a computer device, the computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the above fault handling method when executing the computer program. The computer device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0205] See also Figure 6 , Figure 6The hardware structure of a computer device according to another embodiment is shown, and the computer device includes:

[0206] The processor 501 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0207] The memory 502 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 502 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 502, and the processor 501 calls and executes the question answer generation method of the embodiment of this application;

[0208] Input / output interface 503, used to implement information input and output;

[0209] Communication interface 504, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0210] A bus 505 that transmits information between the various components of the device (e.g., the processor 501, the memory 502, the input / output interface 503, and the communication interface 504);

[0211] The processor 501 , the memory 502 , the input / output interface 503 and the communication interface 504 are connected to each other in communication within the device via the bus 505 .

[0212] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned question answer generation method is implemented.

[0213] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0214] The question and answer generation method, device, computer equipment and storage medium proposed in the present application obtain input question and answer data, which includes questions, root causes of problems and solutions to problems; input the questions, root causes of problems and solutions to problems into a pre-set prompt template and output prompt text; input the prompt text into a pre-trained question and answer model and output candidate solutions corresponding to the problem; verify the candidate solutions to solve the problem to determine the priority of each candidate solution; determine the target solution to the problem from the candidate solutions according to the priority, and enter the problem and the target solution into the online problem system. In this way, the input question and answer data is understood through the pre-trained question and answer model to obtain multiple candidate solutions corresponding to the problem, and then find a target solution with a higher priority from the multiple candidate solutions, and finally enter the problem and the target solution into the online problem system, so that the online problems and the corresponding target solutions are more comprehensive, and the entry integrity of the questions and answers of the online problem system is improved.

[0215] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0216] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0217] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, 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 achieve the purpose of the solution of this embodiment.

[0218] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0219] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0220] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0221] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0222] The units described above as separate components may or may not be physically separated, and the components shown as units 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

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

[0224] 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, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0225] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A method for generating a question answer, characterized in that: include: Obtaining input question-and-answer data, wherein the question-and-answer data includes a question, a root cause of the question, and a solution to the question; Input the problem, the root cause of the problem and the solution to the problem into a preset prompt template, and output a prompt text; Inputting the prompt text into a pre-trained question-answering model, and outputting candidate solutions corresponding to the question; Performing problem-solving verification on the candidate solutions to determine the priority of each candidate solution; A target solution to the problem is determined from among the candidate solutions according to the priority, and the problem and the target solution are entered into an online problem system.

2. The method for generating answers to questions according to claim 1, characterized in that: Before inputting the problem, the root cause of the problem and the solution to the problem into a preset prompt template, the method further includes: Performing word segmentation processing on the question to obtain at least one word segmentation text; Matching the at least one segmented text with an entity in a preset knowledge graph to obtain a matching target entity; Generate an extended question corresponding to the question according to the target entity; The step of inputting the problem, the root cause of the problem and the solution to the problem into a preset prompt template and outputting a prompt text includes: The expanded question, the problem, the root cause of the problem and the solution to the problem are input into a preset prompt template, and a prompt text is output.

3. The method for generating answers to questions according to claim 2, characterized in that: The step of matching the at least one segmented text with an entity in a preset knowledge graph to obtain a matching target entity includes: Obtaining a segmentation text vector corresponding to each segmentation text in the at least one segmentation text; Determine the similarity between the word segmentation text vector and the entity vector of any entity in the preset knowledge graph; The entity corresponding to the entity vector having the highest similarity to the word segmentation text vector is determined as the matching target entity.

4. The method for generating a question answer according to claim 2, characterized in that: The step of generating an extended question corresponding to the question according to the target entity includes: Determine the text attribute corresponding to each of the segmented texts in the question; Determine a text attribute combination corresponding to the question according to the text attributes corresponding to each of the segmented texts; According to the text attribute combination, a target entity with the same text attribute combination is determined in the target entity, and an extended question corresponding to the question is generated according to the target entity with the same text attribute combination.

5. The method for generating a question answer according to claim 1, characterized in that: The problem-solving verification of the candidate solutions to determine the priority of each candidate solution includes: Determine the processing time for each candidate solution to solve the problem; A corresponding priority is set for each of the candidate solutions according to the processing time, and the processing time is negatively correlated with the priority.

6. The method for generating a question answer according to claim 1, characterized in that: Determining a target solution to the problem from among the candidate solutions according to the priority includes: Selecting the first three candidate solutions from the candidate solutions in descending order of priority; The first three of the candidate solutions are determined as target solutions to the problem.

7. The method for generating answers to questions according to claim 1, characterized in that: The step of obtaining the input question and answer data includes: Obtain target historical issues whose occurrence frequency is higher than a preset occurrence frequency threshold; Determine the historical solutions and root causes of the historical problems corresponding to the target historical problems; Question and answer data is generated according to the target historical problem, the historical solution, and the root cause of the historical problem.

8. A question answer generating device, characterized in that: include: An acquisition module is used to acquire input question and answer data, wherein the question and answer data includes questions, root causes of the questions, and solutions to the questions; A prompt module, used for inputting the problem, the root cause of the problem and the solution to the problem into a preset prompt template and outputting a prompt text; An input module, used to input the prompt text into a pre-trained question-answering model and output a candidate solution corresponding to the question; A verification module, used for verifying the problem solving of the candidate solutions to determine the priority of each candidate solution; An input module is used to determine a target solution to the problem from among the candidate solutions according to the priority, and input the problem and the target solution into an online problem system.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the question answer generating method according to any one of claims 1 to 7.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for generating a question answer according to any one of claims 1 to 7 is implemented.