Audio similarity determination method and related device
By separating pure music audio features and human voice audio text from audio, performing semantic analysis, and combining audio and text features to calculate the similarity, the problem of poor audio similarity accuracy in the existing technology is solved, and more objective and accurate Audio similarity assessment.
Patent Information
- Application Number
- CN202411212538.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-08
AI Technical Summary
Existing audio similarity determination methods rely on authors or classifications, with time variation and subjectivity problems, resulting in poor similarity accuracy.
By separating pure music audio features and human voice audio text from the audio, performing semantic analysis, obtaining meaning text features, and combining audio and text features to perform similarity calculations, the similarity of audio is determined based on this.
Improves the accuracy of audio similarity, provides a more objective and accurate audio similarity assessment, and reduces the impact of subjective judgments.
Smart Images

Figure CN118916513A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method for determining audio similarity and a related device. Background Art
[0002] With the rapid development of the Internet and digital technology, massive audio resources are widely disseminated. These audios are not only huge in quantity but also diverse in content. In order to effectively utilize these audios, it is necessary to determine the similarity of audios in many scenarios.
[0003] Currently, the similarity between audios is generally determined by the author of each audio or the category to which it belongs.
[0004] However, the author's audio style may change over time, and the classification criteria are often subjective, which makes the current audio similarity determination method have great limitations, resulting in poor similarity accuracy. Summary of the invention
[0005] In view of the above problems, the present application provides a method and a related device for determining audio similarity in order to improve the accuracy of audio similarity. The specific scheme is as follows:
[0006] The first aspect of the present application provides a method for determining audio similarity, comprising:
[0007] Determine the audio similarity between the audio features of the target audio and the audio features of at least one audio in the preset audio library, wherein the audio features are features of pure music audio separated from the audio;
[0008] Obtain the text corresponding to the human voice audio separated from the audio;
[0009] Performing semantic analysis on the text to obtain a meaning text of the text;
[0010] Obtaining features of the meaning text, and using the features of the meaning text as text features of the audio;
[0011] Determining text similarities between the text features of the target audio and the text features of the at least one audio;
[0012] Based on the audio similarity and the text similarity, similarities between the target audio and the at least one audio are determined.
[0013] In a possible implementation, after determining the similarity between the target audio and the at least one audio based on the audio similarity and the text similarity, the method further includes:
[0014] Sorting the at least one audio based on the similarity to obtain at least one sorted audio;
[0015] The sorted at least one audio is recommended to the user.
[0016] In a possible implementation, performing semantic analysis on the text to obtain the meaning text of the text includes:
[0017] Performing word segmentation on the text to obtain a word segmentation result;
[0018] Preprocessing the word segmentation result to obtain multiple keywords and keyword sequences;
[0019] Obtaining the meaning text of each of the keywords through a preset dictionary;
[0020] The meaning texts of the keywords are combined according to the keyword sequence to obtain the meaning text of the text.
[0021] In a possible implementation, performing semantic analysis on the text to obtain the meaning text of the text includes:
[0022] Performing word segmentation on the text to obtain a word segmentation result;
[0023] Preprocessing the word segmentation results to obtain multiple keywords and parts of speech of the keywords;
[0024] Obtaining the meaning text of each of the keywords through a preset dictionary;
[0025] The meaning texts of the keywords are combined according to the parts of speech of the keywords to obtain the meaning texts of the texts.
[0026] In a possible implementation, performing semantic analysis on the text to obtain the meaning text of the text includes:
[0027] The text is input into a pre-trained meaning text extraction model to obtain the meaning text of the text.
[0028] In a possible implementation, the training process of the meaning text extraction model includes:
[0029] Obtaining a plurality of training samples with meaningful text labels, each of the training samples comprising a plurality of historical texts;
[0030] The initial model is trained using a plurality of the training samples to obtain the meaning text extraction model, wherein the input of the meaning text extraction model is the text, and the output of the meaning text extraction model is the meaning text of the text.
[0031] A second aspect of the present application provides an audio similarity determination device, characterized by comprising:
[0032] A first determination unit is used to determine the audio similarity between the audio features of the target audio and the audio features of at least one audio in a preset audio library, wherein the audio features are features of pure music audio separated from the audio;
[0033] A first obtaining unit, used to obtain a text corresponding to the human voice audio separated from the audio;
[0034] A semantic analysis unit, used for performing semantic analysis on the text to obtain a meaning text of the text;
[0035] A second obtaining unit is used to obtain the features of the meaning text and use the features of the meaning text as text features of the audio;
[0036] A second determination unit, configured to determine text similarities between the text features of the target audio and the text features of the at least one audio;
[0037] The third determining unit is used to determine the similarity between the target audio and the at least one audio based on the audio similarity and the text similarity.
[0038] A third aspect of the present application provides a computer program product, comprising computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the method for determining the audio similarity of the first aspect or any implementation of the first aspect.
[0039] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0040] The memory is used to store computer programs;
[0041] The processor is used to execute the computer program so that the electronic device can implement the audio similarity determination method of the first aspect or any implementation manner of the first aspect.
[0042] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can use the method for determining the audio similarity of the first aspect or any implementation of the first aspect.
[0043] By means of the above technical scheme, the present application provides a method for determining the similarity of audio and a related device. The method first determines the audio similarity between the audio features of the target audio and the audio features of at least one audio in a preset audio library, determines the text similarity between the text features of the target audio and the text features of at least one audio, and determines the similarity between the target audio and the at least one audio based on the audio similarity and the text similarity. The audio features are the features of the pure music audio separated from the audio, and the text features are the features of the meaning text corresponding to the human voice audio separated from the audio. Both the audio features and the text features are objective attributes of the audio itself, and can reflect the intrinsic connection between each audio. Therefore, comprehensive consideration of the audio features and the text features is conducive to improving the accuracy of the similarity of the audio. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0045] Figure 1 A schematic diagram of a flow chart of a method for determining audio similarity provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of the structure of an audio similarity determination device provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of the hardware structure of an audio similarity determination device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0049] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0050] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0051] In many applications such as audio recommendation or audio classification, the calculation of audio similarity is particularly important. At present, the similarity between audios mainly depends on the author of the audio or the category to which it belongs. However, the limitations of this method are becoming increasingly prominent. On the one hand, with the changes in time and the creation environment, the audio style of the same author may change significantly, resulting in the failure of similarity judgment based on author identity. On the other hand, audio classification often relies on subjective judgment and lacks unified and objective standards. Different classifiers may classify the same audio differently based on different understandings, preferences or background knowledge. The method of judging audio similarity based on the audio author or category has obvious limitations in dealing with changes in author style and classification subjectivity, resulting in poor similarity accuracy.
[0052] In order to determine the similarity of audio more objectively and accurately, the present application provides a method for determining the similarity of audio. The method for determining the similarity of audio provided by the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0053] Please see attached Figure 1 , Figure 1 A flowchart of a method for determining audio similarity provided in an embodiment of the present application. The method may include the following steps:
[0054] Step S101: determining the audio similarity between the audio features of the target audio and the audio features of at least one audio in a preset audio library, wherein the audio features are features of pure music audio separated from the audio.
[0055] It should be noted that the preset audio library can contain audio of various music types and styles. The audio can be the target audio or at least one audio in the preset audio library. Audio features are key features that can represent the audio characteristics of pure music audio separated from the audio. For example: spectral features, rhythmic features, pitch features, and timbre features. Among them, the spectral features can be Mel-frequency spectra, which reflect the frequency distribution of audio by simulating the auditory characteristics of the human ear; the rhythmic features can be beat detection, which is used to identify the rhythmic pattern in the audio; the pitch features can be fundamental frequency estimation, which reflects the main melody of the audio; the timbre features can be Mel-frequency cepstral coefficients, which are used to describe the timbre characteristics of the audio.
[0056] In the present application, the process of obtaining audio features may include: performing vocal separation processing on the audio to separate pure music audio from the audio; inputting the pure music audio into a pre-trained audio feature extraction model to obtain audio features of the pure music audio.
[0057] Of course, in other embodiments of the present application, the audio features of pure music audio can also be obtained by other means, for example: using audio analysis software (such as Audacity), a specialized audio feature extraction library (such as Librosa: Python library), an audio feature extraction tool (such as Sonic Visualiser), etc.
[0058] Specifically, there are many ways to perform vocal separation processing on audio to obtain pure music audio in the audio. As an implementable method, audio editing software or online tools (such as Ji Ling online tools) can be used to automatically separate pure music audio. As another implementable method, the audio is input into a pre-trained vocal separation model to obtain pure music audio in the audio. The training process of the vocal separation model includes: obtaining multiple first training samples with pure music audio labels, each first training sample includes multiple historical audios; using multiple first training samples to train a first initial model to obtain a vocal separation model, wherein the input of the vocal separation model is audio, and the output of the vocal separation model is pure music audio in the audio, and the first initial model can be a convolutional neural network, a recurrent neural network, etc.
[0059] The training process of the audio feature extraction model includes: obtaining multiple second training samples with audio feature labels, each second training sample includes multiple historical pure music audios, using the multiple second training samples to train the second initial model to obtain the audio feature extraction model, wherein the input of the audio feature extraction model is pure music audio, and the output of the audio feature extraction model is the audio features of the pure music audio. The second initial model can be a convolutional neural network, a long short-term memory network, etc.
[0060] In the present application, audio similarity quantifies the similarity between the target audio and at least one audio in the preset audio library. There are many ways to determine the audio similarity between the audio features of the target audio and the audio features of at least one audio in the preset audio library, such as cosine similarity, Euclidean distance, and dynamic time warping. Among them, cosine similarity evaluates the similarity by calculating the cosine value of the angle between two audio features; Euclidean distance measures the straight-line distance between two audio features in multidimensional space; dynamic time warping finds the optimal alignment path and calculates the similarity through dynamic programming. The choice of specific method depends on the dimension and type of the audio feature.
[0061] Step S102: Obtain the text corresponding to the human voice audio separated from the audio.
[0062] It should be noted that the audio includes the target audio and at least one audio in the preset audio library. The text is a specific and literal audio character sequence.
[0063] In the present application, the audio can be processed for human voice separation, the human voice audio can be separated from the audio and the human voice audio can be recognized to obtain the text corresponding to the human voice audio.
[0064] Specifically, there are many ways to perform vocal separation processing on audio to obtain the vocal audio in the audio. As an implementable method, the vocal audio can be automatically separated using audio editing software (such as Jinzhou audio vocal separation software) or online tools. As another implementable method, the audio is input into a pre-trained vocal separation model to obtain the vocal audio in the audio. The training process of the vocal separation model includes: obtaining multiple third training samples with vocal audio labels, each third training sample includes multiple historical audios; using multiple third training samples to train the third initial model to obtain the vocal separation model, wherein the input of the vocal separation model is audio, and the output of the vocal separation model is the vocal audio in the audio, and the third initial model can be a convolutional neural network, a recurrent neural network, etc.
[0065] In order to convert the separated human voice audio into a readable text form, a variety of ways can be provided to identify the text corresponding to the human voice audio. As an implementable method, professional audio-to-text software (such as iFlytek Hear), online audio-to-text tools (Speechnotes), smartphone applications, programming and API interfaces, cloud services and integrated solutions can be used to automatically identify the text corresponding to the human voice audio. As another implementable method, the human voice audio is input into a pre-trained text recognition model to obtain the text corresponding to the human voice audio. The training process of the text recognition model includes: obtaining a plurality of fourth training samples with text labels, each fourth training sample includes a plurality of historical human voice audios; using a plurality of fourth training samples to train a fourth initial model to obtain a text recognition model, wherein the input of the text recognition model is human voice audio, and the output of the text recognition model is the text corresponding to the human voice audio, and the fourth initial model can be a convolutional neural network, a long short-term memory network, and the like.
[0066] To make it easier to understand, let’s take the following example: “The stars light up the door of my home, so that lost children can find their way back.”
[0067] Step S103: Perform semantic analysis on the text to obtain the meaning of the text.
[0068] In this application, the text is deeply analyzed and the meaning of the text is accurately interpreted to form the meaning text of the text. Compared with the text, the meaning text can more accurately reflect the text characteristics of the audio.
[0069] It should be noted that the meaning of text refers to the actual meaning or emotion conveyed by the audio.
[0070] A variety of ways can be provided to semantically analyze the meaning text of the text. As one possible implementation method, the text can be semantically analyzed by keywords and keyword sequences to obtain the meaning text of the text; as another possible implementation method, the text can be semantically analyzed by keywords and keyword parts of speech to obtain the meaning text of the text; as another possible implementation method, the text can be input into a pre-trained meaning text extraction model to obtain the meaning text of the text.
[0071] To facilitate understanding, for the text in the above example, the meaning of the text can be: "The stars illuminate my home like lights, helping lost children find their way home, symbolizing hope, guidance and comfort."
[0072] Step S104: Obtain features of the meaning text, and use the features of the meaning text as text features of the audio.
[0073] It should be noted that text features are key features extracted from meaningful text that can represent its audio characteristics. For example: semantic features, lexical features, embedding features and statistical features. Among them, semantic features refer to the specific meaning conveyed in the text, which reflects the deep meaning of the audio by capturing the theme, emotional tendency, contextual relationship, etc. of the text; lexical features include the frequency of occurrence of words, the use of specific words or phrases, and the diversity of words. These features can reveal the language style, key words, and possible keywords or phrases of the audio content; embedding features are representations that map words or sentences in the text to high-dimensional vector space; statistical features are features based on the overall properties or distribution of the text.
[0074] In the present application, the meaning text may be input into a pre-trained text feature extraction model to obtain text features of the meaning text.
[0075] The training process of the text feature extraction model includes: obtaining multiple fifth training samples with text feature labels, each fifth training sample includes multiple historical meaning texts; using the multiple fifth training samples to train the fifth initial model to obtain a text feature extraction model, wherein the input of the text feature extraction model is the meaning text, and the output of the text feature extraction model is the text features of the meaning text, and the fifth initial model can be an embedding model, a Transformer model, etc.
[0076] Of course, in other embodiments of the present application, text features of meaningful text can also be obtained by other means, for example: using text analysis software (such as a natural language processing toolkit), a specialized text feature extraction library (such as TextBlob: Python library), a text feature extraction tool (such as RapidMiner), etc.
[0077] Step S105: Determine the text similarity between the text features of the target audio and the text features of at least one audio.
[0078] In this application, text similarity also quantifies the degree of similarity between the target audio and at least one audio in the preset audio library. There are many ways to determine the text similarity between the text features of the target audio and the text features of at least one audio in the preset audio library, such as cosine similarity, Euclidean distance, and dynamic time warping. Among them, cosine similarity evaluates the similarity by calculating the cosine value of the angle between two text features; Euclidean distance measures the straight-line distance between two text features in multidimensional space; dynamic time warping finds the optimal alignment path and calculates the similarity through dynamic programming. The choice of specific method depends on the dimension and type of text features.
[0079] Step S106: Based on the audio similarity and the text similarity, determine the similarity between the target audio and at least one audio.
[0080] In this application, the audio similarity and text similarity can be fused to obtain a comprehensive similarity evaluation, which can be achieved by weighted summation, taking the maximum value or using a fusion strategy.
[0081] Among them, the weighted sum can assign different weights to audio similarity and text similarity according to the needs of the application scenario. The choice of weight depends on the importance of audio content and text content in similarity assessment in the application scenario. If the application scenario focuses more on audio content, a higher weight can be given to audio similarity.
[0082] In summary, an embodiment of the present application provides a method for determining the similarity of audio. The method first determines the audio similarity between the audio features of the target audio and the audio features of at least one audio in a preset audio library, determines the text similarity between the text features of the target audio and the text features of at least one audio, and determines the similarity between the target audio and the at least one audio based on the audio similarity and the text similarity. The audio features are the features of the pure music audio separated from the audio, and the text features are the features of the meaning text corresponding to the human voice audio separated from the audio. Both the audio features and the text features are objective attributes of the audio itself, and can reflect the intrinsic connection between each audio. Therefore, comprehensive consideration of the audio features and the text features is conducive to improving the accuracy of the similarity of the audio.
[0083] Furthermore, based on the above method, the method may also include the following steps:
[0084] Step S107: sorting the at least one audio based on the similarity to obtain the at least one sorted audio.
[0085] In the present application, at least one audio can be sorted using a sorting algorithm based on the similarity with the target audio to obtain at least one sorted audio. It should be noted that there are many sorting algorithms, including quick sort, merge sort, and heap sort, etc. Each sorting algorithm has its advantages and disadvantages and applicable scenarios. The most suitable sorting algorithm can be selected according to specific needs and the scale of the audio.
[0086] Among them, quick sort is an efficient divide-and-conquer sorting algorithm. By selecting a benchmark element, the array is divided into two sub-arrays, one containing elements smaller than the benchmark and the other containing elements larger than the benchmark. Then the two sub-arrays are recursively sorted until the entire array is ordered. Quick sort is fast in most cases, but its performance is poor in the worst case; merge sort is a stable divide-and-conquer sorting algorithm. It divides the array into two halves, recursively sorts each half, and then merges the two ordered sub-arrays into an ordered array. By continuously merging, a completely ordered array is finally obtained. Merge sort is a stable sorting algorithm suitable for sorting large amounts of data; heap sort is a sorting algorithm based on the heap data structure. It first constructs the array into a maximum heap, then continuously exchanges the maximum element at the top of the heap with the element at the end of the heap, and readjusts the heap structure. By repeating this process, an ordered array is finally obtained. Heap sort is suitable for situations where elements need to be frequently inserted and deleted.
[0087] Step S108: recommending at least one sorted audio to the user.
[0088] In the present application, a certain number of audios can be selected from at least one of the sorted audios and recommended to the user. The number can be set according to actual needs, such as recommending the top five, top ten, etc. The recommendation method can also be varied, such as displaying it as a list on the audio playback platform, or sending it through an email recommendation or a link content in a text message.
[0089] Furthermore, user feedback on the recommended audio, such as click-through rate, playback time, user ratings, etc., can be collected to continuously optimize the recommendation process.
[0090] In summary, by giving priority to recommending audio with high similarity to the target audio to users, the accuracy of the recommendation is improved, which is conducive to improving the user experience and satisfaction. At the same time, this method can also be applied to multiple fields such as audio analysis and audio classification, providing strong support for related applications.
[0091] In a possible implementation, a specific implementation method of performing semantic analysis on a text to obtain the meaning of the text is described in detail. The method may include the following steps:
[0092] Step S201: Segment the text into words to obtain a segmentation result.
[0093] In the present application, a word segmentation algorithm may be used to segment the input text into a series of meaningful vocabulary units according to the language characteristics of the text (such as Chinese, English, etc.) and context information to obtain a word segmentation result.
[0094] It should be noted that there are various word segmentation algorithms, such as statistical-based word segmentation methods, rule-based word segmentation methods, or hybrid methods. The word segmentation result is a list of a series of words, and each word is an independent unit in the text.
[0095] Step S201: Preprocess the word segmentation result to obtain multiple keywords and the keyword order.
[0096] In this application, keywords that contribute more to the text meaning can be screened out from the word segmentation result, and the order of these keywords in the original text is retained.
[0097] Specifically, remove stop words: Stop words refer to words that frequently appear in the text but contribute little to the text meaning, such as "de" (of), "le" (particle indicating completion), etc. Remove duplicate words: Remove duplicate words that do not contribute additionally to understanding the text meaning, and it needs to be determined according to the actual situation whether to execute this operation, because sometimes duplicate words may be part of the text features (such as emphasis). Keyword extraction: Extract keywords in the text based on algorithms such as TF-IDF (Term Frequency - Inverse Document Frequency), TextRank, etc. Record the keyword order: While extracting keywords, record the order in which they appear in the original text.
[0098] Step S203: Obtain the meaning text of each keyword through a preset dictionary.
[0099] It should be noted that this dictionary contains the mapping relationship between words and their meaning texts.
[0100] In this application, through the preset dictionary, the corresponding explanation or meaning text can be found for each keyword. For each keyword, look up the corresponding meaning text in the dictionary. If the keyword does not exist in the dictionary, it can be chosen to ignore the word or perform special processing (such as retrying after replacing with a synonym). The meaning text can be a simple word definition, phrase explanation, or more complex sentence description.
[0101] Step S204: Combine the meaning texts of each keyword according to the keyword order to obtain the meaning text of the text.
[0102] In this application, according to the order of keywords in the original text, their meaning texts can be directly concatenated or concatenated with connecting words, etc., to form a coherent explanation of the overall meaning of the text, that is, the meaning text of the text.
[0103] In a possible implementation, a detailed description is given of the specific implementation method for performing semantic analysis on the text to obtain the meaning text of the text. This method may include the following steps:
[0104] Step S301: Perform word segmentation on the text to obtain the word segmentation result.
[0105] In this application, a word segmentation algorithm can segment the input text into a series of meaningful lexical units according to the language characteristics of the text (such as Chinese, English, etc.) and context information, obtaining the word segmentation result.
[0106] It should be noted that there are various word segmentation algorithms, such as statistical-based word segmentation methods, rule-based word segmentation methods, or hybrid methods. The word segmentation result is a list of a series of words, and each word is an independent unit in the text.
[0107] Step S302: Preprocess the word segmentation result to obtain multiple keywords and the part-of-speech of the keywords.
[0108] In this application, keywords that contribute more to the meaning of the text can be screened out from the word segmentation result, and the part-of-speech of these keywords in the original text is retained.
[0109] Specifically, remove stop words: Stop words refer to words that frequently appear in the text but contribute little to the meaning of the text, such as "de" (的), "le" (了), etc. Specifically, remove stop words: Stop words refer to words that frequently appear in the text but contribute little to the meaning of the text, such as "de" (的), "le" (了), etc. Remove duplicate words: Remove duplicate words that do not contribute additionally to understanding the meaning of the text. Whether to perform this needs to be determined according to the actual situation, because sometimes duplicate words may be part of the text features (such as emphasis). Keyword extraction: Extract keywords in the text based on algorithms such as TF-IDF (Term Frequency-Inverse Document Frequency), TextRank, etc. Record the part-of-speech of keywords: While extracting keywords, record the part-of-speech they represent in the original text, such as nouns, verbs, adjectives, etc.
[0110] Step S303: Obtain the meaning text of each keyword through a preset dictionary.
[0111] It should be noted that this dictionary contains the mapping relationship between words and their meaning texts.
[0112] In this application, through the preset dictionary, the corresponding explanation or meaning text can be found for each keyword. For each keyword, look up the corresponding meaning text in the dictionary. If the keyword does not exist in the dictionary, it can be chosen to ignore the word or perform special processing (such as retrying after using a synonym replacement). The meaning text can be a simple word definition, phrase explanation, or more complex sentence description.
[0113] Step S304: Combine the meaning texts of each keyword according to the part-of-speech of each keyword to obtain the meaning text of the text.
[0114] In this application, the part of speech of each keyword is first used as a guide to help determine the role that the keyword should play in the meaning text (such as subject, predicate, object, etc.), but this does not mean that the part of speech directly determines the order or structure of the text. Next, predefined templates or rules may be used to combine the meaning texts of keywords according to the part of speech. These templates or rules may be based on grammatical rules, sentence structure, or knowledge in a specific field. By applying these templates or rules, the meaning texts of various keywords are combined in a meaningful way to form a new text that can express the meaning of the original text, that is, the meaning text. This process may involve reorganizing the meaning of keywords, adding conjunctions, adjusting sentence structures, etc.
[0115] In a possible implementation, a specific implementation method of performing semantic analysis on a text to obtain a meaning text of the text is described in detail. The method may include: inputting the text into a pre-trained meaning text extraction model to obtain the meaning text of the text.
[0116] In the present application, the training process of the meaning text extraction model may include: obtaining a plurality of training samples with meaning text labels, each training sample including a plurality of historical texts. Using the plurality of training samples to train the initial model, a meaning text extraction model is obtained, wherein the input of the meaning text extraction model is text, and the output of the meaning text extraction model is the meaning text of the text.
[0117] A method for determining audio similarity provided in an embodiment of the present application is introduced above. A device for executing the above method for determining audio similarity will be introduced below.
[0118] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of an audio similarity determination device provided in an embodiment of the present application. Figure 2 As shown, the device comprises:
[0119] The first determination unit 11 is used to determine the audio similarity between the audio features of the target audio and the audio features of at least one audio in the preset audio library, wherein the audio features are features of pure music audio separated from the audio.
[0120] The first obtaining unit 12 is used to obtain the text corresponding to the human voice audio separated from the audio.
[0121] The semantic analysis unit 13 is used to perform semantic analysis on the text to obtain the meaning of the text.
[0122] The second obtaining unit 14 is used to obtain the features of the meaning text and use the features of the meaning text as the text features of the audio.
[0123] The second determining unit 15 is configured to determine the text similarity between the text features of the target audio and the text features of the at least one audio.
[0124] The third determining unit 16 is configured to determine the similarity between the target audio and the at least one audio based on the audio similarity and the text similarity.
[0125] In a possible implementation, the device further includes:
[0126] A sorting unit is used to sort the at least one audio based on the similarity to obtain at least one sorted audio.
[0127] A recommendation unit is used to recommend the at least one sorted audio to a user.
[0128] In a possible implementation, the semantic analysis unit 13 includes:
[0129] The first word segmentation subunit is used to segment the text to obtain a word segmentation result.
[0130] The first processing subunit is used to pre-process the word segmentation result to obtain multiple keywords and keyword sequences.
[0131] The first acquisition subunit is used to acquire the meaning text of each keyword through a preset dictionary.
[0132] The first combining subunit is used to combine the meaning texts of the keywords according to the keyword sequence to obtain the meaning text of the text.
[0133] In a possible implementation, the semantic analysis unit 13 includes:
[0134] The second word segmentation subunit is used to segment the text to obtain a word segmentation result.
[0135] The second processing subunit is used to pre-process the word segmentation result to obtain multiple keywords and the parts of speech of the keywords.
[0136] The second acquisition subunit is used to acquire the meaning text of each keyword through a preset dictionary.
[0137] The second combining subunit is used to combine the meaning texts of the keywords according to the parts of speech of the keywords to obtain the meaning texts of the texts.
[0138] In a possible implementation, the semantic analysis unit 13 includes:
[0139] The input subunit is used to input the text into a pre-trained meaning text extraction model to obtain the meaning text of the text.
[0140] In a possible implementation, the device further includes:
[0141] The third obtaining unit is used to obtain a plurality of training samples with meaningful text labels, each of which includes a plurality of historical texts.
[0142] The training unit is used to train the initial model using a plurality of the training samples to obtain the meaning text extraction model, wherein the input of the meaning text extraction model is the text, and the output of the meaning text extraction model is the meaning text of the text.
[0143] The present application also provides an electronic device in an embodiment. Figure 3 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 3 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0144] like Figure 3 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 to a random access memory (RAM) 303. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 303 is also connected to the bus 304.
[0145] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a memory card, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0146] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any audio similarity determination method provided in the embodiment of the present application.
[0147] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any audio similarity determination method provided in an embodiment of the present application.
[0148] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0149] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0150] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0151] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A method for determining audio similarity, characterized in that: include: Determine the audio similarity between the audio features of the target audio and the audio features of at least one audio in the preset audio library, wherein the audio features are features of pure music audio separated from the audio; Obtain the text corresponding to the human voice audio separated from the audio; Performing semantic analysis on the text to obtain a meaning text of the text; Obtaining features of the meaning text, and using the features of the meaning text as text features of the audio; Determining text similarities between the text features of the target audio and the text features of the at least one audio; Based on the audio similarity and the text similarity, similarities between the target audio and the at least one audio are determined.
2. The method for determining audio similarity according to claim 1, characterized in that: After determining the similarity between the target audio and the at least one audio based on the audio similarity and the text similarity, the method further includes: Sorting the at least one audio based on the similarity to obtain at least one sorted audio; The sorted at least one audio is recommended to the user.
3. The method for determining audio similarity according to claim 1, characterized in that: The semantic analysis of the text to obtain the meaning of the text includes: Performing word segmentation on the text to obtain a word segmentation result; Preprocessing the word segmentation result to obtain multiple keywords and keyword sequences; Obtaining the meaning text of each of the keywords through a preset dictionary; The meaning texts of the keywords are combined according to the keyword sequence to obtain the meaning text of the text.
4. The method for determining audio similarity according to claim 1, characterized in that: The semantic analysis of the text to obtain the meaning of the text includes: Performing word segmentation on the text to obtain a word segmentation result; Preprocessing the word segmentation results to obtain multiple keywords and parts of speech of the keywords; Obtaining the meaning text of each of the keywords through a preset dictionary; The meaning texts of the keywords are combined according to the parts of speech of the keywords to obtain the meaning texts of the texts.
5. The method for determining audio similarity according to claim 1, characterized in that: The semantic analysis of the text to obtain the meaning of the text includes: The text is input into a pre-trained meaning text extraction model to obtain the meaning text of the text.
6. The method for determining audio similarity according to claim 5, characterized in that: The training process of the meaning text extraction model includes: Obtaining a plurality of training samples with meaningful text labels, each of the training samples comprising a plurality of historical texts; The initial model is trained using a plurality of the training samples to obtain the meaning text extraction model, wherein the input of the meaning text extraction model is the text, and the output of the meaning text extraction model is the meaning text of the text.
7. An audio similarity determination device, characterized in that: include: A first determination unit is used to determine the audio similarity between the audio features of the target audio and the audio features of at least one audio in a preset audio library, wherein the audio features are features of pure music audio separated from the audio; A first obtaining unit, used to obtain a text corresponding to the human voice audio separated from the audio; A semantic analysis unit, used for performing semantic analysis on the text to obtain a meaning text of the text; A second obtaining unit is used to obtain the features of the meaning text and use the features of the meaning text as text features of the audio; A second determination unit, configured to determine text similarities between the text features of the target audio and the text features of the at least one audio; The third determining unit is used to determine the similarity between the target audio and the at least one audio based on the audio similarity and the text similarity.
8. A computer program product, characterized in that The method comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the method for determining the audio similarity as claimed in any one of claims 1 to 6.
9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the audio similarity determination method as described in any one of claims 1 to 6.
10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the audio similarity determination method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Terminal fraud phone recognition method based on call text word vector
CN111669757A
Text semantic recognition processing system and method based on industrial control system
CN113609864A
Song identification method, computer equipment and storage medium
CN116189707A
Audio recognition method, electronic equipment and storage medium
CN117672166A
