Data enhancement method and device, electronic equipment and storage medium
Through the data enhancement method, query statements are generated and analyzed using language models to establish correspondence relationships, solving the accuracy and efficiency of complex natural language queries, and improving the processing capability and accuracy of the knowledge question and answer system.
Patent Information
- Application Number
- CN202411296103.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-17
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-09-17
AI Technical Summary
The existing search system based on keyword matching has problems such as low query accuracy and inconsistent semantic understanding when processing complex natural language queries, and relies on manual intervention in large-scale data processing, which is inefficient.
Using a data enhancement method, multiple query statements are generated using the first language model, and the second language model executes and analyzes the query statements, generates candidate query statements, and establishes correspondence based on target questions and candidate statements, and adds them to the knowledge question and answer system. Sample library to improve the accuracy and diversity of query statement generation.
It improves the semantic understanding of complex problems by the knowledge question-and-answer system, reduces manual dependence, improves response efficiency and accuracy, and increases the data quality and coverage of the sample library.
Smart Images

Figure CN119293160A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the field of data enhancement and optimization. It can be used in application scenarios such as intelligent search engines, intelligent question-answering systems, enterprise knowledge bases, and intelligent customer service robots, and specifically relates to a data enhancement method, device, electronic device, and storage medium. Background Art
[0002] With the rapid development of artificial intelligence and natural language processing technology, traditional retrieval systems based on keyword matching are still effective in processing simple queries, but they often show obvious limitations when facing complex and open-domain natural language problems. Especially when the scale of data continues to expand, how to improve the accuracy of queries and the response efficiency of the system has become a problem that needs to be solved urgently. Summary of the invention
[0003] The present disclosure provides a data enhancement method, device, electronic device and storage medium.
[0004] According to one aspect of the present disclosure, a data enhancement method is provided, the method comprising:
[0005] Identify target issues in target areas;
[0006] Generate multiple query statements for the target question using the first language model;
[0007] Execute each query statement using the second language model to obtain a query record corresponding to each query statement;
[0008] Analyze each query statement and its corresponding query record using the first language model to obtain candidate query statements;
[0009] Generate a corresponding relationship based on the target question and the candidate query statements;
[0010] The corresponding relationship is added to a sample library of the knowledge question answering system. The sample library is used to support the knowledge question answering system in matching query statements. The knowledge question answering system is used to support knowledge question answering in a target field.
[0011] According to another aspect of the present disclosure, a data enhancement device is provided, the device comprising:
[0012] The determination module is used to determine the target problem in the target area;
[0013] A first generation module, configured to generate multiple query statements for a target question using a first language model;
[0014] A query execution module, used to execute each query statement using the second language model to obtain a query record corresponding to each query statement;
[0015] An analysis module, configured to analyze each query statement and its corresponding query record using the first language model to obtain a candidate query statement;
[0016] A second generation module is used to generate a corresponding relationship based on the target question and the candidate query statement;
[0017] The updating module is used to add the corresponding relationship to the sample library of the knowledge question answering system, the sample library is used to support the knowledge question answering system to match query statements, and the knowledge question answering system is used to support knowledge question answering in the target field.
[0018] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0019] at least one processor; and
[0020] a memory communicatively connected to the at least one processor; wherein,
[0021] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any method in the embodiments of the present disclosure.
[0022] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any method according to the embodiments of the present disclosure.
[0023] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements any method according to the embodiments of the present disclosure when executed by a processor.
[0024] The solution disclosed in the present invention can increase the data quality and coverage of the sample library, improve the system's matching speed and accuracy for similar questions, and enhance the processing efficiency and accuracy of the knowledge question-answering system in the target field.
[0025] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0027] Figure 1 is a flowchart of a data enhancement method according to an embodiment of the present disclosure;
[0028] Figure 2is a schematic diagram of the relationship between the data enhancement system and the knowledge question answering system according to an embodiment of the present disclosure;
[0029] Figure 3 is a flow chart of data enhancement according to an embodiment of the present disclosure;
[0030] Figure 4 is a schematic diagram of the structure of a data enhancement device according to an embodiment of the present disclosure;
[0031] Figure 5 is a schematic diagram of a scenario of a data enhancement method according to an embodiment of the present disclosure;
[0032] Figure 6 It is a schematic diagram of the structure of an electronic device used to implement the data enhancement method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0034] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The term "at least one" in this article means any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C. The terms "first" and "second" in this article refer to multiple similar technical terms and distinguish them. They do not mean to limit the order or to limit them to only two. For example, the first feature and the second feature refer to two types / two features. The first feature can be one or more, and the second feature can also be one or more.
[0035] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0036] Before introducing the technical solutions of the embodiments of the present disclosure, the technical terms that may be used in the present disclosure are further explained:
[0037] Data augmentation: refers to increasing the diversity and coverage of data sets by expanding, transforming or synthesizing existing data to improve the performance of the model when processing unknown or unseen data. Specific techniques include data generation, resampling, data augmentation, etc., which are used to improve the generalization ability of the model, reduce the risk of overfitting, and enhance the processing ability of complex queries.
[0038] Knowledge question answering system: A system that combines natural language processing, information retrieval and machine learning. It can generate query statements based on users' natural language questions and retrieve relevant answers from structured or unstructured knowledge bases. The system relies on sample libraries and large models for semantic analysis, question understanding and answer generation, and supports automated answers to complex domain problems.
[0039] Logging: Records detailed data during system operation, including queries entered by users, query statements generated by the model, and query execution results (such as query time, amount of data returned, error messages, etc.). This is used to analyze system performance, identify problems, optimize model behavior, and provide a basis for data enhancement and system tuning.
[0040] In the related art, the retrieval system based on keyword matching has problems such as low query accuracy and inconsistent semantic understanding when processing complex natural language queries, and relies on manual intervention in large-scale data processing, which is inefficient. Therefore, how to improve the accuracy and diversity of query generation, enhance the system's semantic understanding of complex problems, reduce manual dependence, and improve response efficiency and accuracy are key issues that need to be solved in this technical field.
[0041] In order to at least partially solve one or more of the above-mentioned problems and other potential problems, the present disclosure proposes a data enhancement method, which significantly improves the accuracy and diversity of query statement generation, enhances the system's semantic understanding of complex problems, reduces manual dependence, and improves response efficiency and accuracy.
[0042] The present disclosure provides a data enhancement method. Figure 1 : is a flow chart of a data enhancement method according to an embodiment of the present disclosure, and the data enhancement method can be applied to a data enhancement device. The data enhancement device is located in an electronic device. The electronic device includes but is not limited to a fixed device and / or a mobile device. For example, a fixed device includes but is not limited to a server, and the server can be a cloud server or an ordinary server. For example, a mobile device includes but is not limited to: a mobile phone, a tablet computer. In some possible implementations, the data enhancement method can also be implemented by a processor calling a computer-readable instruction stored in a memory. Figure 1 As shown, the data enhancement method includes:
[0043] S101. Determine the target problem in the target area;
[0044] S102, generating multiple query statements for the target question using the first language model;
[0045] S103, executing each query statement using the second language model to obtain a query record corresponding to each query statement;
[0046] S104, using the first language model to analyze each query statement and its corresponding query record to obtain a candidate query statement;
[0047] S105, generating a corresponding relationship based on the target question and the candidate query statements;
[0048] S106. Add the corresponding relationship to a sample library of the knowledge question answering system. The sample library is used to support the knowledge question answering system in matching query statements. The knowledge question answering system is used to support knowledge question answering in a target field.
[0049] In the embodiments of the present disclosure, the target domain refers to a problem domain with complex knowledge and information requirements within a specific industry or profession, which usually involves cross-domain semantic understanding and knowledge retrieval. The target domain includes but is not limited to: finance, medical care, law, education, manufacturing, e-commerce, scientific research and development, customer service, etc. The knowledge question-answering systems in these fields require high-precision information matching and question answering.
[0050] In the embodiments of the present disclosure, the target problem refers to the specific problem that the system needs to solve, which is usually presented in the form of natural language and involves complex semantic understanding and information retrieval. The target problem includes, but is not limited to: queries raised by users in specific fields, key issues in technical documents, information requirements in business processes, problem settings in data analysis, etc.
[0051] In the disclosed embodiments, a query statement refers to an expression generated for a target question for information retrieval in a knowledge question answering system. The query statement is usually generated by a natural language model and is intended to accurately reflect the semantic requirements of the target question. The query statement includes, but is not limited to: natural language questions, structured query requests, keyword combinations, semantic search expressions, etc., which can trigger the retrieval and matching of relevant information in a knowledge base or database.
[0052] In the disclosed embodiment, the query record refers to the detailed results and status information of each query statement during execution. The query record includes, but is not limited to: the time of query execution, the amount of data returned, the content of the query result, the status of success or failure of execution, error information, response time, etc. These records are used to analyze the effectiveness of query execution and optimize the generation process of query statements, thereby improving the accuracy and efficiency of the system.
[0053] In the disclosed embodiment, the first language model refers to a natural language processing model for generating query statements, which can understand and parse the semantic structure of the target question to generate a variety of query expressions. The first language model includes, but is not limited to: a pre-trained language generation model, a language model based on the Transformer architecture, a semantic matching model, or a language generation model optimized specifically for a specific field. These models can generate a variety of possible query statements based on the input natural language questions, ensuring the system's coverage and processing capabilities for different query forms.
[0054] In the disclosed embodiment, the second language model refers to a natural language processing model used to execute query statements and evaluate their effects, which is responsible for applying the generated query statements to a database or knowledge base, obtaining query results and generating corresponding query records. The second language model includes, but is not limited to: a pre-trained language understanding model, a question-answering model, a retrieval optimization model, or a language model fine-tuned for a specific field. These models can not only execute queries, but also analyze the accuracy, relevance and amount of data returned of the query results, and provide feedback to the system to optimize the generation and adjustment of subsequent query statements.
[0055] In some embodiments, determining a target question in a target domain includes: obtaining a natural language question input by a user, analyzing the semantic structure of the question, identifying core information related to the target domain, and normalizing the question to generate a standardized question expression suitable for the query.
[0056] In some embodiments, a first language model is used to generate multiple query statements for the target question, including: analyzing the semantics of the target question through a trained natural language model, and generating multiple possible query expressions based on predefined rules or a large model to cover different query angles and information needs.
[0057] In some implementations, each query statement is executed using the second language model to obtain a query record corresponding to each query statement, including: inputting the generated query statement into a knowledge base or database, performing a retrieval operation, and recording the execution time, returned results, and related status information during the retrieval process.
[0058] In some embodiments, the first language model is used to analyze each query statement and its corresponding query record to obtain a candidate query statement, including: using the language model to analyze the logic, accuracy and effectiveness of the query statement based on the amount of data, error information and execution time in the query record, thereby generating an improved candidate query statement.
[0059] In some implementations, generating a correspondence based on the target question and the candidate query statements includes: evaluating each candidate query statement, selecting a query statement that best matches the target question, and establishing a correspondence between them and the target question for subsequent query matching.
[0060] In some embodiments, the correspondence is added to a sample library of a knowledge question-answering system, including: storing the correspondence between the generated target question and the query statement in the sample library, and the sample library is used to optimize the accuracy of queries and answers by matching historical samples in subsequent query processes.
[0061] For example, in a medical knowledge question-and-answer system, the target domain is medical diagnosis. The user enters "What drugs can treat diabetes?" as the target question. The system first determines that the target domain is the medical field, and the target question is "What drugs can treat diabetes." The first language model generates multiple query statements, such as "Drugs for diabetes treatment," "List of commonly used drugs for diabetes treatment," "Recommendations for diabetes patients," etc. The second language model executes these query statements in the medical database and obtains query records corresponding to each query statement, including query results, execution time, amount of data returned, etc. The first language model analyzes these query records and generates candidate query statements, such as "Best drugs for diabetes treatment," based on the relevance and accuracy of the query results. The system generates a correspondence based on the target question and the candidate query statements, and establishes a query match between "diabetes" and "drugs for treatment." This correspondence is added to the sample library of the knowledge question-and-answer system for query matching of similar questions in the future.
[0062] In the technical solution of the embodiment of the present disclosure, the first language model and the second language model work together to generate diversified query statements and optimize the breadth and accuracy of the query. The second language model executes the query and analyzes the results, further improves the query statement, and establishes a corresponding relationship between it and the target question, which is stored in the sample library, thereby increasing the data quality and coverage of the sample library, improving the matching speed and accuracy of the system for similar questions, and enhancing the processing efficiency and accuracy of the knowledge question answering system in the target field.
[0063] In some embodiments, determining a target problem in a target area further includes:
[0064] Get the log records of the knowledge question answering system;
[0065] Filter out issues to be enhanced from log records;
[0066] The problem to be enhanced is normalized to obtain the target problem.
[0067] In the disclosed embodiment, normalization processing refers to the process of standardizing the enhanced questions so that they conform to the unified format or specification of the system for better analysis and processing. Specifically, normalization processing includes but is not limited to: removing noise information in the question (such as redundant symbols or stop words), unifying the word form (such as synonym replacement), simplifying complex syntactic structures, and converting the question into a standard expression that the system can recognize. This process ensures that similar questions in different formats or expressions can be processed and matched in a consistent manner, thereby improving the accuracy and efficiency of the system.
[0068] In some embodiments, obtaining log records of the knowledge question answering system includes: the system extracts detailed data of user interaction and query processing. Such data includes, but is not limited to, the query statement entered by the user, the query result generated by the system, the execution status of the query, the timestamp, the amount of data returned, and the user's feedback on the query result, such as rating, like or confirmation button. The above information provides rich contextual support for subsequent analysis.
[0069] In some embodiments, screening the problems to be enhanced from the log records includes: the system first applies the defined success criteria to evaluate the effectiveness of each query result. The success criteria can be based on user feedback (including but not limited to satisfaction, ratings, or likes) or whether the query accuracy of the system reaches a preset threshold. Based on these criteria, the system automatically identifies those problems that fail to meet the success criteria through screening logic and marks them as problems to be enhanced that need further optimization.
[0070] In some embodiments, the questions to be enhanced are normalized, including: the system performs standardization operations on the screened questions. Specifically, the system removes noise information, unifies synonyms and language expressions, and standardizes the grammatical structure of the questions to ensure that these questions can enter the subsequent process in a consistent format. At the same time, the system performs deduplication processing to avoid the repetition of the same or similar questions, so as to improve processing efficiency and optimization effect.
[0071] For example, in a legal consultation Q&A system, the user inputs "What are the compensation methods after contract breach?" as a query multiple times. The system extracts relevant information from the log records, including the user's query statement, the query results generated by the system, the execution time of the query (e.g., the average execution time of each query is 1.2 seconds), the amount of data returned (e.g., the result set contains 20 relevant records), and the user's feedback (the user gives a score of 2 / 5, indicating dissatisfaction with the results). The success criteria adopted by the system include query accuracy and user satisfaction. Specifically, the threshold for query accuracy is set at 80%, and the threshold for user satisfaction is 3.5 / 5. After analysis, the query accuracy for this question is only 65%, and the user feedback score is 2 / 5, both of which do not meet the success criteria preset by the system. Therefore, the system automatically marks this question as a question to be enhanced. Subsequently, the system performs normalization processing on this question to be enhanced. First, the system detects and removes noise information, such as redundant punctuation marks and stop words (e.g., "de", "ma", etc.). Then, the system identifies and unifies synonyms or near-synonymous expressions. For example, it replaces "compensation method" with "compensation form". The system further processes similar query questions from different users, such as "What are the contract breach compensations?" and "What are the compensation methods after breach?" These different expressions are uniformly summarized into a standardized query "Compensation methods after contract breach". While performing the normalization process, the system also performs deduplication on the selected questions to ensure that similar questions do not enter the data enhancement process repeatedly. The deduplication logic is based on the semantic similarity score of the questions. The system adopts a standard of a semantic similarity threshold of 85%. Only questions with a similarity lower than 85% are regarded as different questions and enter the processing flow. Finally, the system takes the standardized "Compensation methods after contract breach" as the target question and inputs it into the subsequent optimization link. By further generating diverse query statements, the system will improve the matching accuracy based on the analysis of user feedback and query results, ensuring that when the user inputs a similar question next time, the system can provide answers with an accuracy rate exceeding 80% and higher user satisfaction.
[0072] In this way, through log analysis and normalization processing, queries with unmet requirements are efficiently identified and optimized. The success criteria screen questions to be enhanced, normalization unifies the format and removes duplicates, improving the processing efficiency and accuracy. The optimized standardized questions help the system provide more accurate query results, enhancing user satisfaction and system performance.
[0073] In some embodiments, using a first language model to generate multiple query statements for a target question further includes:
[0074] Determining the popularity value or difficulty value of the target question;
[0075] Determining the target number of query statements corresponding to the target question according to the popularity value or difficulty value;
[0076] The first language model is used to generate a target number of query statements for the target question.
[0077] In some embodiments, determining the popularity or difficulty of a target question includes: evaluating the number of times the question is asked (i.e., popularity) or the complexity of the question (i.e., difficulty) by analyzing user query logs, historical interaction data, or question frequency in the system. The popularity can be obtained based on the access frequency of the question, while the difficulty can be evaluated by the accuracy of the query results, user feedback, or the language complexity of the question.
[0078] In some embodiments, determining a target number of query statements corresponding to a target question according to a popularity value or a difficulty value includes: the system sets an appropriate number of query statements to be generated according to the popularity value or the difficulty value. Generally, for questions with higher popularity values or greater difficulty values, more query statements need to be generated to increase coverage and improve the diversity and accuracy of queries.
[0079] In some embodiments, using the first language model to generate a target number of query statements for the target question includes: calling a pre-trained language model to generate multiple query statements with different semantics but related to the target question based on the semantic structure of the target question. These query statements can include different expressions, synonym replacements, or other language variants to ensure that the relevance and accuracy of the results are maximized when executing the query.
[0080] In the customer service system of an e-commerce platform, users have entered "How do I return a product?" as a query question many times. The system first evaluates the popularity and difficulty of the question by analyzing user query logs and historical interaction data. The popularity is evaluated based on the number of times the question has been visited. The system found that "How do I return a product?" has been queried 1,000 times in the past week, so the system sets its popularity to 8 (out of 10). At the same time, the system evaluates the difficulty of the question based on user feedback and accuracy of the query results. Due to high user satisfaction (average 4.8 / 5) and a query accuracy of 90%, the system sets the difficulty to 3 (out of 10). Based on the evaluation results of the popularity and difficulty values, the system has developed a strategy: for questions with high popularity but low difficulty values, 6 query statements are generated to ensure coverage breadth and improve search efficiency. Based on this strategy, the system selects 6 query statements as the target number to ensure that semantic searches in different expressions can fully cover possible user inputs. Next, the system calls the pre-trained first language model to generate 6 query statements based on "How do I return a product?" For example, the generated sentences include "What is the return process?", "How to apply for a return?", "How to submit a return request?", "What are the steps for a return?", "How to process a return?", "How does the return policy work?", etc. Each query sentence is expressed differently to ensure that more user expression variations are covered, improve the accuracy and comprehensiveness of the system during search, and thus improve the user's query experience.
[0081] In this way, the number of query statements generated is dynamically adjusted based on the popularity and difficulty values to ensure wide coverage and accuracy of high-popularity questions. By generating diverse query statements, we can better match different user expressions, improve query relevance and user satisfaction, optimize resource utilization, reduce redundant queries, and improve processing efficiency and response quality.
[0082] In some embodiments, using the first language model to generate a target number of query statements for the target question further includes:
[0083] In each loop, a query statement is generated for the target question using the first language model; wherein the number of loops is equal to the target number, and in each loop, at least one parameter of the first language model is different from that in the previous loop.
[0084] In the disclosed embodiment, in each cycle, a query statement is generated for the target question using the first language model, including: calling the pre-trained first language model, taking the target question as input, and generating an initial query statement based on the semantic structure of the question. In order to ensure that each query statement generated has diversity in different cycles, the system adjusts the parameters of the model randomly or according to a preset strategy in each cycle. The specific adjusted parameters may include, but are not limited to: the initialization weight of the word embedding layer, the length of the generated sentence, the change of the syntactic structure, and the replacement probability of synonyms.
[0085] In the disclosed embodiment, by fine-tuning the weights of the word embedding layer, the same word can generate slightly different semantic expressions in different cycles; the length of the generated sentence is adjusted to generate a short sentence once and a longer, more detailed sentence the next time; the syntactic structure is also changed to change the sentence structure from concise to complex or vice versa, increasing diversity; the change in the probability of synonym replacement is also key, by using different synonyms or near-synonyms in each cycle, the query statement maintains semantic consistency but different expressions. These parameter adjustments will generate diverse query statements in each cycle, ensuring maximum coverage of possible user expressions and improving the accuracy and relevance of query results.
[0086] For example, in a medical consultation system, users query "What is the treatment for hypertension?" multiple times. The system first determines the target number of 5 cycles and generates 5 different query statements. In each cycle, the pre-trained first language model is called to generate a query statement with "What is the treatment for hypertension?" as input. In the first cycle, the system generated the query statement "How to treat hypertension?" In the second cycle, by adjusting the weights of the word embedding layer, the statement "What are the common treatments for hypertension?" was generated. In the third cycle, the system increased the length of the sentence and generated the query statement "How should patients with hypertension choose a treatment plan?" In the fourth cycle, the syntactic structure was changed to generate the statement "What are the common methods for treating hypertension?" Finally, in the fifth cycle, "treatment" was replaced with "control" through synonym replacement, and the statement "What are the control measures for hypertension?" was generated.
[0087] In this way, by adjusting the model parameters in each cycle, a variety of query statements are generated to ensure that different expressions of the target question are widely covered. Parameter adjustments such as word embedding weights, sentence length, syntactic structure, and synonym replacement ensure that the query statements are both semantically consistent and diverse. This improves the flexibility and accuracy of the query, better matches user expressions, and increases the relevance and efficiency of the search.
[0088] In some embodiments, generating multiple query statements for the target question using the first language model further includes:
[0089] Repeat the first language model N times, generating a query for the target question each time;
[0090] Collect the query statements generated in each loop to form a query statement set containing N query statements;
[0091] M query statements are selected from the query statement set, where M is less than N, and both M and N are integers greater than 1.
[0092] In some embodiments, the query statements generated in each loop are collected to form a query statement set containing N query statements, including: when the system runs the first language model in each loop, the generated query statements are stored in the query statement cache. The generated statements will not only be recorded, but also sorted according to their frequency of occurrence, the diversity and length of the statements, and the semantic relevance to the target question. In the absence of significant frequency differences, the system will give priority to the diversity and length of the query statements to ensure that the statements have wide coverage and flexible expressions. Finally, after N cycles, the system will summarize the generated query statements into a set for subsequent screening of the optimal M query statements.
[0093] For example, in a financial consulting system, users repeatedly query "How to apply for a personal loan?" The system sets N to 10 cycles and generates 10 query statements using the first language model. The statements generated in each cycle are stored in the query statement cache. The system not only records the generated query statements, but also sorts them according to the frequency of occurrence, the diversity of the statements, the length, and the semantic relevance to the target question. For example, in 10 cycles, statements such as "How to apply for a loan?" and "Personal loan application process?" were generated. The system detected that "How to apply for a loan?" has a high frequency of occurrence, so it ranks high. However, in order to ensure the wide coverage of the query, the system also gives priority to statements with large semantic differences, such as "How to get a personal loan?" and "What are the steps to apply for a loan?" These statements perform better in diversity and semantic coverage. Finally, the system selects 5 query statements with high frequency and strong diversity from the 10 query statements (M=5). These statements are used to match different expressions of subsequent user input to ensure the accuracy and coverage of the query.
[0094] In this way, by generating and filtering query statements in multiple cycles, we ensure wide coverage and high relevance of the query. The system can filter out the best query statements by sorting by frequency, diversity and semantic relevance, making the query results more accurate. This not only improves the matching degree of different user expressions, but also reduces redundant queries, improving the system's query efficiency and user experience.
[0095] In some embodiments, analyzing each query statement and its corresponding query record using the first language model to obtain a candidate query statement further includes:
[0096] Inputting the query record of each query sentence into the first language model;
[0097] Using the first language model, each query statement is analyzed from at least one dimension of logic analysis, grammar checking, and semantic understanding to obtain an improved query statement;
[0098] Generate candidate query statements based on the improved query statements.
[0099] In some embodiments, the query record of each query statement is input into the first language model, including: providing the detailed results and status of each query execution as input data to the first language model. The query record usually includes the execution time, the amount of data returned, error information, etc. By recording this information, the model can understand the actual problems or performances encountered by each query during execution, thereby providing data support for subsequent optimization. For example, if the amount of data returned by a query is too small or the query execution time is too long, the model can be adjusted based on these feedback data to improve the effectiveness of the query.
[0100] In some embodiments, the first language model is used to analyze each query statement from at least one dimension of logical analysis, grammatical checking, and semantic understanding, including: the model directly optimizes the original query statement based on the information recorded in the query, combined with grammatical checking, logical analysis, and semantic understanding. If the model supports it, the system can directly modify the original query statement, such as fixing logical errors or parts that do not conform to grammatical rules, to ensure that the query structure is clearer and more accurate. In addition, the model can also generate new statements based on the semantic understanding of the query statement. These new statements not only fix the problems of the original query, but also are comprehensively optimized in terms of logic, grammar, and semantics to make them more in line with the user's intentions.
[0101] In some embodiments, generating candidate query statements based on improved query statements includes: the system generates a set of improved query statements, which not only solve the problems in the original query, but also introduce diversity to ensure coverage of a wider range of user input expressions. These candidate query statements will be evaluated based on the execution results (such as relevance, accuracy, diversity, etc.). The evaluation method can be manual evaluation, automatic scoring, or a combination of the two, and finally select the candidate statement that best meets the query requirements.
[0102] For example, in an e-commerce recommendation system, a user enters "the best choice for buying a mobile phone". The system uses the first language model to generate initial query statements, such as "best-selling mobile phone recommendations" and "high-cost mobile phone rankings", and returns the results by querying the database. During the query execution process, the system records the query execution time, the number of products returned, and error information, such as some queries timed out due to excessive data returned or some query results were irrelevant. The system inputs the query records of each query statement (such as execution time, amount of returned data, etc.) into the first language model for further analysis. Through logical analysis and grammar checking, the model finds that some query statements are too vague, resulting in a too large search range. For example, "best-selling mobile phone recommendations" does not limit the price range, the result set is too large and does not meet the actual needs of users. Based on the feedback information in the query records, the model adjusts the syntax and logical structure of the query statement and generates more accurate query statements, such as "best-selling mobile phone recommendations under 3,000 yuan" and "2024 smart phone rankings". These improved query statements not only solve the problem of being too broad or vague in the original query, but also make the query more in line with user intentions through logical optimization and semantic enhancement. Subsequently, the system generates a set of candidate queries based on these improved queries, and selects the queries that best meet user needs through automated evaluation (e.g., relevance scoring, semantic diversity evaluation, etc.) and partial manual review. The evaluation criteria include the accuracy, diversity, and execution efficiency of the returned results, ultimately providing users with more accurate recommendation results.
[0103] In this way, by analyzing query records and optimizing query statements, the system can improve the relevance and efficiency of queries. Through improvements in logic, syntax, and semantics, the query statements generated by the system are more accurate, reduce irrelevant information, and meet user needs. Candidate query statements are rigorously evaluated to ensure their relevance, accuracy, and diversity, thereby enhancing the quality of query results and user experience.
[0104] In some embodiments, generating a corresponding relationship based on the target question and the candidate query statement further includes:
[0105] Evaluate each candidate query statement and obtain an evaluation result;
[0106] The candidate query statements whose evaluation values are greater than a preset threshold are used as backup query statements;
[0107] Establish a correspondence between the target question and the alternative query statements.
[0108] In some embodiments, each candidate query statement is evaluated to obtain an evaluation result, including: a comprehensive analysis of the candidate query statement. The core dimensions of the evaluation may include relevance, that is, the degree of match between the query statement and the target question, ensuring that the query statement can accurately reflect the semantics of the target question; accuracy, evaluating whether the query statement can accurately express the intent of the target question; and efficiency, measuring the speed and resource consumption of the query statement when it is executed in the database or search engine. These evaluations can be achieved in a quantitative manner, such as using a specific scoring model or machine learning algorithm to automatically score each query statement, or through manual review to judge the quality of the query statement to ensure a comprehensive evaluation result.
[0109] In some embodiments, candidate query statements with evaluation values greater than a preset threshold are selected as standby query statements, including: the system screens out query statements with evaluation values higher than a preset threshold according to the quantitative scores of the evaluation or the results of manual review. The preset threshold is set according to the actual needs of the system and is used to distinguish high-quality from low-quality query statements. Specifically, the evaluation scores of relevance, accuracy, and efficiency must meet certain standards before they can be selected as standby query statements, which ensures that the screened query statements can be executed quickly and effectively express the core needs of the target problem.
[0110] In some embodiments, establishing a correspondence between a target question and an alternative query statement includes: establishing a one-to-one correspondence between the target question and the selected alternative query statement. This correspondence can take different data structure forms according to system requirements, such as a simple list, a key-value pair, or a more complex graph structure. If the target question changes or the user input is diversified, the correspondence can ensure that the alternative query statement quickly matches the user's needs and provides efficient and accurate results. In this relationship, the target question is used as a description of the user's needs, and the alternative query statement is the optimal query expression that the system can generate to meet the needs.
[0111] For example, in a legal consulting system, the user enters "What are the legal consequences of contract breach?" as the target question. The system generates multiple candidate query statements, such as "Compensation methods for contract breach", "Legal liability after breach", "Legal provisions for contract termination", etc. The system evaluates these candidate query statements and scores them based on dimensions such as relevance, accuracy, and execution efficiency. For example, "Compensation methods for contract breach" scores high in relevance and accuracy, while "Legal provisions for contract termination" performs well in efficiency. After the evaluation, the system selects query statements with evaluation values higher than the preset threshold as backup query statements, such as "Compensation methods for contract breach" and "Legal liability after breach". The system establishes a corresponding relationship between these backup query statements and the target question, and records them in a key-value pair structure: the target question is "What are the legal consequences of contract breach?", and the backup query statements are screened high-quality query expressions. This corresponding relationship ensures that when the user enters a similar question again, the system can quickly match the optimal query and provide accurate legal advice.
[0112] In this way, by comprehensively evaluating candidate query statements, the system can screen out alternative query statements that are highly matched to the target question, ensuring the relevance, accuracy, and execution efficiency of the query. Establishing a correspondence between the target question and high-quality query statements enables the system to quickly respond to user input and provide accurate answers, especially when the user enters a similar question again, the quality of the query results is significantly improved.
[0113] In some embodiments, the data enhancement method may further include:
[0114] Receive questions to be answered;
[0115] Querying at least one query statement corresponding to the question to be answered from the sample library;
[0116] Analyzing at least one query statement using a second language model to obtain a target query statement;
[0117] Inputting a target query statement into a knowledge question answering system, so that the knowledge question answering system acquires relevant knowledge point data from a knowledge database based on the target query statement;
[0118] The relevant knowledge point data is returned to the second language model so that the second language model generates an answer based on the relevant knowledge point data.
[0119] In some embodiments, receiving a question to be answered includes: the system receives a natural language question input by a user and records relevant timestamps and user information. The question is parsed as a question to be answered and enters a subsequent processing flow. At this point, the system automatically records basic information about the question, such as input time and preliminary analysis of the question, to ensure subsequent performance tracking.
[0120] In some embodiments, searching for at least one query statement corresponding to the question to be answered from the sample library includes: the system searches for multiple query statements similar to the question input by the user from the sample library. The sample library analyzes the semantics of the question input by the user, finds several historical queries closest to it, and returns relevant query statements for subsequent analysis. This process ensures that the query statement can cover different expressions or ways of expressing the question input by the user.
[0121] In some embodiments, at least one query statement is analyzed using a second language model to obtain a target query statement, including: the second language model analyzes the query statement extracted from the sample library to evaluate its relevance, accuracy, and potential optimization space. The analysis content may involve grammar checking, semantic understanding, etc. The model generates or selects a target query statement that most accurately reflects the user's question intention based on the analysis results. This target query statement has a high degree of matching and helps the system find the most relevant answer from the knowledge base.
[0122] In some embodiments, inputting a target query statement into a knowledge question answering system so that the knowledge question answering system acquires relevant knowledge point data from a knowledge database based on the target query statement includes: the system inputs the generated target query statement into the knowledge question answering system, and the knowledge question answering system uses the query statement to retrieve relevant knowledge points from a professional knowledge database. These knowledge points reflect the system's understanding of the target question and serve as a basis for generating an answer.
[0123] In some embodiments, the relevant knowledge point data is returned to the second language model so that the second language model generates an answer based on the relevant knowledge point data, including: the system feeds back the retrieved knowledge point to the second language model, and the model generates a final answer based on the user question and the knowledge point data. The generated answer is not only based on accurate knowledge points, but also can reflect the deep intention of the user's question.
[0124] In addition, the system will generate log records, which record in detail the questions to be answered entered by the user, the query statement generation and analysis process, the knowledge point retrieval process, and the time when the final answer is generated. Log records ensure that the system can track every link of the query when a problem occurs, and provide system performance indicators (such as response time and query efficiency) for subsequent optimization and analysis. These logs provide detailed data support for the health status of the system and problem tracking.
[0125] For example, in a medical question-answering system, a user inputs a question: "What is the best treatment for hypertension?" The system first receives the question and records the user's input time, user ID, and natural language text information of the question. The system parses the question as a "question to be answered" and immediately sends it to the downstream process for processing. Next, the system queries historical query statements similar to the question from the sample library. Through semantic analysis of the user's input question, the system finds several related query statements from the sample library, such as "What are the treatment options for hypertension?", "How to treat hypertension?", and "What are the commonly used drugs for hypertension?". These query statements are matched through a semantic similarity algorithm, and the system selects several historical statements closest to the user's question for further analysis. Then, the system calls the second language model to analyze these query statements and evaluate the relevance, accuracy, and optimization potential of each statement. Through grammatical checking and semantic analysis, the model selects a query statement that most accurately reflects the user's question intent: "What is the standard treatment for hypertension?". The selection of this target query statement is based on the fact that it covers the core intent of the user's question, has the clearest semantics, and is expected to find relevant answers in the knowledge base. The system inputs the generated target query statement into the knowledge question-answering system, which uses the query statement to search from the professional medical knowledge database. After a quick query, the system retrieves a series of knowledge point data related to the treatment of hypertension, including "common drugs (such as angiotensin-converting enzyme inhibitors, beta-blockers)", "dietary control recommendations (such as low-salt diet)" and "lifestyle adjustments (such as regular exercise)". These knowledge point data are returned to the second language model, and the model generates the final answer based on the original question entered by the user and these knowledge points. The answer is: "The best treatment for hypertension usually includes drug therapy (such as angiotensin-converting enzyme inhibitors), low-salt diet and regular exercise, and the specific plan should be adjusted according to individual conditions." This answer combines the latest medical advice in the knowledge base and accurately responds to the user's question. Throughout the process, the system automatically generates log records, which record the execution time and status of each step in detail, including: user input time, query statement generation process, target query statement selection, knowledge point data retrieval time and answer generation time. The log also includes any possible abnormal situations and system performance indicators (such as response time and query efficiency), ensuring detailed performance analysis and problem tracking during system operation.
[0126] In this way, data enhancement methods are used to accurately match user questions, the second language model is used to generate the most relevant query statements, and key knowledge points are quickly retrieved from the knowledge base to generate accurate answers. At the same time, log records ensure that the query process is traceable, support problem troubleshooting and system optimization, improve query efficiency and user experience, and ensure that the system can flexibly respond to complex problems and provide high-quality answers.
[0127] Schematic diagram of the relationship between the data enhancement system and the knowledge question answering system, such as Figure 2 The data enhancement system 202 obtains user questions from the knowledge question answering system 201 and enriches the sample library for the knowledge question answering system 201 .
[0128] The workflow of the knowledge question answering system 201 includes: 201a, obtaining user questions through the interface; 201b, querying related query statements from the sample library based on the user questions, and generating target query statements for the user questions through the language model; 201c, performing knowledge retrieval from the professional knowledge database based on the target query statement to obtain relevant knowledge point data; 201d, generating enhanced answers based on the relevant knowledge point data through the language model and returning them to the user. During the whole process, all target query statements and their query results will be stored in the sample library as an important reference for subsequent data enhancement.
[0129] The workflow of the data enhancement system 202 includes: S202a, screening issues based on user logs to screen out issues to be enhanced; S202b, generating multiple query statements for the issues to be enhanced through the language model; S202c, executing the multiple query statements separately through the language model to obtain execution records; S202d, inputting the execution records of the query statements into the language model to guide the language model to perform self-reflection and error correction; S202e, automatically or manually reviewing the issues to be enhanced, the query statements and their execution records, and evaluating and verifying these query statements according to actual business needs and data security standards, and then sending successful query statements to the sample library. In this way, the data enhancement system can continuously improve the accuracy, efficiency and relevance of queries in repeated cycles.
[0130] The language models used by the knowledge question answering system 201 and the data enhancement system 202 may be different. For example, the data enhancement system 202 uses a heavyweight language model, while the knowledge question answering system 201 uses a lightweight language model.
[0131] In this way, through a continuous feedback loop, the knowledge question answering system can continuously optimize its answer quality. The addition of the data enhancement system further improves the knowledge question answering system's ability to handle complex questions, ensuring the efficiency and accuracy of knowledge point queries, while improving the overall user experience. The application of data enhancement methods in knowledge question answering systems, especially when targeting specific target areas, can significantly improve the performance and accuracy of the system.
[0132] In order to enhance the usability of the sample library, we automatically build a data flywheel to implement data query updates. We export query records from user logs, classify failed tasks, and regenerate query statements using a large model. Then, we manually review the regenerated query statements and import successful examples into the sample library, thereby improving the quality and accuracy of the sample library.
[0133] Figure 3 is a flowchart of data enhancement according to an embodiment of the present disclosure, such as Figure 3 As shown, the process includes:
[0134] S301: Identification and delineation of high-frequency queries.
[0135] The data enhancement system automatically identifies and selects the most frequently used query terms in business scenarios, and identifies high-quality sets. These high-quality sets constitute the initial samples of the database for subsequent data enhancement processes.
[0136] S302: Automatically generate and test query statements.
[0137] Use the language model to generate high-frequency queries multiple times to generate better query statements. For example, by repeatedly running the query to generate query statements 10 times, identify the top 3 query statements with the highest frequency. This step not only improves the efficiency of the query, but also helps reduce the risk of query execution failure.
[0138] S303: Execution recording and status monitoring.
[0139] The data enhancement system records the results and status of each query execution of the language model in detail, including execution time, amount of data returned, error information, etc. These records can help the large model understand the specific situation of query execution and perform targeted optimization.
[0140] S304: Self-reflection and error correction.
[0141] The query execution records are input into the language model to guide the language model to self-reflect and correct errors. This process involves logical analysis, syntax checking, and semantic understanding of the query to ensure that the generated query is accurate.
[0142] S305: Manual review and sample library update.
[0143] The data enhancement system will submit the regenerated query statements to human review. Professionals will evaluate and verify these query statements based on actual business needs and data security standards. Successful query statements will be imported into the sample library.
[0144] S306: Continuous iteration and optimization.
[0145] The core of the data flywheel is continuous iteration and optimization. Over time, user needs and data environments may change. The system will continuously collect new data and update the knowledge base to ensure that the database is always up to date and most relevant.
[0146] S307: User feedback and system adjustment.
[0147] In order to further improve the effect of the data flywheel, the system will also collect user feedback information. User satisfaction, query accuracy and efficiency are all important feedback indicators. By analyzing these feedbacks, the system can further adjust and optimize the query generation and execution strategies to better meet user needs.
[0148] It should be noted that the language models in S302, S303 and S304 may be the same language model or different language models.
[0149] In this way, multiple query statements are generated through the language model, which increases the diversity of data. This diversity helps to train a more robust and generalized knowledge question-answering system. Since the generated query statements cover multiple possible expressions of the target question, when the system faces similar but slightly different queries raised by actual users, it can better understand and respond, thereby improving the generalization ability of the system. Adding successful query statements as new examples to the sample library of the knowledge question-answering system directly increases the number and coverage of the sample library. The richness of the sample library is particularly important for supervised learning and semi-supervised learning methods because they rely on a large amount of labeled data to train the model. Through in-depth analysis of query statements and their query records by language models, candidate query statements that are most relevant to the user's query intent can be identified, thereby generating more accurate correspondences. This precise correspondence can guide the knowledge question-answering system to select the most appropriate answer or information source when answering user questions, thereby improving the accuracy of questions and answers. Compared with relying entirely on manual annotation to expand the sample library, data augmentation methods can automatically or semi-automatically generate a large amount of labeled data, thereby significantly reducing the cost and time investment of manual annotation, which is particularly important for knowledge question-answering systems that need to be frequently updated and expanded.
[0150] The present disclosure provides a data enhancement device, such as Figure 4As shown, the data enhancement device may include: a first determination module 401, used to determine a target problem in a target domain; a first generation module 402, used to generate multiple query statements for the target problem using a first language model; a query execution module 403, used to execute each query statement using a second language model to obtain a query record corresponding to each query statement; an analysis module 404, used to analyze each query statement and its corresponding query record using the first language model to obtain a candidate query statement; a second generation module 405, used to generate a correspondence based on the target problem and the candidate query statement; an update module 406, used to add the correspondence to a sample library of a knowledge question and answer system, the sample library is used to support the knowledge question and answer system in matching query statements, and the knowledge question and answer system is used to support knowledge question and answer in the target domain.
[0151] In some embodiments, the first determining module 401 includes:
[0152] The acquisition submodule is used to obtain the log records of the knowledge question answering system;
[0153] The first screening submodule is used to screen out issues to be enhanced from log records;
[0154] The first determination submodule is used to normalize the problem to be enhanced to obtain the target problem.
[0155] In some embodiments, the first generating module 402 includes:
[0156] The second determination submodule is used to determine the heat value or difficulty value of the target question;
[0157] The third determination submodule is used to determine the target number of query statements corresponding to the target question according to the heat value or the difficulty value;
[0158] The first generation submodule is used to generate a target number of query statements for a target question by using a first language model.
[0159] In some embodiments, the first generation submodule is used to:
[0160] In each loop, a query statement is generated for the target question using the first language model; wherein the number of loops is equal to the target number, and in each loop, at least one parameter of the first language model is different from that in the previous loop.
[0161] In some embodiments, the first generating module 402 includes:
[0162] The second generation submodule is used to repeatedly run the first language model N times, each time generating a query statement for the target question;
[0163] A submodule is formed to collect query statements generated in each loop to form a query statement set including N query statements;
[0164] The second screening submodule is used to screen out M query statements from the query statement set, where M is less than N, and both M and N are integers greater than 1.
[0165] In some embodiments, the query execution module 403 includes:
[0166] A first input submodule, used to input the query record of each query statement into the first language model;
[0167] An analysis submodule, configured to analyze each query statement from at least one dimension of logic analysis, grammar checking, and semantic understanding using the first language model to obtain an improved query statement;
[0168] The third generation submodule is used to generate candidate query statements based on the improved query statements.
[0169] In some embodiments, the query execution module 403 includes:
[0170] An evaluation submodule is used to evaluate each candidate query statement and obtain an evaluation result;
[0171] A third screening submodule, used to select candidate query statements with evaluation values greater than a preset threshold as standby query statements;
[0172] A submodule is established to establish a corresponding relationship between the target question and the alternative query statement.
[0173] In some embodiments, the apparatus further comprises:
[0174] Receiver module( Figure 4 (not shown) for receiving questions to be answered;
[0175] Query Module( Figure 4 (not shown) for searching at least one query statement corresponding to the question to be answered from the sample library;
[0176] The second determination module ( Figure 4 ), used to analyze at least one query statement using a second language model to obtain a target query statement;
[0177] Get Module( Figure 4 ), for inputting a target query statement into a knowledge question answering system, so that the knowledge question answering system acquires relevant knowledge point data from a knowledge database based on the target query statement;
[0178] The third generation module ( Figure 4), which is used to return the relevant knowledge point data to the second language model so that the second language model can generate an answer based on the relevant knowledge point data.
[0179] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0180] The data enhancement device of the disclosed embodiment can increase the data quality and coverage of the sample library, thereby enhancing the processing efficiency and accuracy of the knowledge question answering system in the target field.
[0181] The present disclosure provides a scenario diagram of a data enhancement method, such as Figure 5 shown.
[0182] As mentioned above, the data enhancement method provided by the embodiment of the present disclosure is applied to electronic devices. Electronic devices are intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices.
[0183] Specifically, the electronic device can perform the following operations:
[0184] Identify target issues in target areas;
[0185] Generate multiple query statements for the target question using the first language model;
[0186] Execute each query statement using the second language model to obtain a query record corresponding to each query statement;
[0187] Analyze each query statement and its corresponding query record using the first language model to obtain candidate query statements;
[0188] Generate a corresponding relationship based on the target question and the candidate query statements;
[0189] Add the corresponding relationship to the sample library of the knowledge question answering system.
[0190] It should be understood that Figure 5 The scene diagram shown is only illustrative and not restrictive. Those skilled in the art can Figure 5 Various obvious changes and / or substitutions can be made to the examples, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.
[0191] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0192] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0193] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0194] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 to a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0195] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0196] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a CPU, a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as data enhancement methods. For example, in some embodiments, the data enhancement method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the data enhancement method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the data enhancement method in any other appropriate manner (eg, by means of firmware).
[0197] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0198] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0199] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0200] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0201] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
[0202] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0203] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0204] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A data enhancement method, comprising: Identify target issues in target areas; Generate multiple query statements for the target question using a first language model; Execute each query statement using the second language model to obtain a query record corresponding to each query statement; Analyzing each query statement and its corresponding query record using the first language model to obtain candidate query statements; Generate a corresponding relationship based on the target question and the candidate query statement; The corresponding relationship is added to a sample library of a knowledge question answering system, the sample library is used to support the knowledge question answering system in matching query statements, and the knowledge question answering system is used to support knowledge question answering in the target domain.
2. The method according to claim 1, wherein: The target questions for determining the target area include: Obtaining log records of the knowledge question answering system; Filtering out issues to be enhanced from the log records; The problem to be enhanced is normalized to obtain the target problem.
3. The method according to claim 1, wherein: The step of generating a plurality of query statements for the target question using the first language model includes: Determine the heat value or difficulty value of the target question; Determine a target number of query statements corresponding to the target question according to the popularity value or the difficulty value; The first language model is used to generate the target number of query statements for the target question.
4. The method according to claim 3, wherein: The step of using the first language model to generate the target number of query statements for the target question includes: In each loop, a query statement is generated for the target question using the first language model; wherein the number of loops is equal to the target number, and in each loop, at least one parameter of the first language model is different from that in the previous loop.
5. The method according to claim 1, wherein: The step of generating a plurality of query statements for the target question using the first language model includes: Repeating running the first language model N times, each time generating a query statement for the target question; Collect the query statements generated in each loop to form a query statement set containing N query statements; M query statements are selected from the query statement set, where M is less than N, and both M and N are integers greater than 1.
6. The method according to claim 1, wherein: The using the first language model to analyze each query statement and its corresponding query record to obtain a candidate query statement includes: Inputting the query record of each query statement into the first language model; Analyzing each query statement from at least one dimension of logic analysis, grammar checking, and semantic understanding using the first language model to obtain an improved query statement; The candidate query statement is generated based on the improved query statement.
7. The method according to claim 1 or 6, wherein: The generating a corresponding relationship based on the target question and the candidate query statement includes: Evaluate each of the candidate query statements to obtain an evaluation result; The candidate query statements whose evaluation values are greater than a preset threshold are used as backup query statements; A corresponding relationship between the target question and the alternate query statement is established.
8. The method according to claim 1, further comprising: Receive questions to be answered; Querying at least one query statement corresponding to the question to be answered from the sample library; Analyzing the at least one query statement using a second language model to obtain a target query statement; Inputting the target query statement into the knowledge question answering system, so that the knowledge question answering system acquires relevant knowledge point data from the knowledge database based on the target query statement; The relevant knowledge point data is returned to the second language model so that the second language model generates an answer based on the relevant knowledge point data.
9. A data enhancement device, comprising: The first determination module is used to determine the target problem in the target field; A first generation module, configured to generate a plurality of query statements for the target question using a first language model; A query execution module, used to execute each query statement using the second language model to obtain a query record corresponding to each query statement; An analysis module, configured to analyze each query statement and its corresponding query record using the first language model to obtain a candidate query statement; A second generating module, configured to generate a corresponding relationship based on the target question and the candidate query statement; An updating module is used to add the corresponding relationship to a sample library of a knowledge question answering system, wherein the sample library is used to support the knowledge question answering system in matching query statements, and the knowledge question answering system is used to support knowledge question answering in the target domain.
10. The device according to claim 9, wherein: The first determining module includes: An acquisition submodule, used to acquire log records of the knowledge question answering system; A first screening submodule, used to screen out issues to be enhanced from the log records; The first determination submodule is used to perform normalization processing on the problem to be enhanced to obtain the target problem.
11. The device according to claim 9, wherein: The first generating module comprises: A second determination submodule is used to determine the popularity value or difficulty value of the target question; A third determination submodule is used to determine a target number of query statements corresponding to the target question according to the popularity value or the difficulty value; The first generating submodule is used to generate the target number of query statements for the target question by using the first language model.
12. The device according to claim 11, wherein The first generating submodule is used for: In each loop, a query statement is generated for the target question using the first language model; wherein the number of loops is equal to the target number, and in each loop, at least one parameter of the first language model is different from that in the previous loop.
13. The device according to claim 9, wherein: The first generating module comprises: A second generation submodule is used to repeatedly run the first language model N times, each time generating a query statement for the target question; A submodule is formed to collect query statements generated in each loop to form a query statement set including N query statements; The second screening submodule is used to screen out M query statements from the query statement set, wherein M is less than N, and both M and N are integers greater than 1.
14. The device according to claim 9, wherein: The query execution module includes: A first input submodule, configured to input the query record of each query statement into the first language model; An analysis submodule, configured to analyze each query statement from at least one dimension of logic analysis, grammar checking, and semantic understanding using the first language model to obtain an improved query statement; The third generating submodule is used to generate the candidate query statement based on the improved query statement.
15. The device according to claim 9 or 14, wherein: The query execution module includes: An evaluation submodule, used to evaluate each of the candidate query statements to obtain an evaluation result; A third screening submodule, used to select candidate query statements with evaluation values greater than a preset threshold as standby query statements; A submodule is established to establish a corresponding relationship between the target question and the backup query statement.
16. The apparatus according to claim 9, further comprising: A receiving module, used for receiving questions to be answered; A query module, used to query at least one query statement corresponding to the question to be answered from the sample library; A second determination module is used to analyze the at least one query statement using a second language model to obtain a target query statement; An acquisition module, configured to input the target query statement into the knowledge question answering system, so that the knowledge question answering system acquires relevant knowledge point data from a knowledge database based on the target query statement; The third generating module is used to return the relevant knowledge point data to the second language model so that the second language model generates an answer based on the relevant knowledge point data.
17. An electronic device comprising: at least one processor; as well as a memory communicatively connected to at least one processor; wherein, The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 8.
18. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are for causing a computer to execute a method according to any one of claims 1-8.
19. A computer program product comprising a computer program stored on a storage medium, the computer program implementing the method according to any one of claims 1 to 8 when executed by a processor.
Citation Information
Patent Citations
Dialogue system training data construction method and device, electronic equipment and storage medium
CN109947924A
Question answer determination method and device, equipment, storage medium and program product
CN115510203A
Knowledge question-answering method and device, equipment and storage medium
CN116737908A
Question and answer method based on FAQ system, computer equipment and storage medium
CN117763108A
Method and system for intelligently generating knowledge query statements driven by large-model and few-sample context learning based on scene awareness
CN118093820A
Cited By
Method, device and equipment for converting natural language into SQL (Structured Query Language) query statement and storage medium
CN120448406A
A method, device and equipment for converting natural language into SQL query statement and storage medium
CN120448406B
Sample generation method and device based on large model and intelligent agent
CN120705584A
Sample generation method and device based on large model and agent
CN120705584B