Power industry dispatching ticket generation model training method based on multi-level cue word guidance
Through the model training method based on multi-level prompt word guidance, the problems of inefficient and poor standardization of scheduling ticket writing in the power industry are solved, and automated and intelligent scheduling ticket generation are realized, and efficiency and standardization are improved.
Patent Information
- Application Number
- CN202411422516.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-02-07
AI Technical Summary
In the power industry, it takes a long time to manually write scheduling order tickets, which is inefficient and prone to errors, and the writing rules are complex and the threshold is high, resulting in poor standardization of bills and increasing the difficulty of subsequent work.
A model training method based on multi-level prompt word guidance is adopted, and a large model is pre-trained and multi-level instruction training is carried out, and the power industry dispatch ticket generation model is finally obtained, realizing the automated and intelligent generation of dispatch tickets from one-time arrangement to dispatch tickets.
It improves the efficiency of scheduling ticket generation, enhances the standardization and consistency of writing, reduces the error rate, simplifies the writing process, and lowers the threshold.
Abstract
Description
Technical Field
[0001] The invention relates to a model training method, and more particularly to a model training method for generating dispatch tickets for the electric power industry based on multi-level prompt words. Background Art
[0002] In the power industry, the work of repairing, replacing, adding, and expanding line equipment occurs every day. The dispatcher needs to write a dispatch instruction ticket according to the one-time arrangement in the maintenance application form. Then, according to the dispatch instruction ticket, the corresponding operator is dispatched step by step to perform the corresponding operation. Manually writing a dispatch instruction ticket from a one-time arrangement according to fixed rules often takes several minutes or dozens of minutes, which is inefficient and very error-prone. In addition, the writing rules are complicated and can only be written by people with considerable work experience, which has a high threshold. Different people have different writing habits, and the written bills are less standardized, which increases the difficulty of subsequent work. Summary of the invention
[0003] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a method for training a dispatch ticket generation model for the power industry based on multi-level prompt words, which effectively increases the writing efficiency and reduces the difficulty of subsequent work.
[0004] To achieve the above object, the present invention provides the following technical solution: a method for training a dispatch ticket generation model for the power industry based on multi-level prompt words, characterized in that it comprises the following steps:
[0005] Step 1: pre-train the model with basic instructions to obtain a pre-trained large model M1 that can follow the basic instructions;
[0006] Step 2: Perform multi-level instruction training on the large model M1 obtained in step 1 to obtain a model M2 that can follow the multi-level instructions;
[0007] Step three, train the dispatch order ticket writing model for the model M2 obtained in step two to obtain the final power industry dispatch ticket generation model M3.
[0008] As a further improvement of the present invention, the specific steps of pre-training the model with basic instructions in step 1 are as follows:
[0009] Step 1: All the basic rules of training are fine-grained to form a fine-grained rule base with n rules: R = {r1, r2, ... rn};
[0010] Step 1 and 2: Based on the rule base R, form an instruction base corresponding to each fine-grained rule, P = {p1, p2, p3…pn};
[0011] Step 13: construct the answer to the instruction in the instruction library formed in step 12, that is, label;
[0012] Step 14: Form a basic rule pre-trained data set D. Use this data set to pre-train the large model to obtain a pre-trained large model M1 that can follow basic instructions.
[0013] As a further improvement of the present invention, the instruction library in steps one and two is constructed by the following steps:
[0014] Step 121, construct the instruction format: {personality}+{responsibilities}\n+'rules to be followed:'\n+{rules}\n+"output format"\n+{output format requirements}\n+"example"\n+{example}\n+"Now enter:"\n+{input content}\n+"output:"\n;
[0015] Step 122, fill the existing one-time arrangement content and rules into the above instructions to form a training instruction library P.
[0016] As a further improvement of the present invention, the specific method of constructing the answer to the instruction in steps one and three is: the above instructions can be input into large models such as GPT4 to obtain labels, or they can be manually labeled or generated through fixed logic codes.
[0017] As a further improvement of the present invention, the specific steps of performing multi-level instruction training in step 2 are as follows: step 21, randomly combining the rules in the fine-grained rule base: R = {r1, r2, ... rn} in step 11 to obtain a multi-level rule base: R2; wherein each combination rule in R2 contains 2 to n / 2 rules;
[0018] Step 22, forming a multi-level prompt word instruction library P2 according to the combination of step 21;
[0019] Step 2 and 3: Form a multi-level instruction pre-training data set D2, where the labels in the data set D2 cannot be obtained at one time, but are implemented one by one by rules;
[0020] Step 24: Use dataset D and dataset D2 to fine-tune model M1 to obtain a model M2 that can follow multi-level instructions.
[0021] As a further improvement of the present invention, the specific steps of training the dispatch instruction ticket writing model in step 3 are as follows:
[0022] Step 31: construct an instruction library P3, which has only one prompt word containing all instructions;
[0023] Step 32: replace the input content in the instruction library P3 with the content in the one-time arrangement, and use the existing dispatch ticket content as the label of the instruction, thus forming a data set D3;
[0024] Step 33: Use data set D2 and data set D3 to train model M2 to obtain the final power industry dispatch ticket generation model M3.
[0025] The beneficial effect of the present invention is that, through the setting of steps one to three, it is possible to effectively realize the gradual training of the model by pre-training, then multi-level instruction training, and finally dispatch instruction ticket writing model training. Compared with the method in the prior art, through multi-level prompt words, the large model is trained to understand the logic of power dispatch ticket generation, thereby realizing the automatic and intelligent generation from one-time arrangement to dispatch ticket, improving the generation efficiency, enhancing the standardization and consistency of dispatch ticket writing, and reducing the error rate of writing. DETAILED DESCRIPTION
[0026] The present invention will be further described in detail with reference to the given embodiments below.
[0027] A method for training a dispatch ticket generation model for the electric power industry based on multi-level prompt words in this embodiment includes the following steps:
[0028] Step 1: pre-train the model with basic instructions to obtain a pre-trained large model M1 that can follow the basic instructions;
[0029] Step 2: Perform multi-level instruction training on the large model M1 obtained in step 1 to obtain a model M2 that can follow the multi-level instructions;
[0030] Step three, train the dispatch instruction ticket writing model for the model M2 obtained in step two to obtain the final power industry dispatch ticket generation model M3. In the process of using the training method of this embodiment, you only need to execute steps one to three in sequence. In this way, you can effectively achieve the effect of training the model in sequence, effectively improve the generation efficiency, enhance the standardization and consistency of dispatch ticket writing, and reduce the error rate of writing.
[0031] As a specific implementation of the improvement, the specific steps of pre-training the model with basic instructions in step 1 are as follows:
[0032] Step 1: All the basic rules of training are fine-grained to form a fine-grained rule base with n rules: R = {r1, r2, ... rn};
[0033] Step 1 and 2: Based on the rule base R, form an instruction base corresponding to each fine-grained rule, P = {p1, p2, p3…pn};
[0034] Step 13: construct the answer to the instruction in the instruction library formed in step 12, that is, label;
[0035] Step 14, form a data set D for pre-training of basic rules, use this data set to pre-train the large model, and obtain a pre-trained large model M1 that can follow basic instructions. Through the setting of the above steps, basic instruction pre-training can be realized simply and effectively.
[0036] As a specific implementation method of the improvement, the instruction library in step 12 is constructed by the following steps: Step 121, construct the format of the instruction: {personality}+{responsibilities}\n+'rules to be followed:'\n+{rules}\n+"output format"\n+{output format requirements}\n+"example"\n+{example}\n+"now enter:"\n+{input content}\n+"output:"\n;
[0037] Step 122: Fill the existing content and rules of the one-time arrangement into the above instructions to form a training instruction library P. Through the above headquarters settings, the training instruction library P can be effectively formed by constructing instructions and then filling in the content. The constructed instruction examples are as follows:
[0038] You are a very useful assistant. Now you are a dispatch ticket writer, and your responsibility is to generate dispatch tickets based on the given content and rules.
[0039] Rules to follow:
[0040] Xxx
[0041] Output format requirement: The output is a string
[0042] Example:
[0043] Xxx
[0044] Now type:
[0045] Xxxx
[0046] Output: .
[0047] As an improved specific implementation method, the specific method of constructing the answer to the instruction in steps one and three is: the above instructions can be input into large models such as GPT4 to obtain labels, or they can be manually labeled or generated through fixed logic codes. Through the setting of the above steps, the answers to the instructions can be constructed in three ways.
[0048] As an improved specific implementation method, the specific steps of performing multi-level instruction training in step 2 are as follows:
[0049] Step 21: randomly combine the rules in the fine-grained rule base R = {r1, r2, ... rn} in step 11 to obtain a multi-level rule base R2; each combination rule in R2 contains 2 to n / 2 rules;
[0050] Step 22, forming a multi-level prompt word instruction library P2 according to the combination of step 21;
[0051] Step 2 and 3: Form a multi-level instruction pre-training data set D2. The labels in the data set D2 cannot be obtained at once, but are implemented by executing rules one by one. For example, an instruction contains three rules. You need to execute one first to get the output, and then execute the second rule with the output. And so on.
[0052] Step 24, use dataset D and dataset D2 to train and fine-tune the model M1 to obtain a model M2 that can follow multi-level instructions. Through the settings of the above steps, it is possible to effectively obtain a multi-level rule base through a medium- and fine-grained rule base, and then form a corresponding pre-training dataset D2, and finally train to obtain a model M2 that can follow multi-level instructions.
[0053] As a specific implementation method of the improvement, the specific steps of training the dispatch instruction ticket writing model in step 3 are as follows:
[0054] Step 31: construct an instruction library P3, which has only one prompt word containing all instructions;
[0055] Step 32: replace the input content in the instruction library P3 with the content in the one-time arrangement, and use the existing dispatch ticket content as the label of the instruction, thus forming a data set D3. Simply put, data set D3 is a data set that generates dispatch tickets in one step with all its rules;
[0056] Step three, use data set D2 and data set D3 to train model M2 to obtain the final power industry dispatch ticket generation model M3. Through the above-mentioned headquarters settings, it is possible to effectively form data set D3 through instruction library P3, and then train model M2 through the combination of data set D2 and data set D3, and finally obtain the power industry dispatch ticket generation model M3.
[0057] To sum up, the training method for the dispatch ticket generation model in the power industry based on multi-level prompt words guidance in this embodiment complies with all instructions, arranges the generation of dispatch tickets in a one-time manner, and trains step by step from one level, multiple levels, and then to prompt words containing all rules, which improves the model's instruction-following ability, enables the model to have the ability to generate the final dispatch ticket in one step, improves the generation efficiency, enhances the standardization and consistency of dispatch ticket writing, and reduces the error rate of writing.
[0058] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for training a dispatch ticket generation model for the power industry based on multi-level prompt words, characterized in that: The steps include: Step 1: pre-train the model with basic instructions to obtain a pre-trained large model M1 that can follow the basic instructions; Step 2: Perform multi-level instruction training on the large model M1 obtained in step 1 to obtain a model M2 that can follow the multi-level instructions; Step three, train the dispatch order ticket writing model for the model M2 obtained in step two to obtain the final power industry dispatch ticket generation model M3.
2. The method for training a dispatch ticket generation model for the electric power industry based on multi-level prompt words guidance according to claim 1 is characterized in that: The specific steps of pre-training the model with basic instructions in step 1 are as follows: Step 1: All the basic rules of training are fine-grained to form a fine-grained rule base with n rules: R = {r1, r2, ... rn}; Step 1 and 2: Based on the rule base R, form an instruction base corresponding to each fine-grained rule, P = {p1, p2, p3…pn}; Step 13: construct the answer to the instruction in the instruction library formed in step 12, that is, label; Step 14: Form a data set D for pre-training of basic rules, use the data set to pre-train the large model, and obtain a pre-trained large model M1 that can follow basic instructions.
3. The method for training a dispatch ticket generation model for the electric power industry based on multi-level prompt words guidance according to claim 2 is characterized in that: The instruction library in steps 1 and 2 is constructed by the following steps: Step 121, construct the instruction format: {personality}+{responsibilities}\n+'rules to be followed:'\n+{rules}\n+"output format"\n+{output format requirements}\n+"example"\n+{example}\n+"Now enter:"\n+{input content}\n+"output:"\n; Step 122, fill the existing one-time arrangement content and rules into the above instructions to form a training instruction library P.
4. The method for training a dispatch ticket generation model for the electric power industry based on multi-level prompt words guidance according to claim 3 is characterized in that: The specific method of constructing the answer to the instruction in steps one and three is: the above instructions can be input into large models such as GPT4 to obtain labels, or they can be manually labeled or generated through fixed logic codes.
5. The method for training a dispatch ticket generation model for the electric power industry based on multi-level prompt words guidance according to claims 2 to 4 is characterized in that: The specific steps of performing multi-level instruction training in step 2 are as follows: Step 21: randomly combine the rules in the fine-grained rule base R = {r1, r2, ... rn} in step 11 to obtain a multi-level rule base R2; each combination rule in R2 contains 2 to n / 2 rules; Step 22, forming a multi-level prompt word instruction library P2 according to the combination of step 21; Step 2 and 3: Form a multi-level instruction pre-training data set D2, where the labels in the data set D2 cannot be obtained at one time, but are implemented one by one by rules; Step 24: Use dataset D and dataset D2 to fine-tune model M1 to obtain a model M2 that can follow multi-level instructions.
6. The method for training a dispatch ticket generation model for the electric power industry based on multi-level prompt words guidance according to claim 5 is characterized in that: The specific steps for training the dispatch instruction ticket writing model in step 3 are as follows: Step 31: construct an instruction library P3, which has only one prompt word containing all instructions; Step 32: replace the input content in the instruction library P3 with the content in the one-time arrangement, and use the existing dispatch ticket content as the label of the instruction, thus forming a data set D3; Step 33: Use data set D2 and data set D3 to train model M2 to obtain the final power industry dispatch ticket generation model M3.