Slot extraction method, device and equipment in music search scene
By integrating semantic and knowledge features with interactive heat information, the method enhances the accuracy of slot extraction in music search scenarios, addressing the limitations of traditional methods and improving music search precision.
Patent Information
- Application Number
- CN202411331455.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-24
AI Technical Summary
Traditional slot extraction methods in music search scenarios suffer from low accuracy due to the inability to effectively handle colloquial expressions and complex sentence structures, leading to poor music search results.
A method that integrates semantic features of user input with knowledge features from a pre-built music knowledge base, incorporating interactive heat information to enhance the accuracy of slot extraction by reflecting the importance of different knowledge texts.
Improves the accuracy of slot extraction and subsequent music search by utilizing interactive heat information, resulting in more precise identification of slot types and entities within user queries.
Smart Images

Figure CN119202308A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device and apparatus for extracting slots in a music search scenario. Background Art
[0002] Slot extraction is an important part of music search scenarios. When the music search text entered by the user contains multiple colloquial expressions and complex sentence structures, slot extraction aims to extract meaningful subtexts from the music search text and identify the slot type to which it belongs. The extracted slots help convert the user's music search text into clear instructions that are easier for the search service to understand, thereby improving the accuracy of music search.
[0003] The traditional slot extraction method is mainly achieved by entity matching the music search text in the music field knowledge dictionary. The slot extraction accuracy is low, which leads to low music search accuracy. Summary of the invention
[0004] Based on this, 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 in response to the above technical problems.
[0005] In a first aspect, the present application provides a slot extraction method in a music search scenario, the method comprising:
[0006] Acquire a music search text, extract semantic features of the music search text, and obtain text semantic features;
[0007] Acquire, from a pre-built popular music knowledge base, a knowledge text matching the music search text, as well as slot type information and interactive popularity information of the knowledge text;
[0008] Determining the knowledge features of the music search text according to the knowledge text, the slot type information and the interaction heat information;
[0009] The text semantic feature and the knowledge feature are fused to obtain a fused feature, and a slot extraction result of the music search text is determined according to the fused feature.
[0010] In a second aspect, the present application provides a slot extraction device in a music search scenario, the device comprising:
[0011] The acquisition module is used to acquire the music search text, extract the semantic features of the music search text, and obtain the text semantic features; acquire the knowledge text matching the music search text, as well as the slot type information and interactive heat information of the knowledge text from the pre-built hot music knowledge base;
[0012] A determination module is used to determine the knowledge features of the music search text based on the knowledge text, the slot type information and the interaction heat information; fuse the text semantic features and the knowledge features to obtain fused features, and determine the slot extraction results of the music search text based on the fused features.
[0013] In a third aspect, the present application provides a computer device including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the method embodiments of the present application are implemented.
[0014] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the method embodiments of the present application.
[0015] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps in the method embodiments of the present application when the computer program is executed by a processor.
[0016] The slot extraction method, device and equipment in the above-mentioned music search scenario obtains the music search text, extracts the semantic features of the music search text, and obtains the text semantic features; obtains the knowledge text matching the music search text, as well as the slot type information and interactive heat information of the knowledge text from the pre-built hot music knowledge base; determines the knowledge features of the music search text based on the knowledge text, slot type information and interactive heat information; fuses the text semantic features and knowledge features to obtain fused features, and determines the slot extraction results of the music search text based on the fused features. Compared with the traditional slot extraction method, the present application integrates the interactive heat information of the knowledge text into the process of determining the knowledge features of the music search text through the hot music knowledge base that stores the knowledge text, slot type information and interactive heat information, so as to reflect the different importance of each knowledge text, obtain more accurate knowledge features of the music search text, and improve the accuracy of slot extraction, thereby improving the accuracy of music search. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A diagram showing an application environment of a slot extraction method in a music search scenario in one embodiment;
[0018] Figure 2 A schematic diagram of a flow chart of a slot extraction method in a music search scenario in one embodiment;
[0019] Figure 3 A schematic diagram of the principle of a slot extraction model training process in one embodiment;
[0020] Figure 4is a structural block diagram of a slot extraction device in a music search scenario in an embodiment;
[0021] Figure 5 is a structural block diagram of a slot extraction device in a music search scenario in another embodiment;
[0022] Figure 6 is an internal structure diagram of a computer device in one embodiment;
[0023] FIG. 7 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0025] The slot extraction method in the music search scenario provided by this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can be set up separately and can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, vehicle-mounted terminals, intelligent voice interaction devices, aircraft, smart home appliances and portable wearable devices. Smart home appliances can be smart speakers, smart TVs and smart air conditioners. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, cloud security, host security and other network security services, CDN, and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 102 and the server 104 can be directly or indirectly connected by wired or wireless communication, and this application is not limited here.
[0026] The server 104 can obtain the music search text, extract the semantic features of the music search text, obtain the text semantic features, and obtain the knowledge text that matches the music search text, as well as the slot type information and interactive heat information of the knowledge text from the pre-built hot music knowledge base. The server 104 can determine the knowledge features of the music search text based on the knowledge text, slot type information and interactive heat information; fuse the text semantic features and the knowledge features to obtain fused features, and determine the slot extraction results of the music search text based on the fused features. It can be understood that the server 104 can obtain the music search text from the terminal 102, and this embodiment does not limit this. It can be understood that Figure 1 The application scenarios are only for illustration and are not limited to this.
[0027] In one embodiment, Figure 2 As shown, a slot extraction method in a music search scenario is provided, and the method can be applied to a computer device, and the computer device can be a terminal or a server, that is, the method can be executed by the terminal or the server alone, or can be implemented through interaction between the terminal and the server. This embodiment takes the method applied to a computer device as an example for explanation, and includes the following steps:
[0028] Step 202: extract semantic features of the music search text to obtain text semantic features.
[0029] The music search text is the text input by the user in the music search scenario, and the text semantic feature is the semantic feature of the music search text.
[0030] In one embodiment, a computer device may obtain a music search text, and input the music search text into a trained semantic feature extraction network, so as to extract features of the music search text through the semantic feature extraction network and obtain text semantic features.
[0031] Step 204, obtaining the knowledge text matching the music search text, the slot type information of the knowledge text, and the interactive heat information of the knowledge text from the pre-built hot music knowledge base.
[0032] Among them, the knowledge text is a text obtained based on the data stored in the music library. It can be understood that the knowledge text can be a word, a phrase, or a short sentence. The slot type information is information used to indicate the slot type to which the knowledge text belongs. The interaction heat information is information used to characterize the interaction heat of the knowledge text.
[0033] In one embodiment, the slot type may include at least one of singers, songs, albums, movies, seasons, sorting, demand types, charts, song types, assets, time, era, and playback methods.
[0034] In one embodiment, the interactive heat information may be a heat value determined based on the number of plays of a song. For example, the interactive heat information corresponding to the slot type of song may be the maximum monthly number of plays of all songs with the same name. The interactive heat information corresponding to the slot type of singer may be the maximum monthly number of plays of songs by all singers with the same name. The interactive heat information corresponding to the slot type of album may be the maximum monthly number of plays of songs in all albums with the same name × 0.1. The interactive heat information corresponding to the slot type of film and television may be the maximum monthly number of plays of songs in all films and televisions with the same name × 0.5. It can be understood that the interactive heat information corresponding to the slot types of quarter, sorting, demand type, list, song type, asset, time, era and playback method may be pre-set heat values.
[0035] In one embodiment, a plurality of candidate knowledge texts, as well as slot type information and interactive heat information of each candidate knowledge text, are stored in a pre-constructed hot music knowledge base. The computer device may match the music search text with the candidate knowledge texts in the hot music knowledge base to obtain knowledge texts matching the music search text from the hot music knowledge base, and obtain slot type information and interactive heat information of the knowledge texts.
[0036] Step 206, determining the knowledge features of the music search text based on the knowledge text, the slot type information of the knowledge text and the interaction heat information of the knowledge text.
[0037] In one embodiment, the computer device may fuse the knowledge text, slot type information, and interaction heat information, and perform feature extraction on the fused data to obtain knowledge features of the music search text.
[0038] Step 208, the text semantic features and knowledge features are fused to obtain fused features, and the slot extraction results of the music search text are determined based on the fused features.
[0039] In one embodiment, the computer device may fuse the text semantic features and the knowledge features to obtain the fused features, and predict the target sequence annotation results of the music search text based on the fused features. Among them, the target sequence annotation results are the results obtained by annotating the character sequence of the music search text. Furthermore, the computer device may parse the sequence annotation results to obtain the slot extraction results of the music search text. Among them, the slot extraction results include the slot and the slot type to which the slot belongs. It can be understood that the slot is an entity in the music search text. For example, "Zhang San" and "Big Fish" in the music search text "I want to listen to Zhang San's Big Fish" are two slots respectively. The slot type of the slot "Zhang San" is singer, and the slot type of "Big Fish" is song.
[0040] In one embodiment, the computer device may combine text semantic features and knowledge features to obtain fusion features.
[0041] In one embodiment, the computer device may perform weighted operations on text semantic features and knowledge features to obtain fusion features.
[0042] In one embodiment, text semantic features are extracted by inputting music search text into a semantic feature extraction network in a trained slot extraction model; knowledge features are extracted by inputting music search text into a knowledge feature extraction network in a trained slot extraction model; slot extraction results are obtained by inputting text semantic features and knowledge features into a prediction network in a trained slot extraction model to fuse the text semantic features and knowledge features through the prediction network to obtain fused features, predicting target sequence labeling results of the music search text based on the fused features, and parsing the target sequence labeling results.
[0043] In the slot extraction method in the above-mentioned music search scenario, the music search text is obtained, the semantic features of the music search text are extracted, and the text semantic features are obtained; the knowledge text matching the music search text, as well as the slot type information and interactive heat information of the knowledge text are obtained from the pre-constructed hot music knowledge base; the knowledge features of the music search text are determined according to the knowledge text, slot type information and interactive heat information; the text semantic features and knowledge features are fused to obtain fused features, and the slot extraction results of the music search text are determined according to the fused features. Compared with the traditional slot extraction method, the present application incorporates the interactive heat information of the knowledge text into the process of determining the knowledge features of the music search text by storing the hot music knowledge base that stores the knowledge text, slot type information and interactive heat information, so as to reflect the different importance of each knowledge text, obtain more accurate knowledge features of the music search text, and improve the accuracy of slot extraction, thereby improving the accuracy of music search.
[0044] In one embodiment, the knowledge features of the music search text are determined based on 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 a three-dimensional numerical matrix It is defined as: taking out the target knowledge text with the jth character in the music search text as the entity boundary from the knowledge text, and determining the comprehensive interactive heat information of each target knowledge text with the i-th character in the music search text as the k-th label in the label set in the target knowledge text, represents the length of the music search text, and t represents the length of the tag set; the tags contained in the tag set are generated based on the preset tag system and the candidate slot type information corresponding to the hot music knowledge base; ; Determine the knowledge features of the music search text based on the three-dimensional numerical matrix.
[0045] Among them, the comprehensive interactive heat information is the sum of the interactive heat information of the knowledge text under the same slot type.
[0046] In one embodiment, the slot types include 13 slot types: singer, song, album, film and television, quarter, sort, demand type, list, song type, asset, time, era and playback method. The t types of tags contained in the tag set are implemented based on the BIO tag system, where t = the number of slot types × 2 + 1 = 13 × 2 + 1 = 27. The BIO tag system is a tagging system for named entity recognition tasks, which is used to mark entities in text. The BIO tagging system divides the text into three types of tags 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 tagging system, entities in the text can be clearly identified and located.
[0047] In the above embodiment, by integrating the boundary information and interaction heat information of the entity into a three-dimensional numerical matrix to improve the accuracy of the knowledge features of the music search text, the accuracy of slot extraction can be further improved, and then the accuracy of music search can be further improved.
[0048] In one embodiment, knowledge features of a music search text are determined based on a 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; on the first dimension of the initial three-dimensional vector matrix, summing the first weight matrix and the second weight matrix to obtain a two-dimensional knowledge matrix; and determining the knowledge features of the music search text based on the two-dimensional knowledge matrix.
[0049] The relative position attention weight calculation refers to the process of calculating the attention weight by considering the relative position relationship between elements in the sequence in the attention mechanism. It can be understood that this process aims to capture the importance and relationship between different elements in the sequence, so that the model can better understand the relative order and temporal relationship of the elements in the sequence.
[0050] In one embodiment, the knowledge feature includes a knowledge feature vector. The computer device may input a 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 may input the initial three-dimensional vector matrix into a RoPE (Relative Positional Encoding) network to 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, and 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. The computer device may input the two-dimensional knowledge matrix into a bidirectional gated recurrent network, and then input the input result of the bidirectional gated recurrent network into the RoPE network to obtain a knowledge feature vector of the music search text. Furthermore, the computer device may input the text semantic features and the knowledge features into a second linear fully connected network for fusion to obtain fusion features, and predict the target sequence annotation results of the music search text based on the fusion features.
[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 a two-dimensional knowledge matrix, and determining the knowledge features of the music search text based on the two-dimensional knowledge matrix, the accuracy of the knowledge features of the music search text can be improved, thereby further improving the accuracy of slot extraction, and further improving the accuracy of music search.
[0052] In one embodiment, semantic features of a music search text are extracted to obtain text semantic features, including: 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 of network units in the semantic feature extraction network; fusing features output by the first layer of network units in the semantic feature extraction network with features output by the last layer of network units in the semantic feature extraction network to obtain text semantic features of the music search text.
[0053] In one embodiment, the computer device may use the average value of the features output by the first layer of network units in the semantic feature extraction network and the features output by the last layer of network units in the semantic feature extraction network as the text semantic features of the music search text.
[0054] In one embodiment, the computer device may perform weighted summation on the features output by the first layer of network units in the semantic feature extraction network and the features output by the last layer of network units in the semantic feature extraction network to obtain text semantic features of the music search text.
[0055] In the above embodiment, since the semantic feature extraction network carries rich semantic information, the text semantic features of the music search text are obtained by fusing the features output by the first layer of network units in the semantic feature extraction network with the features output by the last layer of network units in the semantic feature extraction network. This can retain more semantic information in the semantic feature extraction network, improve the accuracy of the knowledge features of the music search text, thereby further improving the accuracy of slot extraction, and further improving the accuracy of music search.
[0056] In one embodiment, text semantic features and knowledge features are fused to obtain fused features, and slot extraction results of the music search text are determined based on the fused features, including: inputting text semantic features and knowledge features into a prediction network in a trained slot extraction model, using the prediction network to fuse the text semantic features and knowledge features to obtain fused features, predicting target sequence labeling results of the music search text based on the fused features, and parsing the target sequence labeling results to obtain slot extraction results of the music search text.
[0057] In one embodiment, the present application also proposes a training method for a slot extraction model, including: obtaining a sample music search text and a reference sequence annotation result of the sample music search text; inputting the sample music search text into the semantic feature extraction network in the slot extraction model to be trained to obtain the sample text semantic feature; inputting the sample music search text into the knowledge feature extraction network in the slot extraction model to be trained to obtain the sample knowledge feature; inputting the sample text semantic feature and the sample knowledge feature into the prediction network in the slot extraction model to be trained to obtain the predicted sequence annotation result of the sample music search text; determining the target loss value according to the predicted sequence annotation result and the reference sequence annotation result, and training the slot extraction model to be trained based on the target loss value to obtain the trained slot extraction model; the trained slot extraction model is used to obtain the slot extraction result of the 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 annotation 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 the semantic features of the sample music search text through the semantic feature extraction network, and 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, so as to extract the knowledge features of the sample music search text through the knowledge feature extraction network, and 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, so as to fuse the sample text semantic features and the sample knowledge features through the prediction network, obtain the sample fusion features, and determine the prediction sequence annotation result of the sample music search text based on the sample fusion head features. Furthermore, the computer device can determine the target loss value based on the predicted sequence labeling results and the reference sequence labeling results, and iteratively train the slot extraction model to be trained in the direction of reducing the target loss value until the iteration stop condition is met, thereby obtaining the trained slot extraction model.
[0059] In one embodiment, the iteration stopping condition may be that the number of iterations reaches a preset number, or that the target loss value is less than a preset loss value.
[0060] In one embodiment, the computer device may directly determine the target loss value based on the predicted sequence labeling results and the reference sequence labeling results.
[0061] In the above embodiment, the target loss value is determined according to the predicted sequence labeling results output by the slot extraction model to be trained and the reference sequence labeling results of the sample music search text, and the slot extraction model to be trained is trained based on the target loss value. This can improve the slot extraction accuracy of the trained slot extraction model, thereby further improving the accuracy of music search.
[0062] In one embodiment, a target loss value is determined based on the predicted sequence labeling results and the reference sequence labeling results, including: determining a first loss value based on the predicted sequence labeling results and the reference sequence labeling results; determining a second loss value based on sample text semantic features and sample knowledge features; and fusing the first loss value with the second loss value to obtain a target loss value.
[0063] In one embodiment, the computer device may perform a weighted summation of the first loss value and the second loss value to obtain a target loss value.
[0064] In one embodiment, the computer device may use 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 may be calculated by the following formula:
[0066] ;
[0067] ;
[0068] ;
[0069] Where m is the number of sample music search texts, The reference sequence annotation result for the i-th sample music search text, The predicted sequence annotation result for the i-th sample music search text, are the pre-set model parameters, is the first loss value, The sample text semantic features of the i-th sample music search text, is the sample knowledge feature of the i-th sample music search text, KL represents the bidirectional KL divergence function, is the second loss value, is a pre-set hyperparameter, is the target loss value.
[0070] In one embodiment, Figure 3As shown, the computer device can build a hot music knowledge base based on the data in the music library. The hot music knowledge base contains dictionary lists corresponding to slot types such as singers, songs, albums, movies, seasons, sorting, demand types, charts, song types, assets, time, eras, and play methods. The dictionary list of each slot type contains multiple candidate knowledge texts and interactive heat information of each candidate knowledge text. For example, the dictionary list under the singer slot type contains the candidate knowledge text "I", and the interactive heat information of the candidate knowledge text "I" is "179", that is, 179 times of play. Similarly, the dictionary list under the movie slot type contains the candidate knowledge text "I", and the interactive heat information of the candidate knowledge text "I" is "4798", that is, 4798 times of play. The dictionary list under the song slot type contains the candidate knowledge text "I", and the interactive heat information of the candidate knowledge text "I" is "1129275", that is, 1129275 times of play. The computer device can obtain sample music search texts, such as "I want to listen to Zhang San's Big Fish", and obtain reference sequence annotation results of sample music search texts based on the BIO tag system, such as "OOOB-singer I-singer OB-song I-song", where "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 means that the character "Zhang" is the beginning of the entity and that the character "Zhang" belongs to the slot type "singer". In addition, labels corresponding to sample knowledge texts that match the sample music search texts are obtained from the hot music knowledge base. For example, labels corresponding to the character "I" include B-singer, B-film and television, and B-song.
[0071] The computer device may input the sample music search text into the semantic feature extraction network in the slot extraction model to be trained, so as 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, so as 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 may 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 to obtain the sample fusion features, and determine the predicted sequence labeling result of the sample music search text based on the sample fusion head features. Furthermore, the computer device may determine the 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 the direction of reducing the target loss value until the iteration stop condition is met to obtain the trained slot extraction model.
[0072] In the above embodiment, 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 sample text semantic features and the sample knowledge features, the first loss value and the second loss value are fused to obtain a target loss value, and the slot extraction model to be trained is 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 each step in the flow chart of the above-mentioned embodiments is shown in order, these steps are not necessarily performed in order. Unless there is a clear explanation in this article, the execution of these steps does not have strict order restrictions, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned embodiments may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in order, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0074] In one embodiment, Figure 4 As shown, a slot extraction device 400 in a music search scenario is provided, and the device 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; obtain the knowledge text matching the music search text, the slot type information of the knowledge text and the interactive heat information of the knowledge text from the pre-built hot music knowledge base;
[0076] 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 interactive heat information of the knowledge text; fuse the text semantic features and the knowledge features to obtain the fused features, and determine the slot extraction results of the music search text based on the fused features.
[0077] In one embodiment, the determination module 404 is further used to convert the knowledge text, the slot type information of the knowledge text and the interaction heat information of the knowledge text into a three-dimensional numerical matrix ; Any element in a three-dimensional numerical matrix It is defined as: taking out the target knowledge text with the jth character in the music search text as the entity boundary from the knowledge text, and determining the comprehensive interactive heat information of the target knowledge text with the i-th character in the music search text as the k-th label in the label set in the target knowledge text, represents the length of the music search text, and t represents the length of the tag set; the tags contained in the tag set are generated based on the preset tag system and the candidate slot type information corresponding to the hot music knowledge base; ; Determine the knowledge features of the music search text based on the three-dimensional numerical matrix.
[0078] In one embodiment, the determination module 404 is also used 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; on the first dimension of the initial three-dimensional vector matrix, sum the first weight matrix and the second weight matrix to obtain a two-dimensional knowledge matrix; and determine the knowledge features of the music search text based on the two-dimensional knowledge matrix.
[0079] In one embodiment, the acquisition module 402 is also used to input the music search text into the semantic feature extraction network in the trained slot extraction model, so as to extract the features of the music search text through each layer of network units in the semantic feature extraction network; the features output by the first layer of network units in the semantic feature extraction network are merged with the features output by the last layer of network units in the semantic feature extraction network to obtain the text semantic features of the music search text.
[0080] In one embodiment, the determination module 404 is also used to input the text semantic features and knowledge features into the prediction network in the trained slot extraction model, and the prediction network fuses the text semantic features and knowledge features to obtain fused features, predicts the target sequence labeling results of the music search text based on the fused features, and parses the target sequence labeling results to obtain the slot extraction results of the music search text.
[0081] In one embodiment, the slot extraction result is obtained by extracting the trained slot extraction model; Figure 5 As shown, the slot extraction device 400 in the music search scenario also includes:
[0082] The training module 406 is used to obtain the sample music search text and the reference sequence annotation results of the sample music search text; input the sample music search text into the semantic feature extraction network in the slot extraction model to be trained to obtain the sample text semantic features; input the sample music search text into the knowledge feature extraction network in the slot extraction model to be trained to obtain the sample knowledge features; input the sample text semantic features and the sample knowledge features into the prediction network in the slot extraction model to be trained to obtain the predicted sequence annotation results of the sample music search text; determine the target loss value according to the predicted sequence annotation results and the reference sequence annotation results, and train the slot extraction model to be trained based on the target loss value to obtain the trained slot extraction model.
[0083] In one embodiment, the training module 406 is also used 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 with the second loss value to obtain a target loss value.
[0084] The slot extraction device in the above-mentioned music search scenario obtains the music search text, extracts the semantic features of the music search text, and obtains the text semantic features; obtains the knowledge text matching the music search text, as well as the slot type information and interactive heat information of the knowledge text from the pre-constructed hot music knowledge base; determines the knowledge features of the music search text based on the knowledge text, slot type information and interactive heat information; fuses the text semantic features and the knowledge features to obtain fused features, and determines the slot extraction results of the music search text based on the fused features. Compared with the traditional slot extraction method, the present application integrates the interactive heat information of the knowledge text into the process of determining the knowledge features of the music search text by storing the hot music knowledge base that stores the knowledge text, slot type information and interactive heat information, so as to reflect the different importance of each knowledge text, obtain more accurate knowledge features of the music search text, and improve the accuracy of slot extraction, thereby improving the accuracy of music search.
[0085] Each module in the slot extraction device in the music search scenario can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0086] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a slot extraction method in a music search scenario is implemented.
[0087] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a slot extraction method in a music search scenario is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0088] Those skilled in the art will understand that Figure 6 The structure shown in FIG. 7 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0089] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0090] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0091] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[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 used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0093] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database 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), tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0094] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.
[0095] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A slot extraction method in a music search scenario, characterized in that: The method comprises: Extracting semantic features of music search text to obtain text semantic features; Acquire, from a pre-built popular music knowledge base, a knowledge text matching the music search text, slot type information of the knowledge text, and interactive popularity information of the knowledge text; Determining the knowledge feature of the music search text according to the knowledge text, the slot type information of the knowledge text and the interaction heat information of the knowledge text; The text semantic feature and the knowledge feature are fused to obtain a fused feature, and a slot extraction result of the music search text is determined according to the fused feature.
2. The method according to claim 1, characterized in that The step of determining the knowledge feature of the music search text according to the knowledge text, the slot type information of the knowledge text, and the interaction heat information of the knowledge text includes: The knowledge text, the slot type information of the knowledge text and the interaction heat information of the knowledge text are converted into a three-dimensional numerical matrix ; Any element in the three-dimensional numerical matrix It is defined as: from the knowledge text, take out the target knowledge text with the jth character in the music search text as the entity boundary, and in the target knowledge text, determine the comprehensive interactive heat information of each target knowledge text with the i-th character in the music search text as the k-th tag in the tag set, represents the length of the music search text, and t represents the length of the tag set; the tags included in the tag set are generated based on a preset tag system and candidate slot type information corresponding to the hot music knowledge base; ; The knowledge features of the music search text are determined based on the three-dimensional numerical matrix.
3. The method according to claim 2, characterized in that Determining the knowledge features of the music search text according to the three-dimensional numerical matrix includes: 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; On 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.
4. The method according to claim 1, characterized in that The step of extracting the semantic features of the music search text to obtain the text semantic features includes: Inputting the music search text into a semantic feature extraction network in a trained slot extraction model, so as to extract features of the music search text through each layer of network units in the semantic feature extraction network; The features output by the first layer of network units in the semantic feature extraction network are fused with the features output by the last layer of network units in the semantic feature extraction network to obtain text semantic features of the music search text.
5. The method according to claim 1, characterized in that The step of fusing the text semantic feature and the knowledge feature to obtain a fusion feature, and determining a slot extraction result of the music search text according to the fusion feature, comprises: The text semantic features and the knowledge features are input into a prediction network in a trained slot extraction model, and the prediction network fuses the text semantic features and the knowledge features to obtain fused features. A target sequence labeling result of the music search text is predicted based on the fused features, and the target sequence labeling result is parsed to obtain a slot extraction result of the music search text.
6. A method for training a slot extraction model, characterized in that: The method comprises: Obtaining a sample music search text and a reference sequence annotation 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 semantic features of the sample text; Inputting the sample music search text into the 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 a slot extraction model to be trained to obtain a prediction sequence labeling result of the sample music search text; According to 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 the music search text.
7. The method according to claim 6, characterized in that The step of determining a 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 feature and the sample knowledge feature; The first loss value and the second loss value are combined to obtain a target loss value.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
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
Destination addressing for transactions associated with a distributed ledger
US20230036694A1
