Music description text generation method and device, electronic equipment, medium and product
By generating prompt words and inputting a multimodal large language model, the problem of insufficient emotional and atmosphere description of traditional neural network models in music description text is solved, and the accuracy and vividness of music description text is improved.
Patent Information
- Application Number
- CN202411342693.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-13
AI Technical Summary
Traditional neural network models lack the accuracy and vividness of the description of emotions and atmosphere when generating music description text.
By obtaining music data and initial music description text, a prompt word represents emotional and atmosphere description requirements are generated, and the music data and prompt word vectors are input to the preset multimodal large language model to output the target music description text.
It improves the accuracy and vividness of the emotional and atmosphere description of the music description text, making the generated text more comprehensive and profound, and can better reflect the emotions and atmosphere of the music data.
Smart Images

Figure CN119128209A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing, and in particular to a method, device, electronic device, computer-readable storage medium and computer program product for generating music description text. Background Art
[0002] Music Caption text is a text description of the music content, including the content, emotion, atmosphere and other aspects of the music. It is widely used in music search, generating subtitles for the hearing-impaired, music recommendation and other scenarios. Currently, the commonly used music description generation scheme mainly generates corresponding music description text based on the input music output by using an end-to-end neural network architecture model. Although the end-to-end neural network model performs well in audio feature extraction and text generation efficiency, the content of the output music description text is insufficient in terms of accuracy and vividness in the description of emotion and atmosphere.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of this application is to provide a method, device, electronic device, computer-readable storage medium and computer program product for generating music description text, aiming to solve the technical problem that the music description text output by the traditional neural network model lacks accuracy and vividness in the description of emotions and atmosphere.
[0005] To achieve the above object, the present application proposes a method for generating music description text, the method comprising:
[0006] Acquire music data, and acquire initial music description text corresponding to the music data;
[0007] Generate corresponding prompt words according to the initial music description text, wherein the prompt words are used to characterize the content of the initial music description text and the description requirements for the emotion and / or atmosphere of the music description text;
[0008] The vectors corresponding to the music data and the prompt words are respectively input into a preset target multimodal large language model, and a target music description text is output through the multimodal large language model.
[0009] In one embodiment, the step of generating corresponding prompt words according to the initial music description text includes:
[0010] Acquire a music description requirement template, wherein the music description requirement template is used to represent the description requirement for the emotion and / or atmosphere of the music description text;
[0011] The music description requirement template is combined with the initial music description text to obtain corresponding prompt words.
[0012] In one embodiment, the vector corresponding to the music data is an audio feature vector, and the vector corresponding to the prompt word is a vector representation;
[0013] The step of inputting the vectors corresponding to the music data and the prompt word into a preset multimodal large language model comprises:
[0014] Encoding the music data to generate an audio feature vector;
[0015] Extracting a vector representation of the prompt word;
[0016] The audio feature vector and the vector representation are input into the multimodal large language model.
[0017] In one embodiment, the step of obtaining the initial music description text corresponding to the music data includes:
[0018] Extracting audio feature vectors of the music data through a convolutional neural network;
[0019] The audio feature vector is input into a preset codec architecture network, and an initial music description text is generated through the codec architecture network.
[0020] In one embodiment, the step of outputting the target music description text through the multimodal large language model includes:
[0021] The vectors corresponding to the music data and the prompt word are respectively fused through the multimodal transformer architecture of the multimodal large language model to obtain a fused feature vector;
[0022] The fused feature vector is recognized and processed by the multimodal large language model, and a corresponding target music description text is output.
[0023] In one embodiment, the method for generating music description text further includes:
[0024] Acquire multiple sets of training music data and corresponding prompt words and real music description texts, and divide the data sets consisting of each set of the training music data, the prompt words and the real music description text into a training set, a validation set and a test set;
[0025] The preset initial multimodal large language model is trained by using the training set, and the performance evaluation and parameter optimization of the trained initial multimodal large language model are performed by using the validation set and the test set;
[0026] When the accuracy of the music description text output by the initial multimodal large language model reaches a preset threshold, the initial multimodal large language model is set as the target multimodal large language model.
[0027] In addition, the present application also provides a music description text generation device, the music description text generation device comprising:
[0028] A data acquisition module, used to acquire music data and obtain initial music description text corresponding to the music data;
[0029] A prompt word generation module, used to generate corresponding prompt words according to the initial music description text, wherein the prompt words are used to characterize the content of the initial music description text and the description requirements for the emotion and / or atmosphere of the music description text;
[0030] The text generation module is used to input the vectors corresponding to the music data and the prompt words into a preset target multimodal large language model, and output a target music description text through the multimodal large language model.
[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the music description text generation method as described above.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the music description text generation method described above are implemented.
[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the music description text generation method as described above are implemented.
[0034] The present application proposes a method for generating a music description text. In the method, music data is first obtained, and an initial music description text corresponding to the music data is obtained. The initial music description text may be a text that needs to be further enriched with descriptions of emotions and atmosphere, and then corresponding prompt words are generated according to the initial music description text, wherein the prompt words are used to characterize the content of the initial music description text and the description requirements for the emotions and / or atmosphere of the music description text. The prompt words can well bring into play the potential and performance of a multimodal large language model, and reflect the description requirements for the emotions or atmosphere of the music description text generated this time. Finally, the music data and the prompt words are combined into a single entity. The vectors corresponding to the words are respectively input into a preset target multimodal large language model, and the target music description text is output through the multimodal large language model. The technical solution of the present application combines the information of the two modes of audio and text, improves the multimodal large language model's ability to understand music data, and the generated music description text will be more comprehensive and in-depth. The target multimodal large language model is a pre-trained multimodal large language model that can fuse and process the vectors of the input music data and the vectors of the prompt words, thereby generating a target music description text with higher accuracy and vividness in describing the emotions and atmosphere of the music data, which can better reflect the emotions and atmosphere of the music data and improve the quality of the music description text. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0037] Figure 1 A flowchart of the first embodiment of the method for generating music description text of the present application is provided;
[0038] Figure 2 A feasible data flow diagram in the method for generating music description text in this application;
[0039] Figure 3 A schematic diagram of a process for training a multimodal large language model in an embodiment of the method for generating music description text of the present application;
[0040] Figure 4 This is a schematic diagram of the structure of a device for generating music description text in an embodiment of the present application;
[0041] Figure 5 Schematic diagram of the device structure of the hardware operating environment involved in the music description text generation method in the embodiment of the present application.
[0042] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0043] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0044] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0045] The execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, a server, etc., or an electronic device or a control device capable of realizing the above functions. The following takes the server as an execution subject as an example to illustrate this embodiment and the following embodiments.
[0046] The present application embodiment provides a method for generating a music description text, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for generating music description text of the present application, and the method for generating music description text includes:
[0047] Step S10, obtaining music data and obtaining initial music description text corresponding to the music data;
[0048] The music data is an audio file for which a music description text needs to be generated, and the initial music description text corresponding to the audio data is a music description text obtained by a traditional music description text generation method, such as manual writing, generation by a traditional end-to-end neural network model, etc. The initial music description text has a certain reference value in describing the music data, but it is lacking in description of emotions and atmosphere, and is not precise, vivid, or appealing enough.
[0049] Step S20, generating corresponding prompt words according to the initial music description text, wherein the prompt words are used to characterize the content of the initial music description text and the description requirements for the emotion and / or atmosphere of the music description text;
[0050] In an embodiment of the present application, prompt words are used to be input into a multimodal large language model so that the multimodal large language model can understand the requirements for the generated music description text. Specifically, in step S20, a music description text is generated based on the determined initial music description text to prompt the multimodal large language model to generate a music description text with higher requirements for emotion and / or atmosphere.
[0051] Exemplarily, the prompt words mainly include two parts, one part is the content of the initial music description text, and the other part is the description requirements about emotions and / or atmosphere.
[0052] Step S30, inputting the vectors corresponding to the music data and the prompt words into a preset target multimodal large language model, and outputting the target music description text through the multimodal large language model.
[0053] Among them, the target multimodal large language model is a pre-trained multimodal large language model. The multimodal large language model can process input data of multiple modes (such as audio, image, text, etc.), so it can better and fully utilize the acquired music data and initial music description text. Compared with the initial music description text, the target music description text has been further processed by the multimodal large language model and utilizes the excellent natural language processing capabilities of the multimodal large language model, so the description of the content, emotion and atmosphere of the music data is more accurate, deeper, more vivid and more humane.
[0054] In the embodiment of the present application, the powerful language understanding and generation capabilities of the multimodal large language model are utilized to make the generated music description text more accurate and vivid, and to better reflect the emotion and atmosphere of the music. Compared with the traditional technical solution, the music description text generation method of the embodiment of the present application combines the information of the two modes of audio (music data) and text (prompt words), which improves the understanding ability of the multimodal large language model to the music content, and the generated music description text is more comprehensive and in-depth.
[0055] The target music description text generated in the embodiment of the present application can be used in various scenarios such as music search, generating subtitles for the hearing-impaired, music recommendation, etc., which can effectively improve the user experience.
[0056] The embodiment of the present application provides a method for generating a music description text. In the method for generating a music description text, music data is first obtained, and an initial music description text corresponding to the music data is obtained. The initial music description text may be a text that needs to be further enriched with descriptions of emotions and atmosphere, and then corresponding prompt words are generated according to the initial music description text, wherein the prompt words are used to characterize the description requirements of the emotions and / or atmosphere of the music description text. The prompt words can well bring into play the potential and performance of a multimodal large language model, and reflect the description requirements of the emotions or atmosphere of the music description text generated this time. Finally, the music data and the prompt words are combined into a single entity. The vectors corresponding to the words are respectively input into a preset target multimodal large language model, and the target music description text is output through the multimodal large language model. The technical solution of the present application combines the information of the two modes of audio and text, improves the multimodal large language model's ability to understand music data, and the generated music description text will be more comprehensive and in-depth. The target multimodal large language model is a pre-trained multimodal large language model that can fuse and process the vectors of the input music data and the vectors of the prompt words, thereby generating a target music description text with higher accuracy and vividness in describing the emotions and atmosphere of the music data, which can better reflect the emotions and atmosphere of the music data.
[0057] Furthermore, in a feasible implementation manner, the step of generating corresponding prompt words according to the initial music description text includes:
[0058] Step S21, obtaining a music description requirement template, wherein the music description requirement template is used to represent the description requirement for the emotion and / or atmosphere of the music description text;
[0059] Step S22, combining the music description requirement template with the initial music description text to obtain corresponding prompt words.
[0060] The music description requirement template can be determined according to the actual needs of the user. For example, different music description requirement templates may include different description requirements for the music description text, such as description requirements for content, emotion, atmosphere, etc. In another feasible embodiment, the music description requirement template may also include detailed requirements for the number of words, format, target group, etc., so as to generate a target music description text that is more in line with the browsing habits and preferences of the target group.
[0061] For example, the prompt words obtained by combining the music description requirement template with the initial music description text may include: This is a preliminary description of a music clip: {initial music description text}. Please generate a detailed music description text containing the music emotion, atmosphere and main content based on the provided music clip and its preliminary description.
[0062] In the embodiments of the present application, prompt words are designed and optimized to fully utilize the potential of a large multimodal language model and improve the quality and efficiency of music description text generation.
[0063] In a feasible embodiment, the vector corresponding to the music data is an audio feature vector, and the vector corresponding to the prompt word is a vector representation;
[0064] The step of inputting the vectors corresponding to the music data and the prompt word into a preset multimodal large language model comprises:
[0065] Step S31, encoding the music data to generate an audio feature vector;
[0066] Step S32, extracting the vector representation of the prompt word;
[0067] Step S33: input the audio feature vector and the vector representation into the multimodal large language model.
[0068] It is understandable that in order for the multimodal large language model to better understand the meaning of the music data and prompt words, they need to be converted into vector form.
[0069] Specifically, when extracting feature vectors of music data, the music data may be encoded by an audio encoder (such as a VGGish model, an audio vector extraction model) to generate corresponding audio feature vectors.
[0070] Exemplarily, when extracting feature vectors of music data, the audio signal of the music data is first preprocessed to extract useful features, such as converting the audio signal into a spectrogram, Mel-frequency cepstral coefficients (MFCC) or other audio features, and then quantized and encoded. The extracted audio features are quantized and converted into a sequence form suitable for processing by the Transformer model, such as converting audio frames or feature vectors into tokens.
[0071] When extracting the vector representation (embedding) of the prompt word, we must first perform text segmentation. The text content of the input prompt word is segmented and split into tokens, and then encoded. The segmented text tokens can be converted into vector representations. This is usually achieved through an embedding layer, which maps each token into a high-dimensional vector space to obtain the embedding corresponding to the prompt word.
[0072] In a feasible embodiment, the step of obtaining the initial music description text corresponding to the music data includes:
[0073] Step S11, extracting the audio feature vector of the music data through a convolutional neural network;
[0074] Step S12, inputting the audio feature vector into a preset codec architecture network, and generating an initial music description text through the codec architecture network.
[0075] An embodiment of the present application provides a method for obtaining initial music description text corresponding to music data, which specifically utilizes an end-to-end neural network (such as a convolutional neural network combined with an encoder-decoder architecture) commonly used in the market to generate the initial music description text.
[0076] This end-to-end neural network can be understood as a pre-trained end-to-end music description generation model, which includes a convolutional neural network (CNN) and an encoder-decoder architecture network (such as a Transformer network or an RNN network). After the music data is input into the convolutional neural network, the convolutional neural network can extract the audio feature vector corresponding to the music data (such as converting audio frames or feature vectors into tokens). In addition, the encoder-decoder architecture network has been pre-trained and can output the corresponding initial music description text based on the input audio feature vector according to the features generated by the learned music description text. The music description text is relatively accurate in its targeted description of audio features and overview including lyrics, but is not accurate and vivid enough in terms of emotions and atmosphere, and the text content needs to be further enriched.
[0077] In a feasible embodiment, the step of outputting the target music description text through the multimodal large language model includes:
[0078] Step S34, fusing the vectors corresponding to the music data and the prompt words respectively through the multimodal transformer architecture of the multimodal large language model to obtain a fused feature vector;
[0079] Step S35, identifying and processing the fused feature vector through a multimodal large language model, and outputting the corresponding target music description text.
[0080] The multimodal large language model in the embodiment of the present application can adopt the Transformer (converter) architecture. The Transformer architecture is a powerful deep learning model that combines the advantages of the Transformer model and can process and associate information from multiple modalities. Moreover, the multimodal Transformer architecture can uniformly process data from different modalities and convert them into labeled embeddings in a shared space, thereby realizing cross-modal information integration. The Transformer architecture can also capture the dependencies between different modal data through the self-attention mechanism, and improve the overall information representation capability. Especially in the field of natural language processing (NLP), the multimodal Transformer can combine additional information such as images and audio to improve the performance of NLP tasks.
[0081] In an embodiment of the present application, the vectors (audio feature vectors and vector representations) corresponding to the music data and the prompt words can be fused through a multimodal transformer architecture. Specifically, the multimodal Transformer architecture can convert the audio feature vectors corresponding to the music data and the vector representations of the prompt words into high-dimensional vector representations through their respective embedding layers, and fuse them to obtain a fused feature vector. This vector will serve as the input of the Transformer model. It should be noted that in the multimodal Transformer architecture, special position codes or modal identifiers can be added to the embedding vectors of different modalities to help the model distinguish between data of different modalities.
[0082] Furthermore, in the process of identifying and processing the fused feature vector through the multimodal large language model, a multimodal self-attention mechanism can be introduced. The core of the Transformer model is the self-attention mechanism. In the multimodal Transformer model, this mechanism is extended to be able to process inputs from multiple modalities. In addition, in the self-attention calculation process, the model considers tokens from all modal data, calculates the similarity and weight between them, and thus captures the dependencies between different modalities. In the multimodal Transformer architecture, the decoder is responsible for generating new text content based on the output of the encoder and the generated text information. It should be noted that the decoder also contains a self-attention mechanism and a cross-modal attention mechanism to ensure that information from multiple modalities can be fully considered when generating text. The final output of the decoder is converted into a probability distribution of each token in the generated vocabulary after linear transformation and Softmax function processing. According to this probability distribution, the model can select the most likely token as part of the output text. By continuously iterating this probability selection process, a complete text sequence can be generated, and the target music description text is finally output.
[0083] In order to facilitate understanding of the music description text generation method provided in the embodiment of the present application, combined with the contents of the aforementioned embodiments, the data flow of a feasible music description text generation method in the embodiment of the present application is schematically shown as follows: Figure 2 As shown, first, the music data is processed by an end-to-end music description generation model to output an initial music description text, and then a prompt word Prompt is obtained in combination with the music description requirement template, such as "This is a preliminary description of a music clip: {initial music description text}. Please generate a detailed music description text containing the music emotion, atmosphere and main content based on the provided music clip and its preliminary description", and it is used as the descriptive text Instruction for feature extraction to obtain a vector representation, and the vector representation is fused with the audio feature vector of the music data after audio decoding Audio Encoder to obtain a fused feature vector and input it into a multimodal large language model (LMM, Large Language Models), and output the target music description text.
[0084] In one possible embodiment, referring to Figure 3 , the music description text generation method also includes:
[0085] Step A10, obtaining multiple sets of training music data and corresponding prompt words and real music description texts, and dividing the data set consisting of the training music data, the prompt words and the real music description text into a training set, a validation set and a test set;
[0086] Step A20, training a preset initial multimodal large language model through a training set, and performing performance evaluation and parameter optimization on the trained initial multimodal large language model through a validation set and a test set;
[0087] Step A30: When the accuracy of the music description text output by the initial multimodal large language model reaches a preset threshold, the initial multimodal large language model is set as the target multimodal large language model.
[0088] The embodiment of the present application also provides a method for training a multimodal large language model, so that the multimodal large language model can generate a target music description text with more accurate and vivid description of emotions and atmosphere based on the input music data and prompt words.
[0089] Specifically, a large amount of music data and the corresponding initial music description text are first collected to ensure data diversity and high quality, and then the collected music data is preprocessed, including noise reduction, standardization and feature extraction, to facilitate model training. It should be noted that the prompt words are generated based on the initial music description text of the music data and the music description requirement template, and the generation method is consistent with step S21 to step S22. During the model training process, the training music data and prompt words are used as data input to the model, and the real music description text is used as the real label corresponding to the training music data, which is used to calculate the loss function value and evaluate the accuracy and quality of the music description text output by the model prediction.
[0090] In the data set, each set of data includes a training music data, an initial music description text and prompt words corresponding to the training music data, and a real music description text corresponding to the training music data, wherein the initial music description text can be a music description text generated by a traditional end-to-end neural network model, and the real music description text is a music description text that describes the emotions and atmosphere of the music data more accurately, vividly, and humanely, and can be obtained by manual writing. The training set, validation set, and test set include multiple sets of training music data, prompt words, and real music description texts, respectively. The data volume of the training set, validation set, and test set can be freely set as needed. The data volume of the training set accounts for a relatively high proportion, while the proportion of the validation set and the test set is relatively low.
[0091] In the process of model training, firstly, the initial multimodal large language model pre-built is trained through multiple sets of data in the training set. The initial multimodal large language model can be a multimodal large language model that already has the ability to understand and process natural language. The training set mainly fine-tunes the initial multimodal large language model so that it can effectively integrate audio and text information and generate high-quality music descriptions. The main training process can include: inputting the training music data and prompt words in the training set into the initial multimodal large language model, predicting and outputting the corresponding music description text by the initial multimodal large language model, calculating the current loss function value of the model through the real music description text corresponding to the training music data and the output music description text, and iteratively adjusting the model parameters so that the loss function value changes in a smaller direction; after reaching a certain number of iterations, verifying the performance of the model through the validation set data; continuing to optimize the model parameters according to the change in performance, so that the performance of the model is getting better and better; finally, testing the accuracy of the model and the instructions of the output music description text through the test set data to see if they meet expectations (for example, the accuracy reaches a preset threshold), if so, stopping the training and obtaining the target multimodal large language model.
[0092] In another feasible embodiment, in order to ensure that the target multimodal large language model can meet the application requirements, manual verification and adjustment are required, and finally the adjusted target multimodal large language model is integrated into the application system to meet the user's music search, subtitle generation, music recommendation and other needs.
[0093] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the method for generating music description text of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0094] The present application also provides a device for generating a music description text, referring to Figure 4 , the music description text generating device comprises:
[0095] The data acquisition module 10 is used to acquire music data and obtain the initial music description text corresponding to the music data;
[0096] A prompt word generation module 20, used to generate corresponding prompt words according to the initial music description text, wherein the prompt words are used to characterize the content of the initial music description text and the description requirements for the emotion and / or atmosphere of the music description text;
[0097] The text generation module 30 is used to input the vectors corresponding to the music data and the prompt words into a preset target multimodal large language model, and output a target music description text through the multimodal large language model.
[0098] In one embodiment, the prompt word generating module 20 is further used for:
[0099] Acquire a music description requirement template, wherein the music description requirement template is used to represent the description requirement for the emotion and / or atmosphere of the music description text;
[0100] The music description requirement template is combined with the initial music description text to obtain corresponding prompt words.
[0101] In one embodiment, the vector corresponding to the music data is an audio feature vector, and the vector corresponding to the prompt word is a vector representation;
[0102] The text generation module 30 is also used for:
[0103] Encoding the music data to generate an audio feature vector;
[0104] Extracting a vector representation of the prompt word;
[0105] The audio feature vector and the vector representation are input into the multimodal large language model.
[0106] The data acquisition module 10 is also used for:
[0107] Extracting audio feature vectors of the music data through a convolutional neural network;
[0108] The audio feature vector is input into a preset codec architecture network, and an initial music description text is generated through the codec architecture network.
[0109] The text generation module 30 is also used for:
[0110] The vectors corresponding to the music data and the prompt word are respectively fused through the multimodal transformer architecture of the multimodal large language model to obtain a fused feature vector;
[0111] The fused feature vector is recognized and processed by the multimodal large language model, and a corresponding target music description text is output.
[0112] The music description text generation device further includes a model training module, which is used to:
[0113] Acquire multiple sets of training music data and corresponding prompt words and real music description texts, and divide the data sets consisting of each set of the training music data, the prompt words and the real music description text into a training set, a validation set and a test set;
[0114] The preset initial multimodal large language model is trained by using the training set, and the performance evaluation and parameter optimization of the trained initial multimodal large language model are performed by using the validation set and the test set;
[0115] When the accuracy of the music description text output by the initial multimodal large language model reaches a preset threshold, the initial multimodal large language model is set as the target multimodal large language model.
[0116] The music description text generation device provided by the present application adopts the music description text generation method in the above embodiment, which can solve the technical problem that the music description text output by the traditional neural network model is not accurate and vivid enough in describing emotions and atmosphere. Compared with the prior art, the beneficial effects of the music description text generation device provided by the present application are the same as the beneficial effects of the music description text generation method provided by the above embodiment, and the other technical features in the music description text generation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0117] The present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the music description text generation method in the above-mentioned embodiment 1.
[0118] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic devices in the embodiments of the present application may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0119] like Figure 5As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0120] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0121] The electronic device provided by the present application adopts the method for generating a music description text in the above embodiment, which can solve the technical problem that the music description text output by the traditional neural network model is not accurate and vivid enough in describing emotions and atmosphere. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the method for generating a music description text provided by the above embodiment, and the other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be described in detail here.
[0122] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0123] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0124] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the music description text generation method in the above-mentioned embodiment.
[0125] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0126] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0127] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device executes: obtaining music data and obtaining an initial music description text corresponding to the music data; generating corresponding prompt words according to the initial music description text, wherein the prompt words are used to characterize the content of the initial music description text and the description requirements for the emotion and / or atmosphere of the music description text; inputting the vectors corresponding to the music data and the prompt words into a preset target multimodal large language model, and outputting the target music description text through the multimodal large language model.
[0128] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0129] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0130] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0131] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned music description text generation method, and can solve the technical problem that the music description text output by the traditional neural network model is not accurate and vivid enough in describing emotions and atmosphere. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the music description text generation method provided by the above-mentioned embodiment, and will not be repeated here.
[0132] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned music description text generation method when executed by a processor.
[0133] The computer program product provided by the present application can solve the technical problem that the music description text output by the traditional neural network model is not accurate and vivid enough in describing emotions and atmosphere. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the music description text generation method provided by the above embodiment, which will not be described in detail here.
[0134] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for generating music description text, It is characterized in that The music description text generation method comprises: Acquire music data, and acquire initial music description text corresponding to the music data; Generate corresponding prompt words according to the initial music description text, wherein the prompt words are used to characterize the content of the initial music description text and the description requirements for the emotion and / or atmosphere of the music description text; The vectors corresponding to the music data and the prompt words are respectively input into a preset target multimodal large language model, and a target music description text is output through the multimodal large language model.
2. The method for generating a music description text according to claim 1, It is characterized in that The step of generating corresponding prompt words according to the initial music description text comprises: Acquire a music description requirement template, wherein the music description requirement template is used to represent the description requirement for the emotion and / or atmosphere of the music description text; The music description requirement template is combined with the initial music description text to obtain corresponding prompt words.
3. The method for generating a music description text according to claim 1, It is characterized in that The vector corresponding to the music data is an audio feature vector, and the vector corresponding to the prompt word is a vector representation; The step of inputting the vectors corresponding to the music data and the prompt word into a preset multimodal large language model comprises: Encoding the music data to generate an audio feature vector; Extracting a vector representation of the prompt word; The audio feature vector and the vector representation are input into the multimodal large language model.
4. The method for generating a music description text according to claim 1, It is characterized in that The step of obtaining the initial music description text corresponding to the music data comprises: Extracting audio feature vectors of the music data through a convolutional neural network; The audio feature vector is input into a preset codec architecture network, and an initial music description text is generated through the codec architecture network.
5. The method for generating a music description text according to claim 1, It is characterized in that The step of outputting the target music description text through the multimodal large language model comprises: The vectors corresponding to the music data and the prompt word are respectively fused through the multimodal transformer architecture of the multimodal large language model to obtain a fused feature vector; The fused feature vector is recognized and processed by the multimodal large language model, and a corresponding target music description text is output.
6. The method for generating a music description text according to any one of claims 1 to 5, It is characterized in that The music description text generation method also includes: Acquire multiple sets of training music data and corresponding prompt words and real music description texts, and divide the data sets consisting of each set of the training music data, the prompt words and the real music description text into a training set, a validation set and a test set; The preset initial multimodal large language model is trained by using the training set, and the performance evaluation and parameter optimization of the trained initial multimodal large language model are performed by using the validation set and the test set; When the accuracy of the music description text output by the initial multimodal large language model reaches a preset threshold, the initial multimodal large language model is set as the target multimodal large language model.
7. A device for generating music description text, It is characterized in that The music description text generating device comprises: A data acquisition module, used to acquire music data and obtain initial music description text corresponding to the music data; A prompt word generation module, used to generate corresponding prompt words according to the initial music description text, wherein the prompt words are used to characterize the content of the initial music description text and the description requirements for the emotion and / or atmosphere of the music description text; The text generation module is used to input the vectors corresponding to the music data and the prompt words into a preset target multimodal large language model, and output a target music description text through the multimodal large language model.
8. An electronic device, It is characterized in that The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for generating a music description text according to any one of claims 1 to 6.
9. A storage medium, It is characterized in that The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the music description text generation method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
