Training Methods and Related Equipment for Chinese Question Answering Models Based on GraphQL
By using a GraphQL-based Chinese question-answering model training method, an end-to-end Chinese graph question-answering model with effective intermediate representations is generated, which solves the problem of poor controllability of answer output in existing technologies and achieves good quality control of answer data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2026-03-06
AI Technical Summary
Existing technologies lack end-to-end Chinese graph question-answering models with effective intermediate representations, resulting in poor controllability of the answer output.
A GraphQL-based Chinese question-answering model training method is adopted. The target question data is obtained from a batch of Chinese question data, a GraphQL query statement is generated, and the answer data is obtained by combining a semantic analysis model. The dual-tower model structure and BM25 algorithm are introduced into the T5 question-answering model to train the model and generate a question-answering model with effective intermediate representation.
An end-to-end Chinese graph question-answering model with effective intermediate representations was implemented, improving the controllability and quality of the answer output.
Smart Images

Figure CN116701593B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology, specifically to the training of intelligent customer service question-answering models in the insurance industry, and particularly to a GraphQL-based Chinese question-answering model training method and related equipment. Background Technology
[0002] In online customer service scenarios within the financial and insurance industry, automated question answering by chatbots can reduce the workload of customer service representatives and improve service efficiency. In vertical sectors, knowledge-based questions are particularly important; in such cases, graph-based question answering can provide precise answers while incorporating standardized knowledge content, effectively reducing knowledge redundancy compared to FAQ-based question-and-answer retrieval systems.
[0003] Current graph question answering methods mainly fall into two categories: semantic parsing-based methods and keyword retrieval-based methods. The Chinese domain lacks corresponding semantic intermediate representations, typically relying on converting natural language sentences into query statements, such as SPARQL / Cypher. Due to the significant differences between Chinese natural language sentences and query statements, direct generation yields poor results. Therefore, Chinese graph question answering often employs a pipeline approach, lacking end-to-end graph question answering models with effective intermediate representations. This makes directly generating Chinese query statements difficult, and the output of answers is prone to uncontrollability. Thus, current technologies lack end-to-end Chinese graph question answering models with effective intermediate representations, easily leading to poor controllability of answer output. Summary of the Invention
[0004] The purpose of this application is to propose a Chinese question-answering model training method and related equipment based on GraphQL, so as to solve the problem that the existing technology lacks an end-to-end Chinese graph question-answering model with effective intermediate representation, which easily leads to poor controllability of the answer output effect.
[0005] To address the aforementioned technical problems, this application provides a GraphQL-based Chinese question-answering model training method, employing the following technical solution:
[0006] A method for training a Chinese question-answering model based on GraphQL includes the following steps:
[0007] Extract a single target Chinese question data from a batch of Chinese question data;
[0008] Generate GraphQL query statements corresponding to the target Chinese question data according to the GraphQL specification;
[0009] The semantic analysis model is used to obtain the answer data corresponding to the target Chinese question data from a pre-set question-and-answer knowledge base;
[0010] Based on the target Chinese question data, the answer data, and the GraphQL query statement, generate a first text pair and a second text pair;
[0011] Repeat the above steps to construct the first and second text pair sets corresponding to the batch of Chinese question data;
[0012] The first text pair set and the second text pair set are input into the T5 question answering model pre-trained in end-to-end mode to train the T5 question answering model and obtain the trained T5 question answering model.
[0013] New Chinese question data is input into the trained T5 question-answering model, and the model output is used as the answer data.
[0014] Furthermore, before executing the step of generating the GraphQL query statement corresponding to the target Chinese question data according to the GraphQL specification, the method further includes:
[0015] Linearization is performed on all answer data in the question-and-answer knowledge base to obtain several data queues and / or several data linked lists;
[0016] Based on a preset question-and-answer scenario classification entity, the plurality of data queues and / or the plurality of data linked lists are classified into categories. The question-and-answer scenario classification entity includes a plurality of preset key search fields related to the question scenario name.
[0017] The steps for generating the GraphQL query statement corresponding to the target Chinese question data according to the GraphQL specification specifically include:
[0018] Based on the preset word segmentation processing model and the question-and-answer scenario classification entities, the target Chinese question data is segmented.
[0019] Based on the word segmentation processing results, multiple segmentation mapping results corresponding to the target Chinese question data are obtained, wherein the multiple segmentation mapping results represent the segmentation mapping results corresponding to different word segmentation processing results respectively;
[0020] According to the GraphQL specification, the multiple segmentation mapping results are combined into corresponding candidate GraphQL query statements.
[0021] The optimal GraphQL query statement is selected from the candidate GraphQL query statements using the BM25 algorithm and used as the GraphQL query statement corresponding to the target Chinese question data.
[0022] Furthermore, the step of selecting the optimal GraphQL query statement from the candidate GraphQL query statements using the BM25 algorithm as the GraphQL query statement corresponding to the target Chinese problem data specifically includes:
[0023] According to the BM25 algorithm formula: Calculate the score for each candidate GraphQL query, where Q is the current candidate GraphQL query, d is the target Chinese question data, n is the number of word segments constituting the target Chinese question data in the current candidate GraphQL query, i is the current word segmentation number, and ω... i Let q be the weight of the segmented word numbered i, R be the correlation between the segmentation result and the target Chinese problem data, and q be the weight of the segmented word. i The word segmentation numbered i;
[0024] Select the candidate GraphQL query statement with the optimal score as the optimal GraphQL query statement;
[0025] The optimal GraphQL query statement is used as the GraphQL query statement corresponding to the target Chinese question data.
[0026] Furthermore, the step of generating the first text pair and the second text pair based on the target Chinese question data, the answer data, and the GraphQL query statement specifically includes:
[0027] The first text pair is generated using the target Chinese question data as the first KEY value and the answer data as the first VALUE value.
[0028] The second text pair is generated using the target Chinese question data as the second KEY value and the GraphQL query statement as the second VALUE value.
[0029] Furthermore, before performing the step of inputting the first set of text pairs and the second set of text pairs into the T5 question-answering model pre-trained in an end-to-end mode, the method further includes:
[0030] A dual-tower model structure is introduced in advance into the T5 question answering model that has been pre-trained in the end-to-end mode. The dual-tower model structure contains two independent neural network processing structures, namely a first neural network processing structure and a second neural network processing structure.
[0031] The steps for training the T5 question answering model specifically include:
[0032] Obtain the first set of text pairs and the second set of text pairs as input;
[0033] The first text pair set is trained and processed according to the first neural network processing structure, and the first Chinese knowledge graph is output by all target Chinese question data and all corresponding answer data.
[0034] The second text pair set is trained and processed according to the second neural network processing structure, and the output is a second Chinese knowledge graph constructed based on all target Chinese question data and all corresponding GraphQL query statements.
[0035] The first and second Chinese knowledge graphs are integrated to obtain a comprehensive Chinese knowledge graph.
[0036] The comprehensive Chinese knowledge graph is set as the question-answering knowledge graph of the T5 question-answering model;
[0037] After performing the step of training the T5 question-answering model, the method further includes:
[0038] Based on the question-and-answer knowledge graph, all answer data corresponding to the target Chinese question data are obtained, and the top N answer data are selected as the final answer data corresponding to the target Chinese question data based on the sorting rules, where N is a positive integer.
[0039] Furthermore, the step of training the second text pair set according to the second neural network processing structure and outputting a second Chinese knowledge graph constructed based on all target Chinese question data and all corresponding GraphQL query statements specifically includes:
[0040] Retrieve the GraphQL query statements corresponding to each of the target Chinese question data;
[0041] Execute the GraphQL query statement to obtain the answer data of all target Chinese question data according to the corresponding GraphQL query statement;
[0042] The output constructs a second Chinese knowledge graph, consisting of all target Chinese question data and the answer data retrieved according to the corresponding GraphQL queries.
[0043] Furthermore, before performing the step of integrating the first Chinese knowledge graph and the second Chinese knowledge graph to obtain a comprehensive Chinese knowledge graph, the method further includes:
[0044] Obtain a pre-labeled verification set, wherein the pre-labeled verification set includes Chinese question data to be verified and expected answer data corresponding to each Chinese question data to be verified;
[0045] Based on the first Chinese knowledge graph and the first neural network processing structure, output the first actual answer data corresponding to the verification set;
[0046] Based on the second Chinese knowledge graph and the second neural network processing structure, output the second actual answer data corresponding to the verification set;
[0047] The similarity between the first actual answer data, the second actual answer data and the expected answer data is calculated based on a preset similarity algorithm.
[0048] Based on the similarity between the first actual answer data, the second actual answer data and the expected answer data, respectively, set answer data selection weights for the first Chinese knowledge graph and the second Chinese knowledge graph;
[0049] The step of integrating the first Chinese knowledge graph and the second Chinese knowledge graph to obtain a comprehensive Chinese knowledge graph specifically includes:
[0050] Based on the answer data corresponding to the first Chinese knowledge graph and the second Chinese knowledge graph respectively, select weights, and select different numbers of answer data corresponding to the same target Chinese question data from the first Chinese knowledge graph and the second Chinese knowledge graph as preferred answer data;
[0051] Obtain the optimal answer data corresponding to all target Chinese question data, and complete the graph integration of the first Chinese knowledge graph and the second Chinese knowledge graph;
[0052] Obtain a comprehensive Chinese knowledge graph constructed from all target Chinese question data and all corresponding optimal answer data.
[0053] To address the aforementioned technical problems, this application also provides a GraphQL-based Chinese question-answering model training device, which employs the following technical solution:
[0054] A GraphQL-based Chinese question-answering model training device includes:
[0055] The target Chinese issue data acquisition module is used to obtain a single target Chinese issue data from a batch of Chinese issue data;
[0056] The GraphQL query statement generation module is used to generate GraphQL query statements corresponding to the target Chinese question data in accordance with the GraphQL specification.
[0057] The answer data acquisition module is used to acquire the answer data corresponding to the target Chinese question data from a preset question-and-answer knowledge base through a semantic analysis model;
[0058] The text pair generation module is used to generate a first text pair and a second text pair based on the target Chinese question data, the answer data, and the GraphQL query statement;
[0059] The text pair construction module is used to repeatedly execute the above steps to construct the first text pair set and the second text pair set corresponding to the batch of Chinese question data.
[0060] The model training module is used to input the first text pair set and the second text pair set into the T5 question answering model pre-trained in an end-to-end mode, to train the T5 question answering model and obtain the trained T5 question answering model.
[0061] The model execution module is used to obtain new Chinese question data and input it into the trained T5 question-answering model to obtain the model output as the answer data.
[0062] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:
[0063] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the above-described GraphQL-based Chinese question-answering model training method.
[0064] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:
[0065] A computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of the GraphQL-based Chinese question-answering model training method described above.
[0066] Compared with the prior art, the embodiments of this application have the following main advantages:
[0067] The GraphQL-based Chinese question-answering model training method described in this application involves: obtaining a single target Chinese question from a batch of Chinese question data; generating a GraphQL query statement corresponding to the target Chinese question data according to GraphQL specifications; obtaining the answer data corresponding to the target Chinese question data from a pre-set question-answering knowledge base using a language analysis model; generating a first text pair and a second text pair based on the target Chinese question data, the answer data, and the GraphQL query statement; repeating the above steps to construct a first text pair set and a second text pair set corresponding to the batch of Chinese question data; inputting the first text pair set and the second text pair set into a T5 question-answering model pre-trained in an end-to-end mode for T5 question-answering model training to obtain a trained T5 question-answering model; obtaining new Chinese question data and inputting it into the trained T5 question-answering model to obtain the model output result as answer data. By introducing a dual-tower model structure into the end-to-end T5 question-answering model, constructing query statements according to the GraphQL specification, and introducing the BM25 algorithm to filter the optimal GraphQL query statements, an end-to-end Chinese graph question-answering model with effective intermediate representations was trained, and the output of the answer data was subjected to good quality control. Attached Figure Description
[0068] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0069] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0070] Figure 2 A flowchart of an embodiment of the GraphQL-based Chinese question-answering model training method according to this application;
[0071] Figure 3 yes Figure 2 A flowchart of a specific embodiment of step 202 shown;
[0072] Figure 4 A flowchart is shown as a specific embodiment of training a T5 question-answering model according to the embodiments of this application;
[0073] Figure 5 yes Figure 4 A flowchart of a specific embodiment of step 403 shown;
[0074] Figure 6 yes Figure 4A flowchart of a specific embodiment of step 404 shown;
[0075] Figure 7 A schematic diagram of the structure of an embodiment of a GraphQL-based Chinese question-answering model training device according to this application;
[0076] Figure 8 yes Figure 7 A schematic diagram of a specific embodiment of 702 is shown;
[0077] Figure 9 A schematic diagram of a specific embodiment of the verification setting module according to the embodiments of this application is shown;
[0078] Figure 10 A schematic diagram of the structure of an embodiment of the computer device according to this application. Detailed Implementation
[0079] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0080] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0081] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0082] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0083] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0084] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.
[0085] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.
[0086] It should be noted that the GraphQL-based Chinese question-answering model training method provided in this application embodiment is generally executed by a server / terminal device, and correspondingly, the GraphQL-based Chinese question-answering model training device is generally set in the server / terminal device.
[0087] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0088] Continue to refer to Figure 2 The diagram illustrates a flowchart of an embodiment of the GraphQL-based Chinese question-answering model training method according to this application. The GraphQL-based Chinese question-answering model training method includes the following steps:
[0089] Step 201: Obtain a single target Chinese problem data from the batch of Chinese problem data.
[0090] In this embodiment, the batch Chinese question data includes Chinese consultation data of historical policyholders of insurance business, which can be the full Chinese consultation data of historical policyholders of certain insurance companies or a certain insurance company.
[0091] Step 202: Generate the GraphQL query statement corresponding to the target Chinese question data according to the GraphQL specification.
[0092] GraphQL (Graph + Query Language) is a data query specification open-sourced by Facebook in 2015. Traditional query methods primarily rely on data requesters initiating separate query requests to data providers, using different target question-and-answer scenario categories as key search fields. The results for each category are then combined to generate the final query. In contrast, GraphQL generates a single query statement based on the question-and-answer requirements for each category, allowing the user to retrieve the query result in a single request. This reduces the number of query interactions and saves network resources.
[0093] In this embodiment, before executing the step of generating the GraphQL query statement corresponding to the target Chinese question data according to the GraphQL specification, the method further includes: linearizing all answer data in a preset question-and-answer knowledge base to obtain several data queues and / or several data linked lists; classifying the several data queues and / or several data linked lists according to a preset question-and-answer scenario classification entity, wherein the question-and-answer scenario classification entity includes several preset retrieval key fields related to the question scenario name.
[0094] In this embodiment, the question-and-answer scenarios include claims scenarios, insurance purchase scenarios, credit card application scenarios, etc. Taking the credit card application scenario as an example, the preset question-and-answer scenario classification entities may include card application, information entry, application progress, etc.
[0095] First, all answer data in the question-and-answer knowledge base is linearized. Then, entities are classified according to the preset question-and-answer scenarios. Several data queues and / or several data linked lists are categorized to facilitate the querying and extraction of answer data from the question-and-answer knowledge base later.
[0096] Continue to refer to Figure 3 , Figure 3 yes Figure 2 A flowchart of a specific embodiment of step 202 shown includes:
[0097] Step 301: Perform word segmentation on the target Chinese question data according to the preset word segmentation processing model and the question-and-answer scenario classification entity;
[0098] In this embodiment, the preset word segmentation processing model can be an existing Chinese word segmentation processing model, such as the Python-based Jieba Chinese word segmentation model or the Java-based HanLP Chinese word segmentation model.
[0099] Step 302: Based on the word segmentation processing results, obtain multiple segmentation mapping results corresponding to the target Chinese question data, wherein the multiple segmentation mapping results represent the segmentation mapping results corresponding to different word segmentation processing results respectively;
[0100] Step 303: According to the GraphQL specification, combine the multiple segmentation mapping results into corresponding candidate GraphQL query statements;
[0101] Step 304: Select the optimal GraphQL query statement from the candidate GraphQL query statements according to the BM25 algorithm as the GraphQL query statement corresponding to the target Chinese question data.
[0102] In this embodiment, the step of selecting the optimal GraphQL query statement from the candidate GraphQL query statements using the BM25 algorithm as the GraphQL query statement corresponding to the target Chinese question data specifically includes: according to the BM25 algorithm formula: Calculate the score for each candidate GraphQL query, where Q is the current candidate GraphQL query, d is the target Chinese question data, n is the number of word segments constituting the target Chinese question data in the current candidate GraphQL query, i is the current word segmentation number, and ω... i Let q be the weight of the segmented word numbered i, R be the correlation between the segmentation result and the target Chinese problem data, and q be the weight of the segmented word. i The word segmentation is numbered i; the candidate GraphQL query statement with the optimal score is selected as the optimal GraphQL query statement; the optimal GraphQL query statement is used as the GraphQL query statement corresponding to the target Chinese question data.
[0103] In this embodiment, the BM25 algorithm is introduced for optimal solution selection. This is primarily because when multiple word segmentation results exist for the same target Chinese question data, multiple GraphQL queries are generated. Executing each GraphQL query individually would result in excessive query interactions, potentially generating too many irrelevant or low-relevance answer data. Therefore, the BM25 algorithm is used to select the optimal solution, ensuring that the final selected GraphQL query is the most relevant to the target Chinese question data. This avoids excessive query interactions and guarantees the relevance between the answer data and the target Chinese question data.
[0104] Step 203: Obtain the answer data corresponding to the target Chinese question data from the preset question-answering knowledge base through a semantic analysis model.
[0105] In this embodiment, a preset semantic analysis model, such as a natural language understanding model, is first used to analyze the Chinese semantics of the target Chinese question data. Then, the corresponding answer data is directly obtained from the preset question-and-answer knowledge base based on the analyzed Chinese semantics of the target Chinese question data. The answer data is obtained using a semantic analysis-based method.
[0106] Step 204: Generate a first text pair and a second text pair based on the target Chinese question data, the answer data, and the GraphQL query statement.
[0107] In this embodiment, the step of generating a first text pair and a second text pair based on the target Chinese question data, the answer data, and the GraphQL query statement specifically includes: generating the first text pair using the target Chinese question data as the first KEY value and the answer data as the first VALUE value; and generating the second text pair using the target Chinese question data as the second KEY value and the GraphQL query statement as the second VALUE value.
[0108] In this embodiment, the first text pair is constructed by pairing the answer data obtained through semantic analysis in step 203 with the corresponding target Chinese question data, and the second text pair is constructed by pairing the GraphQL query statement generated by the GraphQL specification in step 202 with the target Chinese question data. This ensures that the answer data corresponding to the target Chinese question data is obtained through two different acquisition methods, which facilitates the dual-tower model used later to process the answer data obtained through the two different acquisition methods separately.
[0109] Step 205: Repeat the above steps to construct the first text pair set and the second text pair set corresponding to the batch of Chinese question data.
[0110] Step 206: Input the first text pair set and the second text pair set into the T5 question answering model pre-trained in end-to-end mode to train the T5 question answering model and obtain the trained T5 question answering model.
[0111] The T5 (Text-to-Text Transfer Transformer) model structure is an Encoder-Decoder structure composed of stacked Transformer layers, that is, an end-to-end structure composed of stacked Transformer layers.
[0112] In this embodiment, before performing the step of inputting the first text pair set and the second text pair set into the T5 question answering model pre-trained in an end-to-end mode, the method further includes: introducing a dual-tower model structure into the T5 question answering model pre-trained in an end-to-end mode, wherein the dual-tower model structure contains two independent neural network processing structures, namely a first neural network processing structure and a second neural network processing structure.
[0113] The dual-tower model structure is a model structure concept whose main feature is that the model is divided into two parts, and these two parts recommend solution data separately without affecting or interfering with each other.
[0114] The T5 question-answering model incorporates a dual-tower structure. Its main purpose is to divide the T5 question-answering model into two training parts. One training part trains only on the answer data and corresponding target Chinese question data obtained from the first text pair set to acquire the first Chinese knowledge graph. The other training part trains only on the answer data and corresponding target Chinese question data obtained from the second text pair set to acquire the second Chinese knowledge graph. This approach ensures that when acquiring answer data based on the Chinese question data, whether through the optimal GraphQL query or semantic analysis results, answer data can be obtained. This achieves the training of an end-to-end Chinese graph question-answering model with effective intermediate representations and provides good quality control over the output of the answer data.
[0115] Continue to refer to Figure 4 , Figure 4 A flowchart illustrating a specific embodiment of training a T5 question-answering model according to an embodiment of this application is shown, including:
[0116] Step 401: Obtain the first set of text pairs and the second set of text pairs as input;
[0117] Step 402: Train the first text pair set according to the first neural network processing structure, and output the first Chinese knowledge graph constructed from all target Chinese question data and all corresponding answer data;
[0118] Step 403: Train the second text pair set according to the second neural network processing structure, and output the second Chinese knowledge graph constructed based on all target Chinese question data and all corresponding GraphQL query statements;
[0119] Continue to refer to Figure 5 , Figure 5 yes Figure 4 A flowchart of a specific embodiment of step 403 shown includes:
[0120] Step 501: Obtain the GraphQL query statements corresponding to all target Chinese question data;
[0121] Step 502: Execute the GraphQL query statement to obtain the answer data retrieved by the corresponding GraphQL query statement for all target Chinese question data;
[0122] Step 503: Output the second Chinese knowledge graph constructed from all target Chinese question data and the answer data retrieved according to the corresponding GraphQL query statements.
[0123] Step 404: Integrate the first Chinese knowledge graph and the second Chinese knowledge graph to obtain a comprehensive Chinese knowledge graph;
[0124] In this embodiment, before performing the step of integrating the first Chinese knowledge graph and the second Chinese knowledge graph to obtain a comprehensive Chinese knowledge graph, the method further includes: obtaining a pre-labeled verification set, wherein the labeled verification set includes Chinese question data to be verified and expected answer data corresponding to each Chinese question data to be verified; outputting first actual answer data corresponding to the verification set based on the first Chinese knowledge graph and the first neural network processing structure; outputting second actual answer data corresponding to the verification set based on the second Chinese knowledge graph and the second neural network processing structure; calculating the similarity between the first actual answer data, the second actual answer data and the expected answer data based on a preset similarity algorithm, wherein the preset similarity algorithm can be a comprehensive similarity analysis method, Euclidean distance, cosine similarity algorithm, etc.; setting answer data selection weights for the first Chinese knowledge graph and the second Chinese knowledge graph based on the similarity between the first actual answer data, the second actual answer data and the expected answer data.
[0125] By using an labeled validation set for verification, the similarity between the first actual answer data, the second actual answer data and the expected answer data is verified respectively. In essence, this verifies the usability of the first Chinese knowledge graph and the second Chinese knowledge graph. Data selection weights are set for the first Chinese knowledge graph and the second Chinese knowledge graph respectively, ensuring the quality control of the answer data output by the peer-to-peer model.
[0126] Continue to refer to Figure 6 , Figure 6 yes Figure 4 A flowchart of a specific embodiment of step 404 shown includes:
[0127] Step 601: Select weights based on the answer data corresponding to the first Chinese knowledge graph and the second Chinese knowledge graph respectively, and select different numbers of answer data corresponding to the same target Chinese question data from the first Chinese knowledge graph and the second Chinese knowledge graph as preferred answer data;
[0128] By selecting weights based on the answer data corresponding to the first and second Chinese knowledge graphs respectively, different numbers of answer data corresponding to the same target Chinese question data are selected as preferred answer data from the first and second Chinese knowledge graphs. For example, if a target Chinese question data is input, and the weights of the corresponding first and second Chinese knowledge graphs are 0.8 and 0.2 respectively, and assuming that the expected number of answer data entries is 10, then 8 entries are selected based on the first Chinese knowledge graph and 2 entries are selected based on the second Chinese knowledge graph.
[0129] Step 602: Obtain the optimal answer data corresponding to all target Chinese question data, and complete the graph integration of the first Chinese knowledge graph and the second Chinese knowledge graph;
[0130] Step 603: Obtain a comprehensive Chinese knowledge graph constructed from all target Chinese question data and all corresponding preferred answer data.
[0131] By integrating the first and second Chinese knowledge graphs into a comprehensive Chinese knowledge graph based on weights, the solution data can be directly obtained through the comprehensive Chinese knowledge graph after inputting a target Chinese question.
[0132] Step 405: Set the comprehensive Chinese knowledge graph as the question-answering knowledge graph of the T5 question-answering model.
[0133] In this embodiment, after performing the step of training the T5 question-answering model, the method further includes: obtaining all answer data corresponding to the target Chinese question data according to the question-answering knowledge graph, and selecting the top N answer data based on the sorting rules as the final selected answer data corresponding to the target Chinese question data, where N is a positive integer.
[0134] By obtaining the optimal solution for the target number of entries from the question-and-answer knowledge graph through sorting, the quality control of the answer data output by the peer-to-peer model is further ensured.
[0135] Step 207: Obtain new Chinese question data and input it into the trained T5 question-answering model to obtain the model output as the answer data.
[0136] This application obtains a single target Chinese question from a batch of Chinese question data; generates a GraphQL query statement corresponding to the target Chinese question data according to the GraphQL specification; obtains the answer data corresponding to the target Chinese question data from a pre-set question-answering knowledge base through a language analysis model; generates a first text pair and a second text pair based on the target Chinese question data, the answer data, and the GraphQL query statement; repeats the above steps to construct a first text pair set and a second text pair set corresponding to the batch of Chinese question data; inputs the first text pair set and the second text pair set into a T5 question-answering model pre-trained in an end-to-end mode for T5 question-answering model training to obtain a trained T5 question-answering model; obtains new Chinese question data and inputs it into the trained T5 question-answering model to obtain the model output result as answer data. By introducing a dual-tower model structure into the end-to-end T5 question-answering model, constructing the query statement according to the GraphQL specification, and introducing the BM25 algorithm to select the optimal GraphQL query statement, an end-to-end Chinese graph question-answering model with effective intermediate representation is trained, and the output of the answer data is well-controlled.
[0137] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0138] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0139] In this embodiment, by introducing a dual-tower model structure into the end-to-end T5 question-answering model, constructing query statements according to the GraphQL specification, and introducing the BM25 algorithm to filter the optimal GraphQL query statements, an end-to-end Chinese graph question-answering model with effective intermediate representation is trained, and the output of the answer data is well-controlled.
[0140] Further reference Figure 7 As a response to the above Figure 2 The implementation of the method shown in this application provides an embodiment of a GraphQL-based Chinese question-answering model training device, which is similar to... Figure 2Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0141] like Figure 7 As shown, the GraphQL-based Chinese question-answering model training device 700 described in this embodiment includes: a target Chinese question data acquisition module 701, a GraphQL query statement generation module 702, an answer data acquisition module 703, a text pair generation module 704, a text pair set construction module 705, a model training module 706, and a model execution module 707. Wherein:
[0142] The target Chinese issue data acquisition module 701 is used to acquire a single target Chinese issue data from a batch of Chinese issue data;
[0143] The GraphQL query statement generation module 702 is used to generate GraphQL query statements corresponding to the target Chinese question data in accordance with the GraphQL specification.
[0144] The answer data acquisition module 703 is used to acquire the answer data corresponding to the target Chinese question data from a preset question-and-answer knowledge base through a language analysis model;
[0145] The text pair generation module 704 is used to generate a first text pair and a second text pair based on the target Chinese question data, the answer data, and the GraphQL query statement;
[0146] The text pair construction module 705 is used to repeatedly execute the above steps to construct the first text pair set and the second text pair set corresponding to the batch of Chinese problem data;
[0147] The model training module 706 is used to input the first text pair set and the second text pair set into the T5 question answering model pre-trained in an end-to-end mode, to train the T5 question answering model and obtain the trained T5 question answering model.
[0148] The model execution module 707 is used to obtain new Chinese question data and input it into the trained T5 question-answering model to obtain the model output as answer data.
[0149] Continue to refer to Figure 8 , Figure 8 yes Figure 7 The diagram shows a specific embodiment of the GraphQL query statement generation module 702, which includes a word segmentation processing submodule 801, a mapping result acquisition submodule 802, a GraphQL query statement combination submodule 803, and an optimal GraphQL query statement filtering submodule 804. Wherein:
[0150] The word segmentation processing submodule 801 is used to perform word segmentation processing on the target Chinese question data according to the preset word segmentation processing model and the question-and-answer scenario classification entity;
[0151] The mapping result acquisition submodule 802 is used to acquire multiple segmentation mapping results corresponding to the target Chinese question data based on the word segmentation processing results, wherein the multiple segmentation mapping results represent the segmentation mapping results corresponding to different word segmentation processing results respectively;
[0152] The GraphQL query statement combination submodule 803 is used to combine the multiple segmentation mapping results into corresponding candidate GraphQL query statements according to the GraphQL specification.
[0153] The optimal GraphQL query statement filtering submodule 804 is used to filter the optimal GraphQL query statement from the candidate GraphQL query statements according to the BM25 algorithm as the GraphQL query statement corresponding to the target Chinese question data.
[0154] In some specific embodiments of this application, the GraphQL-based Chinese question-answering model training device 700 further includes a verification setting module, which will be discussed further below. Figure 9 , Figure 9 The diagram illustrates a specific embodiment of the verification setting module according to this application. The verification setting module includes a verification set acquisition submodule 901, a first actual solution data output submodule 902, a second actual solution data output submodule 903, a similarity calculation submodule 904, and a selection weight setting submodule 905. Wherein:
[0155] The verification set acquisition submodule 901 is used to acquire a pre-labeled verification set, wherein the pre-labeled verification set includes Chinese question data to be verified and expected answer data corresponding to each Chinese question data to be verified.
[0156] The first actual answer data output submodule 902 is used to output the first actual answer data corresponding to the verification set based on the first Chinese knowledge graph and the first neural network processing structure.
[0157] The second actual answer data output submodule 903 is used to output the second actual answer data corresponding to the verification set based on the second Chinese knowledge graph and the second neural network processing structure.
[0158] The similarity calculation submodule 904 is used to calculate the similarity between the first actual answer data, the second actual answer data and the expected answer data based on a preset similarity algorithm.
[0159] The weight setting submodule 905 is used to set weights for the answer data in the first Chinese knowledge graph and the second Chinese knowledge graph based on the similarity between the first actual answer data, the second actual answer data and the expected answer data.
[0160] This application obtains a single target Chinese question from a batch of Chinese question data; generates a GraphQL query statement corresponding to the target Chinese question data according to the GraphQL specification; obtains the answer data corresponding to the target Chinese question data from a pre-set question-answering knowledge base through a language analysis model; generates a first text pair and a second text pair based on the target Chinese question data, the answer data, and the GraphQL query statement; repeats the above steps to construct a first text pair set and a second text pair set corresponding to the batch of Chinese question data; inputs the first text pair set and the second text pair set into a T5 question-answering model pre-trained in an end-to-end mode for T5 question-answering model training to obtain a trained T5 question-answering model; obtains new Chinese question data and inputs it into the trained T5 question-answering model to obtain the model output result as answer data. By introducing a dual-tower model structure into the end-to-end T5 question-answering model, constructing the query statement according to the GraphQL specification, and introducing the BM25 algorithm to select the optimal GraphQL query statement, an end-to-end Chinese graph question-answering model with effective intermediate representation is trained, and the output of the answer data is well-controlled.
[0161] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0162] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0163] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 10 , Figure 10 This is a basic structural block diagram of the computer device in this embodiment.
[0164] The computer device 10 includes a memory 10a, a processor 10b, and a network interface 10c that are interconnected via a system bus. It should be noted that only the computer device 10 with components 10a-10c is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0165] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0166] The memory 10a includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10a may be an internal storage unit of the computer device 10, such as the hard disk or memory of the computer device 10. In other embodiments, the memory 10a may also be an external storage device of the computer device 10, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 10. Of course, the memory 10a may also include both the internal storage unit and the external storage device of the computer device 10. In this embodiment, the memory 10a is typically used to store the operating system and various application software installed on the computer device 10, such as computer-readable instructions for training a Chinese question-answering model based on GraphQL. Furthermore, the memory 10a can also be used to temporarily store various types of data that have already been output or will be output.
[0167] In some embodiments, the processor 10b may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 10b is typically used to control the overall operation of the computer device 10. In this embodiment, the processor 10b is used to execute computer-readable instructions stored in the memory 10a or to process data, for example, to execute computer-readable instructions for the GraphQL-based Chinese question-answering model training method.
[0168] The network interface 10c may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 10 and other electronic devices.
[0169] The computer device proposed in this embodiment belongs to the field of financial technology and is applied in the field of intelligent customer service question-answering model training in the insurance industry. This application obtains a single target Chinese question data from a batch of Chinese question data; generates a GraphQL query statement corresponding to the target Chinese question data according to the GraphQL specification; obtains the answer data corresponding to the target Chinese question data from a preset question-answering knowledge base through a language analysis model; generates a first text pair and a second text pair based on the target Chinese question data, the answer data, and the GraphQL query statement; repeats the above steps to construct a first text pair set and a second text pair set corresponding to the batch of Chinese question data; inputs the first text pair set and the second text pair set into a T5 question-answering model pre-trained in an end-to-end mode for T5 question-answering model training to obtain a trained T5 question-answering model; obtains new Chinese question data and inputs it into the trained T5 question-answering model to obtain the model output result as answer data. By introducing a dual-tower model structure into the end-to-end T5 question-answering model, constructing query statements according to the GraphQL specification, and introducing the BM25 algorithm to filter the optimal GraphQL query statements, an end-to-end Chinese graph question-answering model with effective intermediate representations was trained, and the output of the answer data was subjected to good quality control.
[0170] This application also provides another implementation, namely, a computer-readable storage medium storing computer-readable instructions that can be executed by a processor to cause the processor to perform the steps of the GraphQL-based Chinese question-answering model training method described above.
[0171] The computer-readable storage medium proposed in this embodiment belongs to the field of financial technology and is applied to the training of intelligent customer service question-answering models in the insurance industry. This application obtains a single target Chinese question data from a batch of Chinese question data; generates a GraphQL query statement corresponding to the target Chinese question data according to the GraphQL specification; obtains the answer data corresponding to the target Chinese question data from a preset question-answering knowledge base through a language analysis model; generates a first text pair and a second text pair based on the target Chinese question data, the answer data, and the GraphQL query statement; repeats the above steps to construct a first text pair set and a second text pair set corresponding to the batch of Chinese question data; inputs the first text pair set and the second text pair set into a T5 question-answering model pre-trained in an end-to-end mode for T5 question-answering model training to obtain a trained T5 question-answering model; obtains new Chinese question data and inputs it into the trained T5 question-answering model to obtain the model output result as answer data. By introducing a dual-tower model structure into the end-to-end T5 question-answering model, constructing query statements according to the GraphQL specification, and introducing the BM25 algorithm to filter the optimal GraphQL query statements, an end-to-end Chinese graph question-answering model with effective intermediate representations was trained, and the output of the answer data was subjected to good quality control.
[0172] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0173] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. A method for training a Chinese question and answer model based on GraphQL, characterized in that, The method comprises the following steps: obtaining single target Chinese question data from batch Chinese question data; generating a GraphQL query statement corresponding to the target Chinese question data according to a GraphQL specification, specifically including: performing word segmentation processing on the target Chinese question data according to a preset word segmentation processing model and a question and answer scenario classification entity; obtaining a plurality of segmentation mapping results corresponding to the target Chinese question data according to the segmentation processing results, wherein the plurality of segmentation mapping results represent segmentation mapping results corresponding to different segmentation processing results respectively; combining the plurality of segmentation mapping results into corresponding candidate GraphQL query statements respectively according to the GraphQL specification; and selecting an optimal GraphQL query statement from the candidate GraphQL query statements as the GraphQL query statement corresponding to the target Chinese question data according to a BM25 algorithm; obtaining answer data corresponding to the target Chinese question data from a preset question and answer knowledge base through a semantic analysis model; generating a first text pair and a second text pair according to the target Chinese question data, the answer data, and the GraphQL query statement; repeating the above steps to construct a first text pair set and a second text pair set corresponding to the batch Chinese question data; inputting the first text pair set and the second text pair set into a T5 question and answer model pre-trained in an end-to-end mode to perform T5 question and answer model training, and obtaining a trained T5 question and answer model; inputting new Chinese question data into the trained T5 question and answer model to obtain model output results as answer data.
2. The GraphQL-based Chinese question answering model training method according to claim 1, characterized in that, Before the step of generating a GraphQL query statement corresponding to the target Chinese question data according to a GraphQL specification, the method further comprises: linearly processing all answer data in the question and answer knowledge base to obtain a plurality of data queues and / or a plurality of data linked lists; performing category classification on the plurality of data queues and / or the plurality of data linked lists according to a preset question and answer scenario classification entity, wherein the question and answer scenario classification entity comprises a plurality of preset search key fields related to question scenario names.
3. The GraphQL-based Chinese question answering model training method according to claim 1, characterized in that, The step of selecting an optimal GraphQL query statement from the candidate GraphQL query statements as the GraphQL query statement corresponding to the target Chinese question data according to a BM25 algorithm specifically comprises: According to the BM25 algorithm formula: The score value of each candidate GraphQL query statement is calculated, wherein Q is the current candidate GraphQL query statement, d is the target Chinese question data, n is the number of word segmentation constituting the target Chinese question data in the current candidate GraphQL query statement, i is the number of the current word segmentation, ω i is the weight of the word segmentation numbered i, R is the relevance between the word segmentation result and the target Chinese question data, q i is the word segmentation numbered i; selecting a candidate GraphQL query statement with an optimal score value as the optimal GraphQL query statement; selecting the optimal GraphQL query statement as the GraphQL query statement corresponding to the target Chinese question data.
4. The GraphQL-based Chinese question answering model training method according to claim 1, characterized in that, The step of generating a first text pair and a second text pair according to the target Chinese question data, the answer data, and the GraphQL query statement specifically comprises: generating the first text pair by taking the target Chinese question data as a first KEY value and the answer data as a first VALUE value; and generate the second text pair by taking the target Chinese question data as a second KEY value and the GraphQL query statement as a second VALUE value. 5.The GraphQL-based Chinese question answering model training method according to claim 1, characterized in that, Before the step of inputting the first text pair set and the second text pair set into the T5 question and answer model pre-trained in an end-to-end mode, the method further comprises: introducing a double-tower model structure into the T5 question and answer model pre-trained in an end-to-end mode in advance, wherein the double-tower model structure comprises two independent neural network processing structures, namely a first neural network processing structure and a second neural network processing structure; the step of training the T5 question and answer model comprises: obtaining the input first text pair set and the input second text pair set; training and processing the first text pair set according to the first neural network processing structure to output a first Chinese knowledge graph constructed by all target Chinese question data and all corresponding answer data; training and processing the second text pair set according to the second neural network processing structure to output a second Chinese knowledge graph constructed based on all target Chinese question data and all corresponding GraphQL query statements; integrating the first Chinese knowledge graph and the second Chinese knowledge graph to obtain a comprehensive Chinese knowledge graph; setting the comprehensive Chinese knowledge graph as a question and answer knowledge graph of the T5 question and answer model; after the step of training the T5 question and answer model, the method further comprises: obtaining all answer data corresponding to target Chinese question data according to the question and answer knowledge graph, and filtering top N answer data based on a sorting rule as final selected answer data corresponding to the target Chinese question data, wherein N is a positive integer.
6. The GraphQL-based Chinese question answering model training method according to claim 5, characterized in that, the step of training and processing the second text pair set according to the second neural network processing structure to output a second Chinese knowledge graph constructed based on all target Chinese question data and all corresponding GraphQL query statements comprises: obtaining GraphQL query statements corresponding to all target Chinese question data respectively; executing the GraphQL query statements to obtain answer data queried by all target Chinese question data according to corresponding GraphQL query statements respectively; outputting a second Chinese knowledge graph constructed by all target Chinese question data and answer data queried according to corresponding GraphQL query statements respectively.
7. The GraphQL-based Chinese question answering model training method according to claim 6, characterized in that, before the step of integrating the first Chinese knowledge graph and the second Chinese knowledge graph to obtain a comprehensive Chinese knowledge graph, the method further comprises: obtaining a pre-labeled verification set, wherein the labeled verification set comprises Chinese question data to be verified and expected answer data corresponding to each Chinese question data to be verified; outputting first actual answer data corresponding to the verification set according to the first Chinese knowledge graph and the first neural network processing structure; outputting second actual answer data corresponding to the verification set according to the second Chinese knowledge graph and the second neural network processing structure; calculate similarity of the first actual answer data, the second actual answer data and the expected answer data respectively based on a preset similarity algorithm; set answer data selection weights for the first Chinese knowledge graph and the second Chinese knowledge graph respectively according to the similarity of the first actual answer data, the second actual answer data and the expected answer data respectively; the step of integrating the first Chinese knowledge graph and the second Chinese knowledge graph to obtain a comprehensive Chinese knowledge graph, specifically comprising: select different numbers of answer data corresponding to the same target Chinese question data from the first Chinese knowledge graph and the second Chinese knowledge graph as preferred answer data according to the answer data selection weights corresponding to the first Chinese knowledge graph and the second Chinese knowledge graph respectively; obtain preferred answer data corresponding to all target Chinese question data, and complete the integration of the first Chinese knowledge graph and the second Chinese knowledge graph; obtain a comprehensive Chinese knowledge graph constructed by all target Chinese question data and all corresponding preferred answer data.
8. A GraphQL-based Chinese question and answer model training apparatus, characterized in that, comprise: a target Chinese question data acquisition module for acquiring single target Chinese question data from batch Chinese question data; a GraphQL query statement generation module for generating a GraphQL query statement corresponding to the target Chinese question data in accordance with the GraphQL specification, specifically comprising: performing word segmentation processing on the target Chinese question data according to a preset word segmentation processing model and a question and answer scenario classification entity; obtaining a plurality of segmentation mapping results corresponding to the target Chinese question data according to the word segmentation processing result, wherein the plurality of segmentation mapping results represent segmentation mapping results corresponding to different word segmentation processing results respectively; combining the plurality of segmentation mapping results into corresponding candidate GraphQL query statements respectively according to the GraphQL specification; and selecting an optimal GraphQL query statement from the candidate GraphQL query statements as the GraphQL query statement corresponding to the target Chinese question data according to a BM25 algorithm; an answer data acquisition module for acquiring answer data corresponding to the target Chinese question data from a preset question and answer knowledge base through a semantic analysis model; a text pair generation module for generating first and second text pairs according to the target Chinese question data, the answer data and the GraphQL query statement; a text pair set construction module for repeatedly executing the above steps to construct first and second text pair sets corresponding to the batch Chinese question data; a model training module for inputting the first and second text pair sets into a T5 question and answer model pre-trained in an end-to-end mode to train the T5 question and answer model and obtain a trained T5 question and answer model; a model execution module for inputting new Chinese question data into the trained T5 question and answer model to obtain model output results as answer data.
9. A computer device comprising a memory and a processor, wherein the memory stores computer readable instructions, and the processor executes the computer readable instructions to implement the steps of the GraphQL-based Chinese question answering model training method in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer readable instructions, and the processor executes the computer readable instructions to implement the steps of the GraphQL-based Chinese question answering model training method in any one of claims 1 to 7.
Citation Information
Patent Citations
Query language interoperability in a graph database
CN110291517A
Intelligent question and answer method, device and equipment and storage medium
CN114416927A
Text processing method, question and answer text processing method and text processing model training method
CN116050405A