Feedback data generation method, question and answer system, question and answer device, and refrigerator
By combining bidirectional recurrent neural networks and window sliding convolution, the problems of poor feedback data accuracy and long processing time in existing natural language processing systems are solved, achieving faster and more accurate information retrieval and improving model performance and retrieval efficiency.
Patent Information
- Application Number
- CN202210714966.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-06-22
AI Technical Summary
Existing natural language processing systems suffer from problems such as poor accuracy of feedback data, long processing time, strong long-term dependence, and complex architecture when dealing with information retrieval in open domains. In particular, they cannot effectively evaluate the interaction and flexibility between sentence components when faced with a large number of knowledge elements.
We employ a combination of bidirectional recurrent neural networks and window sliding convolution to form a two-layer retrieval architecture through fuzzy retrieval and precise similarity judgment. We allocate attention vectors to improve the speed and accuracy of feedback data generation, preserve temporal and positional relevance, and limit the impact of long-term dependencies.
It improved the speed and accuracy of feedback data generation, reduced resource consumption, and enhanced the relevance of retrieval and the performance of the model.
Smart Images

Figure CN115146617B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of information technology, and in particular to a feedback data generation method, a question and answer system, a question and answer device and a refrigerator. BACKGROUND
[0002] Nowadays, building a natural language processing system for information retrieval has become an indispensable part of people's work and life. Current search engines mainly split the input sentence by keywords, retrieve and arrange in descending order according to the keyword repetition degree, to facilitate people to obtain the information they want. However, this technical solution is open to the field, and the field word needs to be clearly defined to get the desired results. However, it is difficult to exhaust the field word, so it often leads to poor accuracy of feedback data, missing of key information and other problems.
[0003] Another technical solution provided in the prior art is to call a preset single-layer neural network to process and retrieve the input sentence after receiving the input sentence, and take the result data corresponding to the highest matching degree of the pre-stored knowledge element as the final output. Although this technical solution uses neural networks to improve the relevance of keywords in time sequence, it still has defects: (1) it still only has keyword-level retrieval, and when facing a large number of knowledge elements, it needs to split and compare keywords one by one, which is time-consuming and still has retrieval omission; (2) it only considers the one-way attention from the input sentence to the knowledge element, cannot evaluate the interaction between the two, and has long-term dependency, which causes the influence of the input of the hidden layer on the network output to decline with continuous recursion, and further causes the prediction to have a large deviation; (3) simply adding conditional constraints after the predicted output can only be hard limited, which not only cannot effectively improve the output accuracy, but also increases the output failure rate. SUMMARY
[0004] One of the purposes of the present application is to provide a feedback data generation method to solve the technical problems of slow feedback speed, poor accuracy of feedback results and complex architecture caused by the inability to retrieve specifically, the influence of different components in the sentence declining in the recursion process, and poor flexibility of the limitation condition in the prior art.
[0005] One of the purposes of the present application is to provide a question and answer system.
[0006] One of the purposes of the present application is to provide a question and answer device.
[0007] One of the purposes of the present application is to provide a refrigerator.
[0008] To achieve the above-mentioned one of the purposes of the application, an embodiment of the application provides a feedback data generation method, comprising: receiving question data, performing fuzzy search and calculation in a feedback basic database according to the question data to obtain a standard question sequence and at least two groups of target question sequences; performing bidirectional recurrent neural network traversal prediction and window sliding convolution on the standard question sequence and the target question sequence respectively to obtain a standard question feature matrix and a target question feature matrix; performing projection fusion on the standard question feature matrix and the target question feature matrix, and assigning an attention vector to the standard question feature matrix and the target question feature matrix according to a question judgment matrix obtained by the projection fusion to obtain question similarity data by comparison calculation; sorting the target question sequences according to the question similarity data, and searching and outputting a final answer corpus of a target question sequence corresponding to maximum question similarity data.
[0009] As a further improvement of the embodiment of the application, the method specifically comprises: performing pooling on the obtained question judgment matrix in two different directions, and introducing a nonlinear factor to the pooling result to obtain a standard attention vector and a target attention vector respectively; taking the standard attention vector as the attention weight of the standard question feature matrix to calculate a standard question representation, and taking the target attention vector as the attention weight of the target question feature matrix to calculate a target question representation; and comparing and calculating the question similarity data according to the standard question representation and the target question representation.
[0010] As a further improvement of the embodiment of the application, the method specifically comprises: setting a row pooling window to perform maximum pooling on the question judgment matrix by row to obtain a standard pooling matrix; and setting a column pooling window to perform maximum pooling on the question judgment matrix by column to obtain a target pooling matrix.
[0011] As a further improvement of the embodiment of the application, the method specifically comprises: calling a preset first activation function to process the standard pooling matrix and the target pooling matrix respectively to obtain the standard attention vector and the target attention vector; wherein the first activation function is a softmax function.
[0012] As a further improvement of the embodiment of the application, the method specifically comprises: sequentially point-multiplying the standard question feature matrix and the standard attention vector to calculate the standard question representation, and sequentially point-multiplying the target question feature matrix and the target attention vector to calculate the target question representation.
[0013] As a further improvement of an embodiment of the application, the method specifically comprises: taking the product of the standard question representation and the target question representation as the dividend, and taking the product of the modulus of the standard question representation and the modulus of the target question representation as the divisor, to calculate the question similarity data.
[0014] As a further improvement of an embodiment of the application, the method specifically comprises: projecting the standard question feature matrix and the target question feature matrix to a preset representation space according to a preset fusion parameter matrix, and invoking a preset second activation function to calculate the question judgment matrix.
[0015] As a further improvement of an embodiment of the application, the second activation function is a tanh function; the method specifically comprises: sequentially point-multiplying the transpose matrix of the question feature matrix, the fusion parameter matrix and the target question feature matrix, and projecting the standard question feature matrix and the target question feature matrix to a preset representation space.
[0016] As a further improvement of an embodiment of the application, the method specifically comprises: invoking a preset feature extraction model to construct a bidirectional recurrent neural network, inputting the standard word vectors in the standard question sequence into the feature extraction model in order, invoking a preset second activation function according to at least two groups of weight matrices to calculate forward standard data; inputting the standard word vectors in reverse order into the feature extraction model, invoking the second activation function according to at least two groups of weight matrices to calculate reverse standard data; calculating standard hidden layer output data corresponding to the standard word vectors according to the forward standard data and the reverse standard data, and performing window sliding convolution on the standard hidden layer output data to correspondingly obtain the standard question feature matrix.
[0017] As a further improvement of an embodiment of the application, the method specifically comprises: inputting the target word vectors in the target question sequence into the feature extraction model in order, invoking the second activation function according to the at least two groups of weight matrices to calculate forward target data; inputting the target word vectors in reverse order into the feature extraction model, invoking the second activation function according to the at least two groups of weight matrices to calculate reverse target data; calculating target hidden layer output data corresponding to the target word vectors according to the forward target data and the reverse target data, and performing window sliding convolution on the target hidden layer output data to correspondingly obtain the target question feature matrix.
[0018] As a further improvement of one embodiment of the application, the bidirectional recurrent neural network comprises an update gate and a reset gate; the method specifically comprises: according to the current input value, the previous hidden layer output value, the update gate weight matrix group and the update gate bias vector, an update gate output is calculated by calling a preset third activation function; according to the current input value, the previous hidden layer output value, the reset gate weight matrix group and the reset gate bias vector, a reset gate output is calculated by calling the third activation function; according to the current input value, the previous hidden layer output value, the reset gate output, the hidden layer weight matrix group and the hidden layer bias vector, a current hidden layer state value is calculated by calling the second activation function; and according to the previous hidden layer output value, the current hidden layer state value and the update gate output, a current hidden layer output value is calculated.
[0019] As a further improvement of one embodiment of the application, the third activation function is a sigmoid function.
[0020] As a further improvement of one embodiment of the application, the method specifically comprises: according to the current forward input value and the previous forward hidden layer state value, forward standard data is calculated by calling the second activation function; according to the current backward input value and the previous backward hidden layer state value, backward standard data is calculated by calling the second activation function; and according to the forward standard data, the backward standard data, the bidirectional hidden layer weight matrix group and the current hidden layer bias vector, the standard hidden layer output data is calculated.
[0021] As a further improvement of one embodiment of the application, the method specifically comprises: a preset global sliding window is called to traverse the components in the question data, and a standard co-occurrence matrix corresponding to the question data is constructed; wherein the standard co-occurrence matrix represents the actual order correlation between the components in the question data; according to a global vector loss function, a standard loss function corresponding to the standard co-occurrence matrix is constructed; wherein the standard loss function represents the difference between the predicted order correlation and the actual order correlation between the components in the question data; the predicted order correlation is approximated to the actual order correlation by using an optimization method, and the standard question sequence is formed according to the standard word vector corresponding to the optimized predicted order correlation.
[0022] As a further improvement of an embodiment of the application, the method specifically comprises: analyzing the standard co-occurrence matrix, and calculating a predicted order expression between a current component and a previous component adjacent to the current component in the question data according to the previous word vector, the current word vector, the previous bias value and the current bias value; wherein the predicted order expression represents the predicted order correlation; constructing the standard loss function according to a difference between the predicted order expression and an actual order expression; wherein the actual order expression represents the actual order correlation.
[0023] As a further improvement of an embodiment of the application, the standard loss function further comprises a weight adjustment function for adjusting the weight of the current word vector according to the frequency of occurrence of the component in the question data.
[0024] As a further improvement of an embodiment of the application, the method further comprises: receiving question data, calling a preset word segmentation tool to perform a word segmentation operation on the question data to obtain a question word data set; traversing the question word data set, screening words in the question word data set according to a preset stop word library to obtain an intermediate question data set; calling a preset part-of-speech tagging tool and / or according to a preset object key domain word library, tagging the intermediate question data set to obtain a standard question data group; and performing fuzzy retrieval and calculation on the standard question data group in a preset feedback basic database to obtain the standard question sequence and the at least two groups of target question sequences.
[0025] As a further improvement of an embodiment of the application, the method further comprises: identifying the language type of the intermediate question data set, and according to the language type, calling a corresponding part-of-speech tagging tool and / or extracting a corresponding object key domain word library to tag the intermediate question data set to obtain the standard question data group.
[0026] As a further improvement of an embodiment of the application, the word segmentation tool comprises one of IKAnalyzer and Jieba, the part-of-speech tagging tool comprises HanLP, and the fuzzy retrieval is configured to be performed by using a Lucene retrieval tool.
[0027] As a further improvement of an embodiment of the application, the method further comprises: traversing all original corpora in an original information database to correspondingly generate original word vectors; calling a preset database generation model to construct a bidirectional recurrent neural network, inputting the original word vectors into the database generation model, screening and establishing an object key word dictionary; crawling question corpora in an object question database, and according to the question corpora and the object key word dictionary, obtaining question corpora and answer corpora corresponding to each other, matching to form a question and answer corpus group; and constructing the feedback basic database according to the question and answer corpus group.
[0028] As a further improvement of an embodiment of the application, the database generation model comprises a recognition classification layer and a condition screening layer; the method specifically comprises: traversing the original corpus, inputting the original corpus into a word embedding layer, generating the original word vector corresponding to each word in the original corpus according to a preset mapping relationship; calling the database generation model, inputting the original word vector into the recognition classification layer, calculating and screening to obtain a pending feature representation corresponding to the original word vector; inputting the pending feature representation into the condition screening layer, judging whether the pending feature representation meets a preset screening rule; if so, taking the original word vector corresponding to the pending feature representation as an object keyword vector; and establishing the object keyword dictionary according to the object keyword vector.
[0029] As a further improvement of an embodiment of the application, the method specifically comprises: calling the database generation model, inputting the original word vector into the recognition classification layer, and calculating at least two original word feature representations corresponding to the original word vector; arranging the at least two original word feature representations according to a prediction score, and extracting an original word feature representation with the maximum prediction score as the pending feature representation.
[0030] As a further improvement of an embodiment of the application, the object keyword dictionary comprises all object keyword vectors in the original information library falling within a preset object key field; and the preset screening rule is set to be that the pending feature representation belongs to the object key field.
[0031] As a further improvement of an embodiment of the application, the method further comprises: repeating and expanding the object keyword dictionary according to a preset logic to obtain an object repetition dictionary; and the method specifically comprises: crawling question corpus in an object question library, traversing and searching in the object repetition dictionary according to the question corpus, obtaining answer corpus corresponding to the question corpus, and matching to form the question and answer corpus group.
[0032] As a further improvement of one embodiment of the present application, the method further comprises: dividing the question corpus in the feedback database according to a preset proportion to obtain a training set, a validation set and a test set; receiving at least one group of question corpora in the training set, and constructing a co-occurrence matrix according to the reference question corpus and the control question corpus in each group of question corpora to obtain a reference co-occurrence matrix and a control co-occurrence matrix; constructing a reference loss function and a control loss function corresponding to the reference co-occurrence matrix and the control co-occurrence matrix respectively according to a global vector loss function; processing the reference loss function and the control loss function respectively by using an optimization method to iteratively train to obtain a reference question sequence and a control question sequence; performing bidirectional recurrent neural network traversal prediction and sliding window convolution on the reference question sequence and the control question sequence respectively to obtain a reference question feature matrix and a control question feature matrix; performing projection fusion on the reference question feature matrix and the control question feature matrix, and assigning attention vectors to the reference question feature matrix and the control question feature matrix according to the obtained question matching matrix to obtain predicted similarity data by comparison; sorting the control question sequence according to the predicted similarity data, finding the training answer corpus of the control question sequence corresponding to the maximum predicted similarity data, calculating at least one evaluation parameter, and iteratively training according to the validation set and the test set until the evaluation parameter meets a preset error tolerance standard.
[0033] As a further improvement of one embodiment of the present application, the evaluation parameter comprises at least one of the average precision mean, the inverse of the average ranking, and the accuracy.
[0034] To achieve one of the above-mentioned purposes, one embodiment of the present application provides a question and answer system, comprising: a data preprocessing module for receiving question data, performing fuzzy retrieval in a feedback database according to the question data, and calculating to obtain a standard question sequence and at least two target question sequences; a feature representation module for performing bidirectional recurrent neural network traversal prediction and window sliding convolution on the standard question sequence and the target question sequence respectively to obtain a standard question feature matrix and a target question feature matrix; a weight fusion module for performing projection fusion on the standard question feature matrix and the target question feature matrix, and assigning attention vectors to the standard question feature matrix and the target question feature matrix according to the obtained question judgment matrix to obtain question similarity data by comparison; and a search output module for sorting the target question sequence according to the question similarity data, finding and outputting the final answer corpus of the target question sequence corresponding to the maximum question similarity data.
[0035] To achieve the above-mentioned one of the purposes of the application, an embodiment of the application provides a question and answer device, comprising a memory, a processor, and a feedback data generation program stored on the memory and executable on the processor, when the feedback data generation program is executed by the processor, the steps of the feedback data generation method in any of the above technical solutions are implemented.
[0036] To achieve the above-mentioned one of the purposes of the application, an embodiment of the application provides a refrigerator, comprising storage compartments of different temperature zones, and a door body for opening and closing the storage compartments, and the refrigerator further comprises the question and answer device in the above technical solution.
[0037] Compared with the prior art, the feedback data generation method provided by the application forms a two-layer retrieval judgment architecture by sequentially performing database fuzzy retrieval and accurate similarity judgment between the fuzzy retrieval result and the question data after receiving the question data; in the part of accurate similarity judgment, not only is a window sliding convolution added after the recurrent neural network, but also the recurrent neural network is configured to have a bidirectional effect, and an attention vector is then allocated, so that the speed of feedback data generation is improved, resource occupation caused by similarity matching of irrelevant data is avoided, and on the basis of preserving the time sequence correlation and the position correlation, the question data and the data in the feedback basic database are made to interact, the development of errors is limited by the attention vector formed accordingly, the influence of long-term dependence is slowed down, and thus the accuracy of the feedback result and the performance of the model architecture are improved. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 is a structural schematic diagram of a question and answer device in an embodiment of the application.
[0039] Figure 2 is a structural schematic diagram of a question and answer system in an embodiment of the application.
[0040] Figure 3 is a step schematic diagram of a feedback data generation method in an embodiment of the application.
[0041] Figure 4 is a partial step schematic diagram of a first embodiment of a feedback data generation method in an embodiment of the application.
[0042] Figure 5 is a partial step schematic diagram of a second embodiment of a feedback data generation method in an embodiment of the application.
[0043] Figure 6 is a partial step schematic diagram of a third embodiment of a feedback data generation method in an embodiment of the application.
[0044] Figure 7is a part of step schematic diagram of the fourth embodiment of the feedback data generation method in an embodiment of the present application.
[0045] Figure 8 is a part of step schematic diagram of the feedback data generation method in another embodiment of the present application.
[0046] Figure 9 is a part of step schematic diagram of a specific example of the feedback data generation method in another embodiment of the present application.
[0047] Figure 10 is a part of step schematic diagram of the feedback data generation method in still another embodiment of the present application. DETAILED DESCRIPTION
[0048] The present application will be described in detail below with reference to specific embodiments shown in the drawings. However, these embodiments do not limit the present application, and structural, methodological, or functional changes made by those of ordinary skill in the art based on these embodiments are included in the protection scope of the present application.
[0049] It should be noted that the term "comprising" or any other variant is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or inherent elements of such a process, method, article, or device. In addition, the terms "first", "second", "third", "fourth" and the like are only for descriptive purposes, and cannot be understood as indicating or implying relative importance.
[0050] With the development of technology, in the field of data analysis and human-computer interaction, especially in the branch of NLP (Natural Language Processing), people are increasingly dissatisfied with the current situation that the existing retrieval system must input part of the data to perform retrieval, and research on the question and answer system equipped with a feedback data generation method is expanding. The goal is to retrieve the corresponding answer corpus from the knowledge base when the user inputs a question corpus with some differences from the answer, and quickly and accurately form feedback to the user. In this way, the requirement for input data can be reduced, and the pre-processing of input data by the user can be simplified. The form processing of input data, as well as the estimation and verification of answers, are performed by devices with faster computing speed, greatly improving the interactive experience and production efficiency.
[0051] Building upon the aforementioned technologies, this invention further combines fuzzy retrieval and precise similarity assessment into a more refined similarity assessment process. The similarity assessment is then sequentially fed into a bidirectional recurrent neural network and a sliding window convolution, with an attention vector assigned before the similarity data is output. This improves speed, enhances the relevance of the matching, and limits further error. Consequently, a high-performance, highly accurate feedback data generation method, question-answering system, question-answering device, and refrigerator are achieved.
[0052] The feedback data generation method, question-and-answer system, and question-and-answer device provided by this invention can be specifically set up in one or more fields, thereby endowing subordinate devices in that field with question-and-answer related human-computer interaction functions. In one scenario, the field can be the field of home appliances, the field of mobile devices, or the field of the Internet, and can be applied to devices such as air conditioners, washing machines, or water heaters; or to devices such as mobile phones, personal computers, watches, bracelets, or headphones; or to dynamic pages such as ASP, JSP, and PHP; static pages such as HTM and HTML; or application software based on Windows, Linux, or iOS platforms. Thus, devices or other components in that field are endowed with the technical effects of this invention.
[0053] In one embodiment of the present invention, a refrigerator is provided, comprising storage compartments with different temperatures and doors for opening and closing the storage compartments. Users can access items in the storage compartments by opening and closing the doors, providing items with a refrigerated, frozen, or variable-temperature storage environment. Furthermore, the refrigerator also includes a question-and-answer device, which receives user-input questions, performs internal processing, generates answers to the corresponding questions, and feeds them back to the user. The question-and-answer device is installed in the refrigerator. Based on its functional configuration, the refrigerator can further provide guidance to users on operating the refrigerator, analyze and provide feedback on the contents of the refrigerator, perform self-checks and feedback on the refrigerator's own functions, provide feedback on the communication status between the refrigerator and a server, and provide feedback on other refrigerator-related peripheral issues.
[0054] For example, in one embodiment, the refrigerator can call the question-answering device after a user raises a question about the operation of the refrigerator, such as how to set the automatic door opening, how to set the automatic door closing, how to set the temperature of the refrigerator compartment and the freezer compartment, etc. The question-answering device can retrieve and analyze the database based on the preset operation guide and output the answer corpus to form feedback. In another embodiment, the refrigerator can call the question-answering device after a user raises a question about the storage in the refrigerator, such as what dishes can be made based on the existing ingredients, what ingredients need to be purchased to make a certain dish, etc. The question-answering device can retrieve and analyze the database based on the preset database or access the server to crawl the relevant database and retrieve and analyze the relevant database, and then output the answer corpus to form feedback.
[0055] The question-answering device can be arranged at any position inside the refrigerator that can receive power supply and interact with the user, and further can be arranged at any position inside the refrigerator that is not excessively affected by the refrigeration system and / or can communicate with the server. When the question-answering device is configured to have input and output devices such as a display screen, an audio collection device, and / or an audio output device, or the question-answering device is connected with the above input and output devices, at least the input and output devices can be arranged on the side of the refrigerator close to the user, and the question-answering device can be arranged at least on the side close to the input and output devices, thereby simplifying the wiring.
[0056] In a preferred embodiment, the question-answering device includes a touch display screen. The touch display screen is specifically embedded on the side of the door body close to the user, and the user can input question data to the touch display screen. The question-answering device processes the question data and outputs the final answer corpus corresponding to the question data and displays it on the touch display screen. Of course, in other embodiments, the way to receive the question data can specifically be or include that the audio collection device receives voice data and hands it over to other parts of the question-answering device for voice recognition. The way to output the final answer corpus can specifically be or include that the audio output device outputs feedback in the form of voice.
[0057] To adapt to more application scenarios and other fields, such as Figure 1As shown, the present application also provides a question and answer device 100, which can be arranged in the above-mentioned refrigerator, or other devices, or other devices in other fields not mentioned herein but can be thought of by those skilled in the art, thereby achieving the corresponding technical effects. Of course, the present application does not exclude the whole such as the refrigerator, collectively referred to as a question and answer device 100, in other words, the question and answer device 100 can have other functional configurations in addition to being able to achieve the feedback data generation function.
[0058] In an embodiment, the question and answer device 100 includes a memory 13, a processor 11, and a feedback data generation program stored on the memory 13 and executable on the processor 11, which, when executed by the processor 11, implements the steps of a feedback data generation method, thereby achieving the technical effects of the present application.
[0059] The memory 13 can include a RAM (Random Access Memory) and a NVM (Non-Volatile Memory), such as at least one disk memory. Alternatively, the memory 13 can also be at least one storage device arranged away from the aforementioned processor 11.
[0060] Preferably, the memory 13 can be or include one or more computer-readable storage media, which can be any available media that can be accessed by a computer, such as a magnetic medium, such as a floppy disk, a hard disk, a magnetic tape, etc., or an optical medium, such as a DVD (Digital Video Disc), etc., or a semiconductor medium, such as an SSD (Solid State Disk), etc.
[0061] The processor 11 can be a general-purpose processor, including a CPU (Central Processing Unit), a NP (Network Processor), etc., and can also be a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0062] The question-answering device 100 provided by the present application can further include a communication interface 12 and a communication bus 14. The processor 11, the communication interface 12, and the memory 13 can communicate with each other through the communication bus 14. The communication interface 12 is configured to communicate between the question-answering device 100 and other devices. The communication bus 14 can be a PCI bus (Peripheral Component Interconnect) or an EISA bus (Extended Industry Standard Architecture), etc. The communication bus 14 can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 1 Only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0063] The embodiment of the present application further provides a question-answering system as shown in the figure, which comprises a data preprocessing module 21, a feature representation module 22, a weight fusion module 23, and a lookup output module 24. Figure 2
[0064] The data preprocessing module 21 is configured to receive question data, perform fuzzy search and calculation in a feedback-based database according to the question data, and obtain a standard question sequence and at least two groups of target question sequences. The feature representation module 22 is configured to sequentially perform bidirectional recurrent neural network traversal prediction and window sliding convolution on the standard question sequence and the target question sequences respectively, and correspondingly obtain a standard question feature matrix and target question feature matrices. The weight fusion module 23 is configured to perform projection fusion on the standard question feature matrix and the target question feature matrices, and assign attention vectors to the standard question feature matrix and the target question feature matrices according to a question judgment matrix obtained by the projection fusion, and calculate question similarity data by comparison. The lookup output module 24 is configured to sort the target question sequences according to the question similarity data, and find and output a final answer corpus of a target question sequence corresponding to maximum question similarity data.
[0065] Of course, the above-mentioned question and answer system is not limited to only having the above-mentioned function modules, and is also not limited to the above-mentioned function modules having the above-mentioned function configurations. Those skilled in the art can think of adding function modules with other functions under the inspiration of the technical solutions provided by the present application, and can also think of adding other function configurations to the above-mentioned existing function modules to realize the expansion of the function of the question and answer system. At the same time, it is worth emphasizing that the description of the above-mentioned function modules does not represent the limitation of their physical structure, and the part described in the form of an independent module can be composed of multiple chips or modules, which cooperate with each other to realize the related technical effects and function steps; as for the part described in the form of multiple modules, its physical structure level can also be set as a unified whole, for example, the case of uniformly naming MCU (Microcontroller Unit, microcontroller unit), CPU (Central Processing Unit, central processor) and the like, so that in different functional partitions inside the whole, the related function steps are executed and the corresponding effects are realized.
[0066] In a preferred embodiment, the weight fusion module 23 can further include a pooling activation module, a weight distribution module and a similarity operation module. The pooling activation module is used to perform pooling on the obtained question judgment matrix in two different directions, and introduce a nonlinear factor to the pooling result, to obtain a standard attention vector and a target attention vector, respectively. The weight distribution module is used to take the standard attention vector as the attention weight of the standard question feature matrix, to calculate a standard question representation, and take the target attention vector as the attention weight of the target question feature matrix, to calculate a target question representation. The similarity operation module is used to calculate the question similarity data by comparing the standard question representation and the target question representation.
[0067] The weight distribution module can further include a matrix fusion module, which is used to project the standard question feature matrix and the target question feature matrix to a preset representation space according to a preset fusion parameter matrix, and to calculate the question judgment matrix by calling a preset second activation function.
[0068] The feature representation module 22 can further include a feature extraction module and a feature enhancement module. The feature extraction module is configured to invoke a preset feature extraction model to construct a bidirectional recurrent neural network, input standard word vectors in a standard question sequence into the feature extraction model in sequence, calculate forward standard data according to at least two groups of weight matrices and a preset second activation function, input the standard word vectors in reverse order into the feature extraction model, calculate reverse standard data according to at least two groups of weight matrices and the second activation function, and calculate standard implicit layer output data corresponding to the standard word vectors according to the forward standard data and the reverse standard data. The feature enhancement module is configured to perform window sliding convolution on the standard implicit layer output data to obtain a standard question sentence feature matrix.
[0069] The data preprocessing module 21 can further include a global traversal module, a loss function module, and an optimization output module. The global traversal module is configured to invoke a preset global sliding window to traverse components in the question data, and construct a standard co-occurrence matrix corresponding to the question data. The loss function module is configured to construct a standard loss function corresponding to the standard co-occurrence matrix according to a global vector loss function. The optimization output module is configured to use an optimization method to approximate the actual order correlation to the predicted order correlation, iteratively train, and form the standard question sequence according to a standard word vector corresponding to the optimized predicted order correlation.
[0070] The data preprocessing module 21 can further include a text processing module, which can specifically include a word segmentation module, a stop word screening module, and a word tagging module. The word segmentation module is configured to receive question data, invoke a preset word segmentation tool to perform word segmentation on the question data, and obtain a question word data set. The stop word screening module is configured to traverse the question word data set, screen words in the question word data set according to a preset stop word library, and obtain an intermediate question data set. The word tagging module is configured to invoke a preset part-of-speech tagging tool and / or according to a preset object key domain word library, tag the intermediate question data set to obtain a standard question data group.
[0071] In a preferred embodiment, the question and answer system can further comprise a database construction module. The database construction module can specifically comprise a data crawling module, a dictionary construction module, a target matching module and an aggregation construction module. The data crawling module is configured to traverse all original corpora in an original information library, generate original word vectors corresponding thereto, and crawl question corpora in an object question library. The dictionary construction module is configured to call a preset database generation model to construct a bidirectional recurrent neural network, input the original word vectors into the database generation model, and screen and establish an object keyword dictionary. The target matching module is configured to obtain question corpora and answer corpora corresponding to each other according to the question corpora and the object keyword dictionary, match to form a question and answer corpus group, and the aggregation construction module is configured to construct the feedback basic database according to the question and answer corpus group.
[0072] In a preferred embodiment, the question and answer system can further comprise a model training module. The model training module is specifically configured to divide a set, extract corpora in the set for feature representation and similarity prediction, calculate evaluation parameters according to obtained answer corpora, and iteratively train a model according to the evaluation parameters.
[0073] In an embodiment, the present application further provides a feedback data generation method as shown in the figure, which can be loaded in any of the above refrigerators, question and answer devices and / or question and answer systems, and can also be loaded in any of the above other devices, equipment or systems. In this embodiment, the feedback data generation method can specifically comprise the following steps. Figure 3
[0074] Step 51, receiving question data, fuzzy searching in the feedback basic database according to the question data and calculating to obtain a standard question sequence and at least two groups of target question sequences.
[0075] Step 52, performing bidirectional recurrent neural network traversal prediction and window sliding convolution on the standard question sequence and the target question sequence respectively in sequence to obtain a standard question feature matrix and a target question feature matrix.
[0076] Step 53, performing projection fusion on the standard question feature matrix and the target question feature matrix, and assigning attention vectors to the standard question feature matrix and the target question feature matrix according to the obtained question judgment matrix, and calculating to obtain question similarity data.
[0077] Step 54, sorting the target question sequences according to the question similarity data, finding and outputting the final answer corpus of the target question sequence corresponding to the maximum question similarity data.
[0078] Based on this, the standard question sequence corresponding to the question data can be generated by searching the question data, and at least two groups of target question sequences searched according to the question data are generated, so as to further judge the similarity between the standard question sequence and the target question sequence, select the target question sequence with the highest similarity to the standard question sequence, find the corresponding answer data according to this, and output it as the final answer corpus matched with the question data. In this way, a double-layer search matching feedback data generation logic can be formed, the accuracy and speed of the overall operation can be improved, and the lightweight algorithm model effect compared with the prior art can also be achieved. In terms of details, the embodiment strengthens the relevance through a bidirectional recurrent neural network, strengthens the features of the matrix and vector through convolution, and post-positions the matrix fusion and attention weight distribution steps, which can retain the time sequence correlation and position correlation, so that the comparison between the standard question sequence and the target question sequence is not limited to internal static components, but takes into account the context correlation, which can further improve the evaluation dimension of the similarity.
[0079] The form of the question data can be adjusted according to the search requirements and the form of the data in the feedback basic database, and preferably, the question data is obtained after preprocessing the user input question data. In this way, the form of the question data and the data in the database can be unified, facilitating fuzzy search and matching. The feedback basic database stores at least three groups of target question sequences, or stores data carrying at least the above target question sequences, so that the sequence or data carrying the sequence corresponding to the question data can be obtained by search matching, and then the target question sequence is extracted.
[0080] In a preferred embodiment, the feedback basic database can be generated according to the device description text corresponding to the device of the question and answer system or the question and answer device, and the device description text can include the operation manual, the use manual, the instruction manual, etc. of the device. When the device is a refrigerator, the feedback basic data can be generated according to the instruction manual of the refrigerator. In this way, the database can be constructed for the specific field of the device, further improving the pertinence and availability of the search.
[0081] The question judgment matrix contains all feature values or vectors in the standard question feature matrix and the target question feature matrix, but the application does not limit the size of the question judgment matrix to be equal to the sum of the size of the standard question feature matrix and the size of the target question feature matrix. Before the projection fusion process, based on the needs of the module and the neural network, zero padding or average value padding and other operations can be performed for matrix expansion. According to the question judgment matrix, the same or different attention vectors can be assigned to the standard question feature matrix and the target question feature matrix, respectively, to form a bidirectional attention mechanism with a bidirectional recurrent neural network, which can further focus on the bidirectional association between the question sequences, so that the question similarity data calculated accordingly has higher reliability.
[0082] The step of assigning attention vectors according to the question judgment matrix is to add different weights to the standard question feature matrix and the target question feature matrix by using attention vectors before outputting for similarity judgment. Therefore, the attention vector assignment step in the application can be set at any position after the window sliding convolution, and the attention vector and the question judgment matrix can have any functional relationship that enables the output to reflect the relevance.
[0083] Preferably, the application provides a first embodiment based on the above-mentioned implementation, which sets the above-mentioned attention vector assignment step in the pooling layer to form a pooling layer with attention mechanism, and corresponds the above-mentioned functional relationship to abstractly different direction pooling relationship, which can maximize the preservation of the original state of the data, and realize the correlation between the standard question features and the target question features to assign different weights to them. In this embodiment, as shown in Figure 3 and Figure 4 The feedback data generation method can specifically include the following steps.
[0084] Step 51, receiving question data, fuzzy searching and calculating in the feedback database according to the question data to obtain a standard question sequence and at least two groups of target question sequences.
[0085] Step 52, performing bidirectional recurrent neural network traversal prediction and window sliding convolution on the standard question sequence and the target question sequence, respectively, to obtain a standard question feature matrix and a target question feature matrix.
[0086] Step 531, performing pooling on the obtained question judgment matrix in two different directions, and introducing a nonlinear factor to the pooling result to obtain a standard attention vector and a target attention vector, respectively.
[0087] Step 532, taking the standard attention vector as the attention weight of the standard question sentence feature matrix, the standard question sentence representation is calculated, and taking the target attention vector as the attention weight of the target question sentence feature matrix, the target question sentence representation is calculated.
[0088] Step 533, according to the standard question sentence representation and the target question sentence representation, the question sentence similarity data is calculated.
[0089] Step 54, according to the question sentence similarity data, the target question sentence sequence is sorted, and the final answer corpus of the target question sentence sequence corresponding to the maximum question sentence similarity data is found and output.
[0090] In this way, different attention vectors generated in different directions according to the question judgment matrix can be taken as weights, and the standard question sentence feature matrix and the target question sentence feature matrix corresponding respectively are weighted and fused, so that the expected technical effect is achieved conveniently, quickly and accurately.
[0091] The different directions are preferably perpendicular to each other, and the content reflecting the correlation between the elements in the feature matrix is extracted as the weight. Preferably, based on the first embodiment, the application provides a specific example of step 531, which performs row pooling on the standard question sentence feature matrix and column pooling on the target question sentence feature matrix, thereby forming a better corresponding state. In this specific example, step 531 can include the following steps.
[0092] Step 5311, set the row pooling window, traverse the question judgment matrix by row to perform maximum pooling, and obtain the standard pooling matrix.
[0093] Step 5312, set the column pooling window, traverse the question judgment matrix by column to perform maximum pooling, and obtain the target pooling matrix.
[0094] In this way, the process of pooling the question judgment matrix in step 531 can be specifically implemented, and after that, the standard pooling matrix and the target pooling matrix are taken as the pooling results, and the nonlinear factor is further introduced, so that the standard attention vector and the target attention vector are obtained.
[0095] In this specific example, the question judgment matrix is defined as G, the row pooling window is defined as M, and the column pooling window is defined as N, then the i-th group of mutually corresponding standard pooling matrix [G_p] i and target pooling matrix [G_q] i can at least satisfy:
[0096]
[0097]
[0098] In particular, the question judgment matrix can be a matrix of size M x N.
[0099] The introduction of a nonlinear factor to the pooling result can process the part that changes nonlinearly in the pooling result according to a preset standard. Preferably, this process can be implemented by using an activation function. Therefore, in this specific example, step 531 can further include step 5313 arranged after step 5311 and step 5312. Step 5313 can specifically include: calling a preset first activation function to process the standard pooling matrix and the target pooling matrix respectively, and correspondingly obtaining a standard attention vector and a target attention vector.
[0100] In this way, the attention vector corresponding to the pooling matrix can be obtained according to a certain mapping relationship, and further used as a weight to process the standard question feature matrix and the target question feature matrix. In a specific embodiment, the first activation function can be preferably configured as a softmax function. In this way, the values inside the standard attention vector and the target attention vector can have a natural correlation with each other, which facilitates setting appropriate weights for the elements in the question feature matrix and simplifies the calculation.
[0101] For the above step 532, the application provides a preferred technical solution, that is, the step 532 can specifically include: sequentially point-multiplying the standard question feature matrix and the standard attention vector to calculate a standard question representation, and sequentially point-multiplying the target question feature matrix and the target attention vector to calculate a target question representation.
[0102] That is, the standard question representation is defined as P attn , the target question representation is defined as Q attn , the standard question feature matrix is defined as P, the target question feature representation is defined as Q, the standard pooling matrix corresponding to the standard question feature matrix is defined as G_p, and the target pooling matrix corresponding to the target question feature matrix is defined as G_q. The standard question representation P attn and the target question representation Q attn can at least satisfy:
[0103] P attn = P·softmax(G_p);
[0104] Q attn = Q·softmax(G_q).
[0105] The similarity data can be calculated by selecting indicators such as distance, for example, Euclidean distance, Minkowski distance, Mahalanobis distance, etc., which can be alternatively applied to the above step 533. In the present application, in order to more accurately distinguish between the standard question representation and the target question representation with small content gap, a preferred technical solution is provided, that is, the step 533 can specifically include: taking the product of the standard question representation and the target question representation as the dividend, and taking the product of the modulus of the standard question representation and the modulus of the target question representation as the divisor, to calculate the question similarity data.
[0106] Following the above definition, and defining the question similarity data as s(P, Q), the question similarity data can at least satisfy:
[0107]
[0108] Further, the above first embodiment can preferably be provided with step 530 before step 531, thereby providing a more optimal question judgment matrix calculation method. Specifically, step 530 can include: projecting the standard question feature matrix and the target question feature matrix into a preset representation space according to a preset fusion parameter matrix, and calling a preset second activation function to calculate a question judgment matrix.
[0109] In this way, the standard question feature matrix and the target question feature matrix can be projected into the same representation space, so that the two question feature matrices are fused, thereby enabling the question judgment matrix to generate an attention vector to assign weights to the two question feature matrices. The projection step is performed according to the fusion parameter matrix, and the fusion parameter matrices corresponding to the standard question feature matrix and the target question feature matrix can be the same or different. For the above step 530, the present application preferably includes: sequentially multiplying the transpose matrix of the question feature matrix, the fusion parameter matrix and the target question feature matrix, and projecting the standard question feature matrix and the target question feature matrix into a preset representation space. In this way, the matrix generated by the projection is activated by the second activation function, and the question judgment matrix is obtained.
[0110] In a preferred embodiment, the second activation function can be configured as a tanh function, which has the advantage of being symmetric about the origin in positive and negative directions, accelerating convergence and improving iteration speed, and facilitating rapid obtaining of an optimal value. Therefore, following the above definition, and defining the fusion parameter matrix as U, the question judgment matrix can at least satisfy:
[0111] G = tanh(P)T UQ)。
[0112] In addition, the above description provides a detailed implementation of step 53 in an embodiment of the present application, and a person skilled in the art can understand that the various technical solutions formed by discussing different levels respectively are not necessarily arranged in a mutually exclusive manner, and a person skilled in the art can certainly combine two or more of the above technical solutions to form a more optimized technical solution. At the same time, it can be understood that the most optimal technical solution provided by the present application is to implement all of the above technical solutions at the same time.
[0113] The present application provides a second embodiment based on the above-mentioned embodiment, in which, as shown in Figure 3 and Figure 5 The feedback data generation method can specifically include the following steps.
[0114] Step 51, receiving question data, fuzzy searching and calculating in the feedback database according to the question data to obtain a standard question sequence and at least two groups of target question sequences.
[0115] Step 521, calling a preset feature extraction model to construct a bidirectional recurrent neural network, inputting the standard word vectors in the standard question sequence into the feature extraction model in order, and calculating the forward standard data according to the at least two groups of weight matrices by calling a preset second activation function.
[0116] Step 522, inputting the standard word vectors in reverse order into the feature extraction model, and calculating the reverse standard data according to the second activation function according to the at least two groups of weight matrices.
[0117] Step 523, calculating the standard implicit layer output data corresponding to the standard word vectors according to the forward standard data and the reverse standard data, and performing window sliding convolution on the standard implicit layer output data to obtain the standard question feature matrix.
[0118] Step 53, performing projection fusion on the standard question feature matrix and the target question feature matrix, and assigning attention vectors to the standard question feature matrix and the target question feature matrix according to the obtained question judgment matrix to calculate the question similarity data.
[0119] Step 54, sorting the target question sequences according to the question similarity data, and searching and outputting the final answer corpus of the target question sequence corresponding to the maximum question similarity data.
[0120] Based on this, the bidirectional recurrent neural network can be used to extract features from the standard question sequence in two directions, which can more accurately reflect the relationship between the context in the sequence. The sliding convolution is performed on the output of the hidden layer in the feature extraction step to obtain the standard question feature matrix after feature enhancement, which is used as the basis for subsequent similarity judgment, which can further improve the credibility of similarity calculation and indirectly improve the credibility of the subsequent answer retrieval step.
[0121] The above steps provide a standard question sequence for Figure 3 In step 52, the steps of processing the standard question sequence, and the corresponding steps of processing the target question sequence in step 52, can also be implemented using similar technical solutions. For example, in one specific example, between steps 51 and steps 521 to 523, or between steps 521 to 523 and step 53, the following steps can be included.
[0122] Step 524, input the target word vector in the target question sequence into the feature extraction model in order, and calculate the forward target data by calling the second activation function according to at least two groups of weight matrices.
[0123] Step 525, input the target word vector after being arranged in reverse order into the feature extraction model, and calculate the reverse target data by calling the second activation function according to at least two groups of weight matrices.
[0124] Step 526, calculate the target hidden layer output data corresponding to the target word vector according to the forward target data and the reverse target data, and perform window sliding convolution on the target hidden layer output data to obtain the target question feature matrix.
[0125] In this way, based on the same mechanism, the target question feature matrix corresponding to the target question sequence can be obtained. Of course, those skilled in the art can understand that the standard question feature matrix and the target question feature matrix do not necessarily use the same processing steps to obtain them.
[0126] The bidirectional recurrent neural network refers to Bi-RNN, Bi-directional Recurrent Neural Network, and in the application, a standard recurrent neural network can be used for bidirectional processing, or a special one such as LSTM (Long Short-Term Memory) can be used for bidirectional processing to serve as the bidirectional recurrent neural network. For the operation logic inside the bidirectional recurrent neural network, the application provides a preferred technical solution, in which the forward standard data and the reverse standard data, and the forward target data and the reverse target data are calculated together according to the output of each component layer inside the bidirectional recurrent neural network. Thus, the generation process of other basic data used for calculating the above data can specifically include the following steps.
[0127] In step 5201, an update gate output is calculated by calling a preset third activation function according to the current input value, the previous hidden layer output value, the update gate weight matrix group, and the update gate bias vector.
[0128] In step 5202, a reset gate output is calculated by calling the third activation function according to the current input value, the previous hidden layer output value, the reset gate weight matrix group, and the reset gate bias vector.
[0129] In step 5203, a current hidden layer state value is calculated by calling a second activation function according to the current input value, the previous hidden layer output value, the reset gate output, the hidden layer weight matrix group, and the hidden layer bias vector.
[0130] In step 5204, a current hidden layer output value is calculated according to the previous hidden layer output value, the current hidden layer state value, and the update gate output.
[0131] The bidirectional recurrent neural network includes an update gate and a reset gate. That is, in this embodiment, a Bi-GRU (Bi-directional Gated Recurrent Unit) is preferably used as the bidirectional recurrent neural network, thereby reducing resource consumption and lightening the model architecture.
[0132] For the third activation function, in the application, it can be preferably configured as a sigmoid function for normalizing each neuron, adapting to data input with obvious gradients, and effectively smoothing the gradient to avoid jumping output values. At the same time, the second activation function can be configured as a tanh function as described above.
[0133] Specifically, the current input value is defined as x t , and the previous hidden layer output value is defined as h t-1, define the update gate weight matrix set as W z and U z , define the update gate bias vector as b z , define the update gate output as z t , define the reset gate weight matrix set as W r and U r , define the reset gate bias vector as b r , define the reset gate output as r t , define the hidden layer weight matrix set as W h and U h , define the current hidden layer state value as define the current hidden layer output value as h t . Then the update gate output z t , the reset gate output r t , the current hidden layer state value and the current hidden layer output value h t , respectively, can at least satisfy:
[0134] z t = σ(W z x t + U z h t-1 + b z ) ;
[0135] r t = σ(W r x t + U r h t-1 + b r ) ;
[0136]
[0137]
[0138] Of course, the configuration of the above parameters and operation methods is related to the selection of the neural network. After changing the type of the neural network, the above parameters and operation methods should be adaptively adjusted. The resulting technical solutions can be obtained by those skilled in the art under the inspiration of the present application. Other feasible technical solutions are not enumerated here.
[0139] Further, for the process of generating forward standard data, backward standard data, forward target data and backward target data according to the output of the above-mentioned constituent layer, the present application provides a preferred technical solution. Taking the forward standard data and the backward standard data as an example, the present embodiment can further include the following specific steps corresponding to steps 521, 522 and 523, respectively.
[0140] Step 5211, according to the current forward input value and the previous forward hidden layer state value, a second activation function is called to calculate the forward standard data.
[0141] Step 5221, according to the current reverse input value and the previous reverse hidden layer state value, a second activation function is called to calculate the reverse standard data.
[0142] Step 5231, according to the forward standard data, the reverse standard data, the bidirectional hidden layer weight matrix group and the current hidden layer bias vector, the standard hidden layer output data is calculated.
[0143] In this way, the preset activation function can be activated in the forward and reverse directions respectively, and then input into the hidden layer for calculation. According to the content in the standard question sequence, the hidden layer output value corresponding to the bidirectional context can be obtained, so as to cooperate with the subsequent projection fusion, attention vector distribution and similarity data calculation, effectively avoiding the problem that the final similarity judgment result is one-sided and single and has poor accuracy due to the isolated comparison of elements in the sequence in the prior art. In an preferred embodiment, the second activation function is consistent with the foregoing, and is configured as a tanh function.
[0144] Specifically, the current forward input value is defined as The previous forward hidden layer state value is defined as The forward standard data is defined as The current reverse input value is defined as The previous reverse hidden layer state value is defined as The reverse standard data is defined as The bidirectional hidden layer weight matrix group includes the forward hidden layer weight matrix W t and the reverse hidden layer weight matrix U t The current hidden layer bias vector is defined as b t The standard hidden layer output data is defined as The forward standard data The reverse standard data And the standard hidden layer output data can at least meet the following respectively:
[0145]
[0146]
[0147]
[0148] It can be understood that the above describes the operation content corresponding to steps 521 to 523 respectively by taking the forward standard data and the reverse standard data as examples, and other ways can be used to calculate the forward target data and the reverse target data, or the above steps can be reused to calculate the forward target data and the reverse target data. Based on this, the process of calculating the forward target data, the reverse target data and the target hidden layer output data can specifically include the following steps.
[0149] Step 5212, the second activation function is called to calculate the forward target data according to the current forward input value and the previous forward hidden layer state value.
[0150] Step 5222, the second activation function is called to calculate the reverse target data according to the current reverse input value and the previous reverse hidden layer state value.
[0151] Step 5232, the target hidden layer output data is calculated according to the forward target data, the reverse target data, the bidirectional hidden layer weight matrix group and the current hidden layer bias vector.
[0152] The preferred calculation process used in steps 5212 to 5232 can be consistent with the calculation process of the above-mentioned forward standard data, the above-mentioned reverse standard data and the above-mentioned standard hidden layer output data respectively, which will not be described here.
[0153] In addition, the above content provides a detailed implementation of step 52 in an embodiment of the application at multiple levels. Those skilled in the art can understand that the various technical solutions formed by discussing different levels do not necessarily be arranged in a mutually exclusive manner, and those skilled in the art can certainly combine two or more of the above-mentioned technical solutions to form a more optimized technical solution. At the same time, it can be understood that the optimal technical solution provided by the present application is to implement all of the optimal embodiments of steps 52 to 53 in the above-mentioned technical solutions.
[0154] The present application provides a third embodiment based on the above-mentioned embodiments, in which, as shown in Figure 3 and Figure 6 The feedback data generation method can specifically include the following steps.
[0155] Step 511, a preset global sliding window is called to traverse the components in the question data to construct a standard co-occurrence matrix corresponding to the question data.
[0156] Step 512, a standard loss function corresponding to the standard co-occurrence matrix is constructed according to a global vector loss function.
[0157] Step 513, using an optimization method to approximate the actual order correlation to the predicted order correlation, iteratively training and forming a standard question sequence according to the standard word vector corresponding to the optimized predicted order correlation.
[0158] Step 52, respectively for the standard question sequence and the target question sequence, sequentially performing bidirectional recurrent neural network traversal prediction and window sliding convolution, and correspondingly obtaining a standard question feature matrix and a target question feature matrix.
[0159] Step 53, performing projection fusion on the standard question feature matrix and the target question feature matrix, and assigning an attention vector to the standard question feature matrix and the target question feature matrix according to the obtained question judgment matrix, and calculating the question similarity data by comparison.
[0160] Step 54, sorting the target question sequence according to the question similarity data, and finding and outputting the final answer corpus of the target question sequence corresponding to the maximum question similarity data.
[0161] The standard co-occurrence matrix represents the actual order correlation between the components in the question data; the standard loss function represents the difference between the predicted order correlation and the actual order correlation between the components in the question data. In this way, the standard co-occurrence matrix sufficient to represent the relationship between each component and its context in the question data can be obtained according to the global sliding window, and the standard loss function can be further fitted according to the standard co-occurrence matrix. The predicted order correlation contained in the loss function is composed of quantifiable parameters, which is infinitely close to the actual order correlation, so as to obtain a plurality of standard word vectors corresponding to the optimized predicted order correlation expression, which jointly form a standard question sequence as basic data for subsequent processing. In this way, compared with other sequence generation or word vector generation methods, the learning target is more flexible, the iteration speed is faster and the effect is better.
[0162] During the traversal process, the global sliding window always takes a component in the question data as the center, and includes a predetermined number of components before and after the component in the coverage range, so as to obtain the co-occurrence of other components relative to the component. Wherein, the component can be a word in the question, and the value in the co-occurrence matrix can be the number of co-occurrence, the normalized number, or the probability value of co-occurrence between components.
[0163] In an embodiment, the question data includes a first element i and a second element j, and the number of times that both of them appear in the global sliding window is X ij Accordingly, the parameter representing the actual order correlation can be generated and included in the standard loss function. Further, a first word vector corresponding to the first element is set as vi , and a second word vector v j corresponding to the second element is set ij . Thus, the predicted order correlation can be expressed by two sets of word vectors, and the predicted order correlation which is unknown can be iteratively approximated to the actual order correlation which is known by optimization method, so that the sets of word vectors for expressing the predicted order correlation can be solved and finally jointly constitute the standard question sequence.
[0164] Preferably, based on the third embodiment described above, the present application provides a specific example for step 512, in which step 512 can specifically include the following steps.
[0165] Step 5121, analyzing the standard co-occurrence matrix, and calculating the predicted order expression between the current component and the previous component adjacent to it in the question data according to the previous word vector, the current word vector, the previous bias value and the current bias value.
[0166] Step 5122, constructing a standard loss function according to the difference between the predicted order expression and the actual order expression.
[0167] Wherein, the predicted order expression represents the predicted order correlation, and the actual order expression represents the actual order correlation.
[0168] Specifically, analyzing the standard co-occurrence matrix can obtain the actual order expression, which can be the co-occurrence number value X ij , of course, preferably, the logarithmic value log(X ij ) of the co-occurrence number value can be taken as the actual order expression. Continuously, one of the first word vector and the second word vector is taken as the current word vector, and the other of the first word vector and the second word vector is taken as the previous word vector. For example, the first word vector v i is taken as the previous word vector, and the second word vector v j is taken as the current word vector, so that the predicted order expression can be generated.
[0169] So far, in an embodiment, the standard loss function J can be configured to at least satisfy:
[0170]
[0171] In order to further enhance the robustness of the standard loss function, in the present embodiment, a bias value can be added to the previous word vector and the current word vector respectively before fitting the loss function. In the embodiment in which the bias value is configured as a bias vector, the previous bias value is defined as b i, the current bias value is defined as b j The standard loss function J can be further configured to satisfy:
[0172]
[0173] Preferably, the standard loss function further comprises a weight adjustment function for adjusting the weight of the current word vector according to the frequency of occurrence of the component in the question sentence data. In this way, the robustness of the model can also be enhanced, and the weight of the auxiliary verb, pronoun and the like, which although has a high frequency of occurrence but does not belong to the entity part of the sentence, can be reduced, preventing the machine from focusing too much on unimportant words and ignoring key words with less occurrence. Based on this, the weight adjustment function corresponding to the co-occurrence value is defined as f(x ij The standard loss function can be further configured to satisfy:
[0174]
[0175] In an embodiment, the weight adjustment function f(x) can be a piecewise function to solve the problem of explosion of the standard loss function when the co-occurrence value is 0. The weight adjustment function f(x) can at least satisfy:
[0176]
[0177] Wherein, the X max is the maximum co-occurrence value, and the a is a weight coefficient. Of course, the present application does not exclude other embodiments for generating word vector data and forming a standard question sequence from question sentence data other than the GloVe method, for example, the skilled person in the art can certainly use Word2Vec, one-hot, NNLM (Neural Network Language Model) and SVD (Singular Value Decomposition) and other word vector encoding methods to form the standard question sequence.
[0178] In addition, the above is an embodiment for generating a standard question sequence corresponding to the question sentence data. The generation of the target question sequence depends on the storage form of the target question sequence in the feedback database. In an embodiment, the feedback database stores the processed target question sequence, at this time, the above steps can be alternatively applied to the construction process of the feedback database. In another embodiment, the feedback database stores data that has not been processed but carries the required information of the target question sequence, at this time, the above steps can also be alternatively used as steps of a method for generating a target question sequence from data in the feedback database, and the resulting technical solution is also included in the protection scope of the present application.
[0179] In addition, the above description provides a detailed implementation of step 51 in an embodiment of the present application at multiple levels, and a person skilled in the art can understand that the various technical solutions formed by discussing different levels respectively are not necessarily arranged in a mutually exclusive manner, and a person skilled in the art can certainly combine two or more of the above-mentioned technical solutions to form a more optimized technical solution. At the same time, it can be understood that the most optimal technical solution provided by the present application is to simultaneously implement all of the most optimal implementations of steps 51 to 53 in the above-mentioned technical solutions.
[0180] The present application provides a fourth embodiment based on the above-mentioned embodiments, in which, as shown in Figure 3 and Figure 7 , the feedback data generation method can specifically include the following steps.
[0181] Step 5101, receiving question data, calling a preset word segmentation tool to perform word segmentation on the question data to obtain a question word data set.
[0182] Step 5102, traversing the question word data set, filtering the words in the question word data set according to a preset stop word library to obtain an intermediate question data set.
[0183] Step 5103, calling a preset part-of-speech tagging tool and / or according to a preset object key domain word library, tagging the intermediate question data set to obtain a standard question data set.
[0184] Step 51', fuzzy searching and calculating in a preset feedback basic database according to the standard question data set to obtain a standard question sequence and at least two groups of target question sequences.
[0185] Step 52, respectively performing bidirectional recurrent neural network traversal prediction and window sliding convolution on the standard question sequence and the target question sequence in turn to correspondingly obtain a standard question feature matrix and a target question feature matrix.
[0186] Step 53, performing projection fusion on the standard question feature matrix and the target question feature matrix, and assigning an attention vector to the standard question feature matrix and the target question feature matrix according to the obtained question judgment matrix, and calculating the question similarity data by comparison.
[0187] Step 54, sorting the target question sequences according to the question similarity data, and searching and outputting the final answer corpus of the target question sequence corresponding to the maximum question similarity data.
[0188] In this way, the question data can be pre-processed to have stronger readability before being retrieved in the feedback database according to the question data, or even before the standard question sequence is generated according to the question data. It is worth noting that the present application does not necessarily arrange steps 5101, 5102 and 5103 at the same time, and the three steps respectively have the effect of improving the readability of the data in different dimensions, and at least one of them can be selected to be arranged, and on this basis, the "according to the standard question data set in..." in step 51' can be replaced with "according to the question word data set", or can be replaced with "according to the intermediate question data set".
[0189] In a preferred embodiment of the present application, the above steps 5101 to 5103 are arranged in sequence before step 51', which can respectively pre-process the word segmentation operation to facilitate the generation of the subsequent standard question sequence, can delete unimportant words to reduce the amount of data for subsequent processing, and can actively analyze the components of the question data to give different weights, and / or can focus on the words related to the object key field. Considering that the feedback database is preferably constructed as a specific field database, the above steps can facilitate the analysis of the relationship between the relevant words and the data in the feedback database.
[0190] For the above step 5103, the present application provides a preferred technical solution, that is, the step 5103 can specifically include: identifying the language type of the intermediate question data set, calling the corresponding part-of-speech tagging tool and / or extracting the corresponding object key field word library according to the language type, and labeling the intermediate question data set to obtain the standard question data set. In this way, the type of the part-of-speech tagging tool and the type of the object key field word library can be adjusted according to the language, and of course, the above language identification step can also be arranged before the step 5101, so that the strategy of word segmentation can be adaptively adjusted according to the language type.
[0191] In a preferred specific example, the word segmentation tool includes one of IKAnalyzer and Jieba, preferably IKAnalyzer, which can support Java development language and can be called across platforms, taking into account the advantages of lightweight and fast processing speed. The part-of-speech tagging tool includes HanLP, and the fuzzy retrieval is configured to be performed using the Lucene retrieval tool, wherein the Lucene retrieval tool can use its inverted index function to speed up the retrieval when performing fuzzy retrieval on the data in the feedback database.
[0192] In addition, the above description provides a detailed implementation of steps 51 in an embodiment of the present application, and the skilled person in the art can understand that the various technical solutions formed by the respective discussion of different levels on the above steps 5101 to 5103 are not necessarily arranged in isolation and exclusion from each other, and the skilled person can certainly combine two or more of the above technical solutions to form a more optimized technical solution. Meanwhile, it can be understood that the most optimal technical solution provided by the present application is to simultaneously implement all of the above optimal implementations related to steps 51 to 53.
[0193] In another embodiment of the present application, a feedback data generation method as shown in Figure 3 and Figure 8 The feedback data generation method can be loaded in any of the above refrigerators, question and answer devices and / or question and answer systems, or in any of the above other devices, equipment or systems. In this another embodiment, the feedback data generation method can specifically include the following steps.
[0194] Step 31: Traverse all original corpora in the original information library to generate original word vectors correspondingly.
[0195] Step 32: Call a preset database generation model to construct a bidirectional recurrent neural network, input the original word vectors into the database generation model, and screen and establish an object keyword dictionary.
[0196] Step 33: Crawl question corpora in the object question library, obtain corresponding question corpora and answer corpora according to the question corpora and the object keyword dictionary, and match to form a question and answer corpus group.
[0197] Step 34: Construct a feedback basic database according to the question and answer corpus group.
[0198] Step 51: Receive question data, perform fuzzy retrieval and calculation in the feedback basic database according to the question data, and obtain a standard question sequence and at least two groups of target question sequences.
[0199] Step 52: Perform bidirectional recurrent neural network traversal prediction and window sliding convolution on the standard question sequence and the target question sequence respectively, and correspondingly obtain a standard question feature matrix and a target question feature matrix.
[0200] Step 53: Perform projection fusion on the standard question feature matrix and the target question feature matrix, and assign attention vectors to the standard question feature matrix and the target question feature matrix according to the obtained question judgment matrix, and calculate the question similarity data by comparison.
[0201] Step 54, according to the question similarity data, the target question sequence is sorted, and the final answer corpus of the target question sequence corresponding to the maximum question similarity data is found and output.
[0202] In this way, the feedback basis database can be established according to the information in the original information base, and the object keyword dictionary meeting the requirements of the field or keyword can be obtained by extracting and screening features through the bidirectional recurrent neural network. Further, the content in the object keyword dictionary is taken as the answer, and the data in the object question library containing the question that the user may input is taken as the question, and the two are matched to obtain the question and answer corpus for constructing the feedback basis database.
[0203] The object question library can be a database of common questions in a specified field, so that step 33 can provide a step of predicting the user input question data. In addition to using a crawler to crawl the object question library on the network, it can also be achieved by manually inputting or calling a pre-set multi-field data set by staff. Further, the content in the feedback basis database provided by the present application can also be the question data and the final answer corpus obtained after steps 51 to 54, or the standard question sequence and the final answer corpus, and the question data or the standard question sequence is stored in the feedback basis database, and the answer data corresponding to the final answer corpus is matched, so as to realize self-adaptive learning.
[0204] Preferably, in order to improve the directionality of the feedback answer, the object keyword dictionary can be expanded to include more associated words. Between steps 32 and 33, step 35 can also be specifically included: the object keyword dictionary is expanded according to the preset logic to obtain the object paraphrase dictionary. In a specific embodiment, the paraphrase expansion can be synonym expansion, bidirectional expansion between abbreviation and full name, bidirectional expansion between multiple languages, etc., and the basis for implementing the paraphrase expansion can be a text library based on professional books and dictionaries.
[0205] Based on this, the corresponding step 33 can be specifically configured to include a step 331: crawling the question corpus in the object question library, searching in the object paraphrase dictionary according to the question corpus, obtaining the answer corpus corresponding to the question corpus, and matching to form the question and answer corpus.
[0206] Based on the above, the process of generating the original word vector from the original corpus can alternatively apply the above steps 511 to 513 and their derivative steps, or use other methods mentioned in the foregoing that can replace the steps 511 to 513. Preferably, based on the above embodiments, the present application provides a method for generating the original word vector from the original corpus, comprising the steps of: Figure 8 and Figure 9The specific example is shown. In this specific example, the step 31 can be specifically configured to include the following steps.
[0207] Step 31', traversing the original corpus, inputting the original corpus into the word embedding layer, and generating the original word vector corresponding to each word in the original corpus according to the preset mapping relationship.
[0208] Based on this, the plurality of words in the original corpus can be used as elements of the word embedding layer, and the interaction relationship between the elements is established to correspondingly generate the original word vector, so that the bidirectional recurrent neural network can be better utilized for feature extraction and classification prediction while preserving the interaction relationship between entities.
[0209] In this specific example, the step 32 can be further configured to include the following steps.
[0210] Step 321, calling the database generation model, inputting the original word vector into the recognition classification layer, and calculating and screening the pending feature representation corresponding to the original word vector.
[0211] Step 322, inputting the pending feature representation into the conditional screening layer, and judging whether the pending feature representation meets the preset screening rule.
[0212] Step 323, if it meets, taking the original word vector corresponding to the pending feature representation as the object keyword vector.
[0213] Step 324, establishing an object keyword dictionary according to the object keyword vector.
[0214] Among them, the database generation model includes a recognition classification layer and a conditional screening layer. In this way, the step configuration corresponding to the feature classification and the specified field word screening is provided, which can convert the original corpus belonging to a specific field into a word vector and store it in the object keyword dictionary, thereby establishing a more targeted feedback foundation database.
[0215] In an embodiment, preferably, the recognition classification layer is constructed as a bidirectional long short-term memory neural network architecture, which can utilize its ability to capture longer distance dependencies to enable the original word vector to be more fully and completely expressed.
[0216] On this basis, for the above-mentioned step 321, the application provides a preferred technical solution, that is, the step 321 can specifically include the following steps.
[0217] Step 3211, calling the database generation model, inputting the original word vector into the recognition classification layer, and calculating at least two original word feature representations corresponding to the original word vector.
[0218] Step 3212, arranging the at least two original word feature representations according to the prediction scores, and extracting the original word feature representation with the maximum prediction score as the pending feature representation.
[0219] Specifically, the label by which the recognition classification layer distinguishes between original word vectors can be a word vector category set in a multi-field word library covering the object key field word library. However, considering the need to simplify the complexity of the system, the above label is preferably a BIO classification label or a BIOES classification label input by a user. Thus, the recognition classification layer can output original word vector feature representations of original word vectors with respect to at least two classification labels, which can represent the possibility (i.e., a probability value, i.e., a corresponding prediction score) of the original word vectors belonging to different classification labels.
[0220] After arranging the original word vector feature representations in ascending or descending order according to the prediction scores, the pending feature representation that best represents the type of the original word vector can be easily obtained. Since the object of the present application is to construct a feedback basic database corresponding to a specified field (e.g., the refrigerator field), it is necessary to perform type screening through the conditional screening layer in step 322 to obtain the object key word vector that meets the conditions.
[0221] In an embodiment, the conditional screening layer can set the preset screening rule as the pending feature representation belonging to the object key field, so that the above-mentioned technical effects can be achieved. Of course, other more specific conditions can also be set. Based on the configuration of the above-mentioned rule, the object key word dictionary is correspondingly configured to include all object key word vectors in the original information library that fall within the preset object key field.
[0222] For example, in an application scenario, the original information library can be a refrigerator instruction manual, and the object key word dictionary or feedback basic database established therefrom can be data containing only operation instructions of the refrigerator and function instructions of the refrigerator, and can not contain information such as bar code information, qualification certification information, and information that is not useful to the customer or is not closely related to the refrigerator. In this way, the amount of generated target question sequences can be indirectly reduced under the premise that no omission occurs in the retrieval, thereby simplifying the computational amount of subsequent feature analysis and similarity comparison, and greatly improving the generation speed of answer corpus and other feedback data.
[0223] Preferably, the conditional screening layer is configured as a conditional random field (CRF). On one hand, the object key domain vocabulary can be reused as a constraint condition. When the to-be-determined feature represents a word vector type that belongs to the word vector types contained in the object key domain vocabulary, it is determined that it meets the condition, thereby achieving the effect of establishing a specific domain (object key domain) feedback basic database. Of course, the present application does not limit the object key domain vocabulary as a necessary condition for establishing a specific domain feedback basic database to achieve the technical effect. Those skilled in the art can also use a conditional screening layer to judge and screen by setting a BIO screening label or a BIOES screening label.
[0224] On the other hand, the conditional random field can adaptively learn constraints in the training data. Even if the object key domain vocabulary or various forms of screening labels are not used as direct constraint conditions, the conditional random field can learn relevant constraint conditions through manual screening in the back end, and finally does not require human intervention through continuous iteration.
[0225] In another embodiment of the present application, a feedback data generation method as shown in Figure 3 and Figure 10 The feedback data generation method can be used in any of the above refrigerators, question and answer devices and / or question and answer systems, or can be used in any of the above other devices, equipment or systems. In this embodiment, the feedback data generation method can specifically include the following steps.
[0226] Step 41: According to the question corpus in the feedback basic database, the training set, the validation set and the test set are obtained by dividing according to the preset proportion.
[0227] Preferably, the training set is used to train the model or neural network involved in the steps 51 to 54 and their derivative steps; the validation set is used to verify the model or neural network, and the model or neural network with smaller error or better convergence is selected according to the output; the test set is used to evaluate the model or neural network with better (optimal) performance obtained from the validation set, and the evaluation result is output together with the model or neural network. Of course, there can be multiple models or neural networks with smaller error or better convergence. At this time, the training set and the validation set can be combined, and the above model or neural network with better performance can be trained again to obtain an optimal model or neural network.
[0228] Preferably, the configuration ratio of the training set, the validation set and the test set is 7:2:1. In addition, the open data set or the feedback database can also be divided into positive sample pool and negative sample pool, wherein the positive sample pool represents a set of sample data in the training set that meets the expected result, for example, a group of corpus data similar enough to the technical solution provided in steps 51-54 and their derivative steps belongs to the positive sample pool. On the contrary, the negative sample pool represents at least part of the set of other sample data in the training set other than the positive sample pool. Preferably, the amount of sample data in the positive sample pool and the negative sample pool is configured as 1:2.
[0229] In addition to the feedback database, the basis for training and validation evaluation in the above step 41 can also be a multi-domain open data set, such as the TREC-QA data set, the WikiQA data set and / or the Quora data set. The TREC-QA data set consists of factual questions and related candidate answers, and [1,0] labels indicating whether the candidate answers are correct. The WikiQA data set is a data set applied to open domain question answering research, which is constructed using a special method to make the corpus in the answer selection task more similar to real natural language. The Quora data set is derived from a knowledge Q&A website and can be used for paraphrase recognition tasks, i.e., determining whether two sentences in a sentence pair express the same meaning and are similar enough.
[0230] In the implementation of using open data set for model and neural network training, the training set, the validation set and the test set formed by division can be used not only for training the model and neural network involved in steps 51-54 and their derivative steps, but also for training the model and neural network involved in steps 31-34 and their derivative steps. Since the training entity steps of the model and neural network have strong correlation with themselves, other conventional steps are generally applicable, therefore, only the training of steps 51-54 and their derivative steps will be discussed below, but this does not mean that the present application does not contain the training of steps 31-34.
[0231] Step 42, receiving at least one group of question corpus in the training set, constructing co-occurrence matrix according to the reference question corpus and the control question corpus in it respectively, to obtain reference co-occurrence matrix and control co-occurrence matrix.
[0232] Step 42 corresponds to step 51, based on the foregoing description, step 42 can also be at least: obtaining reference question sequence and control question sequence according to the reference question corpus and the control question corpus.
[0233] Since the step 42 corresponds to the step 511 in the refined embodiment, the step 42 can also be at least expanded to include: calling the preset global sliding window to traverse the components in the reference question corpus and the control question corpus, constructing the reference co-occurrence matrix corresponding to the reference question corpus, and the control co-occurrence matrix corresponding to the control question corpus.
[0234] The step 43 constructs the reference loss function and the control loss function corresponding to the reference co-occurrence matrix and the control co-occurrence matrix respectively according to the global vector loss function.
[0235] The step 43 also corresponds to the step 51, so it can form the same upper step with the step 42. Since the step 43 corresponds to the step 512 in the refined embodiment, the step 43 can also be at least expanded to include: analyzing the reference co-occurrence matrix and the control co-occurrence matrix, calculating the two groups of predicted order expressions between the current component and the previous component adjacent to it in the reference question corpus and the control question corpus according to the previous word vector, the previous bias value and the current bias value; and constructing the reference loss function and the control loss function corresponding to the reference co-occurrence matrix and the control co-occurrence matrix respectively according to the difference between the two groups of predicted order expressions and the two groups of actual order expressions.
[0236] The step 44 processes the reference loss function and the control loss function respectively by using the optimization method, and iteratively trains to obtain the reference question sequence and the control question sequence.
[0237] The step 44 also corresponds to the step 51, so it can form the same upper step with the step 42. Since the step 44 corresponds to the step 513 in the refined embodiment, the description and various embodiments provided for the step 513 can be alternatively implemented in the step 44.
[0238] The step 45 sequentially executes the bidirectional recurrent neural network traversal prediction and the sliding window convolution on the reference question sequence and the control question sequence respectively, and correspondingly obtains the reference question feature matrix and the control question feature matrix.
[0239] The step 45 corresponds to step 52, and therefore, the step 45 can also be at least expanded to include: calling a preset feature extraction model to construct a bidirectional recurrent neural network, inputting reference word vectors in the reference question sequence into the feature extraction model in order, calling a preset second activation function according to at least two groups of weight matrices to calculate forward reference data; inputting the reference word vectors in reverse order into the feature extraction model, calling the second activation function according to at least two groups of weight matrices to calculate reverse reference data; according to the forward reference data and the reverse reference data, calculating reference implicit layer output data corresponding to the reference word vectors, and performing window sliding convolution on the reference implicit layer output data to correspondingly obtain reference question feature matrices.
[0240] Step 46, performing projection fusion on the reference question feature matrix and the contrast question feature matrix, and assigning attention vectors to the reference question feature matrix and the contrast question feature matrix according to the obtained question matching matrix to calculate the predicted similarity data.
[0241] The step 46 corresponds to step 53, and therefore, the step 46 can also be at least expanded to include: performing pooling on the obtained question training matrix in two directions, and introducing a nonlinear factor to the pooling result to respectively obtain reference attention vectors and contrast attention vectors; taking the reference attention vectors as the attention weights of the reference question feature matrix to calculate reference question representations, and taking the contrast attention vectors as the attention weights of the contrast question feature matrix to calculate contrast question representations; comparing the reference question representations and the contrast question representations to calculate the predicted similarity data.
[0242] In addition to the expansion of the above-described detailed implementation, steps 51 to 54 in the other detailed implementations described in the foregoing can also be alternatively applied to implement the above-described steps 42 to 46, and the present application will not be described here.
[0243] Step 47, sorting the contrast question sequence according to the predicted similarity data, searching for the training answer corpus of the contrast question sequence corresponding to the maximum predicted similarity data, calculating at least one evaluation parameter, and iteratively training according to the validation set and the test set until the evaluation parameter meets the preset error tolerance standard.
[0244] Step 51, receiving question data, and performing fuzzy retrieval and calculation in the feedback database according to the question data to obtain a standard question sequence and at least two groups of target question sequences.
[0245] Step 52, respectively performing bidirectional recurrent neural network traversal prediction and window sliding convolution on the standard question sequence and the target question sequence in turn to correspondingly obtain standard question feature matrices and target question feature matrices.
[0246] Step 53, performing projection fusion on the standard question feature matrix and the target question feature matrix, and assigning an attention vector to the standard question feature matrix and the target question feature matrix according to the obtained question judgment matrix to calculate the question similarity data.
[0247] Step 54, sorting the target question sequence according to the question similarity data, and searching and outputting the final answer corpus of the target question sequence corresponding to the maximum question similarity data.
[0248] In this way, the similarity judgment process of the question data and the corresponding target question sequence data can be simulated by using the reference question corpus and the contrast question corpus through steps 41 to 47, and the model and the neural network can be iteratively trained, and the feedback data can be generated through steps 51 to 54, which can further improve the accuracy of the generated feedback data.
[0249] In a preferred specific example, the evaluation parameters include at least one of the average precision mean, the reciprocal of the average rank, and the accuracy. The reciprocal of the average rank (MRR) is commonly used in two-state problems to determine whether the question corpus and the answer corpus match. The average precision mean only considers the top-ranked answer corpus among all answer corpora related to the current question corpus. The average precision mean (MAP) is used to measure whether the question corpus and the answer corpus match. The accuracy is used to represent the ratio of the number of output samples correctly classified by the model and the neural network for classification to the total number of samples in a given test set. Preferably, the reciprocal of the average rank and the average precision mean are used to evaluate the matching accuracy of the question corpus and the answer corpus, and the accuracy is used to evaluate the classification accuracy of the model and the neural network.
[0250] It is worth emphasizing that although the embodiments expressed by steps 51 to 54 and their derivative steps, the embodiments expressed by steps 31 to 54 and their derivative steps, and the embodiments expressed by steps 41 to 54 and their derivative steps are divided into three embodiments, it is understood that steps 31 to 34 are intended to build a feedback database, steps 41 to 47 are intended to limit the process of model training, and steps 51 to 54 are intended to achieve the process of obtaining feedback data from question data. The three can be combined to form a derived embodiment, two can be combined to form three derived embodiments, and the three can exist separately to form three derived embodiments. The hierarchical description in the above text can be selected for implementation according to the needs of those skilled in the art, and the above derived embodiments are also within the scope of protection of the present application.
[0251] To sum up, the feedback data generation method provided by the application forms a two-layer search judgment architecture by sequentially performing database fuzzy search and accurate similarity judgment between the fuzzy search result and the question data after receiving the question data; in the part of the accurate similarity judgment, not only is a window sliding convolution added after the recurrent neural network, but also the recurrent neural network is configured to have a bidirectional effect, and an attention vector is then allocated, so that the speed of feedback data generation is improved, resource occupation caused by similarity matching of irrelevant data is avoided, and on the basis of retaining the timing correlation and the position correlation, the question data and the data in the feedback basic database are made to interact, the attention vector formed accordingly is used to limit the development of errors and slow down the influence of long-term dependence, thereby improving the accuracy of the feedback result and the performance of the model architecture.
[0252] It should be understood that although the present specification is described in terms of embodiments, not every embodiment contains only one independent technical solution, and the description of the specification is only for the sake of clarity, and those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can be properly combined to form other embodiments that those skilled in the art can understand.
[0253] The series of detailed descriptions listed above are only specific descriptions of the feasible embodiments of the application, and are not intended to limit the protection scope of the application, and any equivalent embodiments or changes made without departing from the spirit of the application should be included in the protection scope of the application.
Claims
1. A method for generating feedback data, characterized by, The method comprises the following steps: receiving question data, performing fuzzy search and calculation in a feedback database based on the question data to obtain a standard question sequence and at least two groups of target question sequences; the standard question sequence is formed by using a word vector coding method according to the question data; the target question sequence is stored in the feedback database and is extracted by searching for a sequence corresponding to the question data in the feedback database; respectively, performing bidirectional recurrent neural network traversal prediction and window sliding convolution on the standard question sequence and the target question sequence to obtain a standard question feature matrix and a target question feature matrix; performing projection fusion on the standard question feature matrix and the target question feature matrix, and assigning attention vectors to the standard question feature matrix and the target question feature matrix according to the obtained question judgment matrix to obtain question similarity data through comparison and calculation; sorting the target question sequences according to the question similarity data, and searching and outputting a final answer corpus of a target question sequence corresponding to maximum question similarity data; The method specifically comprises the following steps: performing pooling in two different directions on the obtained question judgment matrix, and introducing a nonlinear factor to the pooling result to obtain a standard attention vector and a target attention vector, respectively; using the standard attention vector as the attention weight of the standard question feature matrix to calculate a standard question representation, and using the target attention vector as the attention weight of the target question feature matrix to calculate a target question representation; comparing and calculating the question similarity data according to the standard question representation and the target question representation.
2. The feedback data generating method according to claim 1, characterized by, The method specifically comprises the following steps: setting a row pooling window, performing maximum pooling on the question judgment matrix by row to obtain a standard pooling matrix; setting a column pooling window, performing maximum pooling on the question judgment matrix by column to obtain a target pooling matrix.
3. The method of claim 2, wherein, The method specifically comprises the following steps: calling a preset first activation function to process the standard pooling matrix and the target pooling matrix to obtain the standard attention vector and the target attention vector, respectively; wherein the first activation function is a softmax function.
4. The method of claim 1, wherein, The method specifically comprises the following steps: point multiplying the standard question feature matrix and the standard attention vector in sequence to calculate the standard question representation, and point multiplying the target question feature matrix and the target attention vector in sequence to calculate the target question representation.
5. The method of claim 1, wherein, The method specifically comprises the following steps: using the product of the standard question representation and the target question representation as the dividend, and using the product of the modulus of the standard question representation and the modulus of the target question representation as the divisor to calculate the question similarity data.
6. The method of claim 1, wherein, The method specifically comprises the following steps: projecting the standard question feature matrix and the target question feature matrix to a preset representation space according to a preset fusion parameter matrix, and calling a preset second activation function to calculate the question judgment matrix.
7. The method of claim 6, wherein, The second activation function is a tanh function; the method specifically comprises the following steps: Multiply the transposed matrix of the question feature matrix, the fusion parameter matrix and the target question feature matrix in sequence, and project the standard question feature matrix and the target question feature matrix to a preset representation space.
8. The method of claim 1, wherein, The method specifically comprises: Calling a preset feature extraction model to construct a bidirectional recurrent neural network, inputting standard word vectors in the standard question sequence into the feature extraction model in order, and calculating forward standard data according to at least two groups of weight matrices by calling a preset second activation function; Inputting the standard word vectors in reverse order into the feature extraction model, and calculating reverse standard data according to the at least two groups of weight matrices by calling the second activation function; According to the forward standard data and the reverse standard data, the standard implicit layer output data corresponding to the standard word vectors is calculated, and window sliding convolution is performed on the standard implicit layer output data to obtain the standard question feature matrix.
9. The method of claim 8, wherein, The method specifically comprises: Inputting target word vectors in the target question sequence into the feature extraction model in order, and calculating forward target data according to the at least two groups of weight matrices by calling the second activation function; Inputting the target word vectors in reverse order into the feature extraction model, and calculating reverse target data according to the at least two groups of weight matrices by calling the second activation function; According to the forward target data and the reverse target data, the target implicit layer output data corresponding to the target word vectors is calculated, and window sliding convolution is performed on the target implicit layer output data to obtain the target question feature matrix.
10. The method of claim 8, wherein, The bidirectional recurrent neural network comprises an update gate and a reset gate; the method specifically comprises: According to the current input value, the previous implicit layer output value, the update gate weight matrix group and the update gate bias vector, an update gate output is calculated by calling a preset third activation function; According to the current input value, the previous implicit layer output value, the reset gate weight matrix group and the reset gate bias vector, a reset gate output is calculated by calling the third activation function; According to the current input value, the previous implicit layer output value, the reset gate output, the implicit layer weight matrix group and the implicit layer bias vector, a current implicit layer state value is calculated by calling the second activation function; According to the previous implicit layer output value, the current implicit layer state value and the update gate output, a current implicit layer output value is calculated.
11. The method of claim 10, wherein, The third activation function is a sigmoid function.
12. The method of claim 8, wherein, The method specifically comprises: According to the current forward input value and the previous forward implicit layer state value, forward standard data is calculated by calling the second activation function; According to the current reverse input value and the previous reverse implicit layer state value, reverse standard data is calculated by calling the second activation function; According to the forward standard data, the reverse standard data, the bidirectional implicit layer weight matrix group and the current implicit layer bias vector, the standard implicit layer output data is calculated.
13. The method of claim 1, wherein, The method specifically comprises: The preset global sliding window is called to traverse components in the question data, and a standard co-occurrence matrix corresponding to the question data is constructed; the standard co-occurrence matrix represents actual order correlation between the components in the question data; According to a global vector loss function, a standard loss function corresponding to the standard co-occurrence matrix is constructed; the standard loss function represents a difference between predicted order correlation and the actual order correlation between the components in the question data; The predicted order correlation is approximated to the actual order correlation by using an optimization method, and the standard question sequence is formed according to a standard word vector corresponding to the optimized predicted order correlation after iterative training.
14. The method of claim 13, wherein, The method specifically comprises: The standard co-occurrence matrix is analyzed, and a predicted order expression between a current component and a previous component adjacent to the current component in the question data is calculated according to a previous word vector, a current word vector, a previous bias value and a current bias value; the predicted order expression represents the predicted order correlation; The standard loss function is constructed according to a difference between the predicted order expression and an actual order expression; the actual order expression represents the actual order correlation.
15. The method of claim 14, wherein, The standard loss function further comprises a weight adjustment function for adjusting a weight of the current word vector according to a frequency of occurrence of the components in the question data.
16. The method of claim 1, wherein, The method further comprises: Receiving question data, calling a preset word segmentation tool to perform word segmentation on the question data to obtain a question word data set; Traversing the question word data set, filtering words in the question word data set according to a preset stop word library to obtain an intermediate question data set; Calling a preset part-of-speech tagging tool and / or extracting a preset object key domain word library to tag the intermediate question data set to obtain a standard question data group; According to fuzzy search and calculation of the standard question data group in a preset feedback basic database, the standard question sequence and at least two groups of target question sequences are obtained.
17. The method of claim 16, wherein, The method further comprises: Identifying a language type of the intermediate question data set, calling a corresponding part-of-speech tagging tool and / or extracting a corresponding object key domain word library according to the language type to tag the intermediate question data set to obtain the standard question data group.
18. The method of claim 16, wherein, The word segmentation tool comprises one of IKAnalyzer and Jieba, the part-of-speech tagging tool comprises HanLP, and the fuzzy search is configured to be performed by using a Lucene retrieval tool.
19. The method of claim 1, wherein, The method further comprises: Traversing all original corpora in an original information database to correspondingly generate original word vectors; Calling a preset database generation model to construct a bidirectional recurrent neural network, inputting the original word vectors into the database generation model, filtering and establishing an object key word dictionary; Crawling question corpora in an object question database, obtaining question corpora and answer corpora corresponding to each other according to the question corpora and the object key word dictionary, and matching to form a question and answer corpus group; The feedback basic database is constructed according to the question and answer corpus group.
20. The method of claim 19, wherein, The database generation model comprises an identification classification layer and a conditional screening layer; the method specifically comprises: traversing the original corpus, inputting the original corpus into a word embedding layer, and generating the original word vector corresponding to each word in the original corpus according to a preset mapping relationship; calling the database generation model, inputting the original word vector into the identification classification layer, and calculating and screening to obtain a pending feature representation corresponding to the original word vector; inputting the pending feature representation into the conditional screening layer to determine whether the pending feature representation meets a preset screening rule; if yes, taking the original word vector corresponding to the pending feature representation as an object keyword vector; establishing the object keyword dictionary according to the object keyword vector.
21. The method of claim 20, wherein, The method specifically comprises: calling the database generation model, inputting the original word vector into the identification classification layer, and calculating at least two original word feature representations corresponding to the original word vector; arranging the at least two original word feature representations according to a prediction score, and extracting an original word feature representation with the maximum prediction score as the pending feature representation.
22. The method of claim 20, wherein, The object keyword dictionary comprises all object keyword vectors in the original information library falling within a preset object key field; and the preset screening rule is set to be that the pending feature representation belongs to the object key field.
23. The method of claim 19, wherein, The method further comprises: repeating and expanding the object keyword dictionary according to a preset logic to obtain an object repetition dictionary; The method specifically comprises: crawling question corpus in an object question library, traversing and searching in the object repetition dictionary according to the question corpus, obtaining answer corpus corresponding to the question corpus, and matching to form the question and answer corpus group.
24. The method of claim 1, wherein, The method further comprises: dividing the question corpus in the feedback basic database according to a preset proportion to obtain a training set, a verification set and a test set; receiving at least one question corpus group in the training set, and constructing a co-occurrence matrix according to a reference question corpus and a control question corpus in the question corpus group respectively to obtain a reference co-occurrence matrix and a control co-occurrence matrix; constructing a reference loss function and a control loss function corresponding to the reference co-occurrence matrix and the control co-occurrence matrix respectively according to a global vector loss function; processing the reference loss function and the control loss function respectively by using an optimization method to iteratively train to obtain a reference question sequence and a control question sequence; sequentially performing bidirectional recurrent neural network traversal prediction and sliding window convolution on the reference question sequence and the control question sequence respectively to obtain a reference question feature matrix and a control question feature matrix; performing projection fusion on the reference question feature matrix and the control question feature matrix, and assigning an attention vector to the reference question feature matrix and the control question feature matrix according to the obtained question matching matrix to obtain a prediction similarity data by comparison. According to the predicted similarity data, the control question sequence is sorted, the training answer corpus of the control question sequence corresponding to the maximum predicted similarity data is searched, at least one evaluation parameter is calculated, and iterative training is performed according to the verification set and the test set until the evaluation parameter meets a preset error allowance standard.
25. The method of claim 24, wherein, The evaluation parameter includes at least one of the average precision mean, the average ranking inverse, and the accuracy rate.
26. A question answering system, characterized by The method comprises the following steps: The data preprocessing module is configured to receive question data, perform fuzzy search in a feedback database based on the question data, and calculate a standard question sequence and at least two groups of target question sequences; the standard question sequence is formed by using a word vector encoding method based on the question data; and the target question sequences are stored in the feedback database and are extracted by searching for sequences corresponding to the question data in the feedback database. The feature representation module is configured to perform bidirectional recurrent neural network traversal prediction and window sliding convolution on the standard question sequence and the target question sequence respectively to obtain a standard question feature matrix and a target question feature matrix. The weight fusion module is configured to perform projection fusion on the standard question feature matrix and the target question feature matrix, and assign an attention vector to the standard question feature matrix and the target question feature matrix based on a question judgment matrix obtained by comparison and calculation, and obtain question similarity data by comparison and calculation. The weight fusion module is further configured to perform pooling on the question judgment matrix in two different directions, introduce a nonlinear factor to the pooling result, and obtain a standard attention vector and a target attention vector respectively, take the standard attention vector as the attention weight of the standard question feature matrix to calculate a standard question representation, take the target attention vector as the attention weight of the target question feature matrix to calculate a target question representation, and obtain the question similarity data by comparison and calculation based on the standard question representation and the target question representation. The search output module is configured to sort the target question sequences according to the question similarity data, search for, and output a final answer corpus of a target question sequence corresponding to the maximum question similarity data.
27. A question answering apparatus, comprising: The refrigerator further comprises the question and answer device of claim 27. The refrigerator further comprises the question and answer device of claim 27.
28. A refrigerator comprising storage compartments of different temperature zones, and door bodies for opening and closing the storage compartments, characterized in that,
Citation Information
Patent Citations
Intelligent question and answer method, device and equipment and storage medium
CN114416927A
Method and apparatus for automatically generating inference questions and answers
WO2021184311A1