Voice answering method and device, electronic equipment and storage medium

By receiving the current question text in the voice assistant and generating a response voice by imitating the speaking habits and characteristics of the person being imitated, the problem of limited voice functionality is solved, and the user experience is improved.

CN117059064BActive Publication Date: 2026-11-06GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210483727.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-05
Publication Date
2026-11-06
Estimated Expiration
2042-05-05

AI Technical Summary

Technical Problem

Existing voice assistants have limited voice functionality and produce rather stiff voices, resulting in a poor user experience.

Method used

By receiving the current question text, the semantic similarity between it and the object to be imitated in the preset database is obtained. If it is less than or equal to the similarity threshold, the input text generation model generates the answer text and synthesizes the answer speech based on the original voice quality of the object to be imitated, so as to imitate its speaking habits and characteristics.

Benefits of technology

It improves the human-like and friendly feel of the voice responses of electronic devices, enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117059064B_ABST
    Figure CN117059064B_ABST
Patent Text Reader

Abstract

The application discloses a voice answering method and device, electronic equipment and storage medium, and relates to the technical field of electronic equipment. The method comprises the following steps: receiving a current question text, obtaining the semantic similarity between the current question text and an original question text in a preset database, wherein the original voice quality of an object to be imitated is also included in the preset database, if the semantic similarity is less than or equal to a similarity threshold, inputting the current question text into a text generation model to obtain a current answer text output by the text generation model, and obtaining and outputting an answer voice corresponding to the object to be imitated based on the original voice quality and the current answer text. After receiving the current question text, the application imitates the speaking habits and characteristics of the object to be imitated according to the information of the object to be imitated in the preset database to perform voice answering of the question, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic equipment technology, and more specifically, to a method, apparatus, electronic device, and storage medium for voice response. Background Technology

[0002] With the development of science and technology, electronic devices are becoming increasingly widespread and feature-rich, becoming an essential part of people's daily lives. Currently, electronic devices are gradually becoming more artificially integrated with artificial intelligence, and voice assistants represent the most perfect embodiment of AI technology in electronic devices. However, due to the limited voice functionality and somewhat stiff pronunciation of voice assistants, users often experience a poor user experience. Summary of the Invention

[0003] In view of the above problems, this application proposes a method, apparatus, electronic device and storage medium for voice response, which enables the electronic device to receive the current question text and, based on the information of the object to be imitated in the preset database, imitate the speaking habits and characteristics of the object to be imitated to give a voice response to the question, thereby improving the user experience.

[0004] In a first aspect, embodiments of this application provide a method for providing a voice response, the method comprising: receiving a current question text; obtaining the semantic similarity between the current question text and an original question text in a preset database, wherein the preset database also includes the original voice quality of the object to be imitated; if the semantic similarity is less than or equal to a similarity threshold, inputting the current question text into a text generation model to obtain a current response text output by the text generation model; and obtaining and outputting a response voice corresponding to the object to be imitated based on the original voice quality and the current response text.

[0005] Secondly, embodiments of this application provide a voice response apparatus, the apparatus comprising: a current question text receiving module for receiving a current question text; a semantic similarity acquisition module for acquiring the semantic similarity between the current question text and an original question text in a preset database, wherein the preset database also includes the original voice quality of the object to be imitated; a current response text acquisition module for inputting the current question text into a text generation model to obtain the current response text output by the text generation model if the semantic similarity is less than or equal to a similarity threshold; and a response voice acquisition module for acquiring and outputting the response voice corresponding to the object to be imitated based on the original voice quality and the current response text.

[0006] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor performs the above-described method.

[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing program code that can be invoked by a processor to execute the above-described method.

[0008] The methods, apparatus, electronic devices, and storage media for voice answering provided in this application embodiment receive a current question text; obtain the semantic similarity between the current question text and original question texts in a preset database, wherein the preset database also includes the original voice quality of the object to be imitated; if the semantic similarity is less than or equal to a similarity threshold, input the current question text into a text generation model to obtain the current answer text output by the text generation model; based on the original voice quality and the current answer text, obtain and output the answer voice corresponding to the object to be imitated, thereby improving the user experience by imitating the speaking habits and characteristics of the object to be imitated based on the information of the object to be imitated in the preset database after receiving the current question text. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 A flowchart illustrating a voice response method according to an embodiment of this application is shown;

[0011] Figure 2 A flowchart illustrating a voice response method according to an embodiment of this application is shown;

[0012] Figure 3 A flowchart illustrating a voice response method according to an embodiment of this application is shown;

[0013] Figure 4 A flowchart illustrating a voice response method according to an embodiment of this application is shown;

[0014] Figure 5 A flowchart illustrating a voice response method according to an embodiment of this application is shown;

[0015] Figure 6 A flowchart illustrating a voice response method according to an embodiment of this application is shown;

[0016] Figure 7 A block diagram of a voice response apparatus according to an embodiment of this application is shown;

[0017] Figure 8 A block diagram of an electronic device for performing a voice response method according to an embodiment of this application is shown;

[0018] Figure 9 A storage unit for storing or carrying program code implementing the voice response method according to an embodiment of the present application is shown. Detailed Implementation

[0019] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0020] With the continuous advancement of science and technology, the term "artificial intelligence" has gradually entered our lives. The emergence of voice assistants is a manifestation of the integration of artificial intelligence technology with electronic devices. For example, almost every smartphone now has its own independent voice assistant. Specifically, a voice assistant is an intelligent mobile application that helps users solve problems through intelligent dialogue and real-time question-and-answer interaction, primarily addressing everyday life issues.

[0021] The inventors discovered through research that current mobile voice assistants typically use artificial intelligence (AI) for pronunciation or are customized voice packs of celebrities used in map navigation applications (APPs). They cannot customize the voices of acquaintances or idols, resulting in limited functionality and stiff pronunciation, leading to a poor user experience.

[0022] To address the aforementioned problems, the inventors, through extensive research, discovered and proposed a method, apparatus, electronic device, and storage medium for voice response, as provided in this application. By receiving the current question text and, based on information about the object to be imitated in a preset database, mimicking the speaking habits and characteristics of the object to be imitated to provide a voice response, the anthropomorphism and friendliness of the electronic device's voice response are improved, thereby enhancing the user experience. The specific voice response method will be described in detail in subsequent embodiments.

[0023] Please see Figure 1 , Figure 1A flowchart illustrating a voice response method according to an embodiment of this application is shown. This voice response method, upon receiving the current question text, obtains and outputs a response voice mimicking the speaking habits and characteristics of the target object based on information from a preset database, thereby improving the user experience. In specific embodiments, this voice response method can be applied to, for example... Figure 7 The illustrated voice response device 200 and the electronic device 100 equipped with the voice response device 200 (shown) Figure 8 ).

[0024] The following will use an electronic device as an example to illustrate the specific process of this embodiment. Of course, it is understood that the electronic device used in this embodiment may include smartphones, vehicles, tablets, wearable electronic devices, and other devices including voice assistant applications, and is not limited thereto. The following will focus on... Figure 1 The process shown will be explained in detail. The method of voice response may specifically include the following steps:

[0025] Step S110: Receive the current question text.

[0026] In some implementations, the electronic device can be used to record audio or video and obtain captured speech. After obtaining the speech, the electronic device can upload it to a server, where the server can store the uploaded speech and perform transcription to obtain corresponding text.

[0027] In this embodiment, transcription can be understood as converting the speech collected by the electronic device into the corresponding text of the current question. In one approach, a client recording video or audio on the electronic device can extract speech from the audio or video and upload the obtained speech to a server. The electronic device can also establish a transcription task through the server. The server can respond to the transcription task established by the electronic device, acquire the speech, transcribe it, and store the transcription result. The electronic device can retrieve the transcription result from the server, and the server will then send the transcription result to the electronic device.

[0028] In some embodiments, the electronic device may include a conversational interface for enabling voice responses, and this conversational interface may include a first control. The user can touch the first control to control the electronic device to respond with voice and to select an object to be imitated by the electronic device. The method of enabling the electronic device to respond with voice is not limited here; the method of selecting an object to be imitated by the electronic device is also not limited here.

[0029] In one implementation, the electronic device captures the user's current question voice and uploads it to a server. The server stores the current question voice and performs a transcription operation to obtain the corresponding current question text, which is then sent to the electronic device. This allows the electronic device to subsequently determine the content of its voice response based on the current question text.

[0030] As another implementation method, the user can input the current question text by touching the electronic device, so that the electronic device can receive the current question text and then determine the content of the voice answer based on the current question text.

[0031] Step S120: Obtain the semantic similarity between the current question text and the original question text in the preset database, wherein the preset database also includes the original sound quality of the object to be imitated.

[0032] In some implementations, after receiving the current question text, the electronic device calculates the semantic similarity between the current question text and original question texts in a preset database. The preset database may include one or more original question texts. The object to be imitated refers to the object to be imitated by the electronic device's output speech responding to the current question text.

[0033] In some implementations, the original question texts included in the preset database can be the texts of questions asked by the user during voice communication with the target via telephone, WeChat, or QQ, collected with the user's consent. Here, "user" refers to the party asking the most questions in the recognized voice messages. The process of obtaining the user's question texts can involve transcribing the user's speech to obtain the corresponding text, thus ensuring that the original question texts in the preset database are compatible with voice questions of different qualities.

[0034] The preset database also includes the original sound quality of the object to be imitated, so that subsequent electronic devices can synthesize the corresponding response voice based on the original sound quality, thereby improving the friendliness of the electronic device's voice response and the user's user experience.

[0035] In some embodiments, the semantic similarity between the current question text and the original question text in a preset database can be calculated using statistical methods, semantic understanding-based methods, deep learning-based methods, etc. For example, a semantic understanding-based method calculates the semantic similarity between the current question text and the original question text by calculating the distance between two words in the semantic structure tree to determine the semantic similarity between words in the current question text and words in the original question text, thereby obtaining the semantic similarity between the current question text and the original question text in the preset database.

[0036] It should be understood that the preset database includes one or more original question texts, and the calculated speech similarity between the current question text and the original question texts may include one or more. The semantic similarity between the current question text and the original question texts in the preset database is obtained, that is, the semantic similarity between the current question text and the original question text with the highest calculated speech similarity is obtained.

[0037] Step S130: If the semantic similarity is less than or equal to the similarity threshold, then input the current question text into the text generation model to obtain the current answer text output by the text generation model.

[0038] In some implementations, the electronic device may pre-set and store a similarity threshold, which serves as the basis for determining whether to input the current question text into the text generation model. Therefore, in this embodiment, the electronic device compares the semantic similarity of the acquired current question text with the original question text in the preset training library, where the highest semantic similarity is found, with the similarity threshold to determine whether the speech similarity between the current question text and the original question text in the preset training library is less than or equal to the similarity threshold. The similarity threshold characterizes whether the current question text can be expressed using the original question text in the preset database. That is, if the speech similarity between the current question text and the original question text in the preset training library is less than or equal to the similarity threshold, it can be determined that the original question text in the preset database cannot be expressed by the current question text; if the speech similarity between the current question text and the original question text in the preset training library is greater than the similarity threshold, it can be determined that the original question text in the preset database can express the current question text.

[0039] As one approach, if the semantic similarity between the current question text and the original question text is less than or equal to a similarity threshold, it indicates that the current question text cannot be expressed using the original question text in the preset database. Therefore, the current question text can be input into the text generation model to obtain the current answer text output by the text generation model, so that the electronic device can provide a reasonable answer to the current question text.

[0040] As another approach, if the semantic similarity between the current question text and the original question text is greater than the similarity threshold, it indicates that the current question text can be expressed using the original question text in the preset database. Therefore, the electronic device can provide a reasonable answer to the original question text, thereby reducing the power consumption of the electronic device in obtaining reasonable answer content. At the same time, it answers the question in the most original way of expressing the object to be imitated, which improves the user experience.

[0041] The text generation model takes the current question text as input and outputs the corresponding answer text. The text generation model can be pre-set and stored on an electronic device, or obtained from a connected cloud or electronic device via a network. The text generation model can be a SeqGAN (Sequence Adversarial Network), a GAN (Generative Adversarial Network), a Variational Autoencoder (VAE) model, etc.

[0042] Step S140: Based on the original sound quality and the current response text, obtain and output the response voice corresponding to the object to be imitated.

[0043] In some implementations, the electronic device synthesizes the corresponding speech of the current response text using Text To Speech (TTS) technology based on the original sound quality of the object to be imitated and the current response text in a preset database, and outputs the speech of the response.

[0044] As one implementation method, when using TTS technology for speech synthesis, different phonemes in the current response text are found based on linguistic features to identify the original sound quality of the object to be imitated in the preset database. The different factors are then spliced ​​together according to the content of the current response text to complete the speech synthesis, so as to imitate the voice of the person to be imitated and make the pronunciation of the electronic device more vivid, improve the anthropomorphism of the electronic device's response voice, and thus improve the user's experience and sense of intimacy.

[0045] For example, an electronic device uses TTS technology to decompose the current response text into phonemes by word or phrase, analyzes special symbols in the text such as numbers, currency units, word variations, and punctuation, and merges the original sound quality with phonemes to generate digital audio, that is, to obtain the response speech corresponding to the object to be imitated. The electronic device then plays it out through a speaker or saves it as a sound file for playback using multimedia software.

[0046] As another implementation method, the preset data may also include basic phonemes corresponding to different characters. When using TTS technology for speech synthesis, if the original sound quality corresponding to the phonemes of the current answer text cannot be found in the preset database, the basic phonemes in the preset database can be used to splice and synthesize speech according to the content of the current answer text, so that the electronic device can answer the current question text in a timely manner and improve the user experience.

[0047] An embodiment of this application provides a voice response method that receives a current question text; obtains the semantic similarity between the current question text and an original question text in a preset database, wherein the preset database also includes the original voice quality of the object to be imitated; if the semantic similarity is less than or equal to a similarity threshold, the current question text is input into a text generation model to obtain the current response text output by the text generation model; based on the original voice quality and the current response text, the response voice corresponding to the object to be imitated is obtained and output, thereby improving the user experience by imitating the speaking habits and characteristics of the object to be imitated according to the information of the object to be imitated in the preset database after receiving the current question text.

[0048] Please see Figure 2 , Figure 2 A flowchart illustrating a voice response method according to an embodiment of this application is shown. This method is applied to the aforementioned electronic device, and will be discussed below. Figure 2 The process shown will be explained in detail. The method of voice response may specifically include the following steps:

[0049] Step S210: Receive the current question text.

[0050] Step S220: Obtain the semantic similarity between the current question text and the original question text in the preset database, wherein the preset database also includes the original sound quality of the object to be imitated.

[0051] Step S230: If the semantic similarity is less than or equal to the similarity threshold, then input the current question text into the text generation model to obtain the current answer text output by the text generation model.

[0052] For a detailed description of steps S210-S230, please refer to steps S110-S130, which will not be repeated here.

[0053] Step S240: Obtain target words from the preset database, wherein the frequency of the target words output by the object to be imitated is greater than a frequency threshold.

[0054] In some implementations, the electronic device pre-sets and stores a preset database. Optionally, the preset database includes the original response text and original audio quality of the object to be imitated; the preset database may also include the original response audio of the object to be imitated in a voice dialogue corresponding to the original question text.

[0055] In some implementations, the electronic device uses Shared Transistor Technology (STT) to store the recognizable original speech and the original question text in a preset database in a one-to-one correspondence.

[0056] In some implementations, the electronic device retrieves target words from a preset database. The target words are output by the subject to be imitated at a frequency greater than a frequency threshold. That is, the target words refer to the text in the preset database that the subject to be imitated outputs speech to the original question text at a frequency greater than a frequency threshold. In other words, the target words can be phrases that the subject to be imitated habitually outputs intentionally or unintentionally, or they can be understood as the subject to be imitated's catchphrases.

[0057] In some implementations, a frequency threshold can be preset and stored in the electronic device. This frequency threshold serves as the basis for determining whether to retrieve target words from a preset database. Therefore, in this embodiment, the frequency of the same word output by the target in the preset database can be compared with the frequency threshold to determine whether the frequency of the word output by the target is greater than the frequency threshold. The frequency threshold can be a dividing line indicating whether the word output by the target is a commonly used word of the target. For example, if the frequency of the same word output by the target is greater than the frequency threshold, then the word can be determined to be a commonly used word of the target, i.e., a catchphrase; if the frequency of a word output by the target is less than or equal to the frequency threshold, then the word can be determined to be an uncommon word of the target.

[0058] It should be understood that by retrieving target vocabulary from a pre-set database, commonly used words of the object to be imitated can be obtained. Electronic devices can then use these commonly used words to provide voice responses, which enhances the human-like quality of the electronic devices' voice responses and thus improves the user's sense of intimacy and experience in intelligent dialogue with the electronic devices.

[0059] Step S250: Obtain the matching relationship between the target vocabulary and the preset vocabulary.

[0060] In some implementations, after obtaining target words from a preset database, the electronic device acquires the matching relationship between the target words and preset words. The electronic device may pre-set and store preset words, which serve as the basis for judging the semantic compatibility of the target words. Therefore, in this embodiment, after obtaining the target words, they are matched with preset words to determine whether the target words match. For example, if the target words match the preset words, the semantic compatibility of the target words is considered high. The original speech corresponding to the target words can then be used as a prefix or suffix to the electronic device's voice response to the current question text. This makes the electronic device's voice response conform to the speaking habits and characteristics of the object being imitated, improving the user experience and sense of familiarity, while reducing the power consumption of the highly human-like voice processing in the response.

[0061] As one implementation method, the matching relationship between target words and preset words can be obtained by obtaining the semantics of target words and preset words. If the semantics of target words and preset words are the same, such as both indicating negation, then the target words and preset words are determined to match. If the semantics of target words and preset words are different, such as the semantics of target words indicating negation and the semantics of preset words indicating affirmation, then the target words and preset words are determined not to match.

[0062] As another implementation method, the matching relationship between the target word and the preset word can be obtained by obtaining the target word and the preset word. If the target word and the preset word are exactly the same, such as the target word and the preset word being the same word "wow", then the target word and the preset word are determined to match. If the target word and the preset word are different, such as the target word being "impossible" and the preset word being "anything", then the target word and the preset word are determined to not match.

[0063] In some implementations, the preset vocabulary may include one or more, and the semantics of the preset vocabulary may also include one or more. If there exists a preset vocabulary that has the same semantics as the target vocabulary, then the target vocabulary is determined to match the preset vocabulary; if there exists a preset vocabulary that is completely identical to the target vocabulary, then the target vocabulary is determined to match the preset vocabulary. The method of matching the target vocabulary with the preset vocabulary is not limited here.

[0064] Step S260: Based on the matching relationship, the original sound quality, the current response text, and the target vocabulary, obtain and output the response speech corresponding to the object to be imitated.

[0065] In some implementations, electronic devices utilize TTS technology to obtain the corresponding response speech of the object to be imitated, based on matching relationships, original audio quality, current response text, and target vocabulary.

[0066] The matching relationship can include both a match between the target word and a preset word, and a mismatch between the target word and the preset word. Obtaining and outputting the corresponding response speech based on the matching relationship, original audio quality, current response text, and target word can be achieved by: if the target word matches the preset word, concatenating the target word or preset word with the current response text to obtain the final text; then using the original audio quality to concatenate the phonemes of the final text to obtain digital audio; and finally, using this digital audio as the response speech corresponding to the target word. Alternatively, obtaining and outputting the corresponding response speech based on the matching relationship, original audio quality, current response text, and target word can also be achieved by: if the target word matches the preset word, concatenating the target word with the current response text to obtain the final text; then using the original audio quality to concatenate the phonemes of the final text to obtain digital audio; and finally, using this digital audio as the response speech corresponding to the target word.

[0067] Please see Figure 3 , Figure 3 A flowchart illustrating a voice response method according to an embodiment of this application is shown. In some embodiments, step S260 may specifically include the following steps:

[0068] Step S261: When the matching relationship indicates that the target word matches the preset word, the current answer text is processed into speech based on the original sound quality to obtain the current answer speech.

[0069] In some implementations, after the electronic device obtains the matching relationship between the target word and the preset word, if the matching relationship indicates that the target word and the preset word match, the electronic device performs speech-to-speech processing on the current answer text based on the original sound quality to obtain the current answer speech.

[0070] For example, the electronic device can perform speech-to-speech processing on the current response text based on the original sound quality by using TTS technology to decompose the current response text into phonemes by word or phrase, and analyze special symbols in the text such as numbers, currency units, word variations, and punctuation marks, and then fuse the original sound quality with the corresponding phonemes to generate digital audio, that is, to obtain the current response speech corresponding to the object to be imitated.

[0071] Step S262: Concatenate the target speech corresponding to the target vocabulary with the current response speech to obtain and output the response speech corresponding to the object to be imitated.

[0072] In some implementations, a preset database includes target vocabulary. The electronic device performs speech-to-speech processing on the target vocabulary based on the original sound quality of the object to be imitated in the preset database to obtain target speech. Then, the electronic device concatenates the target speech with the current response speech to obtain and output the response speech corresponding to the object to be imitated. The concatenation of the target speech corresponding to the target vocabulary with the current response speech can be done by placing the target speech at the beginning or the end of the current response speech; no limitation is made here.

[0073] In some implementations, the preset database includes target words and the original speech corresponding to the target words. The electronic device obtains the original speech corresponding to the target words in the preset database as the target speech. Then, the electronic device concatenates the target speech with the current response speech to obtain and output the response speech corresponding to the object to be imitated, thereby reducing the power consumption of the electronic device in synthesizing the response speech and using the original speech of the object to be imitated to give a speech response, thus improving the user experience.

[0074] Step S263: If the matching relationship indicates that the target word does not match the preset word, the current answer text and the target word are fused to obtain fused text.

[0075] In some implementations, after the electronic device obtains the matching relationship between the target words and preset words, if the matching relationship indicates that the target words and preset words do not match, the electronic device will fuse the current answer text and the target words to obtain fused text.

[0076] Optionally, the fusion of the current response text and the target vocabulary can be achieved by: firstly, based on the semantics of each word in the current response text and the semantics of the target vocabulary, concatenating the target vocabulary before or after the word whose semantics are most similar to those in the current response text, thus obtaining a fused text; or secondly, by changing the logical structure of the current response text according to the logical structure of the target vocabulary, and then concatenating the target vocabulary at the beginning or end of the changed logical structure of the current response text, thus obtaining a fused text, thereby making the response voice of the electronic device closer to the speaking habits and characteristics of the person being imitated.

[0077] Step S264: Based on the original sound quality, perform speech-to-speech processing on the fused text to obtain and output the response speech corresponding to the object to be imitated.

[0078] In some implementations, the electronic device uses TTS technology to process the fused text into speech based on the original audio quality of the object to be imitated in a preset database, and obtains and outputs the corresponding response speech of the object to be imitated.

[0079] It should be noted that, in the embodiments of this application, the obtained speech may include one or more based on the matching relationship, original sound quality, current response text and target vocabulary. Finally, the response speech obtained and output by the electronic device that corresponds to the object to be imitated may be obtained and output by calculating the semantic fluency of all speech and taking the speech with the highest semantic fluency as the response speech, so as to improve the rationality and anthropomorphism of the electronic device's speech response content and improve the user's experience.

[0080] It should be understood that, based on the original sound quality, the current response text, and the target vocabulary, the system obtains and outputs the response speech corresponding to the object to be imitated. The response speech includes verbal tics that conform to the speaking habits and characteristics of the object to be imitated, which improves the anthropomorphism of the electronic device's voice response and enhances the user's experience and sense of intimacy when having a voice conversation with the electronic device.

[0081] An embodiment of this application provides a voice response method, which includes receiving a current question text; obtaining the semantic similarity between the current question text and original question texts in a preset database, wherein the preset database also includes the original voice quality of the object to be imitated; if the semantic similarity is less than or equal to a similarity threshold, then inputting the current question text into a text generation model to obtain the current response text output by the text generation model; obtaining target words from the preset database, wherein the frequency of the target words output by the object to be imitated is greater than a frequency threshold; obtaining the matching relationship between the target words and preset words; and obtaining and outputting the response voice corresponding to the object to be imitated based on the matching relationship, the original voice quality, the current response text, and the target words. Compared to Figure 1 The voice response method shown in this embodiment obtains target words that match the speaking habits and characteristics of the object to be imitated from a preset database based on semantic similarity and the suitability of catchphrases. Based on the original sound quality, the current response text, and the target words, the response voice corresponding to the object to be imitated is obtained and output, which improves the anthropomorphism of the electronic device's voice response and the user's experience and sense of intimacy when having a voice conversation with the electronic device.

[0082] Please see Figure 4 , Figure 4 A flowchart illustrating a voice response method according to an embodiment of this application is shown. This method is applied to the aforementioned electronic device, and will be discussed below. Figure 4 The process shown will be explained in detail. The method of voice response may specifically include the following steps:

[0083] Step S310: Receive the current question text.

[0084] Step S320: Obtain the semantic similarity between the current question text and the original question text in the preset database, wherein the preset database also includes the original sound quality of the object to be imitated.

[0085] For a detailed description of steps S310-S320, please refer to the previous description of steps S110-S120, which will not be repeated here.

[0086] Step S330: If the semantic similarity is greater than the similarity threshold, obtain the original answer speech corresponding to the original question text from the preset database.

[0087] In some embodiments, the preset database includes the original audio of the object to be imitated corresponding to the original question text; a similarity threshold is preset and stored in the electronic device, used as the basis for determining whether to obtain the original audio of the original question text from the preset database. In this embodiment, if it is determined that the similarity between the current question text and the original question text is greater than the similarity threshold, then it is determined to obtain the original audio of the original question text from the preset database.

[0088] In some implementations, the original question text and the original answer speech of the object to be imitated are stored in a one-to-one correspondence using STT technology. This allows the electronic device to determine that the semantic similarity between the current question text and the original question text is greater than a similarity threshold. The original answer speech corresponding to the original question text is then retrieved from a preset database. This improves the rationality of the content of the electronic device's voice response while reducing the power consumption of the electronic device's voice response.

[0089] Step S340: Output the original audio response.

[0090] In some embodiments, after receiving the current question text, the electronic device obtains the semantic similarity between the current question text and the original question text in the preset database; after determining that the semantic similarity is greater than the similarity threshold, it obtains the original answer speech corresponding to the original question text from the preset database; then the electronic device plays the original answer speech through a speaker or saves it as an audio file and outputs it to an associated device for playback using multimedia software.

[0091] An embodiment of this application provides a voice response method, which receives a current question text; obtains the semantic similarity between the current question text and an original question text in a preset database, wherein the preset database also includes original answer voices of the object to be imitated based on the original question text; if the semantic similarity is greater than a similarity threshold, the original answer voice corresponding to the original question text is obtained from the preset database; and the original answer voice is output. Compared to Figure 1 The method for voice response shown in this embodiment also provides that when the semantic similarity between the current question text and the original question text in the preset database is greater than the similarity threshold, the original answer voice corresponding to the original question text is obtained and output as the highest priority for the electronic device to give a voice response. This allows the electronic device to give a voice response to questions by imitating the original voice of the object to be imitated, thereby improving the anthropomorphism of the electronic device and the user's sense of intimacy and experience in the dialogue with the electronic device.

[0092] Please see Figure 5 , Figure 5 A flowchart illustrating a voice response method according to an embodiment of this application is shown. This method is applied to the aforementioned electronic device, and will be discussed below. Figure 5 The process shown will be explained in detail. The method of voice response may specifically include the following steps:

[0093] Step S410: Obtain the original dialogue voice corresponding to the object to be imitated, wherein the original dialogue voice includes the original question voice and the original answer voice of the object to be imitated.

[0094] In some implementations, the electronic device acquires a recorded audio or video file, performs speech extraction processing on the recorded audio or video file, and obtains the original dialogue speech. The audio or video file is recorded in the form of a chat conversation, and there are two participants in the chat conversation.

[0095] In this process, the party asking more questions in the audio or video file (original dialogue voice) is designated as the non-imitation target, while the other party is designated as the imitation target. The electronic device then distinguishes between the original response voice of the imitation target and the original question voice of the non-imitation target in the original dialogue voice based on the timbre and audio differences of each participant, ultimately obtaining the original dialogue voice corresponding to the imitation target.

[0096] Step S420: Convert the original question speech to text to obtain the original question text.

[0097] In some implementations, the electronic device performs text-to-text processing on the original question speech to obtain the original question text, thereby obtaining original question text that is compatible with different audio qualities and saving the memory of the electronic device.

[0098] For example, an electronic device uses Automatic Speech Recognition (ASR) technology to convert speech into text, and then uses Natural Language Processing (NLP) technology to understand and process the text converted from speech to obtain the original question text corresponding to the original question speech.

[0099] Step S430: Perform sound quality recognition on the original response speech to obtain the original sound quality of the object to be imitated.

[0100] The sound quality can include sound information such as timbre, audio frequency, and pitch. Sound quality is associated with the speaking habits and characteristics of the speaker and can be used to distinguish the corresponding voice. In some embodiments, the electronic device identifies the timbre and audio frequency of the original response speech to obtain the original sound quality of the object to be imitated. This original sound quality corresponds to the phonemes obtained by word decomposing the original response speech of the object to be imitated. The electronic device can then synthesize speech with the vocal characteristics of the object to be imitated based on these phonemes.

[0101] Step S440: Establish a preset database based on the original question text and the original voice quality of the object to be imitated.

[0102] In some implementations, the electronic device establishes a preset database based on the original question text and the original sound quality of the object to be imitated.

[0103] Optionally, the preset database may also include the original speech of the subject's response to the original question text, as well as basic phonemes that can be used for AI speech synthesis. In some embodiments, the electronic device uses STT technology to save the original question text and the corresponding original speech of the original question text to each other in a one-to-one correspondence.

[0104] In some implementations, target vocabulary is pre-stored. This target vocabulary can be derived by comparing the frequency of words output from the original speech to the original text using an electronic device, with a preset frequency, and identifying words whose frequencies are greater than a frequency threshold when output by the object to be imitated.

[0105] Step S450: Receive the current question text.

[0106] Step S460: Obtain the semantic similarity between the current question text and the original question text in the preset database, wherein the preset database also includes the original sound quality of the object to be imitated.

[0107] Step S470: If the semantic similarity is less than or equal to the similarity threshold, then input the current question text into the text generation model to obtain the current answer text output by the text generation model.

[0108] Step S480: Based on the original sound quality and the current response text, obtain and output the response voice corresponding to the object to be imitated.

[0109] For example, please refer to Figure 6 The workflow for electronic devices to provide voice responses is as follows: Figure 6 As shown. When the electronic device performs a voice response function, it determines the object to be imitated. After receiving the current question text, it obtains the semantic similarity between the current question text and the original question text in a preset database, where the preset database also includes the original audio quality of the object to be imitated. In one implementation, if the semantic similarity is less than or equal to a similarity threshold, the current question text is input into a text generation model to obtain the current response text output by the text generation model; based on the original audio quality and the current response text, TTS technology is used to obtain and output the response speech corresponding to the object to be imitated. In another implementation, if the semantic similarity is greater than the similarity threshold, the original response speech corresponding to the original question text, which is stored one-to-one using STT technology, is obtained from the preset database; the original response speech is then output. In yet another implementation, target words are obtained from the preset database, where the frequency of the target words output by the object to be imitated is greater than a frequency threshold; based on the original audio quality, the current response text, and the target words, TTS technology is used to obtain and output the response speech corresponding to the object to be imitated.

[0110] One embodiment of this application provides a voice response method that establishes a preset database before making a voice response. After receiving the question text, the method obtains and outputs the voice response that imitates the target object based on the information of the target object in the preset database, so as to imitate the speaking habits and characteristics of the target object to answer the question, thereby improving the user experience.

[0111] Please see Figure 7 , Figure 7 A block diagram of a voice response device according to an embodiment of this application is shown. This voice response device 200 is applied to the aforementioned electronic device, and will be discussed below. Figure 7 The process is described in detail below. The voice response device 200 includes: a current question text receiving module 210, a semantic similarity acquisition module 220, a current response text acquisition module 230, and a response voice acquisition module 240, wherein:

[0112] The current question text receiving module 210 is used to receive the current question text.

[0113] The semantic similarity acquisition module 220 is used to acquire the semantic similarity between the current question text and the original question text in the preset database, wherein the preset database also includes the original sound quality of the object to be imitated.

[0114] The current answer text acquisition module 230 is used to input the current question text into the text generation model and obtain the current answer text output by the text generation model if the semantic similarity is less than or equal to the similarity threshold.

[0115] The response speech acquisition module 240 is used to acquire and output the response speech corresponding to the object to be imitated based on the original sound quality and the current response text.

[0116] Furthermore, the response speech acquisition module 240 includes: a target vocabulary acquisition module and a response speech acquisition submodule, wherein:

[0117] The target vocabulary acquisition module is used to obtain target vocabulary from a preset database, wherein the frequency of the target vocabulary output by the object to be imitated is greater than a frequency threshold.

[0118] The response speech acquisition submodule is used to obtain and output the response speech corresponding to the object to be imitated, based on the original sound quality, the current response text, and the target vocabulary.

[0119] Furthermore, the response speech acquisition submodule includes: a matching relationship acquisition unit and a response speech acquisition subunit, wherein:

[0120] The matching relationship acquisition unit is used to obtain the matching relationship between the target word and the preset words.

[0121] The response speech acquisition subunit is used to obtain and output the response speech corresponding to the object to be imitated based on the matching relationship, the original sound quality, the current response text, and the target vocabulary.

[0122] Furthermore, the response speech acquisition subunit includes: a current speech acquisition unit and a first speech acquisition unit, wherein:

[0123] The current speech acquisition unit is used to process the current response text into speech based on the original sound quality when the target words in the matching relationship representation match the preset words.

[0124] The first speech acquisition unit is used to concatenate the target speech corresponding to the target word with the current response speech to obtain and output the response speech corresponding to the object to be imitated.

[0125] Furthermore, the response speech acquisition subunit further includes: a fused text acquisition unit and a second speech acquisition unit, wherein:

[0126] The fused text acquisition unit is used to merge the current answer text and the target words when the target words in the matching relationship representation do not match the preset words, so as to obtain fused text.

[0127] The second speech acquisition unit is used to perform speech-to-speech processing on the fused text based on the original sound quality, and to obtain and output the response speech corresponding to the object to be imitated.

[0128] Furthermore, the voice response device 200 further includes: an original response voice acquisition module and an original voice response module, wherein:

[0129] The original answer audio acquisition module is used to retrieve the original answer audio corresponding to the original question text from a preset database if the semantic similarity is greater than a similarity threshold.

[0130] The information acquisition module is used to output the original audio response.

[0131] The original voice response module is used to highlight the target speech text, the target speaker, and the target speech time in the conversation interface.

[0132] Furthermore, the voice response device 200 further includes: an original dialogue acquisition module, an original text acquisition module, a sound quality recognition module, and a database creation module, wherein:

[0133] The original dialogue acquisition module is used to acquire the original dialogue audio corresponding to the object to be imitated. The original dialogue audio includes the original question audio and the original answer audio of the object to be imitated.

[0134] The original text acquisition module is used to process the original question speech into text to obtain the original question text.

[0135] The audio quality recognition module is used to identify the audio quality of the original response speech and obtain the original audio quality of the object to be imitated.

[0136] The database creation module is used to build a preset database based on the original question text and the original sound quality of the object to be imitated.

[0137] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0138] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.

[0139] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0140] Please see Figure 8 This document illustrates a structural block diagram of an electronic device 100 provided in an embodiment of this application. The electronic device 100 can be a smartphone, tablet computer, e-reader, smart wearable device, vehicle, or other electronic device capable of running applications. The electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications can be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more applications are configured to perform the methods described in the foregoing method embodiments.

[0141] The processor 110 may include one or more processing cores. The processor 110 connects to various parts within the electronic device 100 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and by calling data stored in the memory 120. Optionally, the processor 110 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 110 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 110 and may be implemented separately using a communication chip.

[0142] The memory 120 may include random access memory (RAM) or read-only memory (ROM). The memory 120 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the electronic device 100 during use (such as phonebook data, audio and video data, chat log data, etc.).

[0143] Please see Figure 9 This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 300 stores program code that can be called by a processor to execute the methods described in the above method embodiments.

[0144] The computer-readable storage medium 300 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 300 has storage space for program code 310 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 310 may be compressed, for example, in a suitable form.

[0145] In summary, the voice response method, apparatus, electronic device, and storage medium provided in this application embodiment receive a current question text; obtain the semantic similarity between the current question text and the original question text in a preset database, wherein the preset database also includes the original voice quality of the object to be imitated; if the semantic similarity is less than or equal to a similarity threshold, input the current question text into a text generation model to obtain the current response text output by the text generation model; based on the original voice quality and the current response text, obtain and output the response voice corresponding to the object to be imitated, thereby improving the user experience by obtaining and outputting the response voice imitating the object to be imitated based on the information of the object to be imitated in the preset database after receiving the question text, thus imitating the speaking habits and characteristics of the object to be imitated to answer questions.

[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for providing voice responses, characterized in that, The method includes: Receive the current question text; Obtain the semantic similarity between the current question text and the original question text in the preset database, wherein the preset database also includes the original sound quality of the object to be imitated; If the semantic similarity is less than or equal to the similarity threshold, then the current question text is input into the text generation model to obtain the current answer text output by the text generation model; Target words are obtained from the preset database, wherein the target words refer to the text in the preset database in which the frequency of the target being imitated corresponding to the original question text is greater than a frequency threshold. Obtain the matching relationship between the target vocabulary and preset vocabulary; When the matching relationship indicates that the target word does not match the preset word, the target word is concatenated before and after the word whose semantics are most similar to the word in the current answer text, based on the semantics of each word in the current answer text and the semantics of the target word, to obtain the fused text; Based on the original audio quality, the fused text is processed into speech to obtain and output the response speech corresponding to the object to be imitated.

2. The method according to claim 1, characterized in that, The method further includes: When the matching relationship indicates that the target word matches the preset word, the current answer text is processed into speech based on the original sound quality to obtain the current answer speech. The target speech corresponding to the target vocabulary is concatenated with the current response speech to obtain and output the response speech corresponding to the object to be imitated.

3. The method according to claim 1 or 2, characterized in that, The method further includes: If the semantic similarity is greater than the similarity threshold, the original answer audio corresponding to the original question text is obtained from the preset database; Output the original audio response.

4. The method according to claim 1 or 2, characterized in that, Before receiving the current question text, the following is also included: Obtain the original dialogue voice corresponding to the object to be imitated, wherein the original dialogue voice includes the original question voice and the original answer voice of the object to be imitated; The original question speech is converted to text to obtain the original question text; The original response speech is subjected to sound quality recognition to obtain the original sound quality of the object to be imitated; A preset database is established based on the original question text and the original voice quality of the object to be imitated.

5. A device for providing voice responses, characterized in that, The device includes: The current question text receiving module is used to receive the current question text; The semantic similarity acquisition module is used to acquire the semantic similarity between the current question text and the original question text in the preset database, wherein the preset database also includes the original sound quality of the object to be imitated; The current answer text acquisition module is used to input the current question text into the text generation model if the semantic similarity is less than or equal to the similarity threshold, and obtain the current answer text output by the text generation model. The response speech acquisition module is used to obtain target words from the preset database, wherein the target words refer to text in the preset database whose frequency of speech output corresponding to the original question text of the object to be imitated is greater than a frequency threshold; obtain the matching relationship between the target words and the preset words; when the matching relationship indicates that the target words and the preset words do not match, according to the semantics of each word in the current response text and the semantics of the target words, the target words are concatenated before and after the words with the closest semantics to the words in the current response text to obtain fused text; based on the original sound quality, the fused text is processed into speech to obtain and output the response speech corresponding to the object to be imitated.

6. An electronic device, characterized in that, include: One or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform the method as described in any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Speech synthesis method and related equipment

    CN108962217A

  • Answer information processing method and device, terminal and readable storage medium

    CN109614470A

  • Voice interaction method and device, equipment and medium

    CN110633357A

  • Guest greeting robot dialogue method

    CN114116994A