Model training method, lyric generation method and electronic equipment

By training and adjusting the initial model and optimizing the lyrics generation model using test requirements and result information, the problem of low quality of lyrics generation content in the existing technology is solved, and higher quality lyrics generation is achieved to meet the diverse needs of users.

CN119623569AInactive Publication Date: 2025-03-14CHENGDU HAPPY NOTE TECH CO LTD

Patent Information

Application Number
CN202510157741.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2025-03-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the lyrics generation method has low analytical accuracy of user needs, resulting in poor quality of generated lyrics content and cannot meet user usage needs.

Method used

Through a model training method, the initial model is trained and adjusted using training data to optimize the data generation performance of the target model. The method includes training the model based on the test demand information and test result information, and adjusting the model based on the rhythmic conditions and format conditions as preset adjustment conditions to generate lyrics that are more in line with user needs.

Benefits of technology

The efficiency of the target model in data generation and the effectiveness of the results are improved, and the quality of the generated lyrics content is significantly improved, which can better meet the user's various needs and application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623569A_ABST
    Figure CN119623569A_ABST
Patent Text Reader

Abstract

The invention provides a model training method, a lyric generation method and electronic equipment, and relates to the technical field of data generation. The model training method comprises the following steps: training an initial model of a target language according to training data to obtain a training model; wherein the training data comprises test demand information and corresponding test result information; adjusting the training model based on a preset adjustment condition to obtain a target model; wherein the adjustment condition comprises a rhythm condition and a format condition. The lyric generation method comprises the steps of performing feature extraction processing on input information of a user to obtain target demand information; and inputting the target demand information into the target model for processing to obtain target result information. The method has the technical effects that the initial model is trained, adjusted and optimized to obtain the target model, and the target demand information obtained through feature extraction is substituted into the target model for processing, so that the effectiveness of the target result information is effectively improved, and various data generation demands of a user are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data generation technology, and in particular to a model training method, a lyrics generation method and an electronic device. Background Art

[0002] In recent years, generative large models represented by GPT have been widely used, showing strong capabilities in assisting production, content creation, logical reasoning, etc., and are currently a hot research direction in artificial intelligence, greatly improving production efficiency and automation levels in the face of diverse tasks. The current lyrics generation based on large models can create corresponding songs according to the specific needs of users, better meeting the needs of users.

[0003] However, in the current lyrics generation method, the accuracy of parsing user needs is low, and the quality of the generated lyrics is poor, which cannot meet the user's usage needs. Summary of the invention

[0004] In view of this, the purpose of the embodiments of the present application is to provide a model training method, a lyrics generation method and an electronic device to improve the problem of poor quality of the generated lyrics content existing in the prior art.

[0005] In order to solve the above problems, in a first aspect, an embodiment of the present application provides a model training method, the method comprising: The initial model of the target language is trained according to the training data to obtain a training model; wherein the training data includes: test requirement information and corresponding test result information; The training model is adjusted based on preset adjustment conditions to obtain a target model; wherein the adjustment conditions include rhythm conditions and format conditions.

[0006] In the above implementation process, when training the initial model of the target language, the test requirement information and test result information related to the test requirements can be used so that the obtained training model can learn the generation logic between the training data. In addition, considering the application scenario of the target model, the lyrics have corresponding rhythm requirements and format requirements when they are generated. In order to further optimize the data generation performance of the training model, the rhythm conditions and format conditions can also be used as preset adjustment conditions to adjust and optimize the training model accordingly, so that the data results generated by the target model are more in line with the user's needs. Through model training and adjustment, the efficiency of data generation by the target model and the effectiveness of the generated data results are effectively improved, meeting a variety of different user needs and being suitable for a variety of different application scenarios.

[0007] Optionally, the training data is determined in the following manner: Perform keyword extraction processing based on the acquired historical song information to obtain initial demand information; Performing augmentation processing on the initial requirement information to obtain the test requirement information; Extracting lyrics information of the historical song information as the test result information; The test requirement information and the test result information are associated based on the identity information of the historical song information.

[0008] In the above implementation process, training data related to the test requirements can be prepared in advance by preprocessing. The corresponding initial requirement information is extracted through the historical song information, the lyrics information of the historical song information is extracted as the test result information, and the initial requirement information is augmented to obtain test requirement information with a larger demand pointing range. In addition, considering the correspondence between the test requirement information and the test result information, the corresponding test requirement information and the test result information can be associated according to the identity information of the historical song information to obtain training data with real data samples under the test requirements. The ability to generate training data for test requirements based on real data effectively improves the authenticity and effectiveness of the training data, thereby optimizing the effect of model training and further optimizing the data generation performance of the training model.

[0009] Optionally, adjusting the training model based on a preset adjustment condition to obtain a target model includes: Obtaining training result information generated by the training model based on the test requirement information; According to the test result information corresponding to the test requirement information, analyzing and processing the rhythmic content and / or text format in the training result information to obtain a difference parameter between the test result information and the training result information; If the difference parameter is greater than or equal to a preset threshold, the calculation parameters of the training model are iteratively adjusted based on the difference parameter and the adjustment condition until the current difference parameter is less than the preset threshold, and the current training model is used as the target model.

[0010] In the above implementation process, when making adjustments, the test requirement information can be first substituted into the training model for processing to obtain the training result information generated by the training model. Considering the difference between the training result information and the test result information corresponding to the test requirements and other information, the rhythmic content and / or text format in the training result information can be analyzed and processed according to the test result information to obtain the difference parameter between the actual result information and the ideal result information. When the difference parameter is greater than or equal to the preset threshold, it indicates that the difference between the two result information is large, and it is necessary to adjust the calculation parameters in the training model accordingly based on the difference parameter and the adjustment condition, and generate data again based on the adjusted training model, and optimize the training model by threshold comparison and iterative adjustment until the current difference parameter is less than the preset threshold, which indicates that the difference between the two result information is small, that is, the actual generated result information is more similar to the ideal result information, and the current training model can be used as the target model after the adjustment. The training model can be iteratively adjusted and optimized according to the difference between the ideal situation and the actual situation of data generation, effectively optimizing the data generation performance of the target model.

[0011] Optionally, the method further comprises: Acquire a plurality of result information to be evaluated generated by the target model based on the same input test requirement information; Obtaining score information of the plurality of result information to be evaluated; Reinforcement learning is performed on the target model based on the scoring information.

[0012] In the above implementation process, the target model can also be used to process the same test requirement information multiple times to generate multiple result information to be evaluated, and the multiple result information to be evaluated can be scored accordingly to perform reinforcement learning processing on the target model according to the obtained scoring information. The performance of target model data generation can be further optimized by result scoring and reinforcement learning processing, thereby improving the effectiveness and quality of the generated lyrics content to meet a variety of different needs and be suitable for a variety of different types of application scenarios.

[0013] Optionally, the initial model of the target language is determined by: Determining the target language according to the language type required by the user; The database of the initial model is narrowed based on the target language.

[0014] In the above implementation process, due to the huge nature of the database used by the initial model, it usually contains multiple types of language information such as Chinese characters, English characters, various symbols, etc. The huge database increases the size of the model and also increases the difficulty in calculating losses and optimizing the model. Therefore, the required target language can be determined according to the language type required by the user, so that the database of the initial model can be narrowed according to the target language, which can effectively reduce and streamline the database, effectively reduce the amount of calculation of the model, improve the efficiency of the model calculation, reduce the difficulty of model optimization, and make the generated data meet the language requirements of the user.

[0015] In a second aspect, an embodiment of the present application provides a method for generating lyrics, the method comprising: Perform feature extraction on the user's input information to obtain target demand information; Inputting the target demand information into the target model for processing to obtain target result information; Wherein, the target model is determined based on any of the model training methods described above.

[0016] In the above implementation process, considering the diversity of user input information, in order to generate information that meets user needs according to different user needs, the input information can be subjected to feature extraction processing to obtain corresponding target demand information, so as to process the target demand information as a parameter of the input target model, and the target model generates corresponding target result information according to the target demand information. It is able to analyze and determine the user's actual target demand information, and generate target result information that meets the user's needs and has high quality according to the user's actual needs, meet the user's various lyrics generation needs, and is suitable for a variety of different application scenarios.

[0017] Optionally, the input information includes: at least one of image information, text information, and format requirements; The feature extraction process of the user's input information to obtain target demand information includes: Extracting features from the input information to obtain multiple feature information; Performing feature fusion encoding on the multiple feature information to obtain encoded information; The encoded information is decoded and formatted to obtain the target demand information.

[0018] In the above implementation process, the user can input the corresponding requirements in a variety of different ways, so the input information can include image information, text information, format requirements and other data of various types and formats. In this case, feature extraction can be performed on various different types of input information to obtain corresponding feature information, and feature fusion encoding can be performed based on the feature information, and various types of feature information can be uniformly encoded into feature vectors with the same format, and the feature vectors can be fused to obtain corresponding encoding information, and the encoding information can be decoded and formatted to obtain target requirement information that meets the input parameter requirements of the target model. Feature extraction and unified processing can be performed according to the actual input of the user, which effectively improves the effectiveness and integrity of the target requirement information, thereby optimizing the effect of the target model when generating data based on the target requirement information.

[0019] Optionally, the inputting the target demand information into a target model for processing to obtain target result information includes: Inputting the target demand information into the target model for processing to obtain internal result information; The internal result information is cleaned to obtain the target result information.

[0020] In the above implementation process, in the data generation process, considering the duplication, sensitivity, etc. of the generated results, the initial internal result information generated by the target model based on the target demand information can be cleaned accordingly to obtain the final target result information. Through the cleaning process, the duplication, sensitivity, etc. in the target result information are effectively reduced, and the overall quality of the target result information is further optimized.

[0021] Optionally, the cleaning the internal result information to obtain the target result information includes: Performing deduplication processing on the internal result information to obtain first data; Perform text sensitive word matching and replacement processing on the first data to obtain second data; The second data is subjected to sensitive pronunciation matching and optimization processing to obtain the target result information.

[0022] In the above implementation process, when performing the cleaning process, the internal result information can be first deduplicated to obtain the first data with less repeated content, and then the first data can be matched and replaced with text sensitive words to obtain the second data with less text sensitive content. In addition, considering the sensitivity of pronunciation, the second data can also be matched and optimized with sensitive pronunciation to obtain the target result information with less pronunciation sensitive content. The content result information can be processed sequentially from the three perspectives of repeatability, text sensitivity and pronunciation sensitivity, effectively reducing the repetitive, sensitive and other contents in the target result information, and further optimizing the overall quality of the target result information.

[0023] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores program instructions, and when the processor reads and runs the program instructions, it executes the steps in any implementation of the above-mentioned model training method and / or lyrics generation method.

[0024] In summary, the embodiments of the present application provide a model training method, a lyrics generation method and an electronic device, which can achieve the following technical effects: the initial model is trained, adjusted and optimized through training data to obtain a target model with higher performance, and the target demand information is obtained through feature extraction and substituted into the target model for processing, thereby effectively improving the effectiveness of the target result information and meeting the user's various data generation needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0026] Figure 1 A block diagram of an electronic device provided in an embodiment of the present application; Figure 2 A schematic diagram of the flow chart of the first model training method provided in the embodiment of the present application; Figure 3 A schematic diagram of a flow chart of a second model training method provided in an embodiment of the present application; Figure 4 A detailed flow chart of step S220 provided in an embodiment of the present application; Figure 5 A schematic diagram of a flow chart of a third model training method provided in an embodiment of the present application; Figure 6A schematic diagram of a fourth model training method provided in an embodiment of the present application; Figure 7 A flowchart of a method for generating lyrics provided in an embodiment of the present application; Figure 8 A detailed flowchart of step S310 provided in an embodiment of the present application; Fig. 9 A detailed flow chart of step S320 provided in an embodiment of the present application; Fig.10 A detailed flowchart of step S322 is provided for an embodiment of the present application.

[0027] Icon: 100 - electronic device; 111 - memory; 112 - storage controller; 113 - processor; 114 - peripheral interface; 115 - input and output unit; 116 - display unit. DETAILED DESCRIPTION

[0028] The technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments of the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the embodiments of the present application.

[0029] Existing large-model lyric generation technology is usually generated according to the user's preset scenarios. However, during the generation process, the accuracy of parsing user needs is low, and the control and filtering of generated content are insufficient. It is easy for the generated lyrics to not conform to the rhythm or the content to be inappropriate, resulting in poor quality of the generated lyrics content and failure to meet user usage needs.

[0030] In order to solve the above problems, the embodiments of the present application provide a model training method and a lyrics generation method, which are applied to electronic devices. The electronic devices can be servers, personal computers (PCs), tablet computers, smart phones, personal digital assistants (PDAs), and other electronic devices with logical computing functions. The models for generating lyrics can be trained and optimized, and high-quality lyrics results that meet user needs can be generated based on different user needs.

[0031] Optionally, see Figure 1 , Figure 1The block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 may include a memory 111, a storage controller 112, a processor 113, a peripheral interface 114, an input and output unit 115, and a display unit 116. A person skilled in the art may understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the electronic device 100. For example, the electronic device 100 may further include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0032] The memory 111, storage controller 112, processor 113, peripheral interface 114, input / output unit 115 and display unit 116 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines. The processor 113 is used to execute the executable module stored in the memory.

[0033] The memory 111 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 111 is used to store programs, and the processor 113 executes the program after receiving the execution instruction. The method executed by the electronic device 100 defined by the process disclosed in any embodiment of the present application can be applied to the processor 113, or implemented by the processor 113.

[0034] The processor 113 may be an integrated circuit chip with signal processing capability. The processor 113 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or any conventional processor.

[0035] The peripheral interface 114 couples various input / output devices to the processor 113 and the memory 111. In some embodiments, the peripheral interface 114, the processor 113 and the memory controller 112 can be implemented in a single chip. In other embodiments, they can be implemented by separate chips.

[0036] The input / output unit 115 is used to provide input data to the user. The input / output unit 115 may be, but is not limited to, a mouse and a keyboard.

[0037] The above-mentioned display unit 116 provides an interactive interface (such as a user operation interface) between the electronic device 100 and the user or is used to display image data for the user's reference. In this embodiment, the display unit can be a liquid crystal display or a touch display. If it is a touch display, it can be a capacitive touch screen or a resistive touch screen that supports single-point and multi-point touch operations. Supporting single-point and multi-point touch operations means that the touch display can sense touch operations generated simultaneously from one or more positions on the touch display, and the sensed touch operations are handed over to the processor for calculation and processing. In an embodiment of the present application, the display unit 116 can display various types of generated result information.

[0038] The electronic device in this embodiment can be used to execute each step in each model training method and / or lyrics generation method provided in the embodiment of the present application. The implementation process of the model training method and / or lyrics generation method is described in detail below through several embodiments.

[0039] See also Figure 2 , Figure 2 A flowchart of a first model training method provided in an embodiment of the present application, the method may include steps S210-S220.

[0040] Step S210, training the initial model of the target language according to the training data to obtain a training model.

[0041] Among them, training data with real song samples can be generated based on historical song information, and the training data can include: test requirement information and corresponding test result information. It should be noted that the test requirement information and the test result information are corresponding pseudo-paired data sets, which are input requirement information and input result information with corresponding associations related to the test requirements. When training the initial model of the target language, the training set and validation set of the initial model can be used with the training data so that the obtained training model can learn the generation logic between the training data.

[0042] Step S220, adjusting the training model based on preset adjustment conditions to obtain a target model.

[0043] Among them, taking into account the application scenarios of the target model, the lyrics have corresponding rhythmic requirements and format requirements when they are generated. In order to further optimize the data generation performance of the training model, the rhythmic conditions and format conditions can also be used as preset adjustment conditions to adjust and optimize the training model accordingly, so that the data results generated by the target model are more in line with the user's needs.

[0044] Optionally, the adjustment conditions may include rhythmic conditions and format conditions. The format conditions may include various format requirements such as the number of paragraphs in the verse and chorus, the number of words in each line, etc. The rhythmic conditions may include rhythm, pitch, melody, beat, rhyme requirements for each line, etc.

[0045] exist Figure 2 In the illustrated embodiment, the efficiency of data generation by the target model and the validity of the generated data results are effectively improved through model training and adjustment, meeting a variety of different user needs and being suitable for a variety of different application scenarios.

[0046] Optionally, see Figure 3 , Figure 3 A flowchart of a second model training method provided in an embodiment of the present application, which method may also include steps S231-S234.

[0047] Step S231, perform keyword extraction processing based on the acquired historical song information to obtain initial demand information.

[0048] Among them, training data related to the test requirements can be prepared in advance by preprocessing. During processing, authorized historical song information can be obtained from a database, cloud, etc. The historical song information may include the name of the song, lyrics, related information about the lyricist and composer, and other data.

[0049] Optionally, when performing keyword extraction processing, the lyrics paragraphs (verse, chorus) and lyrics rhythm of the historical song information can be divided and annotated, and the theme can be extracted through a semantic analysis model, such as LLM (Large Language Model), and on this basis, a batch of possible corresponding user inputs can be reversely synthesized according to the extracted keywords Key as the corresponding initial demand information. Considering that the widely distributed user input lacks relatively high-quality corresponding lyrics, this application synthesizes the initial demand information by reversely extracting keywords and content summaries from high-quality lyrics samples to improve the quality of generated content.

[0050] Step S232: augment the initial requirement information to obtain test requirement information.

[0051] The initial requirement information may be augmented to obtain test requirement information with a wider range of requirements.

[0052] Optionally, the data set can be augmented by rewriting, extracting fragments, random combination, etc., and finally a batch of annotated real lyrics samples are obtained for training as the corresponding test requirement information.

[0053] Step S233, extracting lyrics information of historical song information as test result information.

[0054] The lyrics information of the historical song information may be subjected to text extraction, and the extraction may be performed in full or in part to serve as the corresponding test result information.

[0055] Step S234, associating the test requirement information with the test result information based on the identity information of the historical song information.

[0056] Among them, considering the correspondence between the test requirement information and the test result information, the corresponding test requirement information and test result information can be associated according to the identity information of the historical song information to obtain training data with real data samples under the test requirement.

[0057] Optionally, the identity information may be unique identification information such as the name and number of the historical song information. One test requirement information may be associated with multiple test result information, and multiple test requirements may also be associated with the same test result information.

[0058] For example, the output test requirement information PIn can be: PIn=LLM(Key, Ly, P2), Key=LLM(Ly, P1), where P1 and P2 are prompt words to guide LLM to perform corresponding tasks, and Ly is the corresponding test result information. For example, the input historical song information is "My Motherland and Me", which will be synthesized as "Please help me write a song, the song should contain the following themes: [Motherland, Mountains and Rivers, Patriotism, Love], the lyrics should contain the following intentions: [Mother, Sea, Cooking Smoke, Country Road, Great Mountains and Rivers, Simple, Breathing Together, Sharing the Same Destiny], and the lyrics meet the following requirements: Required Content" as the corresponding test requirement information.

[0059] exist Figure 3 In the illustrated embodiment, training data required for testing can be generated based on real data, which effectively improves the authenticity and effectiveness of the training data, thereby optimizing the effect of model training and further optimizing the data generation performance of the training model.

[0060] Optionally, see Figure 4 , Figure 4 A detailed flow chart of step S220 is provided for an embodiment of the present application. Step S220 may include steps S221-S223.

[0061] Step S221, obtaining training result information generated by the training model based on the test requirement information.

[0062] When making adjustments, the test requirement information may be first substituted into the training model for processing to obtain the training result information generated by the training model.

[0063] Step S222: Analyze and process the rhythmic content and / or text format in the training result information according to the test result information corresponding to the test requirement information to obtain the difference parameter between the test result information and the training result information.

[0064] Among them, considering the differences between the training result information and the test result information corresponding to the test requirements and other information, the rhythmic content and / or text format in the training result information can be analyzed and processed according to the test result information to obtain the difference parameters between the actual result information and the ideal result information.

[0065] Optionally, the text and tone similarity of the test result information and the training result information may be compared to obtain corresponding difference parameters, and the difference parameters may be similarity values ​​between the test result information and the training result information, such as percentage data.

[0066] Step S223, if the difference parameter is greater than or equal to the preset threshold, the calculation parameters of the training model are iteratively adjusted based on the difference parameter and the adjustment condition until the current difference parameter is less than the preset threshold, and the current training model is used as the target model.

[0067] Among them, the preset threshold can be determined according to the actual needs and application scenarios of the model. The preset threshold can be set to a similarity value with a higher numerical value. Taking percentage data as an example, it can be set to 90%-95%, etc. When the difference parameter is greater than or equal to the preset threshold, it indicates that the two result information are quite different, and it is necessary to adjust the calculation parameters in the training model accordingly based on the difference parameter and the adjustment conditions, and generate data again based on the adjusted training model. The training model is optimized by threshold comparison and iterative adjustment until the current difference parameter is less than the preset threshold. This indicates that the two result information are less different, that is, the actually generated result information is highly similar to the ideal result information, and the current training model can be used as the target model after the adjustment is completed.

[0068] Optionally, when making adjustments, each algorithm in the training model and the parameters of the algorithms may be adjusted.

[0069] Optionally, the training model can be fine-tuned with Lora to enhance the specialized ability of the base model in the task of generating lyrics. When making adjustments, the output content, i.e., the training result information, can be subjected to a rhythmic penalty coefficient LR and a generated text format LG penalty coefficient to optimize the model's ability to generate rhyming lyrics in accordance with the specified format requirements. Among them, the rhythmic penalty coefficient LR can be set to the number of corresponding rhymes, and the generated text format LG penalty coefficient can be set to the number of paragraphs and the number of words required to calculate the format, rhythm and target format of the generated content and obtain two coefficients to apply to the loss. The original loss value is L, and the final loss after applying the penalty control, i.e., the difference parameter is: L_final=(1+LR+LG)×L, L=CrossEntroy(LLM(PIn), Ly), where CrossEntroy is the cross entropy, PIn is the output test requirement information, and Ly is the corresponding test result information. The loss value can be calculated by cross entropy according to the difference between the test requirement information and the test result information. Optionally, the value range of the format penalty and rhythm penalty coefficients can be controlled by an algorithm to be within a smaller value (such as between 0 and 0.1), which will not interfere with the overall optimization process, but will be more inclined to generate lyrics content that better meets the constraints.

[0070] exist Figure 4 In the illustrated embodiment, the training model can be iteratively adjusted and optimized according to the difference between the ideal situation and the actual situation of data generation, thereby effectively optimizing the data generation performance of the target model.

[0071] Optionally, see Figure 5 , Figure 5 A flowchart of a third model training method provided in an embodiment of the present application, which method may also include steps S241-S243.

[0072] Step S241, obtaining multiple pieces of result information to be evaluated generated by the target model based on the same input test requirement information.

[0073] Among them, since the data generation process of the target model may be different each time, the target model can be used to process the same test requirement information multiple times to generate multiple result information to be evaluated.

[0074] Step S242, obtaining score information of multiple pieces of result information to be evaluated.

[0075] Step S243, performing reinforcement learning processing on the target model based on the scoring information.

[0076] Among them, the multiple result information to be evaluated can be scored accordingly, so as to perform reinforcement learning processing on the target model according to the obtained scoring information.

[0077] Optionally, language models and manual scoring can be used to comprehensively evaluate the quality of the generated content, the fit between the generated content and the user input scenario, and the health of the generated content, and the score of the generated content can be marked. When performing reinforcement learning, RLHF (Reinforcement Learning from Human Feedback, combining reinforcement learning and human feedback technology) can be used to reward and punish the target model to optimize the generation results of the target model to obtain a higher score.

[0078] Optionally, a plurality of corresponding target result information may be generated according to the user's actual target demand information and corresponding scoring and reinforcement learning processing may be performed.

[0079] It should be noted that this application improves the target model's ability to generate lyrics with format and rhythm requirements on demand, making the generated lyrics more suitable for the scenarios provided by users. Human preferences are aligned through reinforcement learning to generate healthier and more rhyming lyrics. By extracting features from user input and allowing users to perform more stringent format control, the target model can be further guided to generate lyrics.

[0080] exist Figure 5In the illustrated embodiment, the performance of target model data generation can be further optimized through result scoring and reinforcement learning processing, thereby improving the effectiveness and quality of the generated lyrics content to meet a variety of different needs and be suitable for a variety of different types of application scenarios.

[0081] Optionally, see Figure 6 , Figure 6 A flowchart of the fourth model training method provided in an embodiment of the present application, which method may also include steps S251-S252.

[0082] Step S251, determining the target language according to the language type required by the user.

[0083] Among them, due to the huge nature of the database used by the initial model, it usually contains multiple types of language information such as Chinese characters, English characters, various symbols, etc. The huge database increases the size of the model and also increases the difficulty in calculating losses and optimizing the model. Therefore, the required target language can be determined according to the language type required by the user, such as Chinese, English, etc.

[0084] Step S252: narrowing the database of the initial model based on the target language.

[0085] The database of the initial model is narrowed according to the target language, and the relevant characters of other language types are deleted, and only the relevant characters of the target language are retained, so as to obtain a streamlined database as the data basis for subsequent data generation.

[0086] Optionally, the initial model can be an open source lyrics generation model, which can reduce the vocabulary based on the initial database and modify the input embed word vector embedding module and the fully connected layer module at the output, so as to only retain the required characters of the target language, thereby improving the optimization efficiency of the initial model and avoiding the generation of out-of-range characters when generating lyrics (such as the user requires Chinese lyrics, but Japanese, Russian, English, etc. are generated).

[0087] exist Figure 6 In the illustrated embodiment, the database can be effectively reduced and streamlined, the amount of model calculations can be effectively reduced, the efficiency of model calculations can be improved, the difficulty of model optimization can be reduced, and the generated data can be made to meet the language requirements of users.

[0088] See also Figure 7 , Figure 7 A flowchart of a lyrics generation method provided in an embodiment of the present application, the method may include steps S310-S320.

[0089] Step S310, performing feature extraction processing on the user's input information to obtain target demand information.

[0090] Among them, considering the diversity of user input information, in order to be able to generate information that meets user needs according to different user needs, feature extraction processing can be performed on the input information to obtain corresponding target demand information.

[0091] It should be noted that the target demand information has the same data format as the test demand data used in model training.

[0092] Step S320, input the target demand information into the target model for processing to obtain target result information.

[0093] Among them, the target model is determined based on any of the above-mentioned model training methods, the target demand information is processed as a parameter of the input target model, and the target model generates corresponding target result information according to the target demand information.

[0094] Optionally, the target result information may be corresponding lyrics data, which may include a partial paragraph of lyrics or complete lyrics.

[0095] exist Figure 7 In the illustrated embodiment, it is possible to analyze and determine the user's actual target demand information, and generate target result information that meets the user's needs and is of higher quality based on the user's actual needs, meet the user's various lyrics generation needs, and be suitable for a variety of different application scenarios.

[0096] Optionally, the user may input corresponding requirements in a variety of different ways, and therefore the input information may include data of a variety of different types and formats, such as image information, text information, and format requirements.

[0097] Optionally, see Figure 8 , Figure 8 A detailed flowchart of step S310 is provided for an embodiment of the present application. Step S310 may include steps S311-S313.

[0098] Step S311, extracting features from the input information to obtain a variety of feature information.

[0099] Among them, feature extraction can be performed on various types of input information to obtain corresponding feature information. It should be noted that due to the diversity of the types of input information, the extracted feature information is also diverse, such as target features in images, keyword features in text information, and numerical features in format requirements.

[0100] Step S312, performing feature fusion encoding on multiple feature information to obtain encoded information.

[0101] Among them, feature fusion encoding can be performed based on the feature information, and multiple types of feature information can be uniformly encoded into feature vectors with the same format, and the feature vectors are fused to obtain corresponding encoding information.

[0102] Step S313, decoding and formatting the encoded information to obtain target demand information.

[0103] The encoded information may be decoded and formatted to obtain target requirement information that meets the input parameter requirements of the target model.

[0104] For example, since the types of user input information are widely distributed, and the input distribution of different users is quite different (such as image, text, format requirements, etc.), a user topic extraction module can be constructed to normalize user input and extract high-dimensional features, so as to construct a unified style of input prompt. Specifically, for different types of input information (image, text, format requirements) input by users, the input text is taken as the main body, and the user can decide whether to further input the image and format requirements. The encoder is used to uniformly encode them into one-dimensional feature vectors with the same format and merge them together, and then the encoding result is decoded by the pre-trained decoder, so as to map the user input in different formats to a unified input space to integrate the user input. The output Output is: Output = Decoder (Encoder (In)), In = (Text, Image, Format), where In is user input, Text is text, Image is image, and Format is format requirements. Encoding, decoding and other processing can be performed according to the text and / or image and / or format requirements input by the user to uniformly integrate multiple different types of input information. After extracting and integrating the user input, combined with the original user input, the prompt generation module is used to generate the target requirement information that is ultimately used to guide the target model to generate lyrics. The output is: Prompt=PC(Decoder(Encoder(In)), In), In=(Text, Image, Format).

[0105] For example, for the input: "Farmers are suffering, who can understand the bitterness of farmers? Farmers suffer, they go to the fields to do farm work every day, farmers are tired, and go home to do housework at night", [a picture of a farmer plowing the land], [generate two sections of the verse and chorus, each with N sentences], the extracted coding information may include: ["bitterness", "tiredness", "selfless dedication", "tenacity", "family responsibility"], extract the theme of the picture: [old farmers working in the fields, tractors rumbling], and the final target demand information generated by synthesis may include: "Please help me create lyrics, which need to meet the following constraints: ["bitterness", "tiredness", "selfless dedication", "tenacity", "family responsibility"], the generated lyrics need to meet the following format: [generate two sections of the verse and chorus, each with N sentences], the generated lyrics need to meet the corresponding rhythm, the generated lyrics should be positive, and there should be no [more generation requirements]".

[0106] exist Figure 8 In the illustrated embodiment, feature extraction and unified processing can be performed according to the actual input of the user, which effectively improves the validity and completeness of the target demand information, thereby optimizing the effect of the target model when generating data based on the target demand information.

[0107] Optionally, see Fig. 9 , Fig. 9 A detailed flow chart of step S320 is provided for an embodiment of the present application. Step S320 may include steps S321-S322.

[0108] Step S321, input the target demand information into the target model for processing to obtain internal result information.

[0109] Among them, the target demand information can be input into the target model as an input parameter for processing to obtain initial internal result information.

[0110] Step S322, cleaning the internal result information to obtain target result information.

[0111] Among them, in the process of data generation, considering the duplication, sensitivity, etc. of the generated results, the initial internal result information can be cleaned accordingly to obtain the final target result information.

[0112] For example, a content correction module can be added to filter and correct the pronunciation, pronunciation of connected words, phrase composition, etc. of the generated lyrics, check the paragraph structure of the generated lyrics, and suppress the repetitiveness of the content of the generated lyrics to keep the content healthy and positive (such as cleaning up the use of homophones to make innuendos, attacks, slander, etc.), and further clean up repeated paragraphs that do not conform to the rules to optimize the overall quality of the generated lyrics.

[0113] exist Fig. 9 In the illustrated embodiment, the cleaning process effectively reduces the repetitive, sensitive, and other contents in the target result information, further optimizing the overall quality of the target result information.

[0114] Optionally, see Fig.10 , Fig.10 A detailed flow chart of step S322 is provided for an embodiment of the present application, where step S322 may include steps S3221-S3223.

[0115] Step S3221, deduplicate the internal result information to obtain the first data.

[0116] Among them, when performing the cleaning process, the internal result information can be deduplicated first, for example, removing unnecessary continuous repeated sentences, removing unnecessary paragraphs that are repeated multiple times (such as 3 times) or less, and obtaining the first data with less repeated content.

[0117] Step S3222: Perform text sensitive word matching and replacement processing on the first data to obtain second data.

[0118] The first data may continue to be matched with and replaced by text sensitive words. For example, the first data may be screened, searched according to a sensitive word list, and the searched sensitive words may be replaced to obtain second data with less text sensitive content.

[0119] Step S3223, performing sensitive pronunciation matching and optimization processing on the second data to obtain target result information.

[0120] Among them, considering the sensitivity of pronunciation, the second data can also be matched and optimized for sensitive pronunciation. For example, the second data is matched according to the pronunciation, and the matched sensitive pronunciation is eliminated or blurred to obtain target result information with less pronunciation-sensitive content.

[0121] exist Fig.10 In the illustrated embodiment, the content result information can be processed sequentially from three perspectives: repeatability, text sensitivity, and pronunciation sensitivity, thereby effectively reducing the repetitive, sensitive, and other content in the target result information, suppressing occasional negative generation (such as repeated generation of lyrics, generation of incorrect word pronunciations), and further optimizing the overall quality of the target result information.

[0122] In several embodiments provided in the present application, it should be understood that the disclosed device can also be implemented in other ways. The device embodiments described above are merely schematic, for example, the block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices according to the multiple embodiments of the present application. In this regard, each box in the block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram, and the combination of the block diagrams, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0123] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0124] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0125] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0126] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

[0127] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

Claims

1. A model training method, characterized in that: The method comprises: The initial model of the target language is trained according to the training data to obtain a training model; wherein the training data includes: test requirement information and corresponding test result information; The training model is adjusted based on preset adjustment conditions to obtain a target model; wherein the adjustment conditions include rhythm conditions and format conditions.

2. The model training method according to claim 1, characterized in that: in, The training data is determined in the following manner: Perform keyword extraction processing based on the acquired historical song information to obtain initial demand information; Performing augmentation processing on the initial requirement information to obtain the test requirement information; Extracting lyrics information of the historical song information as the test result information; The test requirement information and the test result information are associated based on the identity information of the historical song information.

3. The model training method according to claim 1, characterized in that: The step of adjusting the training model based on a preset adjustment condition to obtain a target model includes: Obtaining training result information generated by the training model based on the test requirement information; According to the test result information corresponding to the test requirement information, analyzing and processing the rhythmic content and / or text format in the training result information to obtain a difference parameter between the test result information and the training result information; If the difference parameter is greater than or equal to a preset threshold, the calculation parameters of the training model are iteratively adjusted based on the difference parameter and the adjustment condition until the current difference parameter is less than the preset threshold, and the current training model is used as the target model.

4. The model training method according to any one of claims 1 to 3, characterized in that: The method further comprises: Acquire a plurality of result information to be evaluated generated by the target model based on the same input test requirement information; Obtaining score information of the plurality of result information to be evaluated; Reinforcement learning is performed on the target model based on the scoring information.

5. The model training method according to any one of claims 1 to 3, characterized in that: in, The initial model of the target language is determined by: Determining the target language according to the language type required by the user; The database of the initial model is narrowed based on the target language.

6. A method for generating lyrics, characterized in that: The method comprises: Perform feature extraction on the user's input information to obtain target demand information; Inputting the target demand information into the target model for processing to obtain target result information; Wherein, the target model is determined based on the model training method described in any one of claims 1-5.

7. The method for generating lyrics according to claim 6, characterized in that: in, The input information includes: at least one of image information, text information, and format requirements; The feature extraction process of the user's input information to obtain target demand information includes: Extracting features from the input information to obtain multiple feature information; Performing feature fusion encoding on the multiple feature information to obtain encoded information; The encoded information is decoded and formatted to obtain the target demand information.

8. The method for generating lyrics according to claim 6, characterized in that: The target requirement information is input into the target model for processing to obtain target result information, including: Inputting the target demand information into the target model for processing to obtain internal result information; The internal result information is cleaned to obtain the target result information.

9. The method for generating lyrics according to claim 8, characterized in that: The cleaning process of the internal result information to obtain the target result information includes: Performing deduplication processing on the internal result information to obtain first data; Perform text sensitive word matching and replacement processing on the first data to obtain second data; The second data is subjected to sensitive pronunciation matching and optimization processing to obtain the target result information.

10. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory stores program instructions, and when the processor runs the program instructions, the steps in the method according to any one of claims 1 to 9 are executed.

Citation Information

Patent Citations

  • Text generation model training method and device and text generation method and device

    CN111783455A

  • Method for generating end-to-end music audio based on lyrics and melody

    CN117198252A

  • Lyric generation method and device, intelligent terminal and storage medium

    CN119377438A

Cited By

  • Robot model training method, device, equipment and medium

    CN121303202A