Lyric generation method and device, intelligent terminal and storage medium

By extracting the structural information and rhythm information of the lyrics, and using a large language model to generate new lyrics that meet the needs of target, solve the problem of high costs and inspiration of traditional lyrics, and achieve efficient and diverse lyrics creation.

CN119377438APending Publication Date: 2025-01-28GUANGDONG LAB OF ARTIFICIAL INTELLIGENCE & DIGITAL ECONOMY (SZ)
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411304144.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

Traditional lyrics creation requires a lot of manpower and time investment, which is expensive, and creators may encounter problems of exhaustion of inspiration during a long period of creation.

Method used

By obtaining the original lyrics of the target requirements and the target song, the structural information and rhythm information of the lyrics are extracted, the prompt is generated, and it is entered into the trained large language model. New lyrics.

Benefits of technology

Achieve high -quality lyrics, reduce the cost of manpower creation of lyrics, improve the efficiency of lyrics creation, provide creators with a variety of sources of inspiration. sex.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377438A_ABST
    Figure CN119377438A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information processing, in particular to a lyric generation method and device, an intelligent terminal and a storage medium. The method comprises the steps of obtaining a target demand and original lyrics of a target song, wherein the target demand comprises a target theme and a target style; extracting target lyric features of the original lyrics, wherein the target lyric features comprise structure information and rhythm information of the original lyrics; generating prompt words according to the target theme, the target style and the target lyric features; and inputting the prompt word into a target lyric generation model, and guiding the target lyric generation model to generate a new lyric meeting the target demand by reasoning according to the target theme, the target style and the target lyric feature. By adopting the method, the high-quality lyrics meeting the requirements can be generated, the labor and time cost of lyric creation is reduced, the efficiency of lyric creation is improved, and diversified inspiration sources are provided for creators.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information processing technology, and in particular to a lyrics generation method, device, intelligent terminal and storage medium. Background Art

[0002] In the field of music creation, traditional lyrics creation requires a lot of manpower and time investment, which is costly. Creators may run out of inspiration during the long creation process, and the creation time is long.

[0003] With the rapid development of AI (Artificial Intelligence) technology, AI has been widely used in various fields. For example, using AI technology to generate lyrics. It is not difficult to generate lyrics using the text generation function in AI technology, but how to generate high-quality lyrics that meet the needs is the difficulty.

[0004] In view of this, how to create high-quality lyrics that meet the needs, reduce the manpower and time costs of lyric creation, improve the efficiency of lyric creation, and provide creators with diverse sources of inspiration are the problems that need to be solved at present. Summary of the invention

[0005] In view of this, the embodiments of the present application provide a lyric generation method, device, intelligent terminal and storage medium, which can generate high-quality lyrics that meet the needs, reduce the manpower and time costs of lyric creation, improve the efficiency of lyric creation, and provide creators with diverse sources of inspiration.

[0006] A first aspect of an embodiment of the present application provides a method for generating lyrics, the method comprising:

[0007] Obtaining target requirements and original lyrics of a target song, wherein the target requirements include a target theme and a target style;

[0008] Extracting target lyrics features of the original lyrics, wherein the target lyrics features include structural information and rhythmic information of the original lyrics;

[0009] Generate prompts according to the target theme, the target style and the target lyrics features;

[0010] The prompt is input into a target lyrics generation model, guiding the target lyrics generation model to infer and generate new lyrics that meet the target requirements based on the target theme, the target style and the target lyrics features, wherein the target lyrics generation model is a large language model that has been trained to generate lyrics that meet the requirements.

[0011] In a possible implementation of the first aspect, guiding the target lyrics generation model to infer and generate new lyrics that meet the target requirements according to the target theme, the target style, and the target lyrics features includes:

[0012] Guiding the target lyrics generation model to generate first initial lyrics related to the target theme and the target style;

[0013] guiding the target lyrics generation model to adjust the rhythm of the first initial lyrics based on the rhythm information to obtain second initial lyrics;

[0014] The target lyrics generation model is guided to input a specified structural control symbol into the second initial lyrics based on the structural information to generate new lyrics that meet the target requirements.

[0015] In a possible implementation of the first aspect, the lyrics generation method includes:

[0016] Acquire a lyrics data set, wherein the lyrics data set includes sample lyrics;

[0017] Acquire sample lyrics features of the sample lyrics, and generate sample prompts according to the sample lyrics features, wherein the sample lyrics features include the theme, style, structure and rhythm of the sample lyrics;

[0018] The sample prompt is used as the input of the large language model, and the sample lyrics are used as the target output of the large language model. The large language model is trained until the training error meets the preset requirements, thereby obtaining a target lyrics generation model.

[0019] In a possible implementation manner of the first aspect, after obtaining the target lyrics generation model, the method further includes:

[0020] Verifying the quality of lyrics generated by the target lyrics generation model using a specified test data set and the structure and rhythm of the sample lyrics, wherein the specified test data set includes a specified theme and a specified style;

[0021] The model parameters of the target lyrics generation model are adjusted according to the verification results.

[0022] In a possible implementation manner of the first aspect, the target requirement further includes a target language, and the lyrics generation method further includes:

[0023] Generate a prompt according to the target language, the target theme, the target style, and the target lyrics feature;

[0024] The prompt is input into a target lyrics generation model, and the target lyrics generation model is guided to infer and generate new lyrics that meet the target requirements according to the target language, the target theme, the target style and the target lyrics features.

[0025] In a possible implementation manner of the first aspect, after the inference generates new lyrics that meet the target requirement, the method further includes:

[0026] Obtain quality assessment indicators;

[0027] Based on the quality assessment index, performing quality assessment on the new lyrics generated by the target lyrics generation model inference;

[0028] According to the result of the quality assessment, the target lyrics generation model is optimized.

[0029] A second aspect of an embodiment of the present application provides a lyrics generation device, the lyrics generation device comprising:

[0030] A lyrics demand acquisition unit, used to acquire target demand and original lyrics of a target song, wherein the target demand includes a target theme and a target style;

[0031] A target feature extraction unit, used to extract target lyrics features of the original lyrics, wherein the target lyrics features include structural information and rhythm information of the original lyrics;

[0032] A first prompt generating unit, configured to generate prompts according to the target theme, the target style and the target lyrics feature;

[0033] The first inference generation unit is used to input the prompt into the target lyrics generation model, and guide the target lyrics generation model to infer and generate new lyrics that meet the target requirements according to the target theme, the target style and the target lyrics characteristics, wherein the target lyrics generation model is a large language model that has been trained to generate lyrics that meet the requirements.

[0034] The third aspect of an embodiment of the present application provides an intelligent terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the lyrics generation method provided in the first aspect of the embodiment of the present application are implemented.

[0035] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the lyrics generation method provided in the first aspect of the embodiment of the present application are implemented.

[0036] The fifth aspect of the embodiments of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the steps of the lyrics generation method described in the first aspect of the embodiments of the present application.

[0037] In an embodiment of the present application, the target demand and the original lyrics of the target song are first obtained, the target demand includes a target theme and a target style, and then the target lyrics features such as structural information and rhythmic information in the original lyrics are extracted, and then prompts are generated according to the target theme, the target style and the target lyrics features, and the prompts are input into the target lyrics generation model, and the target lyrics generation model is guided to generate new lyrics that meet the target demand according to the target theme, the target style and the target lyrics features. The present application utilizes a well-trained large language model to intelligently generate lyrics similar to the original lyrics in structure, rhythm and syllables according to demand, which not only effectively guarantees the quality of the lyrics, but also greatly reduces the manpower and time costs, improves the efficiency of lyrics creation, helps creators innovate while maintaining the characteristics of the original song, and provides creators with a variety of sources of inspiration. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0039] Figure 1 is a flowchart of the implementation of the lyrics generation method provided in the embodiment of the present application;

[0040] Figure 2 It is a specific implementation flow chart of the method for generating lyrics by model reasoning in the lyrics generation method provided in the embodiment of the present application to generate new lyrics that meet the target requirements;

[0041] Figure 3 is a flowchart of an implementation method of lyrics generation provided by another embodiment of the present application;

[0042] Figure 4 This is a flow chart for implementing model optimization in the lyrics generation method provided in an embodiment of the present application;

[0043] Figure 5 This is a specific implementation flow chart of obtaining a target lyrics generation model in the lyrics generation method provided in the embodiment of the present application;

[0044] Figure 5.1 It is a schematic diagram of a model input sample in the lyrics generation method provided in an embodiment of the present application;

[0045] Figure 6 is a structural block diagram of a lyrics generation device provided in an embodiment of the present application;

[0046] Figure 7 It is a schematic diagram of a smart terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] In the following description, specific details such as specific device structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0048] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0049] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0050] It should be understood that each method embodiment of the present application provides a lyrics generation method applicable to various types of smart terminals or servers that need to perform lyrics generation, which may specifically include smart terminals such as mobile phones, tablet computers, wearable devices, laptops, and desktop computers. The present application embodiment does not impose any restrictions on the specific types of smart terminals and servers.

[0051] The lyrics generation method provided in this application is exemplarily described below in conjunction with specific embodiments.

[0052] Figure 1 The implementation process of the lyrics generation method provided in the embodiment of the present application is shown, and the method flow may include the following steps S101 to S104.

[0053] Step S101: Obtain target requirements and original lyrics of a target song, wherein the target requirements include a target theme and a target style.

[0054] A song is composed of lyrics and tunes. Lyrics, as an important part of a song, complement the tune and convey the emotions and artistic conception of the song. In this embodiment, the target demand and the original lyrics of the target song are obtained. The original lyrics refer to the lyrics in the target song, and the target demand refers to the demand for generating lyrics that match the tune in the target song, including the target theme and the target style. Customized lyrics are achieved by obtaining the creator's target demand.

[0055] In this embodiment, the target topics include but are not limited to love, friendship, nature, and social issues, and the target styles include but are not limited to pop, rock, rap, classical, and folk.

[0056] Step S102: extracting target lyrics features of the original lyrics, wherein the target lyrics features include structural information and rhythmic information of the original lyrics.

[0057] The structural information includes the number of sentences, and the rhythm information includes the number of syllables. A syllable is one of the basic units of lyrics. A syllable consists of two parts: a segment and a nucleus.

[0058] In this embodiment, in order to make the generated lyrics match the melody of the target song, it is necessary to extract the target lyrics features such as the structural information and rhythmic information in the original lyrics.

[0059] The structural information is used to make the lyrics have macro structures such as verse, chorus, bridge, and ending. The structural information of the original lyrics mainly involves its sentence structure, paragraph structure, and overall form.

[0060] Sentence pattern refers to the way sentences in lyrics are constructed, including the number of words in a sentence, the tone, the mood, and the contrast and balance of language rhythm between sentences. Common sentence patterns include three-character sentences, four-character sentences, five-character sentences, six-character sentences, seven-character sentences, etc. These sentence patterns are combined in different ways in lyrics to form a variety of expression effects. For example, three-character sentences are usually short and powerful, suitable for expressing emotional climaxes or finishing touches; four-character sentences are more stable and suitable for narrating or describing scenes.

[0061] Paragraph style refers to the way the lyrics are structured. Common paragraph styles include single paragraph, two paragraph, three paragraph and multi-paragraph. Each paragraph style has its own unique expression effect and emotional transmission method. For example, the single paragraph is usually compact and emotionally concentrated; the two-paragraph style makes the emotions richer and fuller through contrast and progression; the three-paragraph style, based on the first two paragraphs, introduces new content or materials to achieve emotional sublimation or deepen the theme.

[0062] In this embodiment, structural information in the original lyrics can be extracted through word segmentation, sentence division, paragraph division based on key information, etc.

[0063] The rhythm of lyrics mainly includes four tones, rhyme and rhythm. In Chinese, each word has four tones, namely, yinping, yangping, shangsheng and qusheng. The change of four tones can make the lyrics more vivid and rhythmic. Rhyme is an important part of the rhythm of lyrics. By using words with the same or similar finals at the end of the same sentence or in the same position of different sentences, a rhyme effect can be formed, making the lyrics more harmonious and fluent. Rhythm refers to the rhythm and beat of the language in the lyrics. By controlling the length, pauses and stress of sentences, the lyrics can show a distinct sense of rhythm and beat. The sense of rhythm and beat combined with the melody of the song can form a strong musical effect and make the song more moving.

[0064] In this embodiment, a rhyme search engine or a rhyme detection algorithm in NLP technology can be used to identify rhyme information such as rhyme words and rhyme patterns in the lyrics. The words or phrases in the original lyrics are divided into syllables, and then the number of syllables is counted.

[0065] In a possible implementation, the structural information and rhythmic information in the original lyrics are extracted using a pre-trained neural network model, which can improve the speed and accuracy of target lyrics feature extraction.

[0066] Step S103: Generate prompts according to the target theme, the target style and the target lyrics features.

[0067] The prompt is also called description, which is used to guide the target lyrics generation model to generate lyrics that meet the requirements. In the present embodiment, a first prompt template is pre-constructed, and the first prompt template is constructed based on the field of music creation. The first prompt template includes parameter items such as theme, style, structure, rhythm, etc., and also includes format requirements that the target lyrics generation model must follow. The prompt is obtained by filling the target theme, target style, and target lyrics features such as structure information and rhythm information into the corresponding positions in the first prompt template.

[0068] Step S104: input the prompt into the target lyrics generation model, and guide the target lyrics generation model to infer and generate new lyrics that meet the target requirements according to the target theme, the target style and the target lyrics features.

[0069] The target lyrics generation model is a large language model that is trained to generate lyrics that meet the requirements.

[0070] The embodiment of the present application directly utilizes a trained large language model to infer and generate new lyrics that can match the melody of the target song according to the target theme, target style, and target lyric features. On the basis of keeping the melody of the target song unchanged, lyrics with different content from the original lyrics are innovatively generated, helping creators to innovate while maintaining the characteristics of the original song, and providing creators with a variety of sources of inspiration.

[0071] As a possible implementation of this application, Figure 2 It is shown that in the method provided in the embodiment of the present application, the above-mentioned guiding the target lyrics generation model to infer and generate new lyrics that meet the target requirements according to the target theme, the target style and the target lyrics features, includes:

[0072] A1: guiding the target lyrics generation model to generate first initial lyrics related to the target theme and the target style.

[0073] The target theme and target style are the first control factors in the process of generating lyrics by the target lyrics generation model. In the process of generating lyrics, the target lyrics generation model will generate the first initial lyrics related to the target theme and target style based on the semantics and style learned in the training phase. By adopting the style transfer technology, lyrics with different themes and styles from the original lyrics can be generated while retaining the structure and rhythm of the original lyrics. For example, it can migrate from pop style to classical style, and from friendship theme to love theme.

[0074] A2: guiding the target lyrics generation model to adjust the rhythm of the first initial lyrics based on the rhythm information to obtain second initial lyrics.

[0075] The prosodic information is the second control factor. By controlling specific prosodic parameters such as rhyming words, rhyme patterns, and the number of syllables, the generated lyrics are ensured to be prosodic similar to the original lyrics.

[0076] A3: guiding the target lyrics generation model to input a specified structural control symbol into the second initial lyrics based on the structural information to generate new lyrics that meet the target requirements.

[0077] In order to ensure that the generated new lyrics maintain a structure similar to the original lyrics, in this embodiment, by inputting a specified structure control symbol, it is ensured that the number of paragraphs and sentences of the generated new lyrics is similar to that of the original lyrics in the target song.

[0078] In an embodiment of the present application, the lyrics generation process of the target lyrics generation model is controlled according to the target theme, target style, and the rhythmic information and structural information in the original lyrics to ensure that the generated new lyrics are adapted to the melody of the target song and meet the target requirements, thereby ensuring the quality of the lyrics.

[0079] As a possible implementation of the present application, the target requirement also includes a target language. Figure 3 The implementation process of the lyrics generation method provided by another embodiment of the present application is shown, and the method flow may include the following steps S201 to S204.

[0080] Step S201: Obtain target requirements and original lyrics of a target song, wherein the target requirements include a target language, a target theme, and a target style.

[0081] The target languages ​​include Chinese, English, Japanese, Korean, etc. Among them, Chinese includes Mandarin, Cantonese, Hokkien, Hakka, etc.

[0082] Step S202: extracting target lyrics features of the original lyrics, wherein the target lyrics features include structural information and rhythmic information of the original lyrics.

[0083] In this embodiment, the specific steps of step S201 to step S202 refer to step S101 to step S102 in the above embodiment, which will not be repeated here.

[0084] Step S203: Generate prompts according to the target language, the target theme, the target style and the target lyrics features.

[0085] In this embodiment, a second prompt template is pre-constructed, and the second prompt template is constructed based on the field of music creation. The second prompt template includes parameter items such as language, theme, style, structure, rhythm, etc., and also includes format requirements that the target lyrics generation model must follow. The prompt is obtained by filling the target language, target theme, target style, and target lyrics features such as structure information and rhythm information into the corresponding positions in the second prompt template.

[0086] Step S204: input the prompt into the target lyrics generation model, and guide the target lyrics generation model to infer and generate new lyrics that meet the target requirements according to the target language, the target theme, the target style and the target lyrics features.

[0087] The embodiment of the present application directly utilizes a trained large language model to infer and generate new lyrics that can match the melody of the target song based on the target language, target theme, target style, and target lyric features. On the basis of keeping the melody of the target song unchanged, it innovatively generates lyrics with different content and language from the original lyrics, helping creators to innovate while maintaining the characteristics of the original song, and providing creators with diverse sources of inspiration.

[0088] As a possible implementation of the present application, in order to further improve the performance of the target lyrics generation model, such as Figure 4As shown, after the target lyrics generation model infers and generates new lyrics that meet the target requirements, it also includes:

[0089] B1: Obtain quality assessment indicators. The quality assessment indicators include at least one of language quality, diversity, and emotional expression.

[0090] The language quality can be evaluated by checking the grammar, fluency and readability of the lyrics. In some implementations, a grammar checking tool or a network model is used to evaluate the grammar, fluency and readability of the new lyrics.

[0091] Diversity is used to evaluate the innovation of lyrics and whether they have unique markings or new ideas. In some implementations, a similarity detection tool can be used to detect and check the new lyrics for duplication, and the diversity of the lyrics can be evaluated based on the detection results, while preventing the generated new lyrics from plagiarizing existing lyrics.

[0092] Emotional expression is also an important indicator for evaluating the quality of lyrics. In this embodiment, the emotional expression in the new lyrics is evaluated to see whether it conforms to the target theme. In some implementations, a sentiment analysis model can be used to evaluate the emotions and feelings conveyed by the new lyrics.

[0093] In this embodiment, the quality assessment indicators can be selected according to the needs of the creator.

[0094] B2: Based on the quality assessment index, perform quality assessment on the new lyrics generated by the target lyrics generation model.

[0095] The evaluation results corresponding to each quality evaluation indicator are summarized and counted, and the quality of the new lyrics generated by the target lyrics generation model is evaluated based on the summarized and counted results.

[0096] B3: Optimizing the target lyrics generation model according to the quality assessment result.

[0097] In a possible implementation, the evaluation result is expressed in the form of a score. The higher the score, the better the quality of the new lyrics, and the lower the score, the worse the quality of the new lyrics.

[0098] In this embodiment, the lyrics generation model is optimized according to the results of the quality assessment. When the quality assessment score is greater than or equal to the first preset score threshold, the target lyrics generation model may not be optimized. When the quality assessment score is less than the first preset score threshold, the target lyrics generation model performs targeted optimization of the corresponding parameters in the target lyrics generation model according to the evaluation results of each quality assessment indicator in the quality assessment to improve the performance of the model.

[0099] In a possible implementation, new lyrics generated by the target lyrics generation model are matched with the melody of the target song to synthesize a new song, and the target audience's evaluation of the new song is collected, and the target lyrics generation model is optimized based on the evaluation.

[0100] The above target lyrics generation model is pre-trained. As a possible implementation of the present application, Figure 5 A specific implementation process of obtaining a target lyrics generation model in the method embodiment provided in the embodiment of the present application is shown, and is described in detail as follows:

[0101] Step S301: Acquire a lyrics data set, wherein the lyrics data set includes sample lyrics.

[0102] The sample lyrics in the lyrics dataset are publicly available. The lyrics dataset covers sample lyrics of different themes, styles, rhythms, and structures to ensure that the model generates diverse new lyrics.

[0103] Step S302: Acquire sample lyrics features of the sample lyrics, and generate sample prompts according to the sample lyrics features, wherein the sample lyrics features include the theme, style, structure and rhythm of the sample lyrics, wherein the structure includes the number of sentences, and the rhythm includes the number of syllables.

[0104] In some implementations, the sample lyrics features also include the language and emotional expression of the sample lyrics.

[0105] In this embodiment, the features of the sample lyrics may be acquired by manual annotation or automatic extraction of annotations by a feature extraction model.

[0106] The theme and style of the sample lyrics are used to train the model to generate targeted lyrics based on the target theme and target style. One possible implementation is to construct a vocabulary for each sample lyrics in the lyrics dataset. This vocabulary can be used during model training to help the model capture the word usage tendencies of the theme and style, which helps the model generate lyrics that match the target theme and style.

[0107] The structure of the sample lyrics is used to train the model to generate lyrics with a similar structure to the original lyrics in the target song to match the tune of the target song.

[0108] The language of the sample lyrics is used to train the model to generate lyrics in a specific language.

[0109] The emotional expression of the sample lyrics is used to train the model to generate lyrics that are similar to the emotions of the original lyrics or the specified emotions.

[0110] The rhythm and number of syllables of the sample lyrics are used to train the model to generate lyrics that maintain the rhythm and syllables of the original lyrics.

[0111] Step S303: using the sample prompt as input of a large language model, and the sample lyrics as target output of the large language model, and training the large language model until the training error meets preset requirements, thereby obtaining a target lyrics generation model.

[0112] The large language model selected for training is an open source large language model. Supervised fine-tuning training is performed based on the open source large language model to obtain the target lyrics generation model.

[0113] In this embodiment, sample prompts are generated based on the sample lyrics features, line number information is added to the template of the sample prompts so that the large language model can process the number of lyrics lines, and placeholders are used to represent syllables so that the large language model can process the number of syllables in a sentence.

[0114] For example, Figure 5.1 A model input example is shown, where<verse_start> ,<verse_end> ,<prechorus_start> ,<prechorus_end> ,<chorus_start> ,<chorus_end> etc. indicate structural information. [phr] indicates syllables. Each line of lyrics has multiple syllables. The number of [phr] indicates the number of syllables. [YA] indicates rhythm information. The Arabic numerals before each line of lyrics indicate the sentence number. The number of sentences can be determined based on the number.

[0115] In some embodiments, the above-mentioned training error is similarity. When the similarity between the output of the large language model obtained by using the sample lyrics features as the input of the large language model and the target output reaches a preset similarity threshold, the training error meets the preset requirements, the training is completed, and the target lyrics generation model is obtained.

[0116] In this embodiment, the target lyrics generation model obtained after training can be used to generate new lyrics with original lyrics format control, and the target song can be replaced with new lyrics or even lyrics in another language. The target lyrics generation model can be used to generate a large number of lyrics.

[0117] As a possible implementation of the present application, after the target lyrics generation model is obtained through training, the target lyrics generation model is also verified, and the quality of the lyrics generated by the target lyrics generation model is verified using a specified test data set and the structure and rhythm of the sample lyrics, wherein the specified test data set includes a specified theme and a specified style. The model parameters of the target lyrics generation model are adjusted according to the verification results.

[0118] As can be seen from the above, in the embodiment of the present application, by first obtaining the target demand and the original lyrics of the target song, the target demand includes the target theme and the target style, and then extracting the target lyrics features such as the structural information and rhythmic information in the original lyrics, and then generating prompts according to the target theme, the target style and the target lyrics features, the prompts are input into the target lyrics generation model, and the target lyrics generation model is guided to infer and generate new lyrics that meet the target demand according to the target theme, the target style and the target lyrics features. The present application utilizes a well-trained large language model to intelligently generate lyrics similar to the structure, rhythm and syllables of the original lyrics according to demand, which not only effectively guarantees the quality of the lyrics, but also greatly reduces the manpower and time costs, improves the efficiency of lyrics creation, helps creators innovate while maintaining the characteristics of the original song, and provides creators with a variety of sources of inspiration.

[0119] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0120] Corresponding to the lyrics generation method described in the above embodiment, Figure 6 A structural block diagram of a lyrics generation device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0121] Reference Figure 6 The device is applied to an intelligent terminal, and comprises: a lyrics demand acquisition unit 61, a target feature extraction unit 62, a first prompt generation unit 63, and a first inference generation unit 64, wherein:

[0122] The lyrics demand acquisition unit 61 is used to acquire the target demand and the original lyrics of the target song, wherein the target demand includes the target theme and the target style;

[0123] A target feature extraction unit 62, configured to extract target lyrics features of the original lyrics, wherein the target lyrics features include structural information and rhythmic information of the original lyrics;

[0124] A first prompt generating unit 63, configured to generate prompts according to the target theme, the target style and the target lyrics feature;

[0125] The first inference generation unit 64 is used to input the prompt into the target lyrics generation model, and guide the target lyrics generation model to infer and generate new lyrics that meet the target requirements based on the target theme, the target style and the target lyrics characteristics, wherein the target lyrics generation model is a large language model that has been trained to generate lyrics that meet the requirements.

[0126] As a possible implementation of the present application, the first reasoning generation unit 64 is specifically used for:

[0127] Guiding the target lyrics generation model to generate first initial lyrics related to the target theme and the target style;

[0128] guiding the target lyrics generation model to adjust the rhythm of the first initial lyrics based on the rhythm information to obtain second initial lyrics;

[0129] The target lyrics generation model is guided to input a specified structural control symbol into the second initial lyrics based on the structural information to generate new lyrics that meet the target requirements.

[0130] As a possible implementation of the present application, the lyrics generation device further includes:

[0131] A data set acquisition unit, used to acquire a lyrics data set, wherein the lyrics data set includes sample lyrics;

[0132] A sample feature acquisition unit, used to acquire sample lyrics features of the sample lyrics and generate sample prompts according to the sample lyrics features, wherein the sample lyrics features include the theme, style, structure and rhythm of the sample lyrics;

[0133] The model training unit is used to use the sample prompt as the input of the large language model and the sample lyrics as the target output of the large language model, train the large language model until the training error meets the preset requirements, and obtain the target lyrics generation model.

[0134] As a possible implementation of the present application, the lyrics generation device further includes:

[0135] A verification and adjustment unit is used to verify the quality of lyrics generated by the target lyrics generation model using a specified test data set and the structure and rhythm of the sample lyrics, wherein the specified test data set includes a specified theme and a specified style; and adjust the model parameters of the target lyrics generation model according to the verification results.

[0136] As a possible implementation of the present application, the above target requirement also includes a target language, and the above lyrics generation device also includes:

[0137] A second prompt generating unit, configured to generate prompts according to the target language, the target theme, the target style and the target lyrics feature;

[0138] The second inference generation unit is used to input the prompt into the target lyrics generation model, and guide the target lyrics generation model to infer and generate new lyrics that meet the target requirements based on the target language, the target theme, the target style and the target lyrics characteristics.

[0139] As a possible implementation of the present application, the lyrics generation device further includes:

[0140] An indicator acquisition unit, used for acquiring quality assessment indicators;

[0141] A quality assessment unit, configured to perform quality assessment on the new lyrics generated by the target lyrics generation model based on the quality assessment index;

[0142] A model optimization unit is used to optimize the target lyrics generation model according to the result of the quality evaluation.

[0143] In an embodiment of the present application, the target demand and the original lyrics of the target song are first obtained, the target demand includes a target theme and a target style, and then the target lyrics features such as structural information and rhythmic information in the original lyrics are extracted, and then prompts are generated according to the target theme, the target style and the target lyrics features, and the prompts are input into the target lyrics generation model, and the target lyrics generation model is guided to generate new lyrics that meet the target demand according to the target theme, the target style and the target lyrics features. The present application utilizes a well-trained large language model to intelligently generate lyrics similar to the original lyrics in structure, rhythm and syllables according to demand, which not only effectively guarantees the quality of the lyrics, but also greatly reduces the manpower and time costs, improves the efficiency of lyrics creation, helps creators innovate while maintaining the characteristics of the original song, and provides creators with a variety of sources of inspiration.

[0144] The present application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, Figures 1 to 5 The steps of any lyric generation method represented.

[0145] The embodiment of the present application also provides an intelligent terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, Figures 1 to 5 The steps of any lyric generation method represented.

[0146] The embodiment of the present application also provides a computer program product, when the computer program product is run on a terminal device, the terminal device executes the following Figures 1 to 5 The steps of any lyric generation method represented.

[0147] Figure 7 is a schematic diagram of a smart terminal provided by an embodiment of the present application. Figure 7 As shown, the intelligent terminal 7 of this embodiment includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70. When the processor 70 executes the computer program 72, the steps in the above-mentioned embodiments of the lyric generation method are implemented, for example Figure 1 Steps S101 to S104 shown, or Figure 3 Alternatively, when the processor 70 executes the computer program 72, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 6 The functions of units 61 to 64 are shown.

[0148] The computer program 72 may be divided into one or more modules / units, which are stored in the memory 71 and executed by the processor 70 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 72 in the smart terminal 7.

[0149] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0150] The memory 71 may be an internal storage unit of the intelligent terminal 7, such as a hard disk or memory of the intelligent terminal 7. The memory 71 may also be an external storage device of the intelligent terminal 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the intelligent terminal 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the intelligent terminal 7. The memory 71 is used to store the computer program and other programs and data required by the intelligent terminal. The memory 71 may also be used to temporarily store data that has been output or is to be output.

[0151] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0152] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0153] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0154] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0155] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0156] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0157] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0158] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0159] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A lyrics generation method, characterized in that: The lyrics generation method comprises: Obtaining target requirements and original lyrics of a target song, wherein the target requirements include a target theme and a target style; Extracting target lyrics features of the original lyrics, wherein the target lyrics features include structural information and rhythmic information of the original lyrics; Generate prompts according to the target theme, the target style and the target lyrics features; The prompt is input into a target lyrics generation model, guiding the target lyrics generation model to infer and generate new lyrics that meet the target requirements based on the target theme, the target style and the target lyrics features, wherein the target lyrics generation model is a large language model that has been trained to generate lyrics that meet the requirements.

2. The method for generating lyrics according to claim 1, characterized in that: The step of guiding the target lyrics generation model to infer and generate new lyrics that meet the target requirements according to the target theme, the target style, and the target lyrics features includes: Guiding the target lyrics generation model to generate first initial lyrics related to the target theme and the target style; guiding the target lyrics generation model to adjust the rhythm of the first initial lyrics based on the rhythm information to obtain second initial lyrics; The target lyrics generation model is guided to input a specified structural control symbol into the second initial lyrics based on the structural information to generate new lyrics that meet the target requirements.

3. The lyrics generation method according to claim 1, characterized in that: The lyrics generation method comprises: Acquire a lyrics data set, wherein the lyrics data set includes sample lyrics; Acquire sample lyrics features of the sample lyrics, and generate sample prompts according to the sample lyrics features, wherein the sample lyrics features include the theme, style, structure and rhythm of the sample lyrics; The sample prompt is used as the input of the large language model, and the sample lyrics are used as the target output of the large language model. The large language model is trained until the training error meets the preset requirements, thereby obtaining a target lyrics generation model.

4. The method for generating lyrics according to claim 3, characterized in that: After obtaining the target lyrics generation model, the method further includes: Verifying the quality of lyrics generated by the target lyrics generation model using a specified test data set and the structure and rhythm of the sample lyrics, wherein the specified test data set includes a specified theme and a specified style; The model parameters of the target lyrics generation model are adjusted according to the verification results.

5. The lyrics generation method according to claim 1, characterized in that: The target requirement also includes a target language, and the lyrics generation method also includes: Generate a prompt according to the target language, the target theme, the target style, and the target lyrics feature; The prompt is input into a target lyrics generation model, and the target lyrics generation model is guided to infer and generate new lyrics that meet the target requirements according to the target language, the target theme, the target style and the target lyrics features.

6. The method for generating lyrics according to any one of claims 1 or 5, characterized in that: After the reasoning generates new lyrics that meet the target requirements, the method further includes: Obtain quality assessment indicators; Based on the quality assessment index, performing quality assessment on the new lyrics generated by the target lyrics generation model inference; According to the result of the quality assessment, the target lyrics generation model is optimized.

7. A lyrics generating device, characterized in that: The lyrics generating device comprises: A lyrics demand acquisition unit, used to acquire target demand and original lyrics of a target song, wherein the target demand includes a target theme and a target style; A target feature extraction unit, used to extract target lyrics features of the original lyrics, wherein the target lyrics features include structural information and rhythm information of the original lyrics; A first prompt generating unit, configured to generate prompts according to the target theme, the target style and the target lyrics feature; The first inference generation unit is used to input the prompt into the target lyrics generation model, and guide the target lyrics generation model to infer and generate new lyrics that meet the target requirements according to the target theme, the target style and the target lyrics characteristics, wherein the target lyrics generation model is a large language model that has been trained to generate lyrics that meet the requirements.

8. The lyrics generating device according to claim 7, characterized in that: The target requirement also includes a target language, and the lyrics generation device also includes: A second prompt generating unit, configured to generate prompts according to the target language, the target theme, the target style and the target lyrics feature; The second inference generation unit is used to input the prompt into the target lyrics generation model, and guide the target lyrics generation model to infer and generate new lyrics that meet the target requirements based on the target language, the target theme, the target style and the target lyrics characteristics.

9. An intelligent terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the lyrics generation method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the lyrics generation method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Model training method, lyric generation method and electronic equipment

    CN119623569A