Search

CN-116089725-B - Search recommendation method and device, electronic equipment and storage medium

CN116089725BCN 116089725 BCN116089725 BCN 116089725BCN-116089725-B

Abstract

The invention provides a search recommendation method, a device, electronic equipment and a storage medium, wherein the method comprises the steps of determining target public subsequences of input words and candidate recommended words for the acquired input words, determining a first matching position of the target public subsequence in the input words and/or determining a second matching position of the target public subsequence in the candidate recommended words, determining the relevance of the input words and the candidate recommended words according to the first matching position and/or the second matching position and a judgment rule, and determining the target recommended words of the input words according to the candidate recommended words, wherein the candidate recommended words accord with a set condition with the relevance of the input words, so that the relevance is determined according to the matching positions of the input words and the candidate recommended words, and the accuracy is improved.

Inventors

  • Xue Bofan

Assignees

  • 北京字跳网络技术有限公司

Dates

Publication Date
20260508
Application Date
20230224

Claims (8)

  1. 1. A search recommendation method, comprising: Determining target public subsequences of the input word and the candidate recommended word according to the acquired input word; Determining a first matching position of the target public sub-sequence in the input word and/or determining a second matching position of the target public sub-sequence in the candidate recommended word; Determining the relevance of the input word and the candidate recommended word according to the first matching position and/or the second matching position and a judging rule; determining a target recommended word of the input word according to the candidate recommended word which accords with the set condition with the relevance of the input word, Wherein said determining a first matching location of said target common subsequence at said input word comprises: marking the character position corresponding to the target public sub-sequence in the input word as 1 according to the target public sub-sequence, and marking the character position which is not corresponding to the target public sub-sequence as 0 to obtain the first matching position; The determining the second matching position of the target public subsequence in the candidate recommended word comprises the following steps: Marking the character position of the target public sub-sequence in the candidate recommended word as1 according to the target public sub-sequence, marking the character position which is not corresponding to the target public sub-sequence as 0, obtaining the second matching position, The determining the relevance between the input word and the candidate recommended word according to the first matching position and/or the second matching position and the judging rule comprises the following steps: determining a first number of occurrences of 1 and a second number of occurrences of 0 in the second matching location; According to a first weight corresponding to 1 and a second weight corresponding to 0, respectively determining a first product of the first times and the first weight and a second product of the second times and the second weight, and determining a sum of the first product and the second product, wherein the second weight is a negative integer, the first weight is a positive integer, and a difference value between an absolute value of the first weight and an absolute value of the second weight accords with a difference value range; Determining that the input word is related to the candidate recommended word if the sum is greater than or equal to 0; in the case that the sum is less than 0, determining that the input word and the candidate recommended word are not related, or Traversing the value of each character position corresponding mark in the second matching position according to a first weight corresponding to 1 and a second weight corresponding to 0 and a third weight corresponding to each character position, determining a character position corresponding target value corresponding to 1 as the product of the first weight and the corresponding third weight, and determining a character position corresponding target value corresponding to 0 as the product of the second weight and the corresponding third weight, wherein the second weight is a negative integer, the first weight is a positive integer, and the difference value between the absolute value of the first weight and the absolute value of the second weight accords with a difference value range; determining the sum of target values corresponding to the character positions in the second matching position; determining that the input word is related to the candidate recommended word when the sum is greater than or equal to 0; and in the case that the sum is less than 0, determining that the input word and the candidate recommended word are not related.
  2. 2. The method of claim 1, wherein said determining the target common subsequence of the input word and candidate recommended words comprises at least one of: Matching the input word with the candidate recommended word, determining the longest discontinuous public subsequence between the input word and the candidate recommended word, and determining target public subsequences of the input word and the candidate recommended word according to the longest discontinuous public subsequence; And matching the input word with the candidate recommended word, determining the longest continuous public subsequence between the input word and the candidate recommended word, and determining the target public subsequence of the input word and the candidate recommended word according to the longest continuous public subsequence.
  3. 3. The method of claim 2, wherein the determining the target common subsequence of the input word and the candidate recommended word from the longest non-consecutive common subsequence comprises: Under the condition that a plurality of longest non-continuous public subsequences exist, determining a plurality of longest non-continuous public subsequences which are respectively corresponding to the input word and the first longest continuous public subsequence of the candidate recommended word, and screening out the longest non-continuous public subsequence corresponding to the first longest continuous public subsequence with the longest appearance position as a target public subsequence of the input word and the candidate recommended word; the determining the target public subsequence of the input word and the candidate recommended word according to the longest continuous public subsequence comprises the following steps: And screening out the longest continuous public subsequence corresponding to the first appearance position in the input word as a target public subsequence of the input word and the candidate recommended word under the condition that the longest continuous public subsequence has a plurality of.
  4. 4. The method of claim 1, wherein said determining the first matching location of the target common subsequence at the input word comprises: Under the condition that a plurality of first matching positions exist, a first matching position corresponding to the position of the target public subsequence in the input word is screened out; The determining the second matching position of the target public subsequence in the candidate recommended word comprises the following steps: and under the condition that a plurality of second matching positions exist, screening out the second matching position corresponding to the first occurrence position of the target public subsequence in the candidate recommended words.
  5. 5. The method according to claim 1, wherein the determining the relevance of the input word and the candidate recommended word according to the first matching location and/or the second matching location and a judgment rule includes: And in the case that the last two bits in the first matching position are 01, determining that the input word and the candidate recommended word are irrelevant.
  6. 6. A search recommendation apparatus, comprising: the first determining module is used for determining target public subsequences of the input word and the candidate recommended word aiming at the acquired input word; a second determining module, configured to determine a first matching position of the target public sub-sequence in the input word, and/or determine a second matching position of the target public sub-sequence in the candidate recommended word; The judging module is used for determining the relativity between the input word and the candidate recommended word according to the first matching position and/or the second matching position and a judging rule; a third determining module, configured to determine a target recommended word of the input word according to candidate recommended words that have a degree of relevance that meets a set condition, Wherein said determining a first matching location of said target common subsequence at said input word comprises: marking the character position corresponding to the target public sub-sequence in the input word as 1 according to the target public sub-sequence, and marking the character position which is not corresponding to the target public sub-sequence as 0 to obtain the first matching position; The determining the second matching position of the target public subsequence in the candidate recommended word comprises the following steps: Marking the character position of the target public sub-sequence in the candidate recommended word as1 according to the target public sub-sequence, marking the character position which is not corresponding to the target public sub-sequence as 0, obtaining the second matching position, The determining the relevance between the input word and the candidate recommended word according to the first matching position and/or the second matching position and the judging rule comprises the following steps: determining a first number of occurrences of 1 and a second number of occurrences of 0 in the second matching location; According to a first weight corresponding to 1 and a second weight corresponding to 0, respectively determining a first product of the first times and the first weight and a second product of the second times and the second weight, and determining a sum of the first product and the second product, wherein the second weight is a negative integer, the first weight is a positive integer, and a difference value between an absolute value of the first weight and an absolute value of the second weight accords with a difference value range; Determining that the input word is related to the candidate recommended word if the sum is greater than or equal to 0; in the case that the sum is less than 0, determining that the input word and the candidate recommended word are not related, or Traversing the value of each character position corresponding mark in the second matching position according to a first weight corresponding to 1 and a second weight corresponding to 0 and a third weight corresponding to each character position, determining a character position corresponding target value corresponding to 1 as the product of the first weight and the corresponding third weight, and determining a character position corresponding target value corresponding to 0 as the product of the second weight and the corresponding third weight, wherein the second weight is a negative integer, the first weight is a positive integer, and the difference value between the absolute value of the first weight and the absolute value of the second weight accords with a difference value range; determining the sum of target values corresponding to the character positions in the second matching position; determining that the input word is related to the candidate recommended word when the sum is greater than or equal to 0; and in the case that the sum is less than 0, determining that the input word and the candidate recommended word are not related.
  7. 7. An electronic device comprising a processor, a memory storing machine-readable instructions executable by the processor, the processor for executing the machine-readable instructions stored in the memory, the machine-readable instructions when executed by the processor, the processor performing the steps of the method of any of claims 1-5.
  8. 8. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1-5.

Description

Search recommendation method and device, electronic equipment and storage medium Technical Field The disclosure relates to the technical field of computers, and in particular relates to a search recommendation method, a search recommendation device, electronic equipment and a storage medium. Background In the related technology, in the relevance filtering when determining the search recommended words, the relevance is determined only by considering the proportion of the length of the longest continuous or discontinuous public subsequence to the input words and the candidate words, but the proportion is possibly higher, and the relevance of the actual input words and the candidate words is poorer, so that the accuracy of relevance determination is reduced, and the final search recommended words are inaccurate and the search efficiency is reduced. Disclosure of Invention The embodiment of the disclosure at least provides a search recommendation method, a search recommendation device, electronic equipment and a storage medium. In a first aspect, an embodiment of the present disclosure provides a search recommendation method, including: Determining target public subsequences of the input word and the candidate recommended word according to the acquired input word; Determining a first matching position of the target public sub-sequence in the input word and/or determining a second matching position of the target public sub-sequence in the candidate recommended word; Determining the relevance of the input word and the candidate recommended word according to the first matching position and/or the second matching position and a judging rule; and determining target recommended words of the input words according to the candidate recommended words with the relevance meeting the set conditions. In a second aspect, an embodiment of the present disclosure further provides a search recommendation apparatus, including: the first determining module is used for determining target public subsequences of the input word and the candidate recommended word aiming at the acquired input word; a second determining module, configured to determine a first matching position of the target public sub-sequence in the input word, and/or determine a second matching position of the target public sub-sequence in the candidate recommended word; The judging module is used for determining the relativity between the input word and the candidate recommended word according to the first matching position and/or the second matching position and a judging rule; And the third determining module is used for determining the target recommended word of the input word according to the candidate recommended word which accords with the set condition with the relativity of the input word. In a third aspect, an optional implementation manner of the disclosure further provides an electronic device, including a processor, and a memory, where 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, where the machine-readable instructions are executed by the processor, where the processor performs the steps in the first aspect, or any possible implementation manner of the first aspect. In a fourth aspect, an alternative implementation of the present disclosure further provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the first aspect, or any of the possible implementation manners of the first aspect. In the embodiment of the disclosure, for an obtained input word, a target public subsequence of the input word and a candidate recommended word is determined, a first matching position of the target public subsequence at the input word is determined, and/or a second matching position of the target public subsequence at the candidate recommended word is determined, according to the first matching position and/or the second matching position and a judging rule, the relevance of the input word and the candidate recommended word is determined, and according to the candidate recommended word which accords with a set condition with the relevance of the input word, the target recommended word of the input word is determined, so that the target public subsequence of the input word and the candidate recommended word is determined, and the relevance is determined according to the first matching position of the input word and the second matching position of the candidate recommended word, so that the relevance can be determined based on the matching position which can reflect semantic information of the input word and the candidate recommended word, the relevance is determined, the accuracy and the reliability of the target recommended word is improved, the target recommended word is satisfied, the user search intention is improved, and the user experience is optimized