A method, device and medium for generating a multimedia product of music
Through the combination of the music description model and the large language model, multimedia products that conform to the music content and style are generated, which solves the problem of low adaptability of music generation in the existing technology and achieves more efficient matching of music and multimedia products.
Patent Information
- Application Number
- CN202410895246.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-07-05
AI Technical Summary
Existing methods for generating images or videos from music are based on retrieval or rendering methods, resulting in low compatibility between the generated multimedia products and music, and the need to build a large number of material libraries or extract rhythm features, making the process complex and inefficient.
Determine the semantic information of music through the music description model, build a large language model to ask questions, use the conversational large language model to generate music conditional text prompts, drive the generative artificial intelligence model to generate multimedia products that conform to the music content and style, simplify the process and improve the adaptability. Matching.
Without changing the model, multimedia products that are highly matched to music are generated, which improves the fit between music and multimedia products and expands the application scenarios of text-driven generative artificial intelligence models.
Smart Images

Figure CN118427372B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device and medium for generating a multimedia product of music. Background Art
[0002] At present, multimedia products such as images or videos generated for music are mainly generated based on retrieval or rendering methods. Based on the retrieval method, a large material database is built, and then the pictures in the material database are matched based on the music film to obtain the corresponding image; it is necessary to build a database of music-picture pairings to obtain a similarity estimation function, and it is also necessary to collect a large number of pictures as a material library, and the quality of the generated video is greatly affected by the size of the material library and the quality of the material. Based on the rendering method, it is necessary to extract the rhythm features of the music, and then render based on the rhythm features. Since it is mainly based on the rhythm features, the generated image can only reflect the audio properties of the music, and may have a low degree of adaptability to the music.
[0003] Therefore, how to provide a simple multimedia product that is highly compatible with music is a technical problem that needs to be solved urgently in this field. Summary of the invention
[0004] The purpose of this application is to provide a method, device and medium for generating a multimedia product of music, which can easily obtain a multimedia product with a high degree of adaptability to music.
[0005] In a first aspect, a method for generating a multimedia product of music is provided, comprising:
[0006] Acquire target music and a target multimedia product type corresponding to the target music;
[0007] Determine a music description corresponding to the target music by using a music description model, wherein the music description is a text description of the target music;
[0008] Constructing a large language model question word according to the target multimedia product type and the music description;
[0009] Generate a music conditional text prompt using a conversational large language model according to the large language model question words;
[0010] Based on the music conditional text prompt, a multimedia product corresponding to the target music is generated using a cultural product model corresponding to the target multimedia product type.
[0011] Through the above technical scheme, the music description of the target music is determined based on the music description model, and the music description has the semantic information of the music. Then, a large language model question word is constructed based on the target multimedia product type and the music description corresponding to the target music, and the existing conversational large language model is used to generate music conditional text prompts to drive a specific generative artificial intelligence method to generate a multimedia product that conforms to the target music. The multimedia product can be related to the content and style expressed by the music. In addition, the application scenarios of text-driven generative artificial intelligence models such as text images and text videos are expanded, so that it supports the generation of specific products based on music audio without any model changes and training. The method is simpler and the resulting multimedia products are more compatible with the music.
[0012] In a possible implementation, constructing a large language model question word according to the target multimedia product type and the music description includes:
[0013] Analyze the attribute information in the music description to obtain the music attributes of the target music, wherein the music attributes include: music type, speed and emotion;
[0014] Reading the user's requirements for multimedia products, wherein the requirements include at least one of style, color tone, and scene;
[0015] A large language model prompt word is constructed according to the music attribute, the demand and the target multimedia product type, and the first prompt word template.
[0016] Through the above technical solution, the music description is analyzed to obtain the music attributes of the target music, and then the first prompt word template is filled in based on the music attributes, user needs and the target multimedia product type to obtain the large language model prompt words, so that the large language model prompt words include multi-dimensional information, and the obtained multimedia product is of higher quality.
[0017] In a possible implementation, analyzing the attribute information in the music description to obtain the music attributes of the target music includes:
[0018] Constructing attribute information prompt words according to the music description and the second prompt word template;
[0019] Extracting the music attributes of the music description using the conversational large language model according to the attribute information prompt words;
[0020] Determine whether the music attribute meets the requirements. If not, repeat the step of extracting the music attribute of the target music using a large language model according to the music description and the first template prompt word until the music attribute meets the requirements.
[0021] Through the above technical solution, attribute information prompt words are constructed through music description, and the prompt words are fed back using a conversational large language model to obtain music attributes. The conversational large language model can be used to accurately and efficiently identify music attributes, and after obtaining the music attributes, it is necessary to verify whether they meet the requirements. If they do not meet the requirements, they are re-extracted until the music attributes that meet the requirements are obtained. The circular verification method is used to ensure the accuracy and compliance of the music attributes.
[0022] In a possible implementation, the step of generating a music condition text prompt based on the large language model question words and using a conversational large language model includes:
[0023] Acquire a first API call script including a first API call command of the conversational large language model, wherein the first API call command includes the large language model question word;
[0024] Execute the first API call script to send the large language model question words to the server corresponding to the conversational large language model;
[0025] Receive the music condition text prompt returned by the server corresponding to the conversational large language model.
[0026] Through the above technical solution, when the conversational large language model is a commercial model, the conversational large language model is called in the form of a script to obtain music conditional text prompts.
[0027] In a possible implementation, after receiving the music condition text prompt returned by the server corresponding to the conversational large language model, the method further includes:
[0028] Obtaining user feedback information on the music condition text prompt;
[0029] When the feedback information includes improvement information, constructing an improvement prompt word according to the improvement information and a third prompt word template;
[0030] Acquire a second API call script including a second API call command of the conversational large language model, wherein the second API call command includes the improved prompt word;
[0031] Executing the second API call script to send the improved prompt word to a server corresponding to the conversational large language model;
[0032] Receive a new music condition text prompt returned by the server corresponding to the conversational large language model; and obtain user feedback information on the new music condition text prompt again, until the feedback information does not include improvement information, and obtain the final music condition text prompt.
[0033] Through the above technical solution, a feedback mechanism is added. After the returned music conditional text prompt is obtained, the user's feedback information on the current music conditional text prompt is obtained. When the user determines that the music conditional text prompt needs to be improved, an improved prompt word can be constructed, and a script can be executed to call the conversational language large model for regeneration. The above steps are repeated until the user determines that the music conditional text prompt does not need to be improved. At this time, an accurate and final music conditional text prompt is obtained.
[0034] In a possible implementation, before acquiring the target music and the target multimedia product type corresponding to the target music, the method further includes:
[0035] Obtaining the target multimedia product type of the original music;
[0036] When the target multimedia product type is a video type, determining whether the music duration of the original music is greater than the maximum duration of the video that can be generated supported by the cultural product model;
[0037] If yes, the original music is segmented according to the maximum duration of the video that can be generated to obtain multiple sub-music, and the target music is any one of the multiple sub-music;
[0038] Correspondingly, after generating the multimedia product corresponding to the target music based on the music condition text prompt and using the cultural product model corresponding to the target multimedia product type, the method further includes:
[0039] The multimedia products corresponding to each sub-music are spliced together to obtain a music video corresponding to the original music.
[0040] Through the above technical solution, when the target multimedia product type is a video type, due to the limitation of the video length of the cultural product model, the generated video length may not be able to cover the entire music. At this time, the original music audio can be segmented according to the maximum generative video length supported by the cultural product model used to obtain multiple music text prompts.
[0041] In a possible implementation, after generating the multimedia product corresponding to the target music based on the music condition text prompt and using the cultural product model corresponding to the target multimedia product type, the method further includes:
[0042] Using a multimedia description model, a text description is performed on the multimedia product to obtain a product description;
[0043] Determining a degree of match between the music description and the product description;
[0044] If the matching degree is greater than a preset degree threshold, the multimedia product corresponding to the target music is used as the final multimedia product corresponding to the target music;
[0045] If the matching degree is not greater than a preset threshold, a prompt message is generated, and the prompt message is used to prompt the user whether it is necessary to regenerate the music conditional text prompt, or to prompt the user whether it is necessary to re-execute the steps of generating a multimedia product corresponding to the target music based on the music conditional text prompt and using the cultural product model corresponding to the target multimedia product type.
[0046] Through the above technical solution, after obtaining the multimedia product, the multimedia product is verified to ensure the matching of the multimedia product and the music. At this time, the multimedia description model is used to perform a text description of the multimedia product to obtain a product description, and the music description and the product description are matched. When the degree of match between the two is high, the verification is passed. When the degree of match between the two is low, the user is prompted to reread and perform the corresponding operation until the degree of match between the two reaches a preset degree threshold, and the verification is automatically performed, so that the obtained multimedia product meets the requirements better.
[0047] In a possible implementation, determining the degree of matching between the music description and the product description includes:
[0048] According to the music description, the product description and the fourth prompt word template, a matching degree is constructed to determine the prompt word;
[0049] A prompt word is determined according to the matching degree, and the matching degree between the music description and the product description is determined using the conversational large language model.
[0050] Through the above technical solution, a matching degree determination prompt word is constructed according to the music description, product description and the fourth prompt word template, and then the matching degree between the music description and the product description is quickly and accurately determined through the conversational large language model.
[0051] In a second aspect, an electronic device is provided, the electronic device comprising:
[0052] one or more processors;
[0053] Memory;
[0054] One or more applications, wherein one or more applications are stored in a memory and configured to be executed by one or more processors, and one or more programs are configured to: perform operations corresponding to the method shown in any possible implementation of the first aspect.
[0055] In a third aspect, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by a processor to implement the steps of the method as shown in any possible implementation method of the first aspect.
[0056] According to a fourth aspect, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the steps of the method as shown in any possible implementation manner in the first aspect.
[0057] In summary, the present application includes at least one of the following beneficial technical effects:
[0058] 1. Determine the music description of the target music based on the music description model. The music description has the semantic information of the music. Then, build a large language model question word based on the target multimedia product type and the music description corresponding to the target music. Use the existing conversational large language model to generate music conditional text prompts to drive a specific generative artificial intelligence method to generate multimedia products that match the target music. The multimedia products can be related to the content and style expressed by the music. In addition, the application scenarios of text-driven generative artificial intelligence models such as text images and text videos are expanded, so that they can support the generation of specific products based on music audio without any model modification and training. The method is simpler and the resulting multimedia products are more compatible with the music.
[0059] 2. When the target multimedia product type is a video type, due to the limitation of the video length of the cultural product model, the generated video length may not be able to cover the entire music. At this time, the original music audio can be segmented according to the maximum generative video length supported by the cultural product model used to obtain multiple music text prompts. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A schematic diagram of an application scenario of a method for generating a multimedia product of music provided in an embodiment of the present application;
[0061] Figure 2 A schematic diagram of a flow chart of a method for generating a multimedia product of music provided in an embodiment of the present application;
[0062] Figure 3 A schematic diagram of a process of asking questions using a large language model provided in an embodiment of the present application;
[0063] Figure 4 A flow chart of a feedback mechanism provided in an embodiment of the present application;
[0064] Figure 5A flow chart of a verification mechanism provided in an embodiment of the present application;
[0065] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0066] The following is combined with Figure 1 To Attachment Figure 6 This application is described in further detail.
[0067] This specific embodiment is merely an explanation of the present application and is not a limitation of the present application. After reading this specification, those skilled in the art may make modifications to the present embodiment without any creative contribution as needed, but such modifications are protected by the patent law as long as they are within the scope of the claims of the present application.
[0068] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0069] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.
[0070] Currently, multimedia products such as images or videos generated for music are mainly generated based on retrieval or rendering methods.
[0071] Based on the retrieval method, a larger material database is constructed, and then the pictures in the material database are matched based on the music film to obtain the corresponding image; it is necessary to construct a music-picture pairing database to obtain a similarity estimation function, and it is also necessary to collect a large number of pictures as a material library, and the quality of the generated video is greatly affected by the size of the material library and the quality of the material.
[0072] Based on the rendering method, it is necessary to extract the rhythm features of the music and then render based on the rhythm features. Since it is mainly based on rhythm features, it is impossible to explore the deeper semantic information of the music. As a result, the generated image can only reflect the audio properties of the music, which is irrelevant to the content, style and artistic conception expressed by the music, and has a low degree of adaptability to the music.
[0073] Based on this, the purpose of this application is to propose a method for generating text prompts based on music audio, wherein the text prompts can be used to input into generative artificial intelligence models such as text images and text videos to generate products such as images and videos that meet the description.
[0074] Specifically, the present application relates to technical fields such as AIGC (Artificial Intelligence Generated Content) generative artificial intelligence, and in particular to a method for generating music conditional text prompts based on a conversational large language model. The music conditional text prompts output by the present application contain text descriptions of images or videos that match the original music audio, which can be subsequently applied to Vincent graph models or Vincent video models and tools, that is, the generated music conditional text prompts are directly input into the Vincent graph or Vincent video model to guide the corresponding model to generate corresponding images or videos. The resulting images or videos are consistent with the style, artistic conception and other attributes of the original music audio, and can be used as the cover or MV (Music Video) of the music.
[0075] For easier understanding, please refer to Figure 1 , Figure 1 A schematic diagram of an application scenario of a method for generating a multimedia product of music provided in an embodiment of the present application includes: an electronic device, a client device and a server.
[0076] The user sends music and target multimedia product types to the electronic device through the client device;
[0077] The electronic device obtains target music and the target multimedia product type corresponding to the target music; uses a music description model to determine the music description corresponding to the target music, where the music description is a text description of the target music; constructs a large language model question word according to the target multimedia product type and the music description; generates music conditional text prompts according to the large language model question word using a conversational large language model; based on the music conditional text prompts, generates a multimedia product corresponding to the target music using a cultural product model corresponding to the target multimedia product type.
[0078] In one feasible method, a user sends a multimedia product demand to an electronic device through a client device, wherein the demand includes at least one of a painting style, a hue, and a scene; the electronic device analyzes the attribute information in the music description to obtain the music attributes of the target music, wherein the music attributes include: music type, speed, and emotion; reads the user's demand for the multimedia product; and constructs a large language model prompt word based on the music attributes, the demand, the target multimedia product type, and a first prompt word template.
[0079] In another feasible manner, for the conversational large language model business model, users can directly use it by simply obtaining the API (Application Programming Interface) interface called by the model. Specifically, the electronic device obtains a first API call script including a first API call command of the conversational large language model, wherein the first API call command includes a large language model question word; the first API call script is executed to send the large language model question word to a server corresponding to the conversational large language model; the conversational large language model in the server generates a music conditional text prompt based on the large language model question word, and returns it to the electronic device.
[0080] In another feasible method, a conversational large language model is deployed in the electronic device, and the model only needs to be called to answer the large language model's question words to generate music conditional text prompts.
[0081] Specifically, the present application embodiment provides a method for generating a multimedia product of music, such as Figure 2 As shown, the method provided in the embodiment of the present application can be executed by an electronic device, which can be a server or a terminal device, wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present application. The method includes:
[0082] S101, obtaining target music and a target multimedia product type corresponding to the target music;
[0083] The target music is the music work that the user wants to analyze and process, which can be a complete song, a music clip or the audio data of a melody. The target multimedia product type includes: video type or image type.
[0084] The target music may be an audio file uploaded by the user or a track selected from a music library. In an optional case, the user selects or uploads the file of the target music through an interactive interface, and at the same time, the user selects or inputs the target multimedia product type on the interface, and then the electronic device obtains the target music and the target multimedia product type corresponding to the target music according to the user's input.
[0085] S102, determining a music description corresponding to the target music using a music description model, where the music description is a text description of the target music;
[0086] The music description model is a multimodal artificial intelligence model for implementing music description tasks, whose goal is to accurately describe the input music audio using grammatically and semantically correct text.
[0087] The present embodiment of the application does not limit the structure of the music description model, and the user can customize the settings as long as the purpose of the embodiment of the application can be achieved.
[0088] In an achievable embodiment, the music description model is MusCaps. MusCaps is a cutting-edge deep neural network music description model, which is a deep neural network model with an encoder-decoder architecture, in which the encoder is mainly composed of a 7-layer 2D convolutional network and a pooling layer, which is used to extract the audio features of the input music and then input the features into the decoder; and the decoder is mainly composed of an LSTM (Long Short-Term Memory) with an attention operator added, which is used to decode the input music audio features into a text description thereof. The existing MusCaps model has been trained on a large-scale music-text pairing dataset, so it already has the ability to describe the style, melody, artistic conception and other information of the input music in text.
[0089] Specifically, data preprocessing: convert the audio file of the target music into a tensor data type that can be directly input into the MusCaps model. Generally, the librosa audio processing library in Python is used to read the audio file at a sampling rate of 16000Hz, and then convert it into a tensor type; network model loading: read the structure of the MusCaps model and the pre-trained network parameters into the computer memory; obtain the music audio description: input the pre-processed audio tensor into the MusCaps model loaded with pre-trained parameters, and then perform inference operation. Finally, the model will output a text description of the target music, that is, the music description.
[0090] S103, constructing a large language model question word according to the target multimedia product type and the music description;
[0091] The music conditional text prompt generated by the embodiment of the present application is used to drive the generative artificial intelligence model to generate images, videos and other products that are consistent with the music. According to different types of multimedia products, this step needs to construct different question words to input into the conversational large language model of the downstream step S104.
[0092] S104, generating music conditional text prompts based on the large language model question words using the conversational large language model;
[0093] Among them, the large language model is a large-scale artificial intelligence deep network model, which is trained with a large amount of text data and has the ability to predict the context based on the existing text; and the conversational large language model is further trained on the basis of the large language model through question-and-answer data sets and other methods to achieve the task of text-based question-and-answer dialogue with users. There are currently two main types of conversational large language models. The first is an open source model, and users need to download the model architecture and parameters and deploy them by themselves before they can use it; the second is a commercial model, and users only need to obtain the API interface called by the model to use it directly. The embodiments of this application do not limit the type of conversational large language model.
[0094] Using a conversational large language model to generate music-conditional text prompts effectively expands the application scenarios of text-driven generative AI models without introducing more data and model training.
[0095] S105. Based on the music condition text prompt, a multimedia product corresponding to the target music is generated using a cultural product model corresponding to the target multimedia product type.
[0096] The embodiment of the present application uses a conversational large language model to generate text prompts for music audio to drive a specific generative artificial intelligence method to generate a product that conforms to the target audio.
[0097] At present, the conversational large language model and text-driven generative artificial intelligence methods of single text modality cannot support the input and understanding of music audio. The embodiment of the present application allows the conversational large language model to understand music audio and generate text prompts of music conditions, so that the text-driven generative artificial intelligence method generates products related to the target music audio. The embodiment of the present application expands the application scenarios of text-driven generative artificial intelligence models such as text images and text videos, so that they can support the generation of specific products based on music audio without any model modification and training.
[0098] It can be seen that in the embodiment of the present application, the music description of the target music is determined based on the music description model, and the music description has the semantic information of the music. Then, a large language model question word is constructed based on the target multimedia product type and the music description corresponding to the target music, and the existing conversational large language model is used to generate music conditional text prompts to drive a specific generative artificial intelligence method to generate a multimedia product that conforms to the target music. The multimedia product can be related to the content and style expressed by the music. In addition, the application scenarios of text-driven generative artificial intelligence models such as text images and text videos are expanded, so that it supports the generation of specific products based on music audio without any model changes and training. The method is simpler and the resulting multimedia products are more compatible with the music.
[0099] In order to accurately construct large language model question words, see Figure 3 , Figure 3 A schematic diagram of a process of asking questions using a large language model provided in an embodiment of the present application, S103 constructs a large language model question word according to the target multimedia product type and the music description, including: S1031-S1033, wherein:
[0100] S1031, analyzing the attribute information in the music description to obtain the music attributes of the target music, the music attributes including: music type, speed and emotion;
[0101] Music description refers to the description of various characteristics, features or related information of music.
[0102] In some embodiments, the attribute information in the music description may be analyzed in a variety of ways to obtain the music attributes of the target music:
[0103] Alternatively, one method is to use natural language processing technology to analyze the text in the music description. Through text segmentation and part-of-speech tagging, the music description is split into a series of words and phrases; these words and phrases are converted into vector representations using word vector models (such as Word2Vec, GloVe, etc.); these vectors are learned and classified using deep learning models (such as convolutional neural networks, recurrent neural networks, etc.), thereby identifying the attribute information in the music description, and integrating and summarizing these attribute information to obtain the music attributes of the target music.
[0104] Alternatively, another method is rule-based attribute extraction. Define a series of rules about music attributes, which can be based on keyword matching or sentence structure analysis; match the music description with these rules, extract attribute information that meets the rules, and organize and classify the extracted attribute information to obtain the music attributes of the target music.
[0105] Optionally, another method is to construct attribute information prompt words based on the conversational large language model according to the music description and the second prompt word template; extract the music attributes of the music description using the conversational large language model based on the attribute information prompt words; determine whether the music attributes meet the requirements, and if not, repeat the steps of extracting the music attributes of the target music using the large language model based on the music description and the first template prompt words until the music attributes meet the requirements.
[0106] In an embodiment of the present application, the music description is analyzed by calling the large language model API to extract attribute information such as the type of music (such as modern pop, classical, etc.), speed (such as allegro, medium tempo, adagio, etc.), emotion (such as cheerful, sad, passionate, etc.).
[0107] Specifically, a question sentence, i.e., an attribute information prompt word, is constructed based on the music description and the second prompt word template, and the question sentence is used to ask the large language model, requiring it to analyze the target music audio description to obtain the music attributes; wherein, the second prompt word template can be set by the user according to actual needs, and the embodiment of the present application will no longer be limited.
[0108] For example, the second prompt word template can be: "You are a music description analysis robot. I will give you a text description of a piece of music. Please analyze the description carefully and summarize and refine the attribute information such as the type, speed, emotion, etc. of this music. You need to reply in the format of JSON text without adding other text. The reply example is as follows:
[0109] "Music Attributes" {
[0110] "Type": "Modern Pop",
[0111] "Speed": "Allegro",
[0112] "Emotion": "Cheerful",
[0113] }
[0114] Here is a text description of the music: [text description of music]".
[0115] When constructing the attribute information prompt words, it is only necessary to automatically fill the music description into the corresponding position of the second prompt word template. And, after obtaining the reply of the large language model, its reply is input into the Python JSON parser to determine whether the reply text meets the format requirements. If it meets the requirements, its reply is directly saved as a JSON file. If it does not meet the requirements, the large language model is asked again until it meets the requirements. It can be seen that in the embodiment of the present application, the attribute information prompt words are constructed through the music description, and the prompt words are fed back by the conversational large language model to obtain the music attributes. The conversational large language model can accurately and efficiently identify the music attributes, and after obtaining the music attributes, it is necessary to verify whether it meets the requirements. If it does not meet the requirements, it is extracted again until the music attributes that meet the requirements are obtained. The use of a circular verification method ensures the accuracy and compliance of the music attributes.
[0116] S1032, reading the user's demand for multimedia products, the demand including at least one of style, color tone, and scene;
[0117] Specifically, the user input about their demand for multimedia products can be presented in the form of key-value pairs, including demand information such as style (such as realistic style, comic style, futuristic style, etc.), color tone (cold color, warm color, etc.), scene (natural scenery, urban style, etc.). The user input for each demand can be directly described in natural language, or specific options or templates can be checked. Finally, the user input is saved in the form of a JSON file, such as:
[0118] "need":{
[0119] "Style": "Realistic",
[0120] "Tone": "Cool Tone",
[0121] "Scene": "Natural Scenery",
[0122] }.
[0123] S1033: construct a large language model prompt word according to music attributes, requirements, target multimedia product type, and the first prompt word template.
[0124] In this step, a question template is dynamically constructed based on the acquired needs and music attributes. First, the user's target multimedia product type, such as image or video, is confirmed, recorded as [target product], and the two JSON files of needs and music attributes are traversed respectively, and the information key-value pairs therein are recorded as: [user need key 1], [user need value 1], [user need key 2], [user need value 2], ... and [music attribute key 1], [music attribute value 1], [music attribute key 2], [music attribute value 2], .... Finally, a question sentence to the large language model is constructed based on the first prompt word template, wherein the first prompt word template can be set by the user according to actual needs.
[0125] For example, the first prompt word template is: "You are a text prompt generator of a cultural [target product] model. I will give you a text description of a piece of music. Based on this description, combined with the user's [user demand key 1] is [user demand value 1], [user demand key 2] is [user demand value 2], [……] requirements, and the music's [music attribute key 1] is [music attribute value 1], [music attribute key 2] is [music attribute value 2], [……] attributes, please describe the [target product] that meets the description as detailed and vividly as possible, including the structure, layout and elements that appear in the [target product], etc. The description text should be controlled within 100 words. The following is a text description of the music: [music audio description]".
[0126] It can be seen that in the embodiment of the present application, the music description is analyzed to obtain the music attributes of the target music, and then the first prompt word template is filled in with the music attributes, user needs and target multimedia product type to obtain the large language model prompt words, so that the large language model prompt words include multi-dimensional information, and the obtained multimedia product is of higher quality.
[0127] In an achievable embodiment, S104 generates a music condition text prompt based on the large language model question words using the conversational large language model, including:
[0128] Obtaining a first API call script including a first API call command of a conversational large language model, wherein the first API call command includes a large language model question word;
[0129] Execute the first API call script to send the large language model question words to the server corresponding to the conversational large language model;
[0130] Receive music condition text prompts returned by the server corresponding to the conversational large language model.
[0131] Among them, the API call for building a conversational large language model: write a call script, including the first API call command of a specific conversational large language model, in which the "message" parameter in the API is input using the large language model question words. Generate music conditional text prompts: execute the first API call script, send the question request to the target conversational large language model server, and finally receive the message returned by the server, and decode the message body of the "response" into text to obtain the music conditional text prompt.
[0132] It can be seen that in the embodiment of the present application, when the conversational large language model is a commercial model, the conversational large language model is called in the form of a script to obtain the music condition text prompt.
[0133] In one possible embodiment, referring to Figure 4 After obtaining the music condition text prompt returned by the server corresponding to the conversational large language model, it also includes:
[0134] Obtain user feedback on music condition text prompts;
[0135] When the feedback information includes improvement information, constructing an improvement prompt word according to the improvement information and the third prompt word template;
[0136] Obtaining a second API call script including a second API call command of the conversational large language model, wherein the second API call command includes an improved prompt word;
[0137] Execute the second API call script to send the improved prompt words to the server corresponding to the conversational large language model;
[0138] Receive a new music condition text prompt returned by the server corresponding to the conversational large language model; and obtain user feedback information on the new music condition text prompt again, until the feedback information does not include improvement information, and obtain the final music condition text prompt.
[0139] In an embodiment of the present application, a feedback mechanism is set up to confirm whether the music condition text prompt is qualified based on the user's feedback information. If it is unqualified, the user will provide improvement information to generate improved prompt words, and iterate inquiries until the obtained music condition text prompt is qualified.
[0140] Specifically, the generated music condition text prompt is presented to the user, and the user is asked whether he is satisfied. If the user is satisfied, the version is used as the final output. If the user is not satisfied, the user is prompted to explain in detail the areas of dissatisfaction and provide suggestions for improvement. The user can use natural language to describe the defects of the generated text, such as "the image style is not realistic enough", "the color tone is not warm enough", "the lack of natural scenery elements", etc. The user's feedback will be saved in the form of text and recorded as [User Feedback], and the subsequent steps will continue to iterate the inquiry.
[0141] According to the user's feedback information, if the feedback information includes improvement information, i.e., user feedback, then based on the user feedback, an improved prompt word is constructed according to the third prompt word template, wherein the third prompt word template is no longer limited in this embodiment of the application, and the user can set it according to actual needs.
[0142] In a possible case, since the conversational large language model has the function of connecting context, it is not necessary to provide the previous music condition text prompt, and the third prompt word template can be:
[0143] “There are some areas that need improvement in the music condition text prompt you generated previously. User feedback is as follows: [user feedback]. Please modify the text prompt generated previously based on these feedbacks to make it more in line with user needs.” The user feedback, i.e., improvement information, is filled into the third prompt word template to obtain an improved prompt word.
[0144] In another possible case, in order to ensure the accuracy of the new music condition prompt, the third prompt word template can be: "There are some areas that need improvement in the music condition text prompt you generated previously. User feedback is as follows: [user feedback]. Please modify the previously generated text prompt based on these feedbacks to make it more in line with user needs. The following is the previously generated music condition text prompt:
[0145] [Previous music condition text prompt]”.
[0146] The user's feedback, i.e., improvement information, and the previous music condition text prompt are filled into the third prompt word template to obtain an improved prompt word.
[0147] The specific selection of the third prompt word template is not limited in this embodiment of the application.
[0148] After the improved prompt word is determined, continue to execute the API call script, write the improved prompt word into the API call command, obtain the second API call command, and obtain and execute the second API call script to send the improved prompt word to the server corresponding to the conversational large language model.
[0149] Furthermore, in order to make the new music condition text prompt generated by the server more accurate, the API call command can include not only the improved prompt words, but also the previous conversation content; then, the modification request is sent to the server of the target conversational large language model.
[0150] Receive the modified message returned by the server corresponding to the conversational large language model, decode the message body of "response" into text, and obtain the modified music condition text prompt. After obtaining the new music condition text prompt, re-acquire the user's feedback information until the user approves the final music condition text prompt.
[0151] It can be seen that in the embodiment of the present application, a feedback mechanism is added. After the returned music conditional text prompt is obtained, the user's feedback information on the current music conditional text prompt is obtained. When the user determines that the music conditional text prompt needs to be improved, an improved prompt word can be constructed, and a script can be executed to call the conversational language large model for regeneration. The above steps are repeated until the user determines that the music conditional text prompt does not need to be improved. At this time, an accurate and final music conditional text prompt is obtained.
[0152] Furthermore, when generating a video based on the music description text, the generated video duration may not cover the entire piece of music due to the limitation of the video duration of the Vincent video model. In this case, the original music audio can be segmented according to the longest duration supported by the Vincent video model used to obtain multiple music text prompts, and the duration of each text prompt and its corresponding segment is input into the Vincent video model to obtain multiple music videos. Finally, the videos can be spliced according to the segmentation order to obtain a music video with the same duration as the original music audio. Specifically, before obtaining the target music and the target multimedia product type corresponding to the target music, it also includes:
[0153] Obtaining the target multimedia product type of the original music;
[0154] When the target multimedia product type is a video type, determining whether the music duration of the original music is greater than the maximum video duration that can be generated supported by the cultural product model;
[0155] If yes, the original music is segmented according to the maximum duration of the generated video to obtain multiple sub-music, and the target music is any one of the multiple sub-music;
[0156] The original music is the original music file to be processed. When the target multimedia product type of the original music is a video type, and the music duration of the original music is greater than the maximum video duration supported by the cultural product model, in order to ensure that the soundtrack of the video matches the video content, and that the soundtrack can be played completely and smoothly without interruption or replay when the entire audio and video combined product is played, the present application cuts the sub-music into several smaller sub-music, and obtains the multimedia product corresponding to the sub-music according to the multimedia product generation method provided by the present application.
[0157] Specifically, in one possible scenario, the process of segmenting the original music may include: segmenting directly according to the maximum duration of a video that can be generated. For example, if the original music is 43 seconds and the maximum duration of a video that can be generated is 10 seconds, then the music may be segmented into 10s, 10s, 10s, 10s, and 3s.
[0158] In another possible situation, first determine the division points of the original music, divide the original music according to the division points, and obtain multiple initial sub-music; for each initial sub-music, if the duration of the initial sub-music is not greater than the maximum duration of a generable video, determine the initial sub-music as sub-music; if the duration of the initial sub-music is greater than the maximum duration of a generable video, directly divide it according to the maximum duration of a generable video to obtain multiple sub-music.
[0159] To confirm the split points, you can choose the split points in the transition section of the music: the transition section is usually the part where the rhythm, timbre or melody of the music changes. Choosing these positions as split points can make the sub-music after the split have a natural transition when playing, and maintain the continuity of the music. Alternatively, choose the split points before or after the climax: the climax is the most exciting and expressive part of the music. In order to ensure that this part of the content is not split and loses its integrity, you can choose to split it at a suitable position before or after the climax. Alternatively, consider the repetitive structure of the music: many music has a repetitive structure, such as ABAB, ABCB, etc. When splitting, you can try to keep these complete repetitive structures so that the sub-music after the split has a unified style and rhythm when playing.
[0160] Correspondingly, each sub-music is used as the target music to generate a corresponding multimedia product. Then, based on the music condition text prompt, the cultural product model corresponding to the target multimedia product type is used to generate the multimedia product corresponding to the target music, and the following is also included:
[0161] The multimedia products corresponding to each sub-music are spliced together to obtain a music video corresponding to the original music.
[0162] It can be seen that in the embodiment of the present application, when the target multimedia product type is a video type, due to the limitation of the video duration of the cultural product model, the generated video duration may not be able to cover the entire piece of music. At this time, the original music audio can be segmented according to the maximum generative video duration supported by the cultural product model used to obtain multiple music text prompts.
[0163] Based on any of the above embodiments, in order to verify the matching degree between the music condition text prompt and the music audio as accurately as possible, it is possible to consider using the final product generated by the music condition text prompt, that is, images and videos for verification. Figure 5 , based on the music condition text prompt, using the cultural product model corresponding to the target multimedia product type, after generating the multimedia product corresponding to the target music, it also includes:
[0164] Using the multimedia description model, a text description is performed on the multimedia product to obtain a product description;
[0165] Determine how well the music description matches the product description;
[0166] If the matching degree is greater than a preset degree threshold, the multimedia product corresponding to the target music is used as the final multimedia product corresponding to the target music;
[0167] If the matching degree is not greater than the preset degree threshold, a prompt message is generated, which is used to prompt the user whether it is necessary to regenerate the music conditional text prompt, or to prompt the user whether it is necessary to re-execute the steps of generating the multimedia product corresponding to the target music based on the music conditional text prompt and using the cultural product model corresponding to the target multimedia product type.
[0168] Specifically, the final music condition text prompt is input into the Vincent graph or Vincent video model to generate the corresponding music image or music video.
[0169] Use existing image captioning or video captioning models to describe the generated music images or music videos. Image captioning models include BLIP, ChatGPT-4, etc., and video captioning models include VideoBERT, MSTN, etc. Input the generated image or video directly into the image captioning or video captioning model or tool to obtain a detailed description of the image or video, including its style, layout, content, and other elements, and save the description in text form, recorded as [image / video description].
[0170] Then, the matching degree between the music description and the product description is determined, and this application does not limit this method.
[0171] In one possible implementation, determining the degree of match between the music description and the product description includes:
[0172] The music description and the product description are both converted into text descriptions, and then the similarity between the two is matched using a matching algorithm, and the similarity is used as the matching degree.
[0173] In another achievable implementation, determining the degree of match between the music description and the product description includes:
[0174] According to the music description, the product description and the fourth prompt word template, a matching degree is constructed to determine the prompt word;
[0175] The prompt words are determined based on the matching degree, and the matching degree between the music description and the product description is determined using the conversational large language model.
[0176] A conversational large language model is used to determine the degree of match between the image or video description (i.e., product description) and the music description text. Several matching levels are designed and the large language model is allowed to select and score. The matching levels are designed as follows:
[0177] Exact match (5 points): The image or video description completely matches the style, mood, and other elements in the music description text.
[0178] Highly matched (4 points): The description of the image or video basically matches the style, artistic conception and other elements in the music description text.
[0179] Moderate match (3 points): The description of the image or video partially matches the style, mood and other elements of the music description text.
[0180] Low match (2 points): The image or video description does not match most of the style, mood, and other elements in the music description text.
[0181] Total mismatch (1 point): The image or video description does not match the music description text at all.
[0182] Specifically, the fourth prompt word template is no longer limited in the embodiment of the present application, and the user can set it according to actual needs. After obtaining the fourth prompt word template, the music description and product description are filled in the corresponding positions to obtain the matching degree determination prompt words to guide the large language model to score the matching degree between the image or video description and the music description text.
[0183] For example, the fourth prompt word template is:
[0184] “Please rate the matching degree of the following music description text and image / video description and select the most appropriate matching level:
[0185] Music description text: [Music description text]
[0186] Image / Video Description: [Image / Video Description]
[0187] Matching level:
[0188] - Exact match (5 points): The image or video description completely matches the style, mood, and other elements in the music description text.
[0189] -Highly matched (4 points): The description of the image or video basically matches the style, artistic conception and other elements in the music description text.
[0190] - Moderate match (3 points): The description of the image or video partially matches the style, mood and other elements of the music description text.
[0191] - Low match (2 points): The image or video description does not match most of the style, mood, and other elements in the music description text.
[0192] - Total mismatch (1 point): The image or video description does not match the music description text at all.
[0193] Please reply directly with the score number corresponding to the matching level, and do not reply with other content."
[0194] Then, the score given by the large language model is parsed. If the score is high (greater than or equal to 4 points), the image or video generated by the music conditional text prompt can be directly used as the final product. If the score is low (less than or equal to 3 points), the user can be prompted that the music conditional text prompt has a low match with the original video audio, and the user is asked to determine whether the music conditional text prompt needs to be regenerated.
[0195] It can be seen that in the embodiment of the present application, after obtaining the multimedia product, the multimedia product is verified to ensure the matching of the multimedia product and the music. At this time, the multimedia description model is used to perform a text description of the multimedia product to obtain a product description, and the music description and the product description are matched. When the degree of match between the two is high, the verification is passed. When the degree of match between the two is low, the user is prompted to reread and perform the corresponding operation until the degree of match between the two reaches the preset degree threshold, and the verification is automatically performed, and the obtained multimedia product is more in line with the requirements.
[0196] An electronic device is provided in an embodiment of the present application, such as Figure 6 As shown, Figure 6 The electronic device 300 shown includes: a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, such as through a bus 302. Optionally, the electronic device 300 may also include a transceiver 304. It should be noted that in actual applications, the transceiver 304 is not limited to one, and the structure of the electronic device 300 does not constitute a limitation on the embodiments of the present application.
[0197] The processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor 301 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0198] The bus 302 may include a path to transmit information between the above components. The bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0199] The memory 303 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0200] The memory 303 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the contents shown in the above method embodiment.
[0201] Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 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.
[0202] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding content in the aforementioned method embodiment.
[0203] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0204] It should be noted that in the optional embodiments of the present application, the object information and other related data involved, when the embodiments in the present application are applied to specific products or technologies, need to obtain the permission or consent of the object, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. In other words, if the embodiments of the present application involve data related to the object, it needs to be obtained with the authorization and consent of the object, the authorization and consent of the relevant departments, and in compliance with the relevant laws, regulations and standards of the country and region. If personal information is involved in the embodiments, the acquisition of all personal information needs to obtain the consent of the individual. If sensitive information is involved, the separate consent of the information subject needs to be obtained. The embodiments also need to be implemented with the authorization and consent of the object.
[0205] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for generating a multimedia product of music, characterized in that: include: Acquire target music and a target multimedia product type corresponding to the target music; Determine a music description corresponding to the target music by using a music description model, wherein the music description is a text description of the target music; According to the target multimedia product type and the music description, a large language model question word is constructed, including: Analyze the attribute information in the music description to obtain the music attributes of the target music, including: music type, speed and emotion, including: Constructing attribute information prompt words according to the music description and the second prompt word template; Extracting the music attributes of the music description using a conversational large language model according to the attribute information prompt words; Determine whether the music attribute meets the requirements, and if not, repeatedly perform the step of extracting the music attribute of the target music using the large language model according to the music description and the first template prompt word until the music attribute meets the requirements; Reading the user's requirements for multimedia products, wherein the requirements include at least one of style, color tone, and scene; Constructing a large language model prompt word according to the music attribute, the demand and the target multimedia product type, and the first prompt word template; Generate music conditional text prompts using a conversational large language model based on the large language model question words; Based on the music conditional text prompt, a multimedia product corresponding to the target music is generated using a cultural product model corresponding to the target multimedia product type.
2. The method for generating a multimedia product of music according to claim 1, characterized in that: The step of generating a music condition text prompt based on the large language model question words and using a conversational large language model includes: Acquire a first API call script including a first API call command of the conversational large language model, wherein the first API call command includes the large language model question word; Execute the first API call script to send the large language model question words to the server corresponding to the conversational large language model; Receive the music condition text prompt returned by the server corresponding to the conversational large language model.
3. The method for generating a multimedia product of music according to claim 2, characterized in that: After receiving the music condition text prompt returned by the server corresponding to the conversational large language model, the method further includes: Obtaining user feedback information on the music condition text prompt; When the feedback information includes improvement information, constructing an improvement prompt word according to the improvement information and a third prompt word template; Acquire a second API call script including a second API call command of the conversational large language model, wherein the second API call command includes the improved prompt word; Executing the second API call script to send the improved prompt word to a server corresponding to the conversational large language model; Receive a new music condition text prompt returned by the server corresponding to the conversational large language model; and obtain user feedback information on the new music condition text prompt again, until the feedback information does not include improvement information, and obtain the final music condition text prompt.
4. The method for generating a multimedia product of music according to any one of claims 1 to 3, characterized in that: Before acquiring the target music and the target multimedia product type corresponding to the target music, the method further includes: Obtaining the target multimedia product type of the original music; When the target multimedia product type is a video type, determining whether the music duration of the original music is greater than the maximum duration of the video that can be generated supported by the cultural product model; If yes, the original music is segmented according to the maximum duration of the video that can be generated to obtain multiple sub-music, and the target music is any one of the multiple sub-music; Correspondingly, after generating the multimedia product corresponding to the target music based on the music condition text prompt and using the cultural product model corresponding to the target multimedia product type, the method further includes: The multimedia products corresponding to each sub-music are spliced together to obtain a music video corresponding to the original music.
5. The method for generating a multimedia product of music according to any one of claims 1 to 3, characterized in that: After generating the multimedia product corresponding to the target music based on the music condition text prompt and using the cultural product model corresponding to the target multimedia product type, the method further includes: Using the multimedia description model, a text description is performed on the multimedia product to obtain a product description; and a matching degree between the music description and the product description is determined; If the matching degree is greater than a preset degree threshold, the multimedia product corresponding to the target music is used as the final multimedia product corresponding to the target music; If the matching degree is not greater than a preset threshold, a prompt message is generated, and the prompt message is used to prompt the user whether it is necessary to regenerate the music conditional text prompt, or to prompt the user whether it is necessary to re-execute the steps of generating a multimedia product corresponding to the target music based on the music conditional text prompt and using the cultural product model corresponding to the target multimedia product type.
6. The method for generating a multimedia product of music according to claim 5, characterized in that: The determining the matching degree between the music description and the product description includes: According to the music description, the product description and the fourth prompt word template, a matching degree is constructed to determine the prompt word; A prompt word is determined according to the matching degree, and the matching degree between the music description and the product description is determined using the conversational large language model.
7. An electronic device, characterized in that: It includes: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and are configured to be executed by the one or more processors, and the one or more applications are configured to: execute the steps of the method for generating a multimedia product of music according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the steps of the method for generating a multimedia product of music as described in any one of claims 1 to 6.
