Lyrics adaptation method, device, computer equipment and storage medium

By obtaining and occluding preset words in the overlay lyrics document, generating a target lyric template and entering an adaptation model, the problem of low lyrics adaptation quality in the prior art is solved, and a higher quality lyric generation is achieved.

CN111783413BActive Publication Date: 2024-12-31PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010622899.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-30
Publication Date
2024-12-31
Estimated Expiration
2040-06-30

AI Technical Summary

Technical Problem

The text generated by the existing lyric adaptation method is prone to mismatch in words, resulting in unrelated lyric context and low lyric quality.

Method used

Generate the target lyric template by obtaining the preset sentence template words, subject words, conjunctions and weak conjunctions in the lyrics document to be adapted, and use the preset tag to occlude overwrite and enter it into the adapted model to generate related to the target topic word lyrics document of .

Benefits of technology

Improve the quality of lyrics adaptation, and improve the relevance and consistency of the generated lyrics and target themes by retaining the structure of the original document.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111783413B_ABST
    Figure CN111783413B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a lyrics adaptation method, device, computer equipment and storage medium. The present application relates to the fields of artificial intelligence, natural language processing and blockchain technology. The method comprises: obtaining a lyrics document to be adapted, wherein the lyrics document to be adapted comprises preset sentence template words, preset subject words, preset associated words and preset weakly associated words; screening out the preset subject words and preset associated words in the lyrics document to be adapted according to a preset method and a preset screening model, and masking and covering the preset subject words and preset associated words with preset markers to generate a target lyrics template, wherein the target lyrics template comprises preset sentence template words and preset weakly associated words; inputting the target lyrics template and the target subject words into a preset adaptation model to generate a lyrics document related to the target subject words. The embodiment of the present application can improve the quality of the lyrics after the lyrics are adapted to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of artificial intelligence, natural language processing and blockchain technology, and in particular to a lyrics adaptation method, device, computer equipment and storage medium. Background Art

[0002] Songs are an art form that people appreciate and love, and have deeply penetrated into people's lives. Lyrics, as an important part of songs, have a certain structure to express certain emotions. These specific structures are mainly reflected in paragraph distribution, sentence association, and rhyme. The existing methods for generating text when adapting lyrics mainly include language models and Seq2Seq models. However, the words generated by these two models only integrate unilateral information. When the generated text is long, it is easy for the generated words to not match, resulting in the lyrics context being irrelevant and the lyrics quality being low. Summary of the invention

[0003] The embodiments of the present invention provide a lyrics adaptation method, device, computer equipment and storage medium, aiming to solve the problem of low quality of lyrics after existing lyrics adaptation.

[0004] In a first aspect, an embodiment of the present invention provides a lyrics adaptation method, which includes:

[0005] Acquire a lyrics document to be adapted, wherein the lyrics document to be adapted includes preset sentence template words, preset subject words, preset related words, and preset weakly related words;

[0006] The preset subject words and the preset associated words in the lyrics document to be adapted are screened out according to a preset method and a preset screening model, and the preset subject words and the preset associated words are covered with preset markers to generate a target lyrics template, wherein the target lyrics template includes the preset sentence template words and the preset weakly associated words;

[0007] The target lyrics template and the target keyword are input into a preset adaptation model to generate a lyrics document related to the target keyword.

[0008] In a second aspect, an embodiment of the present invention further provides a lyrics adaptation device, which includes:

[0009] An acquisition unit, used for acquiring a lyrics document to be adapted, wherein the lyrics document to be adapted includes preset sentence template words, preset subject words, preset related words and preset weakly related words;

[0010] A screening and covering unit, used for screening out the preset subject words and the preset associated words in the lyrics document to be adapted according to a preset method and a preset screening model, and covering and masking the preset subject words and the preset associated words with preset markers to generate a target lyrics template, wherein the target lyrics template includes the preset sentence template words and the preset weakly associated words;

[0011] The generating unit is used to input the target lyrics template and the target theme word into a preset adaptation model to generate a lyrics document related to the target theme word.

[0012] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.

[0013] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.

[0014] The embodiment of the present invention provides a lyrics adaptation method, device, computer equipment and storage medium. The method includes: obtaining a lyrics document to be adapted, wherein the lyrics document to be adapted includes preset sentence template words, preset subject words, preset associated words and preset weak associated words; filtering out the preset subject words and the preset associated words in the lyrics document to be adapted according to a preset method and a preset screening model, and covering the preset subject words and the preset associated words with a preset marker to generate a target lyrics template, wherein the target lyrics template includes the preset sentence template words and the preset weak associated words; inputting the target lyrics template and the target subject words into the preset adaptation model to generate a lyrics document related to the target subject words. The technical solution of the embodiment of the present invention firstly filters out the preset subject words and the preset associated words in the lyrics document to be adapted according to the preset method and the preset screening model, and covers them with a preset marker to generate a target lyrics template, and then generates a lyrics document related to the target subject words according to the target lyrics template, the target subject words and the preset adaptation model. Since the target lyrics template retains the inherent structure in the lyrics document to be adapted, the quality of the lyrics after the lyrics adaptation can be improved to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0016] Figure 1 A schematic diagram of a scenario of a lyrics adaptation method provided by an embodiment of the present invention;

[0017] Figure 2 A schematic flow chart of a lyrics adaptation method provided by an embodiment of the present invention;

[0018] Figure 3 A schematic diagram of a sub-process of a lyrics adaptation method provided by an embodiment of the present invention;

[0019] Figure 4 A schematic diagram of a sub-process of a lyrics adaptation method provided by an embodiment of the present invention;

[0020] Figure 5 A schematic diagram of a sub-process of a lyrics adaptation method provided by an embodiment of the present invention;

[0021] Figure 6 A schematic diagram of a sub-process of a lyrics adaptation method provided by an embodiment of the present invention;

[0022] Figure 7 A schematic block diagram of a lyrics adaptation device provided by an embodiment of the present invention;

[0023] Figure 8 A schematic block diagram of a screening and covering unit of a lyrics adaptation device provided in an embodiment of the present invention;

[0024] Fig. 9 A schematic block diagram of a first screening and covering subunit of a lyrics adaptation device provided in an embodiment of the present invention;

[0025] Fig.10 A schematic block diagram of a second screening and covering subunit of a lyrics adaptation device provided in an embodiment of the present invention;

[0026] Fig.11 A schematic block diagram of a third screening and covering subunit of the lyrics adaptation device provided in an embodiment of the present invention;

[0027] Fig.12 A schematic block diagram of a generating unit of a lyrics adaptation device provided in an embodiment of the present invention;

[0028] Fig.13 A schematic block diagram of a first generating subunit of a lyrics adaptation device provided in an embodiment of the present invention; and

[0029] Fig.14 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0032] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0033] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0034] As used in this specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0035] See also Figure 1 , Figure 1 : is a scene diagram of a lyrics adaptation method provided by an embodiment of the present invention. The lyrics adaptation method of the embodiment of the present invention can be applied to a server, for example, the lyrics adaptation method can be implemented by a software program configured on the server. The server communicates with the terminal so that the server calls the lyrics document to be adapted uploaded by the user through the terminal and obtains the adapted lyrics document after a series of processing on the lyrics document to be adapted, thereby implementing the adaptation of the lyrics. The terminal can be a desktop computer, a laptop computer, a tablet computer, etc., and is not specifically limited here. In addition, in Figure 1 In the embodiment, the number of the terminal and the user is one. It is understandable that in actual application, the number of the terminal and the user may be multiple. Figure 1It is for illustrative purposes only.

[0036] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of a lyrics adaptation method provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S100-S120.

[0037] S100, obtaining a lyrics document to be adapted, wherein the lyrics document to be adapted includes preset sentence template words, preset subject words, preset related words, and preset weakly related words.

[0038] In an embodiment of the present invention, in order to adapt the lyrics, the server first needs to obtain the lyrics document to be adapted, wherein the lyrics document to be adapted includes preset sentence template words, preset subject words, preset related words and preset weakly related words, and then a series of processing is performed based on the lyrics document to be adapted before the adapted lyrics document can be generated. In an embodiment of the present invention, the lyrics document to be adapted can be uploaded by a user through a user terminal. Specifically, the user can upload the lyrics document to be adapted through the lyrics adaptation web page of the user terminal to send the lyrics document to be adapted to the server. In this embodiment of the present invention, the lyrics document to be adapted is a text document.

[0039] It should be noted that, in other embodiments, the lyrics document to be adapted may also be other types of documents, such as a Word document.

[0040] S110. Filter out the preset subject words and the preset associated words in the lyrics document to be adapted according to a preset method and a preset screening model, and cover the preset subject words and the preset associated words with preset markers to generate a target lyrics template, wherein the target lyrics template includes the preset sentence template words and the preset weakly associated words.

[0041] In the embodiment of the present invention, after the server obtains the lyrics document to be adapted, it needs to filter out the preset subject words and preset associated words in the lyrics document to be adapted according to the preset method and the preset screening model, and use the preset marker to cover the preset subject words and preset associated words to generate a target lyrics template. Among them, the preset method is, for example, a part of speech judgment method, and the part of speech includes noun, pronoun, verb, adjective, etc. The preset marker is, for example, a space, #, etc.

[0042] It should be noted that in this embodiment, the generated target lyric template can be uploaded to the blockchain, and the corresponding digest information can be obtained based on the target lyric template. Specifically, the digest information is obtained by performing a hashing process on the target lyric template, for example, by using the sha256s algorithm. Uploading the digest information to the blockchain can ensure its security and fairness and transparency to users. The user device can download the digest information from the blockchain to verify whether the differentiated information and the updated pre-stored configuration information have been tampered with. The blockchain referred to in this example is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithms. Blockchain, in essence, is a decentralized database, a string of data blocks generated by using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of the information (anti-counterfeiting) and generate the next block.

[0043] In some embodiments, such as this embodiment, as Figure 3 shown, the step S110 may include the following steps S111 - S112.

[0044] S111. Identify the non - preset sentence pattern template words in the lyric document to be adapted according to the part - of - speech judgment method.

[0045] S112. Input all the non - preset sentence pattern template words in the lyric document to be adapted into a preset screening model to screen out the preset theme words and the preset related words, and use a preset marker to cover and block the preset theme words and the preset related words to generate a target lyric template.

[0046] In the embodiment of the present invention, the non - preset sentence pattern template words in the lyric document to be adapted are identified according to the part - of - speech judgment method; all the non - preset sentence pattern template words in the lyric document to be adapted are input into a preset screening model to screen out the preset theme words and the preset related words, and a preset marker is used to cover and block the preset theme words and the preset related words to generate a target lyric template; where the preset sentence pattern template words refer to that a sentence must be organized according to a certain pattern, and the words used to generate this pattern are the preset sentence pattern template words. For example, in a judgment sentence in ancient Chinese, the words "zhe" and "ye" in "Lian Po zhe, Zhao zhi liang jiang ye" are preset sentence pattern template words. In actual part - of - speech judgment, if the lyric in the lyric document to be adapted is a pronoun such as "wo", "ni", or "ta", it can be judged as a preset sentence pattern template word, and the preset sentence pattern template words need to be retained.

[0047] In some embodiments, such as this embodiment, as Figure 4 shown, the step S112 may include the following steps S1121 - S1122.

[0048] S1121. Input all non-preset sentence template words in the lyrics document to be adapted into a first preset screening model to screen out preset subject words, and cover the preset subject words with preset markers to generate a first lyrics document.

[0049] S1122. Input the first lyrics document and the preset subject words into a second preset model to filter out preset associated words, and cover the preset associated words in the first lyrics document with preset markers to generate a second lyrics document, and use the second lyrics document as a target lyrics template.

[0050] In an embodiment of the present invention, all non-preset sentence template words in the lyrics document to be adapted are input into a preset screening model to filter out the preset subject words and the preset associated words, and the preset subject words and preset associated words are covered and masked with preset markers to generate a target lyrics template. Specifically, all non-preset sentence template words in the lyrics document to be adapted are input into a first preset screening model to filter out preset subject words, and the preset subject words are covered and masked with preset markers to generate a first lyrics document; the first lyrics document and the preset subject words are input into a second preset model to filter out preset associated words, and the preset associated words are covered and masked with preset markers in the first lyrics document to generate a second lyrics document, and the second lyrics document is used as the target lyrics template. Among them, the first preset model is a TF-IDF (Term Frequency-Inverse DocumentFrequency) model, and the TF-IDF model is used to evaluate the importance of a word to a file set or a document in a corpus. The importance of a word increases in direct proportion to the number of times it appears in the file, but decreases in inverse proportion to the frequency of its appearance in the corpus; the second preset model is the Word2Vec (Word to vector) model, which can be used to map each word to a vector, and can be used to represent the relationship between words; the preset subject words are the subject words of the lyrics document to be adapted; the preset associated words are words strongly associated with the subject words. More specifically, in this embodiment, the word frequency of each word in the lyrics document after extracting the preset sentence template words and the inverse document frequency of each word in the entire lyrics document are first calculated, and then the TF-IDF score corresponding to each word is calculated in combination with the word frequency and the inverse document frequency, and the TF-IDF scores are sorted, and the N words with the highest TF-IDF scores are selected as the preset subject words, where the value of N depends on specific needs. After determining the preset subject words, the lyrics document after filtering out the preset subject words is input into the Word2Vec model. The Word2Vec model calculates the word vector corresponding to each preset subject word and performs weighted averaging to obtain the subject vector of the lyrics document. Finally, by calculating the cosine similarity between the subject vector and each word vector in the lyrics document, the preset associated words and preset weakly associated words can be obtained. The weakly associated words are words that are weakly associated or unassociated with the preset subject words. In this embodiment, after passing through the TF-IDF model and the Word2Vec model, the preset subject words and preset associated words are masked and covered with preset markers to form a target lyrics template with only preset weakly associated words and preset sentence template words.

[0051] It should be noted that in other embodiments, other models may be used to filter the lyrics document after extracting the preset sentence template words to filter out preset weakly associated words according to actual needs, such as the One-Hot model and the Glove model.

[0052] S120, inputting the target lyrics template and the target keyword into a preset adaptation model to generate a lyrics document related to the target keyword.

[0053] In an embodiment of the present invention, after passing through the part-of-speech judgment method, TF-IDF model and Word2Vec model, the preset subject words and preset associated words will be masked and covered with preset markers to form a target lyrics template containing only preset weakly associated words and preset sentence template words, and the target lyrics template and target subject words will be input into the preset adaptation model to generate a lyrics document related to the target subject words.

[0054] In some embodiments, such as the present embodiment, Figure 5 As shown, the step S120 may include the following steps S121-S122.

[0055] S121, inputting the target lyrics template and the target theme word into a preset adaptation model to generate a target theme replacement word related to the target theme word.

[0056] S122: Fill the target subject replacement word into the target lyrics template to generate a lyrics document related to the target subject word.

[0057] In an embodiment of the present invention, after forming a target lyric template, the target lyric template and the target subject word are input into a preset adaptation model to generate a lyric document related to the target subject word. Specifically, the target lyric template and the target subject word are first input into a preset adaptation model to generate a target subject replacement word related to the target subject word; and then the target subject replacement word is filled into the target lyric template to generate a lyric document related to the target subject word. It is understandable that, since the preset subject words and preset associated words in the target lyric template are blocked and covered by the preset marker, the process of filling the target subject replacement word into the target lyric template is the process of replacing the position of the preset marker with the target subject replacement word. It should be noted that in the process of generating the target subject replacement word, multiple rounds of iterative prediction will be performed to make the generated target subject replacement word more accurate. Finally, the target subject replacement word is filled into the target lyric template to generate a lyric document related to the target subject word.

[0058] In some embodiments, such as the present embodiment, Figure 6 As shown, the step S121 may include the following steps S1211-S1212.

[0059] S1211. Input the target lyrics template and the target subject word into a Bert model to generate target subject candidate words related to the target subject word.

[0060] S1212: Input the target topic candidate word and the target topic word into a Word2Vec model to generate a target topic replacement word related to the target topic word.

[0061] In an embodiment of the present invention, the target lyrics template and the target subject word are input into a preset adaptation model to generate a target subject replacement word related to the target subject word. Wherein, the preset adaptation model includes a Bert (Bidirectional Encoder Representations From Transformers) model and a Word2Vec model. The Bert model is a model based on Transformer that uses a bidirectional language, which can extract the grammatical semantic information of the document, and can also extract it in combination with the document context information. In this embodiment, based on the target lyrics template and the target subject word, the Bert model is used to integrate the bidirectional semantic information to generate target subject candidate words related to the target subject word, and then the target subject candidate words and the target subject word are input into the Word2Vec model for similarity comparison to determine the target subject replacement word, and the target subject replacement word is filled into the target lyrics template to generate a lyrics document related to the target subject word, thereby realizing the lyrics adaptation of a specific theme.

[0062] Figure 7 2 is a schematic block diagram of a lyrics adaptation device 200 provided in an embodiment of the present invention. Figure 7 As shown, corresponding to the above lyrics adaptation method, the present invention also provides a lyrics adaptation device 200. The lyrics adaptation device 200 includes a unit for executing the above lyrics adaptation method, and the device can be configured in a server. Figure 7 The lyrics adaptation device 200 includes an acquisition unit 201, a screening and covering unit 202 and a generation unit 203.

[0063] Among them, the acquisition unit 201 is used to acquire the lyrics document to be adapted, wherein the lyrics document to be adapted includes preset sentence template words, preset subject words, preset associated words and preset weakly associated words; the screening and covering unit 202 is used to screen out the preset subject words and the preset associated words in the lyrics document to be adapted according to a preset method and a preset screening model, and mask and cover the preset subject words and the preset associated words with preset markers to generate a target lyrics template, wherein the target lyrics template includes the preset sentence template words and the preset weakly associated words; the generation unit 203 is used to input the target lyrics template and the target subject words into the preset adaptation model to generate a lyrics document related to the target subject words.

[0064] In some embodiments, such as the present embodiment, Figure 8 As shown, the screening and covering unit 202 includes a determination unit 2021 and a first screening and covering subunit 2022 .

[0065] Among them, the judgment unit 2021 is used to identify non-preset sentence template words in the lyrics document to be adapted according to the part-of-speech judgment method; the first screening and covering sub-unit 2022 is used to input all non-preset sentence template words in the lyrics document to be adapted into the preset screening model to filter out the preset subject words and the preset associated words, and use the preset marker to block and cover the preset subject words and preset associated words to generate a target lyrics template.

[0066] In some embodiments, such as the present embodiment, Fig. 9 As shown, the first screening covering subunit 2022 includes a second screening covering subunit 2023 and a third screening covering subunit 2024 .

[0067] Among them, the second screening and covering subunit 2023 is used to input all non-preset sentence template words in the lyrics document to be adapted into the first preset screening model to filter out preset subject words, and cover the preset subject words with preset markers to generate a first lyrics document; the third screening and covering subunit 2024 is used to input the first lyrics document and the preset subject words into the second preset model to filter out preset associated words, and cover the preset associated words in the first lyrics document with preset markers to generate a second lyrics document, and use the second lyrics document as the target lyrics template.

[0068] In some embodiments, such as the present embodiment, Fig.10 As shown, the second screening covering subunit 2023 includes a fourth screening covering subunit 2025.

[0069] Among them, the fourth screening and covering subunit 2025 is used to input all non-preset sentence template words in the lyrics document to be adapted into the TF-IDF model to screen out preset subject words, and block and cover the preset subject words with preset markers to generate a first lyrics document.

[0070] In some embodiments, such as the present embodiment, Fig.11 As shown, the third screening covering subunit 2024 includes a fifth screening covering subunit 2026 .

[0071] Among them, the fifth screening and covering subunit 2026 is used to input the first lyrics document and the preset keywords into the Word2Vec model to filter out preset associated words, and to cover and mask the preset associated words with preset markers in the first lyrics document to generate a second lyrics document, and use the second lyrics document as the target lyrics template.

[0072] In some embodiments, such as the present embodiment, Fig.12 As shown, the generating unit 203 includes a first generating subunit 2031 and a second generating subunit 2032 .

[0073] Among them, the first generation subunit 2031 is used to input the target lyrics template and target theme words into a preset adaptation model to generate target theme replacement words related to the target theme words; the second generation subunit 2032 is used to fill the target theme replacement words into the target lyrics template to generate a lyrics document related to the target theme words.

[0074] In some embodiments, such as the present embodiment, Fig.13 As shown, the first generating subunit 2031 includes a third generating subunit 2033 and a fourth generating subunit 2034.

[0075] Among them, the third generation subunit 2033 is used to input the target lyrics template and the target theme word into the Bert model to generate target theme candidate words related to the target theme word; the fourth generation subunit 2034 is used to input the target theme candidate words and the target theme word into the Word2Vec model to generate target theme replacement words related to the target theme word.

[0076] The lyrics adaptation device can be implemented in the form of a computer program. Fig.14 Runs on the computer device shown.

[0077] See also Fig.14 , Fig.143 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 300 is a server, and specifically, the server may be an independent server or a server cluster composed of multiple servers.

[0078] See also Fig.14 The computer device 300 includes a processor 302 , a memory and a network interface 305 connected via a system bus 301 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 304 .

[0079] The non-volatile storage medium 303 can store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, the processor 302 can execute a lyrics adaptation method.

[0080] The processor 302 is used to provide computing and control capabilities to support the operation of the entire computer device 300 .

[0081] The internal memory 304 provides an environment for the operation of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute a lyrics adaptation method.

[0082] The network interface 305 is used to communicate with other devices over the network. Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 300 to which the solution of the present application is applied. The specific computer device 300 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0083] The processor 302 is used to run a computer program 3032 stored in a memory to implement the following steps: obtaining a lyric document to be adapted, wherein the lyric document to be adapted includes preset sentence template words, preset subject words, preset associated words and preset weakly associated words; filtering out the preset subject words and the preset associated words in the lyric document to be adapted according to a preset method and a preset screening model, and masking and covering the preset subject words and the preset associated words with preset markers to generate a target lyric template, wherein the target lyric template includes the preset sentence template words and the preset weakly associated words; inputting the target lyric template and the target subject words into a preset adaptation model to generate a lyric document related to the target subject words.

[0084] In certain embodiments, such as the present embodiment, when the processor 302 implements the step of filtering out the preset subject words and the preset associated words in the lyrics document to be adapted according to the preset method and the preset screening model, and covering the preset subject words and the preset associated words with the preset marker to generate a target lyrics template, it specifically implements the following steps: identifying non-preset sentence template words in the lyrics document to be adapted according to the part-of-speech judgment method; inputting all non-preset sentence template words in the lyrics document to be adapted into the preset screening model to filter out the preset subject words and the preset associated words, and covering the preset subject words and the preset associated words with the preset marker to generate a target lyrics template.

[0085] In certain embodiments, such as the present embodiment, when the processor 302 implements the step of inputting all non-preset sentence template words in the lyrics document to be adapted into a preset screening model to filter out the preset subject words and the preset associated words, and covering the preset subject words and preset associated words with preset markers to generate a target lyrics template, it specifically implements the following steps: inputting all non-preset sentence template words in the lyrics document to be adapted into a first preset screening model to filter out preset subject words, and covering the preset subject words with preset markers to generate a first lyrics document; inputting the first lyrics document and the preset subject words into a second preset model to filter out preset associated words, and covering the preset associated words in the first lyrics document with preset markers to generate a second lyrics document, and using the second lyrics document as the target lyrics template.

[0086] In certain embodiments, such as the present embodiment, when the processor 302 implements the step of inputting all non-preset sentence template words in the lyrics document to be adapted into the first preset screening model to filter out preset subject words, and covering the preset subject words with preset markers to generate the first lyrics document, it specifically implements the following steps: inputting all non-preset sentence template words in the lyrics document to be adapted into the TF-IDF model to filter out preset subject words, and covering the preset subject words with preset markers to generate the first lyrics document.

[0087] In certain embodiments, such as the present embodiment, the processor 302 implements the following steps when implementing the step of inputting the first lyrics document and the preset subject words into the second preset model to filter out preset associated words, and masking and covering the preset associated words with preset markers in the first lyrics document to generate a second lyrics document, and using the second lyrics document as the target lyrics template: inputting the first lyrics document and the preset subject words into the Word2Vec model to filter out preset associated words, and masking and covering the preset associated words with preset markers in the first lyrics document to generate a second lyrics document, and using the second lyrics document as the target lyrics template.

[0088] In certain embodiments, such as the present embodiment, when the processor 302 implements the step of inputting the target lyric template and the target theme word into a preset adaptation model to generate a lyric document related to the target theme word, it specifically implements the following steps: inputting the target lyric template and the target theme word into a preset adaptation model to generate a target theme replacement word related to the target theme word; filling the target theme replacement word into the target lyric template to generate a lyric document related to the target theme word.

[0089] In certain embodiments, such as the present embodiment, when the processor 302 implements the step of inputting the target lyrics template and the target theme word into a preset adaptation model to generate a target theme replacement word related to the target theme word, it specifically implements the following steps: inputting the target lyrics template and the target theme word into a Bert model to generate target theme candidate words related to the target theme word; inputting the target theme candidate words and the target theme word into a Word2Vec model to generate a target theme replacement word related to the target theme word.

[0090] It should be understood that in the embodiment of the present application, the processor 302 may be a central processing unit (CPU), and the processor 302 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0091] It is understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0092] Therefore, the present invention also provides a storage medium. The storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When the computer program is executed by a processor, the processor executes the following steps: obtaining a lyrics document to be adapted, wherein the lyrics document to be adapted includes preset sentence template words, preset subject words, preset associated words, and preset weakly associated words; screening out the preset subject words and the preset associated words in the lyrics document to be adapted according to a preset method and a preset screening model, and masking and covering the preset subject words and the preset associated words with preset markers to generate a target lyrics template, wherein the target lyrics template includes the preset sentence template words and the preset weakly associated words; inputting the target lyrics template and the target subject words into a preset adaptation model to generate a lyrics document related to the target subject words.

[0093] In certain embodiments, such as the present embodiment, when the processor executes the computer program to implement the steps of filtering out the preset subject words and the preset associated words in the lyrics document to be adapted according to the preset method and the preset screening model, and masking and covering the preset subject words and the preset associated words with preset markers to generate a target lyrics template, the following steps are specifically implemented: identifying non-preset sentence template words in the lyrics document to be adapted according to the part-of-speech judgment method; inputting all non-preset sentence template words in the lyrics document to be adapted into the preset screening model to filter out the preset subject words and the preset associated words, and masking and covering the preset subject words and preset associated words with preset markers to generate a target lyrics template.

[0094] In certain embodiments, such as the present embodiment, when the processor executes the computer program to implement the step of inputting all non-preset sentence template words in the lyrics document to be adapted into a preset screening model to filter out the preset subject words and the preset associated words, and masking and covering the preset subject words and preset associated words with preset markers to generate a target lyrics template, the following steps are specifically implemented: inputting all non-preset sentence template words in the lyrics document to be adapted into a first preset screening model to filter out preset subject words, and masking and covering the preset subject words with preset markers to generate a first lyrics document; inputting the first lyrics document and the preset subject words into a second preset model to filter out preset associated words, and masking and covering the preset associated words in the first lyrics document with preset markers to generate a second lyrics document, and using the second lyrics document as the target lyrics template.

[0095] In certain embodiments, such as the present embodiment, when the processor executes the computer program to implement the step of inputting all non-preset sentence template words in the lyrics document to be adapted into the first preset screening model to filter out preset subject words, and masking and covering the preset subject words with preset markers to generate the first lyrics document, the following steps are specifically implemented: inputting all non-preset sentence template words in the lyrics document to be adapted into the TF-IDF model to filter out preset subject words, and masking and covering the preset subject words with preset markers to generate the first lyrics document.

[0096] In certain embodiments, such as the present embodiment, when the processor executes the computer program to implement the step of inputting the first lyrics document and the preset subject words into a second preset model to filter out preset associated words, and masking and covering the preset associated words with preset markers in the first lyrics document to generate a second lyrics document, and using the second lyrics document as a target lyrics template, the following steps are specifically implemented: inputting the first lyrics document and the preset subject words into a Word2Vec model to filter out preset associated words, and masking and covering the preset associated words with preset markers in the first lyrics document to generate a second lyrics document, and using the second lyrics document as a target lyrics template.

[0097] In certain embodiments, such as the present embodiment, when the processor executes the computer program to implement the step of inputting the target lyric template and the target subject word into a preset adaptation model to generate a lyric document related to the target subject word, the processor specifically implements the following steps: inputting the target lyric template and the target subject word into a preset adaptation model to generate a target subject replacement word related to the target subject word; filling the target subject replacement word into the target lyric template to generate a lyric document related to the target subject word.

[0098] In certain embodiments, such as the present embodiment, when the processor executes the computer program to implement the step of inputting the target lyrics template and the target theme word into a preset adaptation model to generate a target theme replacement word related to the target theme word, the processor specifically implements the following steps: inputting the target lyrics template and the target theme word into a Bert model to generate target theme candidate words related to the target theme word; inputting the target theme candidate words and the target theme word into a Word2Vec model to generate a target theme replacement word related to the target theme word.

[0099] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0100] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0101] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0102] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0103] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a terminal, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

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

[0105] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

[0106] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A lyrics adaptation method, characterized in that: include: Acquire a lyrics document to be adapted, wherein the lyrics document to be adapted includes preset sentence template words, preset subject words, preset related words, and preset weakly related words; The preset subject words and the preset associated words in the lyrics document to be adapted are screened out according to a preset method and a preset screening model, and the preset subject words and the preset associated words are covered with preset markers to generate a target lyrics template, wherein the target lyrics template includes the preset sentence template words and the preset weakly associated words; Inputting the target lyrics template and the target theme word into a preset adaptation model to generate a lyrics document related to the target theme word; The method of filtering out the preset subject words and the preset associated words in the lyrics document to be adapted according to the preset method and the preset screening model, and covering the preset subject words and the preset associated words with preset markers to generate a target lyrics template includes: Identifying non-preset sentence template words in the lyrics document to be adapted according to a part-of-speech determination method, wherein the parts of speech include nouns, pronouns, verbs, and adjectives; Inputting all non-preset sentence template words in the lyrics document to be adapted into a first preset screening model to screen out the preset subject words, and masking and covering the preset subject words with preset markers to generate a first lyrics document; The first lyrics document and the preset subject words are input into a second preset model to filter out the preset associated words, and the preset associated words in the first lyrics document are masked and covered with the preset markers to generate a second lyrics document, and the second lyrics document is used as a target lyrics template.

2. The method according to claim 1, characterized in that The step of inputting all non-preset sentence template words in the lyrics document to be adapted into a first preset screening model to screen out preset subject words, and covering the preset subject words with preset markers to generate a first lyrics document includes: All non-preset sentence template words in the lyrics document to be adapted are input into the TF-IDF model to filter out preset subject words, and the preset subject words are covered and masked with preset markers to generate a first lyrics document.

3. The method according to claim 1, characterized in that The method comprises: inputting the first lyrics document and the preset subject words into a second preset model to filter out preset associated words, and covering the preset associated words with preset markers in the first lyrics document to generate a second lyrics document, and using the second lyrics document as a target lyrics template, including: The first lyrics document and the preset keywords are input into the Word2Vec model to filter out preset associated words, and the preset associated words are masked and covered with preset markers in the first lyrics document to generate a second lyrics document, and the second lyrics document is used as a target lyrics template.

4. The method according to claim 1, characterized in that: The step of inputting the target lyrics template and the target keyword into a preset adaptation model to generate a lyrics document related to the target keyword includes: Inputting the target lyrics template and the target theme word into a preset adaptation model to generate a target theme replacement word related to the target theme word; The target subject replacement words are filled into the target lyrics template to generate a lyrics document related to the target subject word.

5. The method according to claim 4, characterized in that The step of inputting the target lyrics template and the target subject word into a preset adaptation model to generate a target subject replacement word related to the target subject word includes: Inputting the target lyrics template and the target subject word into a Bert model to generate target subject candidate words related to the target subject word; The target topic candidate words and the target topic word are input into a Word2Vec model to generate a target topic replacement word related to the target topic word.

6. A lyrics adaptation device, characterized in that: include: An acquisition unit, used for acquiring a lyrics document to be adapted, wherein the lyrics document to be adapted includes preset sentence template words, preset subject words, preset related words and preset weakly related words; A screening and covering unit, used for screening out the preset subject words and the preset associated words in the lyrics document to be adapted according to a preset method and a preset screening model, and covering and masking the preset subject words and the preset associated words with preset markers to generate a target lyrics template, wherein the target lyrics template includes the preset sentence template words and the preset weakly associated words; A generating unit, configured to input the target lyrics template and the target theme word into a preset adaptation model to generate a lyrics document related to the target theme word; Wherein, the screening coverage unit comprises: A judgment unit, used for identifying non-preset sentence template words in the lyrics document to be adapted according to a part-of-speech judgment method, wherein the part-of-speech includes noun, pronoun, verb and adjective; The second screening and covering subunit is used to input all non-preset sentence template words in the lyrics document to be adapted into the first preset screening model to screen out the preset subject words, and to cover and mask the preset subject words with preset markers to generate a first lyrics document; The third screening and covering sub-unit is used to input the first lyrics document and the preset subject words into the second preset model to screen out the preset associated words, and to cover and mask the preset associated words in the first lyrics document with the preset marker to generate a second lyrics document, and use the second lyrics document as the target lyrics template.

7. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 can be implemented.