Lyric generation method, computer equipment and storage medium

By extracting the lyric style characteristics of the reference lyrics and combining with the user's creative requirements, the target lyrics are generated, which solves the problem that users find it difficult to accurately express their creative requirements and improves the efficiency and quality of lyric creation.

CN120234445APending Publication Date: 2025-07-01TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510305397.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

It is difficult for users to accurately express the lyrics creation requirements, which makes it difficult for the lyrics generated by large language models to meet the actual needs of users and are less efficient.

Method used

By obtaining lyrics instructions and reference lyrics, the lyrics style characteristics of the reference lyrics are extracted, and target lyrics are generated based on these characteristics, and the basis for creating large language models is added.

Benefits of technology

It improves the efficiency of users in assisting lyrics through large language models, ensures that the generated lyrics more accurately meet users' creative requirements, enriches the lyrics style and ensures the stability of quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234445A_ABST
    Figure CN120234445A_ABST
Patent Text Reader

Abstract

The invention provides a lyric generation method, computer equipment and a storage medium, and belongs to the technical field of artificial intelligence. The method for generating the lyrics comprises the following steps: acquiring word indication information and reference lyrics, extracting word style characteristics of the reference lyrics, the word style characteristics comprising a first text for describing word styles, and generating target lyrics based on the word indication information and the word style characteristics. According to the method and the device, reference information of lyric creation of the large language model can be enriched by extracting the word-making style characteristics of the reference lyrics specified by the user, so that the efficiency of lyric auxiliary creation of the large language model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and particularly relates to a method for generating lyrics, a computer device, and a storage medium. Background Art

[0002] With the development of artificial intelligence (AI) technology, large language models (LLMs) are increasingly widely used, and the ability of large language models to understand and generate language texts is also getting stronger and stronger.

[0003] In some application scenarios of large language models, users can use large language models for assisted lyric creation. For example, users can input lyric writing instruction information into the large language model, such as the theme and number of words of the lyrics, and then the large language model can create lyrics according to the lyric writing instruction information input by the user.

[0004] The lyric writing instruction information input by the user serves as the basis for the large language model to create lyrics, affecting the direction and quality of the lyrics created by the large language model. However, some users are relatively difficult to accurately express their actual lyric writing instruction information, so it is difficult for the lyrics created by the large language model to meet the actual lyric writing instruction information of the users. As a result, users need to repeatedly adjust the lyric writing instruction information input to the large language model, which leads to low efficiency of users using the large language model for assisted lyric creation. Summary of the Invention

[0005] In order to solve the related technical problems, the present disclosure provides a method for generating lyrics, a computer device, and a storage medium, which can improve the efficiency of users using large language models for assisted lyric creation. The corresponding technical solutions are as follows:

[0006] In a first aspect, a method for generating lyrics is provided, and the method includes:

[0007] Obtain lyric writing instruction information and reference lyrics;

[0008] Extract the lyric writing style features of the reference lyrics, where the lyric writing style features include a first text describing the lyric writing style;

[0009] Generate target lyrics based on the lyric writing instruction information and the lyric writing style features.

[0010] Optionally, before generating target lyrics based on the lyric writing instruction information and the lyric writing style features, it further includes: extracting the lyric writing requirement features of the lyric writing instruction information, where the lyric writing requirement features include at least one of keywords and emotional information;

[0011] Generate target lyrics based on the songwriting instruction information and songwriting style features, including: generating target lyrics based on the songwriting requirement features and songwriting style features.

[0012] Optionally, before generating target lyrics based on the songwriting instruction information and songwriting style features, it further includes: extracting the songwriting reference features of the songwriting requirement features and songwriting style features, where the songwriting reference features include songwriting reference words and a second text describing the songwriting reference direction.

[0013] Generate target lyrics based on the songwriting instruction information and songwriting style features, including: generating target lyrics based on the songwriting requirement features and songwriting reference features.

[0014] Optionally, generating target lyrics based on the songwriting requirement features and songwriting reference features includes: generating target lyrics based on the songwriting requirement features, songwriting reference features, and reference lyrics.

[0015] Optionally, the method further includes: generating lyrics obtained by correcting the target lyrics according to the songwriting instruction information based on the songwriting requirement features, songwriting reference features, and target lyrics.

[0016] Optionally, the songwriting requirement features include keywords, emotional information, song genre categories, and lyrics content requirements.

[0017] Optionally, the first text includes at least one piece of information among the habitual words, grammatical structures, and prosody features of the designated songwriter.

[0018] In a second aspect, a device for generating lyrics is provided, and the device includes:

[0019] An acquisition module for acquiring songwriting instruction information and reference lyrics;

[0020] An extraction module for extracting the songwriting style features of the reference lyrics, where the songwriting style features include a first text describing the songwriting style;

[0021] A generation module for generating target lyrics based on the songwriting instruction information and the songwriting style features.

[0022] Optionally, the extraction module is further configured to extract the songwriting requirement features of the songwriting instruction information, and the songwriting requirement features include at least one of keywords and emotional information;

[0023] The generation module is configured to generate the target lyrics based on the songwriting requirement features and the songwriting style features.

[0024] Optionally, the extraction module is further configured to extract lyric-writing reference features of the lyric-writing requirement features and the lyric-writing style features, where the lyric-writing reference features include lyric-writing reference words and a second text describing the lyric-writing reference direction.

[0025] The generation module is configured to generate the target lyrics based on the lyric-writing requirement features and the lyric-writing reference features.

[0026] Optionally, the generation module is configured to generate the target lyrics based on the lyric-writing requirement features, the lyric-writing reference features, and the reference lyrics.

[0027] Optionally, the generation module is further configured to generate lyrics obtained by correcting the target lyrics according to the lyric-writing instruction information based on the lyric-writing requirement features, the lyric-writing reference features, and the target lyrics.

[0028] Optionally, the lyric-writing requirement features include keywords, emotional information, song genre categories, and lyric content requirements.

[0029] Optionally, the first text includes at least one piece of information among the habitual words of a specified lyricist, grammatical structures, and prosody features.

[0030] In a third aspect, a computer device is provided. The computer device includes a memory and a processor. The memory is configured to store computer instructions. The processor executes the computer instructions stored in the memory so that the computer device executes the method according to the first aspect or the method described above.

[0031] In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores computer program code. When the computer program code is executed by a computer device, the computer device executes the method according to the first aspect described above.

[0032] In a fifth aspect, a computer program product is provided. The computer program product includes computer program code. When the computer program code is executed by a computer device, the computer device executes the method according to the first aspect described above.

[0033] The beneficial effects brought by the technical solution provided in this application at least include:

[0034] In the technical solution provided by this application, in addition to normally inputting the lyric writing instruction information, the user can also specify reference lyrics according to their actual creative needs. By extracting features from the reference lyrics, a text describing the lyric writing style of the reference lyrics can be obtained. Since the lyric writing style features can make up for the lack of accuracy in the expression of the creative requirements input by the user, the basis for the large language model to create lyrics can be increased, and thus the actual lyric writing requirements of the user can be more accurately met, and the efficiency of the user's lyric assisted creation through the large language model can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 is a flowchart of a method for generating lyrics provided by an embodiment of this application;

[0036] Figure 2 is a schematic diagram of a lyric creation page provided by an embodiment of this application;

[0037] Figure 3 is a schematic diagram of the structure of a large language model provided by an embodiment of this application;

[0038] Figure 4 is a schematic diagram of the structure of a device for generating lyrics provided by an embodiment of this application;

[0039] Figure 5 is a schematic diagram of a computer structure provided by an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0040] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this disclosure will be further described in detail below with reference to the accompanying drawings.

[0041] With the development of artificial intelligence technology, the application of large language models is becoming more and more widespread, and the ability of large language models to understand and generate language texts is also getting stronger and stronger.

[0042] In one application scenario, users can use large language models for lyric assisted creation. For example, users can input lyric creation requirements into the large language model, such as the theme and word count of the lyrics. Then, after analyzing and processing the lyric creation requirements input by the user, the large language model can output lyrics that meet the lyric creation requirements. Currently, large language models do have certain value in lyric assisted creation, but there are still some obvious problems in lyric assisted creation through large language models, which can specifically include:

[0043] On the one hand, the lyrics creation requirements input by the user serve as the basis for the large language model to create lyrics, influencing the direction and quality of the lyrics created by the large language model. However, some users find it difficult to accurately express their actual lyrics creation requirements, making it difficult for the lyrics created by the large language model to meet the users' actual lyrics creation requirements. As a result, users need to repeatedly adjust the lyrics creation requirements input to the large language model, leading to low efficiency in the lyrics assisted creation by the large language model.

[0044] On the other hand, the large language model can only understand simple lyrics creation requirements, such as the number of words in the lyrics and the keywords that need to appear in the lyrics. If the input lyrics creation requirements are relatively complex, the large language model may not be able to accurately understand the users' actual lyrics creation requirements, resulting in the created lyrics not conforming to the lyrics creation requirements.

[0045] On the other hand, the lyrics created by the large language model are simply mechanically created according to the keywords included in the lyrics creation requirements and some common words and sentence patterns, resulting in a single style of the lyrics created by the large language model and a lack of innovation.

[0046] On the other hand, the quality of the lyrics created by the large language model is not stable enough. Some lyrics have poor logic, semantic incoherence, and even conflict with the users' lyrics creation requirements. For example, when the user requests to create lyrics expressing happiness, the lyrics created by the large language model may contain words expressing sadness.

[0047] The embodiments of the present application provide a method for generating lyrics, which can solve the problems that occur when the large language model creates lyrics, thereby improving the efficiency of the users' lyrics assisted creation using the large language model, enhancing the large language model's understanding ability of the users' creation requirements, enriching the style of the lyrics created by the large language model, and ensuring the stability of the quality of the lyrics created by the large language model. Figure 1 It is a flowchart of a method for generating lyrics provided by the embodiments of the present application, and this method can be executed by a server and / or a terminal. Refer to Figure 1 and this method includes:

[0048] Step 101, obtain lyric writing instruction information and reference lyrics.

[0049] In one example, a lyrics creation page can be displayed on the terminal. As Figure 2 shown, on the lyrics creation page, there is an input window for lyric writing requirements, a display window for the created lyrics, and a start control. The user can input the lyric writing instruction information in the input window. For example, the user can input "Write a song describing a person walking on the beach and feeling lonely". After the user inputs the lyric writing instruction information, the user can click the start control to send the input lyric writing instruction information (i.e., the lyric writing instruction information) to the server.

[0050] Among them, the lyric creation page can be provided in an application with large language model capabilities, such as a music player application. The music player application can have the function of creating lyrics by the large language model. After the user triggers this function, the user can enter the lyric creation page.

[0051] In the embodiments of the present application, in addition to inputting lyric writing requirements, the user can also specify reference lyrics for the large language model for creating lyrics, so that the large language model can create lyrics with reference to the lyric writing style of the reference lyrics specified by the user. Among them, in the embodiments of the present application, the large language model for creating lyrics can be called a lyric creation model, and the lyric writing style of the reference lyrics specified by the user can also be called the lyric writing style of the lyricist of the reference lyrics.

[0052] In one example, the above Figure 2 The shown lyric creation page may further include a song specification window, and the user can enter the song name of the song created by the specified lyricist in the song specification window. After the user clicks the start control, the terminal can send the song name to the server, and the server can obtain the reference lyrics of the song created by the specified lyricist according to the song name. Alternatively, the user can enter the reference lyrics created by the specified lyricist in the song specification window. After the user clicks the start control, the terminal can send the reference lyrics created by the specified lyricist to the server.

[0053] Step 102: Extract the lyric writing style features of the reference lyrics. The lyric writing style features include the first text describing the lyric writing style.

[0054] In implementation, after obtaining the reference lyrics, the server can input the reference lyrics into a trained style analysis model, and the style analysis model can extract features from the reference lyrics to obtain the lyric style features of the lyrics.

[0055] Among them, the style analysis model can be trained by the large language model. Therefore, the lyric writing style features output by the style analysis model can be the lyric writing style of the specified lyricist summarized in text form by the style analysis model according to the reference lyrics. In one example, the lyric writing style can include but is not limited to frequently used words, syntactic structures, rhythm characteristics, lyric expression tendencies, emotional expression methods, and common images, etc. For example, the lyrics of an ancient style love song can be input into the style analysis model, and the style analysis model can output "Lyric style features: combination of classical and modern, delicate emotional expression, rich cultural background, hierarchical image application; common images: moonlight, wind and snow, burning incense, mortal world, memories".

[0056] The training samples for the style analysis model may include sample lyrics and the corresponding lyrics style features presented in text form. The sample lyrics included in the training samples can be the lyrics of any song, and the lyrics style features included in the training samples can include, but are not limited to, syntactic structures, rhythmic features, lyricist's expression tendencies, emotional expression methods, and common imagery, etc. Among them, common imagery refers to the words used to express specific emotions or themes, such as moonlight, willow trees, wind and moon, ice rain, etc.

[0057] In the embodiments of the present application, the user can set the reference lyrics of a designated lyricist that are close to their own creative needs, and the style analysis model can refine the lyricist style of the reference lyrics to obtain the first text that describes the lyrics style of the reference lyrics. In this way, the first text can be used as auxiliary information for the user's lyric writing instruction information and input into the lyric creation model together, which can further enrich the basis for the lyric creation model to create lyrics and improve the lyrics created by the lyric creation model to better meet the user's lyric writing requirements.

[0058] Step 103: Generate target lyrics based on the lyric writing instruction information and the lyricist style features.

[0059] After obtaining the lyric writing instruction information and the lyricist style features, the server can input the lyric writing instruction information and the lyricist style features into the lyric creation model to obtain the target lyrics created according to the lyric writing instruction information and the lyricist style features.

[0060] Among them, the lyric creation model can be trained by a large language model. In one example, the training samples for the lyric creation model may include lyric writing requirement samples and style feature samples. The lyric writing requirement samples are the lyric writing instruction information input by the user, and the style feature samples can be the text that describes the lyricist style of any song. The training samples also include the lyrics created according to the lyric writing requirement samples and the style feature samples.

[0061] In the technical solution provided by the present application, in addition to normally inputting the creative requirements of the lyrics, the user can also specify a lyricist according to their actual creative needs. The style analysis model can analyze and refine the songs of the designated lyricist (that is, the reference songs) to obtain the text that describes the lyricist style of the designated lyricist. In this way, the lyric creation model can create lyrics based on both the user's creative requirements and the lyricist style features of the user-specified lyricist. Since the lyricist style features can make up for the deficiency in the expression accuracy of the creative requirements input by the user, it can increase the basis for the large language model to create lyrics, and thus can more accurately meet the actual lyric creation requirements of the user and improve the efficiency of the user's lyric-assisted creation through the large language model.

[0062] In an implementable manner, the embodiments of the present application further provide a requirement analysis model. The requirement analysis model can analyze and understand the lyric writing instruction information input by the user, and further assist the lyric creation model in understanding the lyric writing instruction information.

[0063] Correspondingly, before performing the above step 103, the lyric writing instruction information can be input into the requirement analysis model to obtain lyric writing requirement features, where the lyric writing requirement features include at least one of keywords and emotional information. The processing of step 103 can be replaced by determining the target lyrics created according to the lyric writing instruction information based on the lyric writing requirement features, the lyric writing style features, and the lyric creation model.

[0064] Among them, the requirement analysis model can also be trained through a large language model. The input of the requirement analysis model is the lyric writing instruction information input by the user in step 101, and the output of the requirement analysis model is the lyric writing requirement features in text form. The lyric writing requirement features can include keywords (or called topic words) and emotional information (or called emotional tones) for lyric creation. For example, the emotional tone can include happiness, sadness, loneliness, anger, etc.

[0065] In an example, the lyric writing requirement features of the requirement analysis model can at least include topic words, emotional tones, genre category requirements, and lyric content requirements. Among them, the topic words can assist the lyric creation model in determining the lyric creation direction. For example, if the lyric writing instruction information input by the user is "create a happy song about summer", the requirement analysis model can extract "summer" and "happy" as topic words. The emotional tone can assist the lyric creation model in determining the emotion that the lyrics need to express. For example, according to "create a happy song about summer", the emotional tone is determined to be happy. The genre requirements include pop, rock, country, etc., which can increase the reference information for the lyric creation model when creating songs. The requirement analysis model can determine the genre requirements expected by the user from the lyric writing instruction information. For example, according to "create a happy song about summer", the genre requirement is determined to be pop. The lyric content requirements can include specific requirements for the lyric content, such as the plot development and character settings. For example, the user may require the lyrics to contain a specific plot development or character description.

[0066] In implementation, the lyric writing requirement features output by the requirement analysis model and the lyric writing style features obtained by the style analysis model can be input into the lyric creation model, and the lyric creation model outputs the target lyrics created according to the lyric writing instruction information.

[0067] In the embodiments of the present application, the requirement analysis model can be used to assist the lyric creation model in understanding the lyric writing instruction information input by the user. As a result, the lyrics created by the lyric creation model can better meet the user's lyric writing requirements, avoiding the need for the user to repeatedly modify the lyric writing instruction information input to the lyric creation model, thereby improving the efficiency of the user using the lyric creation model for lyric-assisted creation.

[0068] In one implementable manner, the embodiments of the present application also provide a lyric writing reference model. This lyric writing reference model can further analyze and understand the lyric writing instruction information input by the user by combining the lyric writing requirement features and the lyric writing style features, thereby assisting in the lyric creation of the lyric creation model.

[0069] Correspondingly, before performing step 103, the lyric writing requirement features and the lyric writing style features can be input into the lyric writing reference model to obtain lyric writing reference features. The lyric writing reference features include lyric writing reference words and a second text describing the lyric writing reference direction. The processing of step 103 can be replaced by inputting the lyric writing requirement features and the lyric writing reference features into the lyric creation model to obtain the target lyrics created according to the lyric writing instruction information.

[0070] Among them, the lyric writing reference model can also be trained through a large language model. The input of the lyric writing reference model is the lyric writing requirement features output by the requirement analysis model and the lyric writing style features obtained by the style analysis model input into the lyric creation model. The output of the lyric writing reference model is the lyric writing reference features in text form. The lyric writing reference features include lyric writing reference words and a second text describing the lyric writing reference direction. Among them, the lyric writing reference words can be "imagery" that can appear in the target lyrics expanded according to the lyric writing requirement features and the lyric writing style features. The lyric writing reference direction can be a further summary of the lyric writing requirement features and the lyric writing style features.

[0071] In an example, the user's lyric writing instruction information is "Write a solemn ancient-style song with the theme of 'ancient war', and the lyrics should include the battlefield, heroes, and farewells". The reference lyrics for the designated lyricist are the lyrics of "Snow Like Hair".

[0072] The lyric writing requirement features output by the requirement analysis model can be "Subject words: ancient war, battlefield, heroes, farewells; Emotional tone: solemn; Genre requirement: ancient style; Content requirement: the lyrics include the battlefield, heroes, and farewells."

[0073] The lyric writing style features output by the style analysis model can be "Lyric style characteristics: combination of classical and modern, delicate emotional expression, rich cultural background, hierarchical imagery application; Common imagery: moonlight, wind and snow, burning incense, mortal world, memories".

[0074] After inputting the above-mentioned songwriting requirement features and songwriting style features into the songwriting reference model, the songwriting reference features output by the songwriting reference model are: "Songwriting direction: themed on ancient wars, with a solemn and stirring emotion, and an ancient style. The imagery should reflect the cruelty of the battlefield, the heroic spirit, and the sorrow of parting, while integrating Chinese style and traditional cultural elements, with beautiful language; Extended imagery: beacon fire, smoke signal, iron horse, frozen river, battle flag, broken sword, farewell song, evening snow".

[0075] In implementation, the songwriting requirement features output by the requirement analysis model and the songwriting reference features obtained by the songwriting reference model can be input into the lyric creation model, and the lyric creation model outputs the target lyrics created according to the songwriting instruction information. Or, the processing in step 103 above can also be to input the songwriting requirement features, songwriting reference features, and reference lyrics into the lyric creation model to obtain the target lyrics created according to the songwriting instruction information. In this way, the creation basis of the lyric creation model can be increased, and the probability that the lyrics created by the lyric creation model meet the user's songwriting requirements can be improved.

[0076] In the embodiment of the present application, the requirement analysis model can analyze the songwriting requirement features corresponding to the user's songwriting instruction information and the songwriting style features of the designated songwriter, so as to further clarify the user's songwriting requirements, further assist the lyric creation model in understanding the user's songwriting requirements, and thus improve the quality of the lyrics created by the lyric creation model.

[0077] In an implementable manner, the embodiment of the present application also provides a lyric polishing model. The lyric polishing model can polish and adjust the target lyrics generated by the lyric generation model according to the user's songwriting instruction information to obtain the revised lyrics, thereby ensuring the stability of the quality of the lyrics created by the large language model.

[0078] Among them, the lyric polishing model can also be trained through a large language model. The input of the lyric polishing model can be the songwriting requirement features output by the requirement analysis model, the songwriting style features obtained by the style analysis model, the reference lyrics of the designated songwriter, and the target lyrics generated by the lyric generation model.

[0079] After the lyric creation model outputs the target lyrics created in step 103 above, the target lyrics, reference lyrics, songwriting requirement features, and songwriting style features can be input into the lyric polishing model. The lyric polishing model can combine the understanding of the songwriting requirement features and songwriting style features to polish and adjust the target lyrics generated by the lyric generation model, so that the revised lyrics are more matched with the user's songwriting requirements and the style of the designated songwriter. The aspects of polishing and adjustment can include but are not limited to:

[0080] 1. Detail adjustment: Make detailed adjustments to the target lyrics, including word choice, sentence structure optimization, etc., to ensure accurate word usage and natural syntax in the lyrics.

[0081] 2. Style consistency check: Ensure that the polished and revised lyrics are consistent with the style of the designated lyricist in terms of overall style. The system ensures style consistency by comparing the similarity between the generated lyrics and the typical lyrics of the lyricist.

[0082] 3. Emotional tone adjustment: Fine-tune the emotional expression of the target lyrics according to the emotional tone in the user's lyric writing requirements. For example, if the user requests the lyrics to express "sadness", the system will adjust the emotional words and intonation in the lyrics to make it more in line with the requirements.

[0083] In the embodiment of the present application, after the lyric creation model creates the target lyrics according to the user's lyric writing requirements, the lyric polishing model can adjust the target lyrics according to the user's lyric writing requirements, so as to ensure accurate word usage and natural syntax in the target lyrics, and meet the user's lyric writing requirements. In this way, the stability of the quality of lyrics created by the large language model can be ensured.

[0084] Figure 3 It is a schematic structural diagram of a large language model for lyric creation provided by the embodiment of the present application. As Figure 3 shown, the large language model for lyric creation provided by the present application may include the above-mentioned requirement analysis model, style analysis model, lyric writing reference model, lyric creation model, and lyric polishing model.

[0085] As Figure 3 shown, the lyric writing instruction information "Write a song describing a person walking on the beach by the sea and feeling lonely" input by the user is input to the requirement analysis model. The requirement analysis model can output the lyric writing requirement features "Theme words: sea, beach, loneliness; Emotional tone: loneliness; Genre requirements: none; Content requirements: none".

[0086] The reference lyrics of the user-specified lyricist "The wolf-tooth moon makes the beauty haggard. I raise my cup and drink up the wind and snow,..., Who am I touching with my incense?" are input to the style analysis model to obtain the lyric writing style features "Lyric style characteristics: combination of classical and modern, delicate emotional expression, rich cultural background, hierarchical use of images; Common images: moonlight, wind and snow, incense, red dust, memories".

[0087] The lyric writing reference model can output the lyric writing reference features "Lyric writing direction: The lyric instruction describes a person walking on the beach by the sea and feeling lonely. The lyrics should express a deep sense of loneliness and the natural beauty of the sea. The language needs to be beautiful and implicit; Extended images: waves, solitary boat, setting sun, beach" according to the reference lyrics, lyric writing requirement features, and lyric writing style features.

[0088] The lyric creation model can create lyrics based on reference lyrics and lyric-writing reference features to obtain target lyrics, including "The waves gently caress the face, a lone boat anchors on the beach watching the seagulls fly, the setting sun reflects the evening glow, and the lonesome feeling surges in my heart as the sound of the tides comes and goes. The sea breeze blows past memories, looking far away at the shore, memories come like the tides, you can't hear clearly, the soft whispers of the tides as night falls."

[0089] The lyric polishing model can adjust the target lyrics according to the reference lyrics, lyric-writing reference features, etc., so that the target lyrics are logical in syntax and word usage and meet the user's lyric-writing requirements, obtaining the revised lyrics. The revised lyrics can be "The waves gently caress the face, a lone boat anchors on the beach watching the seagulls fly, the setting sun reflects the evening glow, and the lonesome feeling surges in my heart as the sound of the tides comes and goes. The sea breeze blows past memories, looking far away at the shore, memories come like the tides, I'm waiting for the moon to come, listening to the soft whispers of the tides as night falls."

[0090] In the embodiments of the present application, the requirement analysis model can deeply understand the user's lyric-writing instruction information. The style analysis model can be based on the lyric creation model's understanding of the user's lyric-writing instruction information and can provide a reference for the creation style of the lyric creation model. The lyric-writing reference model can further provide a creation direction for the lyric creation model according to the lyric-writing instruction information and the lyric-writing style of the designated lyricist. The lyric polishing model can ensure the quality of the created lyrics.

[0091] The above-mentioned requirement analysis model, style analysis model, lyric-writing reference model, lyric creation model, and lyric polishing model can all be trained by large language models. For example, the style analysis model can be trained through llama2 (an open-source pre-trained large language model). In implementation, the style analysis model can be trained with a large number of training samples so that the style analysis model can accurately obtain the lyric-writing style characteristics corresponding to the lyrics. Taking the style analysis model as llama2 as an example, during the training of the style analysis model, the input lyric text can be encoded into corresponding text vectors using the tokenizer and word vectors of llama2. For example, the lyric text can consist of a series of tokens where is the j-th token of text. Then this token sequence can be mapped into a text vector through word vectors Then the text vector is input into the llama2 neural network layer. After being processed by llama2, the input text vector can obtain a text decoding vector The text decoding vector can be mapped to the word vector space to obtain the corresponding output text where represents the j-th token of the output text text dec in text dec consists of a series of tokens, in the form of After obtaining the output text, the language model can be trained through supervised learning to generate the target output "output", and the parameters of Llama 2 can be updated using backpropagation.

[0092] The training of the requirement analysis model, the lyric-writing reference model, the lyric creation model, and the lyric polishing model is similar to that of the style analysis model, and will not be elaborated one by one in the embodiments of this application. In addition, these multiple models can be trained separately according to the training difficulty and then trained as a whole. For example, since the requirement analysis model and the lyric-writing reference model are difficult to train, the requirement analysis model and the style analysis model can be trained a preset number of times separately, and then the requirement analysis model, the style analysis model, the lyric-writing reference model, the lyric creation model, and the lyric polishing model can be trained as a whole, so that the convergence degree of each model can be unified.

[0093] Any combination of the above optional technical solutions can form an optional embodiment of this application, which will not be elaborated one by one here.

[0094] Figure 4 It is a schematic structural diagram of a device for generating lyrics provided by an embodiment of this application, as Figure 4 shown. The device includes:

[0095] An acquisition module 410, configured to acquire lyric-writing instruction information and reference lyrics;

[0096] An extraction module 420, configured to extract the lyric-writing style features of the reference lyrics, where the lyric-writing style features include a first text describing the lyric-writing style;

[0097] A generation module 430, configured to generate target lyrics based on the lyric-writing instruction information and the lyric-writing style features.

[0098] Optionally, the extraction module 420 is further configured to extract the lyric-writing requirement features of the lyric-writing instruction information, where the lyric-writing requirement features include at least one of keywords and emotional information;

[0099] The generation module 430 is configured to generate the target lyrics based on the lyric-writing requirement features and the lyric-writing style features.

[0100] Optionally, the extraction module 420 is further configured to extract the lyric-writing reference features of the lyric-writing requirement features and the lyric-writing style features, where the lyric-writing reference features include lyric-writing reference words and a second text describing the lyric-writing reference direction;

[0101] The generation module 430 is configured to generate the target lyrics based on the lyric-writing requirement features and the lyric-writing reference features.

[0102] Optionally, the generation module 430 is configured to generate the target lyrics based on the songwriting requirement features, the songwriting reference features, and the reference lyrics.

[0103] Optionally, the generation module 430 is further configured to generate lyrics obtained by correcting the target lyrics according to the songwriting instruction information based on the songwriting requirement features, the songwriting reference features, and the target lyrics.

[0104] Optionally, the songwriting requirement features include keywords, emotional information, song genre categories, and lyric content requirements.

[0105] Optionally, the first text includes at least one piece of information such as the habitual words, grammatical structures, and prosodic features of the designated lyricist.

[0106] It should be noted that: when the device for generating lyrics provided in the above embodiments creates lyrics, only the division of the above functional modules is used for illustration. In practical applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device for generating lyrics provided in the above embodiments and the method embodiments for generating lyrics belong to the same concept. For the specific implementation process, please refer to the method embodiments and will not be elaborated here.

[0107] The method for generating lyrics provided in this application can be implemented by a computer device, and the computer device can be a terminal and a server that execute the above method for generating lyrics. Figure 5 It is a schematic diagram of a computer device provided in an embodiment of this application. As Figure 5 shown, the computing device 500 includes: a bus 502, a processor 504, a memory 506, and a communication interface 508. The processor 504, the memory 506, and the communication interface 508 communicate with each other through the bus 502. It should be understood that this application does not limit the number of processors and memories in the computing device 500.

[0108] The bus 502 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 5 only one line is shown in the figure, but it does not mean that there is only one bus or one type of bus. The bus 502 can include a path for transmitting information between various components (for example, the memory 506, the processor 504, and the communication interface 508) of the computing device 500.

[0109] The processor 504 may include any one or more of processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0110] The memory 506 may include volatile memory, such as random access memory (RAM). The memory 506 may also include non-volatile memory, such as read-only memory (ROM), flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0111] The memory 506 stores executable program code, and the processor 504 executes the executable program code, thereby implementing the method for generating lyrics provided by this application.

[0112] The communication interface 508 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 500 and other devices or a communication network.

[0113] The embodiments of this application also provide a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be stored by a computer device or a data storage device such as a data center that contains one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid state drives), etc. The computer-readable storage medium includes instructions for instructing the computing device to implement the method for generating lyrics.

[0114] The embodiments of this application also provide a computer program product. The computer program product includes at least one instruction that can be loaded and executed by a processor to implement the method for generating lyrics in the above embodiments.

[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating lyrics, characterized in that: The method comprises: Get lyric writing instructions and reference lyrics; Extracting a lyric writing style feature of the reference lyrics, wherein the lyric writing style feature includes a first text describing the lyric writing style; Based on the lyric writing instruction information and the lyric writing style features, target lyrics are generated.

2. The method according to claim 1, characterized in that Before generating target lyrics based on the lyrics instruction information and the lyrics style features, the method further includes: Extracting a lyric writing requirement feature of the lyric writing instruction information, wherein the lyric writing requirement feature includes at least one of a keyword and sentiment information; The step of generating target lyrics based on the lyrics instruction information and the lyrics style features includes: The target lyrics are generated based on the lyrics writing requirement features and the lyrics writing style features.

3. The method according to claim 2, characterized in that Before generating target lyrics based on the lyrics instruction information and the lyrics style features, the method further includes: Extracting lyrics reference features of the lyrics requirement features and the lyrics style features, wherein the lyrics reference features include lyrics reference words and a second text describing a lyrics reference direction; The step of generating target lyrics based on the lyrics instruction information and the lyrics style features includes: The target lyrics are generated based on the lyrics writing requirement features and the lyrics writing reference features.

4. The method according to claim 3, characterized in that: The generating the target lyrics based on the lyrics requirement feature and the lyrics reference feature comprises: The target lyrics are generated based on the lyrics writing requirement feature, the lyrics writing reference feature and the reference lyrics.

5. The method according to claim 2, characterized in that: The method further comprises: Based on the lyrics requirement feature, the lyrics reference feature and the target lyrics, lyrics are generated by correcting the target lyrics according to the lyrics instruction information.

6. The method according to any one of claims 2 to 5, characterized in that: The lyrics writing requirement features include keywords, emotional information, song genre categories and lyrics content requirements.

7. The method according to any one of claims 1 to 5, characterized in that: The first text includes at least one piece of information of idiomatic words, grammatical structures, and prosodic features of a designated lyricist.

8. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein the memory is used to store computer instructions; The processor executes the computer instructions stored in the memory to enable the computer device to perform the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program code. When the computer program code is executed by a computer device, the computer device executes the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The computer program product comprises a computer program code. When the computer program code is executed by a computer device, the computer device executes the method according to any one of claims 1 to 7.