Slot extraction method, device and equipment in music search scenario
By integrating the semantic features of music search text with slot types and interaction popularity information from the popular music knowledge base in music search scenarios, the accuracy of slot extraction is improved, thereby enhancing the accuracy of music search.
Patent Information
- Application Number
- CN202411331455.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-09-24
AI Technical Summary
Traditional slot extraction methods have low accuracy in music search scenarios and cannot effectively handle diverse colloquial expressions and complex sentence structures, resulting in a decrease in music search accuracy.
By acquiring semantic features of music search text and slot type and interaction popularity information of knowledge text from the popular music knowledge base, these features are fused to determine the slot extraction results, and feature accuracy is improved by using a three-dimensional numerical matrix and attention weight calculation.
This improved the accuracy of slot extraction, thereby enhancing the accuracy of music search, especially when handling complex search queries.
Smart Images

Figure CN119202308B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, in particular to a slot extraction method, device and equipment in a music search scenario. BACKGROUND
[0002] Slot extraction is an important part in a music search scenario. When there are multi-vernacular expressions and complex combination sentences in the music search text input by a user, slot extraction aims to extract meaningful subtexts in the music search text and identify the slot types to which the subtexts belong. The extracted slots help to convert the music search text of the user into clear instructions that are easier for a search service to understand, so as to improve the accuracy of music search.
[0003] Traditional slot extraction methods mainly achieve slot extraction by matching entities in a music search text in a music field knowledge dictionary, and the accuracy of slot extraction is low, which leads to low accuracy of music search. SUMMARY
[0004] Therefore, it is necessary to provide a slot extraction method, device and equipment in a music search scenario that can improve the accuracy of slot extraction.
[0005] In a first aspect, the present application provides a slot extraction method in a music search scenario, which comprises:
[0006] obtaining a music search text, extracting semantic features of the music search text to obtain text semantic features;
[0007] from a pre-constructed hot music knowledge base, obtaining a knowledge text matched with the music search text, and slot type information and interactive hotness information of the knowledge text;
[0008] determining knowledge features of the music search text according to the knowledge text, the slot type information and the interactive hotness information;
[0009] fusing the text semantic features and the knowledge features to obtain fused features, and determining a slot extraction result of the music search text according to the fused features.
[0010] In a second aspect, the present application provides a slot extraction device in a music search scenario, which comprises:
[0011] an obtaining module configured to obtain a music search text, extract semantic features of the music search text to obtain text semantic features, and from a pre-constructed hot music knowledge base, obtain a knowledge text matched with the music search text, and slot type information and interactive hotness information of the knowledge text;
[0012] determining module configured to determine a knowledge feature of the music search text according to the knowledge text, the slot type information, and the interactive heat information; fuse the text semantic feature and the knowledge feature to obtain a fused feature, and determine a slot extraction result of the music search text according to the fused feature.
[0013] In a third aspect, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the methods in the embodiments of the present application when executing the computer program.
[0014] In a fourth aspect, a computer readable storage medium is provided, storing a computer program, and the computer program implementing the steps in the methods in the embodiments of the present application when executed by a processor.
[0015] In a fifth aspect, a computer program product is provided, including a computer program, and the computer program implementing the steps in the methods in the embodiments of the present application when executed by a processor.
[0016] The slot extraction method, device and equipment in the music search scenario described above, by obtaining a music search text, extracting a semantic feature of the music search text to obtain a text semantic feature, obtaining a knowledge text matching the music search text and slot type information and interactive heat information of the knowledge text from a pre-constructed heat music knowledge base, determining a knowledge feature of the music search text according to the knowledge text, the slot type information and the interactive heat information, fusing the text semantic feature and the knowledge feature to obtain a fused feature, and determining a slot extraction result of the music search text according to the fused feature. Compared with the traditional slot extraction method, the heat music knowledge base storing the knowledge text, the slot type information and the interactive heat information is used to reflect the different importance of each knowledge text by incorporating the interactive heat information of the knowledge text in the process of determining the knowledge feature of the music search text, so as to obtain more accurate knowledge features of the music search text, improve the accuracy of slot extraction, and thus improve the accuracy of music search. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 An application environment diagram of the slot extraction method in the music search scenario in an embodiment;
[0018] Figure 2 A flowchart of the slot extraction method in the music search scenario in an embodiment;
[0019] Figure 3 A principle diagram of the slot extraction model training process in an embodiment;
[0020] Figure 4A structural block diagram of a slot extraction device in a music search scenario according to an embodiment;
[0021] Figure 5 A structural block diagram of a slot extraction device in a music search scenario according to another embodiment;
[0022] Figure 6 An internal structural diagram of a computer device according to an embodiment;
[0023] Figure 7 An internal structural diagram of a computer device according to another embodiment. DETAILED DESCRIPTION
[0024] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0025] The slot extraction method in a music search scenario provided by the present application can be applied in an application environment as shown in the accompanying drawings. Figure 1 The terminal 102 communicates with the server 104 through a network. The data storage system can be separately arranged and can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on the cloud or other servers. The terminal 102 can be, but is not limited to, various desktop computers, notebook computers, smart phones, tablet computers, vehicle-mounted terminals, smart voice interaction devices, aircrafts, smart home appliances and portable wearable devices. The smart home appliances can be smart speakers, smart televisions and smart air conditioners, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be a stand-alone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, cloud security, host security, etc. network security services, CDN, and big data and artificial intelligence platforms, etc. basic cloud computing services. The terminal 102 and the server 104 can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application.
[0026] The server 104 can obtain the music search text, extract semantic features of the music search text, obtain the text semantic features, obtain knowledge text matched with the music search text, and slot type information and interactive heat information of the knowledge text from a pre-constructed heat music knowledge base. The server 104 can determine the knowledge features of the music search text according to the knowledge text, the slot type information and the interactive heat information, fuse the text semantic features and the knowledge features to obtain fused features, and determine the slot extraction result of the music search text according to the fused features. It can be understood that the server 104 can obtain the music search text from the terminal 102, and the present embodiment is not limited thereto, and it can be understood that Figure 1 The application scenarios in the above embodiments are only illustrative and are not limited thereto.
[0027] In one embodiment, as shown in Figure 2 FIG. 1, a slot extraction method in a music search scenario is provided, which can be applied to a computer device, which can be a terminal or a server, that is, the method can be executed by the terminal or the server alone, or can be realized through interaction between the terminal and the server. The present embodiment takes the case where the method is applied to a computer device as an example, which includes the following steps:
[0028] In step 202, semantic features of the music search text are extracted to obtain text semantic features.
[0029] The music search text is a text input by a user in a music search scenario. The text semantic features are semantic features of the music search text.
[0030] In one embodiment, the computer device can obtain the music search text and input the music search text into a trained semantic feature extraction network to extract features of the music search text through the semantic feature extraction network to obtain the text semantic features.
[0031] In step 204, knowledge text matched with the music search text, and slot type information and interactive heat information of the knowledge text are obtained from a pre-constructed heat music knowledge base.
[0032] The knowledge text is a text obtained based on data stored in a music library. It can be understood that the knowledge text can be a word, a phrase or a short sentence, etc. The slot type information is information used to indicate the slot type to which the knowledge text belongs. The interactive heat information is information used to represent the interactive heat of the knowledge text.
[0033] In one embodiment, the slot type can include at least one of a singer, a song, an album, a movie, a season, an order, a demand type, a list, a song type, an asset, a time, an age and a playing mode.
[0034] In an embodiment, the interactive hotness information can be a hotness value determined based on the play amount of a song. For example, the interactive hotness information corresponding to the slot type of a song can be the maximum value of the monthly play amount of all songs with the same name. The interactive hotness information corresponding to the slot type of a singer can be the maximum value of the monthly play amount of songs by all singers with the same name. The interactive hotness information corresponding to the slot type of an album can be the maximum value of the monthly play amount of songs of all albums with the same name multiplied by 0.1. The interactive hotness information corresponding to the slot type of a movie and television can be the maximum value of the monthly play amount of songs of all movies and televisions with the same name multiplied by 0.5. It can be understood that the interactive hotness information corresponding to the slot types of quarter, ranking, demand type, list, song type, asset, time, era, and play mode can be pre-set hotness values.
[0035] In an embodiment, the pre-constructed hotness music knowledge base stores a plurality of candidate knowledge texts, and slot type information and interactive hotness information of each candidate knowledge text. The computer device can match the music search text with the candidate knowledge texts in the hotness music knowledge base to obtain a knowledge text matched with the music search text from the hotness music knowledge base, and obtain the slot type information and the interactive hotness information of the knowledge text.
[0036] Step 206, determining the knowledge features of the music search text according to the knowledge text, the slot type information of the knowledge text, and the interactive hotness information of the knowledge text.
[0037] In an embodiment, the computer device can fuse the knowledge text, the slot type information, and the interactive hotness information, and perform feature extraction on the data obtained after fusion to obtain the knowledge features of the music search text.
[0038] Step 208, fusing the text semantic features and the knowledge features to obtain fusion features, and determining the slot extraction result of the music search text according to the fusion features.
[0039] In an embodiment, the computer device can fuse the text semantic features and the knowledge features to obtain fusion features, and predict the target sequence labeling result of the music search text according to the fusion features. The target sequence labeling result is a result obtained by labeling the character sequence of the music search text. Then, the computer device can analyze the sequence labeling result to obtain the slot extraction result of the music search text. The slot extraction result includes a slot and a slot type to which the slot belongs. It can be understood that the slot is an entity in the music search text. For example, “I want to listen to Zhang San's Dayu” is a music search text, and “Zhang San” and “Dayu” are two slots respectively. The slot type of “Zhang San” is a singer, and the slot type of “Dayu” is a song.
[0040] In an embodiment, the computer device can concatenate the text semantic features and the knowledge features to obtain the fusion features.
[0041] In an embodiment, the computer device can perform weighted operation on the text semantic features and the knowledge features to obtain the fusion features.
[0042] In an embodiment, the text semantic features are extracted by inputting the music search text into a semantic feature extraction network in the trained slot extraction model; the knowledge features are extracted by inputting the music search text into a knowledge feature extraction network in the trained slot extraction model; and the slot extraction result is obtained by inputting the text semantic features and the knowledge features into a prediction network in the trained slot extraction model, fusing the text semantic features and the knowledge features through the prediction network, predicting the target sequence labeling result of the music search text according to the fusion features, and analyzing the target sequence labeling result.
[0043] In the above slot extraction method in the music search scenario, the music search text is obtained, the semantic features of the music search text are extracted to obtain the text semantic features; the knowledge text matched with the music search text, the slot type information and the interactive heat information of the knowledge text are obtained from the pre-constructed heat music knowledge base; the knowledge features of the music search text are determined according to the knowledge text, the slot type information and the interactive heat information; the text semantic features and the knowledge features are fused to obtain the fusion features, and the slot extraction result of the music search text is determined according to the fusion features. Compared with the traditional slot extraction method, the heat music knowledge base storing the knowledge text, the slot type information and the interactive heat information is used in the present application to integrate the interactive heat information of the knowledge text in the process of determining the knowledge features of the music search text, so as to reflect the different importance of each knowledge text and obtain more accurate knowledge features of the music search text, which can improve the slot extraction accuracy and thus improve the accuracy of music search.
[0044] In an embodiment, the knowledge features of the music search text are determined according to the knowledge text, the slot type information of the knowledge text and the interactive heat information of the knowledge text, including: converting the knowledge text, the slot type information of the knowledge text and the interactive heat information of the knowledge text into a three-dimensional numerical matrix ; any element in the three-dimensional numerical matrix is defined as: the target knowledge text with the jth character in the music search text as the entity boundary is taken out from the knowledge text, and the comprehensive interactive heat information of each target knowledge text with the ith character in the music search text as the kth label in the label set is determined in the target knowledge text, represents the length of the music search text, t represents the length of the label set; the labels contained in the label set are generated based on the preset label system and the candidate slot type information corresponding to the hot music knowledge base; determining the knowledge features of the music search text according to the three-dimensional numerical matrix.
[0045] Among them, the comprehensive interactive hotness information is the sum of the interactive hotness information of the knowledge text under the same slot type.
[0046] In one embodiment, the slot types include 13 types of slot types, namely, singer, song, album, film and television, season, ranking, demand type, list, song type, asset, time, era and playing mode. The t types of labels contained in the label set are implemented based on the BIO label system, wherein t = slot type number x 2 + 1 = 13 x 2 + 1 = 27. The BIO label system is a labeling system for named entity recognition tasks, which is used to label entities in text. The BIO labeling system divides text into three types of labels according to entities: “B” represents the beginning of the entity (Beginning), “I” represents the middle part of the entity (Inside), and “O” represents non-entity (Outside). Through this labeling system, the entities in the text can be clearly identified and located.
[0047] In the above embodiment, by integrating the boundary information of the entity and the interactive hotness information into the three-dimensional numerical matrix, the accuracy of the knowledge features of the music search text is improved, so that the slot extraction accuracy can be further improved, and then the music search accuracy can be further improved.
[0048] In one embodiment, the knowledge features of the music search text are determined according to the three-dimensional numerical matrix, including: converting the three-dimensional numerical matrix into an initial three-dimensional vector matrix; performing relative position attention weight calculation on the second dimension of the initial three-dimensional vector matrix to obtain a first weight matrix; performing relative position attention weight calculation on the third dimension of the initial three-dimensional vector matrix to obtain a second weight matrix; summing the first weight matrix and the second weight matrix on the first dimension of the initial three-dimensional vector matrix to obtain a two-dimensional knowledge matrix; determining the knowledge features of the music search text according to the two-dimensional knowledge matrix.
[0049] Among them, the relative position attention weight calculation refers to the process of calculating the attention weight by considering the relative position relationship between the elements in the sequence in the attention mechanism. It can be understood that this process aims to capture the importance and mutual relationship between different elements in the sequence, so that the model can better understand the relative order and time sequence relationship of the elements in the sequence.
[0050] In an embodiment, the knowledge feature includes a knowledge feature vector. The computer device can input the three-dimensional numerical matrix into a first linear fully connected network to convert the three-dimensional numerical matrix into an initial three-dimensional vector matrix. The computer device can input the initial three-dimensional vector matrix into a RoPE (Relative Positional Encoding) network to perform relative position attention weight calculation on a second dimension of the initial three-dimensional vector matrix to obtain a first weight matrix, perform relative position attention weight calculation on a third dimension of the initial three-dimensional vector matrix to obtain a second weight matrix, and sum the first weight matrix and the second weight matrix on a first dimension of the initial three-dimensional vector matrix to obtain a two-dimensional knowledge matrix. The computer device can input the two-dimensional knowledge matrix into a bidirectional gated recurrent network, and then input an input result of the bidirectional gated recurrent network into the RoPE network to obtain the knowledge feature vector of the music search text. Further, the computer device can input the text semantic feature and the knowledge feature into a second linear fully connected network for fusion to obtain a fusion feature, and predict the target sequence labeling result of the music search text according to the fusion feature.
[0051] In the above embodiment, by summing the first weight matrix and the second weight matrix on the first dimension of the initial three-dimensional vector matrix to obtain the two-dimensional knowledge matrix, and determining the knowledge feature of the music search text according to the two-dimensional knowledge matrix, the accuracy of the knowledge feature of the music search text can be improved, so as to further improve the slot extraction accuracy, and then the accuracy of the music search can be further improved.
[0052] In an embodiment, extracting the semantic feature of the music search text to obtain the text semantic feature includes: inputting the music search text into a semantic feature extraction network in a trained slot extraction model to extract features of the music search text through each layer network unit in the semantic feature extraction network; and fusing the features output by a first layer network unit in the semantic feature extraction network and the features output by a last layer network unit in the semantic feature extraction network to obtain the text semantic feature of the music search text.
[0053] In an embodiment, the computer device can take the average of the features output by the first layer network unit in the semantic feature extraction network and the features output by the last layer network unit in the semantic feature extraction network as the text semantic feature of the music search text.
[0054] In an embodiment, the computer device can perform weighted summation on the features output by the first layer network unit in the semantic feature extraction network and the features output by the last layer network unit in the semantic feature extraction network to obtain the text semantic feature of the music search text.
[0055] In the above embodiment, since the semantic feature extraction network has rich semantic information, by fusing the features output by the first layer network unit in the semantic feature extraction network and the features output by the last layer network unit in the semantic feature extraction network, the text semantic features of the music search text are obtained, the semantic information in the semantic feature extraction network can be retained more, the accuracy of the knowledge features of the music search text can be improved, the slot extraction accuracy can be further improved, and then the music search accuracy can be further improved.
[0056] In one embodiment, the text semantic features and the knowledge features are fused to obtain fused features, and the slot extraction result of the music search text is determined according to the fused features, including: inputting the text semantic features and the knowledge features into a prediction network in the trained slot extraction model, fusing the text semantic features and the knowledge features by the prediction network to obtain the fused features, predicting the target sequence labeling result of the music search text according to the fused features, and analyzing the target sequence labeling result to obtain the slot extraction result of the music search text.
[0057] In one embodiment, the application further provides a training method of a slot extraction model, including: obtaining a sample music search text and a reference sequence labeling result of the sample music search text; inputting the sample music search text into a semantic feature extraction network in a slot extraction model to be trained to obtain sample text semantic features; inputting the sample music search text into a knowledge feature extraction network in the slot extraction model to be trained to obtain sample knowledge features; inputting the sample text semantic features and the sample knowledge features into a prediction network in the slot extraction model to be trained to obtain a predicted sequence labeling result of the sample music search text; determining a target loss value according to the predicted sequence labeling result and the reference sequence labeling result, training the slot extraction model to be trained based on the target loss value to obtain a trained slot extraction model; and using the trained slot extraction model to obtain a slot extraction result of a music search text.
[0058] Specifically, the slot extraction model to be trained includes a semantic feature extraction network, a knowledge feature extraction network, and a prediction network. The computer device can obtain a sample music search text, and obtain a reference sequence labeling result of the sample music search text. The computer device can input the sample music search text into the semantic feature extraction network in the slot extraction model to be trained, so as to extract semantic features of the sample music search text through the semantic feature extraction network, obtain sample text semantic features, and input the sample music search text into the knowledge feature extraction network in the slot extraction model to be trained, so as to extract knowledge features of the sample music search text through the knowledge feature extraction network, obtain sample knowledge features. The computer device can input the sample text semantic features and the sample knowledge features into the prediction network in the slot extraction model to be trained, so as to fuse the sample text semantic features and the sample knowledge features through the prediction network, obtain sample fusion features, and determine a predicted sequence labeling result of the sample music search text based on the sample fusion features. Further, the computer device can determine a target loss value according to the predicted sequence labeling result and the reference sequence labeling result, and iteratively train the slot extraction model to be trained in a direction in which the target loss value decreases until a stop condition is met, and obtain a trained slot extraction model.
[0059] In one embodiment, the iteration stop condition can be that the number of iterations reaches a preset number, or the target loss value is less than a preset loss value.
[0060] In one embodiment, the computer device can directly determine the target loss value according to the predicted sequence labeling result and the reference sequence labeling result.
[0061] In the above embodiment, the target loss value is determined according to the predicted sequence labeling result output by the slot extraction model to be trained and the reference sequence labeling result of the sample music search text, and the slot extraction model to be trained is trained based on the target loss value, which can improve the slot extraction accuracy of the trained slot extraction model, thereby further improving the accuracy of music search.
[0062] In one embodiment, determining the target loss value according to the predicted sequence labeling result and the reference sequence labeling result includes: determining a first loss value according to the predicted sequence labeling result and the reference sequence labeling result; determining a second loss value according to the sample text semantic features and the sample knowledge features; and fusing the first loss value and the second loss value to obtain the target loss value.
[0063] In one embodiment, the computer device can perform weighted summation on the first loss value and the second loss value to obtain the target loss value.
[0064] In one embodiment, the computer device can take the average of the first loss value and the second loss value as the target loss value.
[0065] In one embodiment, the target loss value can be calculated by the following formula:
[0066] ;
[0067] ;
[0068] ;
[0069] wherein m is the number of sample music search texts, is the reference sequence labeling result of the ith sample music search text, is the predicted sequence labeling result of the ith sample music search text, is a pre-set model parameter, is the first loss value, is the sample text semantic feature of the ith sample music search text, is the sample knowledge feature of the ith sample music search text, and KL represents a bidirectional KL divergence function, is the second loss value, is a pre-set hyperparameter, is the target loss value.
[0070] In one embodiment, as Figure 3As shown, the computer device can construct a hot music knowledge base based on data in the music library, and the hot music knowledge base includes a dictionary list corresponding to slot types such as singer, song, album, film and television, season, ranking, demand type, list, song type, asset, time, age, and playing mode. Each dictionary list of a slot type includes a plurality of candidate knowledge texts and interactive hotness information of each candidate knowledge text. For example, the dictionary list under the singer slot type includes the candidate knowledge text "I", and the interactive hotness information of the candidate knowledge text "I" is "179", i.e. 179 plays. Similarly, the dictionary list under the film and television slot type includes the candidate knowledge text "I", and the interactive hotness information of the candidate knowledge text "I" is "4798", i.e. 4798 plays. The dictionary list under the song slot type includes the candidate knowledge text "I", and the interactive hotness information of the candidate knowledge text "I" is "1129275", i.e. 1129275 plays. The computer device can obtain a sample music search text, such as "I want to listen to Big Fish by Zhang San", and obtain a reference sequence label result of the sample music search text based on the BIO label system, such as "OOOB-singer I-singer OB-song I-song". Among them, "O" represents a non-entity, "B" represents the beginning of an entity, and "I" represents the middle part of an entity. The label corresponding to the character "Zhang" is "B-singer", which indicates that the character "Zhang" is the beginning of an entity, and the character "Zhang" belongs to the singer slot type. In addition, the computer device obtains the label corresponding to the sample knowledge text matched with the sample music search text from the hot music knowledge base, such as the label corresponding to the character "I" including B-singer, B-film and television, and B-song.
[0071] The computer device can input the sample music search text into the semantic feature extraction network in the slot extraction model to be trained to extract the semantic features of the sample music search text through the semantic feature extraction network to obtain the sample text semantic features, and input the sample music search text into the knowledge feature extraction network in the slot extraction model to be trained to extract the knowledge features of the sample music search text through the knowledge feature extraction network to obtain the sample knowledge features. The computer device can input the sample text semantic features and the sample knowledge features into the prediction network in the slot extraction model to be trained to fuse the sample text semantic features and the sample knowledge features through the prediction network to obtain sample fusion features, and determine the prediction sequence label result of the sample music search text based on the sample fusion features. Further, the computer device can determine the target loss value according to the prediction sequence label result and the reference sequence label result, and iteratively train the slot extraction model to be trained in the direction of reducing the target loss value until the iteration stopping condition is met, and obtain the trained slot extraction model.
[0072] In the above embodiments, a first loss value is determined based on the predicted sequence labeling results and the reference sequence labeling results. A second loss value is determined based on the semantic features of the sample text and the knowledge features of the sample. The first loss value and the second loss value are fused to obtain a target loss value. The slot extraction model to be trained is then trained based on the target loss value, which can further improve the slot extraction accuracy of the trained slot extraction model, thereby further improving the accuracy of music search.
[0073] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially, these steps are not necessarily executed in that order. Unless otherwise expressly 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 of the steps in the above embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0074] In one embodiment, such as Figure 4 As shown, a slot extraction device 400 for a music search scenario is provided, which specifically includes:
[0075] The acquisition module 402 is used to extract the semantic features of the music search text and obtain the text semantic features; from the pre-built popular music knowledge base, it obtains the knowledge text that matches the music search text, as well as the slot type information and interaction popularity information of the knowledge text.
[0076] The determination module 404 is used to determine the knowledge features of the music search text based on the knowledge text, the slot type information of the knowledge text, and the interaction popularity information of the knowledge text; to fuse the text semantic features and knowledge features to obtain fused features; and to determine the slot extraction results of the music search text based on the fused features.
[0077] In one embodiment, the determining module 404 is further configured to convert the knowledge text, the slot type information of the knowledge text, and the interaction popularity information of the knowledge text into a three-dimensional numerical matrix. Any element in a three-dimensional numerical matrix Defined as: extracting target knowledge text from the knowledge text, with the j-th character in the music search text as the entity boundary, and determining the comprehensive interaction popularity information of the target knowledge text with the i-th character in the music search text as the k-th tag in the tag set. denotes the length of the music search text, t denotes the length of the label set; the label contained in the label set is generated based on the preset label system and the candidate slot type information corresponding to the hot music knowledge base; ; determine the knowledge feature of the music search text according to the three-dimensional numerical matrix.
[0078] In one embodiment, the determining module 404 is further configured to convert the three-dimensional numerical matrix into an initial three-dimensional vector matrix; perform relative position attention weight calculation on the second dimension of the initial three-dimensional vector matrix to obtain a first weight matrix; perform relative position attention weight calculation on the third dimension of the initial three-dimensional vector matrix to obtain a second weight matrix; sum the first weight matrix and the second weight matrix on the first dimension of the initial three-dimensional vector matrix to obtain a two-dimensional knowledge matrix; and determine the knowledge feature of the music search text according to the two-dimensional knowledge matrix.
[0079] In one embodiment, the obtaining module 402 is further configured to input the music search text into a semantic feature extraction network in the trained slot extraction model to extract features of the music search text through each layer network unit in the semantic feature extraction network; and fuse the features output by a first layer network unit in the semantic feature extraction network with the features output by a last layer network unit in the semantic feature extraction network to obtain text semantic features of the music search text.
[0080] In one embodiment, the determining module 404 is further configured to input the text semantic features and the knowledge features into a prediction network in the trained slot extraction model, fuse the text semantic features and the knowledge features by the prediction network to obtain fused features, predict the target sequence labeling result of the music search text according to the fused features, and analyze the target sequence labeling result to obtain the slot extraction result of the music search text.
[0081] In one embodiment, the slot extraction result is extracted by the trained slot extraction model; as shown in Figure 5 The slot extraction apparatus 400 in the music search scenario further includes:
[0082] The training module 406 is configured to: obtain sample music search text and reference sequence labeling results of the sample music search text; input the sample music search text into a semantic feature extraction network in a slot extraction model to be trained to obtain sample text semantic features; input the sample music search text into a knowledge feature extraction network in the slot extraction model to be trained to obtain sample knowledge features; input the sample text semantic features and the sample knowledge features into a prediction network in the slot extraction model to be trained to obtain predicted sequence labeling results of the sample music search text; determine a target loss value based on the predicted sequence labeling results and the reference sequence labeling results, train the slot extraction model to be trained based on the target loss value, and obtain a trained slot extraction model.
[0083] In one embodiment, the training module 406 is further configured to: determine a first loss value based on the predicted sequence labeling results and the reference sequence labeling results; determine a second loss value based on the sample text semantic features and the sample knowledge features; and fuse the first loss value and the second loss value to obtain the target loss value.
[0084] The slot extraction device in the music search scenario described above obtains music search text, extracts semantic features of the music search text to obtain text semantic features, obtains knowledge text matched with the music search text from a pre-constructed hot music knowledge base, and obtains slot type information and interactive hotness information of the knowledge text; determines knowledge features of the music search text based on the knowledge text, the slot type information, and the interactive hotness information; fuses the text semantic features and the knowledge features to obtain fused features, and determines slot extraction results of the music search text based on the fused features. Compared with a traditional slot extraction method, the hot music knowledge base storing the knowledge text, the slot type information, and the interactive hotness information is used to reflect different importance of each knowledge text by incorporating the interactive hotness information of the knowledge text in the process of determining the knowledge features of the music search text, so that more accurate knowledge features of the music search text can be obtained, the slot extraction accuracy can be improved, and the music search accuracy can be improved.
[0085] Each module in the slot extraction device in the music search scenario described above can be realized by software, hardware, and a combination thereof, in whole or in part. Each module described above can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform operations corresponding to each module.
[0086] In one embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in FIG. 8. Figure 6As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. 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 the environment for the operating system and computer programs stored in the non-volatile storage media to run. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a slot extraction method in a music search scenario.
[0087] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a slot extraction method in a music search scenario. The display unit of the computer device is used to form a visually visible image. It can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0088] Those skilled in the art will understand that Figure 6 and Figure 7The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0089] In one embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above-mentioned method embodiments when executing the computer program.
[0090] In one embodiment, a computer readable storage medium is provided, storing a computer program, which, when executed by a processor, implements the steps in the above-mentioned method embodiments.
[0091] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps in the above-mentioned method embodiments.
[0092] 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 for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0093] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned method embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium and can include the processes of the above-mentioned method embodiments when executed. Any reference to memory, storage, database or other medium used in the embodiments provided by the present 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 or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not as a limitation, RAM can be in various forms such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0094] Any combination of the technical features in the above embodiments can be made, and for the sake of brevity, not all possible combinations are described above, however, as long as the combination of the technical features does not exist in contradiction, it shall be considered within the scope of the present disclosure.
[0095] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it shall not be understood as a limitation on the patent scope of the present application. It shall be pointed out that, for ordinary skilled persons in the art, several modifications and improvements can be made without departing from the concept of the present application, and these shall be within the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.
Claims
1. A slot extraction method in a music search scenario, characterized in that, The method includes: Extract semantic features from music search text to obtain text semantic features; From a pre-built popular music knowledge base, obtain knowledge text that matches the music search text, as well as slot type information and interaction popularity information of the knowledge text; The knowledge text, its slot type information, and its interaction popularity information are converted into a three-dimensional numerical matrix. Any element in the three-dimensional numerical matrix Defined as follows: From the knowledge text, extract the target knowledge text with the j-th character of the music search text as the entity boundary, and in the target knowledge text, determine the comprehensive interaction popularity information of each target knowledge text with the i-th character of the music search text as the k-th tag in the tag set. The length of the music search text is represented by t, and the length of the tag set is represented by t. The tags included in the tag set are generated based on a preset tag system and the candidate slot type information corresponding to the popular music knowledge base. ; Based on the three-dimensional numerical matrix, the knowledge features of the music search text are determined; The text semantic features and the knowledge features are fused to obtain fused features, and the slot extraction result of the music search text is determined based on the fused features.
2. The method according to claim 1, characterized in that, The step of determining the knowledge features of the music search text based on the three-dimensional numerical matrix includes: Convert the three-dimensional numerical matrix into an initial three-dimensional vector matrix; The relative position attention weights are calculated on the second dimension of the initial three-dimensional vector matrix to obtain a first weight matrix; the relative position attention weights are calculated on the third dimension of the initial three-dimensional vector matrix to obtain a second weight matrix. In the first dimension of the initial three-dimensional vector matrix, the first weight matrix and the second weight matrix are summed to obtain a two-dimensional knowledge matrix; based on the two-dimensional knowledge matrix, the knowledge features of the music search text are determined.
3. The method according to claim 1, characterized in that, The extraction of semantic features from music search text to obtain text semantic features includes: The music search text is input into the semantic feature extraction network in the trained slot extraction model so that the features of the music search text can be extracted through the network units of each layer in the semantic feature extraction network. The features output by the first layer of the semantic feature extraction network are fused with the features output by the last layer of the semantic feature extraction network to obtain the textual semantic features of the music search text.
4. The method according to claim 1, characterized in that, The step of fusing the text semantic features and the knowledge features to obtain fused features, and determining the slot extraction result of the music search text based on the fused features, includes: The text semantic features and the knowledge features are input into the prediction network of the trained slot extraction model. The prediction network fuses the text semantic features and the knowledge features to obtain fused features. The target sequence labeling result of the music search text is predicted based on the fused features. The target sequence labeling result is then parsed to obtain the slot extraction result of the music search text.
5. A training method for a slot extraction model, characterized in that, The method includes: Obtain the sample music search text and the reference sequence annotation results of the sample music search text; The sample music search text is input into the semantic feature extraction network in the slot extraction model to be trained in order to obtain the semantic features of the sample text. The sample music search text is input into the knowledge feature extraction network in the slot extraction model to be trained in order to obtain sample knowledge features; The semantic features of the sample text and the knowledge features of the sample are input into the prediction network of the slot extraction model to be trained, so as to obtain the prediction sequence labeling results of the sample music search text; Based on the predicted sequence labeling results and the reference sequence labeling results, a target loss value is determined, and the slot extraction model to be trained is trained based on the target loss value to obtain a trained slot extraction model; the trained slot extraction model is used to obtain the slot extraction results of music search text.
6. The method according to claim 5, characterized in that, The step of determining the target loss value based on the predicted sequence labeling results and the reference sequence labeling results includes: Based on the predicted sequence labeling results and the reference sequence labeling results, a first loss value is determined; The second loss value is determined based on the semantic features of the sample text and the knowledge features of the sample. The first loss value and the second loss value are fused together to obtain the target loss value.
7. 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 6.
8. A computer-readable storage medium storing 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 6.
9. 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 6.
Citation Information
Patent Citations
Text search method, device, equipment and storage medium
CN113569002A
Music recommendation model processing method, music recommendation method, equipment and storage medium
CN118643182A