Lyric rewriting method and device, electronic equipment and product
By receiving the parameter sequence input by the user and generating new lyric lines using the pre-trained lyric rewriting model, the problem of uncontrollable lyric generation results in the prior art is solved, and high-quality lyrics are rewriting and satisfying user needs are achieved.
Patent Information
- Application Number
- CN202411600350.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-28
AI Technical Summary
The existing lyric generation algorithms are uncontrollable due to randomness, making it difficult to ensure the consistency between the lyrics quality and user needs.
By receiving the user input sequence of parameters, including the target lyrics, the desired position, length and description method of the lyrics line to be generated, it is used as input to the pre-trained lyrics rewriting model, generate a new lyrics line, and combine it with the target lyrics to achieve rewriting.
The lyrics are rewriting the specified lines in the lyrics and secondary creation is carried out according to the user's needs, so that the lyrics are gradually improved to the level of user satisfaction and improve the quality of the song.
Smart Images

Figure CN119537641A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence technology, and specifically relates to a lyrics rewriting method, device, electronic equipment and product. Background Art
[0002] With the development of deep learning technology in the application of lyric generation, the existing lyric generation algorithms have been able to generate some works close to the level of human creation. However, due to the uncontrollable nature of the generation results caused by the randomness of the generation process, the quality of the generated lyrics and their fit with user needs are often difficult to guarantee.
[0003] Therefore, how to provide an effective solution to ensure that the generated lyrics meet the needs of users has become a difficult problem to be solved in the prior art. Summary of the invention
[0004] The purpose of the present invention is to provide a lyrics rewriting method, device, electronic equipment and product to solve the above-mentioned problems existing in the prior art.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] In a first aspect, the present invention provides a lyrics rewriting method, comprising:
[0007] Receive a parameter sequence input by a user, the parameter sequence including a target lyric, an expected position of a lyric line to be generated in the target lyric, a length of the lyric line to be generated, and a lyric description technique corresponding to the lyric line to be generated;
[0008] The parameter sequence is used as an input of a pre-trained lyrics rewriting model to perform calculations to obtain a newly generated lyrics line, wherein the lyrics rewriting model is trained with a sample parameter sequence as a sample input and a newly generated sample lyrics line corresponding to the sample parameter sequence as a sample output, wherein the sample parameter sequence includes sample lyrics, an expected position of a sample lyrics line to be generated in the sample lyrics, a length of the sample lyrics line to be generated, and a lyrics description technique corresponding to the sample lyrics line to be generated;
[0009] Based on the expected position, combining the newly generated lyrics line with the target lyrics to obtain rewritten target lyrics;
[0010] The newly generated lyrics line is located at a position corresponding to the expected position in the rewritten target lyrics.
[0011] Based on the above disclosed content, the present invention receives a parameter sequence input by a user, wherein the parameter sequence includes a target lyric, an expected position of a lyric line to be generated in the target lyric, the length of the lyric line to be generated, and the lyric description technique corresponding to the lyric line to be generated; the parameter sequence is used as the input of a pre-trained lyric rewriting model for operation to obtain a newly generated lyric line, wherein the lyric rewriting model is trained with a sample parameter sequence as a sample input and a newly generated sample lyric line corresponding to the sample parameter sequence as a sample output, wherein the sample parameter sequence includes sample lyrics, an expected position of a sample lyric line to be generated in the sample lyrics, the length of the sample lyric line to be generated, and the lyric description technique corresponding to the sample lyric line to be generated; based on the expected position, the newly generated lyric line is combined with the target lyrics to obtain the rewritten target lyrics; wherein the newly generated lyric line is located at a position corresponding to the expected position in the rewritten target lyrics. In this way, the user can rewrite the specified lyric line in the lyrics according to the desired lyric description technique as needed, thereby realizing the secondary creation of the lyrics, enabling the user to improve the lyrics step by step to a satisfactory degree, and meet the user's creative needs.
[0012] In one possible design, the method further includes:
[0013] Acquire a sample data set, the sample data set comprising a plurality of sample parameter sequences and a plurality of newly generated sample lyrics lines corresponding one-to-one to the plurality of sample parameter sequences;
[0014] Each sample parameter sequence in the multiple sample parameter sequences is used as a sample input, and a newly generated sample lyric line corresponding to each sample parameter sequence is used as a sample output for training to obtain the lyric rewriting model.
[0015] In one possible design, the method further includes:
[0016] The remaining lyrics lines except the lyrics lines to be classified in the sample lyrics of the sample parameter sequence and their corresponding lyrics description techniques are used as inputs of the pre-trained lyrics classification model for operation to obtain the lyrics description techniques corresponding to the lyrics lines to be classified in the sample lyrics of the sample parameter sequence.
[0017] In one possible design, the lyrics classification model is a BERT model, a convolutional neural network model, or a recurrent neural network model.
[0018] In one possible design, the lyrics rewriting model is a Transformer model or a recurrent neural network model.
[0019] In a possible design, the lyrics description technique is scene description, emotion description or dialogue description.
[0020] In a possible design, the target lyrics are a complete lyric or a lyric with at least one line of lyrics deleted.
[0021] In a second aspect, the present invention provides a lyrics rewriting device, comprising:
[0022] A receiving unit, configured to receive a parameter sequence input by a user, wherein the parameter sequence includes a target lyric, an expected position of a lyric line to be generated in the target lyric, a length of the lyric line to be generated, and a lyric description technique corresponding to the lyric line to be generated;
[0023] A lyrics line generation unit, used to use the parameter sequence as an input of a pre-trained lyrics rewriting model to perform calculations to obtain a newly generated lyrics line, wherein the lyrics rewriting model is trained using a sample parameter sequence as a sample input and a newly generated sample lyrics line corresponding to the sample parameter sequence as a sample output, wherein the sample parameter sequence includes sample lyrics, an expected position of a sample lyrics line to be generated in the sample lyrics, a length of the sample lyrics line to be generated, and a lyrics description technique corresponding to the sample lyrics line to be generated;
[0024] A combining unit, configured to combine the newly generated lyrics line with the target lyrics based on the expected position to obtain rewritten target lyrics;
[0025] The newly generated lyrics line is located at a position corresponding to the expected position in the rewritten target lyrics.
[0026] In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a transceiver which are communicatively connected in sequence, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the lyrics rewriting method as described in the first aspect or any possible design of the first aspect.
[0027] In a fourth aspect, the present invention provides a computer-readable storage medium having instructions stored thereon, which, when executed on a computer, executes the lyrics rewriting method described in the first aspect or any possible design of the first aspect.
[0028] In a fifth aspect, the present invention provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the lyrics rewriting method as described in the first aspect or any possible design of the first aspect.
[0029] Beneficial effects:
[0030] The lyrics rewriting method, device, electronic device and product provided by the present invention can rewrite the specified lyrics lines in the lyrics according to the desired lyrics description techniques as needed, thereby realizing secondary creation of the lyrics, allowing the user to improve the lyrics step by step to a satisfactory level, meeting the user's creative needs, and facilitating practical application and promotion. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A flowchart of a lyrics rewriting method provided in an embodiment of the present application;
[0032] Figure 2 A schematic block diagram of a lyrics rewriting device provided in an embodiment of the present application;
[0033] Figure 3 A schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.
[0035] It should be understood that although the terms first, second, etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another unit. For example, a first unit can be referred to as a second unit, and similarly, a second unit can be referred to as a first unit without departing from the scope of the exemplary embodiments of the present invention.
[0036] It should be understood that the term "and / or" that may appear in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, B exists alone, and A and B exist at the same time. The term " / and" that may appear in this article describes another type of association object relationship, indicating that two relationships may exist. For example, A / and B can represent two situations: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this article generally indicates that the previous and next associated objects are in an "or" relationship.
[0037] In order to meet user needs, the embodiments of the present application provide a lyric rewriting method, device, electronic device and product. The lyric rewriting method, device, electronic device and product can realize secondary creation of lyrics, allowing users to improve the lyrics step by step to a level they are satisfied with, thereby meeting the user's creative needs.
[0038] The lyrics rewriting method provided in the embodiment of the present application can be applied to a user terminal or a server. It can be understood that the execution subject does not constitute a limitation on the embodiment of the present application.
[0039] The lyrics rewriting method provided in the embodiment of the present application will be described in detail below.
[0040] like Figure 1 As shown, it is a flowchart of the lyrics rewriting method provided in the first aspect of the embodiment of the present application. The lyrics rewriting method may include but is not limited to the following steps S101-S103.
[0041] Step S101. Receive a parameter sequence input by a user, the parameter sequence including target lyrics, the expected position of the lyrics line to be generated in the target lyrics, the length of the lyrics line to be generated, and the lyrics description technique corresponding to the lyrics line to be generated.
[0042] In the embodiment of the present application, when the user needs to rewrite the target lyrics, he can first input a parameter sequence for lyrics rewriting, which can include the target lyrics, the expected position of the lyrics line to be generated in the target lyrics, the length of the lyrics line to be generated, and the lyrics description technique corresponding to the lyrics line to be generated. The expected position of the lyrics line to be generated in the target lyrics can be the number of lines that the lyrics line to be generated is expected to appear in the rewritten target lyrics.
[0043] The target lyrics can be a complete lyric or a lyric with at least one line deleted. When the target lyrics are a complete lyric, lyrics rewriting can be considered as adding lyrics to the complete lyrics. When the target lyrics are lyrics with at least one line deleted, and the position corresponding to the at least one deleted line corresponds to the expected position, lyrics rewriting can be considered as rewriting at least one line of the target lyrics.
[0044] Step S102: Calculate the parameter sequence as the input of the pre-trained lyrics rewriting model to obtain a newly generated lyrics line.
[0045] In an embodiment of the present application, a lyrics rewriting model for lyrics rewriting is pre-established. The lyrics rewriting model can be trained with a sample parameter sequence as sample input and a newly generated sample lyrics line corresponding to the sample parameter sequence as sample output. The sample parameter sequence includes sample lyrics, the expected position of the sample lyrics line to be generated in the sample lyrics, the length of the sample lyrics line to be generated, and the lyrics description technique corresponding to the sample lyrics line to be generated.
[0046] The training process of the lyrics rewriting model may include but is not limited to the following steps S201-S202.
[0047] Step S201: Acquire a sample data set, where the sample data set includes a plurality of sample parameter sequences and a plurality of newly generated sample lyrics lines corresponding one-to-one to the plurality of sample parameter sequences.
[0048] The sample parameter sequence includes sample lyrics, the expected position of the sample lyrics line to be generated in the sample lyrics, the length of the sample lyrics line to be generated, and the lyrics description technique corresponding to the sample lyrics line to be generated.
[0049] Step S202: taking each sample parameter sequence in the plurality of sample parameter sequences as a sample input and taking the newly generated sample lyrics line corresponding to each sample parameter sequence as a sample output for training to obtain a lyrics rewriting model.
[0050] The lyrics rewriting model may be, but is not limited to, a Transformer model or a Recurrent Neural Networks (RNN) model.
[0051] Before training the lyrics rewriting model, it is also necessary to classify the lyrics description techniques corresponding to the sample lyrics lines. In order to facilitate the classification of the lyrics description techniques corresponding to the sample lyrics lines, in the embodiment of the present application, a lyrics classification model for classifying lyrics description techniques is also pre-trained. When training the lyrics classification model, the lyrics description techniques corresponding to all lyrics lines in the lyrics used for training can be marked, and then the remaining lyrics lines and their corresponding lyrics description techniques except the lyrics lines to be classified in the lyrics used for training are used as sample inputs, and the lyrics description techniques corresponding to the lyrics lines to be classified in the lyrics used for training are used as sample outputs for training to obtain a trained lyrics classification model. Among them, the lyrics lines to be classified can be any one or more lines of lyrics in the lyrics, and the lyrics description techniques can be but are not limited to scene descriptions, emotional descriptions, or dialogue descriptions, etc.
[0052] When classifying the lyrics description techniques corresponding to the sample lyrics lines, the remaining lyrics lines except the lyrics lines to be classified in the sample lyrics of the sample parameter sequence and their corresponding lyrics description techniques can be used as the input of the lyrics classification model for calculation to obtain the lyrics description techniques corresponding to the lyrics lines to be classified in the sample lyrics of the sample parameter sequence.
[0053] In an embodiment of the present application, the lyrics classification model may be, but is not limited to, a BERT (Bidirectional Encoder Representations from Transformers) model, a convolutional neural network (CNN) model, or a recurrent neural network model.
[0054] Step S103. Based on the expected position, the newly generated lyrics line is combined with the target lyrics to obtain the rewritten target lyrics.
[0055] Specifically, the newly generated lyrics line can be inserted into the target lyrics to obtain the rewritten target lyrics, and the position of the newly generated lyrics line in the rewritten target lyrics is exactly located at the position corresponding to the expected position.
[0056] For example, if the expected position is the 7th line, then after combining the newly generated lyrics line with the target lyrics to obtain the rewritten target lyrics, the newly generated lyrics line is exactly located at the 7th line in the rewritten target lyrics.
[0057] The lyrics rewriting method provided by the present invention receives a parameter sequence input by a user, wherein the parameter sequence includes target lyrics, an expected position of a lyrics line to be generated in the target lyrics, the length of the lyrics line to be generated, and a lyrics description technique corresponding to the lyrics line to be generated; the parameter sequence is used as the input of a pre-trained lyrics rewriting model for operation to obtain a newly generated lyrics line, wherein the lyrics rewriting model is trained using a sample parameter sequence as a sample input and a newly generated sample lyrics line corresponding to the sample parameter sequence as a sample output, wherein the sample parameter sequence includes sample lyrics, an expected position of a sample lyrics line to be generated in the sample lyrics, the length of the sample lyrics line to be generated, and a lyrics description technique corresponding to the sample lyrics line to be generated; then, based on the expected position, the newly generated lyrics line is combined with the target lyrics to obtain the rewritten target lyrics; wherein the newly generated lyrics line is located at a position corresponding to the expected position in the rewritten target lyrics. In this way, users can rewrite specified lines of lyrics according to their desired lyric description techniques as needed, thereby achieving secondary creation of the lyrics, allowing users to improve the lyrics step by step to a level they are satisfied with, meeting their creative needs, improving the quality of the songs they create, and facilitating practical application and promotion.
[0058] See also Figure 2A second aspect of an embodiment of the present application provides a lyrics rewriting device, the lyrics rewriting device comprising:
[0059] A receiving unit, configured to receive a parameter sequence input by a user, wherein the parameter sequence includes a target lyric, an expected position of a lyric line to be generated in the target lyric, a length of the lyric line to be generated, and a lyric description technique corresponding to the lyric line to be generated;
[0060] A lyrics line generation unit, used to use the parameter sequence as an input of a pre-trained lyrics rewriting model to perform calculations to obtain a newly generated lyrics line, wherein the lyrics rewriting model is trained using a sample parameter sequence as a sample input and a newly generated sample lyrics line corresponding to the sample parameter sequence as a sample output, wherein the sample parameter sequence includes sample lyrics, an expected position of a sample lyrics line to be generated in the sample lyrics, a length of the sample lyrics line to be generated, and a lyrics description technique corresponding to the sample lyrics line to be generated;
[0061] A combining unit, configured to combine the newly generated lyrics line with the target lyrics based on the expected position to obtain rewritten target lyrics;
[0062] The newly generated lyrics line is located at a position corresponding to the expected position in the rewritten target lyrics.
[0063] The working process, working details and technical effects of the lyrics rewriting device provided in the second aspect of this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.
[0064] like Figure 3 As shown, the third aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor and a transceiver which are communicatively connected in sequence, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the lyrics rewriting method as described in the first aspect of the embodiment.
[0065] For specific examples, the memory may include but is not limited to random access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out memory (FIFO) and / or first-in-last-out memory (FILO), etc.; the processor may be but is not limited to a microprocessor of the STM32F105 series, an ARM (Advanced RISC-Machines), an X86 or other architecture processor, or a processor with an integrated NPU (neural-network processing units); the transceiver may be but is not limited to a WiFi (Wireless Fidelity) wireless transceiver, a Bluetooth wireless transceiver, a General Packet Radio Service (GPRS) wireless transceiver, a ZigBee protocol (a low-power local area network protocol based on the IEEE802.15.4 standard, ZigBee) wireless transceiver, a 3G transceiver, a 4G transceiver and / or a 5G transceiver, etc.
[0066] The fourth aspect of this embodiment provides a computer-readable storage medium storing instructions including the lyrics rewriting method described in the first aspect of the embodiment, that is, the computer-readable storage medium stores instructions, and when the instructions are run on a computer, the lyrics rewriting method described in the first aspect is executed. The computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, a CD, a hard disk, a flash memory, a USB flash drive and / or a memory stick, etc., and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0067] The fifth aspect of this embodiment provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the lyric rewriting method as described in the first aspect of the embodiment, wherein the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0068] It should be understood that certain details are provided in the following description to facilitate a complete understanding of the example embodiments. However, it should be understood by those of ordinary skill in the art that the example embodiments can be implemented without these certain details. For example, the system can be shown in a block diagram to avoid obscuring the example with unnecessary details. In other examples, well-known processes, structures, and techniques may not be shown in unnecessary detail to avoid obscuring the example embodiments.
[0069] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A lyrics rewriting method, characterized in that: include: Receive a parameter sequence input by a user, the parameter sequence including a target lyric, an expected position of a lyric line to be generated in the target lyric, a length of the lyric line to be generated, and a lyric description technique corresponding to the lyric line to be generated; The parameter sequence is used as an input of a pre-trained lyrics rewriting model to perform calculations to obtain a newly generated lyrics line, wherein the lyrics rewriting model is trained with a sample parameter sequence as a sample input and a newly generated sample lyrics line corresponding to the sample parameter sequence as a sample output, wherein the sample parameter sequence includes sample lyrics, an expected position of a sample lyrics line to be generated in the sample lyrics, a length of the sample lyrics line to be generated, and a lyrics description technique corresponding to the sample lyrics line to be generated; Based on the expected position, combining the newly generated lyrics line with the target lyrics to obtain rewritten target lyrics; The newly generated lyrics line is located at a position corresponding to the expected position in the rewritten target lyrics.
2. The lyrics rewriting method according to claim 1, characterized in that: The method further comprises: Acquire a sample data set, the sample data set comprising a plurality of sample parameter sequences and a plurality of newly generated sample lyrics lines corresponding one-to-one to the plurality of sample parameter sequences; Each sample parameter sequence in the multiple sample parameter sequences is used as a sample input, and a newly generated sample lyric line corresponding to each sample parameter sequence is used as a sample output for training to obtain the lyric rewriting model.
3. The lyrics rewriting method according to claim 2, characterized in that: The method further comprises: The remaining lyrics lines except the lyrics lines to be classified in the sample lyrics of the sample parameter sequence and their corresponding lyrics description techniques are used as inputs of the pre-trained lyrics classification model for operation to obtain the lyrics description techniques corresponding to the lyrics lines to be classified in the sample lyrics of the sample parameter sequence.
4. The lyrics rewriting method according to claim 3, characterized in that: The lyrics classification model is a BERT model, a convolutional neural network model or a recurrent neural network model.
5. The lyrics rewriting method according to claim 1, characterized in that: The lyrics rewriting model is a Transformer model or a recurrent neural network model.
6. The lyrics rewriting method according to claim 1, characterized in that: The lyrics description technique is scene description, emotion description or dialogue description.
7. The lyrics rewriting method according to claim 1, characterized in that: The target lyrics are a complete lyric or a lyric with at least one line of lyrics deleted.
8. A lyrics rewriting device, characterized in that: include: A receiving unit, configured to receive a parameter sequence input by a user, wherein the parameter sequence includes a target lyric, an expected position of a lyric line to be generated in the target lyric, a length of the lyric line to be generated, and a lyric description technique corresponding to the lyric line to be generated; A lyrics line generation unit, used to use the parameter sequence as an input of a pre-trained lyrics rewriting model to perform calculations to obtain a newly generated lyrics line, wherein the lyrics rewriting model is trained using a sample parameter sequence as a sample input and a newly generated sample lyrics line corresponding to the sample parameter sequence as a sample output, wherein the sample parameter sequence includes sample lyrics, an expected position of a sample lyrics line to be generated in the sample lyrics, a length of the sample lyrics line to be generated, and a lyrics description technique corresponding to the sample lyrics line to be generated; A combining unit, configured to combine the newly generated lyrics line with the target lyrics based on the expected position to obtain rewritten target lyrics; The newly generated lyrics line is located at a position corresponding to the expected position in the rewritten target lyrics.
9. An electronic device, characterized in that: It comprises a memory, a processor and a transceiver which are communicatively connected in sequence, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the lyrics rewriting method as described in any one of claims 1 to 7.
10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or the instruction is executed by a computer, the lyrics rewriting method according to any one of claims 1 to 7 is implemented.