Search intention identification method and device

文档序号:1363091 发布日期:2020-08-11 浏览:14次 中文

阅读说明:本技术 一种搜索意图识别方法及装置 (Search intention identification method and device ) 是由 张新展 王文博 费浩峻 于 2020-04-21 设计创作,主要内容包括:本申请提供了一种搜索意图识别方法及装置,该方案首先利用规则模型对待识别搜索文本进行意图识别得到相应的第一识别结果;对于准确率低于第一预设值的待识别搜索文本,利用深度学习模型重新进行意图识别得到对应的意图类别。利用规则模型识别得到的准确率高于第一预设值的待识别搜索文本,直接确定对应的第一识别结果为该待识别搜索文本对应的意图类别。由上述内容可知,该方案利用多个模型对待识别搜索文本进行多层次识别,使用规则模型保证识别准确率,对于规则模型识别不准确或无法识别的数据,再使用深度学习模型进行识别,从而保证识别结果的召回率,因此,最终得到的搜索意图识别结果准确率和召回率都很高。(The scheme includes that firstly, a rule model is used for identifying intentions of a search text to be identified to obtain a corresponding first identification result; and for the text to be recognized with the accuracy rate lower than the first preset value, carrying out intention recognition again by using the deep learning model to obtain the corresponding intention category. And identifying the searched text to be identified with the accuracy higher than the first preset value by using the rule model, and directly determining the corresponding first identification result as the intention category corresponding to the searched text to be identified. According to the above content, the scheme utilizes a plurality of models to recognize the text to be recognized in a multi-level mode, the rule models are used for ensuring the recognition accuracy, and the deep learning models are used for recognizing data which are inaccurate or can not be recognized by the rule models, so that the recall rate of the recognition result is ensured, and therefore, the accuracy and the recall rate of the finally obtained recognition result of the search intention are high.)

1. A search intention recognition method, characterized by comprising:

performing intention recognition on the obtained to-be-recognized search text by using a rule model to obtain a first recognition result, wherein the first recognition result comprises intention categories and corresponding accuracy rates corresponding to the to-be-recognized search text, the rule model comprises a plurality of recognition rules, and each recognition rule comprises a plurality of feature dictionaries in a preset sequence and corresponds to one intention category;

for a first recognition result with the accuracy higher than a first preset value, determining an intention category in the first recognition result as an intention category of a corresponding to-be-recognized search text;

and for the first recognition result with the accuracy rate lower than the first preset value, carrying out intention recognition again on the search text to be recognized corresponding to the first recognition result by utilizing a deep learning model obtained through pre-training to obtain a corresponding intention category.

2. The method according to claim 1, wherein for a first recognition result with an accuracy rate lower than the first preset value, performing intention recognition again on the search text to be recognized corresponding to the first recognition result by using a deep learning model obtained by pre-training to obtain a corresponding intention category, and including:

for the text to be recognized, which can be recognized by the rule model and has accuracy lower than the first preset value, performing intention recognition again by using a first deep learning model obtained by pre-training to obtain a classification result of whether the first recognition result of the text to be recognized is correct or not;

and for the search text to be recognized which cannot be recognized by the rule model, performing intention recognition again by using a pre-trained second deep learning model to obtain a corresponding intention category.

3. The method according to claim 2, wherein for the text to be recognized, which can be recognized by the rule model and has accuracy lower than the first preset value, the intention recognition is performed again by using a first deep learning model obtained by pre-training to obtain a classification result indicating whether the first recognition result of the text to be recognized is correct, and the method comprises:

performing intention recognition again on the to-be-recognized search text which can be recognized by the rule model but has accuracy lower than the first preset value by using the first deep learning model to obtain a second recognition result;

if the second recognition result is of a correct type, determining that the first recognition result corresponding to the search text to be recognized is correct; and if the second recognition result is of an incorrect category, determining that the first recognition result corresponding to the search text to be recognized is incorrect.

4. The method according to claim 2, wherein for the search text to be recognized which cannot be recognized by the rule model, performing intent recognition again by using a second deep learning model trained in advance to obtain a corresponding intent category, comprising:

performing intention recognition on the text to be recognized, which cannot be recognized by the rule model, by using a primary classification model in the second deep learning model to obtain a primary intention category of the text to be recognized;

and performing intention recognition on the search text to be recognized by using a secondary classification model corresponding to the primary intention category to obtain a secondary intention category of the search text to be recognized.

5. The method according to any of claims 1-4, wherein the rule model is obtained as follows:

screening candidate search data sets from user search data;

carrying out special word mining on the candidate search data set to obtain special words;

dividing each piece of data in the candidate search data set to obtain candidate subsequences;

dividing the special words not contained in the existing feature dictionary and the words in the candidate subsequence into corresponding feature dictionaries to obtain an updated feature dictionary;

marking the feature dictionary to which the words in each candidate subsequence belong by using the updated feature dictionary to generate a recognition rule;

and marking the corresponding intention category for each identification rule to obtain the rule model.

6. The method according to any one of claims 1-4, wherein the training process of the first deep learning model is as follows:

screening candidate search data sets from user search data;

performing intention identification on each candidate search data in the candidate search data set by using a rule model obtained in advance to obtain a corresponding identification result;

performing category labeling on the first type candidate search data with the accuracy rate lower than a first preset value, which is obtained by the rule model identification;

merging the marked first type of candidate search data with second type of candidate search data which is obtained by the identification of the rule model and has higher accuracy than the first preset value to obtain a first training sample data set;

and training the LSTM model by using the data in the first training sample data set to obtain a target LSTM model.

7. The method according to any one of claims 1-4, wherein the second deep learning model is trained as follows:

screening candidate search data sets from user search data;

performing intention identification on each candidate search data in the candidate search data set by using a rule model obtained in advance to obtain a corresponding identification result;

performing category labeling on third type candidate search data which cannot be identified by the rule model;

merging the marked third type candidate search data with the second type candidate search data which is obtained by the rule model identification and has higher accuracy than the first preset value to obtain a second training sample data set;

training an LSTM model based on an attention mechanism by using the data in the second training sample data set to obtain a primary classification model;

and respectively training corresponding text CNN models aiming at training sample data sets corresponding to all secondary classes contained in the primary classes to obtain secondary classification models corresponding to all the secondary classes, wherein the second deep learning model comprises all the primary classification models obtained by training and all the secondary classification models corresponding to all the primary classification models.

8. A search intention recognition apparatus, characterized by comprising:

the first intention recognition module is used for performing intention recognition on the obtained to-be-recognized search text by utilizing a rule model to obtain a first recognition result, wherein the first recognition result comprises intention categories and corresponding accuracy rates corresponding to the to-be-recognized search text, the rule model comprises a plurality of recognition rules, and each recognition rule comprises a plurality of feature dictionaries in a preset sequence and corresponds to one intention category;

the first determination module is used for determining the intention category in the first recognition result as the intention category of the corresponding to-be-recognized search text for the first recognition result with the accuracy higher than a first preset value;

and the second intention recognition module is used for carrying out intention recognition on the first recognition result with the accuracy rate lower than the first preset value again on the search text to be recognized corresponding to the first recognition result by utilizing a deep learning model obtained through pre-training to obtain the corresponding intention category.

9. The apparatus of claim 8, wherein the second intent recognition module comprises:

the first intention recognition submodule is used for carrying out intention recognition again by utilizing a first deep learning model obtained by pre-training aiming at the text to be recognized, which can be recognized by the rule model and has the accuracy lower than the first preset value, so as to obtain a classification result of whether the first recognition result of the text to be recognized is correct or not;

and the second intention recognition submodule is used for carrying out intention recognition again by utilizing a second deep learning model trained in advance aiming at the text to be recognized which cannot be recognized by the rule model, so as to obtain the corresponding intention category.

10. The apparatus of claim 9, wherein the first intent recognition sub-module is specifically configured to:

performing intention recognition again on the to-be-recognized search text which can be recognized by the rule model but has accuracy lower than the first preset value by using the first deep learning model to obtain a second recognition result;

if the second recognition result is of a correct type, determining that the first recognition result corresponding to the search text to be recognized is correct; and if the second recognition result is of an incorrect category, determining that the first recognition result corresponding to the search text to be recognized is incorrect.

11. The apparatus of claim 9, wherein the second intent recognition submodule is specifically configured to:

performing intention recognition on the text to be recognized, which cannot be recognized by the rule model, by using a primary classification model in the second deep learning model to obtain a primary intention category of the text to be recognized;

and performing intention recognition on the search text to be recognized by using a secondary classification model corresponding to the primary intention category to obtain a secondary intention category of the search text to be recognized.

Technical Field

The invention belongs to the technical field of computers, and particularly relates to a search intention identification method and device.

Background

The search intention identification refers to the steps of disassembling and analyzing search terms of the user to obtain the intention and the demand of the user, so that the most needed products or contents of the user are recommended to the user. It can be seen that improving the search recognition intent can improve the accuracy of product or content recommendations.

The existing search intention identification scheme is to adopt word vectors to carry out semantic representation on search terms, the word vectors are obtained based on the meaning of context, the search terms have non-standard and short length, and almost no context exists, the obtained word vectors have poor representation capability, and the final intention identification accuracy is low.

Disclosure of Invention

In view of the above, the present invention provides a method and an apparatus for identifying a search intention to solve the technical problem of low identification accuracy in the conventional technical solution, and the disclosed technical solution is as follows:

in one aspect, the present invention provides a search intention identification method, including:

performing intention recognition on the obtained to-be-recognized search text by using a rule model to obtain a first recognition result, wherein the first recognition result comprises intention categories and corresponding accuracy rates corresponding to the to-be-recognized search text, the rule model comprises a plurality of recognition rules, and each recognition rule comprises a plurality of feature dictionaries in a preset sequence and corresponds to one intention category;

for a first recognition result with the accuracy higher than a first preset value, determining an intention category in the first recognition result as an intention category of a corresponding to-be-recognized search text;

and for the first recognition result with the accuracy rate lower than the first preset value, carrying out intention recognition again on the search text to be recognized corresponding to the first recognition result by utilizing a deep learning model obtained through pre-training to obtain a corresponding intention category.

In another aspect, the present invention also provides a search intention identifying apparatus, including:

the first intention recognition module is used for performing intention recognition on the obtained to-be-recognized search text by utilizing a rule model to obtain a first recognition result, wherein the first recognition result comprises intention categories and corresponding accuracy rates corresponding to the to-be-recognized search text, the rule model comprises a plurality of recognition rules, and each recognition rule comprises a plurality of feature dictionaries in a preset sequence and corresponds to one intention category;

the first determination module is used for determining the intention category in the first recognition result as the intention category of the corresponding to-be-recognized search text for the first recognition result with the accuracy higher than a first preset value;

and the second intention recognition module is used for carrying out intention recognition on the first recognition result with the accuracy rate lower than the first preset value again on the search text to be recognized corresponding to the first recognition result by utilizing a deep learning model obtained through pre-training to obtain the corresponding intention category.

According to the search intention identification method, firstly, intention identification is carried out on a search text to be identified by using a rule model to obtain a corresponding first identification result; and for the text to be recognized with the accuracy rate lower than the first preset value, carrying out intention recognition again by using the deep learning model to obtain the corresponding intention category. And identifying the searched text to be identified with the accuracy higher than the first preset value by using the rule model, and directly determining the corresponding first identification result as the intention category corresponding to the searched text to be identified. According to the above content, the scheme utilizes a plurality of models to recognize the text to be recognized in a multi-level mode, the rule models are used for ensuring the recognition accuracy, and the deep learning models are used for recognizing data which are inaccurate or can not be recognized by the rule models, so that the recall rate of the recognition result is ensured, and therefore, the accuracy and the recall rate of the finally obtained recognition result of the search intention are high.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.

Fig. 1 is a flowchart of a search intention identification method provided in an embodiment of the present application;

FIG. 2 is a block diagram of a search intention recognition system according to an embodiment of the present disclosure;

FIG. 3 is a flow chart of a rule model building process provided by an embodiment of the present application;

FIG. 4 is a flowchart of a deep learning model training process provided by an embodiment of the present application;

fig. 5 is a schematic structural diagram of a search intention recognition apparatus according to an embodiment of the present application;

fig. 6 is a schematic structural diagram of a second intention identification module according to an embodiment of the present application.

Detailed Description

With the rapid development of internet technology, users can search various products or information desired by themselves in various websites, leave a series of search behavior track information during searching, and determine the final appeal of the user search behavior, namely, the goods or information desired by the user, namely, the intention of the user search behavior, by analyzing the search behavior of the user. So as to further show or push the information desired by the user to the user. The user intention recognition method provided by the present application will be described in detail below with reference to the accompanying drawings.

Referring to fig. 1, a flowchart of a method for identifying search intention provided by an embodiment of the present application is shown, where the method is applied to a device with computing capability, and as shown in fig. 1, the method mainly includes the following steps:

and S110, performing intention recognition on the obtained text to be recognized by using the rule model to obtain a first recognition result.

The rule model is obtained by analyzing a large amount of user search data, each recognition rule in the rule model corresponds to an intention category, and each recognition rule comprises a plurality of feature dictionaries in a preset sequence.

The search text to be recognized is the search text which needs to be subjected to intention recognition, and can be any one or more of the user search terms.

In one embodiment of the application, the rule model includes a template Pattern and a feature dictionary featured component.

For example, the template 1: 0-30 of [ W:0-30 of ] [ D: Bank of ] [ W:0-30 of ] [ D: Loan _ indicator of ] [ W:0-30 of ];

template 2 is as follows:

[W:0-30][D:WeiLiDai_Indicate][W:0-30][D:Loan_Indicate][W:0-30][D:Loan_Interest][W:0-30]。

in the template, [ W:0-30] is wildcard, which represents that 0-30 non-dictionary words are matched; the [ D: XXX ] is a feature dictionary containing a category of words, for example, the feature dictionary [ D: HuaBai _ indicator ] includes flower bei, ant flower bei, borrow.

The template 1 comprises two vocabulary dictionaries and is [ D: Bank ], [ D: Loan _ indicator ] from front to back. Wherein [ D: Bank ] represents a Bank vocabulary dictionary, and [ D: Loan _ Indicate ] represents a Loan vocabulary dictionary.

The template 2 comprises three vocabulary dictionaries and is sequentially from front to back: [ D: WeiLiDai _ Indicate ], [ D: Loan _ Interest ], wherein [ D: WeiLiDai _ Indicate ] particle Loan brand dictionary, [ D: Loan _ Indicate ] Loan vocabulary dictionary, and [ D: Loan _ Interest ] Loan Interest vocabulary dictionary.

For example, the words contained in a search text are matched with the vocabulary dictionary in the template 2 in the order from front to back, and the intention category of the search text is determined as the category label of the template 2, i.e. the particle credit-interest.

The first recognition result comprises the intention category and the corresponding accuracy rate corresponding to the search text to be recognized.

It should be noted that the accuracy of the first recognition result obtained by the rule model is the accuracy corresponding to the corresponding recognition rule, for example, if the search text to be recognized is completely matched with the recognition rule 1 in the rule model, the intention category corresponding to the recognition rule 1 is category a, and the accuracy of the recognition rule 1 is 90%, the intention category of the search text to be recognized is category a, and the accuracy is 90%.

Wherein, the accuracy rate corresponding to each identification rule is the proportion of the number of the correct search terms identified by the identification rule to the total number of the terms identified by the identification rule, namely: the accuracy rate is the number of recognized correct entries/the total number of recognized entries.

S120, for the first recognition result with the accuracy higher than the first preset value, determining the intention category in the first recognition result as the intention category of the corresponding to-be-recognized search text.

If the accuracy of the recognition result obtained by recognizing a certain search text by using the rule model is high, for example, higher than a certain preset value (the preset value can be determined according to the actual accuracy of the rule model), the intention category obtained by recognition by the rule model is taken as the intention category of the search text.

S130, for the first recognition result with the accuracy rate lower than the first preset value, carrying out intention recognition again on the search text to be recognized corresponding to the first recognition result by utilizing a deep learning model obtained through pre-training to obtain a corresponding intention category.

If the accuracy of the recognition result obtained by recognizing a certain search text by using the rule model is low, for example, the accuracy is lower than a certain preset value, the recognition result is considered to have errors, and then the deep learning model obtained by training in advance is continuously used for carrying out intention recognition on the search text to be recognized with low accuracy again, so that the intention category corresponding to the search text is obtained.

The rule model is high in identification accuracy and high in processing speed, but the rule model is suitable for identifying the search texts with short lengths, and the identification accuracy of the search texts with long lengths is low, even the search texts cannot be identified.

In one embodiment of the application, in order to improve the recognition efficiency and the recall rate, for the search text which can be recognized by the rule model but is low in accuracy, a two-classification deep learning model (namely, a first deep learning model) is adopted to verify whether a first recognition result obtained by the rule model is accurate. And for the search text which cannot be identified by the rule model, identifying the intention category of the search text by adopting a multi-classification deep learning model (namely, a second deep learning model).

In one possible implementation, the process of verifying the first recognition result by using the first deep learning model is as follows:

carrying out intention recognition on the to-be-recognized search text with the accuracy rate lower than the first preset value again by using the first deep learning model to obtain a second recognition result; the second recognition result includes two categories of correct and incorrect; if the second recognition result is of the correct type, the first recognition result obtained by the rule model is correct; and if the second recognition result is of an incorrect category, indicating that the first recognition result obtained by the rule model is incorrect.

In another possible implementation manner, the second deep learning model re-identifies the search text as follows:

performing intention recognition on the text to be recognized, which cannot be recognized by the rule model, by using a primary classification model in the second deep learning model to obtain a primary intention category of the text to be recognized; for example,

and then, performing intention recognition on the search text to be recognized by using a secondary classification model corresponding to the primary intention category to obtain a secondary intention category of the search text to be recognized.

In an embodiment of the present application, the first deep learning model may be implemented by using a long short-term memory network (LSTM) model; the second deep learning model may employ an attention-based LSTM model and a textual CNN network. The framework of the search intention recognition system provided by the embodiment is shown in fig. 2, wherein the first layer is a rule model, the second layer is an LSTM model, and the third layer is an attention-based LSTM model and a text CNN network.

According to the search intention identification method provided by the embodiment, firstly, intention identification is carried out on a to-be-identified search text by utilizing a rule model to obtain a corresponding first identification result; and for the text to be recognized with the accuracy rate lower than the first preset value, carrying out intention recognition again by using the deep learning model to obtain the corresponding intention category. And identifying the searched text to be identified with the accuracy higher than the first preset value by using the rule model, and directly determining the corresponding first identification result as the intention category corresponding to the searched text to be identified. According to the above content, the scheme utilizes a plurality of models to recognize the text to be recognized in a multi-level mode, the rule models are used for ensuring the recognition accuracy, and the deep learning models are used for recognizing data which are inaccurate or can not be recognized by the rule models, so that the recall rate of the recognition result is ensured, and therefore, the accuracy and the recall rate of the finally obtained recognition result of the search intention are high. The recall rate is recall rate, that is, the proportion of data correctly predicted to be positive to all data actually positive.

The process of constructing the rule model and the deep learning model will be described in detail below with reference to fig. 3 to 4.

As shown in fig. 3, the process of building the rule model includes:

s210, screening candidate search data sets from the user search data.

In an embodiment of the present application, the search data of the users in the whole network is preprocessed, for example, the search data of the users is denoised, that is, noise data such as completely irrelevant data or data that needs to be masked is removed.

And then, carrying out Random Walk (Random Walk) on the preprocessed user search data by utilizing the seed words to obtain a candidate search data set. The candidate search data set is user search data used to obtain the rule model. For example, the seed word may be an XX loan, a personal spending loan, an XX bank personal loan.

The random walk algorithm is widely applied to the field of data mining, a plurality of random walks are constructed by the random walk algorithm, the random walks are initialized from a certain node, and then a certain adjacent node of the current node is randomly accessed in each step of random walk.

And S220, carrying out proprietary word mining on the candidate search data set to obtain proprietary words.

For each candidate search data, according toThe mutual point information pmi (x, y) and the degree of freedom free (w) between words are calculated as followsi):

free(wi)=min(le(wi),re(wi)) (2)

In formula 1, p (x, y) represents the probability of x and y appearing together, p (x, y) ═ x, y appearing number of times/total text number, p (x) represents the probability of x appearing, p (x) ═ x appearing number of times/total text number, p (y) represents the probability of y appearing, and p (y) ═ y appearing number of times/total text number;

in equation 2, le (w)i) Denotes the current word wiThe entropy of the words appearing on the left, where,in this formula, piIs wiProbability of a word appearing on the left, assuming that a word is at wiThe number of occurrences on the left is n, wiIf m words appear in the left-hand side, p isi=n/m;re(wi) Entropy of information representing a word appearing to the right of the current word, calculation procedure and le (w)i) The same is not described in detail here.

The point mutual information is used for measuring whether the word collocation is reasonable, and the degree of freedom is used for measuring the richness of left adjacent characters and right adjacent characters of a word. The more the degree of freedom and the point mutual information are, the higher the possibility of word formation is, in the concrete implementation, a threshold value is set, and the word combination with the degree of freedom and the point mutual information larger than the threshold value is considered to be a special word.

And S230, segmenting the special word, and dividing each piece of data in the candidate search data set to obtain candidate subsequences.

And respectively carrying out N-gram (such as 2-gram and 3-gram) on the candidate search data set to obtain corresponding sub-sequences, and screening the sub-sequences with high TF-IDF to obtain candidate sub-sequences.

N-Gram is an algorithm based on a statistical language model. The basic idea is to perform a sliding window operation with the size of N on the content in the text according to bytes to form a byte fragment sequence with the length of N.

For example, the search data is "what is the interest of the personal loan of the Beijing bank", the word segmentation is performed to obtain the/personal/loan/interest/yes/how many of the Beijing bank, and the subsequence obtained by performing 2-gram is as follows: beijing Bank-loan, personal-loan, loan-interest, the 3-gram is carried out to obtain the subsequence as: beijing Bank-loan-interest.

TF-IDF, i.e., word frequency-inverse document frequency, means that if a word or phrase occurs frequently in one article (i.e., TF is high) and rarely occurs in other articles (i.e., IDF is high), the word or phrase is considered to have a good class distinction ability, i.e., to be suitable for classification.

S240, classifying the participles of the special words and the words in the candidate subsequence based on the feature dictionary, and updating the words not included in the feature dictionary to the dictionary to obtain an updated feature dictionary.

Training word vectors on the candidate search data set, obtaining words in the candidate subsequence obtained in step S230 and word vectors corresponding to the participles of the special words, and calculating words not included in the existing feature dictionary (i.e. the word X to be classified)i) With words in the feature dictionary (i.e. known class words Y)i) The distance between the two words X to be classified is determinediKnown class word Y with the smallest distance between themiIs the category of the word to be classified.

And S250, labeling the feature dictionary to which the words in each candidate subsequence belong by using the updated feature dictionary, and generating a recognition rule.

Labeling the category of each word in the candidate subsequence obtained in the step S230 by using the updated feature dictionary, for example, if the candidate subsequence is particle credit-Interest, the particle credit belongs to a dictionary [ D: WeiLiDai _ indication ], and the Interest belongs to a dictionary [ D: Loan _ Interest ], then generating the recognition rule as: [ W:0-30] [ D: WeiLiDai _ indicator ] [ W:0-30] [ D: Loan _ Interest ] [ W:0-30 ].

And S260, marking the corresponding intention type for each identification rule to obtain a rule model.

In one embodiment of the present application, the feature dictionary in each recognition rule (i.e., each template) is prioritized, and an intention category tag corresponding to each template is generated.

For example, the brand dictionary in the template has a higher priority than the normal vocabulary dictionary, e.g., [ W:0-30] [ D: WeiLiDai _ Indicate ] [ W:0-30] [ D: Loan _ Indicate ] [ W:0-30] [ D: Loan _ Inte rest ] [ W:0-30], where [ D: WeiLiDai _ Indicate ] is the particle crediting brand dictionary and [ D: Loan _ Indicate ] and [ D: Loan _ Interest ] are the normal vocabulary dictionaries. Thus, the intent category tag of this template is: particle credit-interest. For example, the subsequence "fines credit-loan-interest" matches the template, and thus the intended category for determining the subsequence is fines credit-interest.

After the rule model is created, the search text to be identified is input into an identifier containing the rule model, and an identification result, for example, (query, pattern, tag) triple is output, where query in the triple is a search term, pattern is a matched template, and tag is an intention category.

In the process of creating the rule model provided by this embodiment, the arrangement order among the feature dictionaries included in the template is considered when the template is constructed, so that when the rule model is used to perform intent recognition on a search text, the order of words in the search text is the same as the order of matching dictionaries in the template, and the search text is considered to be matched with the template.

Referring to fig. 4, a flowchart of a deep learning model training process provided in an embodiment of the present application is shown, where the deep learning model in the embodiment includes a first deep learning model and a second deep learning model.

The training process of the first deep learning model is as follows:

s310, screening candidate search data sets from the user search data.

The step is the same as the implementation process of S210, and is not described herein again.

And S320, performing intention identification on each candidate search data in the candidate search data set by using a rule model obtained in advance to obtain a corresponding identification result.

And for each candidate search data in the screened candidate search data set, performing intention identification by using a rule model to obtain a corresponding identification result.

For the data with low accuracy, executing S330; s360 is performed for data that cannot be identified by the rule model.

S330, performing category labeling on the first type candidate search data with the accuracy rate lower than the first preset value, which is obtained by the rule model identification.

And carrying out category marking on partial data with low accuracy, namely the first-class candidate search data, wherein the category marking is carried out based on manual experience.

And carrying out category marking on partial data with low rule model identification accuracy, and screening out data serving as a sample.

S340, merging the labeled first-class candidate search data and second-class candidate search data which is obtained by the rule model identification and has higher accuracy than a first preset value to obtain a first training sample data set.

And then, merging the marked data and the data with high accuracy to obtain a first training sample data set.

And S350, training the LSTM model by using the data in the first training sample data set to obtain the target LSTM model.

In one embodiment of the application, the first training sample data set is divided into a training data set, a test data set, an evaluation data set. Wherein the training data set is used for training the model, the test data set is used for evaluating the effect of the current model in the model training process, and the evaluation data set is used for evaluating the effect of the trained model

And training the LSTM model by utilizing a training data set to obtain an LSTM two-classification model, wherein the LSTM two-classification model is used for verifying whether the intention type of the search data with lower accuracy output by the rule model is correct or not, so that the two output types are correct and incorrect respectively.

The process of training the model is a process of learning what kind of characteristics the training sample data of the same category has.

And then, evaluating the recognition effect of the LSTM two-class model obtained by training by utilizing the evaluation data set, and if the recognition effect accords with the expected effect, determining that the current model is the final target LSTM model. And if the recognition effect of the current model does not accord with the expected effect, re-executing S330-S350, and screening more data for training and evaluating the LSTM two-class model.

The training process of the second deep learning model is as follows:

and S360, performing category marking on the third type candidate search data which cannot be identified by the rule model.

And performing category labeling on candidate search data which cannot be identified by the rule model, namely the third type of candidate search data based on manual experience.

The second deep learning model can identify and obtain a first-level category and a second-level category, so that when the sample data is labeled, the two-level categories also need to be labeled, for example, credit and financing are the first-level categories, car loan, house loan and the like are the second-level categories of credit, and if a certain piece of search data relates to house loan, the labeled label of the search data is credit-house loan.

And S370, merging the labeled third-class candidate search data with the second-class candidate search data which is obtained by the rule model identification and has higher accuracy than the first preset value to obtain a second training sample data set.

And merging the marked third type candidate search data with the candidate search data with higher accuracy to obtain a second training sample data set.

And S380, training an LSTM model based on an attention mechanism by using data in the second training sample data set to obtain a primary classification model.

The second deep learning model includes a first-level model (i.e., the LSTM-Attention model) and a second-level model (the TextCNN model), and thus, two-level models need to be trained separately.

Dividing the second training sample data set into a training data set, a test data set and an evaluation data set, and training the LSTM-Attention model by using the training data set; the current LSTM-Attention model is then evaluated using the evaluation dataset, and the current LSTM-Attention model is determined to be the final first-level classification model if the identified effect corresponds to the expected effect. And if the recognition effect of the current LSTM-Attention model does not accord with the expected effect, repeating S360-S380, and screening more data for model training and evaluation.

And S390, respectively training the corresponding text CNN models according to the second training sample data corresponding to each secondary class corresponding to each primary class to obtain a secondary classification model corresponding to each secondary class.

And for each primary class, training the TextCNN model corresponding to the secondary class by using a training sample data set which is contained in the primary class and has the same secondary classification label. For example, the primary category "credit" includes three secondary categories: and (4) house credit, car credit and consumption credit, training according to each secondary classification to obtain a corresponding secondary classification model, and training by using corresponding training sample data to obtain a corresponding secondary classification model.

Then, the recognition effect of the TextCNN model corresponding to the current secondary category is evaluated by using the corresponding evaluation data set, and if the effect is in accordance with the expected effect, the current model is used as the secondary classification model corresponding to the secondary category. And if the effect does not meet the expected effect, repeating the steps S360, S370 and S390, and screening more training data with the secondary classification label to train and evaluate the secondary classification model.

In the process of training the deep learning model provided by the embodiment, the LSTM binary classification model obtained by training can identify whether the identification result with lower accuracy obtained by the rule model is correct or not, so as to obtain a binary classification result. The LSTM-Attention model and the TextCNN model can identify search data which cannot be identified by the rule model, so that the accuracy and the recall rate of the whole identification system are improved.

Corresponding to the embodiment of the search intention identification method, the application also provides an embodiment of a search intention identification device.

Referring to fig. 5, a schematic structural diagram of a search intention recognition apparatus provided in an embodiment of the present application is shown, where the apparatus is applied to a device with computing capability, and as shown in fig. 5, the apparatus includes:

the first intention identifying module 110 is configured to perform intention identification on the obtained search text to be identified by using the rule model, so as to obtain a first identification result.

The rule model comprises a plurality of identification rules, each identification rule comprises a plurality of feature dictionaries with a preset sequence and corresponds to one intention category.

The first determining module 120 is configured to determine, for a first recognition result with accuracy higher than a first preset value, an intention category in the first recognition result as an intention category of a corresponding search text to be recognized.

The second intention identifying module 130 is configured to perform intention identification again on the to-be-identified search text corresponding to the first identification result by using a pre-trained deep learning model for the first identification result with the accuracy lower than the first preset value, so as to obtain a corresponding intention category.

In one embodiment of the application, in order to improve the recognition efficiency and the recall rate, for the search text which can be recognized by the rule model but is low in accuracy, a two-classification deep learning model (namely, a first deep learning model) is adopted to verify whether a first recognition result obtained by the rule model is accurate. And for the search text which cannot be identified by the rule model, identifying the intention category of the search text by adopting a multi-classification deep learning model (namely, a second deep learning model).

As shown in fig. 6, the second intention identifying module 130 includes:

the first intention identifying sub-module 131 is configured to perform intention identification again by using a first deep learning model obtained through pre-training for a to-be-identified search text that can be identified by the rule model and has an accuracy lower than a first preset value, so as to obtain a classification result of whether a first identification result of the to-be-identified search text is correct.

In one embodiment of the present application, the first intent recognition submodule 131 is specifically configured to:

performing intention recognition again on the to-be-recognized search text which can be recognized by the rule model but has accuracy lower than a first preset value by using the first deep learning model to obtain a second recognition result;

if the second recognition result is of a correct type, determining that the first recognition result corresponding to the search text to be recognized is correct; and if the second recognition result is of an incorrect category, determining that the first recognition result corresponding to the search text to be recognized is incorrect.

And the second intention identifying submodule 132 is configured to perform intention identification again by using a second deep learning model trained in advance for the to-be-identified search text that cannot be identified by the rule model, so as to obtain a corresponding intention category.

In one embodiment of the present application, the second intent recognition submodule 132 is specifically configured to:

performing intention recognition on the text to be recognized, which cannot be recognized by the rule model, by using a primary classification model in the second deep learning model to obtain a primary intention category of the text to be recognized;

and performing intention recognition on the search text to be recognized by using a secondary classification model corresponding to the primary intention category to obtain a secondary intention category of the search text to be recognized.

The search intention recognition device provided by the embodiment firstly performs intention recognition on a search text to be recognized by using a rule model to obtain a corresponding first recognition result; and for the text to be recognized with the accuracy rate lower than the first preset value, carrying out intention recognition again by using the deep learning model to obtain the corresponding intention category. And identifying the searched text to be identified with the accuracy higher than the first preset value by using the rule model, and directly determining the corresponding first identification result as the intention category corresponding to the searched text to be identified. According to the above content, the scheme utilizes a plurality of models to recognize the text to be recognized in a multi-level mode, the rule models are used for ensuring the recognition accuracy, and the deep learning models are used for recognizing data which are inaccurate or can not be recognized by the rule models, so that the recall rate of the recognition result is ensured, and therefore, the accuracy and the recall rate of the finally obtained recognition result of the search intention are high.

In an embodiment of the application, the device further includes a rule model obtaining module, which is specifically configured to obtain a rule model capable of identifying a search intention corresponding to the search text;

the rule model obtaining module is specifically configured to:

screening candidate search data sets from user search data;

carrying out special word mining on the candidate search data set to obtain special words;

dividing each piece of data in the candidate search data set to obtain candidate subsequences;

dividing the special words not contained in the existing feature dictionary and the words in the candidate subsequence into corresponding feature dictionaries to obtain an updated feature dictionary;

marking the feature dictionary to which the words in each candidate subsequence belong by using the updated feature dictionary to generate a recognition rule;

and marking the corresponding intention category for each identification rule to obtain a rule model.

The rule model can be obtained by the rule module obtaining module, and when a template (namely, a recognition rule) is constructed, the arrangement sequence of each feature dictionary contained in the template is considered, so that when the rule model is used for carrying out intention recognition on a search text, the sequence of words in the search text is the same as the sequence of matched dictionaries in the template, and the search text is considered to be matched with the template, in other words, the rule model takes the sequence of words in the search text into consideration, and therefore the accuracy of a recognition result is improved.

In another embodiment of the present application, the apparatus further includes a first deep learning model obtaining module, configured to train to obtain a first deep learning model, where the first deep learning model is specifically configured to:

screening candidate search data sets from user search data;

performing intention identification on each candidate search data in the candidate search data set by using a rule model obtained in advance to obtain a corresponding identification result;

performing category marking on first-class candidate search data with accuracy rate lower than a first preset value, which is obtained by regular model identification;

merging the marked first-class candidate search data with second-class candidate search data which is obtained by the rule model identification and has higher accuracy than a first preset value to obtain a first training sample data set;

and training the LSTM model by using the data in the first training sample data set to obtain a target LSTM model.

In one embodiment of the present application, the apparatus further includes a second deep learning model obtaining module, configured to train to obtain a second deep learning model, where the second deep learning model is specifically configured to:

screening candidate search data sets from user search data;

performing intention identification on each candidate search data in the candidate search data set by using a rule model obtained in advance to obtain a corresponding identification result;

performing category labeling on third-category candidate search data which cannot be identified by the rule model;

merging the marked third type candidate search data with second type candidate search data which is obtained by the rule model identification and has higher accuracy than a first preset value to obtain a second training sample data set;

training an LSTM model based on an attention mechanism by using data in the second training sample data set to obtain a primary classification model;

and respectively training corresponding text CNN models aiming at training sample data sets corresponding to all secondary classes contained in the primary classes to obtain secondary classification models corresponding to all the secondary classes, wherein the second deep learning model comprises all the primary classification models obtained by training and all the secondary classification models corresponding to all the primary classification models.

The LSTM two-classification model obtained by training the first deep learning model can be used for identifying whether the identification result with lower accuracy obtained by the rule model is correct or not to obtain two-classification results, and the model is high in identification speed and efficiency. The LSTM-Attention model (first-level classification model) and the TextCNN model (second-level classification model) which are obtained by training the second deep learning model can identify the search data which cannot be identified by the rule model, so that the accuracy and the recall rate of the whole identification system are improved.

A computing device is provided that includes a processor and a memory having stored therein a program executable on the processor. The processor implements the above-described search intention identification method when executing the program stored in the memory.

The computing device herein may be a server, a PC, etc.

The present application also provides a storage medium executable by a computing device, the storage medium storing a program, the program implementing the above-described search intention identifying method when executed by the computing device.

While, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present invention is not limited by the illustrated ordering of acts, as some steps may occur in other orders or concurrently with other steps in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.

It should be noted that the technical features in the embodiments of the present disclosure may be arbitrarily combined or substituted. Moreover, each embodiment is described with emphasis on differences from other embodiments, and the same and similar parts among the various embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

The steps in the method of the embodiments of the present application may be sequentially adjusted, combined, and deleted according to actual needs.

The device and the modules and sub-modules in the terminal in the embodiments of the present application can be combined, divided and deleted according to actual needs.

In the several embodiments provided in the present application, it should be understood that the disclosed terminal, apparatus and method may be implemented in other manners. For example, the above-described terminal embodiments are merely illustrative, and for example, the division of a module or a sub-module is only one logical division, and there may be other divisions when the terminal is actually implemented, for example, a plurality of sub-modules or modules may be combined or integrated into another module, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.

The modules or sub-modules described as separate parts may or may not be physically separate, and parts that are modules or sub-modules may or may not be physical modules or sub-modules, may be located in one place, or may be distributed over a plurality of network modules or sub-modules. Some or all of the modules or sub-modules can be selected according to actual needs to achieve the purpose of the solution of the present embodiment.

In addition, each functional module or sub-module in the embodiments of the present application may be integrated into one processing module, or each module or sub-module may exist alone physically, or two or more modules or sub-modules may be integrated into one module. The integrated modules or sub-modules may be implemented in the form of hardware, or may be implemented in the form of software functional modules or sub-modules.

Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于释义消歧的查词显示方法、装置和计算设备

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!