Data enhancement method and device, electronic equipment and storage medium
By having the first and second language models work together to generate and optimize query statements, the problems of low accuracy and efficiency of traditional retrieval systems in processing complex questions are solved, and efficient and accurate semantic understanding and response of the knowledge question answering system are achieved.
Patent Information
- Application Number
- CN202411296103.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-17
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-09-17
AI Technical Summary
Traditional keyword matching-based retrieval systems have problems such as low query accuracy, inconsistent semantic understanding, reliance on manual intervention, and low efficiency when dealing with complex, open-domain natural language questions.
The first language model is used to generate multiple query statements, and the second language model is used to execute and analyze the query records to generate candidate query statements. The corresponding relationships are added to the sample library of the knowledge question-answering system to optimize the query statement generation and matching process.
It 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.
Smart Images

Figure CN119293160B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of data enhancement and optimization, and can be used in application scenarios such as intelligent search engines, intelligent question-answering systems, enterprise knowledge bases, and intelligent customer service robots. It 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 technologies, traditional keyword-matching retrieval systems remain effective for simple queries, but often exhibit significant limitations when faced with complex, open-domain natural language queries. Especially as data volumes continue to expand, improving query accuracy and system response efficiency has become a pressing challenge. 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 the target area;
[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 query records 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 correspondence between the target question and the candidate query statements;
[0010] The corresponding relationship is added to the 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 the target field.
[0011] According to another aspect of the present disclosure, a data enhancement device is provided, the device comprising:
[0012] Identification module, used to identify target problems in the target area;
[0013] A first generation module is used to generate multiple query statements for the target question using the first language model;
[0014] A query execution module, configured 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 candidate query statements;
[0016] The second generation module is used to generate a corresponding relationship based on the target question and the candidate query statement;
[0017] The update 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 in matching query statements. 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 perform 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. When the computer program is executed by a processor, the computer program implements any one of the methods according to the embodiments of the present disclosure.
[0024] The solution disclosed in this disclosure 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 contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings are provided to facilitate a better understanding of the present invention 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 structural diagram 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 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 description of exemplary embodiments of the present disclosure is made 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 appreciated by those skilled 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, descriptions of well-known functions and structures are 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 can 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, and do not mean to limit the order or to limit to only two. For example, the first feature and the second feature refer to two categories / two features. The first feature can be one or more, and the second feature can also be one or more.
[0035] In addition, numerous specific details are provided in the following detailed description to better illustrate the present disclosure. Those skilled in the art will appreciate that the present disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main points of the present disclosure.
[0036] Before introducing the technical solutions of the embodiments of the present disclosure, the following technical terms that may be used in the present disclosure are further explained:
[0037] Data augmentation: refers to the expansion, transformation or synthesis of existing data to increase the diversity and coverage of the data set, so as to improve the performance of the model in processing unknown or unseen data. Specific techniques include data generation, resampling, data expansion, 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 Q&A system: a system that combines natural language processing, information retrieval and machine learning, which can generate query statements according to user's natural language questions, and retrieve relevant answers from structured or unstructured knowledge base. The system relies on sample library and large model for semantic analysis, question understanding and answer generation, and supports automatic answer to complex domain questions.
[0039] Log recording: records detailed data during system operation, including user input queries, model generated query statements, query execution results (such as query time, data return amount, error information, etc.), which is used to analyze system performance, identify problems, optimize model behavior, and provide basis for data augmentation and system tuning.
[0040] In the related art, the retrieval system based on keyword matching has the problems of low query accuracy, inconsistent semantic understanding, etc. when processing complex natural language queries, and relies on manual intervention in large-scale data processing, which is low in efficiency. Therefore, how to improve the accuracy and diversity of query generation, enhance the semantic understanding of the system to complex problems, reduce the dependence on manual intervention, and improve the response efficiency and accuracy, are the key problems to be solved in this technical field.
[0041] The present disclosure proposes a data augmentation method to at least partially solve one or more of the above problems and other potential problems, which significantly improves the accuracy and diversity of query statement generation, enhances the semantic understanding of the system to complex problems, reduces the dependence on manual intervention, and improves the response efficiency and accuracy.
[0042] The embodiment of the present disclosure provides a data augmentation method, Figure 1 is a flowchart of the data augmentation method according to the embodiment of the present disclosure, which can be applied to a data augmentation device. The data augmentation device is located in an electronic device. The electronic device includes but is not limited to fixed devices and / or mobile devices. For example, the fixed device includes but is not limited to a server, which can be a cloud server or a general server. For example, the mobile device includes but is not limited to a mobile phone and a tablet computer. In some possible implementation manners, the data augmentation method can also be realized by calling the computer readable instructions stored in the memory through the processor. As shown in the figure, the data augmentation method includes: Figure 1 as shown in the figure, the data augmentation method includes:
[0043] S101, determining a target problem in a target field;
[0044] S102, using the first language model to generate multiple query statements for the target question;
[0045] S103, executing each query statement using the second language model to obtain a query record corresponding to each query statement;
[0046] S104: Analyze each query statement and its corresponding query record using the first language model to obtain candidate query statements;
[0047] S105: Generate a corresponding relationship based on the target question and the candidate query statement;
[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 the target field.
[0049] In the disclosed embodiments, the target domain refers to a problem domain within a specific industry or profession with complex knowledge and information requirements, typically involving cross-domain semantic understanding and knowledge retrieval. Target domains include, but are not limited to, finance, healthcare, law, education, manufacturing, e-commerce, technology R&D, and customer service. Knowledge question-answering systems in these fields require highly accurate information matching and question answering.
[0050] In the disclosed embodiments, a target problem refers to a specific problem that the system needs to solve. It is typically presented in natural language and involves complex semantic understanding and information retrieval. Target problems include, but are not limited to, user queries in specific fields, key questions in technical documents, information needs in business processes, and problem settings in data analysis.
[0051] In the disclosed embodiments, a query statement refers to an expression generated for a target question and used for information retrieval in a knowledge question-answering system. Query statements are typically generated by a natural language model and are designed to accurately reflect the semantic requirements of the target question. Query statements include, but are not limited to, natural language questions, structured query requests, keyword combinations, semantic search expressions, and other techniques, and can trigger the retrieval and matching of relevant information within a knowledge base or database.
[0052] In the disclosed embodiments, query records refer to the detailed results and status information of each query statement during execution. Query records include, but are not limited to, query execution time, amount of data returned, query result content, success or failure status, error messages, and response time. These records are used to analyze query execution effectiveness and optimize the query statement generation process, thereby improving system accuracy and efficiency.
[0053] In the embodiments of the present disclosure, the first language model refers to a natural language processing model used to generate query statements, which can understand and parse the semantic structure of the target problem to generate diversified query expressions. The first language model includes but is not limited to: a pre-trained language generation model, a language model based on a Transformer architecture, a semantic matching model, or a language generation model optimized for a specific field. These models can generate multiple possible query statements based on the input natural language problem, ensuring the system's coverage and processing ability for different query forms.
[0054] In the embodiments of the present disclosure, the second language model refers to a natural language processing model used to execute query statements and evaluate their effectiveness, which is responsible for applying the generated query statements to databases or knowledge bases, 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 and answer model, a retrieval optimization model, or a language model fine-tuned for a specific field. These models not only can execute queries, but also can analyze the accuracy, relevance and amount of returned data of the query results, and feed back to the system to optimize the generation and adjustment of subsequent query statements.
[0055] In some embodiments, determining the target problem of the target field includes: obtaining a natural language question input by a user, analyzing the semantic structure of the question, identifying core information related to the target field, and normalizing the question to generate a standardized question expression suitable for querying.
[0056] In some embodiments, the first language model is used to generate multiple query statements for the target problem, including: analyzing the semantics of the target problem through a trained natural language model, generating multiple possible query expressions based on predefined rules or large models to cover different query angles and information needs.
[0057] In some embodiments, the second language model is used to execute each query statement 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 state 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 logicality, accuracy and effectiveness of the query statement according to the data volume, error information and execution time in the query record, thereby generating an improved candidate query statement.
[0059] In some implementations, generating a correspondence between 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 the 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 medications 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 medications can treat diabetes?" The first language model generates multiple query statements, such as "diabetes treatment medications," "List of commonly used medications for treating diabetes," and "Recommended medications for diabetic patients." The second language model executes these query statements in the medical database, obtaining query records corresponding to each query statement, including query results, execution time, and amount of data returned. The first language model analyzes these query records and, based on the relevance and accuracy of the query results, generates candidate query statements, such as "Best medication for treating diabetes." The system generates a correspondence between the target question and the candidate query statements, establishing a query match between "diabetes" and "medication for treatment." This correspondence is added to the knowledge question-and-answer system's sample library for future query matching of similar questions.
[0062] In the technical solution of the disclosed embodiments, the first and second language models work together to generate diverse query statements, optimizing the breadth and accuracy of the queries. The second language model executes the queries and analyzes the results, further improving the query statements and establishing a correspondence between them and the target questions. This is then stored in a sample library, increasing the data quality and coverage of the sample library, improving the system's matching speed and accuracy for similar questions, and enhancing the processing efficiency and accuracy of the knowledge question-answering system in the target domain.
[0063] In some embodiments, determining target issues in the 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 embodiment of the present disclosure, normalization processing refers to the process of performing standardized conversion on the enhanced question so that it conforms 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 from the knowledge question-answering system involves extracting detailed data about user interactions and query processing. This data includes, but is not limited to, the query statement entered by the user, the query results generated by the system, the query execution status, timestamp, amount of data returned, and user feedback on the query results, such as ratings, likes, or confirmation buttons. This information provides rich context for subsequent analysis.
[0069] In some embodiments, filtering for enhancement issues from log records includes: the system first applies 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 system's query accuracy reaches a preset threshold. Based on these criteria, the system automatically identifies issues that fail to meet the success criteria through filtering logic and marks them as enhancement issues requiring further optimization.
[0070] In some implementations, questions to be enhanced are normalized, including: The system standardizes the selected questions. Specifically, the system removes noise, unifies synonyms and language expressions, and standardizes the grammatical structure of the questions to ensure that these questions can be fed into subsequent processes in a consistent format. Furthermore, the system removes duplicates to prevent the recurrence of identical or similar questions, thereby improving processing efficiency and optimization results.
[0071] For example, in a legal consulting knowledge question-and-answer system, users repeatedly entered the query "What are the methods of compensation for breach of contract?" The system extracted relevant information from the log records, including the user's query statement, the query results generated by the system, the query execution time (e.g., an average of 1.2 seconds per query), the amount of data returned (e.g., the result set contained 20 relevant records), and user feedback (e.g., a user gave a rating of 2 / 5, indicating dissatisfaction with the results). The system's success criteria included query accuracy and user satisfaction. Specifically, the query accuracy threshold was set at 80%, and the user satisfaction threshold was set at 3.5 / 5. After analysis, the query accuracy for this question was only 65%, and the user feedback rating was 2 / 5, both of which failed to meet the system's preset success criteria. Therefore, the system automatically marked the question as a question for enhancement. The system then normalized the question for enhancement. First, the system detected and removed noise, such as redundant punctuation and stop words (e.g., "的" and "吗"). Next, the system identified and standardized synonyms or near-synonymous expressions, for example, replacing "compensation method" with "compensation form." The system further processed similar queries from different users, such as "What are the compensations for breach of contract?" and "What are the methods of compensation after breach of contract?", unifying these different expressions into a standardized query, "Methods of compensation after breach of contract." During this normalization process, the system also deduplicated the selected questions to ensure that similar questions were not repeatedly entered into the data enhancement process. This deduplication logic was based on a semantic similarity score for the questions. The system used an 85% semantic similarity threshold, and only questions with a similarity below 85% were considered separate and entered into the processing process. Ultimately, the system selected the standardized "Methods of compensation after breach of contract" as the target question and entered it into the subsequent optimization phase. By further generating diverse query statements, the system will improve matching accuracy based on user feedback and query result analysis, ensuring that the next time a user enters a similar question, the system can provide answers with over 80% accuracy and higher user satisfaction.
[0072] In this way, through log analysis and normalization, we can efficiently identify and optimize queries that don't meet requirements. Success criteria filter questions for enhancement, normalize them to a unified format, and remove duplicates, improving processing efficiency and accuracy. These optimized, standardized questions help the system provide more accurate query results, enhancing user satisfaction and system performance.
[0073] In some embodiments, generating multiple query statements for the target question using the first language model further includes:
[0074] Determine the popularity or difficulty of the target question;
[0075] Determine the target number of query statements corresponding to the target question based on the popularity value or difficulty value;
[0076] Use the first language model 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 analyzing user query logs, historical interaction data, or question frequency in the system to assess the number of times the question has been asked (i.e., popularity) or the complexity of the question (i.e., difficulty). Popularity can be calculated based on the frequency of access to the question, while difficulty can be assessed based on the accuracy of query results, user feedback, or the linguistic complexity of the question.
[0078] In some embodiments, determining a target number of query statements corresponding to a target question based on a popularity value or a difficulty value includes: the system setting an appropriate number of query statements to be generated based on the popularity value or the difficulty value. Generally, questions with higher popularity values or greater difficulty values require more query statements to increase coverage and improve query diversity and accuracy.
[0079] In some embodiments, generating a target number of query statements for a target question using a first language model includes: invoking a pre-trained language model to generate multiple semantically distinct but related query statements based on the semantic structure of the target question. These query statements may include different wordings, synonyms, or other language variations to ensure maximum relevance and accuracy of the results when executing the query.
[0080] In an e-commerce platform's customer service system, users repeatedly entered the query "How do I return something?" The system first evaluated the question's popularity and difficulty by analyzing user query logs and historical interaction data. Popularity is assessed based on the number of times the question has been accessed. The system found that "How do I return something?" had been queried 1,000 times in the past week, so it assigned a popularity score of 8 (out of 10). The system also assessed the question's difficulty based on user feedback and accuracy. Due to high user satisfaction (average 4.8 / 5) and a 90% accuracy rate, the system assigned a difficulty score of 3 (out of 10). Based on these popularity and difficulty evaluations, the system developed a strategy: for questions with high popularity but low difficulty, it generates six queries to ensure broad coverage and improve search efficiency. Based on this strategy, the system selected a target number of six queries to ensure that semantic search across diverse expressions fully covers all possible user inputs. Next, the system invoked the pre-trained first language model to generate six queries based on "How do I return something?" For example, generated queries include "What is the return process?", "How do I apply for a return?", "How do I submit a return request?", "What are the steps for a return?", "How do I process a return?", and "How does the return policy work?" Each query is expressed differently to ensure that more user expression variations are covered, improving the accuracy and comprehensiveness of the system's search and enhancing the user's query experience.
[0081] In this way, the number of queries generated is dynamically adjusted based on popularity and difficulty, ensuring broad coverage and accuracy for popular questions. By generating diverse queries, we better match different user expressions, improve query relevance and user satisfaction, while optimizing resource utilization, reducing redundant queries, and improving processing efficiency and response quality.
[0082] In some embodiments, generating a target number of query statements for a target question using a first language model 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 at least one parameter of the first language model in each loop is different from that in the previous loop.
[0084] In the disclosed embodiment, in each loop, 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. To ensure that each query statement generated has diversity in different loops, the system adjusts the model parameters randomly or according to a preset strategy in each loop. 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 embodiments, by fine-tuning the weights of the word embedding layer, the same word produces slightly different semantic expressions in different cycles; the length of the generated sentences is adjusted, generating a short sentence one time and a longer, more detailed sentence the next time; the syntactic structure is also changed, making the sentence structure change 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, so that the query statements maintain 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 repeatedly query "What are the treatments for hypertension?" The system first sets a target number of five iterations and generates five different query statements. In each iteration, the pre-trained first language model is invoked, using "What are the treatments for hypertension?" as input to generate a query statement. In the first iteration, the system generated the query "How is hypertension treated?" In the second iteration, by adjusting the weights of the word embedding layer, the query "What are the common treatments for hypertension?" was generated. In the third iteration, by increasing the length of the sentence, the system generated the query "How should patients with hypertension choose a treatment plan?" In the fourth iteration, the syntactic structure is modified to generate the query "What are the common methods for treating hypertension?" Finally, in the fifth iteration, through synonym replacement, "treatment" is replaced with "control," generating the query "What are the control measures for hypertension?"
[0087] In this way, by adjusting model parameters in each iteration, diverse query statements are generated, ensuring comprehensive coverage of diverse expressions of the target question. Parameter adjustments, such as word embedding weights, sentence length, syntactic structure, and synonym replacement, ensure that queries maintain both semantic consistency and diversity. This improves query flexibility and precision, better matches user expressions, and increases search relevance and efficiency.
[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 statement 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, statement diversity, length and 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 expression. Finally, after N loops, 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 advisory system, a user repeatedly queries "How do I 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 a query statement cache. The system not only records the generated query statements but also ranks them based on frequency, statement diversity, length, and semantic relevance to the target question. For example, in 10 cycles, statements such as "How do I apply for a loan?" and "Personal loan application process?" were generated. The system detected that "How do I apply for a loan?" appeared more frequently and therefore ranked it higher. However, to ensure broad query coverage, the system also prioritized statements with greater semantic diversity, such as "How do I get a personal loan?" and "What are the steps to apply for a loan?" These statements perform better in terms of diversity and semantic coverage. Ultimately, the system selected five query statements (M = 5) with high frequency and diversity from the 10 queries. These statements were then used to match different expressions in subsequent user input, ensuring query accuracy and coverage.
[0094] In this way, through multiple cycles of query generation and filtering, we ensure broad coverage and high relevance. The system sorts queries by frequency, diversity, and semantic relevance, selecting the optimal query and providing more accurate results. This not only improves the matching of different user expressions but also reduces redundant queries, improving system 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 candidate query statements further includes:
[0096] Inputting the query record of each query sentence into the first language model;
[0097] Analyzing each query statement using the first language model from at least one of logical analysis, grammatical 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, inputting query records for each query statement into the first language model includes providing the detailed results and status of each query execution as input data to the first language model. Query records typically include execution time, amount of data returned, error messages, etc. By recording this information, the model can understand the actual problems or performance encountered during the execution of each query, thereby providing data support for subsequent optimization. For example, if a query returns too little data or takes too long to execute, the model can make adjustments based on this feedback data to improve the effectiveness of the query.
[0100] In some embodiments, the first language model analyzes each query statement from at least one of the following dimensions: logical analysis, grammatical checking, and semantic understanding. This includes: the model directly optimizes the original query statement based on information from the query record, combined with grammatical checking, logical analysis, and semantic understanding. If supported by the model, the system can directly modify the original query statement, such as correcting logical errors or portions that do not conform to grammatical rules, to ensure a clearer and more accurate query structure. Furthermore, the model can generate entirely new statements based on its semantic understanding of the query statement. These new statements not only fix the problems with the original query but also provide comprehensive optimizations in terms of logic, grammar, and semantics to better align with the user's intent.
[0101] In some embodiments, generating candidate queries based on the improved query includes: the system generating a set of improved queries that not only address issues in the original query but also introduce diversity to ensure coverage of a wider range of user input expressions. These candidate queries are evaluated based on execution results (e.g., relevance, accuracy, diversity, etc.). The evaluation method can be manual evaluation, automatic scoring, or a combination of both, and ultimately selecting the candidate that best meets the query requirements.
[0102] For example, in an e-commerce recommendation system, a user enters "best choices 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 then queries the database to return results. During query execution, the system records the query execution time, the number of products returned, and error messages, such as queries that timed out due to excessive data volume or where some results were irrelevant. The system inputs query records for each query statement (such as execution time and returned data volume) into the first language model for further analysis. Through logical analysis and syntax checking, the model identifies that some queries are too vague, resulting in an overly broad search scope. For example, "best-selling mobile phone recommendations" does not specify a price range, resulting in an overly large result set that does not meet the user's actual needs. Based on the feedback from the query records, the model adjusts the query syntax and logical structure, generating more precise queries, such as "best-selling mobile phone recommendations under 3,000 yuan" and "2024 smartphone rankings." These improved queries not only address the overly broad or vague nature of the original queries but also better align with user intent through logical optimization and semantic enhancement. The system then generates a set of candidate queries based on these improved queries. Through automated evaluation (e.g., relevance scoring, semantic diversity assessment), as well as some manual review, it selects the queries that best meet the user's needs. Evaluation criteria include accuracy, diversity, and efficiency of the returned results, ultimately providing users with more accurate recommendations.
[0103] By analyzing query records and optimizing query statements, the system improves query relevance and efficiency. Through improvements in logic, syntax, and semantics, the system generates more precise queries, reduces irrelevant information, and meets user needs. Candidate queries undergo rigorous evaluation to ensure relevance, accuracy, and diversity, thereby enhancing the quality of query results and user experience.
[0104] In some embodiments, generating a correspondence relationship based on the target question and the candidate query statements 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: performing 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, which evaluates whether the query statement can accurately express the intent of the target question; and efficiency, which measures the speed and resource consumption of the query statement when 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 queries with evaluation values greater than a preset threshold are selected as backup queries. This includes the system selecting queries with evaluation values above the preset threshold based on quantitative evaluation scores or manual review results. The preset threshold is set based on the actual needs of the system and is used to distinguish high-quality from low-quality queries. Specifically, the evaluation scores for relevance, accuracy, and efficiency must all meet certain standards before a query is selected as a backup query. This ensures that the selected queries can be executed quickly and effectively express the core requirements of the target question.
[0110] In some embodiments, establishing a correspondence between the target question and the alternative query statements includes establishing a one-to-one correspondence between the target question and the selected alternative query statements. This correspondence can take the form of different data structures based on system requirements, such as a simple list, key-value pairs, or a more complex graph structure. If the target question changes or user input becomes diverse, this correspondence can ensure that the alternative query statements quickly match user needs and provide efficient and accurate results. In this relationship, the target question serves as a description of the user's needs, while the alternative query statements serve as the optimal query expressions that the system can generate to meet these needs.
[0111] For example, in a legal consulting system, a user enters "What are the legal consequences of a breach of contract?" as the target question. The system generates multiple candidate queries, such as "Compensation methods for breach of contract," "Legal liability after breach of contract," and "Legal provisions for contract termination." The system evaluates these candidate queries, scoring them based on relevance, accuracy, and execution efficiency. For example, "Compensation methods for breach of contract" scores high in relevance and accuracy, while "Legal provisions for contract termination" excels in efficiency. After evaluation, the system selects query statements with evaluation values above a preset threshold as backup queries, such as "Compensation methods for breach of contract" and "Legal liability after breach of contract." The system establishes a corresponding relationship between these backup queries and the target question, recording them in a key-value pair structure: the target question is "What are the legal consequences of a breach of contract?" and the backup queries are selected high-quality query expressions. This relationship ensures that when a user enters a similar question again, the system can quickly match the optimal query and provide accurate legal advice.
[0112] By comprehensively evaluating candidate queries, the system can identify those that closely match the target question, ensuring query relevance, accuracy, and execution efficiency. Establishing a correspondence between the target question and high-quality queries enables the system to quickly respond to user input and provide precise answers. This significantly improves the quality of query results, especially when users enter similar questions again.
[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 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;
[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 receiving a natural language question input by a user and recording the relevant timestamp and user information. The question is parsed as a question to be answered and enters the subsequent processing flow. At this point, the system automatically records basic information about the question, such as the input time and preliminary analysis of the question, to ensure subsequent performance tracking.
[0120] In some embodiments, searching the sample library for at least one query statement corresponding to the question to be answered includes: the system searches the sample library for multiple query statements similar to the user-entered question. The sample library analyzes the semantics of the user-entered question, finds several historical queries that are closest to it, and returns relevant query statements for subsequent analysis. This process ensures that the query statements cover different wordings or expressions of the user-entered question.
[0121] In some embodiments, using a second language model to analyze at least one query statement to obtain a target query statement includes: the second language model analyzes the query statement extracted from the sample library and evaluates its relevance, accuracy, and potential for optimization. The analysis may involve syntax checking and semantic understanding. Based on the analysis results, the model generates or selects a target query statement that most accurately reflects the user's question intent. 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, a target query is input into a knowledge question answering system, and the knowledge question answering system retrieves relevant knowledge point data from a knowledge database based on the target query. This includes: the system inputs a generated target query into the knowledge question answering system, and the knowledge question answering system uses the query 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 the basis for generating an answer.
[0123] In some implementations, the relevant knowledge point data is fed back to the second language model, which then generates an answer based on the relevant knowledge point data. This includes: the system feeds the retrieved knowledge points back to the second language model, which then combines the user's question with the knowledge point data to generate a final answer. The generated answer is not only based on accurate knowledge points, but also reflects the underlying intent of the user's question.
[0124] In addition, the system generates logs detailing the user's input questions, the query generation and analysis process, the knowledge point retrieval process, and the time it takes to generate the final answer. Logging ensures that the system can track every step of the query process if problems arise, and also provides system performance metrics (such as response time and query efficiency) for subsequent optimization and analysis. These logs provide detailed data support for system health and problem tracking.
[0125] For example, in a medical question-answering system, a user enters the 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 of the question. The system parses the question into a "question to be answered" and immediately sends it to downstream processes for processing. The system then searches the sample database for historical queries similar to the question. By semantically analyzing the user's input question, the system finds several relevant queries from the sample database, such as "What are the treatment options for hypertension?", "How is hypertension treated?", and "What are the commonly used medications for hypertension?". These queries are matched using a semantic similarity algorithm, and the system selects the historical queries that are closest to the user's question for further analysis. The system then uses a second language model to analyze these queries, assessing each query's relevance, accuracy, and optimization potential. Through syntax checking and semantic analysis, the model selects the query that most accurately reflects the user's question intent: "What is the standard treatment for hypertension?" This target query was selected based on its semantic clarity while capturing the core intent of the user's question and its potential to find a relevant answer in the knowledge base. The system inputs the generated target query into the knowledge question-answering system, which uses it to search the professional medical knowledge database. After a quick search, the system retrieves a series of knowledge points related to hypertension treatment, including "common medications (such as angiotensin-converting enzyme inhibitors, beta-blockers)," "dietary control recommendations (such as a low-salt diet)," and "lifestyle adjustments (such as regular exercise)." This knowledge point data is fed back to the second language model, which generates the final answer based on the user's original question and these knowledge points. The answer is: "The best treatment for hypertension generally includes medication (such as angiotensin-converting enzyme inhibitors), a low-salt diet, and regular exercise. The specific plan should be tailored to the individual's situation." This answer incorporates the latest medical advice from the knowledge base and accurately responds to the user's question. Throughout the entire process, the system automatically generates logs detailing the execution time and status of each step, including: user input time, query generation process, target query 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 augmentation methods accurately match user questions, a 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. Furthermore, logging ensures traceability of the query process, supports troubleshooting and system optimization, improves query efficiency and user experience, and ensures the system can flexibly respond to complex questions and provide high-quality answers.
[0127] A schematic diagram of the relationship between the data augmentation system and the knowledge Q&A system is shown in FIG. 2. The data augmentation system 202 obtains user questions from the knowledge Q&A system 201 to enrich the sample library of the knowledge Q&A system 201. Figure 2
[0128] The workflow of the knowledge Q&A system 201 includes: 201a, obtaining a user question through an interface; 201b, querying a relevant query statement from the sample library based on the user question, and generating a target query statement for the user question through a language model; 201c, performing knowledge retrieval from a professional knowledge database based on the target query statement to obtain relevant knowledge point data; 201d, generating an augmented answer based on the relevant knowledge point data through a language model and returning the augmented answer to the user. During the entire process, all target query statements and their query results are stored in the sample library as important references for subsequent data augmentation.
[0129] The workflow of the data augmentation system 202 includes: S202a, question screening based on user logs to screen out questions to be augmented; S202b, generating multiple query statements for the questions to be augmented through a language model; S202c, executing the multiple query statements through a 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 reflect on itself and correct errors; S202e, automatically or manually reviewing the questions to be augmented, the query statements, and their execution records, and evaluating and verifying the query statements according to actual business requirements and data security standards, and then sending the successful query statements to the sample library. In this way, the data augmentation system can continuously improve the accuracy, efficiency, and relevance of the query in repeated cycles.
[0130] Among them, the language models used by the knowledge Q&A system 201 and the data augmentation system 202 can be different language models. For example, the data augmentation system 202 uses a heavyweight language model, while the knowledge Q&A system 201 uses a lightweight language model.
[0131] In this way, through continuous feedback loops, the knowledge Q&A system can continuously optimize its answer quality, and the addition of the data augmentation system further improves the processing capability of the knowledge Q&A system for complex problems, ensuring the efficiency and accuracy of knowledge point queries, and improving the overall user experience. The application of the data augmentation method in the knowledge Q&A system, especially in specific target fields, can significantly improve the performance and accuracy of the system.
[0132] To enhance the usability of the sample library, we automated the construction of a data flywheel to update data queries. We exported query records from user logs, categorized failed tasks, and regenerated query statements using a large model. Subsequently, we manually reviewed the regenerated queries and imported successful examples into the sample library, improving its quality and accuracy.
[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: Automatic generation and testing of query statements.
[0137] Use the language model to generate high-frequency queries multiple times to generate more optimized query statements. For example, by repeatedly running the query generation process 10 times, the top three most frequent queries are identified. This step not only improves query efficiency but also helps reduce the risk of query execution failure.
[0138] S303: Execution recording and status monitoring.
[0139] The data augmentation system records the results and status of each query executed by the language model in detail, including execution time, amount of data returned, error messages, etc. These records can help the large model understand the specific circumstances of query execution and perform targeted optimization.
[0140] S304: Self-reflection and error correction.
[0141] The query execution history is fed into the language model, guiding it to self-reflect and correct errors. This process involves logical analysis, syntax checking, and semantic understanding of the query to ensure the accuracy of the generated query.
[0142] S305: Manual review and sample library update.
[0143] The data enhancement system submits the regenerated query statements to human review. Professionals evaluate and verify these queries based on actual business needs and data security standards. Successful queries are imported into the sample library.
[0144] S306: Continuous iteration and optimization.
[0145] The core of the data flywheel lies in continuous iteration and optimization. Over time, user needs and the data environment may change. The system continuously collects new data and updates the knowledge base to ensure that the database is always up to date and relevant.
[0146] S307: User feedback and system adjustments.
[0147] To further enhance the effectiveness of the data flywheel, the system also collects user feedback. User satisfaction, query accuracy, and efficiency are all important feedback indicators. By analyzing this feedback, the system can further adjust and optimize 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] Generating multiple query statements through a language model in this way increases data diversity, which helps train more robust and generalizable knowledge question-answering systems. Because the generated query statements cover multiple possible expressions of the target question, the system can better understand and respond to similar but slightly different queries from real users, improving the system's generalization capabilities. Successful query statements are added as new examples to the knowledge question-answering system's sample library, directly increasing the number and coverage of the sample library. The richness of the sample library is particularly important for supervised and semi-supervised learning methods, as they rely on large amounts of well-labeled data to train the models. Through in-depth analysis of query statements and their query records using a language model, 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 in selecting the most appropriate answer or information source when answering user questions, thereby improving the accuracy of the answer. Compared to relying solely on manual annotation to expand the sample library, data augmentation methods can automatically or semi-automatically generate large amounts of labeled data, significantly reducing the cost and time investment of manual annotation. This is particularly important for knowledge question-answering systems that require frequent updates and expansion.
[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 the target problem in the target domain; a first generation module 402, used to generate multiple query statements for the target problem using the first language model; a query execution module 403, used to execute each query statement using the 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 the sample library of the 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 answering 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 popularity 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 popularity value or difficulty value;
[0158] The first generation submodule is used to generate a target number of query statements for a target question using the first language model.
[0159] In some embodiments, the first generation submodule is configured 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 at least one parameter of the first language model in each loop 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 containing 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, configured to input the query record of each query statement into the first language model;
[0167] an analysis submodule, configured to analyze each query statement using the first language model from at least one of the dimensions of logical analysis, grammatical checking, and semantic understanding to obtain an improved query statement;
[0168] The third generation submodule is used to generate candidate query statements based on the improved query statement.
[0169] In some embodiments, the query execution module 403 includes:
[0170] The evaluation submodule is used to evaluate each candidate query statement and obtain the evaluation result;
[0171] A third screening submodule is configured to select candidate query statements with evaluation values greater than a preset threshold as backup 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 the sample library for at least one query statement corresponding to the question to be answered;
[0176] The second determination module ( Figure 4 (not shown) for analyzing at least one query statement using a second language model to obtain a target query statement;
[0177] Get Module( Figure 4 (not shown), for inputting a target query statement into a knowledge question answering system, so that the knowledge question answering system obtains relevant knowledge point data from a knowledge database based on the target query statement;
[0178] The third generation module ( Figure 4The related knowledge point data is returned to the second language model, so that the second language model generates an answer based on the related knowledge point data.
[0179] The specific functions and examples of the modules and sub-modules of the device of the embodiments of the present disclosure are described above in the corresponding steps of the method embodiments, and will not be described here.
[0180] The data enhancement device of the embodiments of the present disclosure can increase the data quality and coverage of the sample library, and further enhance the processing efficiency and accuracy of the knowledge question and answer system in the target field.
[0181] The embodiments of the present disclosure provide a scene schematic diagram of a data enhancement method, as shown in Figure 5 .
[0182] As described above, the data enhancement method provided by the embodiments of the present disclosure is applied to an electronic device. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smart phones, wearable devices, and other similar computing devices.
[0183] Specifically, the electronic device can specifically perform the following operations:
[0184] determine a target problem of a target field;
[0185] generate a plurality of query sentences for the target problem using a first language model;
[0186] execute each query sentence using a second language model to obtain a query record corresponding to each query sentence;
[0187] analyze each query sentence and its corresponding query record using the first language model to obtain a candidate query sentence;
[0188] generate a corresponding relationship based on the target problem and the candidate query sentence;
[0189] add the corresponding relationship to a sample library of a knowledge question and answer system.
[0190] It should be understood that Figure 5 The scene diagram shown is merely illustrative and not limiting, and those skilled in the art can make various obvious changes and / or replacements based on the examples Figure 5 The resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.
[0191] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply 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 embodiments 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, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed 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 into a random access memory (RAM) 603. Various programs and data required for the operation of the device 600 can also be stored in the RAM 603. 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] Various components in device 600 are connected to I / O interface 605, including an input unit 606, such as a keyboard, mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, optical disk, etc.; and a communication unit 609, such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0196] The computing unit 601 can 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 that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the data enhancement method. For example, in some embodiments, the data enhancement method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the data enhancement method described above can 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 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), system 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 are executable and / or interpreted on a programmable system that includes 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 can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, 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 apparatus. 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, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the foregoing. More specific examples of machine-readable storage media 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 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 having 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 a local area network (LAN), a wide area network (WAN), and the Internet.
[0202] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0203] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.
[0204] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A data augmentation method, comprising: Identify target issues in the target area; generating a plurality of query statements for the target question using a first language model; Execute each query statement using the second language model to obtain query records 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; Adding 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; The method of generating multiple query statements for the target question using the first language model includes: determining a popularity value or a difficulty value of the target question; determining a target number of query statements corresponding to the target question based on the popularity value or the difficulty value; and generating the target number of query statements for the target question using the first language model. The method of generating the target number of query statements for the target question using the first language model includes: generating a query statement for the target question using the first language model in each loop; the number of loops is equal to the target number, and at least one parameter of the first language model in each loop is different from that in the previous loop.
2. The method according to claim 1, wherein The target issues for determining the target areas include: Obtaining log records of the knowledge question answering system; Filtering issues to be enhanced from the log records; Normalizing the problem to be enhanced to obtain the target problem.
3. The method according to claim 1, wherein The 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 screened out from the query statement set, where M is less than N, and both M and N are integers greater than 1.
4. 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 using the first language model from at least one of logical analysis, grammatical checking, and semantic understanding to obtain an improved query statement; The candidate query statement is generated based on the improved query statement.
5. The method according to claim 1 or 4, wherein Generating a corresponding relationship based on the target question and the candidate query statement includes: Evaluate each candidate query statement 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 alternative query statement is established.
6. 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 a 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.
7. A data enhancement device, comprising: The first determination module is used to determine the target problem in the target field; A first generation module is configured to generate multiple query statements for the target question using a first language model; wherein the first generation module includes: a second determination submodule, configured to determine a popularity value or a difficulty value of the target question; a third determination submodule, configured to determine a target number of query statements corresponding to the target question based on the popularity value or the difficulty value; a first generation submodule, configured to generate the target number of query statements for the target question using the first language model; the first generation submodule is configured to: generate one query statement for the target question using the first language model in each loop; wherein the number of loops is equal to the target number, and at least one parameter of the first language model in each loop is different from that in the previous loop; A query execution module, configured 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 candidate query statements; 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 field.
8. The device according to claim 7, wherein The first determining module includes: An acquisition submodule, used to obtain log records of the knowledge question answering system; A first screening submodule, configured to screen out issues to be enhanced from the log records; The first determination submodule is configured to perform normalization processing on the problem to be enhanced to obtain the target problem.
9. The device according to claim 7, wherein The first generating module includes: A second generation submodule is configured 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 containing N query statements; The second screening submodule is configured 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.
10. The device according to claim 7, 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 using the first language model from at least one of the dimensions of logical analysis, grammatical checking, and semantic understanding to obtain an improved query statement; The third generating submodule is configured to generate the candidate query statement based on the improved query statement.
11. The device according to claim 7 or 10, wherein: The query execution module includes: An evaluation submodule, configured to evaluate each candidate query statement and obtain an evaluation result; A third screening submodule is configured to select candidate query statements with evaluation values greater than a preset threshold as backup query statements; A submodule is established to establish a corresponding relationship between the target question and the backup query statement.
12. The apparatus according to claim 7, further comprising: A receiving module, used for receiving questions to be answered; A query module, configured to query the sample library for at least one query statement corresponding to the question to be answered; a second determining module, configured 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 configured 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.
13. 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 the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are for causing a computer to execute the method according to any one of claims 1-6.
15. 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 6 when executed by a processor.
Citation Information
Patent Citations
Dialogue system training data construction method and device, electronic equipment and storage medium
CN109947924A
Method and system for intelligently generating knowledge query statements driven by large-model and few-sample context learning based on scene awareness
CN118093820A