Search recommendation method, device, equipment, and storage medium

By calculating the word vector and character correlation between the information to be searched and the candidate text, and performing fusion evaluation value calculation, the problem of inaccurate recommendation of candidate text in the prior art is solved, and a more accurate search result recommendation is achieved.

CN111274366BActive Publication Date: 2024-12-20LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010220548.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-25
Publication Date
2024-12-20
Estimated Expiration
2040-03-25

AI Technical Summary

Technical Problem

When existing search engines recommend candidate text, it is difficult for them to accurately reflect user needs. The word vector and character correlation are calculated separately, resulting in insufficiently accurate recommendation results.

Method used

By determining the word vector correlation and character correlation between the information to be searched and the candidate text, and fusing them, calculating the evaluation value of the candidate text, and then recommending it.

Benefits of technology

It improves the recommendation accuracy of candidate text, makes the recommendation results more in line with the actual needs of users, and enhances the matching accuracy of search engines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111274366B_ABST
    Figure CN111274366B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a search recommendation method and apparatus, a device, and a storage medium, wherein the method includes: determining the word vector correlation between the information to be searched and each candidate text in a candidate text set; determining the character correlation between the information to be searched and each of the candidate texts; fusing the word vector correlation and the character correlation corresponding to each of the candidate texts to obtain an evaluation value of the corresponding candidate text; and recommending the candidate text corresponding to the evaluation value that meets specific conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to Internet technologies, and relate to but are not limited to search recommendation methods and devices, equipment, and storage media. Background Art

[0002] Users often search for the information they need from the vast amount of information on the Internet, and search engines have become an indispensable tool in users' lives and work. The so-called search engine is a search technology that uses a specific strategy to retrieve relevant texts from the Internet based on user needs and certain algorithms, and then feeds back to users. Among them, a key technology in the search engine is to determine the relevance between the information to be searched input by the user and the candidate text, and then recommend the candidate text with high relevance to the information to be searched to the user.

[0003] Therefore, how to make the candidate texts recommended to users more accurate is of certain significance for better meeting user needs. Summary of the invention

[0004] In view of this, embodiments of the present application provide a search recommendation method and apparatus, a device, and a storage medium.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a search recommendation method, the method comprising: determining the word vector correlation between the information to be searched and each candidate text in a candidate text set; determining the character correlation between the information to be searched and each of the candidate texts; fusing the word vector correlation and the character correlation corresponding to each of the candidate texts to obtain an evaluation value of the corresponding candidate text; and recommending the candidate text corresponding to the evaluation value that meets specific conditions.

[0007] In the second aspect, an embodiment of the present application provides a search recommendation device, comprising: a first determination module, used to determine the word vector correlation between the information to be searched and each candidate text in the candidate text set; a second determination module, used to determine the character correlation between the information to be searched and each of the candidate texts; a fusion module, used to fuse the word vector correlation and the character correlation corresponding to each of the candidate texts to obtain an evaluation value of the corresponding candidate text; and a recommendation module, used to recommend the candidate text corresponding to the evaluation value that meets specific conditions.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and when the processor executes the program, the steps of the search recommendation method described in any one of the embodiments of the present application are implemented.

[0009] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any search recommendation method described in the embodiments of the present application.

[0010] In an embodiment of the present application, a search recommendation method is provided, in which the word vector correlation and character correlation between the information to be searched and each candidate text are determined; then, the word vector correlation and character correlation corresponding to each candidate text are fused to obtain an evaluation value of the corresponding candidate text; in this way, the degree of similarity between the information to be searched and the candidate text can be determined more accurately, thereby making the candidate text recommended to the user more accurate, thereby better meeting the user's needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 A schematic diagram of the implementation flow of the search recommendation method according to an embodiment of the present application;

[0012] Figure 2 An overall flow chart of a model for determining an evaluation value of a candidate text answer for an embodiment of the present application;

[0013] Figure 3 This is a schematic diagram of search recommendation results returned by only the BERT model in the embodiment of the present application;

[0014] Figure 4 A schematic diagram of search recommendation results returned by integrating the BERT model and N-GRAM in an embodiment of the present application;

[0015] Figure 5 A schematic diagram of the structure of a search and recommendation device according to an embodiment of the present application;

[0016] Figure 6 A hardware entity schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the present application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.

[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0019] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0020] It should be pointed out that the terms "first\second\third" involved in the embodiments of the present application are merely used to distinguish similar or different objects, and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0021] The search recommendation method provided in the embodiment of the present application can be applied to electronic devices. During the implementation process, the electronic devices can be various types of devices with search functions, for example, the electronic devices can include smart mobile terminals (such as mobile phones), tablet computers, e-books, laptop computers, desktop computers, desktop computers, etc. The functions implemented by the method can be implemented by calling program codes by the processor in the electronic device. Of course, the program codes can be stored in a computer storage medium. It can be seen that the electronic device at least includes a processor and a storage medium.

[0022] The present application embodiment provides a search recommendation method. Figure 1 The following is a schematic diagram of the implementation process of the search recommendation method in the embodiment of the present application. Figure 1 As shown, the method may include the following steps 101 to 104:

[0023] Step 101: determine the word vector relevance between the information to be searched and each candidate text in the candidate text set.

[0024] It is understandable that the information to be searched is usually a keyword or sentence input into the search engine by the user through voice or text input, also known as a query. The candidate text set can be an existing corpus or other database. The candidate text can be a web page title, or it can be the web page content corresponding to the web page title, or it can be the web page title and the corresponding web page content. The greater the word vector correlation, the closer the semantics between the information to be searched and the candidate text.

[0025] The electronic device may determine the word vector correlation between the information to be searched and the candidate text through steps 201 to 203 of the following embodiment.

[0026] Step 102: Determine the character relevance between the information to be searched and each of the candidate texts.

[0027] We know that word vectors are the semantic representation of text, while characters refer to the words and phrases contained in the text. Therefore, character relevance and word vector relevance are the measurement representations of the similarity between two texts from different perspectives. Word vector relevance represents the similarity of semantics, while character relevance represents the similarity of words.

[0028] The electronic device may determine the character relevance between the information to be searched and the candidate text through steps 204 to 206 of the following embodiment.

[0029] Step 103: The word vector relevance and the character relevance corresponding to each candidate text are merged to obtain an evaluation value of the corresponding candidate text.

[0030] It can be understood that the evaluation value of the candidate text is actually a comprehensive evaluation result of the corresponding word vector relevance and character relevance, which evaluates the similarity between the candidate text and the information to be searched. The larger the evaluation value, the closer the candidate text is to the information to be searched in terms of semantics and words. The electronic device can determine the evaluation value of the corresponding candidate text through steps 207 and 208 of the following embodiment.

[0031] Step 104 : recommending candidate texts corresponding to evaluation values ​​that meet specific conditions.

[0032] The specific conditions can be various. For example, the specific condition is greater than a specific threshold, and accordingly, the candidate texts corresponding to the evaluation values ​​greater than the specific threshold are recommended. The specific condition can also be the K largest evaluation values, where K is an integer greater than 0, and accordingly, the candidate texts corresponding to the K largest evaluation values ​​are recommended.

[0033] When recommending these candidate texts to the user, these candidate texts may be sorted in descending order of evaluation value, so that candidate texts with higher evaluation values ​​are displayed preferentially to facilitate user selection.

[0034] In an embodiment of the present application, a search recommendation method is provided, in which the word vector correlation and character correlation between the information to be searched and each candidate text are determined; then, the word vector correlation and character correlation corresponding to each candidate text are fused to obtain an evaluation value of the corresponding candidate text; in this way, the degree of similarity between the information to be searched and the candidate text can be determined more accurately, thereby making the candidate text recommended to the user more accurate, thereby better meeting the user's needs.

[0035] The present application embodiment further provides a search recommendation method, which may include the following steps 201 to 209:

[0036] Step 201 , performing feature extraction on the information to be searched and each of the candidate texts respectively, to obtain a first word vector of the information to be searched and a second word vector corresponding to the candidate text.

[0037] In some embodiments, the feature extraction is performed on the information to be searched to obtain the first word vector, which can be achieved through the following steps 2011 and 2012: Step 2011, determining the text vector, position vector and initial word vector of the information to be searched; Step 2012, using the BERT (Bidirectional Encoder Representations from Transformer) model to process the text vector, the position vector and the initial word vector to obtain the first word vector.

[0038] It should be noted that the main input of the BERT model is the original word vector of each character or word in the text, that is, the initial word vector described in step 2011, which can be randomly initialized or pre-trained using algorithms such as Word2Vector as the initial value; the output is the vector representation of each character or word in the text after integrating the semantic information of the full text. In other words, the first word vector is the vector representation after integrating the semantic information of the full text of the information to be searched, and the same is true for the second word vector.

[0039] The text vector, which is automatically learned during the BERT model training process, is used to describe the global semantic information of the text and is integrated with the semantic information of a single word or phrase. The position vector, because the semantic information carried by words or phrases at different positions in the text is different (for example, "I love you" and "You love me"), the BERT model attaches a different vector to words or phrases at different positions to distinguish them. Finally, the BERT model uses the sum of the text vector, position vector, and initial word vector as the input of the model to obtain the first word vector.

[0040] Of course, the method for determining the second word vector is similar to the method for determining the first word vector, except that the text content processed is different. The text processed by the former is the candidate text, and the text processed by the latter is the information to be searched.

[0041] Step 202, using the trained classifier model, processing the first word vector and the second word vector of the i-th candidate text to obtain the probability that the information to be searched and the i-th candidate text belong to a similar category; wherein i is a positive integer less than or equal to the total number of candidate texts in the candidate set;

[0042] Step 203: determine the probability as the word vector correlation between the information to be searched and the i-th candidate text.

[0043] In some embodiments, the initial classifier of the classifier model can be trained using a sample data set to obtain the classifier model. Each sample data of the sample data set includes word vectors corresponding to two texts (the word vectors are the results of feature extraction) and labels indicating whether the two texts are similar. For example, if they are similar, the label is 1, otherwise, the label is 0; in this way, the classifier model with a binary classification function is obtained through training. Furthermore, the classifier model can be used to determine the word vector correlation between the information to be searched and the candidate text.

[0044] It should be noted that, for each candidate text, the electronic device can determine the word vector relevance between the candidate text and the information to be searched through the above steps 202 and 203.

[0045] Step 204, performing character string segmentation on the information to be searched according to M types of segmentation grammars, respectively, to obtain M first character string sets; wherein M is an integer greater than 0;

[0046] Step 205 , performing character string segmentation on the i-th candidate text according to the M segmentation grammars to obtain M second character string sets.

[0047] In the embodiment of the present application, there is no limitation on the value of M, that is, the electronic device can perform string segmentation on the text according to one or more segmentation grammars. In some embodiments, the segmentation grammar may be an N-gram (N-GRAM). For example, the N-gram may be 1-GRAM, 2-GRAM, or 3-GRAM, etc. The M types of segmentation grammars may include any one N-gram or a variety of different N-grams. For example, the M types of segmentation grammars include 1-GRAM and 2-GRAM. Alternatively, the M types of segmentation grammars include 1-GRAM and 3-GRAM; alternatively, the M types of segmentation grammars include 2-GRAM and 3-GRAM; alternatively, the M types of segmentation grammars include 1-GRAM, 2-GRAM, and 3-GRAM.

[0048] For example, if the information to be searched is Tencent Cloud, the first set of strings obtained by using 1-GRAM to segment the information is {Tencent / Xun / Cloud}, where " / " is a separator for ease of understanding. The first set of strings obtained by using 2-GRAM to segment the information is {Tencent / Xun Cloud}.

[0049] It should be noted that character is a broad description, that is, characters can include words, letters, numbers, etc. A character string can include only one character or multiple characters. The character string segmentation method for each candidate text is the same.

[0050] Step 206: Determine the character relevance between the information to be searched and the i-th candidate text according to the M first character string sets and the M second character string sets.

[0051] For each candidate text, the electronic device determines the character relevance between the candidate text and the information to be searched in the same way. For example, the electronic device can determine the character relevance between each candidate text and the information to be searched through steps 304 and 305 of the following embodiment.

[0052] It should be noted that in the embodiments of the present application, there is no limitation on the order of determining the word vector relevance and the character relevance. The electronic device may first determine the word vector relevance and then determine the character relevance, or may first determine the character relevance and then determine the word vector relevance; the electronic device may also determine the character relevance and the word vector relevance between the information to be searched and the candidate text in parallel.

[0053] Step 207: Obtain a penalty coefficient, where the penalty coefficient is used to characterize the accuracy of the method for determining character relevance or the method for determining word vector relevance.

[0054] In some embodiments, the penalty coefficient is the confidence of a method for determining character relevance, or is the confidence of a method for determining word vector relevance.

[0055] Step 208, determining the evaluation value of the corresponding candidate text according to the penalty coefficient, the character relevance corresponding to each candidate text, and the word vector relevance.

[0056] The penalty coefficient can be preconfigured. In some embodiments, when the penalty coefficient is used to characterize the confidence of the method for determining the character relevance, the electronic device can determine a first product between the penalty coefficient and the character relevance; and determine the evaluation value of the corresponding candidate text according to the word vector relevance corresponding to each candidate text and the first product.

[0057] For example, the evaluation value Score1 of the candidate text can be determined according to the following formula (1):

[0058] Score1=ScortBert1+α1*F1 (1);

[0059] In formula (1), ScortBert1 represents the word vector relevance between the candidate text and the information to be searched, α1 represents the penalty coefficient, and F1 represents the character relevance between the candidate text and the information to be searched.

[0060] In other embodiments, when the penalty coefficient is used to characterize the confidence of the method for determining the word vector relevance, the electronic device may also determine a second product between the penalty coefficient and the word vector relevance; and determine the evaluation value of the corresponding candidate text based on the character relevance corresponding to each candidate text and the second product.

[0061] For example, the electronic device may also determine the evaluation value Score2 of the candidate text according to the following formula (2):

[0062] Score2=α2*ScortBert1+F1 (2);

[0063] It can be understood that the penalty coefficient α1 represents the accuracy of the method for determining character relevance; α2 represents the accuracy of the method for determining word vector relevance. Taking formula (1) as an example, when the value of α1 is greater than 1, it means that the accuracy of the method for determining character relevance is higher than that of the method for determining word vector relevance, so that the character relevance accounts for a larger proportion in the determination of the evaluation value, thereby reducing the evaluation value of the candidate text that has a large word vector relevance but is actually far from the content of the information to be searched, thereby making the candidate text recommended to the user more in line with the user's actual needs. Conversely, when the value of α1 is less than 1, it means that the accuracy of the method for determining character relevance is lower than that of the method for determining word vector relevance. α1 and α2 can be the same or different.

[0064] Step 209: recommending candidate texts corresponding to evaluation values ​​that meet specific conditions.

[0065] The present application embodiment further provides a search recommendation method, which may include the following steps 301 to 307:

[0066] Step 301, determining the word vector relevance between the information to be searched and each candidate text in the candidate text set;

[0067] Step 302, according to M types of segmentation grammars, respectively perform string segmentation on the information to be searched to obtain M first string sets; wherein M is an integer greater than 0;

[0068] Step 303, performing character string segmentation on the i-th candidate text according to the M segmentation grammars to obtain M second character string sets; wherein i is a positive integer less than or equal to the total number of candidate texts in the candidate set;

[0069] Step 304: determine the distance between the first character string set and the second character string set obtained by using the same segmentation grammar.

[0070] In some embodiments, the distance can be the number of strings that are the same in two sets. For example, the M types of segmentation grammars are 1-GRAM and 2-GRAM, the information to be searched is: Tencent Cloud, and the candidate text is: Tencent is a game company. According to 1-GRAM, the information to be searched is string segmented, and the first string set obtained is {Tencent / Xun / Cloud}, where " / " is a separator for the convenience of description. According to 1-GRAM, the candidate text is string segmented, and the first string set obtained is {Tencent / Xun / is / game / public / company}, then the same string that these two sets have is {Tencent / Xun}, so it is easy to get the distance between the two sets to be 2.

[0071] According to 2-GRAM, the information to be searched is segmented into strings, and the first string set obtained is {Tencent / Xunyun}. The candidate text is segmented into strings, and the first string set obtained is {Tencent / Xun is / is a game / game / company}. The same string in the two sets is {Tencent}, so the distance is 1.

[0072] Step 305: Determine the character relevance between the information to be searched and the i-th candidate text according to each distance.

[0073] It should be noted that, for each candidate text, the method for determining the character relevance is the same, that is, it can be implemented through the above steps 302 to 305. Taking the i-th candidate text as an example, in some embodiments, the electronic device can determine the matching score between the first string set and the second string set of the i-th candidate text according to the j-th distance, the total number of strings included in the first string set, and the total number of strings included in the second string set of the i-th candidate text; wherein j is an integer greater than 0 and less than or equal to M; each matching score is weighted to obtain the character relevance between the information to be searched and the i-th candidate text.

[0074] That is to say, each distance corresponds to a matching score, and the method for determining each matching score is the same. For example, in the above example, the M segmentation grammars are 1-GRAM and 2-GRAM, the information to be searched is: Tencent Cloud, and the candidate text is: Tencent is a game company. Using 1-GRAM to segment the two texts, the first string sets obtained are {Tencent / Cloud} and {Tencent / Is / Game / Company}, respectively. The total number of strings contained in the former is 3, and the total number of strings contained in the latter is 7. The distance between the two sets is 2, so based on this distance, the exact value determined is The recall value is determined to be Substituting these two values ​​into the following formula (3) can obtain the matching score Match_Scores corresponding to the distance:

[0075]

[0076] In formula (3), Precision represents the precision value and Recall represents the recall value.

[0077] Similarly, based on the two first character string sets determined by 2-GRAM, the corresponding matching scores can be obtained according to the above formula (3).

[0078] The weight of each matching score is related to the quality of the segmentation grammar. For example, if the M segmentation grammars are 1-GRAM and 2-GRAM, the weight of the matching score obtained based on 2-GRAM can be configured to be greater than the weight of the matching score obtained based on 1-GRAM.

[0079] Of course, in some embodiments, the electronic device may directly add up each of the matching scores corresponding to the ith candidate text, and determine the result of the addition as the character relevance corresponding to the candidate text.

[0080] Step 306: The word vector relevance and the character relevance corresponding to each candidate text are merged to obtain an evaluation value of the corresponding candidate text.

[0081] In some embodiments, the electronic device determines the evaluation value of the corresponding candidate text according to the penalty coefficient, the character relevance corresponding to each candidate text, and the word vector relevance. For example, the electronic device can determine the evaluation value Score1 of the candidate text according to the following formula (4):

[0082] Score1=ScortBert1+α1*F1 (4);

[0083] In formula (4), ScortBert1 represents the word vector relevance between the candidate text and the information to be searched, α1 represents the penalty coefficient, and F1 represents the character relevance between the candidate text and the information to be searched.

[0084] Step 307: recommend candidate texts corresponding to evaluation values ​​that meet specific conditions.

[0085] There are many search engines on the Internet, such as Baidu, Google, Sogou, etc. The so-called search engine is a search technology that uses specific strategies to retrieve specific information from the Internet based on user needs and certain algorithms, and then feeds back to users. A key technology in search engines is to match the relevance of search query statements and result titles, and then return results that are highly relevant to the query statement.

[0086] In this key technology, the relevant solutions are mainly based on statistics, deep learning, language model methods, etc. Methods based on statistics, such as term frequency-inverse document frequency (TF-IDF) and best match 25 (BM25) algorithms, need to calculate a large amount of user statistical information, such as the number of documents, term frequency, etc., and cannot obtain user semantic information. Methods based on deep learning, such as deep reconstruction classification networks (DRCN), ARC-I, ARC-II, etc., require a large amount of annotated related corpus, and the quality of the corpus greatly affects the model effect. Language models include related models used to generate word vectors (Word to Vector, Word2Vec), Doc2Vec, etc. Although the word vectors they calculate contain semantics, they have certain limitations and are not accurate enough.

[0087] Based on this, an exemplary application of an embodiment of the present application in a practical application scenario will be described below.

[0088] The BERT model is chosen to obtain word vectors. Compared with related methods, the word vectors obtained by this model contain richer semantic features, but the BERT model will bring many errors. Based on this, in the embodiment of the present application, a string distance calculation model based on N-GRAM is added. The more identical characters a sentence has, the higher the score, which can suppress the deviation caused by BERT to a certain extent.

[0089] In the embodiments of the present application, the core points of the solution are as follows:

[0090] First, we use the BERT model to obtain word vectors. This method has better word vectors than Word2Vec and Doc2Vec, and more semantic information than TF-IDF and BM25.

[0091] Second, the BERT model may bring some very biased results. In the embodiment of the present application, a string distance calculation model based on N-GRAM is also designed and added. The model can automatically analyze the string matching situation and return a score (i.e., the character relevance described in the above embodiment). The higher the matching degree, the higher the score, which is incorporated into BERT.

[0092] like Figure 2As shown in the figure, this is the overall flow chart of the model for determining the evaluation value of a candidate text answer. The model takes the query statement and the answer as input, and returns a score after calculation. The higher the score, the higher the correlation between the two.

[0093] It should be noted that:

[0094] 1. The candidate text set is mainly crawled from the Internet (such as Weibo).

[0095] 2, Figure 2 The model shown is mainly divided into two parts, namely the BERT model and the N-GRAM model. The word vector correlation and character correlation of the two input texts can be obtained through the two models respectively. For example Figure 2 As shown in the figure, the query sentence: "Player A" and the answer sentence: "What do you think of Player B? Publicly praise Player A?" are input into the BERT model and the N-GRAM model. The resulting word vector correlation is 0.73415, and the resulting character correlation is 0.5751.

[0096] 3. The BERT model can be a publicly available pre-trained model, and then some similar data sets are used to fine-tune the pre-trained model.

[0097] 4. Based on the N-GRAM string distance model, first count all possible 1-GRAM and 2-GRAM sets of query and answer statements, and then calculate the corresponding precision and recall. Finally, the character relevance F1 value is calculated according to the following formula (5). The higher the value, the higher the matching degree.

[0098]

[0099] Where Precision1 and Recall1 are the precision and recall values ​​determined based on 1-GRAM; Precision2 and Recall2 are the precision and recall values ​​determined based on 2-GRAM.

[0100] 5. Merge the BERT model’s score ScoreBert with F1 to obtain the final score Score. The merging formula is as follows (6), where α is the penalty coefficient:

[0101] Score=ScortBert+α*F1 (6).

[0102] When evaluating the model’s performance, the test data was selected from some online headlines from different fields. When searching for “player A sports”, the results returned by the BERT model alone are as follows: Figure 3As shown in the figure, we can see that the BERT model has learned some parts with the same semantics, such as "team A players", "high speed" and other words are related to sports, but the model also generates many bad items such as "stock market" and so on.

[0103] When the BERT model is added to N-GRAM, when searching for "player A sports", the results returned are as follows Figure 4 As shown, from Figure 4 It can be seen that compared with Figure 3 The results have undergone qualitative changes. The first 10 results are basically related to the query content "Player A Sports". Secondly, the model also provides information about the team that "Player A" belongs to, information related to his nickname, and information related to "Sports".

[0104] Based on the foregoing embodiments, an embodiment of the present application provides a search recommendation device, which includes the modules included and the units included in the modules, and can be implemented by a processor in an electronic device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0105] Figure 5 This is a schematic diagram of the structure of the search recommendation device in the embodiment of the present application, such as Figure 5 As shown, the device 500 includes a first determination module 501, a second determination module 502, a fusion module 503 and a recommendation module 504; wherein,

[0106] The first determination module 501 is used to determine the word vector relevance between the information to be searched and each candidate text in the candidate text set;

[0107] A second determination module 502 is used to determine the character relevance between the information to be searched and each of the candidate texts;

[0108] A fusion module 503 is used to fuse the word vector relevance and the character relevance corresponding to each candidate text to obtain an evaluation value of the corresponding candidate text;

[0109] The recommendation module 504 is used to recommend candidate texts corresponding to evaluation values ​​that meet specific conditions.

[0110] In some embodiments, the second determination module 502 is used to: perform string segmentation on the information to be searched according to M segmentation grammars to obtain M first string sets; wherein M is an integer greater than 0; perform string segmentation on the i-th candidate text according to the M segmentation grammars to obtain M second string sets; wherein i is a positive integer less than or equal to the total number of candidate texts in the candidate set; and determine the character correlation between the information to be searched and the i-th candidate text according to the M first string sets and the M second string sets.

[0111] In some embodiments, the second determination module 502 is used to: determine the distance between the first character string set and the second character string set obtained by using the same segmentation grammar; and determine the character relevance between the information to be searched and the i-th candidate text according to each distance.

[0112] In some embodiments, M is an integer greater than 1, and the second determination module 502 is used to: determine the matching score between the first string set and the second string set of the i-th candidate text according to the j-th distance, the total number of strings included in the first string set, and the total number of strings included in the second string set of the i-th candidate text; wherein j is an integer greater than 0 and less than or equal to M; and weight each matching score to obtain the character correlation between the information to be searched and the i-th candidate text.

[0113] In some embodiments, the fusion module 503 is used to: obtain a penalty coefficient, which is used to characterize the accuracy of the method for determining character relevance or the method for determining word vector relevance; determine the evaluation value of the corresponding candidate text based on the penalty coefficient, the character relevance corresponding to each candidate text, and the word vector relevance.

[0114] In some embodiments, the first determination module 501 is used to: perform feature extraction on the information to be searched and each of the candidate texts, respectively, to obtain a first word vector of the information to be searched and a second word vector of the corresponding candidate text; use the trained classifier model to process the first word vector and the second word vector of the i-th candidate text, to obtain the probability that the information to be searched and the i-th candidate text belong to similar categories; determine the probability as the word vector correlation between the information to be searched and the i-th candidate text; wherein i is a positive integer less than or equal to the total number of candidate texts in the candidate set.

[0115] In some embodiments, the first determination module 501 is used to: determine the text vector, position vector and initial word vector of the information to be searched; and use the BERT model to process the text vector, the position vector and the initial word vector to obtain the first word vector.

[0116] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0117] It should be noted that in the embodiment of the present application, if the above-mentioned search recommendation method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable an electronic device (which can be a smart mobile terminal (such as a mobile phone), a tablet computer, an e-book, a laptop computer, a desktop computer, a desktop computer, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0118] Correspondingly, an embodiment of the present application provides an electronic device, Figure 6 A hardware entity diagram of an electronic device according to an embodiment of the present application is shown in FIG. Figure 6 As shown, the hardware entity of the electronic device 600 includes: a memory 601 and a processor 602, wherein the memory 601 stores a computer program that can be run on the processor 602, and the processor 602 implements the steps in the search recommendation method provided in the above embodiment when executing the program.

[0119] The memory 601 is configured to store instructions and applications executable by the processor 602, and can also cache data to be processed or processed by the processor 602 and various modules in the electronic device 600 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0120] Correspondingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the search recommendation method provided in the above embodiment are implemented.

[0121] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0122] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and 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 embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0123] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0124] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0125] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0126] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately configured as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0127] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.

[0128] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable an electronic device (which can be a smart mobile terminal (such as a mobile phone), a tablet computer, an e-book, a laptop computer, a desktop computer, a desktop computer, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0129] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0130] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0131] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0132] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A search recommendation method, It is characterized in that The method comprises: Determine the word vector relevance between the information to be searched and each candidate text in the candidate text set; According to M segmentation grammars, the information to be searched is segmented into strings respectively to obtain M first string sets, wherein M is an integer greater than 1; According to the M segmentation grammars, the i-th candidate text is segmented into strings to obtain M second string sets; wherein i is a positive integer less than or equal to the total number of candidate texts in the candidate set; Determine the distance between a first set of character strings and a second set of character strings obtained by using the same segmentation grammar; According to each of the distances, determining the character relevance between the information to be searched and the i-th candidate text; The word vector relevance and the character relevance corresponding to each candidate text are merged to obtain an evaluation value of the corresponding candidate text; Recommend candidate texts corresponding to evaluation values ​​that meet specific conditions; Wherein, determining the character relevance between the information to be searched and the i-th candidate text according to each of the distances includes: Determine a matching score between the first character string set and the second character string set of the i-th candidate text according to the j-th distance, the total number of character strings included in the first character string set, and the total number of character strings included in the second character string set of the i-th candidate text; wherein j is an integer greater than 0 and less than or equal to M; Each of the matching scores is weighted to obtain the character relevance between the information to be searched and the i-th candidate text.

2. The method according to claim 1, It is characterized in that The step of fusing the word vector relevance and the character relevance corresponding to each candidate text to obtain an evaluation value of the corresponding candidate text includes: Obtaining a penalty coefficient, wherein the penalty coefficient is used to characterize the accuracy of a method for determining character relevance or a method for determining word vector relevance; The evaluation value of the corresponding candidate text is determined according to the penalty coefficient, the character relevance corresponding to each candidate text, and the word vector relevance.

3. The method according to claim 1, It is characterized in that The step of determining the word vector relevance between the information to be searched and each candidate text in the candidate text set includes: Performing feature extraction on the information to be searched and each of the candidate texts respectively to obtain a first word vector of the information to be searched and a second word vector corresponding to the candidate text; Using the trained classifier model, the first word vector and the second word vector of the i-th candidate text are processed to obtain the probability that the information to be searched and the i-th candidate text belong to a similar category; The probability is determined as the word vector correlation between the information to be searched and the i-th candidate text; wherein i is a positive integer less than or equal to the total number of candidate texts in the candidate set.

4. The method according to claim 3, It is characterized in that Performing the feature extraction on the information to be searched to obtain a first word vector includes: Determine the text vector, position vector and initial word vector of the information to be searched; The text vector, the position vector and the initial word vector are processed by using the BERT model to obtain the first word vector.

5. A search recommendation device, It is characterized in that include: A first determination module is used to determine the word vector relevance between the information to be searched and each candidate text in the candidate text set; The second determination module is used to perform character string segmentation on the information to be searched according to M segmentation grammars to obtain M first character string sets, wherein M is an integer greater than 1; perform character string segmentation on the i-th candidate text according to the M segmentation grammars to obtain M second character string sets, wherein i is a positive integer less than or equal to the total number of candidate texts in the candidate set; determine the distance between the first character string set and the second character string set obtained by using the same segmentation grammar; and determine the character relevance between the information to be searched and the i-th candidate text according to each distance; A fusion module, used for fusing the word vector relevance and the character relevance corresponding to each candidate text to obtain an evaluation value of the corresponding candidate text; A recommendation module is used to recommend candidate texts corresponding to evaluation values ​​that meet specific conditions; The second determination module is specifically used to determine the matching score between the first character string set and the second character string set of the i-th candidate text according to the j-th distance, the total number of character strings included in the first character string set and the total number of character strings included in the second character string set of the i-th candidate text; wherein j is an integer greater than 0 and less than or equal to M; and weight each matching score to obtain the character correlation between the information to be searched and the i-th candidate text.

6. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, It is characterized in that When the processor executes the program, the steps of the search recommendation method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the search recommendation method according to any one of claims 1 to 4 are implemented.