Method for automatically generating music description text based on large language model with music understanding ability
By using multiple large language models with music understanding capabilities for joint annotation in automatic music annotation, and using a variety of prompt words and templates to generate music description text, the problem of lack of music information and model bias in the existing technology is solved, and the More accurate music description text generation.
Patent Information
- Application Number
- CN202410994241.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-18
AI Technical Summary
Existing automatic music annotation methods lack information about the music itself, causing the generated description text to be inaccurate. In addition, a single model has bias issues in small-scale data sets, making it difficult to train high-quality diffusion models for content generation.
Use a large language model based on music understanding capabilities, use data enhancement methods to expand the data set without changing the accuracy of the existing data set, train multiple models for joint annotation, and use a variety of different prompt words and templates to generate music Describe text to reduce single-model bias.
It improves the accuracy of music description text, reduces the bias of a single model under small-scale data sets, and generates description texts that are more accurate and reliable.
Smart Images

Figure CN118800239A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automatic music annotation technology, and in particular to a method for automatically generating music description text based on a large language model with music understanding capabilities. Background Technology
[0002] Diffusion models have demonstrated superior performance in text-to-image and text-to-video generation, and research has shown that this model architecture can be well applied to text-to-music generation. However, training high-quality diffusion models for content generation often requires massive amounts of labeled datasets. Unlike text and images, building music-text datasets typically requires time-consuming and laborious manual annotation by a large number of people with professional music knowledge, making it difficult to construct large-scale labeled datasets using such methods. In comparison, using models for automatic music annotation is more practical.
[0003] Automatic music annotation is a practical and challenging task in the field of artificial intelligence. It falls under the category of music processing tasks, aiming to use automated methods to determine various characteristics of unlabeled music and add annotation information. Automatically generating music description text is a branch of automatic music annotation. Unlike tasks that automatically classify music or add labels, it involves automatically adding annotations using standard natural language, which places higher demands on the model's natural language understanding capabilities.
[0004] In recent years, researchers have devised methods to improve the performance of automated tools in generating music description text. One such method involves using large language models to expand label information from massive music-label datasets into description text. This approach fully leverages the powerful natural language understanding capabilities of large language models and the sheer size of music-label datasets, achieving excellent results. However, due to the input modality limitations of large language models, the generation process lacks the involvement of information from the music itself, potentially leading to inaccurate generated description text. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of existing music-text datasets, which are insufficient in scale, and the lack of information about the music itself in existing automatic annotation methods. This invention proposes a method for automatically generating music description text based on a large language model with music understanding capabilities. This method uses mature data augmentation techniques of large language models to expand the dataset without changing its accuracy. This allows multiple models to be trained for joint annotation, reducing the bias problem of a single model in small-scale datasets, thereby obtaining more accurate music description text.
[0006] The specific technical solution for achieving the objective of this invention is as follows: A method for automatically generating music description text based on a large language model with music understanding capabilities, the method comprising the following steps: 1) Select an existing small-scale manually annotated music dataset with music-description text-music tags as the base dataset, and use a large language model to extract the music feature categories contained in the music description text in the dataset; 2) Set a threshold to filter the extracted music feature categories; 3) Construct various basic prompt words and prompt word templates. Fill the prompt word templates with the music tags and filtered music feature categories from the dataset in step 1. Combine the constructed basic prompt words to obtain various training prompt words. 4) Use the obtained training prompts to train multiple large language models with music comprehension capabilities; 5) Select an existing dataset with music-music tags, fill the music tags from the dataset into the prompt word template constructed in step 3), and combine it with the basic prompt words constructed in step 3) to obtain a variety of different annotation prompt words; 6) Using the obtained different annotation prompts, input them into the corresponding trained large language models with music understanding capabilities to automatically annotate the music and generate music description text.
[0007] Furthermore, step 1) specifically includes: 1.1: Select an existing music dataset with music-description text-music tags and construct feature extraction prompts; 1.2: Input the feature extraction prompts into the large language model to obtain the music feature categories contained in the descriptive text.
[0008] Furthermore, step 3) includes various basic prompt words and prompt word templates, including: regular prompt words, feature prompt word templates, and task prompt word templates.
[0009] Furthermore, step 4) specifically includes: 4.1: Use the various training cue words obtained in step 3, the music fragments and music description text in the dataset of step 1 as multiple different cue word-music-text input pairs, wherein the input pairs have the same music and text, but different cue words; 4.2: Train multiple different large language models with music understanding capabilities using the same training parameters and multiple different input pairs constructed in 4.1.
[0010] Furthermore, step 5) specifically includes: 5.1: Select a dataset containing music tags and music as the dataset to be labeled; 5.2: Fill the music labels in the dataset to be labeled and the feature category results obtained in step 2 into the prompt word template constructed in step 3. Combine the basic prompt words constructed in step 3 to obtain a variety of different prompt words for labeling.
[0011] Furthermore, step 6) specifically includes: 6.1: Use the various annotation prompts obtained in step 5 and the music fragments in the dataset to be annotated in step 5 as multiple different prompt-music input pairs, wherein the input pairs have the same music but different prompts; 6.2: Input the multiple different input pairs obtained in step 6.1 into the multiple large language models with music understanding trained in step 4, wherein the prompt word templates used to construct the prompt words for training and the prompt words used for annotation correspond one-to-one; 6.3: The results of each round of multiple large language models with music understanding capabilities after passing through the Softmax function are weighted and averaged to obtain the final output of the current round. This average is then fed into the input part for the next round of prediction until the sentence end identifier appears, generating the music description text. Beneficial effects
[0012] This invention addresses the issue of insufficient music-related information in annotation processes by employing large language models with music understanding capabilities. Furthermore, adding music understanding functionality to large language models requires fine-tuning existing models; however, publicly available music-text datasets are relatively small. Training on small datasets leads to significant bias in individual models, insufficient for achieving satisfactory fine-tuning results. Therefore, this invention proposes a data augmentation method using mature large language models to expand the dataset without compromising its accuracy. This allows for the training of multiple models for joint annotation, reducing the bias inherent in individual models on small datasets and resulting in more accurate music descriptions. Attached Figure Description
[0013] Figure 1 This is a flowchart of the present invention; Figure 2 This is a flowchart of an embodiment of the present invention. Detailed Implementation
[0014] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0015] See Figure 1 The present invention provides a method for automatically generating music description text based on a large language model with music understanding capabilities, comprising the following specific steps: 1) Select an existing small-scale manually annotated music dataset with music, descriptive text, and music tags as the base dataset, and use a large language model to extract the music feature categories contained in the music descriptive text of this dataset. 1.1: MusicCaps was selected as an existing music dataset with music, descriptive text, and music tags to construct a feature extraction cue word framework; 1.2: Using a feature extraction cue word framework to guide the BaiChuan2 model to output the types of music features contained in the music description text.
[0016] 2) Set a threshold line to filter the extracted music feature categories, retaining feature categories that appear more than 300 times.
[0017] 3) Construct various basic prompt words and prompt word templates, fill each template with music tags and filtered music feature categories from MusicCaps, and combine them with the constructed basic prompt words to obtain various training prompt words; 3.1: Construct templates for regular prompt words, feature prompt words, and task prompt words; 3.2: Fill the filtered music feature categories into the feature prompt word template to obtain feature prompt words; 3.3: Fill the task prompt word template with the music tag information and filtered music feature categories from MusicCaps to obtain the task prompt words; 4) Use the obtained training prompts to train multiple large language models with music comprehension capabilities; 4.1: Use the three cue words obtained in step 3, the music clips in MusicCaps, and the music description text as three different cue word-music-text input pairs. These input pairs have the same music and text, but different cue words. 4.2: Using MU-LLaMA as a large language model architecture with music understanding capabilities, three different models were trained using the same training parameters and the three different input pairs constructed in 4.1. 5) Select an existing dataset with music-music tags, and fill the music tags from the dataset into the prompt word template built in step 3) to create a variety of different annotation prompt words; 5.1: MagnaTagATune was selected as the dataset to be labeled, containing both labels and music. 5.2: Fill the music tags in MagnaTagATune and the feature category results obtained in step 2 into the two prompt word templates constructed in step 3. Combine them with the regular prompt words constructed in step 3.1 to obtain three different prompt words for annotation: regular prompt words, feature prompt words, and task prompt words.
[0018] 6) Use the three types of annotation prompts to guide the corresponding trained large language models with music understanding capabilities. Use these models together to automatically annotate music and obtain the final music description text. 6.1: Use the three types of tagging prompts obtained in step 5 and music clips from MagnaTagATune as multiple different prompt-music input pairs. These input pairs have the same music but different prompts. 6.2: Input the multiple different input pairs obtained in step 6.1 into the multiple large language models with music understanding trained in step 4, wherein the prompt word templates used to construct the prompt words for training and the prompt words used for annotation correspond one-to-one; 6.3: The results of each round of the three large language models with music understanding are processed by the Softmax function and weighted averaged to obtain the final output of the current round. This average is then fed into the input part for the next round of prediction until the sentence end identifier appears, thus obtaining the final music description text. Example
[0019] See Figure 2 This embodiment uses the BaiChuan2 model to extract music feature categories from the music description text in the MusicCaps dataset. A threshold is set to filter the extracted music feature categories. Regular prompt words are constructed based on the music tag information in the dataset. Feature-based prompt words are constructed based on the music tag information and the filtered music feature category information. Task-based prompt words are constructed based on the music tag information, the filtered music feature category information, and some examples from the dataset. Three different MU-LLaMA models are trained using these three types of prompt words and the MusicCaps dataset. The prompt words corresponding to the three models and MagnaTagATune are used as the base dataset with tags and music, respectively, and input into the three trained MU-LLaMA models. The results of each round of the three large language models with music understanding are weighted and averaged after passing through the Softmax function to obtain the final output of the current round, which is then fed into the input for the next round of prediction until the sentence-end identifier appears, resulting in the final music description text.
Claims
1. A method for automatically generating music description text based on a large language model with music understanding ability, It is characterized in that The method comprises the following steps: (1) Select an existing small-scale manually annotated music dataset with music-description text-music labels as the basic dataset, and use a large language model to extract the music feature categories contained in the music description text in the dataset; (2) Setting a threshold line to filter the extracted music feature categories; (3) constructing a variety of basic prompt words and prompt word templates, filling the music labels and filtered music feature categories in the data set in step 1 into the prompt word templates, and combining the constructed basic prompt words to obtain a variety of different training prompt words; (4) using the obtained multiple different training prompt words to train multiple large language models with music understanding capabilities; (5) Select an existing data set with music-music tags, fill the music tags in the data set into the prompt word template constructed in step 3), and combine the basic prompt words constructed in step 3) to obtain a variety of different annotation prompt words; (6) The obtained multiple different annotation prompt words are respectively input into the corresponding large language model with music understanding ability obtained by training to automatically annotate the music and generate music description text.
2. The method for automatically generating music description text according to claim 1, It is characterized in that The step 1) specifically includes: (1.1): Select an existing music dataset with music-description text-music tags and construct feature extraction prompt words; (1.2): Input the feature extraction prompt words into the large language model to obtain the music feature categories contained in the description text.
3. The method for automatically generating music description text according to claim 1, It is characterized in that The multiple different basic prompt words and prompt word templates in step 3) include: regular prompt words, feature prompt word templates and task prompt word templates.
4. The method for automatically generating music description text according to claim 1, It is characterized in that The step 4) specifically includes: (4.1): Use the multiple training prompt words obtained in step 3, the music clips and music description texts in the data set of step 1 as multiple different prompt word-music-text input pairs, where the input pairs have the same music and text but different prompt words; (4.2): Use the large language model with music understanding capabilities, the same training parameters, and the multiple different input pairs constructed in step 4.1 to train multiple different large language models with music understanding capabilities.
5. The method for automatically generating music description text according to claim 1, It is characterized in that The step 5) specifically includes: (5.1): Select a data set with music labels and music as the data set to be labeled; (5.2): Fill the music tags in the dataset to be labeled and the feature category results obtained in step 2 into the prompt word template constructed in step 3, and combine them with the basic prompt words constructed in step 3 to obtain a variety of different prompt words for labeling.
6. The method for automatically generating music description text according to claim 1, It is characterized in that The step 6) specifically includes: (6.1): Use the multiple annotation prompt words obtained in step 5 and the music clips in the to-be-annotated data set in step 5 as multiple different prompt word-music input pairs, where the input pairs have the same music but different prompt words; (6.2): Inputting the multiple different input pairs obtained in step 6.1 into the multiple large language models with music comprehension trained in step 4 respectively, wherein the prompt words used for training and the prompt word templates used for labeling are constructed in one-to-one correspondence; (6.3): The results of each round of the Softmax function of multiple large language models with music understanding are weighted averaged as the final output result of the current round, and connected to the input part for the next round of prediction until the end-of-sentence identifier appears to generate a music description text.
Citation Information
Cited By
Medical record semantic understanding method and device, equipment, medium and product
CN119808791A
