A large model optimization method for reading domain based on fine-tuning and a method for generating accompanying reading manuscripts
By constructing a local corpus and matrix low-rank decomposition optimization large language model in the field of children's language, the problem of inconsistency in style generation in the production of accompanying reading documents is solved, more accurate children's context capture and complex grammar processing are achieved, and the quality and consistency of the documents are improved. sex.
Patent Information
- Application Number
- CN202411250293.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-09-06
AI Technical Summary
The existing large language model is difficult to accurately capture the children's context and handle complex grammatical structures in the generation of companion-read manuscripts, resulting in inconsistent generation styles.
By building a local corpus based on the children's language field, fine-tuning the large language model, and using matrix low-rank decomposition and Bradley-Terry model optimization, we ensure that the model can more accurately adapt to the children's context and process complex grammatical structures when generating companion reading manuscripts.
It realizes the generation of manuscript content that is more suitable for children to read and understand, ensures style consistency and quality, and improves the performance of the model in the processing of specific book content.
Smart Images

Figure CN118760762B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of machine learning, and in particular to a large model optimization method in the reading field based on fine-tuning and a method for generating accompanying reading manuscripts. Background Art
[0002] In the field of artificial intelligence, especially in the subfield of natural language processing, the task of generating accompanying reading manuscripts is a key application. This task aims to generate accompanying reading manuscripts to assist children in reading based on the content of the book and related prompts through automated means. The accompanying reading manuscripts not only need to sort out the content structure of the book, but also need to stimulate children's thinking and summarize knowledge points to improve their reading ability and interest.
[0003] Related technologies usually rely on large language models, which are trained with a large amount of text data and show excellent text generation and comprehension capabilities. However, in the task of generating accompanying texts specific to the children's language field, there is a lack of training corpora specifically for the unique language style and expression of children's stories, resulting in the inability of the generated accompanying texts to accurately capture the needs of children's contexts; at the same time, the complexity and richness of book content leads to misunderstandings in the existing technology when dealing with complex grammatical structures and literary embellishments, and it is impossible to guarantee the generation of text content with consistent style. Summary of the invention
[0004] The embodiments of the present application provide a method for optimizing a large model in the reading field based on fine-tuning and a method for generating accompanying manuscripts. In order to have a basic understanding of some aspects of the disclosed embodiments, a simple summary is given below. This summary is not a general review, nor is it intended to identify key / important components or describe the scope of protection of these embodiments. Its only purpose is to present some concepts in a simple form as a preface to the detailed description that follows.
[0005] In a first aspect, an embodiment of the present application provides a method for optimizing a large model in the reading domain based on fine-tuning, the method comprising:
[0006] Obtaining the text generation requirements and local corpus of the companion text. The text generation requirements are used to represent the requirements for generating the companion text. The local corpus is constructed based on the companion text data in the field of children's language.
[0007] According to the document generation requirement, determine the parameters to be fine-tuned from the large language model, where the parameters to be fine-tuned are some parameters in the large language model that are applicable to the document generation requirement;
[0008] According to the training corpus and the parameters to be fine-tuned in the local corpus, the large language model is fine-tuned and optimized to obtain a pre-trained accompanying text generation model.
[0009] Optionally, fine-tune and optimize the large language model based on the training corpus and parameters to be fine-tuned in the local corpus, including:
[0010] Preprocess the training corpus in the local corpus to obtain the training data set and the test data set;
[0011] Performing matrix low-rank decomposition on the parameters to be fine-tuned to obtain a first parameter matrix and a second parameter matrix after decomposition, wherein the first parameter matrix includes transformation parameters related to columns of an original weight matrix in the large language model, and the second parameter matrix includes transformation parameters related to rows of the original weight matrix in the large language model;
[0012] Fine-tune the large language model according to the training data set, the first parameter matrix, and the second parameter matrix;
[0013] Optimize the fine-tuned large language model based on the test dataset;
[0014] in, , is the original weight matrix, For a size of The matrix of Representation Matrix the number of rows, Representation Matrix The number of columns, is the rank in the low-rank decomposition, which is used to control the accuracy of the approximation and the number of parameters, is the first parameter matrix, is the second parameter matrix.
[0015] Optionally, fine-tuning the large language model according to the training data set, the first parameter matrix, and the second parameter matrix includes:
[0016] Calculate the forward propagation result of the model according to the first training data, the first parameter matrix and the second parameter matrix, where the first training data is each training data in the training data set;
[0017] Calculate the model loss value of the large language model according to the forward propagation result and the preset loss function, where the preset loss function is obtained by freezing the model parameters in the original loss function of the large language model and replacing them with the first parameter matrix and the second parameter matrix;
[0018] When the model loss value reaches the minimum, the fine-tuned large language model is obtained.
[0019] Optionally, the forward propagation result is calculated as:
[0020]
[0021] in, is the forward propagation result, is the first training data, is the result of low-rank decomposition of the matrix;
[0022] The default loss function is:
[0023]
[0024] in, is at the time step The forward propagation result is is the original weight matrix, is the bias term, is the activation function, is the time step The first training data, is the parameter to be fine-tuned, The optimization goal is to maximize the set of parameters The loss value, is the first training data, is the label of the training data, is the training data set, Represents the output sequence Length, is the logarithmic probability, is the original parameter of the large language model, is the low-rank update parameter, is the time step .
[0025] Optionally, optimize the fine-tuned large language model based on the test dataset, including:
[0026] Inputting first test data into a pre-trained companion manuscript generation model, wherein the first test data is any test data in the test data set;
[0027] Outputting a first reading companion document corresponding to the first test data;
[0028] According to the manuscript quality information of the first companion manuscript, the preference score of the fine-tuned large language model is calculated through the Bradley-Terry model. The Bradley-Terry model is a model that integrates a preset target reward difference item through the Simpo optimization technology. The preset target reward difference item is used to ensure that the reward obtained by the model when making a correct prediction is greater than the reward obtained when making an incorrect prediction;
[0029] According to the preference score, the reward value is calculated through the preset reward function;
[0030] According to the reward value, the parameters of the fine-tuned large language model are updated to maximize the expectation of the reward value calculated by the preset reward function.
[0031] Optionally, the default reward function is:
[0032]
[0033] in, For the correct response, For an error response, Indicates priority. The preference score of the fine-tuned large language model calculated based on the manuscript quality information of the first companion manuscript, is the sigmoid function, For a given input The model generates correct responses under the condition The rewards received when For a given input The model generates incorrect responses under the condition The rewards received when This is the difference between the preset target rewards.
[0034] Optionally, based on the document generation requirements, determine the parameters to be fine-tuned from the large language model, including:
[0035] Get the book content of the target book;
[0036] According to the requirements of manuscript generation, the book content is analyzed to obtain the content characteristics of the target book;
[0037] From the large language model, obtain model parameters corresponding to the content features of the target book;
[0038] The obtained model parameters are used as parameters to be fine-tuned.
[0039] Optionally, the manuscript generation requirements include the age range of children, reading purpose, and knowledge points;
[0040] According to the requirements of manuscript generation, the book content is analyzed to obtain the content characteristics of the target book, including:
[0041] Clean the book content and divide it into sentences and segments to obtain a standard text;
[0042] Natural language processing technology is used to extract multi-dimensional features of standard texts, including lexical features, syntactic features, semantic features, and structural features;
[0043] Match and associate lexical features, syntactic features, semantic features, and structural features with children's age range, reading purpose, and knowledge points to determine key features related to multi-dimensional features;
[0044] The key features related to the multi-dimensional features are taken as the content features of the target books.
[0045] Optionally, obtain model parameters corresponding to the content features of the target book from the large language model, including:
[0046] Determine specific aspects of model parameter adaptation of the large language model based on the content characteristics of the target book, including vocabulary usage, sentence structure, and topic consistency;
[0047] A review of large language models was conducted to identify parameters that influence the representation of book content based on vocabulary usage, sentence structure, and thematic consistency;
[0048] For lexical features, syntactic features, semantic features, and structural features, word embedding matrices, self-attention and feedforward network parameters, and layer normalization coefficients are extracted from the parameters that affect the feature expression of book content;
[0049] The word embedding matrix, self-attention and feed-forward network parameters, and layer normalization coefficients are used as model parameters corresponding to the content characteristics of the target book.
[0050] In a second aspect, an embodiment of the present application provides a method for generating a companion reading manuscript, the method comprising:
[0051] Obtaining a user's request for generating a companion reading manuscript, where the request for generating a companion reading manuscript includes books to be processed;
[0052] In response to a request for generating a companion reading manuscript, based on a pre-trained companion reading manuscript generation model, the book content of the book to be processed is processed to obtain a target companion reading manuscript corresponding to the book to be processed;
[0053] Return the target companion text to the user.
[0054] In an embodiment of the present application, on the one hand, the local corpus is constructed based on the reading companion text data in the children's language field, so that the large language model can be optimized specifically for the children's language field based on the local corpus, ensuring that the model can more accurately capture and adapt to the contextual needs of children when generating reading companion manuscripts, thereby generating manuscript content that is more suitable for children to read and understand; on the other hand, the large language model is fine-tuned and optimized according to the training corpus and the parameters to be fine-tuned in the local corpus. The parameters to be fine-tuned enable the model to adapt to the characteristics of specific book content in a targeted manner, including complex grammar and rich literary embellishments, so that the model will not have misunderstandings when processing complex grammatical structures and literary embellishments. At the same time, fine-tuning and optimizing the large language model can extract more available information from the training corpus while fully utilizing the generation capacity of the large model, thereby ensuring the generation of manuscript content with consistent style.
[0055] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0057] Figure 1 It is a flowchart of a method for optimizing a large model in the reading field based on fine-tuning provided in an embodiment of the present application;
[0058] Figure 2 It is a data representation intent of a document generation requirement provided by this application;
[0059] Figure 3 It is a data representation intent of part of the data of a local corpus provided by this application;
[0060] Figure 4 It is a flowchart of a method for generating a companion reading manuscript provided by the present application;
[0061] Figure 5 This is a user interface diagram of a companion manuscript generation service provided by the present application;
[0062] Figure 6 It is a structural schematic diagram of a large model optimization device for the reading field based on fine-tuning provided by the present application;
[0063] Figure 7 It is a structural schematic diagram of a reading companion manuscript generating device provided by the present application;
[0064] Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The following description and the accompanying drawings sufficiently illustrate specific embodiments of the present application to enable those skilled in the art to practice them.
[0066] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0067] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0068] In the description of the present application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0069] The present application provides a method for optimizing a large model in the reading field based on fine-tuning and a method for generating a reading companion manuscript to solve the problems existing in the above-mentioned related technical problems. In the embodiment of the present application, on the one hand, the local corpus is constructed based on the reading companion text data in the children's language field, so that the large language model can be optimized specifically for the children's language field based on the local corpus, ensuring that the model can more accurately capture and adapt to the contextual needs of children when generating reading companion manuscripts, thereby generating manuscript content that is more suitable for children to read and understand; on the other hand, according to the training corpus and the parameters to be fine-tuned in the local corpus, the large language model is fine-tuned and optimized, and the parameters to be fine-tuned enable the model to be targeted to adapt to the characteristics of the content of a specific book, including complex grammar and rich literary decorations, so that the model will not have misunderstandings when processing complex grammatical structures and literary decorations. At the same time, fine-tuning and optimizing the large language model can extract more available information from the training corpus when fully utilizing the generation ability of the large model, thereby ensuring the generation of manuscript content with consistent style. The following is a detailed description using an exemplary embodiment.
[0070] The following will be combined with the attached Figure 1 -Attached Figure 5 , the method for optimizing the large model of the reading domain based on fine-tuning provided in the embodiment of the present application is introduced in detail. The method can be implemented by relying on a computer program and can be run on a large model optimization device for the reading domain based on fine-tuning based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application.
[0071] See also Figure 1 , which is a flow chart of a method for optimizing a large model in the reading field based on fine-tuning, for an embodiment of the present application. Figure 1 As shown, the method of the embodiment of the present application may include the following steps:
[0072] S101, obtaining a text generation requirement and a local corpus of a companion text, wherein the text generation requirement is used to represent the requirements for generating the companion text, and the local corpus is constructed based on companion text data in the field of children's language;
[0073] Among them, companion reading manuscripts refer to texts designed specifically to assist children in reading, usually containing interpretations, explanations or interactive questions about the content of books, aiming to improve children's reading comprehension and interest. Manuscript generation requirements refer to the requirements for generating companion reading manuscripts, including the purpose of the manuscript (such as education, entertainment), the age and cognitive level of the target readers, the style and structure of the manuscript, etc. The local corpus refers to a collection of text data stored locally for fine-tuning large language models. The field of children's language refers to a field specifically targeting children's language use and comprehension characteristics, including children's literature, educational materials, etc., whose language style, vocabulary use and expression methods are different from those of adults. Companion reading text data refers to the text content used for companion reading, which may include word-by-word interpretations of books, questions, annotations or other materials to assist reading.
[0074] In some embodiments, when determining the requirements for the generation of companion reading manuscripts, it is possible to cooperate with educational experts, child psychologists, and teachers to determine the reading needs and cognitive levels of children at different ages, collect feedback from parents and children, understand their expectations and preferences for companion reading manuscripts, and obtain survey results. Based on the survey results, the specific requirements for manuscript generation are clarified, such as language style, knowledge point difficulty, interactivity, etc., and the purpose of the manuscript is determined, such as educational inspiration, entertainment, or language learning. Based on the above content, detailed manuscript generation requirements are created, including target readers, content themes, style guidelines, and format requirements. Manuscript generation requirements, for example Figure 2 As shown, Figure 2 Different requirements are set for different age groups.
[0075] In some embodiments, when generating a local corpus, books and text materials suitable for children of the target age group are collected and screened to ensure that the corpus content is rich and diverse, covering different literary genres and knowledge points. The collected and screened books and text materials are cleaned to remove irrelevant content, such as advertisements, copyright information, etc., to obtain standard content. Text analysis can be performed on the standard content to extract key words, phrases and sentence structures to obtain corpus, and the corpus is annotated, such as difficulty level, subject classification, language style, etc., to finally obtain a local corpus. Some data of the local corpus, such as Figure 3 shown.
[0076] It should be noted that after the local corpus and the document generation requirements are generated, they can be automatically stored, and the stored local corpus and the document generation requirements can also be dynamically updated.
[0077] In some embodiments of the present application, when optimizing the large model in the reading domain based on fine-tuning, the manuscript generation requirements and the local corpus of the accompanying reading manuscript are first obtained from the database.
[0078] S102, determining parameters to be fine-tuned from the large language model according to the document generation requirement, where the parameters to be fine-tuned are some parameters in the large language model that are applicable to the document generation requirement;
[0079] Among them, Large Language Model (LLM) refers to a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. Large language models can handle a variety of natural language tasks, such as text classification, question-answering, and dialogue, and are an important path to artificial intelligence. Partial parameters applicable to document generation requirements mean that in the large language model, only specific parameters related to document generation requirements will be selected for fine-tuning, rather than adjusting all parameters of the model.
[0080] In some embodiments of the present application, the specific process of determining the parameters to be fine-tuned from the large language model according to the document generation requirements includes: obtaining the book content of the target book; performing feature analysis on the book content according to the document generation requirements to obtain the content features of the target book; obtaining model parameters corresponding to the content features of the target book from the large language model; and using the obtained model parameters as the parameters to be fine-tuned.
[0081] Among them, the target book refers to the specific book or text material for which the companion manuscript needs to be generated. The book content refers to the actual text content in the target book, including the storyline, description, character dialogue, etc. The manuscript generation requirements refer to the specific standards or conditions that need to be met when generating the companion manuscript, such as language style, educational purpose, expected readers, etc. Feature analysis refers to an in-depth analysis of the book content to identify and extract key features, such as vocabulary usage, sentence structure, thematic elements, etc. Content features refer to features extracted from the book content that define the unique attributes and style of the book. Model parameters refer to the variables and weights in the large language model, which determine the behavior of the model and how the text is generated.
[0082] In the embodiment of the present application, by accurately acquiring the content of the target book and performing a detailed feature analysis on it, the core features and style of the book can be captured. Combined with clear manuscript generation requirements, the selection of model parameters is ensured to be highly relevant to the content of the book, so that the parameters to be fine-tuned can be targeted to optimize the model to generate a companion reading manuscript that meets specific requirements.
[0083] Among them, the requirements for manuscript generation include the age range of children, reading purposes and knowledge points.
[0084] In some embodiments of the present application, based on the requirements of manuscript generation, feature analysis is performed on the book content to obtain the content features of the target book. The specific process includes: text cleaning and sentence segmentation of the book content to obtain a standard text; natural language processing technology is used to extract multi-dimensional features of the standard text, and the multi-dimensional features include lexical features, syntactic features, semantic features, and structural features; the lexical features, syntactic features, semantic features, and structural features are matched and associated with the age range of children, reading purposes, and knowledge points, respectively, to determine the key features related to the multi-dimensional features; and the key features related to the multi-dimensional features are used as the content features of the target book.
[0085] In some embodiments of the present application, the specific process of obtaining model parameters corresponding to the content characteristics of the target book from the large language model includes: determining specific aspects of the model parameter adaptation of the large language model according to the content characteristics of the target book, the specific aspects including vocabulary usage, sentence structure and topic consistency; based on vocabulary usage, sentence structure and topic consistency, reviewing the large language model to determine the parameters that affect the characteristic expression of the book content; for vocabulary features, syntactic features, semantic features and structural features, respectively extracting word embedding matrices, self-attention and feedforward network parameters and layer normalization coefficients from the parameters that affect the characteristic expression of the book content; using the word embedding matrix, self-attention and feedforward network parameters and layer normalization coefficients as model parameters corresponding to the content characteristics of the target book.
[0086] S103, fine-tuning and optimizing the large language model according to the training corpus and the parameters to be fine-tuned in the local corpus, to obtain a pre-trained accompanying text generation model.
[0087] In some embodiments of the present application, the specific process of fine-tuning and optimizing the large language model according to the training corpus in the local corpus and the parameters to be fine-tuned includes: preprocessing the training corpus in the local corpus to obtain a training data set and a test data set; performing matrix low-rank decomposition on the parameters to be fine-tuned to obtain a first parameter matrix and a second parameter matrix after decomposition, the first parameter matrix containing transformation parameters related to the columns of the original weight matrix in the large language model, and the second parameter matrix containing transformation parameters related to the rows of the original weight matrix in the large language model; fine-tuning the large language model according to the training data set, the first parameter matrix and the second parameter matrix; and optimizing the fine-tuned large language model according to the test data set.
[0088] in, , is the original weight matrix, For a size of The matrix of Representation Matrix the number of rows, Representation Matrix The number of columns, is the rank in the low-rank decomposition, which is used to control the accuracy of the approximation and the number of parameters, is the first parameter matrix, is the second parameter matrix.
[0089] Among them, the training data set is a data set obtained by preprocessing the training corpus and used for model training. The test data set is used to evaluate the performance of the model on unseen data. Matrix low-rank decomposition is a mathematical technique used to decompose a large matrix into the product of two smaller matrices, where the rank is much smaller than the dimension of the original matrix, which is used to reduce the number of model parameters and speed up training. The first parameter matrix is a matrix consisting of transformation parameters associated with the columns of the original weight matrix in the low-rank decomposition. The second parameter matrix is a matrix consisting of transformation parameters associated with the rows of the original weight matrix in the low-rank decomposition.
[0090] In an embodiment of the present application, a training data set and a test data set specifically for model training and evaluation are obtained by preprocessing the training corpus in the local corpus. This separation ensures that the model can be trained on diverse data, while evaluating its generalization ability through an independent test data set. Using matrix low-rank decomposition technology, the parameters to be fine-tuned in the large language model are decomposed into two transformation parameter matrices related to the rows and columns of the original weight matrix, which not only reduces the number of parameters of the model, but also improves the training efficiency. In this way, the consumption of computing resources can be reduced while maintaining the performance of the model, and the fine-tuned large language model can be further optimized based on the feedback of the test data set.
[0091] In some embodiments of the present application, the specific process of fine-tuning the large language model according to the training data set, the first parameter matrix and the second parameter matrix includes: calculating the forward propagation result of the model according to the first training data, the first parameter matrix and the second parameter matrix, the first training data being each training data in the training data set; calculating the model loss value of the large language model according to the forward propagation result and the preset loss function, the preset loss function being obtained by freezing the model parameters in the original loss function of the large language model and replacing them with the first parameter matrix and the second parameter matrix; when the model loss value reaches the minimum, the fine-tuned large language model is obtained.
[0092] Specifically, the calculation formula for the forward propagation result is:
[0093]
[0094] in, is the forward propagation result, is the first training data, is the result of low-rank decomposition of the matrix;
[0095] The default loss function is:
[0096]
[0097] in, is at the time step The forward propagation result is is the original weight matrix, is the bias term, is the activation function, is the time step The first training data, is the parameter to be fine-tuned, The optimization goal is to maximize the set of parameters The loss value, is the first training data, is the label of the training data, is the training data set, Represents the output sequence Length, is the logarithmic probability, is the original parameter of the large language model, is the low-rank update parameter, is the time step .
[0098] In some embodiments of the present application, the specific process of optimizing the fine-tuned large language model according to the test data set includes: inputting the first test data into the pre-trained companion text generation model, the first test data being any test data in the test data set; outputting the first companion text corresponding to the first test data; calculating the preference score of the fine-tuned large language model through the Bradley-Terry model according to the text quality information of the first companion text, the Bradley-Terry model is a model that integrates a preset target reward difference item through the Simpo optimization technology, and the preset target reward difference item is used to ensure that the reward obtained by the model when making a correct prediction is greater than the reward obtained when making an incorrect prediction; calculating the reward value through a preset reward function according to the preference score; and updating the parameters of the fine-tuned large language model according to the reward value to maximize the expectation of the reward value calculated by the preset reward function.
[0099] Among them, the preset reward function is:
[0100]
[0101] in, For the correct response, For an error response, Indicates priority. The preference score of the fine-tuned large language model calculated based on the manuscript quality information of the first companion manuscript, is the sigmoid function, For a given input The model generates correct responses under the condition The rewards received when For a given input The model generates incorrect responses under the condition The rewards received when This is the difference between the preset target rewards.
[0102] Among them, the first test data refers to a data point randomly selected from the test data set for evaluating model performance. The companion manuscript is an auxiliary reading material related to the content of the book, which is designed to enhance the reading experience and understanding. The Bradley-Terry model is a data probability model for modeling comparison and preference, and is widely used in ranking and scoring scenarios. Simpo optimization technology is an optimization algorithm that optimizes the model and improves its performance by integrating a preset target reward difference term. The preset target reward difference term is a fixed value γ, which is used to ensure that the reward obtained by the model when making a correct prediction is significantly higher than the reward obtained when making an incorrect prediction. The preference score is the score of the model output calculated by the Bradley-Terry model, reflecting the advantages and disadvantages of the model prediction. The reward function is a reward value calculated based on the preference score, which is used to guide the update of the model parameters. The reward value is a specific value determined by the reward function, which represents the performance of the model in a certain prediction.
[0103] In an embodiment of the present application, the corresponding reading companion manuscript is obtained by inputting the first test data into a pre-trained reading companion manuscript generation model. The preference scores of the fine-tuned large language model are calculated using the Bradley-Terry model and Simpo optimization technology, and these scores are converted into reward values through a preset reward function. This process introduces a preset target reward difference term γ to ensure that the reward obtained by the model when making a correct prediction is much greater than that for an incorrect prediction, thereby encouraging the model to optimize in the direction of more accurate predictions. Finally, the model parameters are updated according to the reward value, with the aim of maximizing the expectation of the reward value, thereby improving the overall performance of the model and the quality of the generated manuscript.
[0104] It should be noted that Simpo uses an implicit reward form that is directly aligned with the generation indicator, thereby eliminating the need for a reference model, achieving the optimization of the application of a large language model, and using a policy gradient algorithm to maximize the expected reward value by adjusting the parameters of the model. In this way, the large language model of this application can gradually learn how to generate companion manuscripts that are more in line with user preferences and specific needs.
[0105] In an embodiment of the present application, on the one hand, the local corpus is constructed based on the reading companion text data in the children's language field, so that the large language model can be optimized specifically for the children's language field based on the local corpus, ensuring that the model can more accurately capture and adapt to the contextual needs of children when generating reading companion manuscripts, thereby generating manuscript content that is more suitable for children to read and understand; on the other hand, the large language model is fine-tuned and optimized according to the training corpus and the parameters to be fine-tuned in the local corpus. The parameters to be fine-tuned enable the model to adapt to the characteristics of specific book content in a targeted manner, including complex grammar and rich literary embellishments, so that the model will not have misunderstandings when processing complex grammatical structures and literary embellishments. At the same time, fine-tuning and optimizing the large language model can extract more available information from the training corpus while fully utilizing the generation capacity of the large model, thereby ensuring the generation of manuscript content with consistent style.
[0106] See also Figure 4 , which is a flowchart of a method for generating a companion reading manuscript according to an embodiment of the present application. Figure 4 As shown, the method of the embodiment of the present application may include the following steps:
[0107] S201, obtaining a user's request for generating a companion reading manuscript, where the request for generating a companion reading manuscript includes books to be processed;
[0108] The request for generating a companion text refers to a requirement raised by a user, who hopes to generate a companion text related to a specific book. The pending book refers to a specific book for which the user hopes to generate a companion text. This book is an electronic version or a book mark, which will serve as the basic content for generating the text.
[0109] In some embodiments, the user selects a book for which a companion text is desired to be generated from the library of books provided by the platform, or uploads an electronic version of a book that is not in the library. After the user selects the "Generate companion text" service component through the user interface of the platform, the platform can obtain the user's request to generate a companion text. The user interface is, for example, Figure 5 shown.
[0110] S202, in response to a request for generating a companion reading manuscript, based on a pre-trained companion reading manuscript generation model, processing the book content of the book to be processed to obtain a target companion reading manuscript corresponding to the book to be processed;
[0111] Among them, the pre-trained accompanying text generation model is a large language model that has been fine-tuned and optimized.
[0112] In an embodiment of the present application, a pre-trained companion text generation model is generated according to the following steps, including: obtaining a text generation requirement and a local corpus of the companion text, the text generation requirement is used to characterize the requirements for generating the companion text, and the local corpus is constructed based on the companion text data in the field of children's language; according to the text generation requirement, determining parameters to be fine-tuned from a large language model, the parameters to be fine-tuned are some parameters in the large language model that are suitable for the text generation requirement; according to the training corpus in the local corpus and the parameters to be fine-tuned, fine-tuning and optimizing the large language model to obtain a pre-trained companion text generation model.
[0113] In some embodiments of the present application, after receiving the request, the platform automatically distributes the task to the companion reading manuscript generation device. The device pre-processes the uploaded book content, including text cleaning, format adjustment, chapter division, etc. The device selects the most appropriate pre-trained model based on the type of book and user-specified parameters (such as vocabulary difficulty suitable for children, knowledge points included, etc.). The model begins to process the book content, analyze the text structure, extract key information, generate questions and answers, and provide additional educational annotations. The model generates target companion reading manuscripts based on the book content and preset educational goals, including story summaries, character analysis, plot discussion points, interactive questions, etc.
[0114] S203, returning the target reading companion manuscript to the user.
[0115] In the embodiment of the present application, the device can accurately capture and respond to the user's personalized reading companion manuscript generation needs, and provide users with highly customized reading auxiliary materials. Users only need to submit their requests and the corresponding book content, and the device will use advanced pre-trained models to conduct in-depth analysis and processing of the books, and quickly generate reading companion manuscripts that are consistent with the book theme and meet educational purposes. Ultimately, the device returns these rich and interactive manuscripts to the user, greatly improving the user's reading experience and educational effects, while also demonstrating the powerful application potential of technology in the field of auxiliary education.
[0116] In an embodiment of the present application, on the one hand, the local corpus is constructed based on the reading companion text data in the children's language field, so that the large language model can be optimized specifically for the children's language field based on the local corpus, ensuring that the model can more accurately capture and adapt to the contextual needs of children when generating reading companion manuscripts, thereby generating manuscript content that is more suitable for children to read and understand; on the other hand, the large language model is fine-tuned and optimized according to the training corpus and the parameters to be fine-tuned in the local corpus. The parameters to be fine-tuned enable the model to adapt to the characteristics of specific book content in a targeted manner, including complex grammar and rich literary embellishments, so that the model will not have misunderstandings when processing complex grammatical structures and literary embellishments. At the same time, fine-tuning and optimizing the large language model can extract more available information from the training corpus while fully utilizing the generation capacity of the large model, thereby ensuring the generation of manuscript content with consistent style.
[0117] The following are device embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0118] See also Figure 6 , which shows a schematic diagram of the structure of a large model optimization device for the reading domain based on fine-tuning provided by an exemplary embodiment of the present application. The large model optimization device for the reading domain based on fine-tuning can be implemented as all or part of an electronic device through software, hardware or a combination of both. The device 1 includes an acquisition module 10, a determination module 20, and a fine-tuning optimization module 30.
[0119] An acquisition module 10 is used to acquire a text generation requirement of a companion text and a local corpus, wherein the text generation requirement is used to represent the requirements for generating a companion text, and the local corpus is constructed based on the companion text data in the field of children's language;
[0120] A determination module 20, configured to determine parameters to be fine-tuned from the large language model according to the document generation requirement, where the parameters to be fine-tuned are some parameters in the large language model that are applicable to the document generation requirement;
[0121] The fine-tuning and optimization module 30 is used to fine-tune and optimize the large language model according to the training corpus and the parameters to be fine-tuned in the local corpus to obtain a pre-trained companion text generation model.
[0122] Optionally, the fine-tuning optimization module 30 includes:
[0123] A preprocessing unit is used to preprocess the training corpus in the local corpus to obtain a training data set and a test data set;
[0124] A matrix low-rank decomposition unit, used for performing matrix low-rank decomposition on the parameters to be fine-tuned to obtain a first parameter matrix and a second parameter matrix after decomposition, wherein the first parameter matrix includes transformation parameters related to columns of an original weight matrix in a large language model, and the second parameter matrix includes transformation parameters related to rows of the original weight matrix in the large language model;
[0125] A fine-tuning unit, used for fine-tuning the large language model according to the training data set, the first parameter matrix, and the second parameter matrix;
[0126] The optimization unit is used to optimize the fine-tuned large language model according to the test dataset.
[0127] It should be noted that the reading domain large model optimization device based on fine-tuning provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when executing the reading domain large model optimization method based on fine-tuning. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the reading domain large model optimization device based on fine-tuning provided in the above embodiment and the reading domain large model optimization method embodiment based on fine-tuning belong to the same concept. The implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0128] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0129] In an embodiment of the present application, on the one hand, the local corpus is constructed based on the reading companion text data in the children's language field, so that the large language model can be optimized specifically for the children's language field based on the local corpus, ensuring that the model can more accurately capture and adapt to the contextual needs of children when generating reading companion manuscripts, thereby generating manuscript content that is more suitable for children to read and understand; on the other hand, the large language model is fine-tuned and optimized according to the training corpus and the parameters to be fine-tuned in the local corpus. The parameters to be fine-tuned enable the model to adapt to the characteristics of specific book content in a targeted manner, including complex grammar and rich literary embellishments, so that the model will not have misunderstandings when processing complex grammatical structures and literary embellishments. At the same time, fine-tuning and optimizing the large language model can extract more available information from the training corpus while fully utilizing the generation capacity of the large model, thereby ensuring the generation of manuscript content with consistent style.
[0130] See also Figure 7 , which shows a schematic diagram of the structure of a reading companion manuscript generation device provided by an exemplary embodiment of the present application. The fine-tuning-based large model optimization device for the reading field can be implemented as all or part of an electronic device through software, hardware, or a combination of both. The device 2 includes a request acquisition module 40, a processing module 50, and a return module 60.
[0131] A request acquisition module 40 is used to acquire a user's request for generating a companion reading manuscript, wherein the request for generating a companion reading manuscript includes books to be processed;
[0132] The processing module 50 is used to respond to the companion reading manuscript generation request, use the pre-trained companion reading manuscript generation model to process the book content of the book to be processed, and obtain the target companion reading manuscript corresponding to the book to be processed;
[0133] The return module 60 is used to return the target reading companion manuscript to the user.
[0134] It should be noted that the reading domain large model optimization device based on fine-tuning provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when executing the reading domain large model optimization method based on fine-tuning. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the reading domain large model optimization device based on fine-tuning provided in the above embodiment and the reading domain large model optimization method embodiment based on fine-tuning belong to the same concept. The implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0135] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0136] In the embodiment of the present application, the device can accurately capture and respond to the user's personalized reading companion manuscript generation needs, and provide users with highly customized reading auxiliary materials. Users only need to submit their requests and the corresponding book content, and the device will use advanced pre-trained models to conduct in-depth analysis and processing of the books, and quickly generate reading companion manuscripts that are consistent with the book theme and meet educational purposes. Ultimately, the device returns these rich and interactive manuscripts to the user, greatly improving the user's reading experience and educational effects, while also demonstrating the powerful application potential of technology in the field of auxiliary education.
[0137] The present application also provides a computer-readable medium having program instructions stored thereon, which, when executed by a processor, implements the fine-tuning-based large model optimization method for the reading domain provided by the above-mentioned various method embodiments.
[0138] The present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the fine-tuning-based large model optimization method for the reading domain of the above-mentioned various method embodiments.
[0139] See also Figure 8 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8As shown, the electronic device 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .
[0140] The communication bus 1002 is used to realize the connection and communication between these components.
[0141] The user interface 1003 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.
[0142] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0143] Among them, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect various parts of the entire electronic device 1000, and executes various functions and processes data of the electronic device 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1001 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1001, and it can be implemented separately through a chip.
[0144] Among them, the memory 1005 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may also be optionally at least one storage system located away from the aforementioned processor 1001. As Figure 8 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a fine-tuning based large model optimization application for the reading domain.
[0145] exist Figure 8 In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 1001 can be used to call the fine-tuning-based large model optimization application for the reading field stored in the memory 1005, and specifically perform the following operations:
[0146] Obtaining the text generation requirements and local corpus of the companion text. The text generation requirements are used to represent the requirements for generating the companion text. The local corpus is constructed based on the companion text data in the field of children's language.
[0147] According to the document generation requirement, determine the parameters to be fine-tuned from the large language model, where the parameters to be fine-tuned are some parameters in the large language model that are applicable to the document generation requirement;
[0148] According to the training corpus and the parameters to be fine-tuned in the local corpus, the large language model is fine-tuned and optimized to obtain a pre-trained accompanying text generation model.
[0149] In one embodiment, when fine-tuning and optimizing the large language model according to the training corpus and the parameters to be fine-tuned in the local corpus, the processor 1001 specifically performs the following operations:
[0150] Preprocess the training corpus in the local corpus to obtain the training data set and the test data set;
[0151] Performing matrix low-rank decomposition on the parameters to be fine-tuned to obtain a first parameter matrix and a second parameter matrix after decomposition, wherein the first parameter matrix includes transformation parameters related to columns of an original weight matrix in the large language model, and the second parameter matrix includes transformation parameters related to rows of the original weight matrix in the large language model;
[0152] Fine-tune the large language model according to the training data set, the first parameter matrix, and the second parameter matrix;
[0153] Optimize the fine-tuned large language model based on the test dataset;
[0154] in, , is the original weight matrix, For a size of The matrix of Representation Matrix the number of rows, Representation Matrix The number of columns, is the rank in the low-rank decomposition, which is used to control the accuracy of the approximation and the number of parameters, is the first parameter matrix, is the second parameter matrix.
[0155] In one embodiment, when the processor 1001 performs fine-tuning on the large language model according to the training data set, the first parameter matrix and the second parameter matrix, the following operations are specifically performed:
[0156] Calculate the forward propagation result of the model according to the first training data, the first parameter matrix and the second parameter matrix, where the first training data is each training data in the training data set;
[0157] Calculate the model loss value of the large language model according to the forward propagation result and the preset loss function, where the preset loss function is obtained by freezing the model parameters in the original loss function of the large language model and replacing them with the first parameter matrix and the second parameter matrix;
[0158] When the model loss value reaches the minimum, the fine-tuned large language model is obtained.
[0159] In one embodiment, when the processor 1001 optimizes the fine-tuned large language model according to the test data set, the following operations are specifically performed:
[0160] Inputting first test data into a pre-trained companion manuscript generation model, wherein the first test data is any test data in the test data set;
[0161] Outputting a first reading companion document corresponding to the first test data;
[0162] According to the manuscript quality information of the first companion manuscript, the preference score of the fine-tuned large language model is calculated through the Bradley-Terry model. The Bradley-Terry model is a model that integrates a preset target reward difference item through the Simpo optimization technology. The preset target reward difference item is used to ensure that the reward obtained by the model when making a correct prediction is greater than the reward obtained when making an incorrect prediction;
[0163] According to the preference score, the reward value is calculated through the preset reward function;
[0164] According to the reward value, the parameters of the fine-tuned large language model are updated to maximize the expectation of the reward value calculated by the preset reward function.
[0165] In one embodiment, when the processor 1001 determines the parameters to be fine-tuned from the large language model according to the document generation requirement, the processor 1001 specifically performs the following operations:
[0166] Get the book content of the target book;
[0167] According to the requirements of manuscript generation, the book content is analyzed to obtain the content characteristics of the target book;
[0168] From the large language model, obtain model parameters corresponding to the content features of the target book;
[0169] The obtained model parameters are used as parameters to be fine-tuned.
[0170] In one embodiment, when the processor 1001 performs feature analysis on the book content according to the manuscript generation requirement to obtain the content features of the target book, the processor 1001 specifically performs the following operations:
[0171] Clean the book content and divide it into sentences and segments to obtain a standard text;
[0172] Natural language processing technology is used to extract multi-dimensional features of standard texts, including lexical features, syntactic features, semantic features, and structural features;
[0173] Match and associate lexical features, syntactic features, semantic features, and structural features with children's age range, reading purpose, and knowledge points to determine key features related to multi-dimensional features;
[0174] The key features related to the multi-dimensional features are taken as the content features of the target books.
[0175] In one embodiment, when the processor 1001 acquires the model parameters corresponding to the content features of the target book from the large language model, the processor 1001 specifically performs the following operations:
[0176] Determine specific aspects of model parameter adaptation of the large language model based on the content characteristics of the target book, including vocabulary usage, sentence structure, and topic consistency;
[0177] A review of large language models was conducted to identify parameters that influence the representation of book content based on vocabulary usage, sentence structure, and thematic consistency;
[0178] For lexical features, syntactic features, semantic features, and structural features, word embedding matrices, self-attention and feedforward network parameters, and layer normalization coefficients are extracted from the parameters that affect the feature expression of book content;
[0179] The word embedding matrix, self-attention and feed-forward network parameters, and layer normalization coefficients are used as model parameters corresponding to the content characteristics of the target book.
[0180] In an embodiment of the present application, on the one hand, the local corpus is constructed based on the reading companion text data in the children's language field, so that the large language model can be optimized specifically for the children's language field based on the local corpus, ensuring that the model can more accurately capture and adapt to the contextual needs of children when generating reading companion manuscripts, thereby generating manuscript content that is more suitable for children to read and understand; on the other hand, the large language model is fine-tuned and optimized according to the training corpus and the parameters to be fine-tuned in the local corpus. The parameters to be fine-tuned enable the model to adapt to the characteristics of specific book content in a targeted manner, including complex grammar and rich literary embellishments, so that the model will not have misunderstandings when processing complex grammatical structures and literary embellishments. At the same time, fine-tuning and optimizing the large language model can extract more available information from the training corpus while fully utilizing the generation capacity of the large model, thereby ensuring the generation of manuscript content with consistent style.
[0181] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program based on fine-tuning the optimization of the large model of the reading field can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium of the program based on fine-tuning the optimization of the large model of the reading field can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0182] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for optimizing a large model in the reading domain based on fine-tuning, characterized in that: The method comprises: Acquire a text generation requirement and a local corpus of a companion text, wherein the text generation requirement is used to represent the requirement for generating the companion text, and the local corpus is constructed based on companion text data in the field of children's language; According to the document generation requirement, determining parameters to be fine-tuned from the large language model, wherein the parameters to be fine-tuned are some parameters in the large language model that are applicable to the document generation requirement; According to the training corpus in the local corpus and the parameters to be fine-tuned, the large language model is fine-tuned and optimized to obtain a pre-trained companion manuscript generation model; wherein, The step of fine-tuning and optimizing the large language model according to the training corpus in the local corpus and the parameters to be fine-tuned includes: Preprocessing the training corpus in the local corpus to obtain a training data set and a test data set; Performing matrix low-rank decomposition on the parameters to be fine-tuned to obtain a first parameter matrix and a second parameter matrix after decomposition, wherein the first parameter matrix includes transformation parameters related to columns of an original weight matrix in the large language model, and the second parameter matrix includes transformation parameters related to rows of the original weight matrix in the large language model; Fine-tuning the large language model according to the training data set, the first parameter matrix and the second parameter matrix; According to the test data set, the fine-tuned large language model is optimized; wherein, , is the original weight matrix, For a size of The matrix of Representation Matrix the number of rows, Representation Matrix The number of columns, is the rank in the low-rank decomposition, which is used to control the accuracy of the approximation and the number of parameters, is the first parameter matrix, is the second parameter matrix; The fine-tuning of the large language model according to the training data set, the first parameter matrix and the second parameter matrix includes: Calculate the forward propagation result of the model according to the first training data, the first parameter matrix and the second parameter matrix, wherein the first training data is each training data in the training data set; Calculating a model loss value of the large language model according to the forward propagation result and a preset loss function, wherein the preset loss function is obtained by freezing model parameters in an original loss function of the large language model and replacing them with the first parameter matrix and the second parameter matrix; When the model loss value reaches the minimum, a fine-tuned large language model is obtained; wherein, The calculation formula of the forward propagation result is: in, is the forward propagation result, is the first training data, is the result of low-rank decomposition of the matrix; The preset loss function is: in, is at the time step The forward propagation result is is the original weight matrix, is the bias term, is the activation function, is the time step The first training data, is the parameter to be fine-tuned, The optimization goal is to maximize the set of parameters The loss value, is the first training data, is the label of the training data, is the training data set, Represents the output sequence Length, is the logarithmic probability, is the original parameter of the large language model, is the low-rank update parameter, is the time step .
2. The method according to claim 1, characterized in that The step of optimizing the fine-tuned large language model according to the test data set includes: Inputting first test data into a pre-trained companion manuscript generation model, wherein the first test data is any test data in the test data set; Outputting a first reading companion document corresponding to the first test data; According to the manuscript quality information of the first companion manuscript, the preference score of the fine-tuned large language model is calculated by using a Bradley-Terry model, wherein the Bradley-Terry model is a model that integrates a preset target reward difference item through Simpo optimization technology, and the preset target reward difference item is used to ensure that the reward obtained by the model when making a correct prediction is greater than the reward obtained when making an incorrect prediction; Calculating a reward value according to the preference score using a preset reward function; According to the reward value, the parameters of the fine-tuned large language model are updated to maximize the expectation of the reward value calculated by the preset reward function.
3. The method according to claim 2, characterized in that The preset reward function is: in, For the correct response, For an error response, Indicates priority. The preference score of the fine-tuned large language model calculated according to the manuscript quality information of the first companion manuscript, is the sigmoid function, For a given input The model generates correct responses under the condition The rewards received when For a given input The model generates incorrect responses under the condition The rewards received when The preset target reward difference item.
4. The method according to claim 1, characterized in that: Determining the parameters to be fine-tuned from the large language model according to the document generation requirement includes: Get the book content of the target book; According to the manuscript generation requirements, feature analysis is performed on the book content to obtain content features of the target book; Acquire, from the large language model, model parameters corresponding to the content features of the target book; The obtained model parameters are used as parameters to be fine-tuned.
5. The method according to claim 4, characterized in that The manuscript generation requirements include the age range of children, reading purpose and knowledge points; The step of performing feature analysis on the book content according to the manuscript generation requirement to obtain content features of the target book includes: Performing text cleaning and sentence segmentation on the book content to obtain a standard text; Using natural language processing technology to extract multi-dimensional features of the standard text, the multi-dimensional features include lexical features, syntactic features, semantic features and structural features; Matching and associating the lexical features, syntactic features, semantic features and structural features with the children's age range, reading purpose and knowledge points respectively to determine key features related to the multi-dimensional features; The key features related to the multi-dimensional features are used as content features of the target book.
6. The method according to claim 5, characterized in that The step of obtaining model parameters corresponding to the content features of the target book from the large language model includes: Determining specific aspects of model parameter adaptation of the large language model according to content characteristics of the target book, wherein the specific aspects include vocabulary usage, sentence structure, and topic consistency; Reviewing the large language model to determine parameters that influence the representation of features of book content based on the vocabulary usage, sentence structure, and topic consistency; For the lexical features, syntactic features, semantic features, and structural features, respectively extracting word embedding matrices, self-attention and feedforward network parameters, and layer normalization coefficients from the parameters that affect the feature expression of the book content; The word embedding matrix, self-attention and feedforward network parameters, and layer normalization coefficients are used as model parameters corresponding to the content features of the target book.
7. A method for generating a companion reading manuscript, characterized in that: The method comprises: Obtaining a user's request for generating a companion reading manuscript, wherein the request for generating a companion reading manuscript includes a book to be processed; In response to the companion reading manuscript generation request, a pre-trained companion reading manuscript generation model trained based on the method described in any one of claims 1 to 6 is used to process the book content of the book to be processed to obtain a target companion reading manuscript corresponding to the book to be processed; The target reading companion manuscript is returned to the user.
