A search recommendation method and device, electronic equipment and storage medium
By determining the target common subsequence matching position between the input word and the candidate recommended word during the search recommendation process and calculating the relevance, the problem of inaccurate relevance filtering in the prior art is solved, the accuracy and efficiency of search recommendation words are improved, and user needs are met.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2023-02-24
- Publication Date
- 2026-05-08
AI Technical Summary
In existing technologies, the relevance filtering of search recommendation terms only considers the length ratio of the longest continuous or non-continuous common subsequence, which leads to inaccurate relevance determination and reduces the accuracy and efficiency of search recommendation terms.
By determining the matching position of the target common subsequence of the input word and the candidate recommended words in the input word and the candidate recommended words, and calculating the relevance of the input word and the candidate recommended words according to the matching position and the judgment rules, the target recommended words that meet the set conditions are selected.
It improves the accuracy and reliability of determining the relevance of search recommendation terms, meets users' search intent, and optimizes search efficiency and user experience.
Smart Images

Figure CN116089725B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a search recommendation method, apparatus, electronic device, and storage medium. Background Technology
[0002] During the search process, multiple search recommendations can be provided based on the user's input to guide the search. Therefore, the relevance between the search recommendations and the input is crucial. In related technologies, relevance filtering when determining search recommendations only considers the proportion of the length of the longest continuous or non-continuous common subsequence between the input and candidate words. However, this proportion may be too high, while the actual relevance between the input and candidate words may be poor, reducing the accuracy of relevance determination and resulting in inaccurate search recommendations, thus reducing search efficiency. Summary of the Invention
[0003] This disclosure provides at least one search recommendation method, apparatus, electronic device, and storage medium.
[0004] In a first aspect, embodiments of this disclosure provide a search recommendation method, including:
[0005] For the obtained input words, determine the target common subsequence of the input words and candidate recommended words;
[0006] Determine the first matching position of the target common subsequence in the input word, and / or determine the second matching position of the target common subsequence in the candidate recommended word;
[0007] Based on the first matching position and / or the second matching position, and the judgment rules, determine the relevance between the input word and the candidate recommended word;
[0008] The target recommended word is determined based on the candidate recommended words whose relevance to the input word meets the set conditions.
[0009] Secondly, embodiments of this disclosure also provide a search recommendation device, comprising:
[0010] The first determining module is used to determine the target common subsequence of the input word and the candidate recommended word for the obtained input word;
[0011] The second determining module is used to determine the first matching position of the target common subsequence in the input word, and / or determine the second matching position of the target common subsequence in the candidate recommended word;
[0012] The judgment module is used to determine the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rules.
[0013] The third determining module is used to determine the target recommended word of the input word based on the candidate recommended words whose relevance to the input word meets the set conditions.
[0014] Thirdly, an optional implementation of this disclosure also provides an electronic device, including a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is configured to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor performs the steps of the first aspect above, or any possible implementation of the first aspect.
[0015] Fourthly, an optional implementation of this disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the first aspect above, or any possible implementation of the first aspect.
[0016] In this embodiment, for the acquired input word, a target common subsequence of the input word and candidate recommended words is determined; the first matching position of the target common subsequence of the input word is determined, and / or the second matching position of the target common subsequence of the candidate recommended words is determined; based on the first matching position and / or the second matching position, and a judgment rule, the relevance between the input word and the candidate recommended words is determined; based on candidate recommended words whose relevance to the input word meets a set condition, the target recommended words of the input word are determined. Thus, by determining the target common subsequence of the input word and candidate recommended words, and determining the first matching position of the target common subsequence of the input word and the second matching position of the candidate recommended words, the relevance can be determined based on a matching position that better reflects the semantic information of the input word and candidate recommended words, improving the accuracy of relevance determination, thereby improving the accuracy and reliability of the target recommended words, making the target recommended words better meet the user's search intent, improving search efficiency, and optimizing the user experience.
[0017] For a description of the effects of the aforementioned search recommendation device, electronic device, and computer-readable storage medium, please refer to the description of the search recommendation method above, which will not be repeated here.
[0018] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of this disclosure.
[0019] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly described below. These drawings are incorporated in and constitute a part of this specification. They illustrate embodiments conforming to this disclosure and, together with the specification, serve to explain the technical solutions of this disclosure. It should be understood that the following drawings only show some embodiments of this disclosure and should not be considered as limiting the scope. Those skilled in the art can obtain other related drawings based on these drawings without creative effort.
[0021] Figure 1 A flowchart of a search recommendation method provided by an embodiment of this disclosure is shown;
[0022] Figure 2 A flowchart illustrating the relevance determination process in the search recommendation method provided in this embodiment is shown.
[0023] Figure 3 A schematic diagram of a search recommendation device provided in an embodiment of this disclosure is shown;
[0024] Figure 4 A schematic diagram of an electronic device provided in an embodiment of the present disclosure is shown. Detailed Implementation
[0025] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0026] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown herein can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.
[0027] To facilitate understanding of the technical solutions disclosed herein, the technical terms used in the embodiments of this disclosure will first be explained:
[0028] Longest consecutive common subsequence: refers to the longest consecutive subsequence that is the same between two strings. For example, the longest consecutive common subsequence of bikini and biking girl is bikini.
[0029] Longest non-contiguous common subsequence: refers to the longest common non-contiguous subsequence between two strings. For example, bikini and biking girl have the longest non-contiguous common subsequence bikini.
[0030] Research has found that current search engines typically provide multiple search recommendations based on user input. These recommendations can guide and assist users' searches, improving search efficiency. However, in related technologies, the relevance filtering of search recommendations only considers the proportion of the longest continuous or non-continuous common subsequence between the input and candidate words to determine relevance. This proportion may be too high, for example, a candidate word may contain all the characters of the input word, while the actual relevance between the input and candidate words is poor, reducing the accuracy of relevance determination. Consequently, the final search recommendations may also be inaccurate, reducing search efficiency.
[0031] Based on the above research, this disclosure provides a search recommendation method that determines the target common subsequence of the input word and candidate recommended words, and determines the first matching position of the target common subsequence of the input word and / or the second matching position of the candidate recommended words. Based on the first matching position and / or the second matching position, and the judgment rules, the relevance between the input word and the candidate recommended words is determined. Then, based on the candidate recommended words whose relevance to the input word meets the set conditions, the target recommended words of the input word are determined. In this way, the relevance between the input word and the candidate recommended words is determined based on the matching position of the target common subsequence, rather than simply considering the length ratio of the target common subsequence. The matching position better reflects the relevance, which can improve the accuracy of relevance determination, thereby improving the reliability of the target recommended words. The target recommended words are more in line with the search intent, improving search efficiency.
[0032] The shortcomings of the above solutions are the result of the inventor's practical experience and careful research. Therefore, the discovery process of the above problems and the solutions proposed in this disclosure below should be considered as the inventor's contribution to this disclosure.
[0033] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0034] To facilitate understanding of this embodiment, a detailed description of the search and recommendation method disclosed in this disclosure is provided first. The execution entity of the search and recommendation method provided in this disclosure is generally an electronic device with a certain computing capability. This electronic device may include, for example, a terminal device, a server, or other processing devices. The terminal device can be a user equipment (UE), mobile device, cellular phone, cordless phone, personal digital assistant (PDA), handheld device, computing device, in-vehicle device, wearable device, etc. A personal digital assistant is a handheld electronic device that possesses some functions of a computer. It can be used to manage personal information, browse the internet, send and receive emails, etc., and generally does not have a keyboard; it can also be called a handheld computer. In some possible implementations, this search and recommendation method can be implemented by a processor calling computer-readable instructions stored in memory.
[0035] The following describes the search recommendation method provided in this embodiment, taking the server as the execution subject as an example.
[0036] See Figure 1 The diagram shows a flowchart of a search recommendation method provided in an embodiment of this disclosure. The method includes:
[0037] S101: For the obtained input words, determine the target common subsequence of the input words and candidate recommended words.
[0038] In this embodiment of the disclosure, it can be applied to search recommendation scenarios. For example, when a user enters a word in the search box of a search engine, the drop-down suggestion box of the search box can display recommended words for the word. The user can click on the recommended word according to their needs to return the search results corresponding to the recommended word. In the process of determining recommended words, relevance filtering and sorting are usually performed before being displayed to the user. Relevance filtering can remove some irrelevant candidate recommended words, improve accuracy and subsequent processing efficiency. Therefore, the determination of relevance is very important.
[0039] The input word can be a partial or complete Chinese character, a partial or complete Pinyin, a partial or complete English word, or other types, and this disclosure does not impose any restrictions.
[0040] Regarding the determination of the target common subsequence of input words and candidate recommended words in step S101 above, this disclosure provides several possible implementation methods, specifically:
[0041] Implementation method 1: Match the input word with the candidate recommended words to determine the longest non-contiguous common subsequence between the input word and the candidate recommended words. Based on the longest non-contiguous common subsequence, determine the target common subsequence between the input word and the candidate recommended words.
[0042] For example, dynamic programming can be used to match each character in the input word with each character in the candidate recommended words, thereby finding the longest non-continuous common subsequence.
[0043] When the input word and the candidate recommended word are Chinese characters, the matched characters are each of the included characters. When the input word and the candidate recommended word are English or Pinyin, the matched characters are each of the included letters. In addition, this embodiment of the disclosure can also support the matching between input words and candidate recommended words of different languages, such as the matching between English letters and Korean, Japanese and Chinese characters. Specifically, the input word and the candidate recommended word can be converted into English or the standard expression of the corresponding language before matching.
[0044] In this embodiment of the disclosure, the longest non-contiguous common subsequence can be used as the target common subsequence, which can determine the longest common part between the input word and the candidate recommended word, thereby improving the accuracy of subsequent relevance judgment.
[0045] Furthermore, in this embodiment of the disclosure, there may be one or more longest non-contiguous common subsequences matched. For different matching results, this embodiment of the disclosure also provides corresponding implementation methods:
[0046] 1) If there is a longest non-contiguous common subsequence, use the longest non-contiguous common subsequence as the target common subsequence for both the input word and the candidate recommended word.
[0047] 2) When there are multiple longest non-contiguous common subsequences, a final longest non-contiguous common subsequence can be selected from multiple longest non-contiguous common subsequences according to some set selection methods, and used as the target common subsequence.
[0048] In one possible implementation, when there are multiple longest non-contiguous common subsequences, the first longest continuous common subsequence of each of the multiple longest non-contiguous common subsequences is determined to be the first longest continuous common subsequence of the input word and the candidate recommended word, and the longest non-contiguous common subsequence corresponding to the longest and first-occurring first longest continuous common subsequence is selected as the target common subsequence of the input word and the candidate recommended word.
[0049] Of course, other filtering methods can also be included. For example, when there are multiple longest non-contiguous common subsequences, the one containing the earliest occurrence of the first longest continuous common subsequence can be filtered first, and then the one containing the earliest occurrence of the longest non-contiguous common subsequence can be filtered. For example, the longest non-contiguous common subsequence corresponding to the one containing the most longest first longest continuous common subsequences can be filtered out as the target common subsequence of the input word and the candidate recommended word. This embodiment of the present disclosure does not impose any limitations on this.
[0050] In this way, when determining the target common subsequence, the most continuous subsequence among the input words and candidate recommended words is selected. The higher the continuity, the more semantically relevant it is to the input words and candidate recommended words. This allows us to determine the target common subsequence that is most semantically relevant to the input words and candidate recommended words, thereby improving the accuracy of subsequent recall of semantically relevant candidate recommended words.
[0051] For example, if the input word is "ABCBDAB" and the candidate recommended word is "BDCABA", then the longest non-contiguous common subsequence between the input word and the candidate recommended word is determined by matching. It can be "BDAB", "BCAB" and "BCBA". It can be seen that there are three longest non-contiguous common subsequences. At this time, one needs to be selected as the target common subsequence. The first longest continuous common subsequence between "BDAB" and the input word and the candidate recommended word is "BD" and "AB", the first longest continuous common subsequence between "BCAB" and the input word and the candidate recommended word is "AB", and the first longest continuous common subsequence between "BCBA" and the input word and the candidate recommended word is "B", "C", "B" and "A". The first longest continuous common subsequence must not only exist in the longest non-contiguous common subsequence of the matching, but also exist in the input word and the candidate recommended word.
[0052] Comparative analysis shows that, compared to "BCBA", the length of the first longest continuous common subsequence "BD" or "AB" corresponding to "BDAB" is greater than that of the first longest continuous common subsequence "B", "C", "B", and "A" corresponding to "BCBA". However, compared to "BCAB", the "BD" in the first longest continuous common subsequence corresponding to "BDAB" appears earlier than the "AB" in the first longest continuous common subsequence corresponding to "BCAB". "BDAB" also matches earlier than "BCAB" as a whole. Therefore, "BDAB" is selected as the target common subsequence between the input word and the candidate recommended word.
[0053] Implementation Method 2: Match the input word with the candidate recommended words to determine the longest continuous common subsequence between the input word and the candidate recommended words. Based on the longest continuous common subsequence, determine the target common subsequence between the input word and the candidate recommended words.
[0054] In this embodiment of the disclosure, the longest continuous common subsequence of the input word and the candidate recommended words can also be determined to determine the target common subsequence. Furthermore, in this embodiment of the disclosure, there may be one or more longest continuous common subsequences. Specific implementation methods are also provided in this embodiment of the disclosure:
[0055] 1) If there is a longest continuous common subsequence, the longest continuous common subsequence is used as the target common subsequence of the input word and the candidate recommended word.
[0056] 2) In cases where there are multiple longest continuous common subsequences, select the longest continuous common subsequence that appears first in the input word as the target common subsequence of the input word and the candidate recommended word.
[0057] For example, if the input word is "ABCBD" and the candidate recommended word is "ABCDBCB", the longest continuous common subsequence determined by the matching has two "ABC" and "BCB". "ABC" appears first in the input word, so "ABC" can be used as the target common sequence of the input word and the candidate recommended word.
[0058] In this embodiment of the disclosure, when there are multiple longest consecutive common subsequences, other filtering methods can also be used for filtering, and this embodiment of the disclosure does not impose any restrictions.
[0059] Of course, in this embodiment of the disclosure, it is also possible to first match and determine whether there is a longest non-contiguous common subsequence. If there is, the target common subsequence is determined based on the longest non-contiguous common subsequence. If not, the longest continuous common subsequence is determined, and the target common subsequence is determined based on the longest continuous common subsequence. Furthermore, if there is no target common subsequence between the input word and the candidate recommended word, it is considered that the input word and the candidate recommended word are unrelated.
[0060] S102: Determine the first matching position of the target common subsequence in the input word, and / or determine the second matching position of the target common subsequence in the candidate recommended word.
[0061] Specifically, when performing step S102, this disclosure provides a possible implementation method for both the first matching position and the second matching position:
[0062] 1) Determine the first matching position of the target common subsequence in the input word, including: according to the target common subsequence, mark the character position corresponding to the target common subsequence in the input word as 1, and mark the character position that is not corresponding to the target common subsequence as 0, so as to obtain the first matching position.
[0063] 2) Determine the second matching position of the target common subsequence in the candidate recommended word, including: according to the target common subsequence, mark the corresponding character position of the target common subsequence in the candidate recommended word as 1, and mark the character position that is not the target common subsequence as 0, so as to obtain the second matching position.
[0064] For example, if the input word is "invisible" and the candidate recommended word is "invincible but visible", and the target common subsequence is determined to be "invisible", which is the longest non-contiguous common subsequence, then the first matching position of the input word is 1_1_1_1_1_1_1_1_1, and the second matching position of the candidate recommended word is 1_1_0_0_0_0_0_0_0_0_0_0_0_0_0_1_1_1_1_1_1_1.
[0065] Furthermore, the first or second matching position of the target common subsequence in the input word or candidate recommended word is not unique. This disclosure also provides possible implementation methods:
[0066] Determining the first matching position of the target common subsequence in the input word includes: in the case of multiple first matching positions, filtering out the first matching position that corresponds to the first occurrence of the target common subsequence in the input word.
[0067] Determining the second matching position of the target common subsequence in the candidate recommended words includes: when there are multiple second matching positions, selecting the second matching position that corresponds to the first occurrence of the target common subsequence in the candidate recommended words.
[0068] For example, if the input word is "i like apple" and the candidate recommended word is "apple apple", the target common subsequence of the two is determined to be "apple". This target common subsequence has multiple occurrence positions in the candidate recommended word, that is, there are multiple second matching positions. Therefore, the second matching position corresponding to the first occurrence position can be determined as the final second matching position. That is, the second matching position corresponding to the candidate recommended word is 1_1_1_1_1_0_0_0_0_0_0, not 0_0_0_0_0_0_1_1_1_1_1.
[0069] Thus, in this embodiment of the disclosure, the matching position that best represents the semantics of the input word or candidate recommended word can be determined, thereby improving the accuracy of semantic relevance determination.
[0070] S103: Determine the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rules.
[0071] In this embodiment of the disclosure, the first matching position and the second matching position of the input word and / or the candidate recommended word are determined respectively, so that the correlation between the input word and the candidate recommended word can be determined based on the relevant rules of the set matching positions. Specifically, for this step S103, this disclosure provides several possible implementation methods:
[0072] One possible implementation involves determining the relevance between the input word and the candidate recommended word based on a first matching position and / or a second matching position, and a judgment rule. This includes determining that the input word and the candidate recommended word are unrelated if the last two digits in the first matching position are 0 or 1.
[0073] For example, if the first matching position of the input word is x_x_..._x_x_0_1, and this first matching position ends with 0_1, then the input word and the candidate recommended words can be considered irrelevant.
[0074] In this embodiment of the disclosure, a large number of sample pairs can be statistically analyzed in advance. Each sample pair in the sample pair set includes an input sample word and a candidate recommended sample word. Semantically related sample pairs and unrelated sample pairs are analyzed to determine possible patterns. In this embodiment of the disclosure, through statistical analysis, it is found that when most of the first matching positions end with 01, the two are unrelated. Therefore, based on this statistical analysis pattern, it can be determined whether the input word and the candidate recommended word are related.
[0075] In one possible embodiment, the relevance between the input word and the candidate recommended word is determined based on the first matching position and / or the second matching position, as well as the judgment rule. This includes determining that the input word and the candidate recommended word are related when the target common subsequence is the input word and the first n consecutive positions in the second matching position are all 1, where n is equal to the length of the input word.
[0076] In this embodiment of the disclosure, when the prefix of the candidate recommended word is the input word, it can be considered that the candidate recommended word is semantically related to the input word.
[0077] In one possible embodiment, the relevance between the input word and the candidate recommended word is determined based on the first matching position and / or the second matching position, and the judgment rule, including:
[0078] 1) Determine the first occurrence of 1 and the second occurrence of 0 in the second matching position.
[0079] 2) Based on the first weight marked as 1 and the second weight marked as 0, determine the first product of the first number and the first weight, and the second product of the second number and the second weight, and determine the sum of the first product and the second product. The second weight is a negative integer, the first weight is a positive integer, and the difference between the absolute value of the first weight and the absolute value of the second weight is within the range of differences.
[0080] 3) If the sum is greater than or equal to 0, the input word and the candidate recommended word are determined to be related; if the sum is less than 0, the input word and the candidate recommended word are determined to be unrelated.
[0081] For example, the difference between the absolute values of the first and second weights is 1. If the first weight is 1 and the second weight is -2, then traverse the second matching positions, incrementing by 1 for each position equal to 1 and decrementing by 2 for each position equal to 0. This allows us to calculate the sum of the first and second products. If the sum is greater than or equal to 0, we can assume that the target common subsequence has a significant semantic weight in the candidate recommended words and can express the semantic information of the candidate recommended words. Since the target common subsequence is also contained in the input words, we can assume that the input words are semantically related to the candidate recommended words. Conversely, if the sum is less than 0, we can assume that the input words are not related to the candidate recommended words.
[0082] For example, if the second matching position of the candidate recommended word is 0_1_0_1_0_0_1_1, and the sum is calculated to be 4*1+4*(-2)=-4<0, then it is considered that the candidate recommended word is not related to the input word.
[0083] Furthermore, in this embodiment of the disclosure, the larger the sum of the first product and the second product, the greater the correlation between the input word and the candidate recommended word can be determined.
[0084] In one possible embodiment, different character positions can be weighted in this disclosure embodiment to determine the relevance between the input word and the candidate recommended word based on the different positions of the target common subsequence in the input word or candidate recommended word. Specifically, the relevance between the input word and the candidate recommended word is determined based on the first matching position and / or the second matching position, and the judgment rules, including:
[0085] 1) Based on the first weight corresponding to the character position marked as 1, the second weight corresponding to the character position marked as 0, and the third weight corresponding to each character position, iterate through the values of the marks corresponding to each character position in the second matching position. The target value corresponding to the character position marked as 1 is determined as the product of the first weight and the corresponding third weight, and the target value corresponding to the character position marked as 0 is determined as the product of the second weight and the corresponding third weight. Here, the second weight is a negative integer, the first weight is a positive integer, and the difference between the absolute value of the first weight and the absolute value of the second weight conforms to the difference range.
[0086] In this embodiment of the disclosure, a third weight for each character position can be set. The setting of the third weight for each character position can be related to the character length of the candidate recommended word. Specifically, this embodiment of the disclosure does not impose any restrictions. For example, the third weight of each character position in the second matching position gradually decreases from left to right (or from front to back). In this way, the semantics of the candidate recommended word expressed by the different character positions in the second matching position where 0 or 1 appears are different. For example, if the first few values in the second matching position are all 1, that is, the target common subsequence appears before the candidate recommended word, the final first few character positions with a value of 1 should correspond to a higher target value, thereby increasing the proportion of the target common subsequence that can express the semantics of the candidate recommended word.
[0087] 2) Determine the sum of the target values corresponding to each character position in the second matching position.
[0088] 3) If the sum is greater than or equal to 0, the input word and the candidate recommended word are determined to be related; if the sum is less than 0, the input word and the candidate recommended word are determined to be unrelated.
[0089] In this embodiment of the disclosure, other judgment rules may also be used to determine the relevance between the input word and the candidate recommended word. For example, the judgment may be made based on the 0 or 1 values in the first matching position and the second matching position. In this embodiment of the disclosure, no specific restrictions are imposed. The purpose is to determine whether the input word and the candidate recommended word are related.
[0090] S104: Determine the target recommended word for the input word based on the candidate recommended words that meet the set conditions for relevance to the input word.
[0091] For example, based on the above determination method, the relevance between the input word and each candidate recommended word in the candidate recommended word set is determined, thereby filtering out candidate recommended words related to the input word from the candidate recommended word set. Then, based on the filtered candidate recommended words, further processing such as sorting is performed to finally determine the target recommended word for the input word.
[0092] Furthermore, after determining the target recommended words for the input word, this embodiment of the present disclosure also provides a possible implementation method: returning the target recommended words and their ranking information to the terminal device. The terminal device displays the target recommended words in the search box's prompt box according to the ranking information. In this way, it can recommend target recommended words that are more relevant to the input word to the user, better satisfy the user's search intent, and improve search efficiency.
[0093] In this embodiment, a target common subsequence of the input word and candidate recommended words is determined, and the target common subsequence is determined at a first matching position of the input word and / or a second matching position of the candidate recommended words. Based on the first matching position and / or the second matching position, and the judgment rules, the relevance between the input word and the candidate recommended words is determined. Based on the candidate recommended words whose relevance to the input word meets the set conditions, the target recommended words of the input word are determined. In this way, the relevance between the input word and the candidate recommended words is determined based on the matching position of the target common subsequence. The matching position of the target common subsequence better reflects the semantic information of the input word and the candidate recommended words, thereby improving the accuracy of relevance determination, better evaluating the relevance between the input word and the candidate recommended words, reducing the occurrence of irrelevant candidate recommended words, thereby improving the accuracy and reliability of the target recommended words, better meeting the user's search intent, improving search efficiency, and optimizing the user experience.
[0094] The following describes a specific application scenario. In the search recommendation method of this disclosure, the key lies in determining the relevance between the input word and the search recommendation word. To improve the accuracy of the relevance, this disclosure uses the matching position of the target common subsequence to determine it, rather than simply considering the length ratio of the longest continuous common subsequence or the longest non-continuous common subsequence. Specifically, see [link to relevant documentation]. Figure 2 The diagram shown is a flowchart of the relevance determination process in the search recommendation method provided in this embodiment of the present disclosure. The method includes:
[0095] S201: Get the input word.
[0096] For example, a user enters the desired search term into the search box of a search engine, and the terminal device can then send a request to the server to retrieve recommended terms, which includes the input term.
[0097] S202: Determine the target common subsequence of the input word and the candidate recommended words.
[0098] For example, if the input word is "bikini" and the candidate recommended words are "bikinkonten bareng bestie", the target common subsequence is determined to be the longest non-contiguous common subsequence "bikini".
[0099] S203: Determine the first matching position of the target common subsequence in the input word.
[0100] For example, the first matching position of the target common subsequence "bikini" in the input word is 1_1_1_1_1_1_.
[0101] S204: Determine the second matching position of the target common subsequence in the candidate recommended words.
[0102] For example, the second matching position of the target common subsequence "bikini" in the candidate recommended words is 1_1_1_1_1_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_1_0_.
[0103] S205: Determine the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rules.
[0104] For example, the judgment rule is as follows: determine the first occurrence of 1 in the second matching position and the first product of the first weight, and the second occurrence of 0 in the second matching position and the second product of the second weight. Determine the sum of the first product and the second product. If the sum is greater than or equal to 0, the input word and the candidate recommended word are related. If the sum is less than 0, the input word and the candidate recommended word are not related.
[0105] Based on the above judgment rule, for example, the sum corresponding to the second matching position of the candidate recommended word 1_1_1_1_1_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_1_0_ can be determined as: 6*1+19*(-2)=-32<0. Taking the first weight as 1 and the second weight as -2 as an example, it can be determined that the input word and the candidate recommended word are unrelated.
[0106] Thus, in this embodiment of the disclosure, the target common subsequence of the input word and the candidate recommended word is determined, and the matching position of the target common subsequence in the input word and the candidate recommended word is determined. Then, the relevance between the input word and the candidate recommended word can be determined based on the matching position. In this embodiment of the disclosure, considering the matching position to calculate the relevance can improve the accuracy of the relevance calculation, thereby filtering out more irrelevant candidate recommended words and improving the accuracy of search recommendations.
[0107] Of course, the relevance determination method in this embodiment is not limited to search scenarios, but can also be applied to other scenarios, such as any other scenario for determining the relevance between two words.
[0108] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0109] Based on the same inventive concept, this disclosure also provides a search recommendation device corresponding to the search recommendation method. Since the principle of the device in this disclosure for solving the problem is similar to the search recommendation method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0110] Reference Figure 3 The diagram shown is a schematic representation of a search recommendation device provided in an embodiment of this disclosure. The device includes:
[0111] The first determining module 31 is used to determine the target common subsequence of the input word and the candidate recommended word for the obtained input word;
[0112] The second determining module 32 is used to determine the first matching position of the target common subsequence in the input word, and / or determine the second matching position of the target common subsequence in the candidate recommended word;
[0113] The judgment module 33 is used to determine the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rules.
[0114] The third determining module 34 is used to determine the target recommended word of the input word based on the candidate recommended words whose relevance to the input word meets the set conditions.
[0115] In one optional implementation, when determining the target common subsequence of the input word and the candidate recommended words, the first determining module 31 is configured to perform at least one of the following methods:
[0116] The input word is matched with the candidate recommended words to determine the longest non-contiguous common subsequence between the input word and the candidate recommended words. Based on the longest non-contiguous common subsequence, the target common subsequence between the input word and the candidate recommended words is determined.
[0117] The input word is matched with the candidate recommended words to determine the longest continuous common subsequence between the input word and the candidate recommended words. Based on the longest continuous common subsequence, the target common subsequence between the input word and the candidate recommended words is determined.
[0118] In an optional implementation, when determining the target common subsequence of the input word and the candidate recommended word based on the longest non-contiguous common subsequence, the first determining module 31 is used to:
[0119] In cases where there are multiple longest non-contiguous common subsequences, the first longest continuous common subsequences of the multiple longest non-contiguous common subsequences are determined to be the longest continuous common subsequences of the input word and the candidate recommended word, respectively. The longest non-contiguous common subsequence corresponding to the longest first longest continuous common subsequence that appears first is selected as the target common subsequence of the input word and the candidate recommended word.
[0120] When determining the target common subsequence of the input word and the candidate recommended word based on the longest continuous common subsequence, the first determining module 31 is used to:
[0121] In cases where there are multiple longest continuous common subsequences, the longest continuous common subsequence that appears first in the input word is selected as the target common subsequence of the input word and the candidate recommended word.
[0122] In an optional implementation, when determining the target common subsequence at the first matching position of the input word, the second determining module 32 is used to:
[0123] Based on the target common subsequence, the character positions in the input word that correspond to the target common subsequence are marked as 1, and the character positions that do not correspond to the target common subsequence are marked as 0, thereby obtaining the first matching position;
[0124] When determining the target common subsequence at the second matching position of the candidate recommended word, the second determining module 32 is used to:
[0125] Based on the target common subsequence, the character positions corresponding to the target common subsequence in the candidate recommended words are marked as 1, and the character positions that are not corresponding to the target common subsequence are marked as 0, thereby obtaining the second matching position.
[0126] In an optional implementation, when determining the target common subsequence at the first matching position of the input word, the second determining module 32 is used to:
[0127] In the case where there are multiple first matching positions, the first matching position that corresponds to the position where the target common subsequence first appears in the input word is selected;
[0128] When determining the target common subsequence at the second matching position of the candidate recommended word, the second determining module 32 is used to:
[0129] In the case of multiple second matching positions, the second matching position that corresponds to the first occurrence of the target common subsequence in the candidate recommended words is selected.
[0130] In an optional implementation, when determining the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rule, the judgment module 33 is used to:
[0131] If the last two digits in the first matching position are 01, it is determined that the input word and the candidate recommended word are unrelated.
[0132] In an optional implementation, when determining the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rule, the judgment module 33 is used to:
[0133] Determine the first occurrence of 1 and the second occurrence of 0 in the second matching position;
[0134] Based on the first weight marked as 1 and the second weight marked as 0, the first product of the first number and the first weight, and the second product of the second number and the second weight are determined respectively, and the sum of the first product and the second product is determined, wherein the second weight is a negative integer, the first weight is a positive integer, and the difference between the absolute value of the first weight and the absolute value of the second weight conforms to the difference range.
[0135] If the sum is greater than or equal to 0, the input word and the candidate recommended word are determined to be related.
[0136] If the sum is less than 0, it is determined that the input word and the candidate recommended word are unrelated.
[0137] In an optional implementation, when determining the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rule, the judgment module 33 is used to:
[0138] If the target common subsequence is the input word, and the first n consecutive positions in the second matching position are all 1, then the input word and the candidate recommended word are determined to be related, where n is equal to the length of the input word.
[0139] In an optional implementation, when determining the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rule, the judgment module 33 is used to:
[0140] Based on the first weight corresponding to the character position marked as 1, the second weight corresponding to the character position marked as 0, and the third weight corresponding to each character position, the values of the corresponding marks of each character position in the second matching position are traversed. The target value corresponding to the character position marked as 1 is determined as the product of the first weight and the corresponding third weight, and the target value corresponding to the character position marked as 0 is determined as the product of the second weight and the corresponding third weight. Here, the second weight is a negative integer, the first weight is a positive integer, and the difference between the absolute value of the first weight and the absolute value of the second weight conforms to the difference range.
[0141] Determine the sum of the target values corresponding to each character position in the second matching position;
[0142] If the sum is greater than or equal to 0, the input word and the candidate recommended word are determined to be related.
[0143] If the sum is less than 0, it is determined that the input word and the candidate recommended word are unrelated.
[0144] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0145] This disclosure also provides an electronic device, such as... Figure 4 The diagram shown is a schematic representation of the structure of an electronic device provided in an embodiment of this disclosure, including:
[0146] Processor 41 and memory 42; the memory 42 stores machine-readable instructions executable by the processor 41, and the processor 41 executes the machine-readable instructions stored in the memory 42. When the machine-readable instructions are executed by the processor 41, the processor 41 performs the following steps:
[0147] For the obtained input words, determine the target common subsequence of the input words and candidate recommended words;
[0148] Determine the first matching position of the target common subsequence in the input word, and / or determine the second matching position of the target common subsequence in the candidate recommended word;
[0149] Based on the first matching position and / or the second matching position, and the judgment rules, determine the relevance between the input word and the candidate recommended word;
[0150] The target recommended word is determined based on the candidate recommended words whose relevance to the input word meets the set conditions.
[0151] In one optional implementation, when determining the target common subsequence of the input word and the candidate recommended words, the processor 41 is configured to perform at least one of the following methods:
[0152] The input word is matched with the candidate recommended words to determine the longest non-contiguous common subsequence between the input word and the candidate recommended words. Based on the longest non-contiguous common subsequence, the target common subsequence between the input word and the candidate recommended words is determined.
[0153] The input word is matched with the candidate recommended words to determine the longest continuous common subsequence between the input word and the candidate recommended words. Based on the longest continuous common subsequence, the target common subsequence between the input word and the candidate recommended words is determined.
[0154] In an optional implementation, when determining the target common subsequence of the input word and the candidate recommended word based on the longest non-contiguous common subsequence, the processor 41 is configured to:
[0155] In cases where there are multiple longest non-contiguous common subsequences, the first longest continuous common subsequences of the multiple longest non-contiguous common subsequences are determined to be the longest continuous common subsequences of the input word and the candidate recommended word, respectively. The longest non-contiguous common subsequence corresponding to the longest first longest continuous common subsequence that appears first is selected as the target common subsequence of the input word and the candidate recommended word.
[0156] When determining the target common subsequence of the input word and the candidate recommended word based on the longest continuous common subsequence, the processor 41 is configured to: in the case that there are multiple longest continuous common subsequences, select the longest continuous common subsequence that appears first in the input word as the target common subsequence of the input word and the candidate recommended word.
[0157] In an optional implementation, when determining the first matching position of the input word, the processor 41 is configured to: mark the character position in the input word corresponding to the target common subsequence as 1, and mark the character position that is not corresponding to the target common subsequence as 0, based on the target common subsequence, to obtain the first matching position;
[0158] When determining the second matching position of the target common subsequence in the candidate recommended word, the processor 41 is configured to: mark the target common subsequence in the candidate recommended word as 1 at the corresponding character position, and mark the character position that is not the target common subsequence as 0, in order to obtain the second matching position.
[0159] In one optional implementation, when determining the first matching position of the target common subsequence in the input word, the processor 41 is configured to: in the case that there are multiple first matching positions, filter out the first matching position that corresponds to the position where the target common subsequence first appears in the input word;
[0160] When determining the second matching position of the target common subsequence in the candidate recommended word, the processor 41 is configured to: in the case that there are multiple second matching positions, filter out the second matching position that corresponds to the first occurrence position of the target common subsequence in the candidate recommended word.
[0161] In one optional implementation, when determining the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position and the judgment rule, the processor 41 is configured to: determine that the input word and the candidate recommended word are unrelated if the last two digits in the first matching position are 01.
[0162] In an optional implementation, when determining the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rule, the processor 41 is configured to:
[0163] Determine the first occurrence of 1 and the second occurrence of 0 in the second matching position;
[0164] Based on the first weight marked as 1 and the second weight marked as 0, the first product of the first number and the first weight, and the second product of the second number and the second weight are determined respectively, and the sum of the first product and the second product is determined, wherein the second weight is a negative integer, the first weight is a positive integer, and the difference between the absolute value of the first weight and the absolute value of the second weight conforms to the difference range.
[0165] If the sum is greater than or equal to 0, the input word and the candidate recommended word are determined to be related.
[0166] If the sum is less than 0, it is determined that the input word and the candidate recommended word are unrelated.
[0167] In one optional implementation, when determining the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position and the judgment rule, the processor 41 is configured to: determine that the input word and the candidate recommended word are related when the target common subsequence is the input word and the first n consecutive positions in the second matching position are all 1, wherein n is equal to the length of the input word.
[0168] In an optional implementation, when determining the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rule, the processor 41 is configured to:
[0169] Based on the first weight corresponding to the character position marked as 1, the second weight corresponding to the character position marked as 0, and the third weight corresponding to each character position, the values of the corresponding marks of each character position in the second matching position are traversed. The target value corresponding to the character position marked as 1 is determined as the product of the first weight and the corresponding third weight, and the target value corresponding to the character position marked as 0 is determined as the product of the second weight and the corresponding third weight. Here, the second weight is a negative integer, the first weight is a positive integer, and the difference between the absolute value of the first weight and the absolute value of the second weight conforms to the difference range.
[0170] Determine the sum of the target values corresponding to each character position in the second matching position;
[0171] If the sum is greater than or equal to 0, the input word and the candidate recommended word are determined to be related.
[0172] If the sum is less than 0, it is determined that the input word and the candidate recommended word are unrelated.
[0173] The aforementioned memory 42 includes a main memory 421 and an external memory 422; the main memory 421, also known as internal memory, is used to temporarily store the computational data in the processor 41, as well as the data exchanged with external memory 422 such as a hard disk. The processor 41 exchanges data with the external memory 422 through the main memory 421.
[0174] The specific execution process of the above instructions can be referred to the steps of the search recommendation method described in the embodiments of this disclosure, and will not be repeated here.
[0175] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the search recommendation method described in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0176] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the search recommendation method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.
[0177] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0178] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0179] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0180] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0181] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0182] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.
Claims
1. A search recommendation method, characterized in that, include: For the obtained input words, determine the target common subsequence of the input words and candidate recommended words; Determine the first matching position of the target common subsequence in the input word, and / or determine the second matching position of the target common subsequence in the candidate recommended word; Based on the first matching position and / or the second matching position, and the judgment rules, determine the relevance between the input word and the candidate recommended word; Based on candidate recommended words that meet the set relevance criteria to the input word, the target recommended word for the input word is determined. Wherein, determining the target common subsequence at the first matching position of the input word includes: Based on the target common subsequence, the character positions in the input word that correspond to the target common subsequence are marked as 1, and the character positions that do not correspond to the target common subsequence are marked as 0, thereby obtaining the first matching position; Determining the second matching position of the target common subsequence in the candidate recommended word includes: Based on the target common subsequence, the character positions corresponding to the target common subsequence in the candidate recommended words are marked as 1, and the character positions that are not corresponding to the target common subsequence are marked as 0, thus obtaining the second matching position. The step of determining the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rule, includes: Determine the first occurrence of 1 and the second occurrence of 0 in the second matching position; Based on the first weight marked as 1 and the second weight marked as 0, the first product of the first number and the first weight, and the second product of the second number and the second weight are determined respectively, and the sum of the first product and the second product is determined, wherein the second weight is a negative integer, the first weight is a positive integer, and the difference between the absolute value of the first weight and the absolute value of the second weight conforms to the difference range. If the sum is greater than or equal to 0, the input word and the candidate recommended word are determined to be related. If the sum is less than 0, it is determined that the input word and the candidate recommended word are irrelevant, or... Based on the first weight corresponding to the character position marked as 1, the second weight corresponding to the character position marked as 0, and the third weight corresponding to each character position, the values of the corresponding marks of each character position in the second matching position are traversed. The target value corresponding to the character position marked as 1 is determined as the product of the first weight and the corresponding third weight, and the target value corresponding to the character position marked as 0 is determined as the product of the second weight and the corresponding third weight. Here, the second weight is a negative integer, the first weight is a positive integer, and the difference between the absolute value of the first weight and the absolute value of the second weight conforms to the difference range. Determine the sum of the target values corresponding to each character position in the second matching position; If the sum is greater than or equal to 0, the input word and the candidate recommended word are determined to be related. If the sum is less than 0, it is determined that the input word and the candidate recommended word are unrelated.
2. The method according to claim 1, characterized in that, Determining the target common subsequence of the input word and the candidate recommended word includes at least one of the following methods: The input word is matched with the candidate recommended words to determine the longest non-contiguous common subsequence between the input word and the candidate recommended words. Based on the longest non-contiguous common subsequence, the target common subsequence between the input word and the candidate recommended words is determined. The input word is matched with the candidate recommended words to determine the longest continuous common subsequence between the input word and the candidate recommended words. Based on the longest continuous common subsequence, the target common subsequence between the input word and the candidate recommended words is determined.
3. The method according to claim 2, characterized in that, The step of determining the target common subsequence of the input word and the candidate recommended word based on the longest non-contiguous common subsequence includes: In cases where there are multiple longest non-contiguous common subsequences, the first longest continuous common subsequences of the multiple longest non-contiguous common subsequences are determined to be the longest continuous common subsequences of the input word and the candidate recommended word, respectively. The longest non-contiguous common subsequence corresponding to the longest first longest continuous common subsequence that appears first is selected as the target common subsequence of the input word and the candidate recommended word. The step of determining the target common subsequence of the input word and the candidate recommended word based on the longest continuous common subsequence includes: In cases where there are multiple longest continuous common subsequences, the longest continuous common subsequence that appears first in the input word is selected as the target common subsequence of the input word and the candidate recommended word.
4. The method according to claim 1, characterized in that, Determining the first matching position of the target common subsequence in the input word includes: In the case where there are multiple first matching positions, the first matching position that corresponds to the position where the target common subsequence first appears in the input word is selected; Determining the second matching position of the target common subsequence in the candidate recommended word includes: In the case of multiple second matching positions, the second matching position that corresponds to the first occurrence of the target common subsequence in the candidate recommended words is selected.
5. The method according to claim 1, characterized in that, The step of determining the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rule, includes: If the last two digits in the first matching position are 01, it is determined that the input word and the candidate recommended word are unrelated.
6. A search and recommendation device, characterized in that, include: The first determining module is used to determine the target common subsequence of the input word and the candidate recommended word for the obtained input word; The second determining module is used to determine the first matching position of the target common subsequence in the input word, and / or determine the second matching position of the target common subsequence in the candidate recommended word; The judgment module is used to determine the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rules. The third determining module is used to determine the target recommended word for the input word based on candidate recommended words whose relevance to the input word meets set conditions. Wherein, determining the target common subsequence at the first matching position of the input word includes: Based on the target common subsequence, the character positions in the input word that correspond to the target common subsequence are marked as 1, and the character positions that do not correspond to the target common subsequence are marked as 0, thereby obtaining the first matching position; Determining the second matching position of the target common subsequence in the candidate recommended word includes: Based on the target common subsequence, the character positions corresponding to the target common subsequence in the candidate recommended words are marked as 1, and the character positions that are not corresponding to the target common subsequence are marked as 0, thus obtaining the second matching position. The step of determining the relevance between the input word and the candidate recommended word based on the first matching position and / or the second matching position, and the judgment rule, includes: Determine the first occurrence of 1 and the second occurrence of 0 in the second matching position; Based on the first weight marked as 1 and the second weight marked as 0, the first product of the first number and the first weight, and the second product of the second number and the second weight are determined respectively, and the sum of the first product and the second product is determined, wherein the second weight is a negative integer, the first weight is a positive integer, and the difference between the absolute value of the first weight and the absolute value of the second weight conforms to the difference range. If the sum is greater than or equal to 0, the input word and the candidate recommended word are determined to be related. If the sum is less than 0, it is determined that the input word and the candidate recommended word are irrelevant, or... Based on the first weight corresponding to the character position marked as 1, the second weight corresponding to the character position marked as 0, and the third weight corresponding to each character position, the values of the corresponding marks of each character position in the second matching position are traversed. The target value corresponding to the character position marked as 1 is determined as the product of the first weight and the corresponding third weight, and the target value corresponding to the character position marked as 0 is determined as the product of the second weight and the corresponding third weight. Here, the second weight is a negative integer, the first weight is a positive integer, and the difference between the absolute value of the first weight and the absolute value of the second weight conforms to the difference range. Determine the sum of the target values corresponding to each character position in the second matching position; If the sum is greater than or equal to 0, the input word and the candidate recommended word are determined to be related. If the sum is less than 0, it is determined that the input word and the candidate recommended word are unrelated.
7. An electronic device, characterized in that, include: A processor and a memory, the memory storing machine-readable instructions executable by the processor, the processor executing the machine-readable instructions stored in the memory, wherein when the machine-readable instructions are executed by the processor, the processor performs the steps of the method as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-5.
Citation Information
Patent Citations
Candidate word evaluation method and apparatus, computer device and storage medium
CN108664466A
Interactive feature parallel selection method for large-scale high-dimensional sequence data
CN108897990A
Text similarity detection method and device and electronic equipment
CN109657213A