CN116991976A - Model training method, device, electronic equipment and readable storage medium - Google Patents
Model training method, device, electronic equipment and readable storage medium Download PDFInfo
- Publication number
- CN116991976A CN116991976A CN202311147535.7A CN202311147535A CN116991976A CN 116991976 A CN116991976 A CN 116991976A CN 202311147535 A CN202311147535 A CN 202311147535A CN 116991976 A CN116991976 A CN 116991976A
- Authority
- CN
- China
- Prior art keywords
- task
- instruction
- text
- data set
- training
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012549 training Methods 0.000 title claims abstract description 111
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000003058 natural language processing Methods 0.000 claims abstract description 40
- 230000001149 cognitive effect Effects 0.000 claims abstract description 34
- 230000002776 aggregation Effects 0.000 claims description 15
- 238000004220 aggregation Methods 0.000 claims description 15
- 229920006395 saturated elastomer Polymers 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 9
- 230000004931 aggregating effect Effects 0.000 claims description 5
- 230000003930 cognitive ability Effects 0.000 abstract 1
- 230000011218 segmentation Effects 0.000 description 21
- 238000012545 processing Methods 0.000 description 18
- 230000019771 cognition Effects 0.000 description 9
- 230000000694 effects Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 230000003993 interaction Effects 0.000 description 5
- 241000282414 Homo sapiens Species 0.000 description 4
- 230000006399 behavior Effects 0.000 description 4
- 238000011156 evaluation Methods 0.000 description 4
- 238000013473 artificial intelligence Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000006872 improvement Effects 0.000 description 3
- 238000007619 statistical method Methods 0.000 description 3
- 238000013519 translation Methods 0.000 description 3
- PEDCQBHIVMGVHV-UHFFFAOYSA-N Glycerine Chemical compound OCC(O)CO PEDCQBHIVMGVHV-UHFFFAOYSA-N 0.000 description 2
- 230000033228 biological regulation Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006698 induction Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000002787 reinforcement Effects 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009897 systematic effect Effects 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/289—Phrasal analysis, e.g. finite state techniques or chunking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Machine Translation (AREA)
Abstract
The invention provides a model training method, a model training device, electronic equipment and a readable storage medium, and belongs to the technical field of natural language processing. The method comprises the following steps: acquiring a first text data set, wherein the first text data set comprises a plurality of expression texts of a first instruction task; the method comprises the steps of obtaining a hierarchy level of each first instruction task, wherein the hierarchy level is used for indicating the cognitive difficulty of the first instruction task in natural language processing; and training a first model according to the sequence of the hierarchical level from low to high in the cognitive difficulty, and based on the expression text of the first instruction task of the hierarchical level in the first text data set in sequence. The invention can enable the large model to have multi-level cognitive ability and solve the problem of more complexity.
Description
Technical Field
The embodiment of the invention relates to the technical field of natural language processing, in particular to a model training method, a device, electronic equipment and a readable storage medium.
Background
With the rapid development of natural language processing (Natural Language Processing, NLP) technology, large models are widely used. The large model carries out natural language processing on the input instruction task, and the output result can accord with the behavior specification and interaction mode of human beings, thereby realizing man-machine interaction.
Large models often require training prior to human interaction. Through massive text data, a pre-training model is built by utilizing an autoregressive learning mode, so that the pre-training model has rich knowledge; and fine tuning is carried out on the pre-training model through text data of the instruction task, so that the pre-training model learns how to solve the actual instruction task by using knowledge, and the capability of the large model for solving the instruction task is greatly improved.
At present, when a pre-training model is subjected to fine adjustment, text data of an instruction task is generally selected randomly, so that the improvement of the processing capacity of the large model is prevented, and the model training effect is poor.
Disclosure of Invention
The embodiment of the invention provides a model training method, device, electronic equipment and readable storage medium, which are used for solving the problems that in the prior art, large model training is performed by randomly selecting text data of an instruction task, the improvement of processing capacity of the large model is prevented, and the model training effect is poor.
In a first aspect, an embodiment of the present invention provides a model training method, where the method includes:
acquiring a first text data set, wherein the first text data set comprises a plurality of expression texts of a first instruction task;
The method comprises the steps of obtaining a hierarchy level of each first instruction task, wherein the hierarchy level is used for indicating the cognitive difficulty of the first instruction task in natural language processing;
and training a first model according to the sequence of the hierarchical level from low to high in the cognitive difficulty, and based on the expression text of the first instruction task of the hierarchical level in the first text data set in sequence.
In a second aspect, an embodiment of the present invention provides a model training apparatus, including:
the first acquisition module is used for acquiring a first text data set, wherein the first text data set comprises a plurality of expression texts of a first instruction task;
the second acquisition module is used for acquiring the hierarchy level of each first instruction task, wherein the hierarchy level is used for indicating the cognitive difficulty of the first instruction task in natural language processing;
and the training module is used for training the first model based on the expression text of the first instruction task of the hierarchy level in the first text data set in sequence according to the sequence of the hierarchy level from low to high in the cognitive difficulty.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a memory, and a computer program stored on the memory and executable on the processor, the computer program implementing the steps of the model training method described above when executed by the processor.
In a fourth aspect, embodiments of the present invention provide a readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the model training method described above.
In the embodiment of the invention, a first text data set is acquired, wherein the first text data set comprises a plurality of expression texts of a first instruction task; the method comprises the steps of obtaining a hierarchy level of each first instruction task, wherein the hierarchy level is used for indicating the cognitive difficulty of the first instruction task in natural language processing; and training the first model according to the sequence of the hierarchy level from low to high sequentially based on the expression text of the first instruction task of the hierarchy level in the first text data set. Therefore, the instruction tasks are classified in the hierarchical level from the cognition difficulty, and the large model is trained according to the sequence from low cognition difficulty to high cognition difficulty, so that the iteration can be continuously carried out for improving the capacity, the large model with different capacity levels is built, the training effect of the large model is improved, the large model has the cognition capacity of multiple levels, and the problem of more complexity is solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a model training method according to an embodiment of the present invention;
FIG. 2 is a task dimension schematic of a rich instruction task generated by a large model;
FIG. 3 is a schematic diagram of aggregate task categories for an NLP instruction task system;
FIG. 4 is a schematic structural diagram of a model training device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that, the model training method provided by the embodiment of the invention relates to the technical field of natural language processing, and can be widely applied to various fields such as financial field, artificial intelligence field and the like. For example, when applied to the financial field, the instruction task may relate to financial knowledge, such as "whether the action of collecting the cut information of the customer meets the financial laws and regulations" the instruction task. For another example, when the method is applied to the field of artificial intelligence, the instruction task can relate to a behavior instruction and a question-answer instruction, for example, the method can be applied to a robot, and the instruction can be input so that the robot can execute the corresponding task.
For the large model of NLP, training is needed to make the large model applicable, and the large model is constructed as follows:
(1) Through massive text data, a pre-training model is built by utilizing an autoregressive learning mode, so that the pre-training model has rich knowledge;
(2) The pre-training model is finely adjusted through text data of the instruction task, so that the pre-training model learns how to solve the actual instruction task by using knowledge, and the capability of the large model for solving the instruction task is greatly improved;
(3) The output result of the large model accords with the behavior specification and interaction mode of human beings through the learning mode of the reinforcement learning of man-machine interaction.
The model training in the embodiment of the invention mainly relates to the process of the (2) stage, namely, on the basis of pre-training, the large model is finely tuned so as to improve the capability of the large model to solve instruction tasks.
At present, when a pre-training model is subjected to fine adjustment, text data of an instruction task is generally selected at random, the essence of the instruction task is ignored to have a knowledge level, so that the improvement of the processing capacity of the large model is prevented, and the model training effect is poor. Moreover, the internal relation among NLP task instructions is ignored, so that the understanding level of the large model to the instruction tasks is not deep, and a cognitive hierarchy structure similar to human brain is lacked, thereby preventing the later capacity of the large model from being improved, and often causing the problem of catastrophic forgetting of knowledge.
The aim of the embodiment of the invention is to build a large model with different capability levels, so that the large model has a human-like cognitive capability system.
The model training method provided by the embodiment of the invention is described in detail below.
Referring to fig. 1, a flow chart of a model training method provided by an embodiment of the present invention is shown. As shown in fig. 1, the method may include the steps of:
step 101, a first text data set is obtained, wherein the first text data set comprises a plurality of expression texts of a first instruction task.
In the embodiment of the invention, the model training method relates to the technical field of natural language processing, and can be widely used in various scenes such as financial scenes, artificial intelligence and the like. The model training method of the embodiment of the disclosure may be performed by the model training apparatus of the embodiment of the disclosure. The model training apparatus of the embodiments of the present disclosure may be configured in any electronic device to perform the model training method of the embodiments of the present disclosure.
The instruction task is an instruction type task, and the essence of the instruction task is to input an instruction, so that the large model performs natural language processing by using learned knowledge, and the corresponding task is realized. For example, the instruction task "find out the word with a sense of one word in the following two sentences", and for example, "please write a romantic poem for the moon as the theme".
The first instruction task can be described by a text, and the expression text of the first instruction task is instruction description information of the first instruction task. The first instruction task may be a single-dimensional instruction task, for example, an instruction task of "word segmentation of an input sentence", "classification of an input text", or a multi-dimensional instruction task, for example, an instruction task of "word segmentation of an input sentence, statistics of the number of words", where the instruction task may relate to a word segmentation task and a statistics task of "word segmentation of an input sentence, and if there is an entity, an entity type" is output, where the instruction task may relate to a word segmentation task and an entity recognition task.
The first text data set may be marked by a user, for example, an NLP expert may comb through a system of instruction tasks to create a systematic and complete instruction task system, and the first text data set may include instruction tasks in the instruction task system, or may be created by a large model, for example, an expert may create a seed instruction, and the large model expands and enriches based on the seed instruction to create a plurality of instruction tasks, or a combination of the instruction tasks, which is not particularly limited herein.
Step 102, obtaining a hierarchy level of each first instruction task, where the hierarchy level is used to indicate the cognitive difficulty of the first instruction task in natural language processing.
The method can divide the instruction task of the NLP into six hierarchical levels of memory, understanding, simple reasoning, complex reasoning, evaluation demonstration and creation by referring to the cognitive system of the Bruim:
memory: the method is characterized in that concepts and knowledge are known and memorized, the concepts and the knowledge are stored in a large model and can be extracted at any time, wherein the fact knowledge, concepts and the like related in NLP instruction tasks belong to the category, for example, the first part of a country A is a region A, the height of a third part is 2 meters and the like all belong to memory knowledge, for example, idioms are filled in, and the large model is supplemented with NLP instruction tasks of which the second part belongs to memory category by given poetry upper half sentences.
Understanding: to understand things or knowledge, natural language understanding (Natural Language Understanding, NLU) refers to a broader scope, but the understanding referred to herein is generally shallow, mainly to establish a correlation between new and old knowledge, for example, transforming a sentence into a passive sentence, listing a subject of a sentence, identifying an entity of a sentence, etc., instruction tasks all belong to the hierarchical level of understanding.
Simple reasoning: refers to the application of learned concepts, rules and principles, and embodies the ability to apply learned knowledge to new situations and solve practical problems. For example, a multi-hop question answer "where is a third child born? Instruction tasks such as "", reading and understanding.
Complicated reasoning: the task involves first understanding the meaning of a word with ambiguity, then word segmentation of two sentences, then finding two words with identical character layers, and determining whether the semantics of the two characters in the respective sentences are identical.
Evaluation proves that: refers to the integration of intrinsic and extrinsic materials and information to make inferences conforming to objective facts. For the instruction task of the NLP, objective evaluation and corresponding basis can be given, for example, the instruction task: "whether the behavior of collecting the cut-off of the customer meets the financial laws and regulations" is performed.
Creating: refers to the ability to reassemble learned knowledge or add information generated by itself to form a new whole, e.g., instruct task "please write a romantic poem for moon as the theme".
The six hierarchical levels are ranked from low to high in cognitive difficulty as memory, understanding, simple reasoning, complex reasoning, evaluation proof and creation, i.e. memory is simplest in cognitive difficulty and creation is most complex in cognitive difficulty.
The user may refer to the cognitive system of the bloom to perform the hierarchical level marking of the first instruction task according to the six hierarchical levels, or the large model may perform the hierarchical level marking of the first instruction task according to the six hierarchical levels, or both may perform the hierarchical level marking of the first instruction task in combination, which is not limited specifically herein.
In the step, the hierarchical level of each first instruction task is obtained, so that the processing capacity of the large model can be continuously and iteratively increased from low to high in the cognitive difficulty in the fine adjustment process of the first model, namely the large model, aiming at the instruction tasks.
And step 103, training a first model according to the sequence of the hierarchical level from low to high in the cognitive difficulty, and based on the expression text of the first instruction task of the hierarchical level in the first text data set in sequence.
The first model may be a large model, i.e., a model that performs natural language processing, and the first model may be a pre-trained model.
The training of the first model is sequentially iterated from low to high in the cognitive difficulty according to the hierarchy level, the first model can be trained based on the first instruction task of the low hierarchy level, under the condition that the processing learning of the instruction task of the low hierarchy level by the first model is completed, the first model is continuously trained based on the first instruction task of the high hierarchy level, and the like until the training of the highest hierarchy level in the cognitive difficulty is completed, and at the moment, the training of the first model is completed.
When training of the training data set of a level is completed, the processing result index of the instruction task of the level reaches a preset expected index, or the learning gain of the first model for the instruction task of the level is in a saturated state, the processing learning of the first model for the instruction task of the level can be indicated to be completed.
Optionally, the step 103 specifically includes:
training a first model based on a first training dataset in the first text dataset, the first training dataset comprising the descriptive text of a first instruction task of a first hierarchical level;
and under the condition that the learning gain of the first model for the first-level instruction task is in a saturated state, continuing training the first model based on a second training data set in the first text data set, wherein the second training data set comprises the expression text of the second-level first-level instruction task, and the second-level is higher than the first-level in cognitive difficulty.
Specifically, for a hierarchical level, a training data set may be obtained from a first text data set, where the training data set includes a text representing a first instruction task of the hierarchical level, and the text representing the first instruction task in the training data set is input to a first model for natural language processing, so that a large model may learn processing logic of the first instruction task of the hierarchical level, and parameters of the large model may be adjusted. And after training of the training data set is completed and/or the first model is saturated in learning of the hierarchy level, the first model is indicated to complete processing and learning of the instruction task of the hierarchy level.
In the training process, the processing result index of the first model on the instruction task can be counted, and the processing result index can comprise the accuracy rate (ACC) of task processing, the comprehensive score (F1) of task processing and the like. If the processing result index is not increased or the increasing speed is slower, the learning gain of the first model for the instruction task of the first hierarchy level is shown to be in a saturated state, otherwise, the learning gain of the first model for the instruction task of the first hierarchy level is shown to be not in a saturated state.
Under the condition that the learning gain of the first model aiming at the instruction task with the low level is in a saturated state, the instruction task with the high level is continuously trained, so that the training efficiency of the first model can be improved while the first model fully learns the processing of the instruction task.
Optionally, the method further comprises:
under the condition that a preset condition is met, determining that the first model training is successful;
wherein the target condition includes at least one of:
the training of the first text data set is completed;
the first model achieves a preset expected index on a processing result index of a first instruction task of a first target hierarchy level, wherein the first target hierarchy level is the hierarchy level with the highest cognition difficulty in the hierarchy levels.
Therefore, the capability system of the large model can be constructed progressively according to the knowledge level of the NLP task, so that the pre-training model has the capability systems of knowledge of different levels, and the later capability of the large model can be improved.
In this embodiment, a first text data set is acquired, where the first text data set includes a plurality of expression texts of a first instruction task; the method comprises the steps of obtaining a hierarchy level of each first instruction task, wherein the hierarchy level is used for indicating the cognitive difficulty of the first instruction task in natural language processing; and training the first model according to the sequence of the hierarchy level from low to high sequentially based on the expression text of the first instruction task of the hierarchy level in the first text data set. Therefore, the instruction tasks are classified in the hierarchical level from the cognition difficulty, and the large model is trained according to the sequence from low cognition difficulty to high cognition difficulty, so that the iteration can be continuously carried out for improving the capacity, the large model with different capacity levels is built, the training effect of the large model is improved, the large model has the cognition capacity of multiple levels, and the problem of more complexity is solved.
The first instruction task may be a multi-dimensional instruction task. Optionally, the step 101 specifically includes:
acquiring a second text data set, wherein the second text data set comprises expression texts of a plurality of second instruction tasks;
acquiring at least one expression text of the first instruction task based on the expression text of the second instruction task in the second text data set; the first instruction task is an instruction task on N task dimensions, the N task dimensions comprise task dimensions of the second instruction task, and N is an integer greater than 1;
and aggregating the expression text of at least one first instruction task to the second text data set to obtain the first text data set.
The second instruction task may be a single-dimensional instruction task, the NLP expert organizes a system of instruction tasks, a systemized and complete instruction task system is established, and the second text data set may include instruction tasks in the instruction task system.
The user can construct the instruction task combined by multiple tasks based on the second instruction task so as to obtain the multi-dimensional first instruction task, the multi-dimensional first instruction task can be generated by expanding a large model such as chatGPT, GPT4 and the like based on the second instruction task, and the multi-dimensional first instruction task can be obtained in a mode combining the two modes, namely a man-machine cooperation mode. Correspondingly, the first instruction task can be aggregated into the second text data set to obtain the first text data set.
Optionally, the obtaining, based on the expression text of the second instruction task in the second text data set, the expression text of at least one first instruction task includes:
acquiring a task prompt template, wherein the task prompt template comprises main body task dimension information, task combination dimension information and an input text, the main body task dimension information indicates the task dimension of the second instruction task, and the task combination dimension information indicates other task dimensions different from the task dimension of the second instruction task;
inputting the task prompt template into a second model for natural language processing, and outputting the expression text of at least one first instruction task;
the N task dimensions comprise at least one task dimension of the second instruction task and the task dimension indicated by the task combination dimension information.
In this embodiment, the second instruction task in the second text data set may be thinned and the sample expanded. Task hint templates (templates) for instruction tasks may be constructed, generating more abundant candidate instruction tasks by means of large model extensions, examples of templates being as follows:
"please surround #" word segmentation task #, build richer subtasks
The following dimensions may be combined: grammar, information, similarity, sorting, conversion, translation, text generation, security, multiple sentences, output format, statistical analysis, etc
#input#:
According to json format output, 10 results are output each time, the subtask is required to have more patterns and low similarity
#output#:
# subtask: "
In the aforementioned campt, "word segmentation task" is main task dimension information, and "grammar, information, similarity, classification and ordering, conversion, translation, text generation, security, multiple sentences, output format, statistical analysis, and the like" is task combination dimension information. The input text (input) may be "Zhang Sanis a member of the area A Association".
The second model may be a big model such as chatGPT, GPT4, etc., the task prompt template may be input to the second model for natural language processing, and at least one expression text of the first instruction task is output, for example, in the foregoing promt, 10 first instruction tasks may be output at a time, where the 10 first instruction tasks are multidimensional tasks combined with task dimensions of the word segmentation task and task dimensions indicated by task combination dimension information. The 10 first instruction tasks require a large number of subtasks and have low similarity.
A plurality of second instruction tasks may be constructed by the expert, which may be seed tasks, which may be extended by means of a second model, and a plurality of first instruction tasks may be output, which may be multidimensional tasks.
Fig. 2 is a task dimension diagram of a rich instruction task generated by a large model, and as shown in fig. 2, a basic task is a word segmentation task, and can be refined and sample expanded by combining a grammar task dimension, an information task dimension, a similarity task dimension, a classification ordering task dimension, a conversion task dimension, a translation task dimension, a text generation task dimension, a security task dimension, a multi-sentence task dimension, an output format task dimension and a statistical analysis task dimension. For example, the dimension of the information task can be combined for refinement, and sample expansion is performed from the aspects of entity category and entity word.
Optionally, the obtaining, based on the expression text of the second instruction task in the second text data set, the expression text of at least one first instruction task includes:
and acquiring the expression text of at least one first instruction task input by a user, wherein the expression text of the first instruction task is constructed by the user based on the expression text of the second instruction task in the second text data set.
For each type of task in the second text data set, the user may construct a multi-dimensional instruction task paradigm, e.g., for word segmentation tasks, instruction tasks may be designed that combine multiple tasks as follows:
dividing words of the input sentences, and counting the number of the words;
word segmentation is carried out on the input sentences, and the most important words are output;
word segmentation is carried out on the input sentences, and output is organized according to a list form;
dividing words of the input sentences, and sequencing the importance of the words;
word segmentation is carried out on the input sentences, and only words of entity types are output;
word segmentation is carried out on the input sentence, and only verbs are output;
dividing words of the input sentences, and only outputting main words;
word segmentation is carried out on the input sentences, and only words with a dynamic guest relation are output;
the input sentence is segmented, and the sign "# #" is replaced by the sign "#";
word segmentation is carried out on the input sentences, and if entities exist, the entity types are output;
dividing words of the input sentences, and classifying and outputting according to the parts of speech;
word segmentation is carried out on the input sentence, and the first word is translated into English;
word segmentation is carried out on the input sentence, and the most important 3 words are used for sentence making;
word segmentation is carried out on the input sentence, and the most important words and corresponding pinyin are output;
Word segmentation is carried out on the input sentence, and two words which are the most similar are output;
the method comprises the steps of segmenting an input sentence, outputting the longest word, and outputting the token of the word in reverse order.
The instruction tasks generated by the large model can be screened and fused into the instruction tasks constructed by the user, and then the instruction tasks are aggregated into a second text data set to obtain a first text data set. Therefore, the multi-dimensional instruction task can be generated, so that the diversity of task instructions is ensured, and the endogenous logic relationship among the task instructions is established. The large model can learn logicality among task instructions and perform inherent logicality learning from knowledge to simple tasks to complex tasks.
Optionally, the step 102 specifically includes:
performing aggregation classification on first instruction tasks in the first text data set to obtain aggregation task categories of the first instruction tasks;
and determining the hierarchy level of the first instruction task based on the aggregate task category.
And carrying out aggregation classification on the first instruction tasks according to preset aggregation task categories obtained by expert induction and total through a large model such as gpt4 to obtain the aggregation task category of each first instruction task. Fig. 3 is a schematic diagram of aggregate task categories of an NLP instruction task system, and as shown in fig. 3, the aggregate task category of an instruction task for part-of-speech tagging, synonym generation, lexical analysis, etc. may be "basic NLP", and the aggregate task category of an instruction task for punctuation and fact determination may be "determination". The aggregate task category may be two-dimensional, as shown in fig. 3, and the basic NLP and the instruction tasks of decision and the like may be further aggregated into an aggregate task category of preset aggregate task categories such as "creation category", "description", "dialog" and the like.
The first instruction task may then be ranked by means of a large model or by a user based on aggregated task categories, resulting in a hierarchical ranking of the first instruction task. Therefore, the classification process of the hierarchical level of the first instruction task can be simplified, and the classification efficiency of the hierarchical level of the first instruction task can be improved.
The model training device provided by the embodiment of the invention is described below.
Referring to fig. 4, a schematic structural diagram of a model training apparatus provided in an embodiment of the present invention is shown, and as shown in fig. 4, a model training apparatus 400 includes:
a first obtaining module 401, configured to obtain a first text data set, where the first text data set includes a plurality of expression texts of a first instruction task;
a second obtaining module 402, configured to obtain a hierarchy level of each first instruction task, where the hierarchy level is used to indicate a cognitive difficulty of the first instruction task in natural language processing;
the training module 403 is configured to train the first model sequentially based on the text of the first instruction task of the hierarchical level in the first text dataset according to the order of the hierarchical level from low to high in cognitive difficulty.
Optionally, the training module 403 is specifically configured to:
Training a first model based on a first training dataset in the first text dataset, the first training dataset comprising the descriptive text of a first instruction task of a first hierarchical level;
and under the condition that the learning gain of the first model for the first-level instruction task is in a saturated state, continuing training the first model based on a second training data set in the first text data set, wherein the second training data set comprises the expression text of the second-level first-level instruction task, and the second-level is higher than the first-level in cognitive difficulty.
Optionally, the first obtaining module 401 includes:
a first acquisition unit configured to acquire a second text data set including expression texts of a plurality of second instruction tasks;
the second acquisition unit is used for acquiring the expression text of at least one first instruction task based on the expression text of a second instruction task in the second text data set; the first instruction task is an instruction task on N task dimensions, the N task dimensions comprise task dimensions of the second instruction task, and N is an integer greater than 1;
And the aggregation unit is used for aggregating the expression text of at least one first instruction task to the second text data set to obtain the first text data set.
Optionally, the second obtaining unit is specifically configured to:
acquiring a task prompt template, wherein the task prompt template comprises main body task dimension information, task combination dimension information and an input text, the main body task dimension information indicates the task dimension of the second instruction task, and the task combination dimension information indicates other task dimensions different from the task dimension of the second instruction task;
inputting the task prompt template into a second model for natural language processing, and outputting the expression text of at least one first instruction task;
the N task dimensions comprise at least one task dimension of the second instruction task and the task dimension indicated by the task combination dimension information.
Optionally, the second obtaining unit is specifically configured to:
and acquiring the expression text of at least one first instruction task input by a user, wherein the expression text of the first instruction task is constructed by the user based on the expression text of the second instruction task in the second text data set.
Optionally, the second obtaining module 402 is specifically configured to:
performing aggregation classification on first instruction tasks in the first text data set to obtain aggregation task categories of the first instruction tasks;
and determining the hierarchy level of the first instruction task based on the aggregate task category.
The model training apparatus 400 can implement each process implemented in the foregoing embodiment of the model training method, and can achieve the same technical effects, and for avoiding repetition, a detailed description is omitted herein.
The electronic device provided by the embodiment of the invention is explained below.
Referring to fig. 5, a schematic structural diagram of an electronic device according to an embodiment of the present invention is shown. As shown in fig. 5, the electronic device 500 includes: a processor 501, a memory 502, a user interface 503, and a bus interface 504.
A processor 501 for reading the program in the memory 502, and performing the following procedures:
acquiring a first text data set, wherein the first text data set comprises a plurality of expression texts of a first instruction task;
the method comprises the steps of obtaining a hierarchy level of each first instruction task, wherein the hierarchy level is used for indicating the cognitive difficulty of the first instruction task in natural language processing;
and training a first model according to the sequence of the hierarchical level from low to high in the cognitive difficulty, and based on the expression text of the first instruction task of the hierarchical level in the first text data set in sequence.
In fig. 5, a bus architecture may comprise any number of interconnected buses and bridges, with one or more processors, represented in particular by processor 501, and various circuits of memory, represented by memory 502, linked together. The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are well known in the art and, therefore, will not be described further herein. Bus interface 504 provides an interface. The user interface 503 may also be an interface capable of interfacing with an inscribed desired device for a different user device, including but not limited to a keypad, display, speaker, microphone, joystick, etc.
The processor 501 is responsible for managing the bus architecture and general processing, and the memory 502 may store data used by the processor 501 in performing operations.
Optionally, the processor 501 is further configured to:
training a first model based on a first training dataset in the first text dataset, the first training dataset comprising the descriptive text of a first instruction task of a first hierarchical level;
and under the condition that the learning gain of the first model for the first-level instruction task is in a saturated state, continuing training the first model based on a second training data set in the first text data set, wherein the second training data set comprises the expression text of the second-level first-level instruction task, and the second-level is higher than the first-level in cognitive difficulty.
Optionally, the processor 501 is further configured to:
acquiring a second text data set, wherein the second text data set comprises expression texts of a plurality of second instruction tasks;
acquiring at least one expression text of the first instruction task based on the expression text of the second instruction task in the second text data set; the first instruction task is an instruction task on N task dimensions, the N task dimensions comprise task dimensions of the second instruction task, and N is an integer greater than 1;
and aggregating the expression text of at least one first instruction task to the second text data set to obtain the first text data set.
Optionally, the processor 501 is further configured to:
acquiring a task prompt template, wherein the task prompt template comprises main body task dimension information, task combination dimension information and an input text, the main body task dimension information indicates the task dimension of the second instruction task, and the task combination dimension information indicates other task dimensions different from the task dimension of the second instruction task;
inputting the task prompt template into a second model for natural language processing, and outputting the expression text of at least one first instruction task;
The N task dimensions comprise at least one task dimension of the second instruction task and the task dimension indicated by the task combination dimension information.
Optionally, the processor 501 is further configured to:
and acquiring the expression text of at least one first instruction task input by a user, wherein the expression text of the first instruction task is constructed by the user based on the expression text of the second instruction task in the second text data set.
Optionally, the processor 501 is further configured to:
performing aggregation classification on first instruction tasks in the first text data set to obtain aggregation task categories of the first instruction tasks;
and determining the hierarchy level of the first instruction task based on the aggregate task category.
Preferably, the embodiment of the present invention further provides an electronic device, including a processor 501, a memory 502, and a computer program stored in the memory 502 and capable of running on the processor 501, where the computer program when executed by the processor 501 implements each process of the foregoing embodiment of the model training method, and the same technical effects can be achieved, so that repetition is avoided and redundant description is omitted herein.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the processes of the model training method embodiment described above, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here. Wherein the computer readable storage medium is selected from Read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the embodiments provided in the present application, it should be understood that the disclosed system and method may be implemented in other manners. For example, the system embodiments described above are merely illustrative, e.g., the division of the elements is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present invention.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.
Claims (14)
1. A method of model training, the method comprising:
acquiring a first text data set, wherein the first text data set comprises a plurality of expression texts of a first instruction task;
the method comprises the steps of obtaining a hierarchy level of each first instruction task, wherein the hierarchy level is used for indicating the cognitive difficulty of the first instruction task in natural language processing;
and training a first model according to the sequence of the hierarchical level from low to high in the cognitive difficulty, and based on the expression text of the first instruction task of the hierarchical level in the first text data set in sequence.
2. The method of claim 1, wherein training the first model based on the text representing the first instruction task of the hierarchical level in the first text dataset in order of the hierarchical level from low to high in cognitive difficulty sequentially comprises:
Training a first model based on a first training dataset in the first text dataset, the first training dataset comprising the descriptive text of a first instruction task of a first hierarchical level;
and under the condition that the learning gain of the first model for the first-level instruction task is in a saturated state, continuing training the first model based on a second training data set in the first text data set, wherein the second training data set comprises the expression text of the second-level first-level instruction task, and the second-level is higher than the first-level in cognitive difficulty.
3. The method of claim 1, wherein the acquiring the first text data set comprises:
acquiring a second text data set, wherein the second text data set comprises expression texts of a plurality of second instruction tasks;
acquiring at least one expression text of the first instruction task based on the expression text of the second instruction task in the second text data set; the first instruction task is an instruction task on N task dimensions, the N task dimensions comprise task dimensions of the second instruction task, and N is an integer greater than 1;
And aggregating the expression text of at least one first instruction task to the second text data set to obtain the first text data set.
4. A method according to claim 3, wherein said obtaining said descriptive text for at least one of said first instruction tasks based on said descriptive text for a second instruction task in said second text dataset comprises:
acquiring a task prompt template, wherein the task prompt template comprises main body task dimension information, task combination dimension information and an input text, the main body task dimension information indicates the task dimension of the second instruction task, and the task combination dimension information indicates other task dimensions different from the task dimension of the second instruction task;
inputting the task prompt template into a second model for natural language processing, and outputting the expression text of at least one first instruction task;
the N task dimensions comprise at least one task dimension of the second instruction task and the task dimension indicated by the task combination dimension information.
5. A method according to claim 3, wherein said obtaining said descriptive text for at least one of said first instruction tasks based on said descriptive text for a second instruction task in said second text dataset comprises:
And acquiring the expression text of at least one first instruction task input by a user, wherein the expression text of the first instruction task is constructed by the user based on the expression text of the second instruction task in the second text data set.
6. The method of claim 1, wherein the obtaining the hierarchical level of each first instruction task comprises:
performing aggregation classification on first instruction tasks in the first text data set to obtain aggregation task categories of the first instruction tasks;
and determining the hierarchy level of the first instruction task based on the aggregate task category.
7. A model training apparatus, the apparatus comprising:
the first acquisition module is used for acquiring a first text data set, wherein the first text data set comprises a plurality of expression texts of a first instruction task;
the second acquisition module is used for acquiring the hierarchy level of each first instruction task, wherein the hierarchy level is used for indicating the cognitive difficulty of the first instruction task in natural language processing;
and the training module is used for training the first model based on the expression text of the first instruction task of the hierarchy level in the first text data set in sequence according to the sequence of the hierarchy level from low to high in the cognitive difficulty.
8. The device according to claim 7, wherein the training module is specifically configured to:
training a first model based on a first training dataset in the first text dataset, the first training dataset comprising the descriptive text of a first instruction task of a first hierarchical level;
and under the condition that the learning gain of the first model for the first-level instruction task is in a saturated state, continuing training the first model based on a second training data set in the first text data set, wherein the second training data set comprises the expression text of the second-level first-level instruction task, and the second-level is higher than the first-level in cognitive difficulty.
9. The apparatus of claim 7, wherein the first acquisition module comprises:
a first acquisition unit configured to acquire a second text data set including expression texts of a plurality of second instruction tasks;
the second acquisition unit is used for acquiring the expression text of at least one first instruction task based on the expression text of a second instruction task in the second text data set; the first instruction task is an instruction task on N task dimensions, the N task dimensions comprise task dimensions of the second instruction task, and N is an integer greater than 1;
And the aggregation unit is used for aggregating the expression text of at least one first instruction task to the second text data set to obtain the first text data set.
10. The apparatus according to claim 9, wherein the second acquisition unit is specifically configured to:
acquiring a task prompt template, wherein the task prompt template comprises main body task dimension information, task combination dimension information and an input text, the main body task dimension information indicates the task dimension of the second instruction task, and the task combination dimension information indicates other task dimensions different from the task dimension of the second instruction task;
inputting the task prompt template into a second model for natural language processing, and outputting the expression text of at least one first instruction task;
the N task dimensions comprise at least one task dimension of the second instruction task and the task dimension indicated by the task combination dimension information.
11. The apparatus according to claim 9, wherein the second acquisition unit is specifically configured to:
and acquiring the expression text of at least one first instruction task input by a user, wherein the expression text of the first instruction task is constructed by the user based on the expression text of the second instruction task in the second text data set.
12. The apparatus of claim 7, wherein the second acquisition module is specifically configured to:
performing aggregation classification on first instruction tasks in the first text data set to obtain aggregation task categories of the first instruction tasks;
and determining the hierarchy level of the first instruction task based on the aggregate task category.
13. An electronic device, the electronic device comprising: comprising a processor, a memory, a computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, implements the steps of the model training method according to any of claims 1 to 6.
14. A readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the steps of the model training method according to any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311147535.7A CN116991976A (en) | 2023-09-07 | 2023-09-07 | Model training method, device, electronic equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311147535.7A CN116991976A (en) | 2023-09-07 | 2023-09-07 | Model training method, device, electronic equipment and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116991976A true CN116991976A (en) | 2023-11-03 |
Family
ID=88523293
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311147535.7A Pending CN116991976A (en) | 2023-09-07 | 2023-09-07 | Model training method, device, electronic equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116991976A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117827014A (en) * | 2024-03-05 | 2024-04-05 | 四川物通科技有限公司 | Digital twin model multi-person interaction collaboration system based on meta universe |
-
2023
- 2023-09-07 CN CN202311147535.7A patent/CN116991976A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117827014A (en) * | 2024-03-05 | 2024-04-05 | 四川物通科技有限公司 | Digital twin model multi-person interaction collaboration system based on meta universe |
CN117827014B (en) * | 2024-03-05 | 2024-06-04 | 四川物通科技有限公司 | Digital twin model multi-person interaction collaboration system based on meta universe |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Yang et al. | Dynamic graph attention for referring expression comprehension | |
Wang et al. | Tree-structured regional CNN-LSTM model for dimensional sentiment analysis | |
Obamuyide et al. | Zero-shot relation classification as textual entailment | |
Rad et al. | AI thinking for cloud education platform with personalized learning | |
CN112905795A (en) | Text intention classification method, device and readable medium | |
CN116992007B (en) | Limiting question-answering system based on question intention understanding | |
CN112685550B (en) | Intelligent question-answering method, intelligent question-answering device, intelligent question-answering server and computer readable storage medium | |
CN115309910B (en) | Language-text element and element relation joint extraction method and knowledge graph construction method | |
CN116910185B (en) | Model training method, device, electronic equipment and readable storage medium | |
CN118170894A (en) | Knowledge graph question-answering method, knowledge graph question-answering device and storage medium | |
CN116991976A (en) | Model training method, device, electronic equipment and readable storage medium | |
Vijayaraghavan et al. | Lifelong knowledge-enriched social event representation learning | |
Arora et al. | Comparative question answering system based on natural language processing and machine learning | |
Tubishat et al. | Sentiment analysis of using chatgpt in education | |
Meena et al. | Evaluation of the descriptive type answers using hyperspace analog to language and self-organizing map | |
Aakur et al. | Leveraging symbolic knowledge bases for commonsense natural language inference using pattern theory | |
Teng et al. | Retracted: Recognition of emotion with SVMs | |
Tapsai et al. | Natural language interface to database for data retrieval and processing | |
Agbesi et al. | Multi-topic categorization in a low-resource ewe language: A modern transformer approach | |
Aliyanto et al. | Supervised probabilistic latent semantic analysis (sPLSA) for estimating technology readiness level | |
CN114372478A (en) | Knowledge distillation-based question and answer method, terminal equipment and storage medium | |
Rawat et al. | A Systematic Review of Question Classification Techniques Based on Bloom's Taxonomy | |
CN116991975A (en) | Model training method, device, electronic equipment and readable storage medium | |
CN105808522A (en) | Method and apparatus for semantic association | |
Klenin et al. | Comparison of Vector Space Representations of Documents for the Task of Matching Contents of Educational Course Programmes. |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Country or region after: China Address after: Room 228, 2nd Floor, No. 5 Guanghua Road, Zhangjiawan Town, Tongzhou District, Beijing, 101113 Applicant after: BEIJING ZHONGGUANCUN KEJIN TECHNOLOGY Co.,Ltd. Address before: 130, 1st Floor, Building 5, Courtyard 1, Shangdi Fourth Street, Haidian District, Beijing, 100085 Applicant before: BEIJING ZHONGGUANCUN KEJIN TECHNOLOGY Co.,Ltd. Country or region before: China |