Music recommendation method and model training method of generative large language model
Patent Information
- Application Number
- CN202410435040.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-11
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2044-04-11
AI Technical Summary
然而,这种推荐方法无法通过用户的实时输入获取到用户当前的兴趣,无法准确地根据用户的当前想法为用户进行音乐推荐
[0044]上述音乐推荐方法、装置、计算机设备、存储介质,通过将音乐推荐提问句输入至生成式大语言模型,得到响应音乐推荐提问句的音乐推荐回答句;生成式大语言模型为采用预先生成的训练样本进行训练得到的;训练样本包括音乐推荐提问样本和音乐推荐回答样本;音乐推荐回答样本包括音乐推荐理由和推荐音乐清单;音乐推荐提问样本为用于使音乐推荐系统推荐推荐音乐清单的问句;音乐推荐理由为根据音乐推荐提问样本和推荐音乐清单生成的推荐结果描述信息;按照音乐推荐回答句进行音乐推荐;如此,能够将用户实时输入的音乐推荐提问句输入至具有音乐推荐功能的生成式大语言模型,具有音乐推荐功能的生成式大语言模型可以实时响应以生成与音乐推荐提问句匹配的音乐推荐回答句,能够快速而准确地推断出用户可能喜欢的音乐,进而向用户推荐音乐,实现了快速而精准地向用户进行音乐推荐。
Smart Images

Figure CN118364133B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a music recommendation method, a model training method for generative large language models, computer devices, storage media, and computer program products. Background Technology
[0002] With the development of big data technology, more and more data processing methods have emerged, and more and more music applications are analyzing users' historical behavior data based on their accounts to recommend music to users in a timely manner.
[0003] Currently, music app recommendation systems often personalize music recommendations to user accounts by analyzing historical user interaction data. However, this method cannot obtain the user's current interests through real-time input, and therefore cannot accurately recommend music based on the user's current thoughts.
[0004] Therefore, traditional technologies have the problem of not being able to accurately recommend music to users. Summary of the Invention
[0005] Therefore, it is necessary to provide a music recommendation method, apparatus, computer device, computer-readable storage medium, and computer program product that can accurately recommend music to users in order to address the above-mentioned technical problems.
[0006] A music recommendation method includes:
[0007] Retrieve the music recommendation question input for the music recommendation task;
[0008] The music recommendation question is input into a generative large language model to obtain music recommendation answers. The generative large language model is trained using pre-generated training samples. The training samples include music recommendation question samples and music recommendation answer samples. The music recommendation answer samples include music recommendation reasons and recommended music lists. The music recommendation question samples are questions used to make the music recommendation system recommend recommended music lists. The music recommendation reasons are descriptions of the recommendation results generated based on the music recommendation question samples and recommended music lists.
[0009] Recommend music based on the answer to the music recommendation question.
[0010] In one embodiment, obtaining the music recommendation question generated for the music recommendation task includes:
[0011] Obtain user profile information corresponding to the user account; the user profile information includes music preference tags associated with the user account.
[0012] Fill the music recommendation question template with the text corresponding to the music preference tags to generate music recommendation questions.
[0013] In one embodiment, obtaining the music recommendation question generated for the music recommendation task includes:
[0014] Displays a virtual companion listening to music scene; the virtual companion listening scene includes a virtual companion with artificial intelligence dialogue capabilities;
[0015] In response to interactive operations input to the virtual listening object, if the interactive text input is associated with the music recommendation task, the interactive text is used as a music recommendation question.
[0016] In one embodiment, music recommendation is performed based on the music recommendation response, including:
[0017] The music search engine is used to search for recommended music in the music recommendation response sentences to determine the matching music to be played;
[0018] Display recommended music responses and add matching music to the playlist for playback.
[0019] In one embodiment, a music search engine is used to search for recommended music in the music recommendation response to determine the matching music to be played, including:
[0020] The music recommendation response is input into the named entity recognition model, which identifies at least one music entity contained in the music recommendation response;
[0021] A music search engine is used to search for each music entity to obtain the matching music to be played.
[0022] A method for training a generative large language model includes:
[0023] Obtain pre-generated training samples; the training samples include music recommendation question samples and music recommendation answer samples; the music recommendation answer samples include music recommendation reasons and recommended music lists; the music recommendation question samples are questions used to make the music recommendation system recommend the recommended music lists; the music recommendation reasons are descriptions of the recommendation results generated based on the music recommendation question samples and recommended music lists;
[0024] The generative large language model is trained using training samples; the generative large language model is used to respond to music recommendation questions and output music recommendation answers; the music recommendation questions are generated for the music recommendation task.
[0025] In one embodiment, obtaining pre-generated training samples includes:
[0026] By simulating user questioning using a generative large language model, music recommendation question samples are generated based on the recommended music list;
[0027] Using the dialogue completion function of a generative large language model, reasons for music recommendations are generated based on music recommendation question samples and recommended music lists;
[0028] By combining the reasons for music recommendations with the recommended music list, we obtained a sample of music recommendation responses;
[0029] Training samples are generated based on music recommendation question samples and music recommendation answer samples.
[0030] In one embodiment, a sample of music recommendation questions is generated based on a recommended music list using the simulated user questioning function of a generative large language model, including:
[0031] Obtain the first prompt; the first prompt is used to instruct the generative large language model to simulate the user's questioning method and generate the user input question; the user input question is a question statement used by the music recommendation system to recommend a list of recommended music.
[0032] The first prompt is input into the generative large language model to instruct the generative large language model to simulate user questioning and generate the user input question.
[0033] Fill the music recommendation question sample generation template with the user's input question to generate a music recommendation question sample.
[0034] In one embodiment, the dialogue completion function of a generative large language model is used to generate reasons for music recommendations based on music recommendation question samples and recommended music lists, including:
[0035] Obtain the second prompt; the second prompt is used to instruct the generative large language model to fill in natural language statements that satisfy the dialogue context between the music recommendation question sample and the recommended music list;
[0036] The second prompt is input into the generative large language model to instruct its dialogue completion function to generate a natural language statement as a reason for music recommendation; the natural language statement is used to fill in the gap between the music recommendation question sample and the recommended music list.
[0037] In one embodiment, training a generative large language model using training samples includes:
[0038] Input the music recommendation question samples from the training samples into the generative large language model to obtain the music recommendation answer text;
[0039] The model loss value is determined based on the textual differences between the music recommendation response text and the music recommendation response sample.
[0040] Based on the model loss value, the model parameters of the generative large language model are adjusted.
[0041] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.
[0042] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described above.
[0043] A computer program product includes a computer program that, when executed by a processor, implements the steps of the method described above.
[0044] The aforementioned music recommendation method, apparatus, computer equipment, and storage medium input music recommendation questions into a generative large language model to obtain music recommendation responses. The generative large language model is trained using pre-generated training samples. These training samples include music recommendation question samples and music recommendation response samples. The music recommendation response samples include music recommendation reasons and a recommended music list. The music recommendation question samples are questions used to prompt the music recommendation system to recommend the recommended music list. The music recommendation reasons are descriptions of the recommendation results generated based on the music recommendation question samples and the recommended music list. Music recommendations are then made according to the music recommendation response sentences. Thus, the user's real-time input of music recommendation questions can be fed into a generative large language model with music recommendation functionality. This model can respond in real-time to generate music recommendation responses that match the question, quickly and accurately inferring music that the user might like and recommending music to the user, achieving fast and accurate music recommendations. Attached Figure Description
[0045] Figure 1 This is a diagram illustrating the application environment of a music recommendation method in one embodiment.
[0046] Figure 2 This is a flowchart illustrating a music recommendation method in one embodiment;
[0047] Figure 3 This is a flowchart illustrating a music recommendation method in one embodiment;
[0048] Figure 4 This is a schematic diagram of a music recommendation scenario in one embodiment;
[0049] Figure 5 This is a flowchart illustrating a music recommendation method in another embodiment;
[0050] Figure 6This is a flowchart illustrating a model training method for a generative large language model in one embodiment.
[0051] Figure 7 This is a schematic diagram of the format of a training sample in one embodiment;
[0052] Figure 8 This is a schematic diagram of the specific text content of a training sample in one embodiment.
[0053] Figure 9 This is a schematic diagram of a method for generating training samples in one embodiment;
[0054] Figure 10 This is a schematic diagram of a method for fine-tuning a generative large language model in one embodiment.
[0055] Figure 11 This is a flowchart illustrating a model training method for a generative large language model in another embodiment;
[0056] Figure 12 This is a structural block diagram of a music recommendation device in one embodiment;
[0057] Figure 13 This is a structural block diagram of a model training device for a generative large language model in one embodiment;
[0058] Figure 14 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0060] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure.
[0061] The music recommendation method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Server 104 obtains music recommendation questions generated for the music recommendation task; server 104 inputs the music recommendation questions into a generative large language model to obtain music recommendation answers in response to the music recommendation questions; the generative large language model is trained using pre-generated training samples; the training samples include music recommendation question samples and music recommendation answer samples; the music recommendation answer samples include music recommendation reasons and a recommended music list; the music recommendation question samples are questions used to make the music recommendation system recommend the recommended music list; the music recommendation reasons are descriptions of the recommendation results generated based on the music recommendation question samples and the recommended music list; server 104 makes music recommendations according to the music recommendation answer sentences. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0062] In one embodiment, such as Figure 2 As shown, a music recommendation method is provided, which is applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0063] Step S202: Obtain the music recommendation question generated for the music recommendation task.
[0064] Among them, music recommendation tasks can refer to tasks used to recommend music to user accounts.
[0065] Among them, music recommendation questions can be question texts used to ask questions to obtain recommended music.
[0066] In practice, the server retrieves the music recommendation question generated for the music recommendation task.
[0067] Step S204: Input the music recommendation question into the generative large language model to obtain the music recommendation answer to the music recommendation question; the generative large language model is trained using pre-generated training samples; the training samples include music recommendation question samples and music recommendation answer samples; the music recommendation answer samples include music recommendation reasons and recommended music lists; the music recommendation question samples are questions used to make the music recommendation system recommend recommended music lists; the music recommendation reasons are recommendation result description information generated based on the music recommendation question samples and recommended music lists.
[0068] Among them, the generative large language model can be a type of generative artificial intelligence model that can generate corresponding language text, images, audio and other content based on input information.
[0069] It should be noted that the generative artificial intelligence services provided by the generative artificial intelligence models involved in the embodiments of this application comply with the requirements of laws and regulations and respect social morality and public order. All information and data used by the generative artificial intelligence models involved in the embodiments of this application are authorized by the user or fully authorized by all parties.
[0070] The music recommendation answer can be the text used to answer the question posed in the music recommendation question, and the answer includes text corresponding to the reasons for the music recommendation and text corresponding to the music recommendation list. The music recommendation question sample can be any question text used to ask for recommended music. The music recommendation answer sample can be any answer text used to answer the question posed in the music recommendation question sample.
[0071] In this context, the answer text corresponding to the music recommendation answer sample in any training sample responds to the question text corresponding to the music recommendation question sample in the training sample.
[0072] The music recommendation system can refer to a system with music recommendation functionality that can be used to recommend music to user accounts. A user account can be any account registered on the user's music app.
[0073] The music recommendation reason is the recommendation result description information generated based on the music recommendation question sample and the recommended music list. The recommendation result description information can refer to information describing the common characteristics of each recommended music in the recommendation results.
[0074] The recommended music list can be pre-generated based on the user's historical music recommendation data. For example, the recommended music list can be generated based on information such as genre, language, region, artist profile, music description, and album description of each song in a user's historical music recommendation playlist.
[0075] In practical applications, recommended music lists can be obtained by weighted filtering based on the frequency of songs and artists in historical music recommendation data. Specifically, the sampling weight of top songs and artists can be reduced during data processing to avoid them appearing too frequently. At the same time, long-tail lyrics can be weighted for each music style, genre, and language to ensure coverage of music styles, genres, and languages.
[0076] In practice, the server inputs the music recommendation question into the generative large language model and obtains the music recommendation answer to the question. That is, the answer text generated by the generative large language model in response to the question in the music recommendation question includes the reasons for the music recommendation and the list of music recommendations.
[0077] Step S206: Recommend music according to the music recommendation answer.
[0078] In practice, the server recommends music to the user based on the music displayed in the music recommendation response.
[0079] For the convenience of those skilled in the art, Figure 3 An exemplary flowchart of a music recommendation method is provided, including the flow of the music recommendation method and the flow of the training method for the query statement generation model.
[0080] The music recommendation method first inputs the target user's interests and preferences into a query generation model to obtain a personalized query for the target user. Then, the personalized query is input into the music app's search engine to obtain recommended music that matches the personalized query. The query generation model can be a generative large language model as described in various embodiments of this application. The query can be used as the search input for the search engine. The query generation model can be considered as a trained generative large language model as described in various embodiments of this application. The personalized query generated can be the music recommendation answer sentence as described in various embodiments of this application, and the recommended music that matches the personalized query can be the matching music to be played as described in various embodiments of this application.
[0081] The training method for the query generation model first involves processing the target user's historical behavior data using a chain of thought approach within a generative large language model to construct training samples for the query generation model. Then, the generative large language model is fine-tuned under supervised instruction using these training samples to obtain the query generation model. The target user's historical behavior data includes explicitly created text and music association data, such as all music in a playlist associated with the title text, and music associated with the user's comments. The historical behavior data also includes implicit music preference association data, such as using an i2i algorithm (an algorithm that recommends music based on the similarity between items) to associate titles or lyrics with music similar to the target user's preferences.
[0082] The music recommendation method based on the query statement generation model and search engine determined by the method of this application embodiment has higher recommendation diversity and accuracy compared with the traditional music recommendation method based on the query statement generation model and search engine. Table 1 also shows the accuracy evaluation data and diversity evaluation data corresponding to the traditional method of this application embodiment. It can be seen that the music recommendation method of this application embodiment has significantly improved recommendation accuracy and recommendation diversity.
[0083] Table 1
[0084]
[0085] In the aforementioned music recommendation method, a generative large language model is input into a music recommendation question to obtain a music recommendation answer. The generative large language model is trained using pre-generated training samples. The training samples include music recommendation question samples and music recommendation answer samples. The music recommendation answer samples include music recommendation reasons and a recommended music list. The music recommendation question samples are questions used to prompt the music recommendation system to recommend the recommended music list. The music recommendation reasons are descriptions of the recommendation results generated based on the music recommendation question samples and the recommended music list. A music search engine is used to search for recommended music in the music recommendation answer to determine the matching music to be played. The music recommendation answer is displayed, and the matching music is added to the playlist for playback. In this way, the music recommendation question input by the user in real time can be input into a generative large language model with music recommendation functionality. The generative large language model with music recommendation functionality can respond in real time to generate a music recommendation answer that matches the music recommendation question, which can quickly and accurately infer the music that the user may like and then recommend music to the user, thus achieving fast and accurate music recommendation to the user.
[0086] In another embodiment, obtaining the music recommendation question generated for the music recommendation task includes: obtaining user profile information corresponding to the user account; the user profile information includes music preference tags associated with the user account; and filling the text corresponding to the music preference tags into the music recommendation question generation template to generate the music recommendation question.
[0087] User profile information refers to user feature tags obtained by tagging user information. User profile information can reflect the music preferences of user accounts.
[0088] Among them, music preference tags can be tags that represent the music preferences of a user's account. For example, music preference tags can be "artist A" or "music style A".
[0089] Among them, the music recommendation question generation template can be a text generation template used to generate music recommendation questions.
[0090] In the specific implementation, the server obtains the user profile information corresponding to the user account, thereby obtaining the music preference tags corresponding to the user account. The server fills the text corresponding to the music preference tags into the music recommendation question generation template, generating question text that can be used to ask questions to the generative large language model to obtain recommended music, that is, generating music recommendation question sentences.
[0091] For example, if a user's account has music preference tags including "Artist A" and "Music Style A", then the text corresponding to "Artist A" and "Music Style A" can be filled into the music recommendation question generation template to generate the music recommendation question "I like artist A and music style A, recommend some songs to me".
[0092] The technical solution of this embodiment can construct accurate music recommendation questions based on the user's music preferences, thereby facilitating the acquisition of recommended music that matches the user's music preferences and improving the accuracy of music recommendations.
[0093] In another embodiment, obtaining a music recommendation question generated for a music recommendation task includes: displaying a virtual companion listening scene; the virtual companion listening scene includes a virtual companion object with artificial intelligence dialogue capabilities; in response to an interactive operation input to the virtual companion object, if the interactive text input in the interactive operation is associated with the music recommendation task, the interactive text is used as a music recommendation question.
[0094] Among them, the virtual companion listening scene can be the scene corresponding to when the user account and the virtual companion listen to music together. In actual application, the virtual image of the user account and the virtual image of the virtual companion can appear simultaneously in the virtual space corresponding to the virtual companion listening scene, and the user account can interact with the virtual companion.
[0095] Among them, the AI dialogue function can refer to the ability of the virtual companion to interact with the user's account through text and language.
[0096] Among them, the virtual companion can be an artificial intelligence assistant in a virtual music listening scenario.
[0097] Interactive operations can be operations performed when a user interacts with a virtual companion via voice, or operations performed when a user interacts with a virtual companion via text input.
[0098] Interactive text can be text generated during the interaction between the user and the virtual listening companion. For example, when the user interacts with the virtual listening companion via voice, the interactive text can be text obtained by transcribing the user's voice; when the user interacts with the virtual listening companion via text, the interactive text can be text entered by the user.
[0099] In practice, the server displays a virtual companion listening to music scene and responds to the user's interactive operations on the virtual companion object. When the interactive text entered in the interactive operation is related to the music recommendation task, the server uses the interactive text as a music recommendation question.
[0100] In practical applications, such as Figure 4 As shown, users can enter the "Listen Together" virtual companion listening scenario through the "AI Listen Together" function in the music app. Users communicate with the AI assistant, which is a virtual companion. If the user's question is related to music recommendations, such as "I want to listen to happy songs" or "Let's listen to some rock music to cheer me up," the AI assistant will use "I want to listen to happy songs" or "Let's listen to some rock music to cheer me up" as the music recommendation question. Through the music recommendation method of this application embodiment, the virtual companion listening scenario can display the music recommendation response, such as "Let's jump up and dance together! Happy Song A, Happy Song B, Happy Song C. These songs have been added to your playlist. Let's listen together later~", thereby recommending music to the user and adding the recommended music to the user's account playlist.
[0101] The technical solution of this embodiment can enable a music recommendation task to be triggered when a user interacts with a virtual companion object. If the interaction content is related to music recommendations, the task will generate a music recommendation question that matches the interaction content, thereby achieving accurate real-time music recommendations for the user.
[0102] In another embodiment, music recommendation based on the music recommendation response includes: using a music search engine to search for recommended music in the music recommendation response to determine the matching music to be played; displaying the music recommendation response and adding the matching music to the playlist for playback.
[0103] Among them, a music search engine can be a search engine used by users to search for music.
[0104] The recommended music can be any piece of music.
[0105] In this context, a playlist can refer to a user's music recommendation list within a music app.
[0106] In practice, the server uses a music search engine to search for music in the music recommendation list displayed in the answer text corresponding to the music recommendation question, and uses the searched music as the matching music to be played. The server displays the music recommendation answer to the user account, that is, the server displays the answer text to the user account for the question raised in the music recommendation question, including the reason for the music recommendation and the music recommendation list, and adds the matching music to be played to the user account's playlist for playback.
[0107] The technical solution of this embodiment uses a music search engine to find matching music to be played and adds it to the playlist, which enables users to play the music quickly. At the same time, it displays music recommendation answers, realizing accurate real-time music recommendation to users.
[0108] In another embodiment, a music search engine is used to search for recommended music in the music recommendation response sentence to determine the matching music to be played, including: inputting the music recommendation response sentence into a named entity recognition model to identify at least one music entity contained in the music recommendation response sentence; and using a music search engine to search for each music entity to obtain the matching music to be played.
[0109] The named entity recognition model can be a NER (Named-Entity Recognition) model used to identify named entities in text. In practical applications, this model can also be used for information extraction, question answering systems, syntactic analysis, machine translation, etc. Music entities can refer to named entities such as music titles and artists in text.
[0110] In practice, the server inputs the music recommendation answer into the named entity recognition model, identifies the various music entities contained in the music recommendation answer, and the server samples the music search engine to search for each music entity and match the actual music to be played.
[0111] The technical solution of this embodiment can quickly match real music through named entity recognition, which helps to improve the accuracy of music recommendations.
[0112] In one embodiment, such as Figure 5 As shown, a music recommendation method is provided, which is applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0113] Step S502: Obtain user profile information corresponding to the user account; the user profile information includes music preference tags associated with the user account.
[0114] Step S504: Fill the music recommendation question template with the text corresponding to the music preference tags to generate the music recommendation question.
[0115] Step S506: Input the music recommendation question into the generative large language model to obtain the music recommendation answer to the music recommendation question; the generative large language model is trained using pre-generated training samples; the training samples include music recommendation question samples and music recommendation answer samples; the music recommendation answer samples include music recommendation reasons and recommended music lists; the music recommendation question samples are questions used to make the music recommendation system recommend recommended music lists; the music recommendation reasons are recommendation result description information generated based on the music recommendation question samples and recommended music lists.
[0116] Step S508: Recommend music according to the music recommendation answer.
[0117] It should be noted that the specific limitations of the above steps can be found in the specific limitations of a music recommendation method described above.
[0118] In one embodiment, such as Figure 6 As shown, a model training method for generative large language models is provided, and this method is applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0119] Step S602: Obtain pre-generated training samples; the training samples include music recommendation question samples and music recommendation answer samples; the music recommendation answer samples include music recommendation reasons and recommended music lists; the music recommendation question samples are questions used to make the music recommendation system recommend recommended music lists; the music recommendation reasons are recommendation result description information generated based on the music recommendation question samples and recommended music lists.
[0120] In practice, the server obtains pre-generated training samples.
[0121] Step S604: Train the generative large language model using training samples; the generative large language model is used to respond to music recommendation questions and output music recommendation answers; the music recommendation questions are generated for the music recommendation task.
[0122] In practice, the server uses training samples to train the generative large language model.
[0123] The above-described generative large language model training method obtains pre-generated training samples. These training samples include music recommendation question samples and music recommendation answer samples. The music recommendation answer samples include music recommendation reasons and a recommended music list. The music recommendation question samples are questions used to prompt the music recommendation system to recommend the recommended music list. The music recommendation reasons are recommendation result descriptions generated based on the music recommendation question samples and the recommended music list. The generative large language model is trained using these training samples. The generative large language model responds to music recommendation questions and outputs music recommendation answer sentences. The music recommendation question sentences are generated specifically for music recommendation tasks. In this way, a generative large language model with music recommendation functionality can be trained, enabling rapid response and music recommendation to users when they input music recommendation questions in real time.
[0124] In another embodiment, obtaining pre-generated training samples includes: generating music recommendation question samples based on a recommended music list using the simulated user questioning function of a generative large language model; generating music recommendation reasons based on the music recommendation question samples and the recommended music list using the dialogue completion function of the generative large language model; obtaining music recommendation answer samples by combining the music recommendation reasons and the recommended music list; and generating training samples based on the music recommendation question samples and the music recommendation answer samples.
[0125] The simulated user questioning function can refer to a function that can be used to simulate the way users ask questions.
[0126] The dialogue completion function refers to the function used to complete incomplete dialogues.
[0127] In the specific implementation, the server uses the simulated user questioning function of the generative large language model to generate music recommendation question samples based on the recommended music list. The server then uses the dialogue completion function of the generative large language model to fill in the music recommendation reasons between the music recommendation question samples and the recommended music list. The server combines the music recommendation reasons and the recommended music list to obtain music recommendation answer samples. The server generates training samples based on the music recommendation question samples and music recommendation answer samples.
[0128] Figure 7 This is a schematic diagram of the format of a training sample. Except for the sections “<Quantity>”, “<User Question>”, “<Reasons for Music Recommendation>”, and “<Recommended Music List 1, 2, 3, ……>”, the text content of each training sample is the same. Among them, "<Quantity>" is a randomly generated quantity, which can be used to enhance the generative large language model's ability to follow instructions; "<User Question>" is a question that can simulate what the user might ask, generated by the generative large language model based on "<Recommended Music List 1, 2, 3, ...>". In this process, a generative large language model with larger parameters and stronger general reasoning ability is often selected; "<Music Recommendation Reason>" is a comprehensive description of the music recommendation results generated by the generative large language model based on both "<User Question>" and "<Recommended Music List 1, 2, 3, ...>". It can be based on the idea of Chain of Thoughts, where the generative large language model first determines the recommendation reason and then recommends the song, which can enhance the logic of the recommendation results; "<Recommended Music List 1, 2, 3, ...>" is determined based on the user's historical music playback data, which can enhance the diversity of music recommendations.
[0129] Figure 8This is a schematic diagram of the specific text content of a training sample. The music recommendation question sample corresponds to "You are a personalized recommendation system. Please recommend 10 songs for me in the format of 'Song' - 'Artist'. What songs should I listen to while traveling?"; the music recommendation answer sample corresponds to "Listen to the following songs and enjoy the most beautiful melodies on your journey: 1. 'Travel-Related Song 1' - Artist A; 2. 'Travel-Related Song 2' - Artist B; 3. 'Travel-Related Song 3' - Artist C".
[0130] In the music recommendation response sample "Listen to the following songs and enjoy the most beautiful melodies of your journey: 1. 'Travel-Related Song 1' - Singer A; 2. 'Travel-Related Song 2' - Singer B; 3. 'Travel-Related Song 3' - Singer C", the music recommendation reason "Listen to the following songs and enjoy the most beautiful melodies of your journey" is generated through the dialogue completion function of a generative large language model, based on the music recommendation question sample "You are a personalized recommendation system. Please recommend 10 songs for me in the format of 'Song' - Singer. What songs should I listen to while traveling?" and the recommended music list "1. 'Travel-Related Song 1' - Singer A; 2. 'Travel-Related Song 2' - Singer B; 3. 'Travel-Related Song 3' - Singer C".
[0131] The technical solution of this embodiment enables the construction of a large number of data-enhanced training samples through a generative large language model, which is beneficial for subsequent training to obtain a generative large language model with stronger reasoning ability, thereby facilitating accurate real-time music recommendations for user accounts.
[0132] In another embodiment, a music recommendation question sample is generated based on a recommended music list using the simulated user questioning function of a generative large language model. This includes: obtaining a first prompt; the first prompt instructing the generative large language model to generate a user input question using a simulated user questioning method; the user input question being a question statement used to prompt the music recommendation system to recommend a recommended music list; inputting the first prompt into the generative large language model to instruct its simulated user questioning function to generate the user input question; and filling the user input question into a music recommendation question sample generation template to generate a music recommendation question sample.
[0133] The first prompt can refer to the prompt text used to instruct the generative large language model to simulate the user's questioning style. The user's input question can refer to a question statement that can simulate the user's questioning style. The music recommendation question sample generation template can be a template used to generate music recommendation question samples.
[0134] In the specific implementation, the server obtains the first prompt and then inputs the first prompt into the generative large language model to instruct the generative large language model to simulate user questioning function, generate user input questions in the manner of simulating user questions, and the server fills the user input questions into the music recommendation question sample generation template to generate music recommendation question samples.
[0135] The technical solution of this embodiment enables the generative large language model to generate questions that users may ask based on the recommended music list, which is beneficial for quickly generating a large number of music recommendation question samples, and thus for quickly generating training samples.
[0136] In another embodiment, the dialogue completion function of the generative large language model is used to generate music recommendation reasons based on the music recommendation question sample and the recommended music list. This includes: obtaining a second prompt; the second prompt is used to instruct the generative large language model to fill in a natural language statement that satisfies the dialogue context between the music recommendation question sample and the recommended music list; the second prompt is input into the generative large language model to instruct the dialogue completion function of the generative large language model to generate a natural language statement as a music recommendation reason; the natural language statement is used to fill in the music recommendation question sample and the recommended music list.
[0137] The second prompt can be a text that instructs the generative large language model to fill in a natural language statement that satisfies the dialogue context between the music recommendation question sample and the recommended music list. The natural language statement can be a statement that satisfies the dialogue context between the music recommendation question sample and the recommended music list.
[0138] In the specific implementation, the server obtains the second prompt and then inputs the second prompt into the generative large language model to instruct the dialogue completion function of the generative large language model to fill in a natural language statement that meets the dialogue context between the music recommendation question sample and the recommended music list. The server uses this natural language statement as the reason for recommending the music in the recommended music list.
[0139] The technical solution of this embodiment can use a generative large language model to fill in natural language statements that meet the dialogue context between the music recommendation question sample and the recommended music list as reasons for music recommendation. This is equivalent to using a generative large language model to generate a comprehensive description of the recommended music list based on both the music recommendation question sample and the recommended music list. Subsequently, when using a generative language model to output a music recommendation answer sentence containing the reasons for music recommendation and the music recommendation list, the reasons for music recommendation can be output first, followed by the music recommendation list, thus enhancing the textual logic of the music recommendation answer sentence.
[0140] For the convenience of those skilled in the art, Figure 9An illustrative diagram is provided illustrating a method for generating training samples using a generative large language model. This method specifically includes:
[0141] Step 1: Generate a recommended music list in advance based on the user's historical music playback data: "1. Travel-related songs 1 - Singer A; 2. Travel-related songs 2 - Singer B; 3. Travel-related songs 3 - Singer C".
[0142] Step 2: Obtain the first prompt. The first prompt is: "You are asked to provide a one-sentence description of the playlist. This user input will be provided to my music recommendation system. You will act as the user asking the question and directly generate a user input so that the recommendation system can generate the following playlist. Your question should ideally reflect the commonalities of the songs in the playlist. Recommended music list: 1. 'Travel-related songs 1' - Artist A; 2. 'Travel-related songs 2' - Artist B; 3. 'Travel-related songs 3' - Artist C." The instruction in the first prompt, "You will act as the user asking the question and directly generate a user input so that the recommendation system can generate the following playlist," can be used to instruct the generative large language model to generate a response that conforms to this instruction, essentially generating a user input statement that simulates the user's question.
[0143] Step 3: Input the initial prompt, "You are asked to provide a one-sentence description of your playlist. This user input will be provided to my music recommendation system. You will act as the user asking the question and directly generate a user input, which will then allow the recommendation system to generate the following playlist. Your question should ideally reflect the commonalities of the songs in the playlist. Recommended music list: 1. 'Travel-related songs 1' - Artist A; 2. 'Travel-related songs 2' - Artist B; 3. 'Travel-related songs 3' - Artist C," into the generative large language model. This will instruct the generative large language model's simulated user question function to generate the user input question that triggers the music recommendation system to recommend the playlist "1. 'Travel-related songs 1' - Artist A; 2. 'Travel-related songs 2' - Artist B; 3. 'Travel-related songs 3' - Artist C": "What songs should I listen to when I travel?"
[0144] Step 4: Obtain the second prompt. The second prompt is "Generate the most suitable sentence (within 20 characters) at the [mask] position. What songs should I listen to while traveling? [mask] 1. 'Travel-related songs 1' - Singer A; 2. 'Travel-related songs 2' - Singer B; 3. 'Travel-related songs 3' - Singer C"; where "Generate the most suitable sentence (within 20 characters) at the [mask] position" is the instruction in the second prompt. This instruction can be used to instruct the generative large language model to generate a response that conforms to this instruction, which is equivalent to generating a music recommendation reason.
[0145] Step 5: Input the second prompt, "Generate the most suitable sentence (within 20 characters) at the [mask] position. What songs should I listen to while traveling? [mask] 1. 'Travel-related songs 1' - Singer A; 2. 'Travel-related songs 2' - Singer B; 3. 'Travel-related songs 3' - Singer C", into the generative large language model to instruct its dialogue completion function to generate the natural language sentence "Listen to the following songs and enjoy the most beautiful melodies during your travels," as a music recommendation reason.
[0146] Step 6: Based on steps 1-5 above, generate as follows Figure 8 The training samples shown.
[0147] By using a generative large language model based on the methods described in steps 1-6 above, data augmentation of training samples can be achieved, and a large number of samples can be constructed.
[0148] In another embodiment, training the generative large language model using training samples includes: inputting music recommendation question samples from the training samples into the generative large language model to obtain music recommendation answer text; determining the model loss value based on the textual differences between the music recommendation answer text and the music recommendation answer samples; and adjusting the model parameters of the generative large language model based on the model loss value.
[0149] In this context, the music recommendation response text can refer to the response text output by the generative large language model to the question posed by the music recommendation question sample. The textual differences can refer to the differences between the music recommendation reasons in the response text and those in the music recommendation sample, as well as the differences between the recommended music lists in the response text and those in the music recommendation sample. The model loss value can refer to the cross-entropy loss function value.
[0150] In practice, the server inputs music recommendation question samples from the training samples into the generative large language model, and obtains the answer text output by the generative large language model for the questions asked by the music recommendation question samples. The server determines the model loss value based on the text difference between the answer text and the music recommendation answer sample, and then adjusts the model parameters of the generative large language model based on the model loss value.
[0151] In practical applications, before training a generative large language model using training samples, it is necessary to pre-train it with a knowledge data training set from the music domain. This is known as continuous pretraining, which allows the generative large language model to better understand and generate music-related language. This improves the model's performance in music recommendation tasks, enhancing accuracy and reducing training time and data requirements based on learned music domain knowledge, thus improving data processing efficiency. Specifically, this pretraining can be performed using a Transformer model (a natural language processing model) architecture through self-supervised learning.
[0152] In practical applications, supervised instruction fine-tuning (a method for training generative large language models) can be used to fine-tune the generative large language model of this application. This method can make the generative large language model more flexible and adaptable in handling various tasks. Based on deep learning, this method, through additional training of the generative large language model, enables it to understand and execute text instructions input by the user. During instruction fine-tuning, the generative large language model first receives a prompt containing the instruction, and then generates a response that conforms to the instruction. For example, if the instruction is "write a poem," the generative large language model will generate a poem. The loss function used in the fine-tuning process is L = -Σ(y i * log(p i During the instruction fine-tuning phase, y i It is the output one-hot encoding, p i It is the probability distribution of the model's predicted output. Unlike continued pre-training, the loss function of supervised fine-tuning usually only calculates the loss of the key output tokens.
[0153] Figure 10An exemplary diagram is provided illustrating a method for fine-tuning a generative large language model using a supervised instruction fine-tuning approach. First, the music recommendation question sample from the training samples, "You are a personalized recommendation system. Please recommend 10 songs for me in the format of 'Song'-Singer. What songs should I listen to while traveling?", is input into the generative large language model. This yields the output text of the generative large language model's response to the question posed by the music recommendation question sample: "Listen to the following songs to enjoy the most beautiful melodies of your trip: 1. 'Travel-Related Songs 1' - Singer D". Then, based on the textual differences between the music recommendation response samples from the training samples, "Listen to the following songs to enjoy the most beautiful melodies of your trip: 1. 'Travel-Related Songs 1' - Singer A; 2. 'Travel-Related Songs 2' - Singer B; 3. 'Travel-Related Songs 3' - Singer C", and the response text "Listen to the following songs to enjoy the most beautiful melodies of your trip: 1. 'Travel-Related Songs 1' - Singer D", the cross-entropy loss function value is determined. Finally, the gradient is backpropagated to the generative large language model based on the cross-entropy loss function value to adjust the model parameters.
[0154] The technical solution of this embodiment can train a generative large language model that can understand music recommendation questions, thereby facilitating the generation of more accurate music recommendation answers and enabling precise music recommendations for user accounts.
[0155] In one embodiment, such as Figure 11 As shown, a model training method for generative large language models is provided, and this method is applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0156] Step S1102: Using the simulated user questioning function of the generative large language model, generate music recommendation question samples based on the recommended music list; the music recommendation question samples are questions used to enable the music recommendation system to recommend the recommended music list.
[0157] Step S1104: Using the dialogue completion function of the generative large language model, generate music recommendation reasons based on the music recommendation question samples and the recommended music list; the music recommendation reasons are the recommendation result description information generated based on the music recommendation question samples and the recommended music list.
[0158] Step S1106: Combine the reasons for music recommendation with the list of recommended music to obtain a sample of music recommendation responses.
[0159] Step S1108: Generate training samples based on music recommendation question samples and music recommendation answer samples.
[0160] Step S1110: The generative large language model is trained using training samples; the generative large language model is used to respond to music recommendation questions and output music recommendation answers; the music recommendation questions are generated for the music recommendation task.
[0161] It should be noted that the specific limitations of the above steps can be found in the specific limitations of the model training method for a generative large language model described above.
[0162] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0163] Based on the same inventive concept, this application also provides a music recommendation device for implementing the music recommendation method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more music recommendation device embodiments provided below can be found in the limitations of the music recommendation method described above, and will not be repeated here.
[0164] In one embodiment, such as Figure 12 As shown, a music recommendation device is provided, comprising:
[0165] Module 1202 is used to obtain the music recommendation question input for the music recommendation task;
[0166] Input module 1204 is used to input the music recommendation question into a generative large language model to obtain a music recommendation answer in response to the music recommendation question; the generative large language model is trained using pre-generated training samples; the training samples include music recommendation question samples and music recommendation answer samples; the music recommendation answer samples include music recommendation reasons and a list of recommended music; the music recommendation question samples are questions used to enable the music recommendation system to recommend the list of recommended music; the music recommendation reasons are recommendation result description information generated based on the music recommendation question samples and the list of recommended music;
[0167] The recommendation module 1206 is used to recommend music according to the music recommendation answer sentence.
[0168] In one embodiment, the acquisition module 1202 is specifically used to acquire user profile information corresponding to the user account; the user profile information includes music preference tags associated with the user account; the text corresponding to the music preference tags is filled into the music recommendation question generation template to generate a music recommendation question.
[0169] In one embodiment, the acquisition module 1202 is specifically used to display a virtual companion listening scene; the virtual companion listening scene includes a virtual companion object with artificial intelligence dialogue function; in response to the interactive operation input to the virtual companion object, if the interactive text input by the interactive operation is associated with the music recommendation task, the interactive text is used as a music recommendation question.
[0170] In one embodiment, the recommendation module 1206 is specifically used to use a music search engine to search for recommended music in the music recommendation response sentence, determine the matching music to be played, display the music recommendation response sentence, and add the matching music to the playlist for playback.
[0171] In one embodiment, the recommendation module 1206 is specifically used to input the music recommendation response into the named entity recognition model, identify at least one music entity contained in the music recommendation response, and use the music search engine to search for each of the music entities to obtain the matching music to be played.
[0172] Each module in the aforementioned music recommendation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0173] Based on the same inventive concept, this application also provides a model training apparatus for a generative large language model, used to implement the model training method for the generative large language model described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method. Therefore, the specific limitations of one or more embodiments of the model training apparatus for a generative large language model provided below can be found in the limitations of the model training apparatus method for a generative large language model described above, and will not be repeated here.
[0174] In one embodiment, such as Figure 13 As shown, a model training device for a generative large language model is provided, comprising:
[0175] The sample acquisition module 1302 is used to acquire pre-generated training samples; the training samples include music recommendation question samples and music recommendation answer samples; the music recommendation answer samples include music recommendation reasons and recommended music lists; the music recommendation question samples are questions used to enable the music recommendation system to recommend the recommended music lists; the music recommendation reasons are recommendation result description information generated based on the music recommendation question samples and the recommended music lists;
[0176] The model training module 1304 is used to train the generative large language model using the training samples; the generative large language model is used to respond to music recommendation questions and output music recommendation answers; the music recommendation questions are generated for the music recommendation task.
[0177] In one embodiment, the sample acquisition module 1302 is specifically used to generate music recommendation question samples based on the recommended music list through the simulated user question function of the generative large language model; generate music recommendation reasons based on the music recommendation question samples and the recommended music list through the dialogue completion function of the generative large language model; obtain music recommendation answer samples by combining the music recommendation reasons and the recommended music list; and generate training samples based on the music recommendation question samples and the music recommendation answer samples.
[0178] In one embodiment, the sample acquisition module 1302 is specifically used to acquire a first prompt; the first prompt is used to instruct the generative large language model to simulate user questioning and generate a user input question; the user input question is a question statement used to make the music recommendation system recommend a list of recommended music; the first prompt is input to the generative large language model to instruct the generative large language model to simulate user questioning and generate the user input question; the user input question is filled into the music recommendation question sample generation template to generate a music recommendation question sample.
[0179] In one embodiment, the sample acquisition module 1302 is specifically used to acquire a second prompt; the second prompt is used to instruct the generative large language model to fill in a natural language statement that satisfies the dialogue context between the music recommendation question sample and the recommended music list; the second prompt is input to the generative large language model to instruct the dialogue completion function of the generative large language model to generate a natural language statement as a reason for music recommendation; the natural language statement is used to fill in the music recommendation question sample and the recommended music list.
[0180] In one embodiment, the model training module 1304 is specifically used to input music recommendation question samples from the training samples into the generative large language model to obtain music recommendation answer text; determine the model loss value based on the text difference between the music recommendation answer text and the music recommendation answer sample; and adjust the model parameters of the generative large language model based on the model loss value.
[0181] Each module in the model training device of the aforementioned generative large language model can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0182] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 14 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores music recommendation data and model training data for a generative large language model. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a music recommendation method and a model training method for a generative large language model.
[0183] Those skilled in the art will understand that Figure 14 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0184] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the music recommendation method and the generative large language model training method described above. Here, the steps of the music recommendation method can be those steps in the music recommendation method of the various embodiments described above, and the steps of the generative large language model training method can be those steps in the generative large language model training method of the various embodiments described above.
[0185] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, causes the processor to perform the steps of the music recommendation method and the generative large language model training method described above. Here, the steps of the music recommendation method can be those steps from the music recommendation method described in the above embodiments, and the steps of the generative large language model training method can be those steps from the generative large language model training method described in the above embodiments.
[0186] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, causes the processor to perform the steps of the music recommendation method and the generative large language model training method described above. Here, the steps of the music recommendation method can be those steps in the music recommendation method of the various embodiments described above, and the steps of the generative large language model training method can be those steps in the generative large language model training method of the various embodiments described above.
[0187] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0188] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0189] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0190] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A music recommendation method, characterized in that, The method includes: Retrieve the music recommendation question input for the music recommendation task; The music recommendation question is input into a generative large language model to obtain a music recommendation answer. The generative large language model is trained using pre-generated training samples. These training samples include music recommendation question samples and music recommendation answer samples. The answer text corresponding to any music recommendation answer sample in the training samples responds to the question posed by the music recommendation question sample in the same training sample. The music recommendation answer sample includes a music recommendation reason and a recommended music list. The music recommendation question sample is generated based on the recommended music list and is used to prompt the music recommendation system to recommend the recommended music list. The music recommendation reason is a description of the recommendation result generated based on the music recommendation question sample and the recommended music list. Recommend music based on the aforementioned music recommendation response.
2. The method according to claim 1, characterized in that, The step of obtaining the music recommendation question generated for the music recommendation task includes: Obtain user profile information corresponding to the user account; the user profile information includes music preference tags associated with the user account. Fill the music recommendation question template with the text corresponding to the music preference tags to generate the music recommendation question.
3. The method according to claim 1, characterized in that, The step of obtaining the music recommendation question generated for the music recommendation task includes: This displays a virtual companion listening to music scenario; the virtual companion listening scenario includes a virtual listening companion object with artificial intelligence dialogue function; In response to an interactive operation input to the virtual listening object, if the interactive text input in the interactive operation is associated with the music recommendation task, the interactive text is used as the music recommendation question.
4. The method according to claim 1, characterized in that, The music recommendation based on the music recommendation response includes: The recommended music in the music recommendation response sentence is searched using a music search engine to determine the matching music to be played; The recommended music response is displayed, and the matching music is added to the playlist for playback.
5. The method according to claim 4, characterized in that, The step of using a music search engine to search for recommended music in the music recommendation response to determine the matching music to be played includes: The music recommendation response is input into the named entity recognition model to identify at least one music entity contained in the music recommendation response; The music search engine is used to search for each of the music entities to obtain the matching music to be played.
6. A method for training a generative large language model, characterized in that, The method includes: Obtain pre-generated training samples; the training samples include music recommendation question samples and music recommendation answer samples; the answer text corresponding to the music recommendation answer sample in any of the training samples responds to the question raised by the music recommendation question sample in the same training sample; the music recommendation answer sample includes a music recommendation reason and a recommended music list; the music recommendation question sample is a question generated based on the recommended music list, used to enable the music recommendation system to recommend the recommended music list; the music recommendation reason is a description of the recommendation result generated based on the music recommendation question sample and the recommended music list; The generative large language model is trained using the training samples; the generative large language model is used to output music recommendation answer sentences in response to music recommendation questions; the music recommendation questions are generated for music recommendation tasks.
7. The method according to claim 6, characterized in that, The process of obtaining pre-generated training samples includes: The generative large language model simulates user questioning, and generates music recommendation question samples based on the recommended music list. The reason for the music recommendation is generated based on the music recommendation question sample and the recommended music list using the dialogue completion function of the generative large language model. Based on the reasons for the music recommendation and the list of recommended music, a sample of the music recommendation response is obtained; The training samples are generated based on the music recommendation question samples and the music recommendation answer samples.
8. The method according to claim 7, characterized in that, The step of generating music recommendation question samples based on the recommended music list using the simulated user question function of the generative large language model includes: Obtain a first prompt; the first prompt is used to instruct the generative large language model to simulate a user question and generate a user input question; the user input question is a question statement used to prompt the music recommendation system to recommend the recommended music list; The first prompt is input into the generative large language model to instruct the generative large language model to simulate user questioning and generate the user input question. The user-input question is filled into the music recommendation question sample generation template to generate the music recommendation question sample.
9. The method according to claim 7, characterized in that, The process of generating music recommendation reasons based on the music recommendation question sample and the recommended music list using the dialogue completion function of the generative large language model includes: Obtain a second prompt; the second prompt is used to instruct the generative large language model to fill in a natural language statement that satisfies the dialogue context between the music recommendation question sample and the recommended music list; The second prompt is input into the generative large language model to instruct the dialogue completion function of the generative large language model to generate the natural language statement as the reason for the music recommendation; the natural language statement is used to fill in the gap between the music recommendation question sample and the recommended music list.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Information recommendation method based on generative large language model and related device
CN116932733A