Audio retrieval method and device, electronic equipment and storage medium

By converting the question speech into textual semantic features and retrieving them in the semantic feature database, combined with the language model to determine the relevance, the problem of inaccurate audio retrieval in the existing technology is solved, and the user's voice control audio playback experience and accuracy are improved.

CN118535762APending Publication Date: 2024-08-23ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410404848.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-03
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing audio retrieval technology is difficult to accurately calculate the similarity between texts, resulting in poor performance when users control audio playback with their voice. Retrieval errors are prone to occur, especially when the keyword semantics are ambiguous.

Method used

By converting the question speech into text, the text semantic features are generated, and similarity retrieval is performed in the semantic feature database. The language model is used to determine the correlation between the semantic features of the candidate text block and the question text to determine the target audio segment.

Benefits of technology

It improves the accuracy of audio retrieval and the user's voice control audio playback experience, and avoids inaccurate or incorrect retrieval results caused by ambiguous semantics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535762A
    Figure CN118535762A
Patent Text Reader

Abstract

The invention provides an audio retrieval method and device, electronic equipment and a storage medium. The method can comprise the following steps: converting an obtained question voice into a question text, and generating a question text semantic feature corresponding to the question text; candidate text block semantic features matched with the question text semantic features are retrieved in a semantic feature library, the semantic feature library comprises text block semantic features generated by pre-segmented first-class text blocks, and the first-class text blocks are obtained by segmenting an existing text corresponding to the existing audio; inputting the semantic feature of the question text, the semantic feature of the candidate text block and the first prompt information into a language model, and obtaining a relevancy result output by the language model; and determining a target text block semantic feature matched with the problem text from the candidate text block semantic features according to a correlation result, and determining a target audio segment corresponding to the target text block semantic feature in the existing audio.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present specification relates to the field of data processing technology, and in particular to an audio retrieval method, device, electronic device and storage medium. Background Art

[0002] In some audio retrieval scenarios, users want to control audio playback products through voice to play the content they need. For example, the user says to the audio playback product: play the story of Borrowing Light Through a Hole in the Wall. The player needs to retrieve the audio of Borrowing Light Through a Hole in the Wall from the massive audio stored in the audio library and play it.

[0003] In the related art, when performing audio retrieval, the user's voice is usually converted into text, and then the retrieval is performed based on the keywords contained in the text. However, this retrieval method is difficult to accurately calculate the similarity between texts, which easily leads to the mismatch between the retrieved audio and the user's needs. Especially when the semantics of the keywords are vague, it is more likely to make audio retrieval errors, resulting in the effect of the user's voice controlling the audio playback being less than ideal. Summary of the invention

[0004] In view of this, the present invention provides an audio retrieval method, device, electronic device and storage medium to solve the deficiencies in the related art.

[0005] Specifically, this specification is implemented through the following technical solutions:

[0006] According to a first aspect of an embodiment of this specification, there is provided an audio retrieval method, the method comprising:

[0007] Convert the acquired question speech into question text, and generate question text semantic features corresponding to the question text;

[0008] Retrieving a candidate text block semantic feature that matches the semantic feature of the question text in a semantic feature library, wherein the semantic feature library contains text block semantic features generated by pre-segmented first-category text blocks, wherein the first-category text blocks are obtained by segmenting existing text corresponding to existing audio;

[0009] Inputting the semantic features of the question text, the semantic features of the candidate text blocks and first prompt information into a language model, and obtaining a correlation result output by the language model, wherein the first prompt information is used to instruct the language model to calculate the correlation between the semantic features of the question text and the semantic features of each candidate text block;

[0010] According to the relevance result, a target text block semantic feature matching the question text is determined from the candidate text block semantic features, and a target audio segment corresponding to the target text block semantic feature in the existing audio is determined.

[0011] According to a second aspect of the embodiments of this specification, an electronic device is provided, including:

[0012] processor;

[0013] a memory for storing processor-executable instructions;

[0014] The processor implements the audio retrieval method as described in the first aspect by running the executable instructions.

[0015] According to a third aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the audio retrieval method described in the first aspect are implemented.

[0016] According to a fourth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program and / or instructions, which, when executed by a processor, implement the steps of the audio retrieval method as described in the first aspect.

[0017] In the technical solution provided in this specification, after the question speech is converted into question text, the semantic features of the question text corresponding to the question text are generated, so as to search in the semantic feature library according to the semantic features of the question text. This method of retrieval based on semantic similarity can retrieve the semantic features of the candidate text block that are more matched with the semantic features of the question text, thereby effectively improving the accuracy of the retrieval results and avoiding the problem that the retrieval results are not accurate or even wrong due to the semantic ambiguity of the question text. In addition, the correlation between the semantic features of the candidate text block and the question text is further determined by the language model, which helps to further improve the accuracy of the semantic features of the target text block that are finally determined, so that the accurate target audio segment can be determined and played according to the accurate semantic features of the target text block, which greatly improves the user's experience of voice-controlled audio playback.

[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification, and for ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0020] Figure 1 is a schematic diagram of the architecture of an audio retrieval system shown in an exemplary embodiment of this specification;

[0021] Figure 2 is a flowchart of an audio retrieval method shown in an exemplary embodiment of this specification;

[0022] Figure 3 is a schematic diagram of adjusting the text length of a first type of text block shown in an exemplary embodiment of this specification;

[0023] Figure 4 is a schematic diagram of establishing an index connection shown in an exemplary embodiment of this specification;

[0024] Figure 5 is a flowchart of an audio search shown in an exemplary embodiment of this specification;

[0025] Figure 6 is a schematic structural diagram of an electronic device shown in an exemplary embodiment of this specification;

[0026] Figure 7 It is a structural diagram of an audio retrieval device shown as an exemplary embodiment of this specification. DETAILED DESCRIPTION

[0027] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification.

[0028] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, the single step described in this specification may be decomposed into multiple steps for description in other embodiments; and the multiple steps described in this specification may also be combined into a single step for description in other embodiments. It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0029] Next, the embodiments of this specification are described in detail.

[0030] In one embodiment, the audio retrieval scheme of the present disclosure can be applied to electronic devices, which may include but are not limited to smart phones, desktop computers, tablet computers, laptop computers, e-book readers, smart watches, smart bracelets, etc. One or more embodiments of this specification are not limited to this. During operation, the electronic device can run an audio retrieval system to achieve the purpose of retrieving audio. Among them, the application of the audio retrieval system can be pre-installed on the electronic device, so that the audio retrieval system can be started and run on the electronic device; of course, when using technologies such as HTML5, there is no need to install the corresponding application on the electronic device to obtain and run the audio retrieval system.

[0031] In another embodiment, the audio retrieval system may include: Figure 1 The server 11, network 12 and electronic device 13 are shown. During operation, the server 11 can run the program on the server side of the audio retrieval system to implement related data processing and other functions; and during operation, the electronic device 13 can run the program on the client side of the audio retrieval system to implement related playback, human-computer interaction and other functions, so as to cooperate between the server 11 and the electronic device 13 to implement the audio retrieval solution. It should be noted that the server 11 can also communicate with multiple electronic devices to implement audio retrieval on multiple electronic devices.

[0032] Among them, the server 11 can be a physical server including an independent host, or the server 11 can be a virtual server carried by a host cluster. The electronic device 13 can be any of the following types of devices: PC, tablet device, laptop, PDA (Personal Digital Assistants), mobile phone, wearable device (such as smart glasses, smart watch, etc.), etc., and one or more embodiments of this specification do not limit this. As for the network 12 for interaction between the electronic device 13 and the server 11, it can include various types of wired or wireless networks. In one embodiment, the network 12 can include a public switched telephone network (PSTN) and the Internet. Among them, the client application of the audio retrieval system can be pre-installed on the electronic device, so that the client can be started and run on the electronic device; of course, when an online "client" such as HTML5 technology is adopted, the client can be obtained and run without installing the corresponding application on the electronic device.

[0033] Figure 2 FIG. 1 is a flow chart of an audio retrieval method according to an exemplary embodiment of the present specification. Figure 2As shown, the audio retrieval method may include the following steps:

[0034] S202, converting the acquired question speech into question text, and generating question text semantic features corresponding to the question text.

[0035] The output party of the question voice can be a user or a device that can make a voice. The user / device can achieve the purpose of voice control audio playback by outputting the question voice. The question voice can be in the form of a question, a statement or other forms. For example, the question voice can be "Xiaobai's life story" or "What did Xiaobai do?" The present disclosure does not limit this. The technology for converting speech to text can be called automatic speech recognition (ASR, Automatic Speech Recognition) technology. There are many automatic speech recognition technologies, such as hidden Markov model (HMM, Hidden Markov Model), deep neural network (DNN, Deep Neural Network), long short-term memory network (LSTM, Long Short-Term Memory), etc. In this embodiment, the Whisper system is used to convert the acquired question voice into question text. Whisper is an automatic speech recognition system that can understand and transcribe speech in different language environments and output text results.

[0036] After obtaining the question text, generate the semantic features of the question text corresponding to the question text. The semantic features of the text refer to the features containing semantic information carried in the text, which can reflect the deeper meaning and context in the text. Usually, the text can be converted into a semantic vector to express the semantic features of the text. For example, models such as BERT (Bidirectional Encoder Representations from Transformers), RNN (Recurrent Neural Network) or Word2Vec can be used to generate semantic vectors of text, and the present disclosure is not limited to this.

[0037] In one embodiment, after obtaining the question text, the question text can be firstly subjected to intent recognition, that is, the intent of the question voice output party reflected in the question text can be identified. There are many methods for intent recognition. In this embodiment, the question text is subjected to intent recognition using a language model. A language model (LM) is an artificial intelligence model based on deep learning technology, which can generate, understand, and reason about natural language text. The question text and the second prompt information are input into the language model, and the second prompt information is used to instruct the language model to perform intent recognition on the question text. Among them, the second prompt information can be expressed in the form of a prompt instruction. In this embodiment, the purpose of performing intent recognition on the question text is to identify whether the intention of the question text is to retrieve information. Therefore, the second prompt information can be "determine whether the question text is content for retrieving information". Then obtain the recognition result output by the language model.

[0038] If the recognition result output by the language model shows that the intention of the question text is not to retrieve information, such as the question text is "reduce the volume" (the intention is not to retrieve information), in this case, there is no need to generate semantic features of the question text, and information such as "unable to find relevant content based on the question" can be directly returned to the question voice output party. If the recognition result output by the language model shows that the intention of the question text is to retrieve information, such as the question text is "what did Xiaobai do" (the intention is to retrieve information), in this case, the semantic features of the question text corresponding to the question text can be generated, so that subsequent audio retrieval operations can be performed based on the semantic features of the question text. This embodiment performs intent recognition on the question text, and thus performs subsequent audio retrieval operations only when it is recognized that the intention of the question text is to retrieve information, which helps to avoid searching for question voices with non-retrieval intentions, thereby greatly saving the resources required for audio retrieval.

[0039] In one embodiment, the question text can be rewritten to generate corresponding semantic features of the question text based on the rewritten question text, and perform subsequent operations. In this embodiment, the question text is rewritten by a language model. Specifically, the question text and the third prompt information are input into the language model, and the rewritten question text output by the language model is obtained. The third prompt information contains a rewriting requirement for the question text, and the third prompt information is used to instruct the language model to rewrite the question text according to the rewriting requirement. The rewriting requirements may include accurate and concise expression, smooth sentences, and requirements on voice or grammatical structure. For example, the rewriting requirement may be to change the passive voice to the active voice. The rewriting requirement may also be to check and correct typos in the question text. The rewriting requirement may also be to rewrite the question text into a smooth sentence. The present disclosure does not limit the specific rewriting requirements, as long as the rewriting requirements can make the meaning of the rewritten question text clearer.

[0040] In this embodiment, the question text is rewritten to replace the question text with the rewritten question text, thereby effectively improving the readability of the rewritten question text and making the meaning of the rewritten question text clearer and more accurate, thereby enabling subsequent audio retrieval based on the rewritten question text with clear and accurate meaning, effectively reducing the difficulty of retrieval and improving the efficiency and accuracy of audio retrieval.

[0041] In one embodiment, the rewriting requirement may include a rewriting method. The rewriting method may include, but is not limited to, synonym replacement, adjustment of sentence word order and structure, sentence conversion (such as rewriting a declarative sentence into an interrogative sentence, rewriting a negative sentence into an affirmative sentence, etc.), tense and voice change, etc. Among them, the tense includes past tense, present tense and future tense, and the voice includes active voice and passive voice. In the case where the rewriting requirement includes a rewriting method, the rewritten question text includes the content rewritten according to the rewriting method. For example, assuming that the question text is "Xiaobai's life and deeds", and the rewriting method is to rewrite the declarative sentence into an interrogative sentence, then the language model rewrites the question text according to the rewriting method, and the rewritten question text output is "What did Xiaobai do in his life?"

[0042] In addition, the rewriting requirement may also include reference information. In this embodiment, the reference information may include two types - reference information as an example and reference information as expanded content. When the rewriting requirement includes a rewriting method and reference information as an example, the rewritten question text includes the text content rewritten based on the reference information and the rewriting method. In this case, the reference information usually includes the original text and the rewritten text. For example, assuming that the question text is "playing Xiaobai's allusions, missing my hometown", the rewriting method is to adjust the sentence word order, and the reference information includes: the original text "a picture, bright and beautiful" and the rewritten text "a bright, beautiful picture". Therefore, the language model can rewrite the question text as "playing Xiaobai's allusions to his hometown" based on the reference information and the rewriting method. Obviously, compared with the inverted word order in the question text, the meaning of the rewritten question text is clearer and more accurate. In this example, if the rewriting requirement does not include reference information, the language model will not be able to determine the specific way to adjust the word order, and it is easy to output a rewritten question text with incorrect word order, such as "Play the story of missing my hometown, Xiaobai". Therefore, by adding reference information as an example to the rewriting requirement, it helps the language model to further clarify the specific form of rewriting based on the reference information, so that it can output an accurate rewritten question text that meets the rewriting requirements based on the reference example, avoiding the situation where the rewriting method is too general and causes rewriting errors.

[0043] When the rewriting requirement includes a rewriting method and reference information as an expanded content, the rewritten question text includes text content expanded based on the reference information. In some cases, the question text itself contains less semantic information, resulting in the inability to retrieve accurate candidate text block semantic features based on less semantic information. Based on this, this embodiment proposes to expand the question text based on the reference information, thereby enriching the semantic information contained in the rewritten question text to improve the accuracy of retrieval based on the rich semantic information. Among them, the reference information as the expanded content can be a historical question text obtained by converting the historical question voice. The time difference between the historical question voice and the question voice is short, and there may be a certain semantic association between this historical question voice and the question voice. For example, the question text converted from the question voice is "What did Xiaobai do", and the historical question text converted from the historical question voice is "What did Xiaohei do after establishing Country A", "The relationship between Xiaohei and Xiaobai", and the rewriting method is sentence expansion. The language model expands the question text based on the historical question text (i.e., the reference information), and the rewritten question text is "What did Xiaobai do in Country A". By rewriting the expanded content in this way, it can be further clarified that the newbie in the question text is a newbie from Country A, thereby enriching the semantic information contained in the question text, helping to filter out relevant information about newbies who are not from Country A during retrieval, and greatly improving the accuracy of the retrieval results.

[0044] S204, searching for candidate text block semantic features that match the semantic features of the question text in a semantic feature library, wherein the semantic feature library contains text block semantic features generated by pre-segmented first-category text blocks, wherein the first-category text blocks are obtained by segmenting existing texts corresponding to existing audios.

[0045] In this embodiment, the existing audio is converted into the existing text, and the existing text is divided into one or more first-category text blocks. Then the first-category text blocks are converted into text block semantic features, so as to construct a semantic feature library based on the text block semantic features. When performing audio retrieval, the retrieval is performed based on the semantic similarity between the semantic features of the question text and the semantic features of the text blocks contained in the semantic feature library, which can effectively improve the accuracy of the retrieval results in semantic ambiguity, polysemous words or situational semantic query scenarios.

[0046] In one embodiment, the existing text can be segmented according to semantics so that the semantically related text content is segmented into the first category text block. For example, the existing text can be segmented according to paragraphs. Each paragraph usually contains a theme or a complete idea, thereby ensuring that the information contained in the same first category text block is the same theme or the same idea. Of course, the existing text can also be segmented according to punctuation marks. In order to ensure the semantic coherence and avoid the semantic fragmentation of the existing text, the existing text can be segmented according to punctuation marks such as periods, question marks, exclamation marks, etc. that are usually used to represent the end of a sentence. The present disclosure does not limit the specific segmentation method for the existing text, and it is only necessary to ensure that the semantically related text content can be segmented into the same first category text block. This method of segmentation according to semantics helps to further improve the accuracy of matching based on semantic similarity, thereby improving the accuracy of the retrieval results.

[0047] In addition, if the information contained in the first type of text block is too redundant, it is easy to cause the final audio to contain audio content that is not needed by the problematic voice output party. Therefore, when segmenting the existing text, the text length of the first type of text block can be limited, for example, the text length of the first type of text block is limited to no more than 300 words. This method effectively avoids the first type of text block containing too much information, can make the final audio played more in line with the needs of the problematic voice output party, and improve the control accuracy of audio playback.

[0048] In another embodiment, after the existing text is segmented according to semantics, the text length of the first-category text blocks obtained by segmentation may be adjusted so that there is overlapping content of a preset text length between the adjusted first-category text blocks. Figure 3 FIG. 1 is a schematic diagram showing a method of adjusting the text length of a first type of text block according to an exemplary embodiment of this specification. Figure 3 As shown, after segmentation, the text length of the first-class text block a is 10 words, and the text length of the first-class text block b is 20 words. The first-class text block a and the first-class text block b are connected contexts in the existing text. Assume that the preset text length is 10 words. The first-class text block a is adjusted to obtain the first-class text block a1; and the first-class text block b is adjusted to obtain the first-class text block b1. The specific adjustment process is: copy the last 5 words in the first-class text block a and add them to the first-class text block b, and copy the first 5 words in the first-class text block b and add them to the first-class text block a. Therefore, the text length of the first-class text block a1 is 15 words, the text length of the first-class text block b1 is 25 words, and there is 10 words of overlapping content between the first-class text block a1 and the first-class text block b1. This method helps to ensure the semantic coherence of each first-class text block, avoid the sudden truncation of the semantics of the first-class text block, and thus improve the accuracy of subsequent retrieval.

[0049] In one embodiment, after obtaining the first type of text block, it can also be determined whether there is meta information in the existing audio. The meta information is meta information associated with the existing audio. For example, an existing audio has an audio title, and the audio title is associated with the existing audio and is additional information of the existing audio. Therefore, the course title can be used as meta information. In the case where it is determined that there is meta information in the existing audio, the meta information is obtained, and text block semantic features are generated based on the meta information and the first type of text block, so that the text block semantic features contain the meta information semantic features corresponding to the meta information. In the case of segmenting to obtain multiple first type text blocks, the text block semantic features corresponding to each first type text block contain the meta information semantic features. In this way, the semantic features contained in the text block semantic features corresponding to the first type of text block can be enriched, thereby improving the accuracy of the retrieval results.

[0050] In one embodiment, the meta-information may include, but is not limited to: audio title, audio author, audio tag, etc. Among them, the audio author may include the user who created the audio or the user who uploaded the audio. Audio tags may include category tags, emotion tags, entity tags, event tags, etc. of existing audio. For example, category tags may include "history", "music", "sports", etc. Emotion tags may include "positive", "negative", etc. Entity tagging refers to using entities that appear in the audio as labels, such as "Little Black", "Landmark m", etc. Event tagging refers to using specific events or behaviors that appear in the audio as labels, such as "T stage show", "live scene", etc.

[0051] In addition, an index connection can be established between the semantic features of the text block and the existing audio. Figure 4 FIG. 1 is a schematic diagram showing a method of establishing an index relationship according to an exemplary embodiment of the present specification. Figure 4 As shown, taking the existing audio m and the existing audio n in the audio library as an example, the two existing audios are converted into text to obtain the existing text m and the existing text n. The two existing texts are segmented according to semantics. Assume that the existing text m is segmented into three first-class text blocks m1-m3, and the existing text n is segmented into two first-class text blocks n1-n2. The first-class text blocks m1-m3 correspond to the text block semantic features m1'-m3' respectively, and the first-class text blocks n1-n2 correspond to the text block semantic features n1'-n2' respectively. Furthermore, the text block semantic features m1'-m3' can be indexed with the existing audio m (indicated by dotted lines in the figure), and the text block semantic features n1'-n2' can be indexed with the existing audio n (indicated by dotted lines in the figure). In this way, it is possible to query the target audio according to the index connection during the audio retrieval process, thereby improving the efficiency of audio retrieval.

[0052] S206, inputting the semantic features of the question text, the semantic features of the candidate text blocks and the first prompt information into a language model, and obtaining a correlation result output by the language model, wherein the first prompt information is used to instruct the language model to calculate the correlation between the semantic features of the question text and the semantic features of each candidate text block.

[0053] In one embodiment, the semantic feature library contains a large amount of text block semantic features, so the amount of data of recalled candidate text block semantic features is also very considerable. The candidate text block semantic features can be rearranged, and the initial text block semantic features to be input into the language model for processing are selected according to the rearrangement results.

[0054] There are many rearrangement models, such as Cohere Rerank, bge-reranker-base, bge-reranker-large, etc. Taking bge-reranker-large as an example, this model is a language model based on deep learning technology, which can reorder the input text by calculating the similarity between the input texts. The rearrangement results output by the rearrangement model usually arrange the candidate text block semantic features in order from high to low relevance. Select a preset number of candidate text block semantic features that are ranked at the top of the rearrangement results as the initial text block semantic features, or select the candidate text block semantic features whose relevance in the rearrangement results is greater than the relevance threshold as the initial text block semantic features. Then, the question text semantic features, the initial text block semantic features and the first prompt information are input into the language model, so that the language model calculates the relevance between the question text semantic features and the initial text block semantic features according to the first prompt information. Among them, the first prompt information can be: Are the question text semantic features related to the initial text block semantic features?

[0055] In this embodiment, by rearranging the semantic features of the candidate text blocks, on the one hand, the semantic features of the initial text blocks with higher relevance can be screened out for subsequent operations, thereby ensuring that the semantic features of the target text blocks determined from the semantic features of the initial text blocks have a high degree of match with the question text, thereby improving the accuracy of the target audio segment. On the other hand, the amount of data that the language model needs to process can be reduced, thereby improving the efficiency of audio retrieval.

[0056] S208, determining a target text block semantic feature that matches the question text from the candidate text block semantic features according to the correlation result, and determining a target audio segment in the existing audio that corresponds to the target text block semantic feature.

[0057] The relevance result output by the language model can be set to "relevant" or "irrelevant". In this case, when the relevance result output by the language model is "relevant", the semantic features of the candidate text block corresponding to the relevance result can be determined as the semantic features of the target text block that match the question text. The relevance result output by the language model can also be set to a specific value representing the degree of relevance, usually expressed as a percentage. In this case, the semantic features of the candidate text block whose specific values ​​exceed a preset threshold can be determined as the semantic features of the target text block that match the question text. Then, the target audio segment corresponding to the semantic features of the target text block is determined from the existing audio contained in the audio library and played.

[0058] In the above embodiment, after the question speech is converted into the question text, the semantic features of the question text corresponding to the question text are generated, so as to search in the semantic feature library according to the semantic features of the question text. This method of retrieval based on semantic similarity can retrieve the semantic features of the candidate text block that are more matched with the semantic features of the question text, thereby effectively improving the accuracy of the retrieval results and avoiding the problem that the retrieval results are not accurate or even wrong due to the semantic ambiguity of the question text. In addition, further judging the relevance of the semantic features of the candidate text block and the question text through the language model helps to further improve the accuracy of the semantic features of the target text block that are finally determined, so that the accurate target audio segment can be determined and played according to the accurate semantic features of the target text block, which greatly improves the user's experience of voice-controlled audio playback.

[0059] In one embodiment, the existing audio in the audio library can be segmented to obtain multiple audio segments, and then the audio segments are converted into text to obtain second-class text blocks, and the second-class text blocks are stored in the audio library together with the audio segments. Among them, there is a one-to-one correspondence between the second-class text blocks and the audio segments, and the text length of each second-class text block is less than the text length of the first-class text block. For example, when the text length of the first-class text block is greater than 20 words and less than 300 words, the existing audio can be segmented into 5 seconds of equal length to obtain multiple audio segments. The text length of the second-class text block converted from the 5-second audio segment is usually less than 20 words. Of course, the duration of the multiple audio segments obtained by segmentation may not be equal, as long as the text length of the second-class text block corresponding to the audio segment is less than the text length of the first-class text block.

[0060] In the audio retrieval process, after the semantic features of the target text block matching the question text are determined from the semantic features of the candidate text blocks, the target second-class text block matching the semantic features of the target text block can be searched in the audio library through the text matching algorithm. The text matching algorithm includes but is not limited to cosine similarity, Jaccard similarity coefficient, matching algorithm based on bag-of-words model, etc. Those skilled in the art can select the text matching algorithm according to actual needs, and the present disclosure does not limit this. Then, the target audio segment corresponding to the target second-class text block is determined according to the corresponding relationship between the second-class text block and the audio segment. Since the text length of the second-class text block is less than the text length of the first-class text block, that is, the information contained in the second-class text block is less than the information contained in the first-class text block, the target second-class text block matching is searched according to the semantic features of the target text block, and then the target audio segment corresponding to the target second-class text block is determined, which can ensure that the target audio segment is an audio that meets the needs of the question voice output party, and avoids the target audio segment from containing other audio content unrelated to the question text, so that the control experience of audio playback can be ensured by playing the target audio segment.

[0061] The above method obtains audio segments by dividing the existing audio, and establishes a mapping relationship between the audio segments and the second type of text blocks, so as to locate and play part of the audio content in the existing audio according to the problem voice, without playing the entire existing audio, effectively improving the accuracy of audio playback control. For example, the duration of the existing audio about country A is 1 hour. The audio content related to Xiaobai in the existing audio is 5 minutes, and the audio content is near the end of the existing audio. Then, the above method can be used to directly play the audio content related to Xiaobai without playing the entire existing audio from the beginning, which greatly improves the efficiency of the problem voice output party in obtaining the target audio and improves the control experience of audio playback.

[0062] In addition, if the number of target second-category text blocks that match the semantic features of the target text block is multiple, the number of target audio segments is also multiple. In this case, you can choose to play the multiple target audio segments, or you can choose to play the audio segments that are in the front position in the existing audio among the multiple target audio segments. For example, the duration of the existing audio is 30 minutes, and 3 target audio segments are finally determined, and the 3 target audio segments are respectively located at the 1st-2nd minute, the 3rd minute-3rd minute 10 seconds and the 3rd minute 40 seconds-4th minute in the existing audio. Now you can choose to only play the target audio segment that is located at the 1st-2nd minute in the existing audio. Because the multiple target audio segments determined are not necessarily continuous audio segments, only playing the target audio segment that is in the front position in the existing audio helps to avoid the situation of audio content fragmentation in the process of playing audio, thereby helping to improve the playing effect of audio.

[0063] Figure 5FIG. 1 is a flowchart of an audio search according to an exemplary embodiment of the present specification. Figure 5 In the audio retrieval platform, the user is the outputter of the question voice, and the language model is a large language model (LLM). The audio retrieval platform combines the large language model, the search engine, and the stored semantic feature library and audio library to complete the audio retrieval process. Among them, the semantic feature library contains the semantic features of the text blocks generated by the pre-segmented first-category text blocks, and the first-category text blocks are obtained by segmenting the existing text corresponding to the existing audio. The audio library contains the audio segments obtained by segmenting the existing audio and the second-category text blocks corresponding to the audio segments. It should be noted that the audio retrieval platform, the large language model, the search engine, and the data storage are logically independent of each other, and can be physically deployed on the same electronic device or separately deployed in multiple electronic devices. The audio retrieval process is as follows:

[0064] The user sends a voice question to the audio retrieval platform. The audio retrieval platform converts the voice question into a question text, and inputs the question text and the second prompt information for indicating intent recognition into the large language model, so that the large language model can perform intent recognition on the question text. When the intent recognition result output by the large language model is retrieval information, the audio retrieval platform inputs the question text and the third prompt information containing the rewriting requirement into the large language model, so that the large language model can rewrite the question text according to the rewriting requirement and output the rewritten question text.

[0065] The audio retrieval platform generates corresponding semantic features of the question text based on the rewritten question text, and calls the search engine to retrieve the semantic features of the candidate text blocks that match the semantic features of the question text in the semantic feature library. Then, the audio retrieval platform inputs the semantic features of the candidate text blocks into the rearrangement model, so that the rearrangement model rearranges the semantic features of the candidate text blocks and outputs the rearrangement results. The audio retrieval platform selects the initial text block semantic features from the candidate text block semantic features based on the rearrangement results, and inputs the initial text block semantic features, the question text and the first prompt information into the large language model. The large language model calculates the correlation between the question text and the initial text block semantic features according to the instructions of the first prompt information, and outputs the correlation results. The audio retrieval platform determines the target text block semantic features that match the question text from the initial text block semantic features based on the correlation results, and then queries the target audio segment corresponding to the target text block semantic features in the audio library.

[0066] This semantic similarity-based retrieval method can effectively improve the accuracy of retrieval results and avoid the problem of inaccurate or even erroneous retrieval results due to the semantic ambiguity of the question text. In addition, by further determining the relevance of the semantic features of the candidate text block and the question text through the language model, it helps to further improve the accuracy of the semantic features of the target text block that is finally determined, so that the accurate target audio segment can be determined and played based on the accurate semantic features of the target text block, greatly improving the user's experience of voice-controlled audio playback.

[0067] Figure 6 is a schematic structural diagram of an electronic device shown in an exemplary embodiment. Figure 6 At the hardware level, the electronic device includes a processor 602, an internal bus 604, a network interface 606, a memory 608, and a non-volatile memory 610, and may also include other required hardware. One or more embodiments of this specification may be implemented based on software, such as the processor 602 reading the corresponding computer program from the non-volatile memory 610 into the memory 608 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0068] Corresponding to the embodiments of the aforementioned audio retrieval method, this specification also provides embodiments of an audio retrieval device.

[0069] Please refer to Figure 7 , Figure 7 FIG. 1 is a schematic diagram showing the structure of an audio retrieval device according to an exemplary embodiment. Figure 7 As shown, in a software implementation, the device may include: a conversion module 702, a retrieval module 704, an input module 706 and a determination module 708, wherein:

[0070] The conversion module 702 is configured to convert the acquired question speech into question text, and generate question text semantic features corresponding to the question text;

[0071] A retrieval module 704 is configured to retrieve a candidate text block semantic feature that matches the semantic feature of the question text in a semantic feature library, wherein the semantic feature library contains text block semantic features generated by pre-segmented first-category text blocks, wherein the first-category text blocks are obtained by segmenting existing text corresponding to existing audio;

[0072] An input module 706 is configured to input the semantic features of the question text, the semantic features of the candidate text blocks and first prompt information into a language model, and obtain a relevance result output by the language model, wherein the first prompt information is used to instruct the language model to calculate the relevance between the semantic features of the question text and the semantic features of each candidate text block;

[0073] The determination module 708 is configured to determine the target text block semantic features matching the question text from the candidate text block semantic features according to the relevance result, and determine the target audio segment corresponding to the target text block semantic features in the existing audio.

[0074] Optionally, segmenting the existing text to obtain the first type of text blocks includes: segmenting the existing text according to semantics so that semantically related text contents are segmented into the first type of text blocks.

[0075] Optionally, generating a text block semantic feature corresponding to the first type of text block includes: obtaining meta-information associated with the existing audio, and generating the text block semantic feature based on the meta-information and the first type of text block, so that the text block semantic feature contains the meta-information semantic feature corresponding to the meta-information.

[0076] Optionally, the meta information includes at least one of the following: audio title, audio author, and audio tag.

[0077] Optionally, the device further comprises:

[0078] The recognition module 710 is configured to input the question text and the second prompt information for instructing the language model to perform intent recognition on the question text into the language model, and obtain the recognition result output by the language model.

[0079] The conversion module 702 is specifically configured to generate a question text semantic feature corresponding to the question text when the recognition result indicates that the intention of the question text is to retrieve information.

[0080] Optionally, the device further comprises:

[0081] The rewriting module 712 is configured to input the question text and the third prompt information into the language model so that the language model rewrites the question text according to the rewriting requirements for the question text contained in the third prompt information; and obtain the rewritten question text output by the language model to replace the question text.

[0082] Optionally, when the rewriting requirement includes a rewriting method, the rewritten question text includes text content rewritten according to the rewriting method; when the rewriting requirement includes the rewriting method and reference information and the reference information is used as an example, the rewritten question text includes text content rewritten based on the reference information and the rewriting method; when the rewriting requirement includes the rewriting method and the reference information and the reference information is used as expanded content, the rewritten question text includes text content expanded based on the reference information.

[0083] Optionally, the device further comprises:

[0084] A rearrangement module 714 is configured to rearrange the semantic features of the candidate text blocks and select the initial text block semantic features according to the rearrangement result;

[0085] The input module 706 is specifically used to input the semantic features of the question text, the semantic features of the initial text block and the first prompt information into the language model.

[0086] Optionally, the audio library contains audio segments obtained by segmenting the existing audio and second-category text blocks corresponding to the audio segments, wherein the text length of any second-category text block is less than the text length of the first-category text block; the determination module 708 is specifically used to: search for a target second-category text block that matches the semantic features of the target text block in the audio library according to a text matching algorithm, and determine a target audio segment corresponding to the target second-category text block according to the correspondence between the second-category text block and the audio segment.

[0087] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0088] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only 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 on 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 specification. Ordinary technicians in this field can understand and implement it without paying creative work.

[0089] The devices or modules described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0090] In a typical configuration, a computer includes one or more processors, including a central processing unit (CPU) and a graphics processing unit (GPU), an input / output interface, a network interface, and a memory. The CPU is used for computing simulations, and the GPU is used for outputting high-quality 3D images.

[0091] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0092] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0093] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or requiring that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.

[0094] Thus, specific embodiments of the subject matter have been described. Furthermore, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve desired results. In some implementations, multitasking and parallel processing may be advantageous.

[0095] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims

1. An audio retrieval method, the method comprising: Convert the acquired question speech into question text, and generate question text semantic features corresponding to the question text; Retrieving a candidate text block semantic feature that matches the semantic feature of the question text in a semantic feature library, wherein the semantic feature library contains text block semantic features generated by pre-segmented first-category text blocks, wherein the first-category text blocks are obtained by segmenting existing text corresponding to existing audio; Inputting the semantic features of the question text, the semantic features of the candidate text blocks and first prompt information into a language model, and obtaining a correlation result output by the language model, wherein the first prompt information is used to instruct the language model to calculate the correlation between the semantic features of the question text and the semantic features of each candidate text block; According to the relevance result, a target text block semantic feature matching the question text is determined from the candidate text block semantic features, and a target audio segment corresponding to the target text block semantic feature in the existing audio is determined.

2. According to the method of claim 1, segmenting the existing text to obtain the first type of text blocks comprises: The existing text is segmented according to semantics, so that semantically related text contents are segmented into the first type of text blocks.

3. According to the method of claim 1, generating text block semantic features corresponding to the first type of text blocks comprises: Meta information associated with the existing audio is obtained, and the text block semantic feature is generated based on the meta information and the first type of text block, so that the text block semantic feature contains the meta information semantic feature corresponding to the meta information.

4. The method according to claim 3, wherein the meta information comprises at least one of the following: audio title, audio author, and audio tag.

5. The method according to claim 1, Also includes: Inputting the question text and second prompt information for instructing the language model to perform intent recognition on the question text into the language model, and obtaining a recognition result output by the language model; The generating of the semantic features of the question text corresponding to the question text includes: generating the semantic features of the question text corresponding to the question text when the recognition result indicates that the intention of the question text is to retrieve information.

6. The method according to claim 1, further comprising: Inputting the question text and the third prompt information into the language model, so that the language model rewrites the question text according to the rewriting requirement for the question text contained in the third prompt information; The rewritten question text output by the language model is obtained to replace the question text.

7. The method according to claim 6, In the case where the rewriting requirement includes a rewriting method, the rewritten question text includes text content rewritten according to the rewriting method; In the case where the rewriting requirement includes the rewriting method and reference information and the reference information is used as an example, the rewritten question text includes text content rewritten based on the reference information and the rewriting method; In the case where the rewriting requirement includes the rewriting method and the reference information and the reference information serves as the extended content, the rewritten question text includes text content extended based on the reference information.

8. The method according to claim 1, Also includes: Rearranging the semantic features of the candidate text blocks, and selecting the semantic features of the initial text blocks according to the rearrangement results; The step of inputting the semantic features of the question text, the semantic features of the candidate text block and the first prompt information into a language model comprises: inputting the semantic features of the question text, the semantic features of the initial text block and the first prompt information into the language model.

9. The method according to claim 1, wherein the audio library comprises audio segments obtained by segmenting the existing audio and second-type text blocks corresponding to the audio segments, wherein: The text length of any second-category text block is shorter than the text length of the first-category text block; The method of determining a target audio segment in the existing audio corresponding to the semantic feature of the target text block includes: searching the audio library for a target second-category text block that matches the semantic feature of the target text block according to a text matching algorithm, and determining a target audio segment corresponding to the target second-category text block according to a correspondence between the second-category text block and the audio segment.

10. An electronic device, comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 9 by running the executable instructions.

11. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.

12. A computer program product, comprising a computer program and / or instructions, wherein the computer program and / or instructions, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.

Citation Information

Cited By

  • Music generation method, device and system based on intelligent loudspeaker box

    CN119296542A

  • A method, apparatus and system for music generation based on a smart speaker

    CN119296542B

  • Medical demand customized dialogue method and device, equipment and storage medium

    CN120524955A

  • Medical demand customized dialogue method, device, equipment and storage medium

    CN120524955B