Method and device for generating reply voice

文档序号:106578 发布日期:2021-10-15 浏览:35次 中文

阅读说明:本技术 生成回复语音的方法及装置 (Method and device for generating reply voice ) 是由 冯鑫 张韶峰 于 2021-08-06 设计创作,主要内容包括:本申请公开一种生成回复语音的方法及装置,涉及自然语言处理技术领域。本申请的方法包括:接收待回复语音;基于目标自动语音识别模块判断待回复语音对应的文本内容是否为目标特定词,其中,目标自动语音识别模块为预先集成在软交换子系统中的功能模块,目标特定词为多个预设肯定词和多个预设否定词中的任意一个;若是,则根据目标特定词、目标自然语言理解模块和目标文字转语音模块生成待回复语音对应的回复语音,其中,目标自然语言理解模块和目标文字转语音模块为预先集成在软交换子系统中的功能模块;若否,则将待回复语音发送至智能语音子系统中,以便智能语音子系统生成待回复语音对应的回复语音。(The application discloses a method and a device for generating reply voice, and relates to the technical field of natural language processing. The method of the present application comprises: receiving a voice to be replied; judging whether text content corresponding to the voice to be replied is a target specific word or not based on a target automatic voice recognition module, wherein the target automatic voice recognition module is a functional module integrated in a soft switch subsystem in advance, and the target specific word is any one of a plurality of preset positive words and a plurality of preset negative words; if so, generating a reply voice corresponding to the voice to be replied according to the target specific word, the target natural language understanding module and the target character to voice conversion module, wherein the target natural language understanding module and the target character to voice conversion module are functional modules integrated in the soft switch subsystem in advance; if not, the to-be-replied voice is sent to the intelligent voice subsystem, so that the intelligent voice subsystem can generate a reply voice corresponding to the to-be-replied voice.)

1. A method for generating a reply voice, the method being applied to a softswitch subsystem, comprising:

receiving a voice to be replied;

judging whether the text content corresponding to the voice to be replied is a target specific word or not based on a target automatic voice recognition module, wherein the target automatic voice recognition module is a functional module integrated in the soft switch subsystem in advance, and the target specific word is any one of a plurality of preset positive words and a plurality of preset negative words;

if so, generating a reply voice corresponding to the voice to be replied according to the target specific word, a target natural language understanding module and a target character-to-voice module, wherein the target natural language understanding module and the target character-to-voice module are functional modules integrated in the soft switch subsystem in advance;

if not, the to-be-replied voice is sent to an intelligent voice subsystem, so that the intelligent voice subsystem generates a reply voice corresponding to the to-be-replied voice.

2. The method of claim 1, wherein the target automatic speech recognition module comprises a preset acoustic model, a preset language model, and a preset recognized word network; the method for judging whether the text content corresponding to the to-be-replied voice is the target specific word or not based on the target automatic voice recognition module comprises the following steps:

inputting the voice to be replied into the target automatic voice recognition module so that the target automatic voice recognition module carries out voice recognition on the voice to be replied based on the preset acoustic model, the preset language model and the preset recognition word network;

if the target automatic voice recognition module outputs the target specific word, determining the text content corresponding to the voice to be replied as the target specific word;

and if the target automatic voice recognition module does not output the target specific word, determining that the text content corresponding to the voice to be replied is not the target specific word.

3. The method according to claim 1, wherein the target natural language understanding module comprises a first mapping relationship between each of the predetermined positive words and its corresponding predetermined reply text, and a second mapping relationship between each of the predetermined negative words and its corresponding predetermined reply text, and the target text-to-speech module comprises a third mapping relationship between each of the predetermined reply texts and its corresponding reply speech; generating a reply voice corresponding to the voice to be replied according to the target specific word, the target natural language understanding module and the target character-to-voice module, wherein the method comprises the following steps:

inputting the target specific word into the target natural language understanding module so that the target natural language understanding module outputs a preset reply text corresponding to the target specific word according to the target specific word, the first mapping relation and the second mapping relation;

and inputting the preset reply text corresponding to the target specific word into the target word-to-speech module, so that the target word-to-speech module outputs the reply speech corresponding to the speech to be replied according to the preset reply text corresponding to the target specific word and the third mapping relation.

4. The method of claim 2, wherein prior to said receiving the voice to reply, the method further comprises:

obtaining a first training sample set, wherein the first training sample set includes a plurality of first training samples, a plurality of second training samples, and a plurality of third training samples, and the first training samples include: any one of the preset positive words and the voice corresponding to the preset positive word, wherein the second training sample comprises: any one of the preset negative words and the voice corresponding to the preset negative word, wherein the third training sample comprises: training texts not containing any preset positive words and any preset negative words and voices corresponding to the training texts;

training a first preset model by using the first training sample set until a first preset training stop condition is reached to obtain the preset acoustic model;

acquiring a second training sample set, wherein the second training sample set comprises a plurality of preset positive words, a plurality of preset negative words and a plurality of other words, and the other words are words related to the preset positive words or the preset negative words;

training a second preset model by using the second training sample set until a second preset training stop condition is reached to obtain the preset language model;

and establishing the preset recognition word network according to the inter-word relationship corresponding to each preset positive word and the inter-word relationship corresponding to each preset negative word.

5. The method according to claim 4, wherein the first pre-set model is specifically: the GMM-HMM model specifically comprises the following second preset model: N-Gram model.

6. An apparatus for generating a reply voice, the apparatus being applied to a soft switch subsystem, comprising:

the receiving unit is used for receiving the voice to be replied;

a judging unit, configured to judge whether text content corresponding to the to-be-replied voice is a target specific word based on a target automatic voice recognition module, where the target automatic voice recognition module is a functional module integrated in the soft switch subsystem in advance, and the target specific word is any one of a plurality of preset positive words and a plurality of preset negative words;

a generating unit, configured to generate a reply voice corresponding to the voice to be replied according to the target specific word, a target natural language understanding module and a target text-to-speech module when the determining unit determines that the text content corresponding to the voice to be replied is the target specific word, where the target natural language understanding module and the target text-to-speech module are functional modules integrated in the soft switch subsystem in advance;

and the sending unit is used for sending the voice to be replied to the intelligent voice subsystem when the judging unit judges that the text content corresponding to the voice to be replied is not the target specific word, so that the intelligent voice subsystem can generate the reply voice corresponding to the voice to be replied.

7. The apparatus of claim 6, wherein the target automatic speech recognition module comprises a preset acoustic model, a preset language model, and a preset recognized word network; the judging unit includes:

the first input module is used for inputting the voice to be replied into the target automatic voice recognition module so that the target automatic voice recognition module carries out voice recognition on the voice to be replied based on the preset acoustic model, the preset language model and the preset recognition word network;

the first determining module is used for determining the text content corresponding to the to-be-replied voice as the target specific word when the target automatic voice recognition module outputs the target specific word;

and the second determining module is used for determining that the text content corresponding to the to-be-replied voice is not the target specific word when the target automatic voice recognition module does not output the target specific word.

8. The apparatus of claim 6, wherein the target natural language understanding module comprises a first mapping relationship between each of the predetermined positive words and its corresponding predetermined reply text, and a second mapping relationship between each of the predetermined negative words and its corresponding predetermined reply text, and wherein the target text-to-speech module comprises a third mapping relationship between each of the predetermined reply texts and its corresponding reply speech; the generation unit includes:

the second input module is used for inputting the target specific word into the target natural language understanding module so that the target natural language understanding module can output a preset reply text corresponding to the target specific word according to the target specific word, the first mapping relation and the second mapping relation;

and the third input module is used for inputting the preset reply text corresponding to the target specific word into the target word-to-speech module, so that the target word-to-speech module outputs the reply speech corresponding to the to-be-replied speech according to the preset reply text corresponding to the target specific word and the third mapping relation.

9. The apparatus of claim 7, further comprising:

a first obtaining unit, configured to obtain a first training sample set before the receiving unit receives the to-be-replied voice, where the first training sample set includes a plurality of first training samples, a plurality of second training samples, and a plurality of third training samples, and the first training sample includes: any one of the preset positive words and the voice corresponding to the preset positive word, wherein the second training sample comprises: any one of the preset negative words and the voice corresponding to the preset negative word, wherein the third training sample comprises: training texts not containing any preset positive words and any preset negative words and voices corresponding to the training texts;

a first training unit, configured to train a first preset model using the first training sample set until a first preset training stop condition is reached, so as to obtain the preset acoustic model;

a second obtaining unit, configured to obtain a second training sample set, where the second training sample set includes a plurality of the preset positive words, a plurality of the preset negative words, and a plurality of other words, and the other words are words related to the preset positive words or the preset negative words;

the second training unit is used for training a second preset model by using the second training sample set until a second preset training stopping condition is reached so as to obtain the preset language model;

and the establishing unit is used for establishing the preset recognition word network according to the inter-word relationship corresponding to each preset positive word and the inter-word relationship corresponding to each preset negative word.

10. The apparatus according to claim 9, wherein the first preset model is specifically: the GMM-HMM model specifically comprises the following second preset model: N-Gram model.

11. A storage medium, comprising a stored program, wherein when the program runs, a device in which the storage medium is located is controlled to execute the method for generating a reply voice according to any one of claims 1 to 5.

12. An apparatus for generating a reply voice, the apparatus comprising a storage medium; and one or more processors, the storage medium coupled with the processors, the processors configured to execute program instructions stored in the storage medium; the program instructions when executed perform the method of generating a reply voice of any of claims 1 to 5.

Technical Field

The present application relates to the field of natural language processing technologies, and in particular, to a method and an apparatus for generating a reply voice.

Background

With the continuous development of artificial intelligence technology, intelligent voice technology has also been rapidly developed. The soft exchange intelligent voice interaction system applying the intelligent voice technology can replace a customer service of a mobile communication operator to carry out multi-round conversation with the customer, wherein the soft exchange intelligent voice interaction system comprises a soft exchange subsystem and an intelligent voice subsystem, the mobile communication operator sends a conversation voice to the soft exchange subsystem after receiving the conversation voice sent by the customer so that the soft exchange subsystem sends the conversation voice to the intelligent voice subsystem, the intelligent voice subsystem generates a reply voice corresponding to the conversation voice based on an automatic voice recognition module, a natural language understanding module, a conversation management module, a natural language generating module and a character-to-speech module and then sends the reply voice to the soft exchange subsystem, the soft exchange subsystem sends the reply voice to the mobile communication operator, and then the mobile communication operator feeds the reply voice back to the customer, thereby completing the current round of conversation.

In order to ensure the accuracy of recognizing complex call speech, an automatic speech recognition module in an intelligent speech subsystem usually performs speech recognition on the call speech based on a DNN-HMM (deep neural network-hidden markov) model, so as to convert the call speech into text content, however, performing speech recognition on the call speech based on the DNN-HMM model consumes a long time; in addition, in general, the soft switch subsystem and the intelligent voice subsystem are deployed in different servers, so that the soft switch subsystem and the intelligent voice subsystem need to communicate in a network communication manner, and therefore, when the soft switch subsystem communicates with the intelligent voice subsystem, network transmission delay exists. Therefore, the existing soft switch intelligent voice interaction system consumes a long time when generating the reply voice, thereby resulting in poor user experience of the client.

Disclosure of Invention

The embodiment of the application provides a method and a device for generating reply voice, and mainly aims to improve the efficiency of generating the reply voice by a soft switch intelligent voice interaction system, so that the user experience of a client is improved.

In order to solve the above technical problem, an embodiment of the present application provides the following technical solutions:

in a first aspect, the present application provides a method for generating a reply voice, which is applied to a soft switch subsystem, and includes:

receiving a voice to be replied;

judging whether the text content corresponding to the voice to be replied is a target specific word or not based on a target automatic voice recognition module, wherein the target automatic voice recognition module is a functional module integrated in the soft switch subsystem in advance, and the target specific word is any one of a plurality of preset positive words and a plurality of preset negative words;

if so, generating a reply voice corresponding to the voice to be replied according to the target specific word, a target natural language understanding module and a target character-to-voice module, wherein the target natural language understanding module and the target character-to-voice module are functional modules integrated in the soft switch subsystem in advance;

if not, the to-be-replied voice is sent to an intelligent voice subsystem, so that the intelligent voice subsystem generates a reply voice corresponding to the to-be-replied voice.

Optionally, the target automatic speech recognition module includes a preset acoustic model, a preset language model and a preset recognition word network; the method for judging whether the text content corresponding to the to-be-replied voice is the target specific word or not based on the target automatic voice recognition module comprises the following steps:

inputting the voice to be replied into the target automatic voice recognition module so that the target automatic voice recognition module carries out voice recognition on the voice to be replied based on the preset acoustic model, the preset language model and the preset recognition word network;

if the target automatic voice recognition module outputs the target specific word, determining the text content corresponding to the voice to be replied as the target specific word;

and if the target automatic voice recognition module does not output the target specific word, determining that the text content corresponding to the voice to be replied is not the target specific word.

Optionally, the target natural language understanding module includes a first mapping relationship between each preset positive word and the corresponding preset reply text thereof, and a second mapping relationship between each preset negative word and the corresponding preset reply text thereof, and the target character-to-speech module includes a third mapping relationship between each preset reply text and the corresponding reply speech thereof; generating a reply voice corresponding to the voice to be replied according to the target specific word, the target natural language understanding module and the target character-to-voice module, wherein the method comprises the following steps:

inputting the target specific word into the target natural language understanding module so that the target natural language understanding module outputs a preset reply text corresponding to the target specific word according to the target specific word, the first mapping relation and the second mapping relation;

and inputting the preset reply text corresponding to the target specific word into the target word-to-speech module, so that the target word-to-speech module outputs the reply speech corresponding to the speech to be replied according to the preset reply text corresponding to the target specific word and the third mapping relation.

Optionally, before the receiving the voice to be replied, the method further includes:

obtaining a first training sample set, wherein the first training sample set includes a plurality of first training samples, a plurality of second training samples, and a plurality of third training samples, and the first training samples include: any one of the preset positive words and the voice corresponding to the preset positive word, wherein the second training sample comprises: any one of the preset negative words and the voice corresponding to the preset negative word, wherein the third training sample comprises: training texts not containing any preset positive words and any preset negative words and voices corresponding to the training texts;

training a first preset model by using the first training sample set until a first preset training stop condition is reached to obtain the preset acoustic model;

acquiring a second training sample set, wherein the second training sample set comprises a plurality of preset positive words, a plurality of preset negative words and a plurality of other words, and the other words are words related to the preset positive words or the preset negative words;

training a second preset model by using the second training sample set until a second preset training stop condition is reached to obtain the preset language model;

and establishing the preset recognition word network according to the inter-word relationship corresponding to each preset positive word and the inter-word relationship corresponding to each preset negative word.

Optionally, the first preset model specifically includes: the GMM-HMM model specifically comprises the following second preset model: N-Gram model.

In a second aspect, the present application further provides an apparatus for generating a reply voice, where the apparatus is applied to a soft switch subsystem, and the apparatus includes:

the receiving unit is used for receiving the voice to be replied;

a judging unit, configured to judge whether text content corresponding to the to-be-replied voice is a target specific word based on a target automatic voice recognition module, where the target automatic voice recognition module is a functional module integrated in the soft switch subsystem in advance, and the target specific word is any one of a plurality of preset positive words and a plurality of preset negative words;

a generating unit, configured to generate a reply voice corresponding to the voice to be replied according to the target specific word, a target natural language understanding module and a target text-to-speech module when the determining unit determines that the text content corresponding to the voice to be replied is the target specific word, where the target natural language understanding module and the target text-to-speech module are functional modules integrated in the soft switch subsystem in advance;

and the sending unit is used for sending the voice to be replied to the intelligent voice subsystem when the judging unit judges that the text content corresponding to the voice to be replied is not the target specific word, so that the intelligent voice subsystem can generate the reply voice corresponding to the voice to be replied.

Optionally, the target automatic speech recognition module includes a preset acoustic model, a preset language model and a preset recognition word network; the judging unit includes:

the first input module is used for inputting the voice to be replied into the target automatic voice recognition module so that the target automatic voice recognition module carries out voice recognition on the voice to be replied based on the preset acoustic model, the preset language model and the preset recognition word network;

the first determining module is used for determining the text content corresponding to the to-be-replied voice as the target specific word when the target automatic voice recognition module outputs the target specific word;

and the second determining module is used for determining that the text content corresponding to the to-be-replied voice is not the target specific word when the target automatic voice recognition module does not output the target specific word.

Optionally, the target natural language understanding module includes a first mapping relationship between each preset positive word and the corresponding preset reply text thereof, and a second mapping relationship between each preset negative word and the corresponding preset reply text thereof, and the target character-to-speech module includes a third mapping relationship between each preset reply text and the corresponding reply speech thereof; the generation unit includes:

the second input module is used for inputting the target specific word into the target natural language understanding module so that the target natural language understanding module can output a preset reply text corresponding to the target specific word according to the target specific word, the first mapping relation and the second mapping relation;

and the third input module is used for inputting the preset reply text corresponding to the target specific word into the target word-to-speech module, so that the target word-to-speech module outputs the reply speech corresponding to the to-be-replied speech according to the preset reply text corresponding to the target specific word and the third mapping relation.

Optionally, the apparatus further comprises:

a first obtaining unit, configured to obtain a first training sample set before the receiving unit receives the to-be-replied voice, where the first training sample set includes a plurality of first training samples, a plurality of second training samples, and a plurality of third training samples, and the first training sample includes: any one of the preset positive words and the voice corresponding to the preset positive word, wherein the second training sample comprises: any one of the preset negative words and the voice corresponding to the preset negative word, wherein the third training sample comprises: training texts not containing any preset positive words and any preset negative words and voices corresponding to the training texts;

a first training unit, configured to train a first preset model using the first training sample set until a first preset training stop condition is reached, so as to obtain the preset acoustic model;

a second obtaining unit, configured to obtain a second training sample set, where the second training sample set includes a plurality of the preset positive words, a plurality of the preset negative words, and a plurality of other words, and the other words are words related to the preset positive words or the preset negative words;

the second training unit is used for training a second preset model by using the second training sample set until a second preset training stopping condition is reached so as to obtain the preset language model;

and the establishing unit is used for establishing the preset recognition word network according to the inter-word relationship corresponding to each preset positive word and the inter-word relationship corresponding to each preset negative word.

Optionally, the first preset model specifically includes: the GMM-HMM model specifically comprises the following second preset model: N-Gram model.

In a third aspect, an embodiment of the present application provides a storage medium, where the storage medium includes a stored program, and when the program runs, a device on which the storage medium is located is controlled to execute the method for generating a reply voice according to the first aspect.

In a fourth aspect, embodiments of the present application provide an apparatus for generating a reply voice, the apparatus comprising a storage medium; and one or more processors, the storage medium coupled with the processors, the processors configured to execute program instructions stored in the storage medium; the program instructions when executed perform the method for generating a reply voice of the first aspect.

By means of the technical scheme, the technical scheme provided by the application at least has the following advantages:

the application provides a method and a device for generating reply voice, which can judge whether text content corresponding to the voice to be replied is a target specific word or not by a soft switch subsystem based on a target automatic voice recognition module after the soft switch subsystem receives the voice to be replied sent by a mobile communication operator, generate reply voice corresponding to the voice to be replied according to the target specific word, a target natural language understanding module and a target character to voice conversion module when judging that the text content corresponding to the voice to be replied is the target specific word, and send the voice to be replied to an intelligent voice subsystem when judging that the text content corresponding to the voice to be replied is not the target specific word so as to generate the reply voice corresponding to the voice to be replied by the intelligent voice subsystem. Because the target automatic speech recognition module, the target natural language understanding module and the target character-to-speech module are functional modules integrated in the soft switch subsystem in advance, and the target automatic speech recognition module performs speech recognition on the speech to be replied which only contains the target specific word based on the acoustic model with a simple model structure, the consumed time is short, therefore, when the speech to be replied is the speech which only contains the target specific word, the soft switch subsystem can quickly generate the reply speech corresponding to the speech to be replied based on the target automatic speech recognition module, the target natural language understanding module and the target character-to-speech module, so that the efficiency of generating the reply speech by the soft switch intelligent speech interaction system can be improved, and the user experience of a client can be improved.

The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.

Drawings

The above and other objects, features and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the present application are illustrated by way of example and not by way of limitation in the figures of the accompanying drawings and in which like reference numerals refer to similar or corresponding parts and in which:

fig. 1 is a flowchart illustrating a method for generating a reply voice according to an embodiment of the present application;

FIG. 2 is a flow chart of another method for generating reply speech according to an embodiment of the present application;

FIG. 3 is a block diagram illustrating components of an apparatus for generating reply speech according to an embodiment of the present application;

fig. 4 is a block diagram illustrating another apparatus for generating a reply voice according to an embodiment of the present application.

Detailed Description

Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

It is to be noted that, unless otherwise specified, technical or scientific terms used herein shall have the ordinary meaning as understood by those skilled in the art to which this application belongs.

An embodiment of the present application provides a method for generating a reply voice, specifically as shown in fig. 1, where the method is applied to a soft switch subsystem, and the method includes:

101. and receiving the voice to be replied.

The voice to be replied is the communication voice sent out by the client in the process of carrying out multiple rounds of conversations with the mobile communication operator.

In the embodiment of the present application, after receiving the call voice (i.e., the voice to be replied) sent by the client, the mobile communication operator sends the voice to be replied to the soft switch subsystem, and at this time, the soft switch subsystem can receive the voice to be replied sent by the mobile communication operator.

102. And judging whether the text content corresponding to the voice to be replied is the target specific word or not based on the target automatic voice recognition module.

The target specific word is any one of a plurality of preset positive words and a plurality of preset negative words, and the plurality of preset positive words may be, but are not limited to: good, right, not problematic, yes, etc., and a plurality of preset negatives may be, but are not limited to: unparallel, misbehaving, having problems, etc.; the target automatic voice recognition module is a functional module integrated in the soft switch subsystem in advance, and is different from the automatic voice recognition module in the intelligent voice subsystem: in order to ensure the accuracy of recognizing the complicated call voice, an automatic voice recognition module in the intelligent voice subsystem performs voice recognition on the call voice based on a DNN-HMM model with a complicated model structure; the target automatic voice recognition module is used for judging whether the text content corresponding to the voice to be replied is a certain preset positive word or a certain preset negative word (namely judging whether the text content corresponding to the voice to be replied is a target specific word), therefore, the target automatic speech recognition module only needs to have the capability of performing speech recognition on the speech to be replied only containing the target specific word, so that the target automatic speech recognition module can perform speech recognition on the speech to be replied based on the acoustic model with simple model structure, because, compared with the speech recognition of the call speech based on the DNN-HMM model with a complex model structure, the speech recognition of the speech to be replied is performed based on the acoustic model with a simple model structure, the calculation amount in the voice recognition process can be effectively reduced, so that the time consumed by voice recognition on the voice to be replied can be effectively reduced.

In the embodiment of the application, after receiving the to-be-replied voice sent by the mobile communication operator, the soft switch subsystem may perform voice recognition on the to-be-replied voice based on the target automatic voice recognition module, and determine whether the text content corresponding to the to-be-replied voice is a certain preset positive word or a certain preset negative word according to the voice recognition result, that is, determine whether the text content corresponding to the to-be-replied voice is a target specific word.

And 103a, if yes, generating a reply voice corresponding to the voice to be replied according to the target specific word, the target natural language understanding module and the target character-to-voice module.

The target natural language understanding module and the target character-to-speech module are functional modules integrated in the soft switch subsystem in advance.

In the embodiment of the application, when the text content corresponding to the to-be-replied voice is determined to be the target specific word based on the target automatic voice recognition module, the soft switch subsystem can generate the reply voice corresponding to the to-be-replied voice according to the target specific word, the target natural language understanding module and the target character to voice conversion module, so that the to-be-replied voice does not need to be sent to the intelligent voice subsystem, and the intelligent voice subsystem generates the reply voice corresponding to the to-be-replied voice.

For the embodiment of the application, step 103b, which is parallel to step 103a, if not, the to-be-replied voice is sent to the intelligent voice subsystem, so that the intelligent voice subsystem generates the reply voice corresponding to the to-be-replied voice.

In this embodiment of the application, when it is determined that the text content corresponding to the to-be-replied voice is not the target specific word based on the target automatic voice recognition module, the soft switch subsystem needs to send the to-be-replied voice to the intelligent voice subsystem, so that the intelligent voice subsystem generates the reply voice corresponding to the to-be-replied voice based on the automatic voice recognition module, the natural language understanding module, the dialogue management module, the natural language generation module, and the text-to-speech module.

The embodiment of the application provides a method for generating reply voice, which can judge whether text content corresponding to the voice to be replied is a target specific word or not by a soft switch subsystem based on a target automatic voice recognition module after the soft switch subsystem receives the voice to be replied sent by a mobile communication operator, generate reply voice corresponding to the voice to be replied according to the target specific word, a target natural language understanding module and a target character-to-voice module when judging that the text content corresponding to the voice to be replied is the target specific word, and send the voice to be replied to an intelligent voice subsystem when judging that the text content corresponding to the voice to be replied is not the target specific word, so that the intelligent voice subsystem generates the reply voice corresponding to the voice to be replied. Because the target automatic speech recognition module, the target natural language understanding module and the target character-to-speech module are functional modules integrated in the soft switch subsystem in advance, and the target automatic speech recognition module performs speech recognition on the speech to be replied which only contains the target specific word based on the acoustic model with a simple model structure, the consumed time is short, therefore, when the speech to be replied is the speech which only contains the target specific word, the soft switch subsystem can quickly generate the reply speech corresponding to the speech to be replied based on the target automatic speech recognition module, the target natural language understanding module and the target character-to-speech module, so that the efficiency of generating the reply speech by the soft switch intelligent speech interaction system can be improved, and the user experience of a client can be improved.

For the purpose of more detailed description, another method for generating a reply voice is provided in the embodiments of the present application, and as shown in fig. 2 in particular, the method is applied to a soft switch subsystem, and includes:

201. and receiving the voice to be replied.

For step 201, the receiving of the to-be-replied voice may refer to the description of the corresponding portion in fig. 1, and the details of the embodiment of the present invention will not be repeated here.

202. And judging whether the text content corresponding to the voice to be replied is the target specific word or not based on the target automatic voice recognition module.

In the embodiment of the application, after receiving the to-be-replied voice sent by the mobile communication operator, the soft switch subsystem may perform voice recognition on the to-be-replied voice based on the target automatic voice recognition module, and determine whether the text content corresponding to the to-be-replied voice is a certain preset positive word or a certain preset negative word according to the voice recognition result, that is, determine whether the text content corresponding to the to-be-replied voice is a target specific word.

Specifically, in this step, the soft switch subsystem may determine whether the text content corresponding to the to-be-replied voice is the target specific word based on the target automatic voice recognition module in the following manner:

the target automatic voice recognition module comprises a preset acoustic model, a preset language model and a preset recognition word network.

(1) Inputting the voice to be replied into a target automatic voice recognition module so that the target automatic voice recognition module performs voice recognition on the voice to be replied based on a preset acoustic model, a preset language model and a preset recognition word network, wherein when the voice to be replied only contains a target specific word, the target automatic voice recognition module performs voice recognition on the voice to be replied based on the preset acoustic model, the preset language model and the preset recognition word network, can convert the voice to be replied into text content (namely the target specific word), and when the voice to be replied does not contain the target specific word or contains the target specific word and other words, the target automatic voice recognition module performs voice recognition on the voice to be replied based on the preset acoustic model, the preset language model and the preset recognition word network, and cannot convert the voice to be replied into the text content;

(2a) when the target automatic speech recognition module outputs a target specific word (namely, the target automatic speech recognition module converts the speech to be replied into text content based on a preset acoustic model, a preset language model and a preset recognition word network), the text content corresponding to the speech to be replied can be determined as the target specific word;

(2b) when the target automatic speech recognition module does not output the target specific word (namely the target automatic speech recognition module cannot convert the speech to be replied into the text content based on the preset acoustic model, the preset language model and the preset recognition word network), determining that the text content corresponding to the speech to be replied is a complex text instead of the target specific word.

Further, in the embodiment of the present application, it is necessary to train a preset acoustic model and a preset language model in advance, and establish a preset recognized word network in advance, where the steps of training the preset acoustic model and the preset language model, and establishing the preset recognized word network are specifically as follows:

(1) obtaining a first training sample set, wherein the first training sample set includes a plurality of first training samples, a plurality of second training samples, and a plurality of third training samples, and the first training samples include: any one preset positive word and the voice corresponding to the preset positive word, wherein the second training sample comprises: any one preset negative word and the voice corresponding to the preset negative word, wherein the third training sample comprises: training texts not containing any preset positive words and any preset negative words and voices corresponding to the training texts; training a first preset model by using a first training sample set until a first preset training stop condition is reached, thereby obtaining a preset acoustic model, wherein the first preset model specifically comprises: the GMM-HMM model, the first preset training stop condition, may be, but is not limited to: the current training round number reaches a first preset round number threshold or the current training duration reaches a first preset duration threshold, where the first preset round number threshold may be, but is not limited to: 10, 20, 30, etc., and the first preset duration threshold may be, but is not limited to: 1 hour, 5 hours, 10 hours, etc.; when the first preset model is trained by using the first training sample set, the first preset model may be trained by using an existing GMM-HMM model training method, which is not described in detail herein.

(2) Acquiring a second training sample set, wherein the second training sample set comprises a plurality of preset positive words, a plurality of preset negative words and a plurality of other words (the words related to the preset positive words or the preset negative words); training a second preset model by using a second training sample set until a second preset training stop condition is reached, thereby obtaining a preset language model, wherein the second preset model specifically comprises: the N-Gram model, the second preset training stop condition may be, but is not limited to: the current training round number reaches a second preset round number threshold or the current training duration reaches a second preset duration threshold, where the second preset round number threshold may be, but is not limited to: 10, 20, 30, etc., and the second preset duration threshold may be, but is not limited to: 1 hour, 5 hours, 10 hours, etc.; when the second preset model is trained by using the second training sample set, the second preset model can be trained by using the existing N-Gram model training method, which is not described in detail herein.

(3) And establishing a preset recognition word network according to the inter-character relationship corresponding to each preset positive word and the inter-character relationship corresponding to each preset negative word, so that when the target automatic voice recognition module performs voice recognition on the voice to be replied based on the preset recognition word network, the inter-character relationship corresponding to the text content obtained by the conversion can be restrained according to the inter-character relationship corresponding to each preset positive word and the inter-character relationship corresponding to each preset negative word, and the accuracy of the target automatic voice recognition module in recognizing the voice to be replied is improved.

It should be noted that, because the meaningless mood assist words do not change the meaning of the target specific word, in order to further improve the accuracy of the target automatic speech recognition module in recognizing the speech to be replied, the preset acoustic model, the preset language model and the preset recognition word network may be optimized and adjusted, so that when the speech to be replied includes the target specific word and the meaningless mood assist words, the target automatic speech recognition module performs speech recognition on the speech to be replied based on the preset acoustic model, the preset language model and the preset recognition word network, and can convert the speech to be replied into text content (i.e., the target specific word).

203a, if yes, generating a reply voice corresponding to the voice to be replied according to the target specific word, the target natural language understanding module and the target character-to-voice module.

In the embodiment of the application, when the text content corresponding to the to-be-replied voice is determined to be the target specific word based on the target automatic voice recognition module, the soft switch subsystem may generate the reply voice corresponding to the to-be-replied voice according to the target specific word, the target natural language understanding module and the target character to voice conversion module.

Specifically, in this step, the soft switch subsystem may generate a reply voice corresponding to the voice to be replied according to the target specific word, the target natural language understanding module, and the target text-to-speech module in the following manner:

the target natural language understanding module comprises a first mapping relation between each preset positive word and the corresponding preset reply text and a second mapping relation between each preset negative word and the corresponding preset reply text; the target text-to-speech module includes a third mapping relationship between each preset reply text and the reply speech corresponding thereto.

(1) Inputting the target specific word into the target natural language understanding module so that the target natural language understanding module outputs a preset reply text corresponding to the target specific word according to the target specific word, the first mapping relation and the second mapping relation, namely when the target specific word is a certain preset positive word, the target natural language understanding module searches the preset reply text corresponding to the preset positive word in the first mapping relation and outputs the searched preset reply text, and when the target specific word is a certain preset negative word, the target natural language understanding module searches the preset reply text corresponding to the preset negative word in the second mapping relation and outputs the searched preset reply text;

(2) and inputting the preset reply text corresponding to the target specific word into the target word-to-speech module, so that the target word-to-speech module outputs the reply speech corresponding to the speech to be replied according to the preset reply text corresponding to the target specific word and the third mapping relation, namely, the target word-to-speech module searches the reply speech (i.e. the reply speech corresponding to the speech to be replied) corresponding to the target preset reply text (i.e. the preset reply text corresponding to the target specific word) in the third mapping relation and outputs the searched reply speech.

For the embodiment of the present application, 203b, which is parallel to step 203a, if not, the to-be-replied voice is sent to the intelligent voice subsystem, so that the intelligent voice subsystem generates the reply voice corresponding to the to-be-replied voice.

In step 203b, if not, the to-be-replied voice is sent to the intelligent voice subsystem, so that the intelligent voice subsystem generates a reply voice corresponding to the to-be-replied voice, which may refer to the description of the corresponding part in fig. 1, and details of the embodiment of the present invention will not be repeated here.

In order to achieve the above object, according to another aspect of the present application, an embodiment of the present application further provides a storage medium, where the storage medium includes a stored program, and when the program runs, a device on which the storage medium is located is controlled to execute the method for generating a reply voice described above.

In order to achieve the above object, according to another aspect of the present application, an embodiment of the present application further provides an apparatus for generating a reply voice, the apparatus including a storage medium; and one or more processors, the storage medium coupled with the processors, the processors configured to execute program instructions stored in the storage medium; the program instructions execute the method for generating the reply voice when running.

Further, as an implementation of the method shown in fig. 1 and fig. 2, another embodiment of the present application further provides an apparatus for generating a reply voice, where the apparatus is applied to a soft switch subsystem. The embodiment of the apparatus corresponds to the embodiment of the method, and for convenience of reading, details in the embodiment of the apparatus are not repeated one by one, but it should be clear that the apparatus in the embodiment can correspondingly implement all the contents in the embodiment of the method. The device is applied to improve the efficiency of generating the reply voice of the soft switch intelligent voice interaction system, so as to improve the user experience of the client, and specifically as shown in fig. 3, the device comprises:

a receiving unit 31, configured to receive a voice to be replied;

a determining unit 32, configured to determine whether a text content corresponding to the to-be-replied voice is a target specific word based on a target automatic voice recognition module, where the target automatic voice recognition module is a functional module integrated in the soft switch subsystem in advance, and the target specific word is any one of a plurality of preset positive words and a plurality of preset negative words;

a generating unit 33, configured to generate a reply voice corresponding to the to-be-replied voice according to the target specific word, a target natural language understanding module and a target text-to-speech module when the determining unit 32 determines that the text content corresponding to the to-be-replied voice is the target specific word, where the target natural language understanding module and the target text-to-speech module are functional modules integrated in the soft switch subsystem in advance;

the sending unit 34 is configured to send the to-be-replied voice to the intelligent voice subsystem when the determining unit 32 determines that the text content corresponding to the to-be-replied voice is not the target specific word, so that the intelligent voice subsystem generates a reply voice corresponding to the to-be-replied voice.

Further, as shown in fig. 4, the target automatic speech recognition module includes a preset acoustic model, a preset language model and a preset recognition word network; the judgment unit 32 includes:

a first input module 321, configured to input the to-be-replied voice into the target automatic voice recognition module, so that the target automatic voice recognition module performs voice recognition on the to-be-replied voice based on the preset acoustic model, the preset language model, and the preset recognition word network;

a first determining module 322, configured to determine, when the target automatic speech recognition module outputs the target specific word, that a text content corresponding to the to-be-replied speech is the target specific word;

a second determining module 323, configured to determine that the text content corresponding to the to-be-replied voice is not the target specific word when the target automatic speech recognition module does not output the target specific word.

Further, as shown in fig. 4, the target natural language understanding module includes a first mapping relationship between each preset positive word and its corresponding preset reply text, and a second mapping relationship between each preset negative word and its corresponding preset reply text, and the target character-to-speech module includes a third mapping relationship between each preset reply text and its corresponding reply speech; the generation unit 33 includes:

the second input module 331 is configured to input the target specific word into the target natural language understanding module, so that the target natural language understanding module outputs a preset reply text corresponding to the target specific word according to the target specific word, the first mapping relationship and the second mapping relationship;

a third input module 332, configured to input the preset reply text corresponding to the target specific word into the target word-to-speech module, so that the target word-to-speech module outputs the reply speech corresponding to the to-be-replied speech according to the preset reply text corresponding to the target specific word and the third mapping relationship.

Further, as shown in fig. 4, the apparatus further includes:

a first obtaining unit 35, configured to obtain a first training sample set before the receiving unit 31 receives the to-be-replied voice, where the first training sample set includes a plurality of first training samples, a plurality of second training samples, and a plurality of third training samples, and the first training sample includes: any one of the preset positive words and the voice corresponding to the preset positive word, wherein the second training sample comprises: any one of the preset negative words and the voice corresponding to the preset negative word, wherein the third training sample comprises: training texts not containing any preset positive words and any preset negative words and voices corresponding to the training texts;

a first training unit 36, configured to train a first preset model using the first training sample set until a first preset training stop condition is reached, so as to obtain the preset acoustic model;

a second obtaining unit 37, configured to obtain a second training sample set, where the second training sample set includes a plurality of the preset positive words, a plurality of the preset negative words, and a plurality of other words, and the other words are words related to the preset positive words or the preset negative words;

a second training unit 38, configured to train a second preset model using the second training sample set until a second preset training stop condition is reached, so as to obtain the preset language model;

the establishing unit 39 is configured to establish the preset recognized word network according to the inter-word relationship corresponding to each preset positive word and the inter-word relationship corresponding to each preset negative word.

Further, as shown in fig. 4, the first preset model specifically includes: the GMM-HMM model specifically comprises the following second preset model: N-Gram model.

The embodiment of the application provides a method and a device for generating reply voice, and the method and the device can judge whether text content corresponding to the voice to be replied is a target specific word or not by a soft switch subsystem based on a target automatic voice recognition module after the soft switch subsystem receives the voice to be replied sent by a mobile communication operator, generate reply voice corresponding to the voice to be replied according to the target specific word, a target natural language understanding module and a target character-to-voice module when judging that the text content corresponding to the voice to be replied is the target specific word, and send the voice to be replied to an intelligent voice subsystem when judging that the text content corresponding to the voice to be replied is not the target specific word, so that the intelligent voice subsystem generates the reply voice corresponding to the voice to be replied. Because the target automatic speech recognition module, the target natural language understanding module and the target character-to-speech module are functional modules integrated in the soft switch subsystem in advance, and the target automatic speech recognition module performs speech recognition on the speech to be replied which only contains the target specific word based on the acoustic model with a simple model structure, the consumed time is short, therefore, when the speech to be replied is the speech which only contains the target specific word, the soft switch subsystem can quickly generate the reply speech corresponding to the speech to be replied based on the target automatic speech recognition module, the target natural language understanding module and the target character-to-speech module, so that the efficiency of generating the reply speech by the soft switch intelligent speech interaction system can be improved, and the user experience of a client can be improved.

The device for generating the reply voice comprises a processor and a memory, wherein the receiving unit, the judging unit, the generating unit, the sending unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.

The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the efficiency of generating the reply voice by the soft switch intelligent voice interaction system is improved by adjusting the kernel parameters, so that the user experience of a client is improved.

The embodiment of the application provides a storage medium, the storage medium comprises a stored program, and when the program runs, the device where the storage medium is located is controlled to execute the method for generating the reply voice.

The storage medium may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.

The embodiment of the application also provides a device for generating the reply voice, which comprises a storage medium; and one or more processors, the storage medium coupled with the processors, the processors configured to execute program instructions stored in the storage medium; the program instructions execute the method for generating the reply voice when running.

The embodiment of the application provides equipment, the equipment comprises a processor, a memory and a program which is stored on the memory and can run on the processor, and the following steps are realized when the processor executes the program:

receiving a voice to be replied;

judging whether the text content corresponding to the voice to be replied is a target specific word or not based on a target automatic voice recognition module, wherein the target automatic voice recognition module is a functional module integrated in the soft switch subsystem in advance, and the target specific word is any one of a plurality of preset positive words and a plurality of preset negative words;

if so, generating a reply voice corresponding to the voice to be replied according to the target specific word, a target natural language understanding module and a target character-to-voice module, wherein the target natural language understanding module and the target character-to-voice module are functional modules integrated in the soft switch subsystem in advance;

if not, the to-be-replied voice is sent to an intelligent voice subsystem, so that the intelligent voice subsystem generates a reply voice corresponding to the to-be-replied voice.

Further, the target automatic voice recognition module comprises a preset acoustic model, a preset language model and a preset recognition word network; the method for judging whether the text content corresponding to the to-be-replied voice is the target specific word or not based on the target automatic voice recognition module comprises the following steps:

inputting the voice to be replied into the target automatic voice recognition module so that the target automatic voice recognition module carries out voice recognition on the voice to be replied based on the preset acoustic model, the preset language model and the preset recognition word network;

if the target automatic voice recognition module outputs the target specific word, determining the text content corresponding to the voice to be replied as the target specific word;

and if the target automatic voice recognition module does not output the target specific word, determining that the text content corresponding to the voice to be replied is not the target specific word.

Further, the target natural language understanding module includes a first mapping relationship between each preset positive word and a corresponding preset reply text thereof, and a second mapping relationship between each preset negative word and a corresponding preset reply text thereof, and the target character-to-speech module includes a third mapping relationship between each preset reply text and a corresponding reply speech thereof; generating a reply voice corresponding to the voice to be replied according to the target specific word, the target natural language understanding module and the target character-to-voice module, wherein the method comprises the following steps:

inputting the target specific word into the target natural language understanding module so that the target natural language understanding module outputs a preset reply text corresponding to the target specific word according to the target specific word, the first mapping relation and the second mapping relation;

and inputting the preset reply text corresponding to the target specific word into the target word-to-speech module, so that the target word-to-speech module outputs the reply speech corresponding to the speech to be replied according to the preset reply text corresponding to the target specific word and the third mapping relation.

Further, before the receiving the voice to be replied, the method further includes:

obtaining a first training sample set, wherein the first training sample set includes a plurality of first training samples, a plurality of second training samples, and a plurality of third training samples, and the first training samples include: any one of the preset positive words and the voice corresponding to the preset positive word, wherein the second training sample comprises: any one of the preset negative words and the voice corresponding to the preset negative word, wherein the third training sample comprises: training texts not containing any preset positive words and any preset negative words and voices corresponding to the training texts;

training a first preset model by using the first training sample set until a first preset training stop condition is reached to obtain the preset acoustic model;

acquiring a second training sample set, wherein the second training sample set comprises a plurality of preset positive words, a plurality of preset negative words and a plurality of other words, and the other words are words related to the preset positive words or the preset negative words;

training a second preset model by using the second training sample set until a second preset training stop condition is reached to obtain the preset language model;

and establishing the preset recognition word network according to the inter-word relationship corresponding to each preset positive word and the inter-word relationship corresponding to each preset negative word.

Further, the first preset model specifically includes: the GMM-HMM model specifically comprises the following second preset model: N-Gram model.

The present application further provides a computer program product adapted to perform program code for initializing the following method steps when executed on a data processing device: receiving a voice to be replied; judging whether the text content corresponding to the voice to be replied is a target specific word or not based on a target automatic voice recognition module, wherein the target automatic voice recognition module is a functional module integrated in the soft switch subsystem in advance, and the target specific word is any one of a plurality of preset positive words and a plurality of preset negative words; if so, generating a reply voice corresponding to the voice to be replied according to the target specific word, a target natural language understanding module and a target character-to-voice module, wherein the target natural language understanding module and the target character-to-voice module are functional modules integrated in the soft switch subsystem in advance; if not, the to-be-replied voice is sent to an intelligent voice subsystem, so that the intelligent voice subsystem generates a reply voice corresponding to the to-be-replied voice.

As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.

Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.

It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.

As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:自定义命令词的识别方法、装置和计算机设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!