Lyric generation method, lyric generation model training method and computer equipment
By obtaining the user's lyrics requirements description text, and using the pre-trained lyrics generation model to generate lyrics requirements keywords and intention guidance keywords, the problem of large differences between lyrics generation and user needs in the prior art is solved, and more accurate lyrics generation is achieved.
Patent Information
- Application Number
- CN202510388002.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-29
AI Technical Summary
The existing artificial intelligence technology generation lyrics method is difficult to accurately extract in-depth themes, emotional tone and specific content requirements, resulting in a large difference between the generated lyrics and user needs.
By obtaining the user's lyrics requirements description text, the pre-trained lyrics generation model is used to generate lyrics requirements keywords and intention guidance keywords, and combining these keywords to generate target lyrics to reduce the difference between generated lyrics and user needs.
It improves the accuracy of lyrics generation, makes the generated lyrics more in line with the user's lyrics needs, and reduces the difference between lyrics and user needs.
Smart Images

Figure CN120387430A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular, to a method for generating lyrics, a method for training a lyrics generation model, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the development of artificial intelligence technology, a technology for generating lyrics using artificial intelligence technology has emerged. When generating lyrics, users can set the lyric features of the lyrics to be generated. For example, users can set the number of words, keywords, themes, styles, etc. of the lyrics to be generated, and then an artificial intelligence model can be used to generate lyrics associated with the above-mentioned lyric features.
[0003] However, in the current methods for generating lyrics using artificial intelligence technology, the artificial intelligence model can only simply follow keywords and basic emotions, and it is difficult to accurately extract in-depth themes, emotional tones, and specific content requirements to generate lyrics. Therefore, in the existing lyrics generation methods, the difference between the generated lyrics and the lyrics required by users is relatively large. Summary of the Invention
[0004] Based on this, in view of the above technical problems, it is necessary to provide a lyrics generation method, device, computer device, computer-readable storage medium, and computer program product that can reduce the difference between the generated lyrics and the lyrics required by users.
[0005] In a first aspect, the present application provides a method for generating lyrics, including:
[0006] Obtaining a lyric writing requirement description text input by a user for the lyrics to be generated;
[0007] Inputting the lyric writing requirement description text into a pre-trained lyrics generation model, and the lyrics generation model performs the following steps: generating lyric writing requirement keywords for the lyrics to be generated according to the lyric writing requirement description text, generating intention guiding keywords for guiding the imagery direction of the lyrics to be generated according to the lyric writing requirement keywords, and generating target lyrics based on the lyric writing requirement keywords and the intention guiding keywords.
[0008] In a second aspect, the present application further provides a method for generating lyrics, including:
[0009] Displaying a lyrics generation interface, where the lyrics generation interface includes a first text input control;
[0010] Obtaining a lyric writing requirement description text input by a user for the lyrics to be generated through the first text input control;
[0011] Input the lyric-writing requirement description text into a pre-trained lyric generation model to call the lyric generation model to generate lyric-writing requirement keywords for the to-be-generated lyrics according to the lyric-writing requirement description text, and generate intention guidance keywords for guiding the imagery direction of the to-be-generated lyrics according to the lyric-writing requirement keywords, and generate target lyrics based on the lyric-writing requirement keywords and the intention guidance keywords;
[0012] Display the target lyrics on the lyric generation interface.
[0013] In a third aspect, the present application also provides a training method for a lyric generation model, including:
[0014] Obtain a sample lyric-writing requirement description text and a sample lyric that matches the sample lyric-writing requirement description text;
[0015] Use a pre-trained large language model as the lyric generation model to be trained, and train the lyric generation model through the sample lyric-writing requirement description text and the sample lyric to obtain a pre-trained lyric generation model.
[0016] In a fourth aspect, the present application also provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the method described in any embodiment of the first aspect, the second aspect, or the third aspect.
[0017] In a fifth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the method described in any embodiment of the first aspect, the second aspect, or the third aspect.
[0018] In a sixth aspect, the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the steps of the method described in any embodiment of the first aspect, the second aspect, or the third aspect.
[0019] The above-mentioned lyric generation method, device, computer device, computer-readable storage medium and computer program product obtain a text description of the lyric-writing requirements input by the user for the lyric to be generated; input the text description of the lyric-writing requirements into a pre-trained lyric generation model, and the lyric generation model performs the following steps: generate keyword descriptions of the lyric-writing requirements for the lyric to be generated according to the text description of the lyric-writing requirements, generate intention guiding keywords for guiding the imagery direction of the lyric to be generated according to the keyword descriptions of the lyric-writing requirements, and generate target lyrics based on the keyword descriptions of the lyric-writing requirements and the intention guiding keywords. In this application, the user can input a text description of the lyric-writing requirements for the lyric to be generated, and then input the text description of the lyric-writing requirements into a pre-trained lyric generation model. The lyric generation model generates keyword descriptions of the lyric-writing requirements for the lyric to be generated, and further obtains intention guiding keywords, so as to generate target lyrics by using the intention guiding keywords and the keyword descriptions of the lyric-writing requirements. In this way, the lyric generation model can extract the lyric-writing requirements from the text description of the lyric-writing requirements input by the user, and further generate lyrics based on the lyric-writing requirements, thereby reducing the degree of difference between the generated lyrics and the lyrics required by the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required to be used in the description of the embodiments of the present application or related technologies. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1 It is a flowchart of the lyric generation method in an embodiment;
[0022] Figure 2 It is a flowchart of the lyric generation method in another embodiment;
[0023] Figure 3 It is a flowchart of the training method of the lyric generation model in an embodiment;
[0024] Figure 4 It is a schematic diagram of the interaction interface of the conversational lyric generation system in an embodiment;
[0025] Figure 5 It is a flowchart of the working process of the conversational lyric generation system in an embodiment;
[0026] Figure 6 It is a structural block diagram of the lyric generation device in an embodiment;
[0027] Figure 7 It is a structural block diagram of the lyric generation device in another embodiment;
[0028] Figure 8 is a structural block diagram of a training device for a lyric generation model in an embodiment;
[0029] Figure 9 is an internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0030] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] In an embodiment, as Figure 1 shown, a lyric generation method is provided. In this embodiment, an example is given where this method is applied to a terminal. It can be understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0032] Step S101, obtain a text description of the lyric-writing requirement input by the user for the lyric to be generated.
[0033] Among them, the text description of the lyric-writing requirement refers to the text information input by the user for describing the lyric-writing requirement, and the lyric to be generated is the lyric that needs to be generated. Specifically, when the user needs to generate a lyric, the user can input the text representing the lyric-writing requirement through the lyric generation page displayed by the terminal as the text description of the lyric-writing requirement, and then the terminal can obtain the text description of the lyric-writing requirement input by the user.
[0034] For example, if the user needs to generate a lyric about graduation, the user can input the text description of "write a song about the graduation season" in the lyric generation page displayed by the terminal to represent that the user's lyric-writing requirement for the lyric to be generated is a lyric about the graduation season.
[0035] Step S102, input the text description of the lyric-writing requirement into a pre-trained lyric generation model, and the lyric generation model performs the following steps: generate a keyword of the lyric-writing requirement for the lyric to be generated according to the text description of the lyric-writing requirement, generate an intention guiding keyword for guiding the imagery direction of the lyric to be generated according to the keyword of the lyric-writing requirement, and generate a target lyric based on the keyword of the lyric-writing requirement and the intention guiding keyword.
[0036] The lyrics generation model is an artificially intelligent model pre-trained for generating lyrics, while the keyword of the songwriting requirement refers to the user's songwriting requirement for the lyrics to be generated obtained by the lyrics generation model through analyzing the text describing the songwriting requirement. For example, it may include the genre requirement of the lyrics required by the user, such as classical, pop, etc., the emotional tone required by the user, such as positive, sad, etc., the rhyme required by the user, the inspiration description and content requirement for the lyrics to be generated, etc.
[0037] Specifically, the lyrics generation model can be used to identify the keyword of the songwriting requirement for the lyrics to be generated according to the text describing the songwriting requirement input by the user. For example, when the user inputs the text description "Write a song about graduation season, and it is required to include 'time machine'", the terminal can identify through the lyrics generation model that the genre requirement of the lyrics is pop, the emotional tone requirement is positive, the rhyme requirement is ang, the inspiration description is "Recall the beautiful campus time, cherish friendship and teachers' kindness; be reluctant to part, look forward to the future", and the content requirement is "The lyrics include: time machine".
[0038] The intention guiding keyword is a keyword used to guide the imagery direction for the lyrics generation model to generate lyrics. For example, it can be the imagery description information for the lyrics to be generated. After obtaining the keyword of the songwriting requirement, the lyrics generation model can further obtain the intention guiding keyword for guiding the imagery direction of the lyrics to be generated based on the generated keyword of the songwriting requirement. For example, for the text description "Write a song about graduation season, and it is required to include 'time machine'", the generated intention guiding keywords can include: time machine, youth, classmates, dreams, textbooks, bell, etc. The above intention guiding keywords can be generated by the lyrics generation model based on the analyzed keyword of the songwriting requirement.
[0039] Specifically, after obtaining the keyword of the songwriting requirement, the lyrics generation model can further generate the intention guiding keyword based on the keyword of the songwriting requirement, so as to combine the analyzed keyword of the songwriting requirement and the generated intention guiding keyword to generate the final target lyrics.
[0040] In the embodiment of this application, the user can input the text description of the songwriting requirement for the lyrics to be generated, and then input the text description of the songwriting requirement into the pre-trained lyrics generation model. The lyrics generation model generates the keyword of the songwriting requirement for the lyrics to be generated, and further obtains the intention guiding keyword, so as to use the intention guiding keyword and the keyword of the songwriting requirement to generate the target lyrics. Through this method, the lyrics generation model can extract the songwriting requirement from the text description of the songwriting requirement input by the user, and further generate lyrics based on the songwriting requirement, thereby reducing the degree of difference between the generated lyrics and the lyrics required by the user.
[0041] In one embodiment, Figure 2 As shown, before step S102, the method may further include: in response to the user's selection operation on the displayed lyrics requirement option, obtaining lyrics requirement option information corresponding to the selected lyrics requirement option, and inputting the lyrics requirement option information into the lyrics generation model.
[0042] The lyrics requirement option information refers to the option information represented by the lyrics requirement option selected by the user. In this embodiment, when the user initiates a request to generate lyrics, in addition to entering the lyrics requirement description text on the interface, the user can also select some lyrics requirement options on the interface. For example, the user can select the song genre, emotional tone and rhyme, etc. After that, the terminal can obtain the lyrics requirement option information corresponding to the lyrics requirement option selected by the user, and input the lyrics requirement option information and the lyrics requirement description text into the lyrics generation model.
[0043] Step S102 may further include: adding the lyrics writing requirement description text and lyrics writing requirement option information to a preset prompt word template to generate prompt word information; and generating lyrics writing requirement keywords for the lyrics to be generated based on the prompt word information.
[0044] The prompt word information refers to the prompt word used by the lyrics generation model to generate the lyrics requirement keywords for the lyrics to be generated. The prompt word can be obtained based on a pre-set prompt word template. In this embodiment, after the lyrics generation model receives the input of the lyrics requirement description text and the lyrics requirement option information, it can add the lyrics requirement description text and the lyrics requirement option information to the prompt word template pre-set by the lyrics generation model to obtain the prompt word information, and then generate the lyrics requirement keywords for the lyrics to be generated based on the prompt word information.
[0045] Alternatively, in one implementation, the lyrics requirement description text and lyrics requirement option information can be added to a pre-set prompt word template to generate prompt word information, and then the prompt word information is input into the lyrics generation model, and the lyrics generation model generates the lyrics requirement keywords for the lyrics to be generated based on the instructions of the prompt word.
[0046] For example, the lyrics requirement options selected by the user may be that the user selects the "popular" genre, selects the "positive" sentiment, and <ang>"Rhyme, the input lyric-writing requirement description text can be: "Write a song about graduation season, which is required to include 'time machine'". If the prompt template used by the lyric generation model is "You are an artist of lyric creation, and are good at creating lyrics according to user requirements. Your current task is to analyze the [genre requirements], [emotional tone], [rhyme requirements], [inspiration description], and [content requirements] for lyric creation based on the [lyric genre], [emotional tone], [rhyme], and [inspiration description] input by the user." Then "pop", "positive", and " <ang>", fill in the [Lyrics Genre], [Emotional Tone], and [Rhyme] in the prompt word template respectively, and fill in "Write a song about graduation season, which must include 'time machine'" in the [Inspiration Description] of the prompt word template to obtain the prompt word information, and then use the prompt word information to generate the lyrics writing requirement keywords (i.e. genre requirements, emotional tone requirements, rhyme requirements, inspiration description and content requirements) for the lyrics to be generated.
[0047] In addition, the output lyrics requirement keywords for the lyrics to be generated are prioritized to be adapted to the lyrics requirement description text input by the user. If the lyrics requirement option information selected by the user does not match the lyrics requirement description text, for example, when the user selects "negative" emotion and it does not match the "positive" emotional tone of the lyrics requirement description text, the emotional tone in the output lyrics requirement keywords can also be "positive" emotion.
[0048] In this embodiment, when a user initiates a lyrics generation request for generating lyrics to be generated, in addition to entering a lyrics requirement description text for describing the lyrics to be generated, the user can also select a lyrics requirement option to input lyrics requirement option information. Compared to only entering the lyrics requirement description text, this method can improve the prompt word information for generating lyrics requirement keywords, thereby improving the accuracy of generated lyrics.
[0049] Furthermore, the prompt word information includes role information and task information; step S203 may further include: extracting lyrics requirement description text and lyrics requirement option information from the task information, using the role represented by the role information to perform the task of generating lyrics requirement keywords using the lyrics requirement description text and lyrics requirement option information, thereby obtaining lyrics requirement keywords.
[0050] In this embodiment, the prompt word template can include two parts, a role template and a task template, where the role template can be: "You are a lyricist artist who is good at composing lyrics according to user needs.", and the task template can be: "Your current task is to analyze the [genre requirements], [emotional tone], [rhyme] and [inspiration description] of lyric creation based on the [lyrics genre], [emotional tone], [rhyme requirements], [inspiration description] and [content requirements]." The terminal adds the lyrics requirement description text and lyrics requirement option information to the pre-set prompt word template, which can refer to the task template added to the prompt word template to generate prompt word information.
[0051] After that, when generating the keyword requirements for lyric writing, it is possible to perform the task information according to the role characterized by the role information, that is, to extract the text description of the lyric writing requirement input by the user and the option information of the lyric writing requirement from the task information, and perform the task of generating the keyword requirements for lyric writing by using the above input information. That is, according to the [lyric genre], [emotional tone], [rhyme], and [inspiration description] input by the user, generate keyword requirements for lyric writing such as [genre requirement], [emotional tone], [rhyme requirement], [inspiration description], and [content requirement].
[0052] In this embodiment, the generated prompt word information may include role information and task information, so that the role characterized by the role information can be used to extract the text description of the lyric writing requirement and the option information of the lyric writing requirement from the task information to generate the keyword requirements for lyric writing. In this way, the accuracy of the keyword requirements for lyric writing can be improved.
[0053] In one embodiment, after step S102, it may further include: when receiving the modified opinion text of the user for the target lyric, using the keyword requirements for lyric writing, the intention guiding keyword, and the modified opinion text to correct the target lyric to obtain the corrected target lyric; selecting from the target lyric and the corrected target lyric to obtain the lyric that the user expects to generate.
[0054] The modified opinion text may refer to the text description of the modified opinion input by the user for the generated target lyric. In this embodiment, after the terminal generates the target lyric, it may also display the target lyric on the terminal and allow the user to modify the generated target lyric. For example, the user can modify the generated target lyric by inputting the modified opinion text.
[0055] Specifically, if the user has a modified opinion for the generated target lyric, the modified opinion text can be input in the form of a dialogue interaction. At this time, the terminal can input the intention guiding keyword, the keyword requirements for lyric writing, the modified opinion text input by the user, and the generated target lyric into the lyric generation model, and the lyric generation model uses the intention guiding keyword, the keyword requirements for lyric writing, and the modified opinion text to correct the generated target lyric as the corrected target lyric.
[0056] For example, after the terminal generates the first version of the lyric, the user can also input the modified opinion text for the first version of the lyric, which can be "required to be more literary and the words used are more beautiful". At this time, the terminal can further combine the above modified opinion text to correct the currently generated lyric as the corrected target lyric.
[0057] The lyrics expected to be generated by the user refer to the lyrics expected to be generated by the end user. Since there can be multiple versions of the generated lyrics, the user can also select one of the lyric versions as the lyrics of the final version, that is, the lyrics expected to be generated by the user.
[0058] Specifically, the terminal can display the corrected target lyrics and the initial version of the target lyrics, and detect whether the user inputs a modification opinion text for the corrected target lyrics again. If the modification opinion text input by the user is still detected, the target lyrics are updated again until the user does not input a modification opinion text for the target lyrics. The terminal can display the generated target lyrics of each version, and the user can select from the displayed target lyrics of each version. Thus, after receiving the selection operation of the user for the displayed target lyrics of each version, the selected target lyrics are used as the lyrics expected to be generated by the user.
[0059] For example, after the lyric generation module generates the lyrics corresponding to version 1, if the user inputs a modification opinion text for the lyrics of version 1, the terminal can receive the above modification opinion text through the lyric writing interaction module, so as to correct the lyrics of version 1 to obtain the lyrics of version 2. At this time, the terminal can detect again whether the user inputs a further modification opinion text for the lyrics of version 2. If so, the lyrics of version 3 can be generated until the user does not input a modification opinion. Then the terminal can display the lyrics of version 1, version 2, and version 3 for the user to select. If the user selects the lyrics of version 3, then the terminal can use the lyrics of version 3 as the lyrics expected to be generated by the user.
[0060] In this embodiment, when receiving the modification opinion text of the user for the target lyrics, the lyric generation model can also correct the target lyrics and display multiple target lyrics. In this way, the user can correct the lyrics through an interactive dialogue, and the most suitable lyrics can be screened out as the lyrics expected to be generated by the user. Therefore, on the premise of ensuring the efficiency and accuracy of lyric correction, it can be further ensured that the generated lyrics can best meet the needs of the user.
[0061] In one embodiment, after step S102, it may further include: displaying an intention guiding keyword; in response to the user's modification operation for the displayed intention guiding keyword, obtaining the modified intention guiding keyword; inputting the modified intention guiding keyword into the lyric generation model to call the lyric generation model to generate new lyrics based on the modified intention guiding keyword and the lyric writing requirement keyword; and selecting the lyrics expected to be generated by the user from the target lyrics and the new lyrics.
[0062] In this embodiment, after the terminal generates the intention guiding keywords through the lyrics generation model, it can also display the intention guiding keywords on the display interface. At this time, the user can also trigger a modification operation on the displayed intention guiding keywords to correct the intention guiding keywords. Then, the terminal can use the modified intention guiding keywords and the songwriting requirement keywords to generate new lyrics. For example, the corrected intention guiding keywords and the songwriting requirement keywords can be input into the lyrics generation model to generate new lyrics again and display them together with the target lyrics. Then, the user can select one of the displayed new lyrics and the target lyrics as the lyrics that the user finally expects to generate.
[0063] In this embodiment, after generating the intention guiding keywords, the intention guiding keywords can also be displayed, so that the user can perform a modification operation on the displayed intention guiding keywords to generate new lyrics. In this way, the diversity of the lyrics generation function can be further improved.
[0064] In one embodiment, as Figure 2 shown, a lyrics generation method is also provided. In this embodiment, this method is exemplified by being applied to a terminal. In this embodiment, the method includes the following steps:
[0065] Step S201, display a lyrics generation interface, where the lyrics generation interface includes a first text input control;
[0066] Step S202, obtain the songwriting requirement description text for the lyrics to be generated input by the user through the first text input control.
[0067] The lyrics generation interface is a display interface for the user to initiate a lyrics generation request, and the first text input control is a control in the lyrics generation interface for inputting the songwriting requirement description text. This control can be a certain text input box. Specifically, the user can initiate a lyrics generation request through the lyrics generation interface, and this interface can include a first text input control for inputting the songwriting requirement description text. The user can input the songwriting requirement description text for the lyrics to be generated in the first text input control, so that the terminal can obtain this songwriting requirement description text.
[0068] Step S203, input the songwriting requirement description text into a pre-trained lyrics generation model to call the lyrics generation model to generate the songwriting requirement keywords for the lyrics to be generated according to the songwriting requirement description text, and generate intention guiding keywords for guiding the imagery direction of the lyrics to be generated according to the songwriting requirement keywords, and generate target lyrics based on the songwriting requirement keywords and the intention guiding keywords;
[0069] Step S204, display the target lyrics on the lyrics generation interface.
[0070] After obtaining the lyric-writing requirement description text, the terminal can further input the lyric-writing requirement description text into a pre-trained lyric generation model. The model can generate lyric-writing requirement keywords for the to-be-generated lyrics based on the lyric-writing requirement description text, and then generate intention guiding keywords for guiding the imagery direction of the to-be-generated lyrics based on the lyric-writing requirement keywords, so as to generate target lyrics based on the lyric-writing requirement keywords and the intention guiding keywords. Finally, the terminal can display the generated target lyrics in the lyric generation interface.
[0071] In this embodiment, by displaying a lyric generation interface including a first text input control, the user can input a lyric-writing requirement description text for the to-be-generated lyrics in the lyric generation interface, so as to input the lyric-writing requirement description text into the pre-trained lyric generation model to obtain target lyrics and display them in the lyric generation interface. In this way, the lyric generation model can generate lyrics from the lyric-writing requirement description text input by the user, thereby reducing the difference degree between the generated lyrics and the lyrics required by the user.
[0072] Furthermore, the lyric generation interface further includes a second text input control; after step S204, it may further include: inputting the modification opinion text into the lyric generation model to obtain the corrected target lyrics obtained by the lyric generation model correcting the target lyrics according to the modification opinion text; displaying the target lyrics and the corrected target lyrics through the lyric generation interface; in response to the user's selection operation on the displayed target lyrics and the corrected target lyrics, taking the selected lyrics as the lyrics expected to be generated by the user.
[0073] The second text input control is a control for the user to input the modification opinion text. Similar to the first text input control, this control can also be a certain text input box. After the terminal generates the target lyrics and displays them in the lyric generation interface, it can also allow the user to modify the generated target lyrics. For example, the user can modify the generated target lyrics by inputting the modification opinion text, and the modification opinion text can be input in the second text input control.
[0074] Specifically, if the user has a modification opinion on the generated target lyrics, the user can input the modification opinion text through the second text input control included in the lyric generation interface. Then the terminal can input the modification opinion text into the lyric generation model to correct the target lyrics according to the modification opinion text, so as to obtain the corrected target lyrics. And the terminal can also display the target lyrics and the corrected target lyrics in the lyric generation interface at the same time for the user to select. When the user selects a certain target lyric, the terminal can take it as the finally user-expected generated lyric.
[0075] In this embodiment, a second text input control can also be provided in the lyrics generation interface for users to input modification opinion text to implement the correction of target lyrics, and multiple target lyrics can be displayed. In this way, users can correct lyrics through interactive dialogue and filter out the most suitable lyrics as the lyrics that users expect to generate. Therefore, under the premise of ensuring the efficiency and accuracy of lyrics correction, it can be further ensured that the generated lyrics can best meet the needs of users.
[0076] In addition, lyrics requirement options are displayed in the lyrics generation interface; step S203 may further include: in response to the user's selection operation on the displayed lyrics requirement option, obtaining lyrics requirement option information corresponding to the selected lyrics requirement option; inputting the lyrics requirement description text and the lyrics requirement option information into the lyrics generation model to obtain the target lyrics generated by the lyrics generation model according to the lyrics requirement description text and the lyrics requirement option information.
[0077] The lyrics requirement option is an option control provided to the user in the lyrics generation interface for selecting lyrics requirements. In this embodiment, in addition to the first text input control for the user to input the lyrics requirement description text, the lyrics generation interface can also include a lyrics requirement option to further assist the user in inputting the lyrics requirements for the lyrics to be generated.
[0078] Specifically, when a user initiates a lyric generation request, they can also select a lyric requirement option provided in the lyric generation interface, so that the terminal can obtain the lyric requirement option information represented by the lyric requirement option selected by the user. The terminal can then further input the lyric requirement option information and the lyric requirement description text into the lyric generation model, so that the lyric generation model can generate target lyrics based on the lyric requirement description text and the lyric requirement option information.
[0079] In this embodiment, a lyrics requirement option can also be provided in the lyrics generation interface for the user to select so that the terminal can obtain the lyrics requirement option information. The terminal can then obtain the target lyrics generated using the lyrics requirement option information and the lyrics requirement description text. In this way, the accuracy of the generated lyrics can be improved.
[0080] In one embodiment, after step S204, the method may also include: displaying intention-guiding keywords in the intention-guiding word display area of the lyrics generation interface, and obtaining the modified intention-guiding keywords input by the user through the intention-guiding word display area; calling the lyrics generation model to generate new lyrics based on the modified intention-guiding keywords and the lyrics requirement keywords; displaying the new lyrics in the lyrics generation interface; and in response to the user's selection operation for the displayed target lyrics and the new lyrics, using the selected lyrics as the lyrics that the user expects to generate.
[0081] In this embodiment, the lyrics generation interface may further include an intention guiding word display area, which can be used to display intention guiding keywords that guide the imagery direction of the target lyrics. The intention guiding keywords can be generated by the lyrics generation model based on the text description of the lyrics writing requirements. For example, the lyrics writing requirement keywords can be first generated from the text description of the lyrics writing requirements, and then the intention guiding keywords can be generated based on the lyrics writing requirement keywords.
[0082] Specifically, after the terminal inputs the text description of the lyrics writing requirements into the lyrics generation model, the lyrics generation model can first generate intention guiding keywords, and then generate the target lyrics based on the intention guiding keywords. During this process, the generated intention guiding keywords can be displayed in the intention guiding word display area of the lyrics generation interface. At this time, the user can also trigger a modification operation on the displayed intention guiding keywords, so as to correct the intention guiding keywords through the intention guiding word display area. The terminal can then use the modified intention guiding keywords to generate new lyrics and display the new lyrics and the target lyrics together. Then the user can select one of the displayed new lyrics and the target lyrics as the lyrics that the user finally expects to generate.
[0083] In this embodiment, after generating the intention guiding keywords, the intention guiding keywords can also be displayed, so that the user can perform a modification operation on the displayed intention guiding keywords to generate new lyrics. In this way, the diversity of the lyrics generation function can be further improved.
[0084] In one embodiment, as Figure 3 shown, a training method for a lyrics generation model is also provided. In this embodiment, this method is exemplified by being applied to a terminal. In this embodiment, the method includes the following steps:
[0085] Step S301, obtain a sample text description of lyrics writing requirements and a sample lyrics that matches the sample text description of lyrics writing requirements.
[0086] Among them, the sample text description of lyrics writing requirements refers to the text description of lyrics writing requirements used for training the lyrics generation model, and the sample lyrics are the lyrics used for training the lyrics generation model. The sample text description of lyrics writing requirements can be used to describe the lyrics writing requirements for the sample lyrics.
[0087] Specifically, when training the lyrics generation model, training data needs to be collected first. The training data can include the sample text description of lyrics writing requirements and the sample lyrics that match the sample text description of lyrics writing requirements.
[0088] Step S302, use the pre-trained large language model as the lyrics generation model to be trained, and train the lyrics generation model through the sample text description of lyrics writing requirements and the sample lyrics to obtain the pre-trained lyrics generation model.
[0089] The pre-trained large language model can be the pre-trained Llama2 model. In this embodiment, the pre-trained large language model can be used as the infrastructure model for model training, and the collected sample lyric-writing requirement description texts and sample lyrics can be further used to further train the large language model, so that the large language model can realize the function of lyric generation, and thus the pre-trained lyric generation model can be obtained.
[0090] In the training method of the above lyric generation model, the sample lyric-writing requirement description text and the sample lyrics matching the sample lyric-writing requirement description text are obtained; the pre-trained large language model is used as the lyric generation model to be trained, and the lyric generation model is trained through the sample lyric-writing requirement description text and the sample lyrics to obtain the pre-trained lyric generation model. In this embodiment, the training method of the lyric generation model can be to first collect the sample lyric-writing requirement description text and the sample lyrics, and use the pre-trained large language model as the infrastructure model, so as to use the sample lyric-writing requirement description text and the sample lyrics to train the pre-trained large language model, so that the large language model can realize the function of lyric generation. Through this method, the infrastructure of the large language model can be fully utilized to realize the generation of personalized lyrics, and the accuracy of the lyrics output by the lyric generation model is further improved.
[0091] Further, the lyric generation model includes: an instruction analysis module and a lyric generation module; the lyric generation module includes a first sub-module and a second sub-module; step S402 can further include:
[0092] Obtain the preset lyric-writing requirement keywords and preset intention guiding keywords matching the sample lyrics.
[0093] Among them, the preset lyric-writing requirement keywords refer to the real lyric-writing requirement keywords matching the sample lyrics, and the preset intention guiding keywords are the real intention guiding keywords matching the sample lyrics. In this embodiment, the lyric generation model can include two parts, namely an instruction analysis module and a lyric generation module. The instruction analysis module is mainly used to execute the task of converting the lyric-writing requirement description text into lyric-writing requirement keywords, and the lyric generation module is mainly used to execute the following two tasks: the task of generating intention guiding keywords according to the lyric-writing requirement keywords, and the task of generating lyrics based on the intention guiding keywords. Therefore, when training the lyric generation model, in addition to collecting the sample lyric-writing requirement description text and the sample lyrics, it is also necessary to collect the preset lyric-writing requirement keywords and preset intention guiding keywords matching the sample lyrics.
[0094] Input the sample lyric-writing requirement description text into the instruction analysis module to obtain the first predicted lyric-writing requirement keyword. Based on the difference between the first predicted lyric-writing requirement keyword and the preset lyric-writing requirement keyword, train the instruction analysis module to obtain a trained instruction analysis module.
[0095] Since the lyric generation model needs to perform multiple tasks, namely task 1 of converting the lyric-writing requirement description text into lyric-writing requirement keywords, task 2 of generating intention guiding keywords based on the lyric-writing requirement keywords, and task 3 of generating lyrics based on the intention guiding keywords. Therefore, when training the model, each task can also be trained in sequence. The trained instruction analysis module refers to the instruction analysis module after completing the training of task 1, and the first predicted lyric-writing requirement keyword is the predicted lyric-writing requirement keyword output by the instruction analysis module when performing the training of task 1.
[0096] Specifically, when training task 1, the terminal can first input the sample lyric-writing requirement description text into the instruction analysis module, and the instruction analysis module outputs the first predicted lyric-writing requirement keyword. Then, based on the difference between the first predicted lyric-writing requirement keyword and the preset lyric-writing requirement keyword, train the instruction analysis module to complete the training of task 1 and obtain a trained instruction analysis module.
[0097] Input the preset lyric-writing requirement keyword into the first sub-module of the lyric generation module to obtain the first predicted intention guiding keyword. Based on the difference between the first predicted intention guiding keyword and the preset intention guiding keyword, train the first sub-module to obtain a trained first sub-module.
[0098] The first sub-module is the module in the lyric generation module for performing task 2. The trained first sub-module refers to the first sub-module after completing the training of task 2, and the first predicted intention guiding keyword is the predicted intention guiding keyword output by the first sub-module when performing the training of task 2.
[0099] Similarly, when training task 2, the terminal can first input the preset lyric-writing requirement keyword into the first sub-module of the lyric generation module, and the first sub-module outputs the first predicted intention guiding keyword information. Then, based on the difference between the first predicted intention guiding keyword information and the preset intention guiding keyword, train the first sub-module to complete the training of task 2 and obtain a trained first sub-module.
[0100] Input the preset intention guiding keyword and the preset lyric-writing requirement keyword into the second sub-module of the lyric generation module to obtain the first predicted lyric. Based on the difference between the first predicted lyric and the sample lyric, train the second sub-module to obtain a trained second sub-module.
[0101] The second sub-module is the module in the lyric generation module for executing Task 3. The trained second sub-module refers to the second sub-module after completing the training of Task 3. The first predicted lyric is the predicted lyric output by the second sub-module during the training of Task 3.
[0102] Similarly, when training Task 3, the terminal can first input the preset intention guiding keyword and the preset lyric writing requirement keyword into the second sub-module of the lyric generation module. The second sub-module outputs the first predicted lyric, and then the second sub-module can be trained according to the difference between the first predicted lyric and the sample lyric to complete the training of Task 3 and obtain the trained second sub-module.
[0103] Based on the trained instruction analysis module, the trained first sub-module, and the trained second sub-module, a pre-trained lyric generation model is obtained.
[0104] After obtaining the trained instruction analysis module, the trained first sub-module, and the trained second sub-module, the terminal can further obtain a pre-trained lyric generation model based on the trained instruction analysis module, the trained first sub-module, and the trained second sub-module.
[0105] In this embodiment, the preset lyric writing requirement keyword and the preset intention guiding keyword matching the sample lyric can also be obtained, so as to train different tasks in the lyric generation process, and respectively obtain the trained instruction analysis module, the trained first sub-module, and the trained second sub-module. Then, a pre-trained lyric generation model is obtained according to the above-mentioned trained instruction analysis module, trained first sub-module, and trained second sub-module. Through this embodiment, the training efficiency of the lyric generation model can be improved.
[0106] In addition, the lyric generation model further includes: a lyric writing interaction module; Step S405 can further include: obtaining the sample modification opinion text corresponding to the sample lyric and the actual corrected lyric matching the sample modification opinion text; inputting the sample modification opinion text and the sample lyric into the lyric writing interaction module to obtain the first predicted corrected lyric, and training the lyric writing interaction module according to the difference between the first predicted corrected lyric and the actual corrected lyric to obtain the trained lyric writing interaction module; obtaining a pre-trained lyric generation model according to the trained instruction analysis module, the trained first sub-module, the trained second sub-module, and the trained lyric writing interaction module.
[0107] In this embodiment, the lyric generation model may further include a lyric-writing interaction module, which is mainly used to complete Task 4 of correcting lyrics based on the modification opinion text for use. When training Task 4, it is necessary to collect the modification opinion text corresponding to the sample lyrics as the sample modification opinion text, and the actual corrected lyrics obtained by correcting the sample lyrics after being modified by the sample modification opinion text. Specifically, when training the lyric-writing interaction module in the lyric generation model for completing Task 4, the terminal needs to first collect the sample modification opinion text corresponding to the sample lyrics and the actual corrected lyrics matched by the sample modification opinion text.
[0108] The trained lyric-writing interaction module refers to the lyric-writing interaction module after completing the training of Task 4. The first predicted corrected lyrics are the corrected lyrics output by the lyric-writing interaction module based on the sample modification opinion text during the training of Task 4. Specifically, when training Task 4, the terminal can input the sample modification opinion text and the sample lyrics into the lyric-writing interaction module, and the lyric-writing interaction module outputs the first predicted corrected lyrics. Then, according to the difference between the first predicted corrected lyrics and the actual corrected lyrics, the lyric-writing interaction module can be trained to complete the training of Task 4 and obtain the trained lyric-writing interaction module.
[0109] Finally, after obtaining the trained instruction analysis module, the trained first sub-module, the trained second sub-module, and the trained lyric-writing interaction module, the training of the lyric generation model can be completed according to the above-mentioned trained instruction analysis module, trained first sub-module, trained second sub-module, and trained lyric-writing interaction module.
[0110] In this embodiment, the lyric generation model may further include a lyric-writing interaction module, so that the task of correcting lyrics using the modification opinion text can be trained. In this way, the lyric generation model can be made to have the function of interacting with the user's dialogue text to correct lyrics, further improving the accuracy of the lyrics generated by the lyric generation model.
[0111] Further, according to the trained instruction analysis module, the trained first sub-module, the trained second sub-module, and the trained lyric writing interaction module, a pre-trained lyric generation model can be obtained, which can further include: inputting the sample lyric writing requirement description text into the trained instruction analysis module to obtain the second predicted lyric writing requirement keywords; inputting the second predicted lyric writing requirement keywords into the trained first sub-module to obtain the second predicted intention guiding keywords, and inputting the second predicted intention guiding keywords into the trained second sub-module to obtain the second predicted lyrics; inputting the second predicted lyrics and the sample modification opinion text into the trained lyric writing interaction module to obtain the second predicted revised lyrics; according to the differences between the second predicted lyric writing requirement keywords and the preset lyric writing requirement keywords, the differences between the second predicted intention guiding keywords and the preset intention guiding keywords, the differences between the second predicted lyrics and the sample lyrics, and the differences between the second predicted revised lyrics and the actual revised lyrics, re-training the trained instruction analysis module, the trained first sub-module, the trained second sub-module, and the trained lyric writing interaction module to obtain the pre-trained lyric generation model.
[0112] Among them, the second predicted lyric writing requirement keywords are the predicted lyric writing requirement keywords output by the trained instruction analysis module, the second predicted intention guiding keywords are the predicted intention guiding keywords output by the trained first sub-module, the second predicted lyrics are the predictions output by the trained second sub-module, and the second predicted revised lyrics are the predicted revised lyrics output by the trained lyric writing interaction module. In this embodiment, after the individual training of each task is completed, a stage of mixed training is also required.
[0113] Specifically, the terminal can input the sample lyric writing requirement description text into the trained instruction analysis module to obtain the second predicted lyric writing requirement keywords, then input the second predicted lyric writing requirement keywords into the trained first sub-module to obtain the second predicted intention guiding keywords, and input the second predicted intention guiding keywords and the second predicted lyric writing requirement keywords into the trained second sub-module to obtain the second predicted lyrics, and finally input the second predicted lyrics and the sample modification opinion text into the trained lyric writing interaction module to obtain the second predicted revised lyrics.
[0114] After that, the differences between the second predicted lyric writing requirement keywords and the preset lyric writing requirement keywords, the differences between the second predicted intention guiding keywords and the preset intention guiding keywords, the differences between the second predicted lyrics and the sample lyrics, and the differences between the second predicted revised lyrics and the actual revised lyrics can be calculated respectively, and the above-mentioned differences are used to overall train the trained instruction analysis module, the trained first sub-module, the trained second sub-module, and the trained lyric writing interaction module, so as to obtain the pre-trained lyric generation model.
[0115] In this embodiment, after the separate training of sub-tasks is completed, there is also a stage of hybrid training. Through this training method, the accuracy of the lyrics output by the model can be further improved on the premise of ensuring the training efficiency of the model.
[0116] In one embodiment, a conversational lyric generation method and device are also provided. After the user generates lyrics using multi-dimensional lyric writing elements, they can continue to use conversational interaction to modify and polish the lyric content, and iteratively generate one or more lyrics that meet the user's requirements. The core innovation is to implement the process of conversational interaction and customized lyric writing through a large lyric writing model. The three modules that work together are as follows:
[0117] Instruction analysis module: Provide the user with a flexible way to input lyric writing requirements and related preset elements in a structured or free text manner. Support the user to select the song genre, emotional tone, and rhyme scheme, and at the same time, the user can input a description of lyric writing inspiration; analyze the user input to obtain the song genre, emotional tone, and rhyme scheme of the lyric writing, and understand the inspiration description to analyze the lyric writing inspiration explanation and content requirements.
[0118] Lyric generation module: Based on the lyric writing elements extracted and analyzed by the processing module, first understand and expand to generate imagery words related to the current lyric writing requirements, and then generate initial lyrics based on the above elements. All elements of the lyrics are explicitly displayed, supporting the user to modify and adjust, and then regenerate the lyrics.
[0119] Lyric writing interaction module: Based on the initial lyrics generated by the generation module, the user can put forward modification suggestions for the lyric content and modify and iterate the lyrics through text interaction, supporting overall adjustment and fine-grained adjustment. When interacting and modifying the lyrics, the user can save the lyric version that they think is more satisfactory in the output module. Finally, after the interaction is completed, compare the saved versions in the output module, select one or more lyrics for output, and at the same time, it also supports the user to edit the final lyrics.
[0120] This embodiment can be applied to lyric writing assistant tools on the web or mobile side. The schematic diagram of its interaction interface is as Figure 4 shown. First, the user inputs lyric writing elements in the A lyric writing instruction area, and an initial version of the lyrics is output in the B lyric writing interaction area according to the lyric writing elements input by the user and the expanded imagery. In addition, the user can edit and adjust the lyric writing elements in the lyric writing instruction area to regenerate the initial version of the lyrics. After obtaining a more satisfactory initial version of the lyrics, the user can continue to put forward modification suggestions for the lyric content in the lyric writing interaction area, and the adjusted lyrics are output according to the user's modification opinions. During the interaction process, the user can save the satisfactory lyric version in real time in the C lyric output area, and finally, operations such as editing, copying, and saving the saved lyric content can be performed.
[0121] The conversational lyric generation system provided in this embodiment may include three modules: an instruction analysis module, a lyric generation module, and a lyricist interaction module. As Figure 5 shown, it may specifically include the following functions:
[0122] 1. Instruction analysis module: Provide users with the option to input lyric writing requirements in a structured or free-text manner. Specific functions include:
[0123] (1) Input method: Support users to select or input the song genre, emotional tone, and rhyme scheme. For example, the user selects the "pop" genre, the "positive" emotion, and " <ang>"Rhyme.
[0124] (2) Inspiration description: The user can input a description of the inspiration for writing lyrics. For example, input "Write a song about graduation season".
[0125] (3) Analysis function: Analyze the user input, extract the song genre, emotional tone, and rhyme of the lyrics. Analyze the selected information and inspiration description comprehensively, and extract the inspiration description and content requirements in the lyric writing requirements. For example, the user may require the lyrics to contain a specific plot development or character description. If the genre and emotional tone are empty, they will be filled in according to the inspiration description.
[0126] 2. Lyric generation module: Generate lyrics based on the lyric elements extracted by the analysis module. The generation process includes:
[0127] (1) Imagery word generation: Understand the lyric elements and expand to generate imagery words related to the current lyric writing requirements, as the specific imagery direction to guide the lyrics.
[0128] (2) Lyric text generation: Generate the initial lyrics based on the analysis elements and imagery direction, generate lyric text that meets the user's required theme, grammar, and rhythm, and the syntactic structure meets the lyric requirements to ensure the fluency and rhythm of the lyrics.
[0129] (3) User modification support: The lyric writing elements support real-time editing by the user, including the imagery words of the lyric writing. The user can modify and adjust the lyric elements and then regenerate the lyrics.
[0130] 3. Lyric writing interaction module: Support the user to interact with the generated initial lyrics. Based on the understanding of the initial lyrics and the user's modification opinions, polish and adjust the initial lyrics generated by the lyric generation module to make the lyrics more in line with the target lyric writing requirements. The polishing functions include:
[0131] (1) Modification opinions: The user can put forward modification opinions on the lyric content and modify and iterate the lyrics through text interaction.
[0132] (2) Adjustment support: Support overall adjustment and fine-grained adjustment. In terms of overall large-scale adjustment, it includes the adjustment of the lyric paragraph structure and the adjustment of the lyric writing style; in terms of detailed adjustment, it includes, for example, the adjustment of words, the optimization of sentence structure, and planning through the language model to ensure accurate word usage and natural syntax in the lyrics.
[0133] (3) Version saving and comparison output: The user can save the satisfied lyric versions during the interaction process; after the interaction is completed, the output module compares the saved versions and selects one or more lyrics for output.
[0134] Among them, the model adopted can be obtained through the following methods:
[0135] 1. Conversational Lyric-Writing Language Model:
[0136] Use the pre-trained large language model llama2 as the infrastructure of the multi-modal large language model. Utilize the tokenizer and word vectors of llama2 to encode the input text into corresponding text vectors. A task instruction text text here is represented as a series of tokens , where is the j-th token of text. Map this token sequence into through word vector mapping, and then input the text vector into the llama2 neural network layer. Obtain the text decoding vector by predicting the next text word by word based on the above text:
[0137]
[0138] where decode the corresponding text output through the word vector space mapped by llama2 :
[0139] [[ID=2*]]
[0140] where, represents the j-th token in the target text , which is composed of a series of tokens, in the form of .
[0141] 2. Multi-Task Training Method:
[0142] Collect and construct a multi-task instruction dataset to train the conversational lyric-writing large language model described in this patent.
[0143] 1. Example of Instruction Analysis Task Data:
[0144] {
[0145] "system”: ”You are an artist specializing in lyric writing, and are good at creating lyrics according to user needs.
[0146] Your current task is to analyze the [lyric genre], [emotional tone], [rhyme scheme], and [inspiration description] input by the user to obtain the [genre requirements], [emotional tone], [rhyme requirements], [inspiration description], and [content requirements] for lyric writing.”,
[0147] "input”:”[lyric genre] /
[0148] [emotional tone] /
[0149] [rhyme scheme] <ang>
[0150]
Inspiration description
[0151] "output”:”
Genre requirement
[0152]
Emotional tone
[0153]
Rhyme requirement
[0154]
Inspiration Note
[0155]
Content Requirements
[0156] }
[0157] 2. Example data for the imagery expansion task:
[0158] {
[0159] "system": "You are a lyricist artist, good at creating lyrics according to user needs.
[0160] Your current task is to analyze the
Expanded Imagery
Genre Requirements
Emotional Tone
Inspiration Note
Content Requirements
[0161] "input": "
Genre Requirements
[0162]
Emotional Tone
[0163]
Inspiration Note
[0164]
Content Requirements
[0165] "output": "
Expanded Imagery
[0166] }
[0167] 3. Example data for the lyric generation task:
[0168] {
[0169] "system": "You are a lyricist artist, good at creating lyrics according to user needs.
[0170] Your current task is to generate a lyric that meets the requirements based on the provided songwriting requirements:
Genre Requirements
Emotional Tone
Rhyme Requirements
Inspiration Note
Content Requirements
Expanded Imagery
[0171] "input": "
Genre Requirements
[0172]
Emotional Tone
[0173]
Rhyme Requirements
[0174]
Inspiration Note
[0175]
Content Requirements
[0176]
Extended Imagery
[0177] "output”:”Lyrics A”
[0178] 4. Example of lyric-writing interaction task data:
[0179] {
[0180] "system":"You are a lyric-writing artist, good at creating lyrics according to user needs.
[0181] Your current task is to polish the
Initial Lyrics
Genre Requirements
Emotional Tone
Rhyme Requirements
Inspiration Note
Content Requirements
Extended Imagery
Modification Suggestions
Modification Results
[0182] "input”:
Genre Requirements
[0183]
Emotional Tone
[0184]
Rhyme Requirements
[0185]
Inspiration Explanation
[0186]
Content Requirements
[0187]
Extended Imagery
[0188]
Initial Version of Lyrics
[0189]
Suggestions for Revision
[0190] "output”:”Lyrics B”
[0191] }
[0192] Input the multitask lyric-writing instruction data system and input into the pre-trained large language model llama2. Train the language model to generate the target output output through supervised learning, update the parameters of the language model using backpropagation, and the prediction loss of the language model for the text, that is, the cross-entropy loss for fitting the real target text.
[0193] For effective multitask instruction training, train the above tasks in order according to the difficulty level from difficult to easy. First, train instruction analysis, followed by imagery expansion, lyric generation, and lyric-writing interaction. After completing the training in order, conduct a stage of mixed training.
[0194] In this embodiment, through the instruction analysis module, users can flexibly express their lyric-writing requirements in various ways (structured or free text). This flexibility enables the system to adapt to different users' creative habits and style preferences, thereby generating more personalized lyrics. Whether it is to express a specific emotional tone, pursue a certain song genre, or even customize unique rhymes, the system can accurately capture and reflect them in the generated lyrics. The lyric-writing interaction module allows users to play an active role in the lyric generation process, put forward modification suggestions and see the changes in the lyrics in real time. This interactivity not only enhances the user's sense of participation but also makes the entire creative process more interesting and challenging. Users can communicate with the system like they are collaborating with a songwriter to jointly polish the lyrics to satisfaction. And based on advanced natural language processing technologies and machine learning algorithms, the lyric generation module in this embodiment can quickly understand the user's lyric-writing requirements and generate high-quality initial lyrics. This greatly shortens the time for groping and trial-and-error in traditional lyric writing and improves the creative efficiency. At the same time, through the iterative modification and optimization by users, the finally generated lyrics are often closer to the user's expectations and of higher quality.
[0195] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0196] Based on the same inventive concept, an embodiment of the present application also provides a lyric generation device for implementing the above-mentioned lyric generation method. The implementation solution provided by this device for solving problems is similar to the implementation solution described in the above method. Therefore, the specific limitations in one or more embodiments of the lyric generation device provided below can refer to the limitations on the lyric generation method in the above text, and will not be repeated here.
[0197] In one embodiment, as Figure 6 shown, a lyric generation device is provided, including: a requirement text acquisition module 601 and a target lyric generation module 602, where:
[0198] The requirement text acquisition module 601 is used to acquire the lyric-writing requirement description text input by the user for the lyric to be generated;
[0199] The target lyric generation module 602 is used to input the lyric-writing requirement description text into a pre-trained lyric generation model, and the lyric generation model performs the following steps: generate lyric-writing requirement keywords for the lyric to be generated according to the lyric-writing requirement description text, generate intention guiding keywords for guiding the imagery direction of the lyric to be generated according to the lyric-writing requirement keywords, and generate target lyrics based on the lyric-writing requirement keywords and the intention guiding keywords.
[0200] In one embodiment, as Figure 7 shown, a lyric generation device is further provided, including: an interface display module 701, a requirement input module 702, a lyric generation module 703, and a lyric display module 704, where:
[0201] The interface display module 701 is used to display a lyric generation interface, and the lyric generation interface includes a first text input control;
[0202] The requirement input module 702 is used to acquire the lyric-writing requirement description text input by the user for the lyric to be generated through the first text input control;
[0203] The lyric generation module 703 is configured to input the lyric-writing requirement description text into a pre-trained lyric generation model, so as to call the lyric generation model to generate lyric-writing requirement keywords for the to-be-generated lyrics according to the lyric-writing requirement description text, and generate intention guiding keywords for guiding the imagery direction of the to-be-generated lyrics according to the lyric-writing requirement keywords, and generate target lyrics based on the lyric-writing requirement keywords and the intention guiding keywords;
[0204] The lyric display module 704 is configured to display the target lyrics on the lyric generation interface.
[0205] In one embodiment, as Figure 8 shown, a training device for a lyric generation model is further provided, including: a sample acquisition module 801 and a model training module 802, wherein:
[0206] The sample acquisition module 801 is configured to acquire sample lyric-writing requirement description texts and sample lyrics matching the sample lyric-writing requirement description texts;
[0207] The model training module 802 is configured to use a pre-trained large language model as the to-be-trained lyric generation model, and train the lyric generation model through the sample lyric-writing requirement description texts and the sample lyrics to obtain the pre-trained lyric generation model.
[0208] Each module in the above lyric generation device and the training device for the lyric generation model can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so as to facilitate the processor to call and execute the operations corresponding to the above modules.
[0209] In one embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 9 As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a method for generating lyrics. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0210] Those skilled in the art can understand that Figure 9 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0211] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0212] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0213] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0214] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0215] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., and are not limited thereto.
[0216] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this application.
[0217] The above-described embodiments merely represent several implementation manners of this application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of this application. It should be noted that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can still be made, and these all belong to the protection scope of this application. Therefore, the protection scope of this application shall be subject to the appended claims.< / ang> < / ang> < / ang> < / ang> < / ang> < / ang> < / ang>
Claims
1. A method for generating lyrics, characterized in that, The method includes: Obtaining a lyric-writing requirement description text input by the user for the lyric to be generated; Inputting the lyric-writing requirement description text into a pre-trained lyric generation model, and the lyric generation model performs the following steps: generating lyric-writing requirement keywords for the lyric to be generated according to the lyric-writing requirement description text, generating intention guidance keywords for guiding the imagery direction of the lyric to be generated according to the lyric-writing requirement keywords, and generating target lyrics based on the lyric-writing requirement keywords and the intention guidance keywords.
2. The method according to claim 1, characterized in that, Before inputting the lyric-writing requirement description text into the pre-trained lyric generation model, it further includes: In response to the user's selection operation on the displayed lyric-writing requirement options, obtaining lyric-writing requirement option information corresponding to the selected lyric-writing requirement option, and inputting the lyric-writing requirement option information into the lyric generation model; The generating lyric-writing requirement keywords for the lyric to be generated according to the lyric-writing requirement description text includes: Supplementary filling the lyric-writing requirement description text and the lyric-writing requirement option information into a pre-set prompt template to generate prompt information; Generating lyric-writing requirement keywords for the lyric to be generated based on the indication of the prompt information.
3. The method according to claim 2, characterized in that, The prompt information includes character information and task information; the generating lyric-writing requirement keywords for the lyric to be generated based on the indication of the prompt information includes: Extracting the lyric-writing requirement description text and the lyric-writing requirement option information from the task information; using the character represented by the character information to perform the task of generating the lyric-writing requirement keywords by using the lyric-writing requirement description text and the lyric-writing requirement option information to obtain the lyric-writing requirement keywords.
4. The method according to claim 1, wherein After generating the target lyrics, it further includes: In the case of receiving a text of modification opinion from the user for the target lyrics, correcting the target lyrics by using the lyric-writing requirement keywords, the intention guidance keywords and the text of modification opinion to obtain a corrected target lyric; Selecting the lyric desired by the user to be generated from the target lyrics and the corrected target lyric.
5. The method according to claim 1, wherein After generating the target lyrics, it further includes: Displaying the intention guidance keywords; In response to the user's modification operation on the displayed intention guidance keywords, obtaining the modified intention guidance keywords; Inputting the modified intention guidance keywords into the lyric generation model to call the lyric generation model to generate new lyrics based on the modified intention guidance keywords and the lyric-writing requirement keywords; Selecting the lyric desired by the user to be generated from the target lyrics and the new lyrics.
6. A method for generating lyrics, characterized in that, The method includes: Displaying a lyric generation interface, where the lyric generation interface includes a first text input control; Obtaining a lyric-writing requirement description text input by the user through the first text input control for the lyric to be generated; Input the lyric-writing requirement description text into a pre-trained lyric generation model to call the lyric generation model to generate lyric-writing requirement keywords for the to-be-generated lyrics according to the lyric-writing requirement description text, and generate intention guidance keywords for guiding the imagery direction of the to-be-generated lyrics, and generate target lyrics based on the lyric-writing requirement keywords and the intention guidance keywords; Display the target lyrics on the lyric generation interface.
7. The method according to claim 6, wherein Lyric-writing requirement options are displayed on the lyric generation interface; the step of inputting the lyric-writing requirement description text into a pre-trained lyric generation model to obtain the target lyrics generated by the lyric generation model according to the lyric-writing requirement description text includes: In response to the user's selection operation on the displayed lyric-writing requirement options, obtain lyric-writing requirement option information corresponding to the selected lyric-writing requirement options; Input the lyric-writing requirement description text and the lyric-writing requirement option information into the lyric generation model to obtain the target lyrics generated by the lyric generation model according to the lyric-writing requirement description text and the lyric-writing requirement option information.
8. The method according to claim 6, wherein The lyric generation interface further includes a second text input control; after displaying the target lyrics on the lyric generation interface, it further includes: Obtain the modified opinion text input by the user for the target lyrics through the second text input control; Input the modified opinion text into the lyric generation model to obtain the corrected target lyrics obtained by the lyric generation model correcting the target lyrics according to the modified opinion text; Display the target lyrics and the corrected target lyrics through the lyric generation interface; In response to the user's selection operation on the displayed target lyrics and the corrected target lyrics, use the selected lyrics as the lyrics expected to be generated by the user.
9. The method according to claim 6, wherein After displaying the target lyrics on the lyric generation interface, it further includes: Display the intention guidance keywords in the intention guidance word display area of the lyric generation interface, and obtain the modified intention guidance keywords input by the user through the intention guidance word display area; Call the lyric generation model to generate new lyrics based on the modified intention guidance keywords and the lyric-writing requirement keywords; Display the new lyrics on the lyric generation interface; In response to the user's selection operation on the displayed target lyrics and the new lyrics, use the selected lyrics as the lyrics expected to be generated by the user.
10. A training method for a lyric generation model, characterized in that, It includes: Obtain sample lyric-writing requirement description texts and sample lyrics matching the sample lyric-writing requirement description texts; Use a pre-trained large language model as the lyric generation model to be trained, and train the lyric generation model through the sample lyric-writing requirement description texts and the sample lyrics to obtain a pre-trained lyric generation model.
11. The method according to claim 10, wherein The lyric generation model includes: an instruction analysis module and a lyric generation module, and the lyric generation module includes a first sub-module and a second sub-module; Training the lyric generation model with the sample lyric writing requirement description text and the sample lyrics to obtain the pre-trained lyric generation model includes: Obtaining preset lyric writing requirement keywords and preset intention guiding keywords that match the sample lyrics; Inputting the sample lyric writing requirement description text into the instruction analysis module to obtain the first predicted lyric writing requirement keywords, and training the instruction analysis module according to the difference between the first predicted lyric writing requirement keywords and the preset lyric writing requirement keywords to obtain a trained instruction analysis module; Inputting the preset lyric writing requirement keywords into the first sub-module of the lyric generation module to obtain the first predicted intention guiding keywords, and training the first sub-module according to the difference between the first predicted intention guiding keywords and the preset intention guiding keywords to obtain a trained first sub-module; Inputting the preset intention guiding keywords and the preset lyric writing requirement keywords into the second sub-module of the lyric generation module to obtain the first predicted lyrics, and training the second sub-module according to the difference between the first predicted lyrics and the sample lyrics to obtain a trained second sub-module; Obtaining the pre-trained lyric generation model according to the trained instruction analysis module, the trained first sub-module, and the trained second sub-module.
12. The method according to claim 11, wherein The lyric generation model further includes: a lyric writing interaction module; Obtaining the pre-trained lyric generation model according to the trained instruction analysis module, the trained first sub-module, and the trained second sub-module includes: Obtaining the sample modification opinion text corresponding to the sample lyrics and the preset corrected lyrics that match the sample modification opinion text; Inputting the sample modification opinion text and the sample lyrics into the lyric writing interaction module to obtain the first predicted corrected lyrics, and training the lyric writing interaction module according to the difference between the first predicted corrected lyrics and the preset corrected lyrics to obtain a trained lyric writing interaction module; Obtaining the pre-trained lyric generation model according to the trained instruction analysis module, the trained first sub-module, the trained second sub-module, and the trained lyric writing interaction module.
13. The method according to claim 12, wherein Obtaining the pre-trained lyric generation model according to the trained instruction analysis module, the trained first sub-module, the trained second sub-module, and the trained lyric writing interaction module includes: Inputting the sample lyric writing requirement description text into the trained instruction analysis module to obtain the second predicted lyric writing requirement keywords; Inputting the second predicted lyric writing requirement keywords into the trained first sub-module to obtain the second predicted intention guiding keywords, and inputting the second predicted intention guiding keywords and the second predicted lyric writing requirement keywords into the trained second sub-module to obtain the second predicted lyrics; Inputting the second predicted lyrics and the sample modification opinion text into the trained lyric writing interaction module to obtain the second predicted corrected lyrics; Based on the differences between the second predicted lyric-writing requirement keywords and the preset lyric-writing requirement keywords, the differences between the second predicted intention guiding keywords and the preset intention guiding keywords, the differences between the second predicted lyrics and the sample lyrics, and the differences between the second predicted revised lyrics and the preset revised lyrics, retrain the trained instruction analysis module, the trained first sub-module, the trained second sub-module, and the trained lyric-writing interaction module to obtain the pre-trained lyric generation model.
14. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 13.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 13.
16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 13.