CN112002313B - Interaction method and device, sound box, electronic equipment and storage medium - Google Patents
Interaction method and device, sound box, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN112002313B CN112002313B CN201910384519.7A CN201910384519A CN112002313B CN 112002313 B CN112002313 B CN 112002313B CN 201910384519 A CN201910384519 A CN 201910384519A CN 112002313 B CN112002313 B CN 112002313B
- Authority
- CN
- China
- Prior art keywords
- vector
- input information
- user input
- template
- matching template
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 230000003993 interaction Effects 0.000 title claims abstract description 106
- 238000000034 method Methods 0.000 title claims abstract description 66
- 238000003860 storage Methods 0.000 title claims abstract description 22
- 239000013598 vector Substances 0.000 claims abstract description 478
- 238000012545 processing Methods 0.000 claims description 55
- 230000009467 reduction Effects 0.000 claims description 46
- 230000007246 mechanism Effects 0.000 claims description 15
- 238000013136 deep learning model Methods 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 11
- 238000010606 normalization Methods 0.000 claims description 9
- 230000002452 interceptive effect Effects 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 28
- 238000005516 engineering process Methods 0.000 description 13
- 238000004891 communication Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 9
- 230000003287 optical effect Effects 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 238000013528 artificial neural network Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 238000003062 neural network model Methods 0.000 description 2
- 230000001902 propagating effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- RYGMFSIKBFXOCR-UHFFFAOYSA-N Copper Chemical compound [Cu] RYGMFSIKBFXOCR-UHFFFAOYSA-N 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000004140 cleaning Methods 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 229910052802 copper Inorganic materials 0.000 description 1
- 239000010949 copper Substances 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L15/00—Speech recognition
- G10L15/06—Creation of reference templates; Training of speech recognition systems, e.g. adaptation to the characteristics of the speaker's voice
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L15/00—Speech recognition
- G10L15/22—Procedures used during a speech recognition process, e.g. man-machine dialogue
-
- G—PHYSICS
- G10—MUSICAL INSTRUMENTS; ACOUSTICS
- G10L—SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G10L15/00—Speech recognition
- G10L15/26—Speech to text systems
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Acoustics & Sound (AREA)
- Human Computer Interaction (AREA)
- Multimedia (AREA)
- Artificial Intelligence (AREA)
- Theoretical Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The disclosure relates to an interaction method and apparatus, a sound box, an electronic device, and a storage medium. The method comprises the following steps: receiving user input information; determining a semantic vector corresponding to the user input information; determining a matching template vector corresponding to the user input information, wherein the matching template vector represents a vector of a template matched with the user input information, and the template matched with the user input information at least comprises a preset basic template; determining a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector; and outputting an interaction result corresponding to the user input information at least based on the semantic vector and the matching template statistical vector. The method and the device can improve the accuracy of the result returned to the user in the interaction.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an interaction method and apparatus, a sound box, an electronic device, and a storage medium.
Background
Voice interaction is an interactive mode based on voice input. Unlike the traditional human-computer interaction at the mobile end and the PC (personal computer), the voice interaction system is a system that mainly performs input in a voice manner in human-computer interaction.
In the related art, a method of searching for a matching algorithm and a neural network model is generally adopted, whether the voice input by a user is hit is judged through the searching for the matching algorithm, if the voice input by the user is hit, a searching for a matching result is adopted, and otherwise, a processing result of the neural network model is adopted. In this manner, if the search matching algorithm erroneously hits the user-entered speech, an error is caused, wherein a common cause is dirty data.
For example, a sentence of a certain template in the video domain is @ { video _ title } of "@ { artist }", and a sentence of a certain template in the music domain is a song of "@ { artist }". If the entity set @ artist comprises the entity swordsman, the entity set @ video title comprises the entity song, and the voice input by the user is the song of the swordsman, the voice input by the user hits the two templates at the same time, so that conflict occurs.
For another example, a sentence pattern of a certain template in the music field is "@ { artist } @ { song }", an entity set @ { artist } contains an entity "weenlege", and an entity set @ { song } contains an entity "who" is ", and if a voice input by a user is" who is weenlege ", the template is hit. However, in practice the semantics of this sentence are the query for the relevant encyclopedia of Wednjie.
With the increase of fields and templates, the difficulty and complexity of maintaining the templates and cleaning dirty data are greatly increased.
How to improve the accuracy of the result returned to the user in the interaction is a problem to be solved urgently.
Disclosure of Invention
The present disclosure provides an interaction technical solution.
According to an aspect of the present disclosure, there is provided an interaction method, including:
receiving user input information;
determining a semantic vector corresponding to the user input information;
determining a matching template vector corresponding to the user input information, wherein the matching template vector represents a vector of a template matched with the user input information, and the template matched with the user input information at least comprises a preset basic template;
determining a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector;
and outputting an interaction result corresponding to the user input information at least based on the semantic vector and the matching template statistical vector.
In a possible implementation manner, the determining a matching template vector corresponding to the user input information includes:
and respectively determining the vector of each basic template as a matching template vector corresponding to the user input information.
In a possible implementation manner, the determining a matching template vector corresponding to the user input information includes:
if the user input information conforms to the sentence pattern of any non-basic template, determining the vector of the non-basic template as a matching template vector corresponding to the user input information; wherein, the user input information conforms to any sentence pattern of the non-basic template, including: the user input information includes entities of the set of entities in the sentence of the non-base template.
In one possible implementation manner, the determining, based on the matching template vector and the semantic vector, a matching template statistical vector corresponding to the user input information includes:
and processing the matching template vector and the semantic vector based on an attention mechanism to obtain a matching template statistical vector corresponding to the user input information.
In a possible implementation manner, the processing the matching template vector and the semantic vector based on the attention mechanism to obtain a matching template statistical vector corresponding to the user input information includes:
determining the weight of the matching template vector according to the similarity of the matching template vector and the semantic vector;
and weighting the matching template vector based on the weight of the matching template vector to obtain a matching template statistical vector corresponding to the user input information.
In a possible implementation manner, the determining the weight of the matching template vector according to the similarity between the matching template vector and the semantic vector includes:
and carrying out normalization processing on the similarity of the matching template vector and the semantic vector to obtain the weight of the matching template vector.
In one possible implementation manner, the outputting an interaction result corresponding to the user input information based on at least the semantic vector and the matching template statistical vector includes:
performing connection processing on the semantic vector and the matching template statistical vector to obtain a connection vector;
and outputting an interaction result corresponding to the user input information based on the connection vector.
In a possible implementation manner, the outputting an interaction result corresponding to the user input information based on the connection vector includes:
performing linear dimensionality reduction on the connecting vector to obtain a dimensionality reduction vector, wherein the dimensionality of the dimensionality reduction vector is the same as the classification number;
and inputting the dimension reduction vector into a softmax layer, and outputting an interaction result corresponding to the user input information through the softmax layer.
In one possible implementation, the user input information is voice input by a user.
According to another aspect of the present disclosure, there is provided an interaction method including:
receiving user input information;
determining a semantic vector corresponding to the user input information through a deep learning model;
determining a matching template vector corresponding to the user input information by searching a matching model, wherein the matching template vector represents a vector of a template matched with the user input information, and the template matched with the user input information at least comprises a preset basic template;
processing the matching template vector and the semantic vector based on an attention mechanism to obtain a matching template statistical vector corresponding to the user input information;
and outputting an interaction result corresponding to the user input information at least based on the semantic vector and the matching template statistical vector.
In a possible implementation manner, the determining, by searching a matching model, a matching template vector corresponding to the user input information includes:
and respectively determining the vector of each basic template as a matching template vector corresponding to the user input information.
In one possible implementation manner, the determining, by searching a matching model, a matching template vector corresponding to the user input information includes:
if the user input information conforms to the sentence pattern of any non-basic template, determining the vector of the non-basic template as a matching template vector corresponding to the user input information; wherein, the user input information conforms to any sentence pattern of the non-basic template, including: the user input information includes entities of the set of entities in the sentence of the non-base template.
In a possible implementation manner, the processing the matching template vector and the semantic vector based on the attention mechanism to obtain a matching template statistical vector corresponding to the user input information includes:
determining the weight of the matching template vector according to the similarity of the matching template vector and the semantic vector;
and weighting the matching template vector based on the weight of the matching template vector to obtain a matching template statistical vector corresponding to the user input information.
In a possible implementation manner, the determining the weight of the matching template vector according to the similarity between the matching template vector and the semantic vector includes:
and carrying out normalization processing on the similarity of the matching template vector and the semantic vector to obtain the weight of the matching template vector.
In one possible implementation manner, the outputting an interaction result corresponding to the user input information based on at least the semantic vector and the matching template statistical vector includes:
performing connection processing on the semantic vector and the matching template statistical vector to obtain a connection vector;
and outputting an interaction result corresponding to the user input information based on the connection vector.
In a possible implementation manner, the outputting an interaction result corresponding to the user input information based on the connection vector includes:
performing linear dimensionality reduction on the connecting vector to obtain a dimensionality reduction vector, wherein the dimensionality of the dimensionality reduction vector is the same as the classification number;
and inputting the dimension reduction vector into a softmax layer, and outputting an interaction result corresponding to the user input information through the softmax layer.
In one possible implementation, the user input information is voice input by a user.
According to another aspect of the present disclosure, there is provided an interaction apparatus including:
the receiving module is used for receiving user input information;
the first determining module is used for determining a semantic vector corresponding to the user input information;
a second determining module, configured to determine a matching template vector corresponding to the user input information, where the matching template vector represents a vector of a template matching the user input information, and the template matching the user input information at least includes a preset basic template;
a third determining module, configured to determine a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector;
and the output module is used for outputting an interaction result corresponding to the user input information at least based on the semantic vector and the matching template statistical vector.
In one possible implementation manner, the second determining module is configured to:
and respectively determining the vector of each basic template as a matching template vector corresponding to the user input information.
In one possible implementation manner, the second determining module is configured to:
if the user input information conforms to the sentence pattern of any non-basic template, determining the vector of the non-basic template as a matching template vector corresponding to the user input information; wherein, the user input information conforms to any sentence pattern of the non-basic template, including: the user input information includes entities of the set of entities in the sentence of the non-base template.
In one possible implementation manner, the third determining module is configured to:
and processing the matching template vector and the semantic vector based on an attention mechanism to obtain a matching template statistical vector corresponding to the user input information.
In one possible implementation manner, the third determining module is configured to:
determining the weight of the matching template vector according to the similarity of the matching template vector and the semantic vector;
and weighting the matching template vector based on the weight of the matching template vector to obtain a matching template statistical vector corresponding to the user input information.
In one possible implementation manner, the third determining module is configured to:
and carrying out normalization processing on the similarity of the matching template vector and the semantic vector to obtain the weight of the matching template vector.
In one possible implementation, the output module is configured to:
performing connection processing on the semantic vector and the matching template statistical vector to obtain a connection vector;
and outputting an interaction result corresponding to the user input information based on the connection vector.
In one possible implementation, the output module is configured to:
performing linear dimensionality reduction on the connecting vector to obtain a dimensionality reduction vector, wherein the dimensionality of the dimensionality reduction vector is the same as the classification number;
and inputting the dimension reduction vector into a softmax layer, and outputting an interaction result corresponding to the user input information through the softmax layer.
In one possible implementation, the user input information is voice input by a user.
According to another aspect of the present disclosure, there is provided an acoustic enclosure comprising:
the receiving module is used for receiving user input information;
the first determining module is used for determining a semantic vector corresponding to the user input information;
a second determining module, configured to determine a matching template vector corresponding to the user input information, where the matching template vector represents a vector of a template that matches the user input information, and the template that matches the user input information at least includes a preset basic template;
a third determining module, configured to determine a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector;
and the output module is used for outputting an interaction result corresponding to the user input information at least based on the semantic vector and the matching template statistical vector.
In one possible implementation manner, the second determining module is configured to:
and respectively determining the vector of each basic template as a matching template vector corresponding to the user input information.
In one possible implementation manner, the second determining module is configured to:
if the user input information conforms to the sentence pattern of any non-basic template, determining the vector of the non-basic template as a matching template vector corresponding to the user input information; wherein, the user input information conforms to any sentence pattern of the non-basic template, including: the user input information includes entities of the set of entities in the sentence of the non-base template.
In one possible implementation manner, the third determining module is configured to:
and processing the matching template vector and the semantic vector based on an attention mechanism to obtain a matching template statistical vector corresponding to the user input information.
In one possible implementation manner, the third determining module is configured to:
determining the weight of the matching template vector according to the similarity of the matching template vector and the semantic vector;
and weighting the matching template vector based on the weight of the matching template vector to obtain a matching template statistical vector corresponding to the user input information.
In one possible implementation manner, the third determining module is configured to:
and carrying out normalization processing on the similarity of the matching template vector and the semantic vector to obtain the weight of the matching template vector.
In one possible implementation, the output module is configured to:
performing connection processing on the semantic vector and the matching template statistical vector to obtain a connection vector;
and outputting an interaction result corresponding to the user input information based on the connection vector.
In one possible implementation, the output module is configured to:
performing linear dimensionality reduction on the connecting vector to obtain a dimensionality reduction vector, wherein the dimensionality of the dimensionality reduction vector is the same as the classification number;
and inputting the dimensionality reduction vector into a softmax layer, and outputting an interaction result corresponding to the user input information through the softmax layer.
In one possible implementation, the user input information is voice input by a user.
According to another aspect of the present disclosure, there is provided an electronic device including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the memory-stored instructions to perform the above-described interaction method.
According to another aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described interaction method.
In the embodiment of the disclosure, by receiving user input information, determining a semantic vector corresponding to the user input information, and determining a matching template vector corresponding to the user input information, wherein a template matched with the user input information at least includes a preset basic template, determining a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector, and outputting an interaction result corresponding to the user input information based on the semantic vector and the matching template statistical vector, the influence of dirty data on the interaction can be reduced, and the accuracy of a result returned to a user can be improved in the interaction.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 shows a flow chart of an interaction method according to an embodiment of the present disclosure.
Fig. 2 illustrates a schematic diagram of a template matched with user input information in an interaction method according to an embodiment of the present disclosure.
Fig. 3 shows a schematic diagram of an interaction method according to an embodiment of the present disclosure.
Fig. 4 shows a schematic diagram of an interaction method according to an embodiment of the present disclosure.
Fig. 5 shows a schematic diagram of a dialog system performing an interaction method according to an embodiment of the present disclosure.
Fig. 6 shows a flow diagram of another interaction method according to an embodiment of the present disclosure.
Fig. 7 shows a block diagram of an interaction device according to an embodiment of the present disclosure.
Fig. 8 shows a block diagram of an acoustic enclosure according to an embodiment of the present disclosure.
Fig. 9 illustrates a block diagram of an electronic device 800 in accordance with an embodiment of the disclosure.
Fig. 10 shows a block diagram of an electronic device 1900 according to an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of a, B, and C, and may mean including any one or more elements selected from the group consisting of a, B, and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the subject matter of the present disclosure.
Fig. 1 shows a flow chart of an interaction method according to an embodiment of the present disclosure. The execution subject of the interactive method may be an interactive device. For example, the interaction method may be performed by a terminal device or a server or other processing device. The terminal device may be a User Equipment (UE), a mobile device, a User terminal, a sound box, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, or a wearable device. In some possible implementations, the interaction method may be implemented by a processor invoking computer readable instructions stored in a memory. As shown in fig. 1, the interactive method includes steps S11 to S15.
In step S11, user input information is received.
In the disclosed embodiment, the user input information may be voice, text or other information input by the user.
In one possible implementation, the user input information is speech input by the user. For example, in an application scenario of voice interaction, the user input information may be voice input by the user.
In step S12, a semantic vector corresponding to the user input information is determined.
In one possible implementation, if the user input information is voice input by the user, ASR (Automatic Speech Recognition) technology may be used to convert the user input information into text. The text obtained by conversion can be input into the deep learning model, and a semantic vector corresponding to the user input information is output through the deep learning model. In this implementation, the deep learning model may be an NLU (Natural Language Understanding) based technology, where the NLU technology may be any technology capable of Understanding information such as semantics and intention of human Natural Language. In this implementation, the deep learning model may be an RNN (Recurrent Neural Network), a TextCNN (Convolutional Neural Network for text classification), a model based on a Transformer structure, or the like, which is not limited in this embodiment of the disclosure.
In another possible implementation manner, if the user input information is a text input by the user, the user input information may be directly input into the deep learning model, and the semantic vector corresponding to the user input information is output through the deep learning model.
In step S13, a matching template vector corresponding to the user input information is determined, where the matching template vector represents a vector of a template matching the user input information, and the template matching the user input information at least includes a preset basic template.
The matching template corresponding to the user input information represents a template matched with the user input information.
In one possible implementation, a matching template vector corresponding to the user input information may be determined by searching a matching model.
In the embodiment of the present disclosure, if the user input information is the voice input by the user, ASR technology may be adopted to convert the user input information into a text, and then a template matching the text obtained by conversion is determined; if the user input information is the text input by the user, the template matched with the user input information can be directly determined.
In embodiments of the present disclosure, the templates include a base template and a non-base template. The template that matches the user-entered information may include at least a base template and possibly a non-base template.
Fig. 2 illustrates a schematic diagram of a template matched with user input information in an interaction method according to an embodiment of the present disclosure. In FIG. 2, m base Denotes a basic form, m u Representing non-base templates, the templates matching the user input information include base template 1, base template 2, base template 3, and non-base template 6.
In one possible implementation, determining a matching template vector corresponding to the user input information includes: and respectively determining the vectors of all the basic templates as matching template vectors corresponding to the input information of the user. In this implementation, all the basic templates are used as templates matched with the user input information, that is, vectors of all the basic templates are used as matching template vectors corresponding to the user input information. For example, in the example shown in fig. 2, the base template includes base template 1, base template 2, and base template 3, and then vectors of base template 1, base template 2, and base template 3 are respectively determined as matching template vectors corresponding to the user input information.
In another possible implementation manner, determining a matching template vector corresponding to the user input information includes: if the user input information conforms to the sentence pattern of any non-basic template, determining the vector of the non-basic template as a matching template vector corresponding to the user input information; wherein, the user input information accords with the sentence pattern of any non-basic template, and comprises the following steps: the user input information contains entities of the set of entities in the sentence of the non-base template.
For example, the period of non-base template 1 is @ { song } of "@ { artist }", where @ { artist } represents the collection of entities of the artist and @ { song } represents the collection of entities of the song. For example, if the user input information is "i want to listen to celadon in zhou lungje", if the entity set @ { artist } contains the entity "zhou lungje", and the entity set @ { song } contains the entity "celadon", it may be determined that the user input information contains the entity set in the sentence pattern of the non-base template 1, and thus it may be determined that the user input information conforms to the sentence pattern of the non-base template 1. For another example, if the user input information is "success of three Zhao", if the entity set @ { artist } includes the entity "three Zhao", and the entity set @ { song } includes the entity "success", it may be determined that the user input information includes the entity set in the sentence pattern of the non-basic template 1, and thus it may be determined that the user input information conforms to the sentence pattern of the non-basic template 1.
In embodiments of the present disclosure, a set of entities may represent a set of entities of the same attribute. For example, the entities in the entity set @ artist are artists, and the entities in the entity set @ song are songs.
In step S14, a matching template statistical vector corresponding to the user input information is determined based on the matching template vector and the semantic vector.
In one possible implementation manner, determining a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector includes: and processing the matching template vector and the semantic vector based on an attention mechanism to obtain a matching template statistical vector corresponding to the user input information.
In a possible implementation manner, processing the matching template vector and the semantic vector based on an attention mechanism to obtain a matching template statistical vector corresponding to the user input information includes: determining the weight of the matching template vector according to the similarity of the matching template vector and the semantic vector; and weighting the matched template vector based on the weight of the matched template vector to obtain a matched template statistical vector corresponding to the user input information.
In fig. 2, the semantic vector vsentric corresponding to the vector of the template and the user input information is indicated by a line segment with an arrow. In the example shown in fig. 2, the vectors of the base template 1, the base template 2, the base template 3 and the non-base template 6 have a similarity of 0.1, 0.7, 0.1 and 0.1, respectively, to the semantic vector vsentric. For example, matching template statistics vector Vmemory = w 1 ×m base1 +w 2 ×m base2 +w 3 ×m base3 +w 6 ×m u6 . Wherein w 1 Shows a base form 1 (m) base1 ) Weight of (1), w 2 Represents the basic form 2 (m) base2 ) Weight of (b), w 3 Indicates the basic form 3 (m) base3 ) Weight of (1), w 6 Represents a non-basic template 6 (m) u6 ) The weight of (c).
In one possible implementation manner, determining the weight of the matching template vector according to the similarity between the matching template vector and the semantic vector includes: and carrying out normalization processing on the similarity of the matching template vector and the semantic vector to obtain the weight of the matching template vector. For example, the templates that match the user input information include the base template 1, the base template 2, the base template 3, and the non-base template 6, i.e., the matching template vector includes the vector of the base template 1, the vector of the base template 2, the vector of the base template 3, and the vector of the non-base template 6. Wherein, the similarity between the vector of the basic template 1 and the semantic vector is s 1 The similarity between the vector of the basic template 2 and the semantic vector is s 2 The similarity between the vector of the basic template 3 and the semantic vector is s 3 The similarity between the vector of the non-basic template 6 and the semantic vector is s 6 Then the sum of similarity of the matching template vector and the semantic vector is s a =s 1 +s 2 +s 3 +s 6 . Weight w of the base template 1 1 =s 1 /s a Weight w of the base template 2 2 =s 2 /s a Weight w of the base template 3 3 =s 3 /s a Weight w of non-basic template 6 6 =s 6 /s a 。
In the embodiment of the disclosure, because the basic template is added to calculate the statistical vector of the matching template, the influence of dirty data can be reduced, and even if the dirty data is hit by searching and matching, a more accurate interaction result can be obtained.
In step S15, an interaction result corresponding to the user input information is output based on at least the semantic vector and the matching template statistical vector.
In the disclosed embodiment, the semantic vector and the matching template statistical vector are combined to respond to the user.
In one possible implementation, outputting an interaction result corresponding to the user input information based on at least the semantic vector and the matching template statistical vector includes: performing connection processing on the semantic vector and the statistical vector of the matching template to obtain a connection vector; and outputting an interaction result corresponding to the user input information based on the connection vector. In this implementation, the join process may refer to a coordinate process.
In one possible implementation manner, outputting an interaction result corresponding to the user input information based on the connection vector includes: performing linear dimensionality reduction on the connecting vector to obtain a dimensionality reduction vector, wherein the dimensionality of the dimensionality reduction vector is the same as the classification number; and inputting the dimension reduction vector into the softmax layer, and outputting an interaction result corresponding to the user input information through the softmax layer.
In another possible implementation manner, outputting an interaction result corresponding to the user input information based on the semantic vector and the matching template statistical vector includes: adding the semantic vector and the statistical vector of the matching template to obtain a sum vector of the semantic vector and the statistical vector of the matching template; and outputting an interaction result corresponding to the user input information based on the sum vector. For example, performing linear dimensionality reduction on the sum vector to obtain a dimensionality reduction vector, wherein the dimensionality of the dimensionality reduction vector is the same as the classification number; and inputting the dimension reduction vector into the softmax layer, and outputting an interaction result corresponding to the user input information through the softmax layer.
In another possible implementation manner, outputting an interaction result corresponding to the user input information based on the semantic vector and the matching template statistical vector includes: multiplying the semantic vector by the statistical vector of the matching template to obtain a product vector of the semantic vector and the statistical vector of the matching template; and outputting an interaction result corresponding to the user input information based on the product vector. For example, performing linear dimensionality reduction on the product vector to obtain a dimensionality reduction vector, wherein the dimensionality of the dimensionality reduction vector is the same as the classification number; and inputting the dimension reduction vector into the softmax layer, and outputting an interaction result corresponding to the user input information through the softmax layer.
Fig. 3 shows a schematic diagram of an interaction method according to an embodiment of the present disclosure. In the example shown in fig. 3, the user input information is "celadon of zhorenjie". And searching and matching in the memory module, and determining a template matched with the information input by the user. In fig. 3, the templates matching the user input information include all basic templates and 3 non-basic templates. And processing the matching template vector and the semantic vector Vsemail based on an Attention mechanism to obtain a matching template statistical vector Vmemory corresponding to the user input information. The semantic vector Vsemantic with the same dimension as the statistical vector Vmemory of the matching template can be obtained through deep learning model (such as neural network) of the user input information, connection (linkage) processing and linear dimension reduction. Connecting the semantic vector Vsemail and the statistical vector Vmemory of the matching template to obtain a connecting vector; and performing linear reduction and softmax regression on the connection vector to obtain an interaction result.
In the embodiment of the disclosure, by receiving user input information, determining a semantic vector corresponding to the user input information, and determining a matching template vector corresponding to the user input information, wherein a template matching the user input information at least includes a preset basic template, determining a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector, and outputting an interaction result corresponding to the user input information based on the semantic vector and the matching template statistical vector, the influence of dirty data on the interaction can be reduced, and the accuracy of a result returned to a user in the interaction can be improved.
The interaction method provided by the embodiment of the disclosure can be modeled based on a Memory Network (Memory-Network), different templates (a basic template and a non-basic template) are used as Memory (Memory) modules, and the Memory modules provide characteristics for a neural Network (Network) module. By adopting the embodiment of the disclosure, a more accurate interaction result can still be obtained when the memory module contains noise.
Fig. 4 shows a schematic diagram of an interaction method according to an embodiment of the present disclosure. As shown in fig. 4, the interaction method provided by the embodiment of the present disclosure provides an end-to-end scheme, and changes a serial structure in the related art into a parallel and single structure, thereby reducing the maintenance difficulty.
In one possible implementation, the interaction method provided by the embodiment of the present disclosure may be implemented by a dialog system. Fig. 5 shows a schematic diagram of a dialog system performing an interaction method according to an embodiment of the present disclosure. As shown in fig. 5, after receiving the input user input information, if the user input information is voice input by the user, the ASR technology is adopted to convert the user input information into text; obtaining a semantic vector based on the text obtained by conversion by adopting a natural speech understanding technology; the service is executed again (i.e. steps S13 to S15 are executed), and a service reply (i.e. an interaction result) is obtained.
Fig. 6 shows a flow diagram of another interaction method according to an embodiment of the present disclosure. As shown in fig. 6, the method may include steps S21 to S25.
In step S21, user input information is received.
In one possible implementation, the user input information is speech input by the user.
In step S22, a semantic vector corresponding to the user input information is determined by the deep learning model.
In the embodiment of the present disclosure, the deep learning model may be RNN, textCNN, or a model based on a transform structure, and the like, which is not limited in the embodiment of the present disclosure.
In step S23, a matching template vector corresponding to the user input information is determined by searching the matching model, where the matching template vector represents a vector of templates matching the user input information, and the templates matching the user input information at least include a preset basic template.
In one possible implementation, determining a matching template vector corresponding to the user input information by searching the matching model includes: and respectively determining the vectors of all the basic templates as matching template vectors corresponding to the input information of the user.
In one possible implementation, determining a matching template vector corresponding to the user input information by searching the matching model includes: if the user input information conforms to the sentence pattern of any non-basic template, determining the vector of the non-basic template as a matching template vector corresponding to the user input information; wherein, the user input information accords with any sentence pattern of the non-basic template, including: the user input information contains entities of the set of entities in the sentence of the non-base template.
In step S24, the matching template vector and the semantic vector are processed based on the attention mechanism, and a matching template statistical vector corresponding to the user input information is obtained.
In a possible implementation manner, processing the matching template vector and the semantic vector based on an attention mechanism to obtain a matching template statistical vector corresponding to the user input information includes: determining the weight of the matching template vector according to the similarity of the matching template vector and the semantic vector; and weighting the matched template vector based on the weight of the matched template vector to obtain a matched template statistical vector corresponding to the user input information.
In one possible implementation manner, determining the weight of the matching template vector according to the similarity between the matching template vector and the semantic vector includes: and carrying out normalization processing on the similarity of the matching template vector and the semantic vector to obtain the weight of the matching template vector.
In step S25, an interaction result corresponding to the user input information is output based on at least the semantic vector and the matching template statistical vector.
In one possible implementation, outputting an interaction result corresponding to the user input information based on at least the semantic vector and the matching template statistical vector includes: performing connection processing on the semantic vector and the statistical vector of the matching template to obtain a connection vector; and outputting an interaction result corresponding to the input information of the user based on the connection vector.
In one possible implementation manner, outputting an interaction result corresponding to the user input information based on the connection vector includes: carrying out linear dimensionality reduction on the connecting vectors to obtain dimensionality reduction vectors, wherein the dimensionalities of the dimensionality reduction vectors are the same as the classification number; and inputting the dimension reduction vector into the softmax layer, and outputting an interaction result corresponding to the user input information through the softmax layer.
In the embodiment of the disclosure, by receiving user input information, determining a semantic vector corresponding to the user input information through a deep learning model, and determining a matching template vector corresponding to the user input information through searching a matching model, wherein a template matching the user input information at least comprises a preset basic template, determining a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector, and outputting an interaction result corresponding to the user input information based on the semantic vector and the matching template statistical vector, the influence of dirty data on the interaction can be reduced, so that the accuracy of a result returned to a user in the interaction can be improved.
It is understood that the above-mentioned embodiments of the method of the present disclosure can be combined with each other to form a combined embodiment without departing from the principle logic, which is limited by the space, and the detailed description of the present disclosure is omitted.
It will be understood by those of skill in the art that in the above method of the present embodiment, the order of writing the steps does not imply a strict order of execution and does not impose any limitations on the implementation, as the order of execution of the steps should be determined by their function and possibly inherent logic.
In addition, the present disclosure also provides an interaction device, a sound box, an electronic device, a computer-readable storage medium, and a program, which can be used to implement any one of the interaction methods provided by the present disclosure, and the corresponding technical solutions and descriptions and corresponding descriptions in the method sections are not repeated.
Fig. 7 shows a block diagram of an interaction device according to an embodiment of the present disclosure, which, as shown in fig. 7, includes: a receiving module 31, configured to receive user input information; a first determining module 32, configured to determine a semantic vector corresponding to the user input information; the second determining module 33 is configured to determine a matching template vector corresponding to the user input information, where the matching template vector represents a vector of a template matching the user input information, and the template matching the user input information at least includes a preset basic template; a third determining module 34, configured to determine, based on the matching template vector and the semantic vector, a matching template statistical vector corresponding to the user input information; and the output module 35 is configured to output an interaction result corresponding to the user input information based on at least the semantic vector and the matching template statistical vector.
In one possible implementation, the second determining module 33 is configured to: and respectively determining the vectors of all the basic templates as matching template vectors corresponding to the input information of the user.
In one possible implementation, the second determining module 33 is configured to: if the user input information conforms to the sentence pattern of any non-basic template, determining the vector of the non-basic template as a matching template vector corresponding to the user input information; wherein, the user input information accords with any sentence pattern of the non-basic template, including: the user input information contains entities of the set of entities in the sentence of the non-base template.
In one possible implementation, the third determining module 34 is configured to: and processing the matching template vector and the semantic vector based on an attention mechanism to obtain a matching template statistical vector corresponding to the user input information.
In one possible implementation, the third determining module 34 is configured to: determining the weight of the matching template vector according to the similarity of the matching template vector and the semantic vector; and weighting the matched template vector based on the weight of the matched template vector to obtain a matched template statistical vector corresponding to the user input information.
In one possible implementation, the third determining module 34 is configured to: and carrying out normalization processing on the similarity of the matching template vector and the semantic vector to obtain the weight of the matching template vector.
In one possible implementation, the output module 35 is configured to: performing connection processing on the semantic vector and the statistical vector of the matching template to obtain a connection vector; and outputting an interaction result corresponding to the input information of the user based on the connection vector.
In one possible implementation, the output module 35 is configured to: performing linear dimensionality reduction on the connecting vector to obtain a dimensionality reduction vector, wherein the dimensionality of the dimensionality reduction vector is the same as the classification number; and inputting the dimension reduction vector into the softmax layer, and outputting an interaction result corresponding to the user input information through the softmax layer.
In one possible implementation, the user input information is speech input by the user.
In the embodiment of the disclosure, by receiving user input information, determining a semantic vector corresponding to the user input information, and determining a matching template vector corresponding to the user input information, where a template matching the user input information at least includes a preset basic template, determining a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector, and outputting an interaction result corresponding to the user input information based on at least the semantic vector and the matching template statistical vector, the influence of dirty data on interaction can be reduced, and thus the accuracy of a result returned to a user in interaction can be improved.
Fig. 8 shows a block diagram of an acoustic enclosure according to an embodiment of the present disclosure, as shown in fig. 8, the acoustic enclosure comprising: a receiving module 41, configured to receive user input information; a first determining module 42, configured to determine a semantic vector corresponding to the user input information; a second determining module 43, configured to determine a matching template vector corresponding to the user input information, where the matching template vector represents a vector of a template matching the user input information, and the template matching the user input information at least includes a preset basic template; a third determining module 44, configured to determine, based on the matching template vector and the semantic vector, a matching template statistical vector corresponding to the user input information; and the output module 45 is configured to output an interaction result corresponding to the user input information based on at least the semantic vector and the matching template statistical vector.
In one possible implementation, the second determining module 43 is configured to: and respectively determining the vectors of all the basic templates as matching template vectors corresponding to the input information of the user.
In one possible implementation, the second determining module 43 is configured to: if the user input information conforms to the sentence pattern of any non-basic template, determining the vector of the non-basic template as a matching template vector corresponding to the user input information; wherein, the user input information accords with the sentence pattern of any non-basic template, and comprises the following steps: the user input information contains entities of the set of entities in the sentence of the non-base template.
In one possible implementation, the third determining module 44 is configured to: and processing the matching template vector and the semantic vector based on an attention mechanism to obtain a matching template statistical vector corresponding to the user input information.
In one possible implementation, the third determining module 44 is configured to: determining the weight of the matching template vector according to the similarity of the matching template vector and the semantic vector; and weighting the matched template vector based on the weight of the matched template vector to obtain a matched template statistical vector corresponding to the user input information.
In one possible implementation, the third determining module 44 is configured to: and carrying out normalization processing on the similarity of the matching template vector and the semantic vector to obtain the weight of the matching template vector.
In one possible implementation, the output module 45 is configured to: performing connection processing on the semantic vector and the statistical vector of the matching template to obtain a connection vector; and outputting an interaction result corresponding to the user input information based on the connection vector.
In one possible implementation, the output module 45 is configured to: performing linear dimensionality reduction on the connecting vector to obtain a dimensionality reduction vector, wherein the dimensionality of the dimensionality reduction vector is the same as the classification number; and inputting the dimension reduction vector into the softmax layer, and outputting an interaction result corresponding to the user input information through the softmax layer.
In one possible implementation, the user input information is speech input by the user.
In the embodiment of the disclosure, by receiving user input information, determining a semantic vector corresponding to the user input information, and determining a matching template vector corresponding to the user input information, wherein a template matching the user input information at least includes a preset basic template, determining a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector, and outputting an interaction result corresponding to the user input information based on the semantic vector and the matching template statistical vector, the influence of dirty data on the interaction can be reduced, and the accuracy of a result returned to a user in the interaction can be improved.
In some embodiments, the functions or included modules of the apparatus and the audio box provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and for specific implementation, reference may be made to the description of the above method embodiments, and for brevity, details are not described here again.
Embodiments of the present disclosure also provide a computer-readable storage medium, on which computer program instructions are stored, and when executed by a processor, the computer program instructions implement the above method. The computer readable storage medium may be a non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured as the above method.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 9 illustrates a block diagram of an electronic device 800 in accordance with an embodiment of the disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
Referring to fig. 9, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
Fig. 10 shows a block diagram of an electronic device 1900 according to an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server. Referring to fig. 10, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, 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/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.
Claims (14)
1. An interaction method, comprising:
receiving user input information;
determining a semantic vector corresponding to the user input information;
determining a vector of a preset basic template as a matching template vector corresponding to the user input information, and if the user input information conforms to a sentence pattern of any non-basic template, determining the vector of the non-basic template as the matching template vector corresponding to the user input information;
determining a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector;
and outputting an interaction result corresponding to the user input information at least based on the semantic vector and the matching template statistical vector.
2. The method of claim 1, wherein:
and respectively determining the vector of each basic template as a matching template vector corresponding to the user input information.
3. The method of claim 1, wherein:
the user input information conforms to any sentence pattern of a non-basic template, including: the user input information includes entities of the set of entities in the sentence of the non-base template.
4. A method according to any one of claims 1 to 3, characterized in that:
and processing the matching template vector and the semantic vector based on an attention mechanism to obtain a matching template statistical vector corresponding to the user input information.
5. The method of claim 4, wherein:
determining the weight of the matching template vector according to the similarity of the matching template vector and the semantic vector;
and weighting the matching template vector based on the weight of the matching template vector to obtain a matching template statistical vector corresponding to the user input information.
6. The method of claim 5, wherein:
and carrying out normalization processing on the similarity of the matching template vector and the semantic vector to obtain the weight of the matching template vector.
7. The method of claim 1, wherein:
performing connection processing on the semantic vector and the matching template statistical vector to obtain a connection vector;
and outputting an interaction result corresponding to the user input information based on the connection vector.
8. The method of claim 7, wherein:
performing linear dimensionality reduction on the connecting vector to obtain a dimensionality reduction vector, wherein the dimensionality of the dimensionality reduction vector is the same as the classification number;
and inputting the dimension reduction vector into a softmax layer, and outputting an interaction result corresponding to the user input information through the softmax layer.
9. The method of claim 1, wherein the user input information is speech input by a user.
10. An interaction method, comprising:
receiving user input information;
determining a semantic vector corresponding to the user input information through a deep learning model;
determining a vector of a preset basic template as a matching template vector corresponding to the user input information, and if the user input information conforms to a sentence pattern of any non-basic template, determining the vector of the non-basic template as the matching template vector corresponding to the user input information;
processing the matching template vector and the semantic vector based on an attention mechanism to obtain a matching template statistical vector corresponding to the user input information;
and outputting an interaction result corresponding to the user input information at least based on the semantic vector and the matching template statistical vector.
11. An interactive apparatus, comprising:
the receiving module is used for receiving user input information;
the first determining module is used for determining a semantic vector corresponding to the user input information;
a second determining module, configured to determine a vector of a preset basic template as a matching template vector corresponding to the user input information, and if the user input information conforms to a sentence pattern of any non-basic template, determine the vector of the non-basic template as the matching template vector corresponding to the user input information;
a third determining module, configured to determine a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector;
and the output module is used for outputting an interaction result corresponding to the user input information at least based on the semantic vector and the matching template statistical vector.
12. An acoustic enclosure, comprising:
the receiving module is used for receiving user input information;
the first determining module is used for determining a semantic vector corresponding to the user input information;
a second determining module, configured to determine a vector of a preset basic template as a matching template vector corresponding to the user input information, and determine a vector of a non-basic template as a matching template vector corresponding to the user input information if the user input information conforms to a sentence pattern of any non-basic template;
a third determining module, configured to determine a matching template statistical vector corresponding to the user input information based on the matching template vector and the semantic vector;
and the output module is used for outputting an interaction result corresponding to the user input information at least based on the semantic vector and the matching template statistical vector.
13. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the memory-stored instructions to perform the method of any of claims 1 to 9.
14. A computer readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1 to 9.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910384519.7A CN112002313B (en) | 2019-05-09 | 2019-05-09 | Interaction method and device, sound box, electronic equipment and storage medium |
PCT/CN2020/088643 WO2020224570A1 (en) | 2019-05-09 | 2020-05-06 | Interaction method and apparatus, and loudspeaker box, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910384519.7A CN112002313B (en) | 2019-05-09 | 2019-05-09 | Interaction method and device, sound box, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112002313A CN112002313A (en) | 2020-11-27 |
CN112002313B true CN112002313B (en) | 2023-04-07 |
Family
ID=73051237
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910384519.7A Active CN112002313B (en) | 2019-05-09 | 2019-05-09 | Interaction method and device, sound box, electronic equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112002313B (en) |
WO (1) | WO2020224570A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112559687B (en) * | 2020-12-15 | 2024-07-30 | 中国平安人寿保险股份有限公司 | Question identification and query method and device, electronic equipment and storage medium |
CN114036823B (en) * | 2021-10-26 | 2024-05-10 | 天津大学 | Power transformer load control method and device based on coding-decoding and memory mechanism |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9576046B2 (en) * | 2011-11-16 | 2017-02-21 | Ptc Inc. | Methods for integrating semantic search, query, and analysis across heterogeneous data types and devices thereof |
CN105868313B (en) * | 2016-03-25 | 2019-02-12 | 浙江大学 | A kind of knowledge mapping question answering system and method based on template matching technique |
CN107656996B (en) * | 2017-09-19 | 2021-05-07 | 北京百度网讯科技有限公司 | Man-machine interaction method and device based on artificial intelligence |
CN109101479B (en) * | 2018-06-07 | 2023-12-05 | 苏宁易购集团股份有限公司 | Clustering method and device for Chinese sentences |
CN109002516A (en) * | 2018-07-06 | 2018-12-14 | 国网电子商务有限公司 | A kind of searching method and device |
CN109241524B (en) * | 2018-08-13 | 2022-12-20 | 腾讯科技(深圳)有限公司 | Semantic analysis method and device, computer-readable storage medium and electronic equipment |
CN109063174B (en) * | 2018-08-21 | 2022-06-07 | 腾讯科技(深圳)有限公司 | Query answer generation method and device, computer storage medium and electronic equipment |
CN109614464B (en) * | 2018-10-31 | 2023-10-27 | 创新先进技术有限公司 | Method and device for identifying business problems |
-
2019
- 2019-05-09 CN CN201910384519.7A patent/CN112002313B/en active Active
-
2020
- 2020-05-06 WO PCT/CN2020/088643 patent/WO2020224570A1/en active Application Filing
Also Published As
Publication number | Publication date |
---|---|
CN112002313A (en) | 2020-11-27 |
WO2020224570A1 (en) | 2020-11-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210312902A1 (en) | Method and electronic device for separating mixed sound signal | |
CN107644646B (en) | Voice processing method and device for voice processing | |
CN105489220B (en) | Voice recognition method and device | |
CN109887515B (en) | Audio processing method and device, electronic equipment and storage medium | |
CN111128183B (en) | Speech recognition method, apparatus and medium | |
WO2021031308A1 (en) | Audio processing method and device, and storage medium | |
CN111242303B (en) | Network training method and device, and image processing method and device | |
CN104035995A (en) | Method and device for generating group tags | |
CN105389304A (en) | Event extraction method and apparatus | |
WO2017092121A1 (en) | Information processing method and device | |
CN112001364A (en) | Image recognition method and device, electronic equipment and storage medium | |
WO2022247128A1 (en) | Image processing method and apparatus, electronic device, and storage medium | |
US11354520B2 (en) | Data processing method and apparatus providing translation based on acoustic model, and storage medium | |
CN109685041B (en) | Image analysis method and device, electronic equipment and storage medium | |
CN111160047A (en) | Data processing method and device and data processing device | |
CN112002313B (en) | Interaction method and device, sound box, electronic equipment and storage medium | |
CN111739535A (en) | Voice recognition method and device and electronic equipment | |
CN111090998A (en) | Sign language conversion method and device and sign language conversion device | |
CN109388699A (en) | Input method, device, equipment and storage medium | |
CN106384586A (en) | Method and device for reading text information | |
CN109447258B (en) | Neural network model optimization method and device, electronic device and storage medium | |
CN112445906A (en) | Method and device for generating reply message | |
CN112559673A (en) | Language processing model training method and device, electronic equipment and storage medium | |
CN113987128A (en) | Related article searching method and device, electronic equipment and storage medium | |
CN108241438B (en) | Input method, input device and input device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |