A response method, apparatus and electronic device

By concatenating the text to be recognized to generate a concatenation matrix, and using the mask operation matrix and decoder parameters for encoding and decoding, the problem of slow inference speed of Transformer neural networks is solved, achieving faster processing time and a better user experience.

CN117808096BActive Publication Date: 2026-11-10HISENSE VISUAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311110983.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-30
Publication Date
2026-11-10
Estimated Expiration
2043-08-30

AI Technical Summary

Technical Problem

Existing large-scale pre-trained Transformer neural networks suffer from slow inference speeds due to their massive number of parameters and computational demands, making them difficult to deploy industrially.

Method used

By concatenating the text to be recognized instead of zero-padding, a concatenation matrix is ​​generated, and encoding and decoding are performed using the mask operation matrix and the decoder's decoding parameters. This reduces zero-padding time and optimizes the processing flow of the Transformer neural network.

Benefits of technology

It improves the inference speed of the Transformer neural network, shortens the time to process the text to be recognized, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117808096B_ABST
    Figure CN117808096B_ABST
Patent Text Reader

Abstract

This disclosure relates to the field of response technology, and more particularly to a response method, apparatus, and electronic device for addressing the problem of improving the inference speed of a Transformer neural network. The method includes: acquiring at least two concatenation matrices corresponding to texts to be recognized, a mask operation matrix corresponding to the texts to be recognized, and a prefix sum matrix corresponding to the texts to be recognized; determining a feature vector for each text to be recognized based on the concatenation matrix and the prefix sum matrix; performing the following operations on each feature vector: encoding based on both the feature vector and the mask operation matrix to obtain an encoding result corresponding to the feature vector; decoding based on the decoder's decoding parameters, the encoding result, the decoding result of the previous cycle, and the mask operation matrix to obtain a decoding result for the feature vector; and obtaining the response text for each text to be recognized based on the decoding result of each feature vector.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of response technology, and more particularly to a response method, apparatus and electronic device. Background Technology

[0002] Currently, large-scale pre-trained models have demonstrated remarkable capabilities in fields such as computer vision, natural language processing, and speech processing. However, their training and deployment still face many challenges. These large models are constructed based on Transformer neural networks. Due to the enormous number of parameters and computational demands of Transformer neural networks, inference speed is very slow, making it difficult to deploy large models industrially.

[0003] Therefore, improving the inference speed of Transformer neural networks has become an urgent problem to be solved. Summary of the Invention

[0004] To address the aforementioned technical problems, this disclosure provides a response method, apparatus, and electronic device.

[0005] The technical solution disclosed herein is as follows:

[0006] In a first aspect, this disclosure provides a display device, comprising: a communicator configured to acquire at least two concatenation matrices corresponding to texts to be identified, a mask operation matrix corresponding to the texts to be identified, and a prefix sum matrix corresponding to the texts to be identified; wherein the concatenation matrix and the prefix sum matrix correspond one-to-one, and the prefix sum matrix includes an interval identifier for distinguishing feature vectors; a processor configured to determine a feature vector for each text to be identified based on the concatenation matrix and the prefix sum matrix acquired by the communicator; the processor is further configured to perform the following operations on each feature vector: encoding based on both the feature vector and the mask operation matrix acquired by the communicator to obtain an encoding result corresponding to the feature vector; decoding based on the decoding parameters of the decoder, the encoding result, the decoding result of the previous cycle, and the mask operation matrix acquired by the communicator to obtain a decoding result of the feature vector; and the processor is further configured to obtain a response text for each text to be identified based on the decoding result of each feature vector.

[0007] Secondly, this disclosure provides a display device, comprising: a communicator configured to acquire text to be recognized and a mask operation matrix corresponding to the text to be recognized; a processor configured to encode based on the mask operation matrix acquired by the communicator and the feature vector of the text to be recognized acquired by the communicator, to obtain an encoding result corresponding to the feature vector; the processor is further configured to decode based on the decoding parameters of the decoder, the encoding result, the decoding result of the previous cycle, and the mask operation matrix acquired by the communicator, to obtain a decoding result of the feature vector; wherein the decoding parameters include a first concatenation weight, a second concatenation weight, and a fusion bias term, the first concatenation weight being obtained by concatenating the first weights of the lookup vectors of each fully connected layer in the decoder, the second concatenation weight being obtained by concatenating the second weights of the content vectors of each fully connected layer in the decoder, and the fusion bias term being obtained by concatenating the bias terms of each fully connected layer in the decoder; the processor is further configured to obtain a response text of the text to be recognized based on the decoding result.

[0008] Thirdly, this disclosure provides a response method, comprising: obtaining at least two concatenation matrices corresponding to texts to be identified, a mask operation matrix corresponding to the texts to be identified, and a prefix sum matrix corresponding to the texts to be identified; wherein the concatenation matrix and the prefix sum matrix correspond one-to-one, and the prefix sum matrix includes an interval identifier used to distinguish feature vectors; determining the feature vector of each text to be identified based on the concatenation matrix and the prefix sum matrix; performing the following operations on each feature vector: encoding based on both the feature vector and the mask operation matrix to obtain the encoding result corresponding to the feature vector; decoding based on the decoding parameters of the decoder, the encoding result, the decoding result of the previous cycle, and the mask operation matrix to obtain the decoding result of the feature vector; and obtaining the response text for each text to be identified based on the decoding result of each feature vector.

[0009] Fourthly, this disclosure provides a response method, comprising: acquiring a text to be identified and a mask operation matrix corresponding to the text to be identified; encoding based on the mask operation matrix and the feature vector of the text to be identified to obtain an encoding result corresponding to the feature vector; decoding based on the decoding parameters of the decoder, the encoding result, the decoding result of the previous cycle, and the mask operation matrix to obtain a decoding result of the feature vector; wherein, the decoding parameters include a first concatenation weight, a second concatenation weight, and a fusion bias term, the first concatenation weight being obtained by concatenating the first weights of the lookup vectors of each fully connected layer in the decoder, the second concatenation weight being obtained by concatenating the second weights of the content vectors of each fully connected layer in the decoder, and the fusion bias term being obtained by concatenating the bias terms of each fully connected layer in the decoder; and obtaining the response text of the text to be identified based on the decoding result.

[0010] Fifthly, this disclosure provides an electronic device, including: a memory and a processor, the memory being used to store a computer program; the processor being used to cause the electronic device to implement the response method as provided in any of the third aspects when executing the computer program.

[0011] In a sixth aspect, the present invention provides a computer-readable storage medium comprising: storing a computer program on the computer-readable storage medium, the computer program being executed by a processor of a response method as provided in any of the third aspects.

[0012] In a seventh aspect, the present invention provides a computer program product that, when run on a computer, causes the computer to perform a response method as provided in any of the third aspects.

[0013] Eighthly, this disclosure provides an electronic device, including: a memory and a processor, the memory being used to store a computer program; the processor being used to cause the electronic device to implement the response method as provided in any of the fourth aspects when executing the computer program.

[0014] In a ninth aspect, the present invention provides a computer-readable storage medium comprising: storing a computer program on the computer-readable storage medium, the computer program being executed by a processor of a response method as provided in any of the fourth aspects.

[0015] In a tenth aspect, the present invention provides a computer program product that, when run on a computer, causes the computer to perform a response method as provided in any of the fourth aspects.

[0016] It should be noted that the aforementioned computer instructions may be stored, in whole or in part, on the first computer-readable storage medium. The first computer-readable storage medium may be packaged together with the processor of the display device, or it may be packaged separately from the processor of the display device; this disclosure does not impose any limitations on this.

[0017] The descriptions of the third, fifth, sixth, and seventh aspects in this disclosure can be referenced to the detailed description of the first aspect; and the beneficial effects of the descriptions of the third, fifth, sixth, and seventh aspects can be referenced to the analysis of the beneficial effects of the first aspect, which will not be repeated here.

[0018] The descriptions of aspects four, eight, nine, and ten in this disclosure can be referenced to the detailed description of aspect one; and the beneficial effects of the descriptions of aspects four, eight, nine, and ten can be referenced to the analysis of the beneficial effects of aspect two, which will not be repeated here.

[0019] In this disclosure, the names of the aforementioned display devices do not limit the devices or functional modules themselves. In actual implementation, these devices or functional modules may appear under other names. As long as the functions of each device or functional module are similar to those of this disclosure, they fall within the scope of the claims of this disclosure and their equivalents.

[0020] These or other aspects of this disclosure will become more readily apparent in the following description.

[0021] The technical solution provided in this disclosure has the following advantages compared with the prior art:

[0022] The response method provided in this disclosure, when applied to a Transformer neural network, eliminates the need for zero-padding of the text to be recognized. Instead, it directly concatenates the text to obtain a concatenated matrix corresponding to the text to be recognized. This reduces the time spent on zero-padding. Subsequently, encoding is performed based on the mask operation matrix and the feature vectors of the text to be recognized, yielding the encoded result corresponding to the feature vectors. Decoding is then performed based on the decoder's decoding parameters, the encoded result, the decoding result from the previous cycle, and the mask operation matrix, resulting in the decoded result of the feature vectors. Based on the decoded result, the response text to be recognized is obtained. Because the Transformer neural network requires zero-padding when processing the text to be recognized, the processing time for that text is shortened. Since the Transformer neural network spends less time processing the text, its inference speed is improved, thus solving the problem of how to increase the inference speed of the Transformer neural network. Attached Figure Description

[0023] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0024] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 A schematic diagram illustrating a scenario for the response method provided in an embodiment of this application;

[0026] Figure 2 This is one of the structural schematic diagrams of the display device provided in the embodiments of this application;

[0027] Figure 3This is a second schematic diagram of the structure of the display device provided in the embodiments of this application;

[0028] Figure 4 One of the flowcharts illustrating the response method provided in this application embodiment;

[0029] Figure 5 A schematic diagram of the Transformer neural network structure of the response method provided in the embodiments of this application;

[0030] Figure 6 A schematic diagram of the splicing matrix, mask operation matrix, and prefix sum matrix of the response method provided in the embodiments of this application;

[0031] Figure 7 A second schematic flowchart illustrating the response method provided in this application embodiment;

[0032] Figure 8 The third flowchart illustrating the response method provided in this application embodiment;

[0033] Figure 9 The fourth flowchart illustrating the response method provided in this application embodiment;

[0034] Figure 10 This is a schematic diagram of the server structure provided in an embodiment of this application;

[0035] Figure 11 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation

[0036] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0037] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0038] The display device provided in this application can have various implementation forms, such as a television, a smart television, a laser projection device, a monitor, an electronic bulletin board, an electronic table, etc. Figure 1 and Figure 2 This is one specific embodiment of the display device of this application.

[0039] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0040] CUDA (Compute Unified Device Architecture) in this disclosure is a computing platform launched by graphics card manufacturer NVIDIA.

[0041] The input embedding layer in this embodiment is called Input Embedding, which is a technique for converting input data into vector form.

[0042] The position encoding layer in this embodiment is Position Encoding.

[0043] The residual connection in this embodiment is Add, which is inspired by the approach of convolutional neural networks (CNNs). This allows the network to focus only on the currently differing parts, which can alleviate the degradation problem of multi-layer networks.

[0044] In this embodiment, layer normalization is referred to as Norm. Borrowing from Recurrent Neural Networks (RNNs), it transforms the inputs of each neuron in a layer into inputs with the same mean and variance, thus accelerating convergence.

[0045] In this embodiment, the forward propagation is referred to as Feedforward, a neural network architecture also known as forward propagation or direct propagation. In a neural network, Feedforward is a direct computation method from the input layer to the output layer.

[0046] The multi-head attention mechanism in this embodiment is Multi-Head Attention.

[0047] The masked multi-head attention mechanism in this embodiment is Masked Multi-Head Attention.

[0048] In this embodiment, "Linear" refers to a linear layer, representing a linear layer in a neural network, also known as a fully connected layer or a dense layer. The Linear layer receives input and applies a linear transformation, multiplying each input by its corresponding weight and summing the results, then adding a bias.

[0049] The output probabilities in this embodiment are called output probabilities.

[0050] The target text in this embodiment is Outputs (shifted right), which includes the encoder's output probability in the previous operation.

[0051] In this embodiment of the disclosure, the multi-classification layer refers to the Softmax layer.

[0052] The Scaled Dot-Product Attention in this embodiment is a computational method for self-attention mechanisms.

[0053] In this embodiment of the disclosure, the mask operation matrix refers to the Mask matrix, which is a matrix composed of 0 and 1 (where 1 in the mask matrix represents real data; 0 represents padding data).

[0054] Figure 1 This is a schematic diagram illustrating an operational scenario between a display device and a control device according to one or more embodiments of this application, such as... Figure 1 As shown, a user can operate the display device 200 via a mobile terminal 300 and a control device 100. The control device 100 can be a remote control, and communication between the remote control and the display device includes infrared protocol communication, Bluetooth protocol communication, wireless or other wired methods to control the display device 200. The user can input user commands through buttons on the remote control, voice input, control panel input, etc., to control the display device 200. In some embodiments, a mobile terminal, tablet computer, computer, laptop computer, and other smart devices can also be used to control the display device 200.

[0055] In some embodiments, the electronic device provided in this application can be the aforementioned display device 200. When a user needs to perform a voice search while using the display device 200, they can press the voice button on the control device 100 and input at least two voice commands to search for information, or input the same two voice commands through another electronic device (such as a mobile phone) that has established a communication connection with the display device 200. The display device 200 acquires the at least two voice commands sent by the target device (control device 100 or mobile phone). Then, the display device 200 preprocesses each of the at least two voice commands (e.g., quantization, sampling, pre-filtering, pre-emphasis, and frame windowing of the audio signal, to remove noise from the search information), thus obtaining at least two audio streams to be recognized. Next, the display device 200 performs a speech-to-text operation on each audio stream to obtain the text to be recognized for each audio stream. Finally, the display device 200 acquires the mask operation matrix corresponding to each text to be recognized. Next, the display device 200 encodes the feature vectors of each mask operation matrix and the text to be recognized, obtaining the encoding result corresponding to the feature vectors. The display device 200 then decodes the text based on the decoder's decoding parameters, the encoding result, the decoding result from the previous cycle, and the mask operation matrix, obtaining the decoding result of the feature vectors. Based on each decoding result, the display device 200 obtains the response text for each text to be recognized.

[0056] As can be seen, the response method provided in this embodiment, when applied to a Transformer neural network, does not require zero-padding of the text to be recognized. Instead, it directly concatenates the text to be recognized to obtain the concatenation matrix corresponding to the text to be recognized. This reduces the time spent on zero-padding. Then, encoding is performed based on the mask operation matrix and the feature vector of the text to be recognized to obtain the encoding result corresponding to the feature vector. Decoding is performed based on the decoder's decoding parameters, the encoding result, the decoding result of the previous cycle, and the mask operation matrix to obtain the decoding result of the feature vector. Based on the decoding result, the response text of the text to be recognized is obtained. Since the Transformer neural network needs to perform zero-padding when processing the text to be recognized, the processing time of the Transformer neural network for the text to be recognized can be shortened. Because the Transformer neural network spends less time processing the text to be recognized, the inference speed of the Transformer neural network can be improved, ensuring a better user experience.

[0057] In some embodiments, the electronic device provided in this application can be the aforementioned display device 200. When a user needs to perform a voice search while using the display device 200, they can press the voice button on the control device 100 and input the voice information to be searched, or input the voice information to be searched through another electronic device (such as a mobile phone) that has established a communication connection with the display device 200. The display device 200 acquires the voice sent by the target device (control device 100 or mobile phone). Then, the display device 200 preprocesses the voice (e.g., one or more of the following: audio signal quantization, sampling, pre-filtering, pre-emphasis, and frame windowing to remove noise in the search information), thus obtaining the audio stream to be recognized. Then, the display device 200 performs a speech-to-text operation on the audio stream to be recognized, obtaining the text to be recognized. Finally, the display device 200 acquires the mask operation matrix corresponding to the text to be recognized. Next, the display device 200 encodes the text to be recognized based on the mask operation matrix and the feature vectors, obtaining the encoding result corresponding to the feature vectors. The display device 200 then decodes the text based on the decoder's decoding parameters, the encoding result, the decoding result from the previous cycle, and the mask operation matrix, obtaining the decoding result of the feature vectors. Based on the decoding result, the display device 200 obtains the response text of the text to be recognized.

[0058] As can be seen, the response method provided in this embodiment, when applied to a Transformer neural network, concatenates the first weights of the lookup vectors of each fully connected layer in the decoder, the second weights of the content vectors of each fully connected layer in the decoder, and the bias terms of each fully connected layer in the decoder. This eliminates the need for multiple computational resource calls; instead, the feature vector decoding result can be obtained in a single calculation based on the first concatenation weights, the second concatenation weights, the fusion bias term, the encoding result, the decoding result from the previous cycle, and the mask operation matrix. This significantly reduces the time the decoder spends on computational resources. Because the decoder spends less time on computational resources, the processing time of the Transformer neural network for the text to be recognized is reduced. Furthermore, the reduced processing time improves the inference speed of the Transformer neural network, ensuring a better user experience.

[0059] In some embodiments, the electronic device provided in this application can be the server 400 described above. When a user needs to perform a voice search while using the display device 200, they can press the voice button on the control device 100 and input at least two voice commands to search for information, or input at least two voice commands to search for information through another electronic device (such as a mobile phone) that has established a communication connection with the display device 200. The display device 200 acquires at least two voice commands sent by the target device (control device 100 or mobile phone). Then, the display device 200 performs preprocessing on each voice command (e.g., quantization, sampling, pre-filtering, pre-emphasis, and frame windowing, or one or more of these to remove noise from the search information), thus obtaining at least two audio streams to be recognized. The display device 200 then sends these at least two audio streams to the server 400. The server 400 performs speech-to-text conversion on each audio stream to be recognized sent by the display device 200 acquired within a preset time (e.g., 1 ms), obtaining at least one text to be recognized. Next, server 400 acquires at least two concatenation matrices, mask operation matrices, and prefix sum matrices corresponding to the texts to be recognized. Then, server 400 determines the feature vector for each text to be recognized based on the concatenation and prefix sum matrices. Server 400 performs the following operations on each feature vector: encoding based on both the feature vector and the mask operation matrix to obtain the encoding result corresponding to the feature vector; decoding based on the decoder's decoding parameters, the encoding result, the decoding result from the previous cycle, and the mask operation matrix to obtain the decoding result of the feature vector; server 400 obtains the response text for each text to be recognized based on the decoding result of each feature vector. Then, server 400 can send the response text to the display device 200 corresponding to each text to be recognized, so that the display device 200 can display the response text.

[0060] In some embodiments, the electronic device provided in this application can be the server 400 described above. When a user needs to perform a voice search while using the display device 200, they can press the voice button on the control device 100 and input the voice information to be searched, or input the voice information to be searched through another electronic device (such as a mobile phone) that has established a communication connection with the display device 200. The display device 200 acquires the voice sent by the target device (control device 100 or mobile phone). Then, the display device 200 preprocesses the voice (e.g., quantization, sampling, pre-filtering, pre-emphasis, and frame windowing of the audio signal, to remove noise in the search information), thus obtaining the audio stream to be recognized. The display device 200 then sends the audio stream to the server 400. The server 400 performs a speech-to-text operation on the audio stream sent by the display device 200 to obtain at least one text to be recognized. Then, the server 400 obtains the mask operation matrix corresponding to the text to be recognized. Next, server 400 encodes based on both the feature vector and the mask operation matrix to obtain the encoding result corresponding to the feature vector. Server 400 then decodes based on the decoder's decoding parameters, the encoding result, the decoding result from the previous cycle, and the mask operation matrix to obtain the decoding result of the feature vector. Based on the decoding result of each feature vector, server 400 obtains the response text for each text to be recognized. Server 400 can then send this response text to display device 200 for display.

[0061] Figure 2 A hardware configuration block diagram of a display device 200 according to an exemplary embodiment is shown. For example... Figure 2 The display device 200 shown includes at least one of the following: a tuner / demodulator 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a memory, a power supply, and a user interface 280. The controller includes a central processing unit, a video processor, an audio processor, a graphics processor, RAM, ROM, and a first to nth interface for input / output. The display 260 may be a touch-enabled display, such as a touch screen display. The tuner / demodulator 210 receives broadcast television signals via wired or wireless reception and demodulates audio and video signals, such as EPG data signals, from multiple wireless or wired broadcast television signals. The detector 230 is used to collect signals from the external environment or signals interacting with the external environment. The controller 250 and the tuner / demodulator 210 may be located in different separate devices; that is, the tuner / demodulator 210 may also be located in an external device of the main device containing the controller 250, such as an external set-top box.

[0062] In some embodiments, the controller 250 controls the operation of the display device and responds to user operations through various software control programs stored in memory. The controller 250 controls the overall operation of the display device 200.

[0063] In some examples, the display device 200 of one or more embodiments is a television 1, and the operating system of the television 1 is the Android system, for example... Figure 3 As shown, TV 1 can be logically divided into an application layer (referred to as "application layer") 21, an application framework layer (referred to as "framework layer") 22, an Android runtime and system library layer (referred to as "system runtime library layer") 23, and a kernel layer 24.

[0064] The application layer 21 includes one or more applications. These applications can be system applications or third-party applications. For example, application layer 21 may include a first application that provides response functionality. The framework layer 22 provides application programming interfaces (APIs) and programming frameworks for the applications in application layer 21. The system runtime library layer 23 provides support for the upper layer, namely the framework layer 22. When the framework layer 22 is used, the Android operating system runs the C / C++ libraries contained in the system runtime library layer 23 to implement the functions required by the framework layer 22. The kernel layer 24 acts as software middleware between the hardware layer and application layer 21, managing and controlling hardware and software resources.

[0065] In some examples, after the television 1 is turned on, the first application starts. When a user needs to perform a voice search while using the display device 200, they can press the voice button on the control device 100 and input at least two voice commands to search for information, or input at least two voice commands to search for information through another electronic device (such as a mobile phone) that has established a communication connection with the display device 200. At this time, the acquisition unit 101 of the display device 200 acquires at least two voice commands sent by the target device (control device 100 or mobile phone). The processing unit 102 of the display device 200 preprocesses each voice command acquired by the acquisition unit 101 (e.g., one or more of the following: audio signal quantization, sampling, pre-filtering, pre-emphasis, and frame windowing to remove noise in the search information), thus obtaining at least two audio streams to be identified. Then, the processing unit 102 of the display device 200 controls the sending unit 103 to send the at least two audio streams to be identified to the server 400. The processing unit 201 of server 400 performs speech-to-text conversion on the audio streams to be recognized sent by each display device 200 acquired by the acquisition unit 202 within a preset time (e.g., 1ms), obtaining at least one text to be recognized. Then, the acquisition unit 202 of server 400 acquires the concatenation matrix, the mask operation matrix, and the prefix sum matrix corresponding to at least two texts to be recognized. Next, the processing unit 201 of server 400 determines the feature vector of each text to be recognized based on the concatenation matrix and the prefix sum matrix acquired by the acquisition unit 202. The processing unit 201 of server 400 performs the following operations on each feature vector: encoding the feature vector and the mask operation matrix acquired by the acquisition unit 201 to obtain the encoding result corresponding to the feature vector; decoding the feature vector based on the decoder's decoding parameters, the encoding result, the decoding result of the previous cycle, and the mask operation matrix acquired by the acquisition unit 201; and obtaining the response text for each text to be recognized based on the decoding result of each feature vector. Then, the processing unit 201 of the server 400 controls the sending unit 203 to send the reply text to the display device 200 corresponding to each text to be identified, so that the display device 200 can display the reply text.

[0066] Specifically, when the execution subject of the response method provided in this embodiment is a server 400, the storage unit 204 of the server 400 is used to store data such as the program code of the response method provided in this embodiment.

[0067] In the following embodiments, the execution subject of the response method provided in this disclosure is the aforementioned server 400, and the electronic device is the aforementioned television set 1, to illustrate the method of this application embodiment.

[0068] This application provides a response method applied to server 400, such as... Figure 4 As shown, the response method may include S11-S14.

[0069] S11. Obtain at least two concatenation matrices corresponding to the texts to be identified, a mask operation matrix corresponding to the texts to be identified, and a prefix sum matrix corresponding to the texts to be identified. The concatenation matrix and the prefix sum matrix correspond one-to-one, and the prefix sum matrix includes an interval identifier used to distinguish feature vectors.

[0070] In some examples, a text to be recognized corresponds to a television set 1. Server 400 distinguishes television set 1 by the physical identifier (such as device identification code) of the television set 1 that uploaded the text to be recognized.

[0071] In some examples, the architecture of the Transformer neural network is as follows: Figure 5 As shown, the system includes: an index recognition layer, a word embedding layer, a positional encoding layer, N encoders, N decoders, a linear layer, and a multi-classification layer. The encoder stack contains several encoders, each containing a multi-head attention mechanism, forward propagation, and two residual connections & layer normalization. The decoder stack contains several decoders, each containing a mask multi-head attention mechanism, a multi-head attention mechanism, forward propagation, and three residual connections & layer normalization. The index recognition layer determines the feature vector of each text to be recognized based on the concatenation matrix and the prefix sum matrix. The multi-head attention mechanism of the decoders decodes the text based on the decoder's decoding parameters, the encoding result, the decoding result of the previous cycle, and the mask operation matrix to obtain the decoded feature vector. Here, N is an integer greater than or equal to 1.

[0072] In some examples, when obtaining the concatenation matrix corresponding to at least two texts to be recognized, the obtained texts to be recognized can be converted into feature vectors, and then at least two feature vectors can be concatenated to obtain the concatenation matrix corresponding to at least two texts to be recognized.

[0073] For example, such as Figure 6 As shown, assume the first text to be recognized (Sentence1) has 4 valid characters (5, 1, 2, 4 respectively), the second text to be recognized (Sentence2) has 3 valid characters (10, 12, 8 respectively), and the third text to be recognized (Sentence3) has 5 valid characters (2, 4, 6, 9, 11 respectively). Then, the feature vectors corresponding to Sentence1, Sentence2, and Sentence3 are concatenated to obtain the following... Figure 6The splicing matrix shown.

[0074] In some examples, in Natural Language Processing (NLP), the length of the input text to be recognized (the number of characters contained in the text) is not uniform. To ensure that the length of the acquired text to be recognized is uniform, it is necessary to pad the end of sentences with zeros if the length is less than the target length. Then, a mask operation matrix is ​​formed by recording the positions where zeros were padded and the positions where zeros were not padded.

[0075] For example, such as Figure 6 As shown, assuming the target length is 5, the first text to be recognized (Sentence1) has 4 valid characters (5, 1, 2, 4 respectively), the second text to be recognized (Sentence2) has 3 valid characters (10, 12, 8 respectively), and the third text to be recognized (Sentence3) has 5 valid characters (2, 4, 6, 9, 11 respectively). Since the length of Sentence1 is less than the target length, padding is needed at the last position of Sentence1. Similarly, since the length of Sentence2 is less than the target length, padding is needed at the last two positions of Sentence2. Likewise, since the length of Sentence3 is equal to the target length, no padding is needed for Sentence3. Thus, it becomes as follows... Figure 6 The mask operation matrix is ​​shown.

[0076] S12. Based on the concatenation matrix and the prefix sum matrix, determine the feature vector of each text to be identified.

[0077] In some examples, the response method provided in this disclosure first creates an interval identifier (e.g., index data of valid characters) to record the position of each valid character, and then fills in the cumulative number of characters in the currently processed text to be recognized with the cumulative number of characters for the parts that need zero padding based on the cumulative number of characters.

[0078] For example, such as Figure 6As shown, assuming the maximum number of valid characters in the text to be recognized is 5, the first text to be recognized (Sentence1) has 4 valid characters, and the total number of characters is 4. Therefore, the interval marker corresponding to the fifth position is 4. The second text to be recognized (Sentence2) has 3 valid characters, and the total number of characters is 7 (4+3). Therefore, the interval markers corresponding to the fourth and fifth positions of the second text to be recognized are both 7. The third text to be recognized (Sentence3) has 5 valid characters. Since the total number of valid characters in Sentence3 is equal to the maximum number of valid characters in the text to be recognized, no padding is required.

[0079] Subsequently, when determining the feature vector of each text to be recognized based on the concatenation matrix and the prefix sum matrix, the number of valid characters corresponding to each text to be recognized in the prefix sum matrix is ​​first determined based on the interval markers used to distinguish feature vectors in the prefix sum matrix. Then, based on this number, the corresponding number of features are selected sequentially from the features arranged in the concatenation matrix to obtain the feature vector of each text to be recognized.

[0080] For example, in conjunction with the example given in S11 above, such as Figure 6 As shown, based on the interval markers used to distinguish feature vectors in the prefix sum matrix, it can be determined that Sentence1 has 4 valid characters, Sentence2 has 3 valid characters, and Sentence3 has 5 valid characters. Since Sentence1, Sentence2, and Sentence3 are concatenated in order (e.g., by their reception time or by the number of characters they contain), it can be determined that the features recorded in positions 1, 2, 3, and 4 of the concatenation matrix are the feature vectors corresponding to Sentence1. Similarly, the features recorded in positions 5, 6, and 7 are the feature vectors corresponding to Sentence2. Likewise, the features recorded in positions 8, 9, 10, 11, and 12 are the feature vectors corresponding to Sentence3.

[0081] As can be seen, by using this interval identifier and combining it with CUDA parallel computing, the text to be recognized and its corresponding interval identifier can be determined in each CUDA thread based on the thread identifier code (e.g., id). Therefore, during the calculation of the Query (query vector) matrix, Key (queried vector) matrix, and Value (content vector) matrix, only the effective characters need to be multiplied by their corresponding weights, effectively reducing the computational load in batch input scenarios.

[0082] S13. Perform the following operations on each feature vector: Encode based on both the feature vector and the mask operation matrix to obtain the encoding result corresponding to the feature vector; Decode based on the decoder's decoding parameters, the encoding result, the decoding result of the previous cycle, and the mask operation matrix to obtain the decoding result of the feature vector.

[0083] In some examples, it is assumed that x is the output of the encoder computation of the Transformer neural network, such as Figure 5 The multi-head attention mechanism in the decoder, in the original Transformer neural network, uses a for loop to iteratively assign x to the weights W of the fully connected layers of each of the N decoders. k W v Multiplying these matrices and adding the bias term b yields the Key matrix (e.g., the lookup vector) and Value matrix (e.g., the content vector) for each Decoder. Figure 5 The output of the multi-head attention mechanism of the N decoders connected to the linear layer is used as the query matrix (e.g., query vector) for calculating Scaled Dot-product Attention. Since the for loop requires frequent memory accesses and copies, it is very time-consuming for the graphics processing unit (GPU). Therefore, the response method provided in this embodiment replaces the for loop calculation with a single-step matrix multiplication calculation; that is, the original single-layer calculation formula is: [y k y v ] = [W k W v ]*x+[b k b v ], the weights W of the fully connected layer of each of the N decoders. k By splicing them together, we can obtain Similarly, for the weights W of the fully connected layer of each of the N decoders... v By splicing them together, we can obtain Similarly, the bias term b of the fully connected layer of each of the N decoders is concatenated in the same way and calculated with the input x in the manner y = W × x + b, thus obtaining the key matrix and value matrix of each decoder. Then, the output of the multi-head attention mechanism of the decoders connected to the linear layers in the N decoders is used as the query matrix for calculating Scaled Dot-product Attention. It can be seen that the response method provided in this embodiment of the invention eliminates the need to access GPU computing resources N times, requiring only one access to GPU computing resources to calculate the key matrix and value matrix of the fully connected layer of each of the N decoders. This reduces GPU memory access and copying, effectively improving the performance of the Transformer neural network.

[0084] In some examples, decoding is performed based on four factors: the decoder's decoding parameters, the encoding result, the decoding result from the previous cycle, and the mask operation matrix. This results in the following steps: determining the query vector based on the encoding result, the first concatenation weight, and the fusion bias term; determining the content vector based on the encoding result, the second concatenation weight, and the fusion bias term; determining the query vector based on the third weight corresponding to the previous cycle's decoding result and the query vector; and finally, obtaining the feature vector decoding result based on the query vector, the content vector, the query vector, and the mask operation matrix.

[0085] S14. Based on the decoding results of each feature vector, obtain the response text for each text to be identified.

[0086] In some examples, due to the timeliness of the response, when the server 400 does not receive at least two texts to be identified within a preset time, such as when the server 400 only receives one text to be identified within a preset time, the server 400 does not need to concatenate the texts to be identified. Instead, after obtaining the texts to be identified, the server 400 obtains the texts to be identified and the mask operation matrix corresponding to the texts to be identified. Subsequently, server 400 encodes the feature vector of the text to be recognized based on the mask operation matrix, obtaining the encoding result corresponding to the feature vector. Server 400 then decodes the feature vector based on the decoder's decoding parameters, the encoding result, the decoding result of the previous cycle, and the mask operation matrix. The decoding parameters include a first concatenation weight, a second concatenation weight, and a fusion bias term. The first concatenation weight is obtained by concatenating the first weights of the lookup vectors of each fully connected layer in the decoder. The second concatenation weight is obtained by concatenating the second weights of the content vectors of each fully connected layer in the decoder. The fusion bias term is obtained by concatenating the bias terms of each fully connected layer in the decoder. Based on the decoding result, the response text of the text to be recognized is obtained, thereby reducing the time for the Transformer neural network to process the text to be recognized, improving the inference speed of the Transformer neural network, and ensuring the user experience.

[0087] In some examples, the response method provided in this disclosure can be applied to electronic devices that support voice interaction (such as smart speakers, televisions, etc.). The electronic device receives a voice request from a user and sends it to a server for parsing. After parsing the voice request, the server obtains the text to be recognized, such as "AAA movies." The server can then search for film and television resources corresponding to "AAA" in the background and send these resources to the electronic device. The electronic device then presents the film and television resources sent by the server to the user. Using the response method provided in this disclosure, the voice assistant can not only execute fixed commands but also possess a certain creative ability, serving as a user's assistant to provide convenience in life and work. For example, if a user requests the electronic device to "write a travel guide to BBB," the Transformer neural network can stream generated content, including information on tourist attractions, travel routes, hotels, restaurants, etc., and display it on the screen of the electronic device.

[0088] While the Transformer neural network boasts impressive capabilities, its high memory consumption and computational complexity currently result in extremely slow generation speeds. Typically, large models with hundreds of billions of parameters generate only 30 characters per second, making deployment virtually impossible. The response method provided in this invention significantly improves the generation speed of the Transformer neural network, allowing users to obtain desired content in a shorter time and ensuring a better user experience.

[0089] As can be seen, when the response method provided in this disclosure is applied to a Transformer neural network, it eliminates the need for zero-padding of the text to be recognized. Instead, it directly concatenates the text to obtain the concatenation matrix corresponding to the text to be recognized. This reduces the time spent on zero-padding. Then, encoding is performed based on the mask operation matrix and the feature vector of the text to be recognized, yielding the encoded result corresponding to the feature vector. Decoding is then performed based on the decoder's decoding parameters, the encoded result, the decoding result from the previous cycle, and the mask operation matrix, yielding the decoded result of the feature vector. Based on the decoded result, the response text to be recognized is obtained. Because the Transformer neural network requires zero-padding when processing the text to be recognized, the processing time for the text to be recognized by the Transformer neural network is shortened. Since the Transformer neural network spends less time processing the text to be recognized, its inference speed can be improved.

[0090] In some feasible examples, combining Figure 4 ,like Figure 7 As shown, the above S12 can be implemented by the following S120.

[0091] S120. Based on the number of characters and the interval identifier, perform character indexing on the concatenation matrix to obtain the feature vector of each text to be recognized.

[0092] In some feasible examples, combining Figure 4 ,like Figure 8 As shown, the response method provided in this embodiment further includes S15-S18.

[0093] S15. Concatenate the first weights of the lookup vectors of each fully connected layer in the decoder to obtain the first concatenation weight.

[0094] S16. Concatenate the second weights of the content vectors of each fully connected layer in the decoder to obtain the second concatenation weight.

[0095] S17. The bias terms of each fully connected layer in the decoder are concatenated to obtain the fused bias terms.

[0096] S18. Based on the first splicing weight, the second splicing weight, and the fusion bias term, the decoding parameters of the decoder are obtained.

[0097] In some feasible examples, the decoding parameters include a first splicing weight, a second splicing weight, and a fusion bias term; combined with Figure 4 ,like Figure 9 As shown, the above S13 can be specifically implemented through the following S130-S133.

[0098] S130. Perform the following operations on each feature vector: encode based on both the feature vector and the mask operation matrix to obtain the encoding result corresponding to the feature vector; determine the lookup vector based on the encoding result, the first concatenation weight, and the fusion bias term.

[0099] S131. Based on the encoding result, the second splicing weight, and the fusion bias term, determine the content vector.

[0100] S132. Determine the query vector based on the third weight corresponding to the decoding result of the previous cycle and the query vector.

[0101] S133. Based on the query vector, content vector, query vector, and mask operation matrix, the decoding result of the feature vector is obtained.

[0102] In some feasible examples, the interval identifier includes the number of characters contained in the text to be identified.

[0103] In some feasible examples, the interval identifier includes: the cumulative number of characters of the currently processed text to be recognized.

[0104] The foregoing mainly describes the solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0105] This application embodiment can divide the server into functional modules according to the above method example. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing unit. The integrated modules can be implemented in hardware or as software functional modules. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0106] like Figure 10 As shown in the diagram, an embodiment of this application provides a schematic diagram of the structure of a server 400. It includes a communicator 101 and a processor 102.

[0107] The communicator 101 is configured to acquire at least two concatenation matrices corresponding to the texts to be identified, mask operation matrices corresponding to the texts to be identified, and prefix sum matrices corresponding to the texts to be identified; wherein the concatenation matrices and prefix sum matrices correspond one-to-one, and the prefix sum matrices include interval identifiers used to distinguish feature vectors; the processor 102 is configured to determine the feature vector of each text to be identified based on the concatenation matrices and prefix sum matrices acquired by the communicator 101; the processor 102 is further configured to perform the following operations on each feature vector: encode the feature vector and the mask operation matrix acquired by the communicator 101 to obtain the encoding result corresponding to the feature vector; decode the feature vector based on the decoder's decoding parameters, the encoding result, the decoding result of the previous cycle, and the mask operation matrix acquired by the communicator 101; the processor 102 is further configured to obtain the response text of each text to be identified based on the decoding result of each feature vector.

[0108] In some implementable examples, processor 102 is further configured to index the concatenation matrix character by character based on the number of characters acquired by communicator 101 and the interval identifier acquired by communicator 101, to obtain the feature vector of each text to be identified.

[0109] In some implementable examples, processor 102 is further configured to concatenate a first weight of the lookup vector of each fully connected layer in the decoder to obtain a first concatenation weight; processor 102 is further configured to concatenate a second weight of the content vector of each fully connected layer in the decoder to obtain a second concatenation weight; processor 102 is further configured to concatenate a bias term of each fully connected layer in the decoder to obtain a fusion bias term; processor 102 is further configured to obtain the decoding parameters of the decoder based on the first concatenation weight, the second concatenation weight, and the fusion bias term.

[0110] In some feasible examples, the decoding parameters include a first concatenation weight, a second concatenation weight, and a fusion bias term; processor 102 is further configured to determine the query vector based on the encoding result, the first concatenation weight, and the fusion bias term; processor 102 is further configured to determine the content vector based on the encoding result, the second concatenation weight, and the fusion bias term; processor 102 is further configured to determine the query vector based on the third weight corresponding to the decoding result of the previous cycle and the query vector; processor 102 is further configured to obtain the decoding result of the feature vector based on the query vector, the content vector, the query vector, and the mask operation matrix.

[0111] In some feasible examples, the interval identifier includes the number of characters contained in the text to be identified.

[0112] In some feasible examples, the interval identifier includes: the cumulative number of characters of the currently processed text to be recognized.

[0113] In some feasible examples, communicator 101 is configured to acquire the text to be recognized and the mask operation matrix corresponding to the text to be recognized; processor 102 is configured to encode the feature vector based on the mask operation matrix acquired by communicator 101 and the feature vector of the text to be recognized acquired by communicator 101 to obtain the encoding result corresponding to the feature vector; processor 102 is also configured to decode the feature vector based on the decoding parameters of the decoder, the encoding result, the decoding result of the previous cycle, and the mask operation matrix acquired by communicator 101; wherein, the decoding parameters include a first concatenation weight, a second concatenation weight, and a fusion bias term, the first concatenation weight is obtained by concatenating the first weight of the lookup vector of each fully connected layer in the decoder, the second concatenation weight is obtained by concatenating the second weight of the content vector of each fully connected layer in the decoder, and the fusion bias term is obtained by concatenating the bias term of each fully connected layer in the decoder; processor 102 is also configured to obtain the response text of the text to be recognized based on the decoding result.

[0114] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and their functions will not be repeated here.

[0115] Of course, the server 400 provided in this application embodiment includes, but is not limited to, the modules described above. For example, the server 400 may also include a memory 103. The memory 103 may be used to store the program code of the server 400, and may also be used to store data generated by the server 400 during operation, such as data in write requests.

[0116] As an example, combined Figure 3The acquisition unit 202 and the sending unit 203 in the server 400 perform the same functions as the communicator 101, the processing unit 201 performs the same functions as the processor 102, and the storage unit 204 performs the same functions as the memory 103.

[0117] like Figure 11 As shown, this application embodiment also provides a chip system that can be applied to the server 400 in the foregoing embodiments. The chip system includes at least one processor 1501 and at least one interface circuit 1502. The processor 1501 can be the processor in the server 400. The processor 1501 and the interface circuit 1502 can be interconnected via a line. The processor 1501 can receive and execute computer instructions from the memory of the server 400 through the interface circuit 1502. When the computer instructions are executed by the processor 1501, the server 400 can perform the various steps performed by the server 400 in the foregoing embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in this application embodiment.

[0118] This application also provides a computer-readable storage medium for storing computer instructions executed by the server 400 described above.

[0119] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A display device, characterized in that, include: The communicator is configured to acquire at least two concatenation matrices corresponding to texts to be identified, a mask operation matrix corresponding to the texts to be identified, and a prefix sum matrix corresponding to the texts to be identified; wherein the concatenation matrix and the prefix sum matrix correspond one-to-one, and the prefix sum matrix includes an interval identifier for distinguishing feature vectors; The processor is configured to determine a feature vector for each of the texts to be identified based on the concatenation matrix obtained by the communicator and the prefix sum matrix obtained by the communicator. The processor is further configured to perform the following operations on each feature vector: encode the feature vector and the mask operation matrix obtained by the communicator to obtain an encoding result corresponding to the feature vector; and decode the feature vector based on the decoding parameters of the decoder, the encoding result, the decoding result of the previous cycle, and the mask operation matrix obtained by the communicator to obtain a decoding result of the feature vector. The processor is further configured to obtain a response text for each of the texts to be identified based on the decoding result of each of the feature vectors.

2. The display device according to claim 1, characterized in that, The processor is further configured to perform character indexing on the concatenation matrix based on the number of characters acquired by the communicator and the interval identifier acquired by the communicator, to obtain the feature vector of each text to be identified.

3. The display device according to claim 1, characterized in that, The processor is further configured to concatenate the first weights of the lookup vectors of each fully connected layer in the decoder to obtain a first concatenation weight. The processor is further configured to concatenate the second weights of the content vectors of each fully connected layer in the decoder to obtain a second concatenation weight. The processor is also configured to concatenate the bias terms of each fully connected layer in the decoder to obtain a fused bias term; The processor is further configured to obtain the decoding parameters of the decoder based on the first splicing weight, the second splicing weight, and the fusion bias term.

4. The display device according to claim 1, characterized in that, The decoding parameters include a first splicing weight, a second splicing weight, and a fusion bias term; The processor is further configured to determine the lookup vector based on the encoding result, the first concatenation weight, and the fusion bias term; The processor is further configured to determine the content vector based on the encoding result, the second splicing weight, and the fusion bias term; The processor is further configured to determine the query vector based on the third weight corresponding to the decoding result of the previous cycle and the query vector; The processor is further configured to obtain the decoding result of the feature vector based on the query vector, the content vector, the query vector, and the mask operation matrix.

5. The display device according to claim 1, characterized in that, The interval identifier includes the number of characters contained in the text to be identified.

6. The display device according to claim 1, characterized in that, The interval identifier includes: the cumulative number of characters in the currently processed text to be recognized.

7. A display device, characterized in that, include: The communicator is configured to acquire the text to be recognized and the mask operation matrix corresponding to the text to be recognized; The processor is configured to encode the mask operation matrix obtained by the communicator and the feature vector of the text to be identified obtained by the communicator to obtain the encoding result corresponding to the feature vector; The processor is further configured to perform decoding based on the decoder's decoding parameters, the encoding result, the decoding result of the previous cycle, and the mask operation matrix obtained by the communicator to obtain the decoding result of the feature vector; wherein, the decoding parameters include a first concatenation weight, a second concatenation weight, and a fusion bias term, the first concatenation weight is obtained by concatenating the first weights of the lookup vectors of each fully connected layer in the decoder, the second concatenation weight is obtained by concatenating the second weights of the content vectors of each fully connected layer in the decoder, and the fusion bias term is obtained by concatenating the bias terms of each fully connected layer in the decoder; The processor is also configured to obtain a response text of the text to be identified based on the decoding result.

8. A response method, characterized in that, include: Obtain the concatenation matrix corresponding to the text to be identified, the mask operation matrix corresponding to the text to be identified, and the prefix sum matrix corresponding to the text to be identified; wherein, the concatenation matrix and the prefix sum matrix correspond one-to-one, and the prefix sum matrix includes an interval identifier for distinguishing feature vectors; Based on the concatenation matrix and the prefix sum matrix, the feature vector of each of the texts to be identified is determined; For each feature vector, the following operations are performed: encoding is performed based on both the feature vector and the mask operation matrix to obtain the encoding result corresponding to the feature vector; decoding is performed based on the decoding parameters of the decoder, the encoding result, the decoding result of the previous cycle, and the mask operation matrix to obtain the decoding result of the feature vector; Based on the decoding result of each feature vector, the response text for each text to be identified is obtained.

9. A response method, characterized in that, include: Obtain the text to be recognized, and the mask operation matrix corresponding to the text to be recognized; Encoding is performed based on the mask operation matrix and the feature vector of the text to be identified to obtain the encoding result corresponding to the feature vector; Decoding is performed based on the decoder's decoding parameters, encoding results, decoding results from the previous cycle, and mask operation matrix to obtain the feature vector decoding result. The decoding parameters include a first concatenation weight, a second concatenation weight, and a fusion bias term. The first concatenation weight is obtained by concatenating the first weights of the lookup vectors of each fully connected layer in the decoder. The second concatenation weight is obtained by concatenating the second weights of the content vectors of each fully connected layer in the decoder. The fusion bias term is obtained by concatenating the bias terms of each fully connected layer in the decoder. Based on the decoding result, the response text of the text to be identified is obtained.

10. A computer-readable storage medium, characterized in that, include: The computer-readable storage medium stores a computer program that, when executed by a computing device, causes the computing device to implement the response method according to any one of claims 8 or 9.

Citation Information

Patent Citations

  • Task type dialogue robot response method and device, robot and storage medium

    CN111625629A

  • Text information extraction method, system and equipment and medium

    CN113094509A