Problem prompt word generation method and system and electronic equipment

By grading text quality and question-and-answer effect on the initial prompt words, filtering and optimizing the generation of high-quality problem prompt words, the problem of low quality prompt words generation in the prior art is solved, and the output accuracy of the large language model is improved.

CN119782768AActive Publication Date: 2025-04-08CHENGDU CELIS TECH CO LTD

Patent Information

Application Number
CN202510265508.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-04-08
Estimated Expiration
2045-03-07

AI Technical Summary

Technical Problem

In the prior art, the generation quality of problem prompt words generated by machine learning models is uneven, resulting in low output accuracy of large language models, mainly due to significant differences in language characteristics and problem types in different fields.

Method used

A method for generating question prompt words is proposed, including obtaining multiple initial prompt words, filtering out alternative prompt words through text quality score, and text optimization of alternative prompt words through question and answer effect scores, and finally generating high-quality question prompt words.

Benefits of technology

Through quality score screening and effect score optimization, we ensure that the generated prompt words are guaranteed in terms of text quality and question-and-answer effect, thereby improving the generation quality of question prompt words and thus improving the output accuracy of the large language model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782768A_ABST
    Figure CN119782768A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of large language models, and discloses a question prompt word generation method and system and electronic equipment. According to the application, the text quality of the initial cue word is scored, the alternative cue word in the initial cue word is screened out according to the quality score, the question and answer effect of the alternative cue word is scored, and the effect score is taken as an optimization standard to perform text optimization on the alternative cue word, so that the user experience is improved. The question cue word corresponding to the target question is generated according to the optimized alternative cue word, the text quality of the cue word is evaluated according to the quality score, the cue word with high text quality is screened out, the question and answer effect of the cue word in the use process is evaluated according to the effect score, and the cue word is optimized based on the effect score. According to the method, the text quality and the question and answer effect of the automatically generated cue word are guaranteed, the generation quality of the question cue word is improved, and then the output accuracy of the large language model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of large language models, and in particular to a method, system and electronic device for generating question prompt words. Background Art

[0002] In the field of natural language processing (NLP), large language models (LLMs) are cutting-edge artificial intelligence technologies. Through deep learning theory and training of massive amounts of text data, they have mastered the grammar, semantics, and contextual information of language, and are therefore able to accurately process and generate human language. They have great potential and broad application prospects. Question-answering accuracy is one of the key indicators for measuring model performance, and prompt words serve as a bridge between users and models, guiding model output through clear and specific guiding language. The design quality of prompt words is directly related to the model's understanding of user intent and the accuracy of generated answers. If the prompt words are too simple or vague, they cannot accurately convey user intent. If the prompt words are too complex or redundant, the model will not be able to correctly understand and generate corresponding answers.

[0003] Since prompt word design requires developers to have deep professional knowledge and rich practical experience in order to accurately grasp the core intent of the target question and design prompt words that can stimulate the potential of the model, some developers try to use machine learning models to replace manual design and automatically generate question prompt words. However, since the fields involved by different large language models vary greatly, machine learning models often require a large amount of standard data to ensure the availability of prompt words.

[0004] Therefore, due to the significant differences in language characteristics and question types in different fields, the quality of prompt words generated by machine learning models varies, resulting in low output accuracy of large language models. Summary of the invention

[0005] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical elements or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

[0006] In view of the above-mentioned shortcomings of the prior art, the present application provides a method, system and electronic device for generating question prompt words to improve the generation quality of question prompt words.

[0007] The present application provides a method for generating question prompt words, comprising: obtaining multiple initial prompt words corresponding to a target question; scoring the text quality of each of the initial prompt words to obtain a quality score corresponding to each of the initial prompt words, and screening each of the initial prompt words according to the quality score to obtain candidate prompt words; scoring the question-answering effect of the candidate prompt words to obtain an effect score, and using the effect score as an optimization criterion to perform text optimization on the candidate prompt words; and generating a question prompt word corresponding to the target question according to the optimized candidate prompt words.

[0008] In one embodiment of the present application, multiple initial prompt words corresponding to a target question are obtained, including: obtaining multiple historical questions input by a user; grouping each of the historical questions according to the text similarity between the historical questions to obtain a similar question group; if the number of historical questions in the similar question group is greater than or equal to a preset number threshold, determining high-frequency questions based on the historical questions in the similar question group to form a high-frequency question library based on the high-frequency questions; determining a target question from the high-frequency question library, and inputting the target question into multiple preset prompt word generation models to obtain initial prompt words output by each of the prompt word generation models, wherein the prompt word generation model is trained based on a large language model.

[0009] In one embodiment of the present application, the quality of the text of each of the initial prompt words is scored to obtain a quality score corresponding to each of the initial prompt words, including: obtaining one or more prompt word scoring models, wherein the prompt word scoring model is trained based on a large language model; using each of the prompt word scoring models to evaluate the rationality of the initial prompt word; if the initial prompt word does not meet the rationality, the initial prompt word does not have a quality score; if the initial prompt word meets the rationality, using each of the prompt word scoring models to score the text quality of the initial prompt word according to a preset scoring dimension, to obtain quality scoring results output by each of the prompt word scoring models, and combining each of the quality scoring results for calculation to obtain a quality score.

[0010] In one embodiment of the present application, each of the initial prompt words is screened according to the quality score to obtain an alternative prompt word, including at least one of the following: using the initial prompt word with the highest quality score as the alternative prompt word; using the initial prompt word with a quality score greater than or equal to a preset quality threshold as the alternative prompt word.

[0011] In one embodiment of the present application, an effect score is obtained by scoring the question-answering effect of the alternative prompt word, including at least one of the following: using a preset question-answering model to determine the model output result corresponding to the alternative prompt word, and using a preset result scoring model to score the model output result to obtain an effect score; collecting user feedback data corresponding to the alternative prompt word to score according to the user feedback data to obtain an effect score, wherein the user feedback data includes at least one of the number of user modifications, the number of user uses, user positive evaluations, and user negative evaluations.

[0012] In one embodiment of the present application, the text optimization of the alternative prompt word is performed with the effect score as the optimization criterion, including: in response to the alternative prompt word, comparing the effect score corresponding to the alternative prompt word according to a preset effect threshold; if the alternative prompt word meets a first preset condition and a second preset condition, setting the text optimization result of the alternative prompt word to optimization completion, wherein the first preset condition includes that the effect score is less than the preset effect threshold, and the second preset condition includes that the number of text optimizations of the alternative prompt word is less than the preset optimization number threshold; if the alternative prompt word does not meet the first preset condition, performing text optimization on the alternative prompt word to obtain a new alternative prompt word; if the alternative prompt word does not meet the second preset condition, setting the text optimization result of the alternative prompt word to optimization failure.

[0013] In one embodiment of the present application, the text of the candidate prompt words is optimized in at least one of the following ways: text processing is performed on the candidate prompt words, wherein the text processing includes at least one of deleting stop words, replacing synonyms, replacing near-synonyms, and adjusting the text order; using a prompt word scoring model to output a quality evaluation corresponding to the candidate prompt words, wherein the prompt word scoring model is used to score the text quality of each of the initial prompt words; text parsing is performed on the quality evaluation to extract a model positive evaluation and a model negative evaluation from the quality evaluation according to the text parsing result; a prompt word generation text is generated according to at least one of the candidate prompt words, the model positive evaluation and the model negative evaluation, and the prompt word generation text is input into the prompt word generation model, so that the prompt word generation model outputs a new candidate prompt word based on the model positive evaluation and / or the model negative evaluation.

[0014] In one embodiment of the present application, after generating the question prompt words corresponding to the target question based on the optimized alternative prompt words, the method also includes: displaying the question prompt words to the user; if a modification instruction input by the user is received, modifying the question prompt words according to the prompt word modification instruction; if a selection instruction input by the user is received, inputting the question prompt words into a preset question and answer model, so that the preset question and answer model outputs the question and answer result corresponding to the target question.

[0015] The present application provides a system for generating question prompt words, including: an acquisition module, configured to acquire multiple initial prompt words corresponding to a target question; a screening module, configured to score the text quality of each of the initial prompt words to obtain a quality score corresponding to each of the initial prompt words, and screen each of the initial prompt words according to the quality score to obtain candidate prompt words; an optimization module, configured to score the question-answering effect of the candidate prompt words to obtain an effect score, and use the effect score as an optimization standard to perform text optimization on the candidate prompt words; and a generation module, configured to generate the question prompt words corresponding to the target question according to the optimized candidate prompt words.

[0016] The present application provides an electronic device, comprising: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above method.

[0017] Beneficial effects of this application: By scoring the text quality of the initial prompt words, the candidate prompt words in the initial prompt words are screened out according to the quality score, and by scoring the question-answering effect of the candidate prompt words, the text of the candidate prompt words is optimized with the effect score as the optimization standard, so as to generate the question prompt words corresponding to the target question according to the optimized candidate prompt words. In this way, the text quality of the prompt words themselves is evaluated according to the quality score, so as to screen out prompt words with high text quality, and the question-answering effect of the prompt words during use is evaluated according to the effect score, and the prompt words are optimized based on the effect score, so that the automatically generated prompt words are guaranteed in terms of text quality and question-answering effect, improving the generation quality of question prompt words, and thus improving the output accuracy of the large language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flow chart of a method for generating a question prompt word in an embodiment of the present application; Figure 2 It is a flowchart of a method for obtaining an initial prompt word in an embodiment of the present application; Figure 3 It is a flowchart of a text quality scoring method in an embodiment of the present application; Figure 4 It is a flowchart of a text optimization method in an embodiment of the present application; Figure 5 is a flow chart of another method for generating question prompt words in an embodiment of the present application; Figure 6 is a structural diagram of a problem prompt word generation system in an embodiment of the present application; Figure 7 It is a schematic diagram of the structure of an electronic device in an embodiment of the present invention.

[0019] Reference numerals: 601-acquisition module; 602-screening module; 603-optimization module; 604-generation module; 700-computer system; 701-central processing unit; 702-read only memory; 703-random access memory; 704-bus; 705-input / output interface; 706-input part; 707-output part; 708-storage part; 709 communication part; 710-drive; 711-removable medium. DETAILED DESCRIPTION

[0020] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and sub-samples in the embodiments can be combined with each other without conflict.

[0021] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0022] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0023] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so as to describe the embodiments of the present application described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

[0024] Unless otherwise stated, the term "plurality" means two or more.

[0025] In this application, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B means: A or B.

[0026] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.

[0027] Combination Figure 1 As shown, the present application provides a method for generating question prompt words, comprising: Step S101, obtaining multiple initial prompt words corresponding to the target question; Step S102, scoring the text quality of each initial prompt word to obtain a quality score corresponding to each initial prompt word, and screening each initial prompt word according to the quality score to obtain an alternative prompt word; Step S103, scoring the question-answering effects of the candidate prompt words to obtain effect scores, and using the effect scores as optimization criteria to perform text optimization on the candidate prompt words; Step S104: Generate question prompt words corresponding to the target question based on the optimized candidate prompt words.

[0028] The question prompt word generation method provided by the present application is adopted, by scoring the text quality of the initial prompt word, to screen out the alternative prompt words in the initial prompt word according to the quality score, and by scoring the question-answering effect of the alternative prompt word, using the effect score as the optimization standard, to optimize the text of the alternative prompt word, so as to generate the question prompt word corresponding to the target question according to the optimized alternative prompt word. In this way, the text quality of the prompt word itself is evaluated according to the quality score, so as to screen out the prompt word with high text quality, and the question-answering effect of the prompt word during use is evaluated according to the effect score, and the prompt word is optimized based on the effect score, so that the automatically generated prompt word is guaranteed in terms of text quality and question-answering effect, and the generation quality of the question prompt word is improved, thereby improving the output accuracy of the large language model.

[0029] Combination Figure 2As shown in the figure, in step S101, multiple initial prompt words corresponding to the target question are obtained, including: Step S10101, obtaining multiple historical questions input by the user; Among them, the historical questions are text-segmented to obtain tokens; Among them, stop words are removed from the historical questions, and the stop words include "de", "shi", etc.; Step S10102, grouping each historical question according to the text similarity between historical questions to obtain similar question groups; Among them, a preset text feature extraction algorithm is used to convert historical questions into text feature vectors, and the text feature extraction algorithm includes the TF-IDF (Term Frequency-Inverse Document Frequency) algorithm; Among them, if the cosine similarity between two historical questions on the text feature vectors is greater than the preset similarity threshold, the two historical questions are divided into the same similar question group to cluster similar historical questions together to form similar question groups; Step S10103, if the number of historical questions in the similar question group is greater than or equal to the preset quantity threshold, high-frequency questions are determined according to the historical questions in the similar question group, and a high-frequency question library is formed according to the high-frequency questions; Among them, when the content in the similar question group reaches the preset quantity threshold, the similar question group is determined as a high-frequency group; Among them, the historical question with the highest similarity to other similar questions within the high-frequency group is used as the high-frequency question; Step S10104, determining the target question from the high-frequency question library and inputting the target question into a preset multiple prompt word generation models to obtain the initial prompt words respectively output by each prompt word generation model; Among them, the prompt word generation model is trained based on a large language model.

[0030] In some embodiments, if the number of characters of the target question is too small, for example, "Hello", "1", etc., the target question will lack effective information; if the number of characters of the target question is too large, the length of the prompt words generated by the target question will deviate, resulting in the continuous expansion of the reply length during training, affecting the model's ability to generate concise and efficient Q&A. To ensure the quality of the target question, filtering the historical questions by the character length can effectively improve the final quality of the prompt words.

[0031] In some embodiments, the target question includes question Q1, question Q2, and question Q3. Among them, the target question is directly input into a preset Q&A model to obtain the original Q&A result corresponding to the target question, as shown in Table 1.

[0032] Table 1

[0033] In some embodiments, multiple large language models are used as prompt word content producers to establish a prompt word generation model, wherein the prompt word generation model is established in a manner including a third-party model and / or a self-developed model; a generation task is assigned to the prompt word generation model according to the target question to obtain alternative prompt words; the alternative prompt words are input into a preset question-answering model to obtain the current output result, for example, the prompt word generation model includes model A, model B and model C, the target question Q2 is input into each prompt word generation model, and initial prompt words P1, P2 and P3 are obtained respectively, as shown in Table 2.

[0034] Table 2

[0035] In some embodiments, the initial prompt words P1, P2 and P3 are input into a preset question-answering model to obtain the current output result corresponding to the target question, and a part of the current output result is shown in Table 3; by comparing the original question result and the current output result, it can be seen that the prompt words can improve the output effect of the large language model.

[0036] Table 3

[0037] Combination Figure 3 As shown, in step S102, by scoring the text quality of each initial prompt word, the quality score corresponding to each initial prompt word is obtained, including: Step S10201, obtaining one or more prompt word scoring models; Among them, the prompt word scoring model is trained based on the large language model; Step S10202, using each prompt word scoring model to evaluate the rationality of the initial prompt word; Step S10203, if the initial prompt word does not meet the rationality, then the initial prompt word does not have a quality score; Step S10204: if the initial prompt word meets the rationality, the text quality of the initial prompt word is scored using each prompt word scoring model according to a preset scoring dimension to obtain a quality scoring result output by each prompt word scoring model; Step S10205, performing calculations based on the quality score results to obtain a quality score.

[0038] In some embodiments, legality is used to characterize whether the initial prompt word contains illegal, biased, discriminatory, and other content.

[0039] In some embodiments, the preset scoring dimensions include accuracy, practicality, and logicality, where accuracy is used to characterize whether the initial prompt word is true and reliable, practicality is used to characterize whether the initial prompt word has specific content rather than a generalized description, and logicality is used to characterize whether the initial prompt word has characteristics such as correct grammar, clear structure, and strict logic.

[0040] In some embodiments, the initial prompt words include P1, P2 and P3, and the prompt word scoring model includes model D, model E and model F; the initial prompt words are scored in terms of accuracy, practicality, logic and rationality according to model D, model E and model F, and the scoring results are shown in Table 4.

[0041] Table 4

[0042] In some embodiments, the score weights corresponding to accuracy, practicality and logic are determined according to business needs. For example, the score weight for accuracy is 40%, the score weight for practicality is 30%, and the score weight for logic is 30%.

[0043] In some embodiments, the accuracy score of the initial prompt word P1 is , the practicality score of the initial prompt word P1 is , the logic score of the initial prompt word P1 is , then based on the weighted calculation of accuracy score, practicality score and logic score, the quality score of the initial prompt word P1 is 7.57.

[0044] In some embodiments, the accuracy score of the initial prompt word P2 is , the practicality score of the initial prompt word P2 is , the logic score of the initial prompt word P2 is , then based on the weighted calculation of accuracy score, practicality score and logic score, the quality score of the initial prompt word P2 is 8.23.

[0045] In some embodiments, the accuracy score of the initial prompt word P3 is , the practicality score of the initial prompt word P3 is , the logic score of the initial prompt word P3 is , then based on the weighted calculation of accuracy score, practicality score and logic score, the quality score of the initial prompt word P3 is 8.33.

[0046] Optionally, the initial prompt words are screened according to the quality score to obtain the candidate prompt words, including: taking the initial prompt word with the highest quality score as the candidate prompt word.

[0047] In some embodiments, the quality score of the initial prompt word P3 is 8.33, which is higher than the quality scores of the initial prompt words P1 and P2. Therefore, the initial prompt word P3 is used as an alternative prompt word.

[0048] Optionally, screening each initial prompt word according to the quality score to obtain the candidate prompt word includes: taking the initial prompt word with a quality score greater than or equal to a preset quality threshold as the candidate prompt word.

[0049] In some embodiments, the preset quality threshold is 8. Since the quality score of the initial prompt word P1 is less than the preset quality threshold, and the quality scores of the initial prompt words P2 and P3 are both greater than the preset quality threshold, the initial prompt words P2 and P3 are used as alternative prompt words.

[0050] Optionally, the effect score is obtained by scoring the question and answer effect of the alternative prompt words, including: using a preset question and answer model to determine the model output result corresponding to the alternative prompt word, and using a preset result scoring model to score the model output result to obtain the effect score.

[0051] In some embodiments, a result scoring model is established based on user needs; one or more result scoring models are used to comprehensively score the effects of alternative prompt words and their model output results to obtain an effect score, which is used to characterize whether the question and answer of the alternative prompt words meet user needs; the alternative prompt words before and after optimization are screened based on the effect score.

[0052] Optionally, the effect score is obtained by scoring the question and answer effect of the alternative prompt words, including: collecting user feedback data corresponding to the alternative prompt words, scoring according to the user feedback data, and obtaining the effect score, wherein the user feedback data includes at least one of the number of user modifications, the number of user uses, user positive evaluations, and user negative evaluations.

[0053] In some embodiments, the number of user modifications and the user's negative evaluations are negatively correlated to the effect score, and the number of user uses and the user's positive evaluations are positively correlated to the effect score.

[0054] Combination Figure 4 As shown, in step S103, the text of the candidate prompt words is optimized using the effect score as the optimization criterion, including: Step S10301, in response to the candidate prompt words, comparing the effect scores corresponding to the candidate prompt words according to a preset effect threshold; Among them, the preset effect threshold is 8; Step S10302: if the candidate prompt word satisfies the first preset condition and the second preset condition, the text optimization result of the candidate prompt word is set as optimization completed; Among them, the first preset condition includes that the effect score is less than a preset effect threshold; The second preset condition includes that the number of text optimizations of the candidate prompt word is less than a preset optimization number threshold; Among them, the candidate prompt words with effect scores greater than or equal to 8 are used as question prompt words for the target question and added to the question prompt word library; Step S10303: if the candidate prompt word does not meet the first preset condition, text optimization is performed on the candidate prompt word to obtain a new candidate prompt word; If the effect score of the candidate prompt word is less than 8, a new round of text optimization is performed on the candidate prompt word to generate a new candidate prompt word until a preset effect threshold or optimization times threshold is reached; Step S10304: if the candidate prompt word does not meet the second preset condition, the text optimization result of the candidate prompt word is set as optimization failure.

[0055] Optionally, the text of the candidate prompt words is optimized in the following manner: text processing is performed on the candidate prompt words, wherein the text processing includes at least one of deleting stop words, replacing synonyms, replacing near-synonyms, and adjusting the text order.

[0056] In some embodiments, training is performed based on a large language model to obtain a prompt word optimization model, which tentatively optimizes the candidate prompt words through a preset optimization strategy to generate one or more new candidate prompt words, wherein the pre-selected optimization strategy includes at least one of deleting stop words, replacing synonyms, replacing near-synonyms, and adjusting the text order.

[0057] Optionally, the text of the alternative prompt words is optimized in the following manner: a prompt word scoring model is used to output quality evaluations corresponding to the alternative prompt words, wherein the prompt word scoring model is used to score the text quality of each initial prompt word; text parsing is performed on the quality evaluation to extract model positive evaluations and model negative evaluations from the quality evaluations according to the text parsing results; a prompt word generation text is generated according to at least one of the alternative prompt words, the model positive evaluations and the model negative evaluations, and the prompt word generation text is input into the prompt word generation model, so that the prompt word generation model outputs new alternative prompt words based on the model positive evaluations and / or the model negative evaluations.

[0058] In some embodiments, the alternative prompt words are "Please tell me about the latest developments in artificial intelligence", and the quality evaluation includes clear semantics and high relevance, but slightly broad semantics. Through analysis, the model's positive evaluation is clear semantics and high relevance, while the model's negative evaluation includes slightly broad semantics. Based on the alternative prompt words and the model evaluation, a prompt word generation text is generated. For example, "Please design a prompt word about the latest developments in artificial intelligence, which requires clear semantics and more targeted." The above text is input into the prompt word generation model to obtain "Please share the latest breakthroughs in artificial intelligence in the field of medical health." In this way, in each iteration, the direction and focus of the prompt words can be adjusted according to the positive and negative evaluations of the model, so that the prompt words are significantly improved in terms of semantic clarity, relevance, fluency and innovation.

[0059] Optionally, after generating question prompt words corresponding to the target question based on the optimized alternative prompt words, the method also includes: displaying the question prompt words to the user; if a modification instruction input by the user is received, modifying the question prompt words according to the prompt word modification instruction; if a selection instruction input by the user is received, inputting the question prompt words into a preset question and answer model, so that the preset question and answer model outputs a question and answer result corresponding to the target question.

[0060] In some embodiments, question prompt words are displayed to users through the platform homepage or the platform main page. After viewing the prompt words, users can select and modify them by clicking, which helps users generate higher quality and more expected output.

[0061] In some embodiments, a display area is designed on the page of a user terminal such as a vehicle terminal or a mobile phone terminal to display question prompt words in the question prompt word library; and the number of user feedbacks on the question prompt words is recorded.

[0062] In some embodiments, the target question includes "What is the solenoid valve on new energy vehicles used for?", and the question prompt words corresponding to the target question include "You are a senior automotive industry expert with a deep understanding and rich experience in automotive technology, and are proficient in various automotive knowledge and technologies such as automotive common sense, automotive principles, automotive repair and maintenance, and automotive design. Now, please give detailed and professional answers to the following questions about cars"; the user obtains the question and answer results of the target question by selecting the question prompt words corresponding to the target question.

[0063] Combination Figure 5 As shown, a method for generating question prompt words includes: Step S501, obtaining multiple historical questions input by the user; Step S502, grouping the historical questions according to the text similarity between the historical questions to obtain similar question groups; Step S503, determining high-frequency questions according to the historical questions in the similar question group, so as to form a high-frequency question library according to the high-frequency questions; Step S504, determining a target question from a high-frequency question library; Step S505, inputting the target question into a plurality of preset prompt word generation models to obtain initial prompt words outputted by each prompt word generation model; Step S506, scoring the text quality of each initial prompt word to obtain a quality score corresponding to each initial prompt word; Step S507, taking the initial prompt words with a quality score greater than or equal to a preset quality threshold as candidate prompt words; Step S508, scoring the question-answering effect of the candidate prompt words to obtain an effect score; Step S509, determining whether the effect score is greater than or equal to a preset effect threshold, if so, jump to step S510, if not, jump to step S513; Step S510, using the current candidate prompt word as the question prompt word corresponding to the target question; Step S511, displaying question prompt words to the user; Step S512, in response to the selection instruction, input the question prompt word into the preset question and answer model, so that the preset question and answer model outputs the question and answer result corresponding to the target question.

[0064] Step S513, optimizing the text of the candidate prompt words to obtain new candidate prompt words, and then jumping to step S507.

[0065] The question prompt word generation method provided by the present application is adopted, by scoring the text quality of the initial prompt word, to screen out the alternative prompt words in the initial prompt word according to the quality score, and by scoring the question-answering effect of the alternative prompt word, using the effect score as the optimization standard, to optimize the text of the alternative prompt word, so as to generate the question prompt word corresponding to the target question according to the optimized alternative prompt word. In this way, the text quality of the prompt word itself is evaluated according to the quality score, so as to screen out the prompt word with high text quality, and the question-answering effect of the prompt word during use is evaluated according to the effect score, and the prompt word is optimized based on the effect score, so that the automatically generated prompt word is guaranteed in terms of text quality and question-answering effect, and the generation quality of the question prompt word is improved, thereby improving the output accuracy of the large language model.

[0066] Combination Figure 6 As shown, the present application provides a question prompt word generation system, including an acquisition module 601, a screening module 602, an optimization module 603 and a generation module 604.

[0067] The acquisition module 601 is configured to acquire a plurality of initial prompt words corresponding to the target question.

[0068] The screening module 602 is configured to score the text quality of each initial prompt word to obtain a quality score corresponding to each initial prompt word, and screen each initial prompt word according to the quality score to obtain candidate prompt words.

[0069] The optimization module 603 is configured to score the question-answering effects of the candidate prompt words to obtain effect scores, and use the effect scores as optimization criteria to perform text optimization on the candidate prompt words.

[0070] The generating module 604 is configured to generate a question prompt word corresponding to the target question according to the optimized candidate prompt words. The question prompt word generation system provided by the present application is adopted, by scoring the text quality of the initial prompt words, to screen out the alternative prompt words in the initial prompt words according to the quality score, and by scoring the question-answering effect of the alternative prompt words, using the effect score as the optimization standard, to optimize the text of the alternative prompt words, so as to generate the question prompt words corresponding to the target question according to the optimized alternative prompt words. In this way, the text quality of the prompt words themselves is evaluated according to the quality score, so as to screen out prompt words with high text quality, and the question-answering effect of the prompt words during use is evaluated according to the effect score, and the prompt words are optimized based on the effect score, so that the automatically generated prompt words are guaranteed in terms of text quality and question-answering effect, and the generation quality of the question prompt words is improved, thereby improving the output accuracy of the large language model.

[0071] The present application also provides an electronic device, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above method.

[0072] Figure 7 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0073] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703, such as executing the method in the above embodiment. Various programs and data required for system operation are also stored in the random access memory 703. The central processing unit 701, the read-only memory 702 and the random access memory 703 are connected to each other through a bus 704. The input / output (I / O) interface 705 is also connected to the bus 704.

[0074] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.

[0075] The electronic device disclosed in this embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used to communicate, and the processor and the transceiver are used to run the computer program so that the electronic device executes each step of the above method.

[0076] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operations may vary. Parts and sub-samples of some embodiments may be included in or replace parts and sub-samples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated sub-samples, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method or device including the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.

[0077] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0078] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some sub-samples can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the present application may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0079] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and operations of the system, method and computer program product according to the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a module, a program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

Claims

1. A method for generating question prompt words, characterized in that: include: Obtain multiple initial prompt words corresponding to the target question; By scoring the text quality of each of the initial prompt words, a quality score corresponding to each of the initial prompt words is obtained, and each of the initial prompt words is screened according to the quality score to obtain candidate prompt words; The question-answering effect of the candidate prompt words is scored to obtain an effect score, and the effect score is used as an optimization criterion to perform text optimization on the candidate prompt words; Generate a question prompt word corresponding to the target question according to the optimized candidate prompt words.

2. The method according to claim 1, characterized in that: Get multiple initial prompt words corresponding to the target question, including: Get multiple history questions input by the user; Grouping the historical questions according to the text similarities between the historical questions to obtain similar question groups; If the number of historical questions in the similar question group is greater than or equal to a preset number threshold, determining high-frequency questions according to the historical questions in the similar question group, so as to form a high-frequency question library according to the high-frequency questions; A target question is determined from the high-frequency question library, and the target question is input into a plurality of preset prompt word generation models to obtain initial prompt words output by each of the prompt word generation models, wherein the prompt word generation model is trained based on a large language model.

3. The method according to claim 1, characterized in that By scoring the text quality of each of the initial prompt words, the quality scores corresponding to each of the initial prompt words are obtained, including: Acquire one or more prompt word scoring models, wherein the prompt word scoring models are trained based on a large language model; Using each of the prompt word scoring models to evaluate the rationality of the initial prompt word; If the initial prompt word does not meet the rationality, then the initial prompt word does not have a quality score; If the initial prompt word meets the rationality, each prompt word scoring model is used to score the text quality of the initial prompt word according to the preset scoring dimension, and the quality scoring results output by each prompt word scoring model are obtained, and the quality score is obtained by combining the quality scoring results.

4. The method according to claim 1, characterized in that: The initial prompt words are screened according to the quality score to obtain candidate prompt words, including at least one of the following: The initial prompt word with the highest quality score is used as the candidate prompt word; The initial prompt words whose quality scores are greater than or equal to the preset quality threshold are used as candidate prompt words.

5. The method according to claim 1, characterized in that The effect score is obtained by scoring the question-answering effect of the candidate prompt words, including at least one of the following: Determine the model output result corresponding to the candidate prompt word by using a preset question-answering model, and score the model output result by using a preset result scoring model to obtain an effect score; Collect user feedback data corresponding to the candidate prompt words, and score them according to the user feedback data to obtain an effect score, wherein the user feedback data includes at least one of the number of user modifications, the number of user uses, the user positive evaluation, and the user negative evaluation.

6. The method according to claim 1, characterized in that Taking the effect score as the optimization standard, text optimization is performed on the candidate prompt words, including: In response to the candidate prompt words, comparing the effect scores corresponding to the candidate prompt words according to a preset effect threshold; If the candidate prompt word satisfies a first preset condition and a second preset condition, setting the text optimization result of the candidate prompt word as optimization completed, wherein the first preset condition includes that the effect score is less than the preset effect threshold, and the second preset condition includes that the number of text optimizations of the candidate prompt word is less than the preset optimization number threshold; If the candidate prompt word does not meet the first preset condition, text optimization is performed on the candidate prompt word to obtain a new candidate prompt word; If the candidate prompt word does not meet the second preset condition, the text optimization result of the candidate prompt word is set as optimization failure.

7. The method according to claim 1, characterized in that The text of the candidate prompt word is optimized by at least one of the following methods: Performing text processing on the candidate prompt words, wherein the text processing includes at least one of deleting stop words, replacing synonyms, replacing near-synonyms, and adjusting the text order; A prompt word scoring model is used to output a quality evaluation corresponding to the candidate prompt words, wherein the prompt word scoring model is used to score the text quality of each of the initial prompt words; the quality evaluation is subjected to text parsing to extract a model positive evaluation and a model negative evaluation from the quality evaluation according to the text parsing result; a prompt word generation text is generated according to at least one of the candidate prompt words, the model positive evaluation and the model negative evaluation, and the prompt word generation text is input into the prompt word generation model, so that the prompt word generation model outputs a new candidate prompt word based on the model positive evaluation and / or the model negative evaluation.

8. The method according to any one of claims 1 to 7, characterized in that: After generating the question prompt word corresponding to the target question according to the optimized candidate prompt words, the method further includes: Displaying the question prompt to the user; If a modification instruction input by the user is received, the question prompt word is modified according to the prompt word modification instruction; If a selection instruction input by the user is received, the question prompt word is input into a preset question-answering model, so that the preset question-answering model outputs a question-answering result corresponding to the target question.

9. A system for generating question prompt words, characterized in that: include: An acquisition module is configured to acquire a plurality of initial prompt words corresponding to the target question; A screening module is configured to score the text quality of each of the initial prompt words to obtain a quality score corresponding to each of the initial prompt words, and screen each of the initial prompt words according to the quality score to obtain an alternative prompt word; an optimization module configured to score the question-answering effect of the candidate prompt words to obtain an effect score, and use the effect score as an optimization criterion to perform text optimization on the candidate prompt words; The generating module is configured to generate a question prompt word corresponding to the target question according to the optimized candidate prompt words.

10. An electronic device, characterized in that: include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Prompt word updating method, device and system based on multi-dimensional large language model

    CN118132716A

  • Model training method and question and answer processing method and device based on large language model

    CN118245581A

  • Method and system for optimizing cue word, electronic equipment and storage medium

    CN118428492A

  • Search optimization method and device for spoken text content

    CN118760750A

  • Prompt word generation method and related device

    CN119167934A

Cited By

  • Large model cue word automatic optimization method and device and electronic equipment

    CN120086360A