Information retrieval method based on convolutional neural network and related equipment
Through the information retrieval method based on convolutional neural network, through word segmentation, intent recognition and semantic slot type recognition, the problem of low accuracy of traditional information retrieval methods is solved, efficient and accurate information query is achieved, and user efficiency is improved.
Patent Information
- Application Number
- CN201910884119.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-19
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2039-09-19
AI Technical Summary
Traditional information retrieval methods are not very accurate, resulting in users being unable to accurately query information and affecting work efficiency.
The information retrieval method based on convolutional neural network is used to determine the query object and obtain the query results by performing word segmentation processing, intent recognition, and semantic slot type recognition on the query statement, combined with the identification information in the preset model library for matching.
It improves the accuracy of information query and user work efficiency, and realizes the ability to automatically feedback query results based on query statements.
Smart Images

Figure CN110825949B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to an information retrieval method based on a convolutional neural network, and related equipment. Background Art
[0002] Traditional information retrieval methods mainly search for information based on keywords or search through search engines based on Internet tables, but both methods have defects. Among them, the method of searching for information based on keywords has a low hit rate, and the keyword search of its search engine requires a large amount of corpus. In many scenarios, small or medium-sized corpora are difficult to achieve ideal results; and the method of searching through search engines based on Internet tables has the problems of low accuracy and poor performance; as a result, users are unable to accurately query the corresponding information according to traditional information retrieval methods, further affecting the user's work efficiency. Summary of the invention
[0003] The embodiment of the present invention provides an information retrieval method based on a convolutional neural network and related equipment to solve the problem that the traditional information retrieval method has low accuracy, resulting in users being unable to accurately query information, thereby affecting work efficiency.
[0004] An information retrieval method based on a convolutional neural network, comprising:
[0005] Obtain the query statement input by the query user from the preset database;
[0006] Performing word segmentation processing on the query statement to obtain target word segmentation;
[0007] Applying a pre-trained intent model to perform intent recognition on the target word segmentation to obtain an intent recognition result;
[0008] Matching the intention recognition result with the identification information in a preset model library, wherein the preset model library contains different identification information and semantic slot models corresponding to the identification information;
[0009] If the identification information corresponding to the intention recognition result is matched, the semantic slot model corresponding to the identification information is selected from the preset model library to perform semantic slot type recognition on the target word segmentation to obtain a slot recognition result;
[0010] Determining a query object according to the intention recognition result and the slot recognition result;
[0011] The query result corresponding to the query object is obtained from the query database, and the query result is sent to the query user.
[0012] An information retrieval device based on a convolutional neural network, comprising:
[0013] The acquisition module is used to obtain the query statement input by the query user from the preset database;
[0014] A word segmentation module, used to perform word segmentation processing on the query statement to obtain target word segments;
[0015] An intention recognition module is used to apply a pre-trained intention model to perform intention recognition on the target word segmentation to obtain an intention recognition result;
[0016] A matching module, used to match the intention recognition result with the identification information in a preset model library, wherein the preset model library contains different identification information and semantic slot models corresponding to the identification information;
[0017] A slot recognition module is used to select a semantic slot model corresponding to the identification information from a preset model library to perform semantic slot type recognition on the target word segmentation if the identification information corresponding to the intention recognition result is matched, so as to obtain a slot recognition result;
[0018] A determination module, used to determine a query object according to the intention recognition result and the slot recognition result;
[0019] The sending module is used to obtain the query result corresponding to the query object from the query database, and send the query result to the query user.
[0020] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned information retrieval method based on a convolutional neural network when executing the computer program.
[0021] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned information retrieval method based on a convolutional neural network.
[0022] The above-mentioned information retrieval method, device, computer equipment and storage medium based on convolutional neural network obtain target word segments by segmenting the query statement, use the pre-trained intention model to perform intention recognition on the target word segmentation, match the intention recognition result obtained after recognition with the identification information in the preset model library, select the semantic slot model corresponding to the successfully matched identification information to perform semantic slot type recognition on the target word segmentation, obtain the slot recognition result, determine the query object according to the intention recognition result and the slot recognition result, and finally obtain the query result corresponding to the query object and send it to the query user. Thereby, the query result is automatically fed back according to the query statement, and by combining the intention recognition and slot recognition methods, the query object can be accurately obtained, the accuracy of information query can be improved, and the work efficiency of the user can be further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0024] Figure 1 is a flow chart of an information retrieval method based on a convolutional neural network provided by an embodiment of the present invention;
[0025] Figure 2 is a flowchart of step S2 in the information retrieval method based on a convolutional neural network provided in an embodiment of the present invention;
[0026] Figure 3 is a flowchart of step S3 in the information retrieval method based on a convolutional neural network provided in an embodiment of the present invention;
[0027] Figure 4 is a flowchart of step S31 in the information retrieval method based on a convolutional neural network provided in an embodiment of the present invention;
[0028] Figure 5 It is a flowchart of processing in the case where identification information corresponding to the intention recognition result is not matched in the information retrieval method based on the convolutional neural network provided by an embodiment of the present invention;
[0029] Figure 6 It is a flowchart of processing when the slot recognition result is a recognition failure in the information retrieval method based on a convolutional neural network provided by an embodiment of the present invention;
[0030] Figure 7It is a flowchart of processing when no query result can be found from the query library according to the query object in the information retrieval method based on the convolutional neural network provided by an embodiment of the present invention;
[0031] Figure 8 is a schematic diagram of an information retrieval device based on a convolutional neural network provided by an embodiment of the present invention;
[0032] Fig. 9 This is a basic structural block diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] The information retrieval method based on convolutional neural network provided in the present application is applied to the server side, which can be implemented by an independent server or a server cluster composed of multiple servers. Figure 1 As shown, a convolutional neural network-based information retrieval method is provided, comprising the following steps:
[0035] S1: Obtain the query statement input by the query user from the preset database.
[0036] In this embodiment, by detecting the preset database, when it is detected that there is a query statement in the preset database, the query statement is extracted. The preset database refers to a database specifically used to store the query statement input by the query user.
[0037] It should be noted that when a query statement input by a query user is obtained from a preset database, the query statement is deleted from the preset database.
[0038] S2: Perform word segmentation on the query statement to obtain the target word segmentation.
[0039] In the embodiment of the present invention, the query statement is imported into the preset word segmentation port for word segmentation processing to obtain the target word segmentation after word segmentation processing. The preset word segmentation port refers to a processing port specifically used for word segmentation processing of the query statement.
[0040] Word segmentation refers to the process of recombining continuous word sequences into word sequences according to certain specifications. For example, the continuous word sequence "ABCD" is processed through word segmentation to obtain "AB" and "CD".
[0041] S3: Apply the pre-trained intent model to perform intent recognition on the target word segmentation to obtain the intent recognition result.
[0042] Specifically, by importing the target word segmentation into a pre-trained intent model for intent recognition, the intent model will directly recognize the output result corresponding to the target word segmentation based on the input target word segmentation, and use the output result as the intent recognition result.
[0043] Among them, the pre-trained intent model refers to a convolutional neural network model specifically used for intent recognition of target word segmentation.
[0044] S4: Match the intent recognition result with the identification information in the preset model library, wherein the preset model library contains different identification information and semantic slot models corresponding to the identification information.
[0045] Specifically, the intent recognition result obtained in step S3 is matched with the identification information in the preset model library, wherein the preset model library is used to store different identification information and a database of semantic slot models corresponding to the identification information, and the semantic slot models corresponding to different identification information are also different.
[0046] It should be noted that identification information refers to label information specifically used to match intent recognition results, and different identification information corresponds to different semantic slot models.
[0047] The semantic slot model refers to a convolutional neural network model that is pre-trained according to user needs and is used to identify the semantic slot type of the target word segmentation. Since the semantic slot model is trained by semantic training samples, the recognition effects of the semantic slot models trained with different semantic training samples are also different. Therefore, selecting the semantic slot model corresponding to the intent recognition result, that is, selecting the semantic slot model corresponding to the identification information to identify the semantic slot type of the target word segmentation can ensure the accuracy of recognition.
[0048] S5: If the identification information corresponding to the intent recognition result is matched, the semantic slot model corresponding to the identification information is selected from the preset model library to perform semantic slot type recognition on the target word segmentation to obtain the slot recognition result.
[0049] In an embodiment of the present invention, according to the method of matching the intention recognition result with the identification information in the preset model library in step S4, if the intention recognition result is the same as the identification information, it means that the intention recognition result matches the identification information, and the target word segmentation is imported into the semantic slot model corresponding to the identification information for semantic slot type identification. The semantic slot model will directly identify the output result corresponding to the target word segmentation based on the input target word segmentation, and use the output result as the slot identification result.
[0050] For example, the preset model library contains identification information of "product type", "product cost" and "product specification", and their corresponding semantic slot models are model A, model B and model C respectively. If there is an intention recognition result of "product type", the intention recognition result is matched with the identification information in the preset model library, and the intention recognition result "product type" matches the identification information "product type". Therefore, the semantic slot model model A corresponding to the identification information "product type" is selected to perform semantic slot type recognition on the target word segmentation.
[0051] S6: Determine the query object according to the intent recognition result and the slot recognition result.
[0052] In an embodiment of the present invention, based on the intent recognition result, descriptive information identical to the intent recognition result is queried from a preset information library, and a file list corresponding to the descriptive information is obtained, the file identification information in the file list is matched with the slot recognition result, and the file object corresponding to the successfully matched file identification information is selected as the query object.
[0053] The preset information library is used to store different description information and a file list corresponding to the description information, and the file list includes different file identification information and a file object corresponding to the file identification information.
[0054] For example, if the intent recognition result is "product cost" and the slot recognition result is "product name", there are two description information in the preset information library, namely "product cost" and "product quality", and their corresponding file lists are List A and List B respectively. List A contains two file identification information, namely "product name" and "product ID", and their corresponding file objects are Q1 and W1 respectively; List B contains two file identification information, namely "product specifications" and "product manufacturer", and their corresponding file objects are Q2 and W2 respectively; by matching the intent recognition result "product cost" with the description information, List A is obtained, and then the slot recognition result "product name" is matched with the file identification information in List A to obtain file object Q1 as the query object.
[0055] S7: Obtain the query result corresponding to the query object from the query database, and send the query result to the query user.
[0056] Specifically, according to the query object obtained in step S6, the query object is matched with the query identifier in the query database. If the match is successful, the query result corresponding to the query identifier is obtained, and the query result is sent to the query user according to a preset sending method.
[0057] The query database includes different query identifiers and query results corresponding to the query identifiers.
[0058] The preset sending method can be in the form of email, or it can be set according to the actual needs of the user, and there is no restriction here.
[0059] In this embodiment, the target word segmentation is obtained by segmenting the query statement, the pre-trained intent model is used to perform intent recognition on the target word segmentation, the intent recognition result obtained after recognition is matched with the identification information in the preset model library, the semantic slot model corresponding to the successfully matched identification information is selected to perform semantic slot type recognition on the target word segmentation, and the slot recognition result is obtained. The query object is determined according to the intent recognition result and the slot recognition result, and finally the query result corresponding to the query object is obtained and sent to the query user. In this way, the query result is automatically fed back according to the query statement. By combining intent recognition and slot recognition, the query object can be accurately obtained, the accuracy of information query is improved, and the user's work efficiency is further improved.
[0060] In one embodiment, if Figure 2 As shown, in step S2, the query statement is segmented to obtain the target segmentation, which includes the following steps:
[0061] S21: Filter out non-text characters from the query statement to obtain a plain text.
[0062] In the embodiment of the present invention, non-text character filtering refers to deleting non-text characters in the query statement, and finally retaining only text characters. Since non-text characters may exist in the query statement, in order to avoid interference caused by non-text characters in the subsequent word segmentation process, the query statement is filtered out of non-text characters to ensure the accuracy of the subsequent word segmentation process.
[0063] Specifically, the query statement is imported into a preset filtering port for filtering out non-text characters, and the processed text containing only text characters is obtained, that is, plain text. The preset filtering port refers to a processing port for filtering out non-text characters in the query statement.
[0064] For example, the query statement is: Query "Class A" insurance. There are non-text characters "" in the query statement. The query statement is imported into the preset filtering port to filter out non-text characters and obtain plain text, that is: Query Class A insurance.
[0065] S22: Perform word segmentation processing on the plain text using a preset word segmentation vocabulary to obtain target word segments.
[0066] Specifically, the legal words in the preset word segmentation word library are matched with the plain text respectively. If the plain text matches the same text characters as the legal words, the text characters are determined as the target word segmentation. If the plain text matches the text characters different from the legal words, the single text characters are determined as the target word segmentation. The preset word segmentation word library refers to a database specifically used to store different legal words.
[0067] It should be noted that if new insurance product names are involved, such new insurance names need to be added to the preset word segmentation library as legal words in advance to ensure accurate word segmentation when using the preset word segmentation library.
[0068] Among them, the method of adding new insurance names as legal words to the preset word segmentation vocabulary in advance is that when an insurance company launches a new insurance product name, the user will send the new insurance product name as a legal word to the preset word segmentation vocabulary in advance. If the preset word segmentation vocabulary receives the legal words sent by the user, the legal words will be added to the preset word segmentation vocabulary, thereby continuously improving the legal words in the preset word segmentation vocabulary and ensuring the accuracy of word segmentation processing using the preset word segmentation vocabulary.
[0069] In this embodiment, the query statement is processed by filtering out non-text characters to obtain a plain text, and then the plain text is processed by segmentation using a preset segmentation library to obtain a target segmentation. Thus, the query statement is segmented, and the interference of non-text characters in the segmentation process can be effectively avoided by filtering out non-text characters, further ensuring the accuracy of the segmentation and improving the accuracy of the subsequent intent recognition using the target segmentation.
[0070] In one embodiment, if Figure 3 As shown, the intent model includes an input layer, a convolutional layer, a pooling layer, and a fully connected layer. In step S3, the pre-trained intent model is applied to perform intent recognition on the target word segmentation, and obtaining the intent recognition result includes the following steps:
[0071] S31: Use the input layer to perform word vector conversion on the target word to obtain the word vector.
[0072] In an embodiment of the present invention, the target word segmentation is imported into the input layer of the intent model. After receiving the target word segmentation, the input layer performs word vector conversion processing on the target word segmentation through the word2vec algorithm to obtain the processed word vector.
[0073] Among them, the word2vec algorithm refers to a processing algorithm used to convert word vectors for target word segmentation.
[0074] S32: Perform convolution operation on the word vector according to the convolution layer to obtain a feature matrix.
[0075] In an embodiment of the present invention, the convolution layer includes a convolution kernel pre-set by a user. According to the word vector obtained in step S31, the word vector is imported into the convolution layer. The convolution layer performs a convolution operation on the word vector according to the pre-set convolution kernel, and obtains the corresponding feature matrix through the convolution operation.
[0076] The pre-set convolution kernel refers to a kernel function used for convolution processing set according to actual needs of the user.
[0077] It should be noted that the convolutional layer includes the first convolutional layer, the second convolutional layer and the third convolutional layer, wherein the first convolutional layer contains a one-dimensional convolutional kernel with a length of 1 and the number of channels is 128, and the second convolutional layer and the third convolutional layer both contain a one-dimensional convolutional kernel with a length of 3 and the number of channels is 384.
[0078] S33: Use the pooling layer to reduce the dimension of the feature matrix to obtain the target matrix.
[0079] In the embodiment of the present invention, the pooling layer includes a preset dimensionality reduction function. According to the feature matrix obtained in step S32, the feature matrix is imported into the pooling layer. After receiving the feature matrix, the pooling layer uses the preset dimensionality reduction function to perform dimensionality reduction processing on the feature matrix to obtain a processed target matrix. The preset dimensionality reduction function refers to a processing function used to perform dimensionality reduction processing on the feature.
[0080] S34: The target matrix is processed by the fully connected layer to obtain the intent recognition result.
[0081] Specifically, there are n trained classifiers in the fully connected layer. Each classifier is similar to the target matrix to obtain the probability that the target matrix belongs to the behavior category corresponding to the classifier, and a total of n probabilities are obtained. Among these n classifiers, each classifier has the intent recognition result corresponding to the target matrix and the probability corresponding to the intent recognition result. The probabilities corresponding to the intent recognition results contained in each classifier are compared, and the intent recognition result corresponding to the classifier with the largest probability is selected for output, that is, the intent recognition result with the highest accuracy is output.
[0082] Among them, the intent recognition results corresponding to the classifier and the probabilities corresponding to the intent recognition results can be trained according to actual needs, and the number n of classifiers can also be set as needed. There is no specific restriction here. For example, n is set to 14.
[0083] Classifier implementation methods include but are not limited to: Logistic Regression (LR), Support Vector Machine (SVM), Cross Entropy and Softmax Regression.
[0084] Preferably, the embodiment of the present invention adopts softmax regression to implement classification and recognition of multiple classifiers.
[0085] In this embodiment, the output layer, convolution layer, pooling layer and fully connected layer in the pre-trained intent model are used to perform a series of processing on the target word segmentation to obtain the processed intent recognition result. Thus, the pre-trained intent model can be used to quickly and accurately identify the intent recognition result corresponding to the target word segmentation, ensuring the accuracy of the subsequent determination of the query object using the intent recognition result and slot recognition.
[0086] In one embodiment, if Figure 4 As shown, in step S31, the target word segmentation is converted into a word vector using the input layer, and the word vector is obtained, which includes the following steps:
[0087] S311: Based on the preset corpus, construct the basic word vector for each target word segmentation.
[0088] Specifically, each target word segment is mapped to a vector according to the preset corpus, and these vectors are linked together to form a word vector space, where each vector is equivalent to a point in this space. The preset corpus refers to the database used to construct the basic word vector corresponding to the target word segment.
[0089] For example, the target words are BMW and Mercedes-Benz. Based on the preset corpus, all possible categories of these two target words are obtained: "car", "luxury", "animal", "action" and "food". Therefore, a vector representation is introduced for these two target words:
[0090] <Cars, luxury goods, animals, action, food>;
[0091] Using statistical learning methods to calculate the probability that the two target words belong to each category, the computer may learn:
[0092] BMW = <0.5, 0.2, 0.2, 0.0, 0.1>;
[0093] Mercedes = <0.7, 0.2, 0.0, 0.1, 0.0>.
[0094] It can be understood that the value of each dimension of the basic word vector represents a feature that can be interpreted in a certain semantic and grammatical sense, so each dimension of the basic word vector can be called a target word segmentation feature.
[0095] Furthermore, a keyword word vector is constructed for each target word segment to obtain a basic word vector.
[0096] It should be noted that each target word segment corresponds to a unique basic word vector, and each basic word vector corresponds to at least one target word segment.
[0097] By building a basic word vector for each target word based on a preset corpus, text that cannot be accurately understood by the machine is converted into a word vector that can be easily recognized and calculated by the machine, which is conducive to the accurate recognition of user intentions.
[0098] S312: For each basic word vector, calculate the spatial distance between the basic word vector and other basic word vectors, and select the minimum value from the spatial distances as the minimum spatial distance of the basic word vector.
[0099] Specifically, for each basic word vector, the spatial distance calculation formula is used to calculate the spatial distance between the basic word vector and all other basic word vectors, and the minimum value of these spatial distances is found.
[0100] According to formula (1), the basic word vector A(a1, a2, ..., a n ) and the basic word vector B(b1,b2,...,b n ) between the space distance L:
[0101]
[0102] Where L is the spatial distance, n is a positive integer greater than or equal to 2, and b i and a i They are all basic word vectors.
[0103] For example, if the basic word vectors include G1(0.9, 0.1), G2(0.5, 0.5) and G3(0.8, 0.2), for G1, according to formula (1), the spatial distance from G1 to G2 is 0.5659, and the spatial distance from G1 to G3 is 0.1414, then the minimum spatial distance of G1 is 0.1414.
[0104] S313: Use the basic word vector whose minimum spatial distance is less than or equal to the preset spatial distance threshold as the word vector.
[0105] Specifically, after calculating the minimum spatial distance of each basic word vector according to step S312, these minimum spatial distances are compared with the preset spatial distance threshold, and the basic word vector with the minimum spatial distance less than or equal to the spatial distance threshold is used as the word vector. Among them, the preset spatial distance threshold can be 0.5, or it can be set according to the actual needs of the user, which is not limited here.
[0106] By filtering the basic word vectors that do not meet the preset spatial distance threshold requirements, it is possible to avoid including content with low user attention in the word vector, thereby more accurately determining user intent.
[0107] For example, in a specific embodiment, the preset spatial distance threshold is 0.8, and the basic word vectors include H1 (0.9, 0.1, 0), H2 (0.8, 0.1, 0.1) and H3 (0, 0.1, 0.9). The minimum spatial distance of H1 is calculated by formula (1) in step S312 to be 0.4243, the minimum spatial distance of H2 is 0.4243, and the minimum spatial distance of H3 is 1.1314. The minimum spatial distance of H1 and H2 is less than the preset spatial distance threshold of 0.8. Therefore, H1 and H2 are used as word vectors.
[0108] In this embodiment, the basic word vector of each target word segment is constructed according to the preset corpus, the spatial distance between each basic word vector and other basic word vectors is calculated, and the minimum spatial distance is selected, and the basic word vector with the minimum spatial distance less than or equal to the preset spatial distance threshold is used as the word vector. This can quickly convert the target word segment into the corresponding word vector, which is conducive to the accurate recognition of the word vector by the subsequent intent model, thereby improving the accuracy of subsequent model recognition.
[0109] In one embodiment, if Figure 5 As shown, after step S4, the information retrieval method based on convolutional neural network further includes the following steps:
[0110] S81: If identification information corresponding to the intent recognition result is not matched, the intent recognition result and the query statement are sent to the first target user for confirmation.
[0111] In the embodiment of the present invention, the first target user refers to a processing user who analyzes and confirms the intent recognition result and the query statement in the case where the identification information corresponding to the intent recognition result is not matched.
[0112] Specifically, according to the method of matching the intent recognition result with the identification information in the preset model library in step S4, if the identification information corresponding to the intent recognition result is not matched, it means that there is no semantic slot model in the preset model library that can perform semantic slot type identification on the intent recognition result, and the intent recognition result and the query statement corresponding to the intent recognition result are sent to the first target user in a preset manner.
[0113] The preset method may be in the form of an email or a text message, which is not limited here.
[0114] S82: Receive the initial recognition result fed back by the first target user, and use the initial recognition result as the slot recognition result.
[0115] Specifically, after receiving the intention recognition result and query statement sent in step S81, the first target user obtains an initial recognition result by analyzing and processing the intention recognition result and the query statement, and feeds back the initial recognition result. When it is detected that the initial recognition result exists in the preset first feedback library, the initial recognition result is extracted and used as the slot recognition result.
[0116] The preset first feedback database refers to a database specifically used to store the initial recognition results fed back by the first target user.
[0117] It should be noted that after the initial recognition result is extracted from the preset first feedback library, the extracted initial recognition result is deleted from the preset first feedback library.
[0118] In this embodiment, if the identification information corresponding to the intent recognition result is not matched, the intent recognition result and the query statement are sent to the first target user for confirmation, and finally the initial recognition result fed back by the first target user is received, and the initial recognition result is used as the slot recognition result. In this way, if the identification information corresponding to the intent recognition result is not matched, the slot recognition result can be determined by combining manual interaction, thereby ensuring the accuracy of the subsequent use of the slot recognition result to determine the query object.
[0119] In one embodiment, if Figure 6 As shown, after step S5, the information retrieval method based on convolutional neural network further includes the following steps:
[0120] S91: If the slot recognition result is a recognition failure, then a related question matching the intention recognition result is selected from a preset question library and sent to the querying user for confirmation.
[0121] In an embodiment of the present invention, the slot identification result includes an identification failure. If the slot identification result is an identification failure, the intention identification result corresponding to the slot identification result is matched with the question identifier in a preset question library. When the intention identification result is the same as the question identifier, it indicates that the match is successful, and the associated question corresponding to the question identifier is sent to the querying user for confirmation in a preset manner.
[0122] Among them, the preset question library refers to a database specifically used to store different question identifiers and related questions corresponding to the question identifiers, and the preset question library contains the same question identifiers as all intent recognition results.
[0123] For example, there are two question identifiers in the preset question library, namely "product price" and "product quality", and their corresponding related questions are "What is the price of product C" and "What is the quality of product C". If the intention recognition result is "product price", by matching the intention recognition result with the question identifier, it is found that the intention recognition result "product price" is the same as the question identifier "product price", so the related question "What is the price of product C" corresponding to the question identifier "product price" is sent to the querying user for confirmation in a preset manner.
[0124] S92: receiving feedback information from the query user, and re-recognizing the feedback information as a new query statement.
[0125] Specifically, after receiving the related question, the query user can directly provide the related question as feedback information, or re-enter the query statement as feedback information. When it is detected that there is feedback information in the preset user library, the feedback information is extracted and used as a new query statement. The steps of re-performing intent recognition and slot recognition based on the query statement are continued.
[0126] The preset user database refers to a database specifically used to receive feedback information sent by querying users.
[0127] It should be noted that after the feedback information is extracted from the preset user database, the extracted feedback information is deleted from the preset user database.
[0128] In this embodiment, when the slot recognition result is a recognition failure, the associated questions matching the intent recognition result are selected and sent to the querying user for confirmation, and finally the feedback information fed back by the querying user is used as a new query statement for re-recognition. Thus, when the slot recognition result is a recognition failure, the associated questions can be automatically selected and sent to the querying user for confirmation, avoiding the direct output of the result when the recognition error occurs, and further improving the accuracy of information query.
[0129] In one embodiment, if Figure 7 As shown, after step S6, the information retrieval method based on convolutional neural network further includes the following steps:
[0130] S101: If no query result can be found from the query library according to the query object, the query object and the query statement are sent to the second target user for confirmation.
[0131] In the embodiment of the present invention, the second target user refers to a processing user who analyzes and confirms the query statement in response to the situation that no query result can be found from the query library according to the query object. Since the information under a certain path in the query library may be empty, there may be a situation where the query object has no corresponding query result in the query library.
[0132] Specifically, when no query result can be found from the query library according to the query object, the query object and the query statement corresponding to the query object are sent to the target user in a preset manner for analysis and confirmation.
[0133] S102: receiving a feedback result fed back by a second target user, determining the feedback result as a query result, and sending the result to the query user.
[0134] Specifically, when it is detected that there is a feedback result in the preset second feedback library, the feedback result is extracted, determined as the query result, and sent to the query user in a preset manner. The preset second feedback library refers to a database specifically used to receive feedback results sent by the second target user.
[0135] In this embodiment, if the query result cannot be found from the query library according to the query object, the query object and the query statement are sent to the second target user for confirmation, and finally the feedback result fed back by the second target user is used as the query result and sent to the query user. In this way, when the query result cannot be found according to the query object, the query result can be determined by combining the manual interaction method, thereby improving the accuracy of information query.
[0136] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0137] In one embodiment, a convolutional neural network-based information retrieval device is provided, and the convolutional neural network-based information retrieval device corresponds to the convolutional neural network-based information retrieval method in the above embodiment. Figure 8 As shown, the information retrieval device based on convolutional neural network includes an acquisition module 81, a word segmentation module 82, an intention recognition module 83, a matching module 84, a slot recognition module 85, a determination module 86 and a sending module 87. The functional modules are described in detail as follows:
[0138] An acquisition module 81 is used to acquire a query statement input by a query user from a preset database;
[0139] The word segmentation module 82 is used to perform word segmentation processing on the query statement to obtain target word segments;
[0140] The intention recognition module 83 is used to apply the pre-trained intention model to perform intention recognition on the target word segmentation to obtain the intention recognition result;
[0141] A matching module 84, used to match the intention recognition result with the identification information in the preset model library, wherein the preset model library contains different identification information and semantic slot models corresponding to the identification information;
[0142] The slot identification module 85 is used to select the semantic slot model corresponding to the identification information from the preset model library to perform semantic slot type identification on the target word segmentation if the identification information corresponding to the intention recognition result is matched, so as to obtain the slot recognition result;
[0143] A determination module 86, configured to determine a query object according to the intent recognition result and the slot recognition result;
[0144] The sending module 87 is used to obtain the query result corresponding to the query object from the query database and send the query result to the query user.
[0145] Furthermore, the word segmentation module 82 includes:
[0146] The filtering submodule is used to filter out non-text characters from the query statement to obtain a plain text;
[0147] The plain text segmentation submodule is used to perform segmentation processing on the plain text through a preset segmentation vocabulary to obtain target segmentations.
[0148] Furthermore, the intention recognition module 83 includes:
[0149] The word vector conversion submodule is used to convert the target word into a word vector using the input layer to obtain a word vector;
[0150] The convolution submodule is used to perform convolution operations on word vectors according to the convolution layer to obtain a feature matrix;
[0151] The dimension reduction submodule is used to reduce the dimension of the feature matrix using the pooling layer to obtain the target matrix;
[0152] The operator module is used to perform operations on the target matrix through the fully connected layer to obtain the intent recognition result.
[0153] Furthermore, the word vector conversion submodule includes:
[0154] The construction unit is used to construct the basic word vector of each target word based on the preset corpus;
[0155] A calculation unit, used for calculating, for each basic word vector, the spatial distance between the basic word vector and other basic word vectors, and selecting a minimum value from the spatial distances as the minimum spatial distance of the basic word vector;
[0156] The word vector determination unit is used to use the basic word vector in the minimum spatial distance that is less than or equal to a preset spatial distance threshold as the word vector.
[0157] Furthermore, the information retrieval device based on the convolutional neural network also includes:
[0158] A first sending module, configured to send the intent recognition result and the query statement to the first target user for confirmation if no identification information corresponding to the intent recognition result is matched;
[0159] The first receiving module is used to receive an initial recognition result fed back by a first target user, and use the initial recognition result as a slot recognition result.
[0160] Furthermore, the information retrieval device based on the convolutional neural network also includes:
[0161] The second sending module is used to select a related question matching the intention recognition result from a preset question library and send it to the querying user for confirmation if the slot recognition result is a recognition failure;
[0162] The second receiving module is used to receive feedback information from the query user and re-recognize the feedback information as a new query statement.
[0163] Furthermore, the information retrieval device based on the convolutional neural network also includes:
[0164] A third sending module is used to send the query object and the query statement to the second target user for confirmation if no query result can be found from the query library according to the query object;
[0165] The third receiving module is used to receive the feedback result fed back by the second target user, determine the feedback result as the query result and send it to the query user.
[0166] Some embodiments of the present application disclose computer devices. Fig. 9 , which is a basic structural block diagram of a computer device 90 in one embodiment of the present application.
[0167] like Fig. 9 As shown in FIG. 1 , the computer device 90 includes a memory 91, a processor 92, and a network interface 93 that are interconnected and communicated via a system bus. It should be noted that Fig. 9Only a computer device 90 having components 91-93 is shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.
[0168] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0169] The memory 91 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 91 can be an internal storage unit of the computer device 90, such as a hard disk or memory of the computer device 90. In other embodiments, the memory 91 can also be an external storage device of the computer device 90, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 90. Of course, the memory 91 can also include both the internal storage unit of the computer device 90 and its external storage device. In this embodiment, the memory 91 is generally used to store the operating system and various application software installed on the computer device 90, such as the program code of the information retrieval method based on the convolutional neural network, etc. In addition, the memory 91 can also be used to temporarily store various types of data that have been output or are to be output.
[0170] The processor 92 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 92 is generally used to control the overall operation of the computer device 90. In this embodiment, the processor 92 is used to run the program code stored in the memory 91 or process data, such as running the program code of the information retrieval method based on the convolutional neural network.
[0171] The network interface 93 may include a wireless network interface or a wired network interface. The network interface 93 is generally used to establish a communication connection between the computer device 90 and other electronic devices.
[0172] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores a query information entry program, and the query information entry program can be executed by at least one processor so that the at least one processor performs any step of the above-mentioned information retrieval method based on a convolutional neural network.
[0173] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a computer device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0174] Finally, it should be noted that the embodiments described above are obviously only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to replace some of the technical features therein with equivalents. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present application.
Claims
1. An information retrieval method based on convolutional neural network, characterized in that: The information retrieval method of the convolutional neural network comprises: Obtain the query statement input by the query user from the preset database; Performing word segmentation processing on the query statement to obtain target word segmentation; Applying a pre-trained intent model to perform intent recognition on the target word segmentation to obtain an intent recognition result; The intent model comprises an input layer, a convolutional layer, a pooling layer and a fully connected layer. The specific steps of applying the pre-trained intent model to perform intent recognition on the target word segmentation and obtaining the intent recognition result include: Using the input layer to perform word vector conversion processing on the target word segmentation to obtain a word vector; Performing a convolution operation on the word vector according to the convolution layer to obtain a feature matrix; Using the pooling layer to perform dimensionality reduction processing on the feature matrix to obtain a target matrix; Performing operation processing on the target matrix through the fully connected layer to obtain the intention recognition result; Matching the intention recognition result with the identification information in a preset model library, wherein the preset model library contains different identification information and semantic slot models corresponding to the identification information; If the identification information corresponding to the intention recognition result is matched, the semantic slot model corresponding to the identification information is selected from the preset model library to perform semantic slot type recognition on the target word segmentation to obtain a slot recognition result; Determine a query object according to the intention recognition result and the slot recognition result, query the description information identical to the intention recognition result from a preset information library according to the intention recognition result, obtain a file list corresponding to the description information, match the file identification information in the file list with the slot recognition result, and select the file object corresponding to the successfully matched file identification information as the query object, wherein the preset information library is used to store different description information and the file list corresponding to the description information, and the file list contains different file identification information and the file objects corresponding to the file identification information; Obtaining the query result corresponding to the query object from the query database, and sending the query result to the query user; The specific step of obtaining the query result corresponding to the query object from the query database includes: Matching the query object with the query identifier in the query database, and if the match is successful, obtaining the query result corresponding to the query identifier; the query database contains different query identifiers and query results corresponding to the query identifiers; After the step of determining the query object according to the intention recognition result and the slot recognition result, the specific method of information retrieval based on convolutional neural network further includes: If the query result cannot be found from the query database according to the query object, sending the query object and the query statement to a second target user for confirmation; The feedback result fed back by the second target user is received, the feedback result is determined as the query result, and the result is sent to the query user.
2. The information retrieval method based on convolutional neural network according to claim 1, characterized in that: The step of performing word segmentation processing on the query statement to obtain target word segments includes: Filter out non-text characters from the query statement to obtain a plain text; The plain text is segmented using a preset segmentation vocabulary to obtain the target segmented words.
3. The information retrieval method based on convolutional neural network according to claim 1, characterized in that: The step of using the input layer to convert the target word into a word vector to obtain a word vector comprises: Based on a preset corpus, construct a basic word vector for each of the target words; For each of the basic word vectors, calculate the spatial distance between the basic word vector and other basic word vectors, and select the minimum value from the spatial distances as the minimum spatial distance of the basic word vector; The basic word vector in the minimum spatial distance that is less than or equal to the preset spatial distance threshold is used as the word vector.
4. The information retrieval method based on convolutional neural network according to claim 1, characterized in that: After the step of matching the intention recognition result with the identification information in the preset model library, the information retrieval method based on the convolutional neural network further includes: If no identification information corresponding to the intention recognition result is matched, sending the intention recognition result and the query statement to the first target user for confirmation; An initial recognition result fed back by the first target user is received, and the initial recognition result is used as the slot recognition result.
5. The information retrieval method based on convolutional neural network according to claim 1, characterized in that: If the identification information corresponding to the intention recognition result is matched, the semantic slot model corresponding to the identification information is selected from the preset model library to perform semantic slot type recognition on the target word segmentation, and after the step of obtaining the slot recognition result, the information retrieval method based on the convolutional neural network also includes: If the slot recognition result is a recognition failure, then a related question matching the intention recognition result is selected from a preset question library and sent to the querying user for confirmation; Receive feedback information from the query user, and re-identify the feedback information as a new query statement.
6. An information retrieval device based on a convolutional neural network, characterized in that: The information retrieval device based on convolutional neural network includes: The acquisition module is used to obtain the query statement input by the query user from the preset database; A word segmentation module, used to perform word segmentation processing on the query statement to obtain target word segments; An intention recognition module is used to apply a pre-trained intention model to perform intention recognition on the target word segmentation to obtain an intention recognition result; A matching module, used to match the intention recognition result with the identification information in a preset model library, wherein the preset model library contains different identification information and semantic slot models corresponding to the identification information; A slot recognition module is used to select a semantic slot model corresponding to the identification information from a preset model library to perform semantic slot type recognition on the target word segmentation if the identification information corresponding to the intention recognition result is matched, so as to obtain a slot recognition result; A determination module, used to determine a query object according to the intention recognition result and the slot recognition result, query the description information identical to the intention recognition result from a preset information library according to the intention recognition result, obtain a file list corresponding to the description information, match the file identification information in the file list with the slot recognition result, and select the file object corresponding to the successfully matched file identification information as the query object, wherein the preset information library is used to store different description information and the file list corresponding to the description information, and the file list contains different file identification information and the file objects corresponding to the file identification information; A sending module, used to obtain the query result corresponding to the query object from the query database, and send the query result to the query user; The intent model includes an input layer, a convolutional layer, a pooling layer and a fully connected layer, and the intent recognition module includes: A word vector conversion submodule, used to perform word vector conversion processing on the target word segmentation using the input layer to obtain a word vector; A convolution submodule, used for performing a convolution operation on the word vector according to the convolution layer to obtain a feature matrix; A dimensionality reduction submodule, used for performing dimensionality reduction processing on the feature matrix using the pooling layer to obtain a target matrix; An operator module, used for performing operation processing on the target matrix through the fully connected layer to obtain the intention recognition result; The sending module is further used for: Matching the query object with the query identifier in the query database, and if the match is successful, obtaining the query result corresponding to the query identifier; the query database contains different query identifiers and query results corresponding to the query identifiers; The information retrieval device of the convolutional neural network also includes: A third sending module is used to send the query object and the query statement to a second target user for confirmation if the query result cannot be found from the query database according to the query object; The third receiving module is used to receive the feedback result fed back by the second target user, determine the feedback result as the query result, and send it to the query user.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the information retrieval method based on a convolutional neural network as described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the information retrieval method based on a convolutional neural network as described in any one of claims 1 to 5 are implemented.
