A product filtering method, device and computing device based on Trie tree
By constructing a Trie tree for each filtering dictionary and using the efficient index of the Trie tree to filter the query-product data pairs, the problem of low filtering efficiency in the existing technology is solved, and efficient product recall and product iteration are achieved.
Patent Information
- Application Number
- CN201910176640.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-03-08
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2039-03-08
Smart Images

Figure CN111666487B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computational advertising technology, and in particular to a Trie tree-based commodity filtering method, a Trie tree-based commodity filtering device, a computer storage medium, and a computing device. Background Art
[0002] Computational advertising is an emerging sub-discipline. Its primary challenge is finding the "best match" between a specific user and the corresponding advertisement within a specific context. This context can typically be a query entered by a user into a search engine. In the field of computational advertising, matching dictionaries are often used to map user search terms to product titles, streamlining the online recall process and improving product recall efficiency. To this end, numerous offline query-title matching dictionary models have been applied. For example, search engines store a vast amount of customer-provided product information. To ensure that user queries match the desired product, a combination of query-to-product or title mappings is typically constructed offline at the underlying layer. These combinations form an offline matching dictionary, which serves as the basis for online search and ad output.
[0003] However, regardless of the matching dictionary model, the mined query-title pairs inevitably suffer from mismatches and other issues, making them unusable directly. Filtering is required. Existing techniques typically involve establishing several local filter dictionaries and applying their contents to filter query-title pairs one by one. This traditional dictionary-based query approach is inefficient when the dictionary is complex and the candidate data is large, resulting in long data production cycles and slow product iteration.
[0004] Therefore, there is an urgent need for a method that can improve filtering efficiency, shorten data production cycle, and increase product iteration speed. Summary of the Invention
[0005] In view of the above problems, the present invention is proposed to provide a Trie tree-based product filtering method, Trie tree-based product filtering device, computer storage medium and computing device that overcome the above problems or at least partially solve the above problems.
[0006] According to one aspect of an embodiment of the present invention, a product filtering method based on a Trie tree is provided, comprising:
[0007] Input the query-product data pair obtained based on the user's search term;
[0008] Filtering the input query-product data pair using a Trie tree of a filter dictionary according to a specified filtering rule, wherein the Trie tree of the filter dictionary is constructed by pushing each element in the filter dictionary into a tree structure;
[0009] Output the filtered results.
[0010] Optionally, each element in the filter dictionary is pushed into a tree structure, including:
[0011] Each element in the filter dictionary is pushed into the tree structure in such a way that any path from the root node to the leaf node represents an element.
[0012] Optionally, the specified filtering rule includes at least one of the following:
[0013] Whether the theme is suitable, whether the region is appropriate, and whether there are sensitive words.
[0014] Optionally, the input query-product data pair is filtered using a Trie tree of a filter dictionary, including:
[0015] The Trie tree of the filtering dictionary is used to search for the position of the element in the filtering dictionary and the weight of the element in the query-product data pair, and the query-product data pair is filtered according to the position and weight of the element.
[0016] Optionally, before filtering the input query-product data pair using the Trie tree of the filter dictionary, the method further includes:
[0017] According to the filter conditions of the query, select the Trie tree of the corresponding filter dictionary.
[0018] Optionally, the query-product data pair is obtained by mining through a statistical model or a semantic relevance model.
[0019] According to another aspect of an embodiment of the present invention, a product filtering device based on a Trie tree is provided, comprising:
[0020] An input module, adapted to input query-product data pairs obtained based on user search terms;
[0021] a filtering module adapted to filter the input query-product data pairs using a Trie tree of a filtering dictionary according to specified filtering rules, wherein the Trie tree of the filtering dictionary is constructed by pushing each element in the filtering dictionary into a tree structure; and
[0022] Output module, suitable for outputting filtered results.
[0023] Optionally, the Trie tree of the filter dictionary is constructed by pushing each element in the filter dictionary into a tree structure in a manner such that any path from a root node to a leaf node represents an element.
[0024] Optionally, the specified filtering rule includes at least one of the following:
[0025] Whether the theme is suitable, whether the region is appropriate, and whether there are sensitive words.
[0026] Optionally, the filtering module is further adapted to:
[0027] The Trie tree of the filtering dictionary is used to search for the position of the element in the filtering dictionary and the weight of the element in the query-product data pair, and the query-product data pair is filtered according to the position and weight of the element.
[0028] Optionally, the device further comprises:
[0029] The selection module is adapted to select a corresponding Trie tree of the filter dictionary according to the filter condition of the query before the filter module filters the input query-product data pair using the Trie tree of the filter dictionary.
[0030] Optionally, the query-product data pair is obtained by mining through a statistical model or a semantic relevance model.
[0031] According to another aspect of an embodiment of the present invention, a computer storage medium is provided, wherein the computer storage medium stores computer program code. When the computer program code is executed on a computing device, the computing device executes the Trie tree-based commodity filtering method according to any one of the above descriptions.
[0032] According to another aspect of an embodiment of the present invention, there is further provided a computing device, including:
[0033] processor; and
[0034] a memory storing computer program code;
[0035] When the computer program code is executed by the processor, it causes the computing device to execute the Trie tree-based commodity filtering method according to any one of the above descriptions.
[0036] The Trie-tree-based product filtering method and device proposed in the embodiment of the present invention constructs a Trie tree for each filtering dictionary, and uses the Trie tree of the filtering dictionary to filter the query-product data pairs obtained based on the user search terms according to the specified filtering rules to remove some incorrect matches or sensitive word matches, thereby ensuring the accuracy of product recall. The solution of the present invention uses the efficient index of the Trie tree to replace the brute force search method in the prior art, reducing the dimension of the search diameter, which can significantly improve the filtering efficiency, shorten the data production cycle, and increase the product iteration speed. In particular, when the number of filtering dictionary entries is large (for example, tens of thousands, hundreds of thousands, or even more), the number of filtering dictionary queries can be greatly reduced, saving iteration time and resource consumption. The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification, and in order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below.
[0037] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0039] Figure 1 A flowchart of a product filtering method based on a Trie tree according to an embodiment of the present invention is shown;
[0040] Figure 2 A schematic diagram of a process of a product filtering method based on a Trie tree according to another embodiment of the present invention is shown;
[0041] Figure 3 A schematic structural diagram of a Trie-tree-based commodity filtering device according to an embodiment of the present invention is shown; and
[0042] Figure 4 A schematic structural diagram of a Trie-tree-based commodity filtering device according to another embodiment of the present invention is shown. DETAILED DESCRIPTION
[0043] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0044] In the field of computational advertising, offline matching dictionaries mined using models require post-processing using rules to remove incorrect matches or sensitive word matches. To this end, several filtering dictionaries are typically created locally, and their contents are used to filter matches against similar query-titles in the matching dictionary. However, the traditional approach of query-by-query filtering based on filtering dictionaries is inefficient when the dictionary is complex and the candidate data is large. It is also time-consuming and computationally intensive, making it extremely inefficient for resource conservation.
[0045] To solve the above technical problems, an embodiment of the present invention proposes a product filtering method based on a Trie tree. Figure 1 FIG2 shows a flow chart of a product filtering method based on a Trie tree according to an embodiment of the present invention. Figure 1 The method may at least include the following steps S102 to S106.
[0046] Step S102: input a query-product data pair obtained based on a user search term.
[0047] Step S104 , filtering the input query-product data pair using the Trie tree of the filtering dictionary according to the specified filtering rule, wherein the Trie tree of each filtering dictionary is constructed by pushing each element in the filtering dictionary into a tree structure.
[0048] Step S106: output the filtered result.
[0049] The Trie-based product filtering method proposed in this embodiment of the present invention constructs a Trie tree for each filtering dictionary. Using the Trie tree in the filtering dictionary, the method filters query-product data pairs generated based on user search terms according to specified filtering rules, eliminating false matches or sensitive word matches, thereby ensuring accurate product recall. By using the efficient indexing of the Trie tree instead of the brute-force search method used in existing technologies, the method reduces the search diameter dimension, significantly improving filtering efficiency, shortening the data production cycle, and accelerating product iteration.
[0050] The query-product data pair mentioned in step S102 above represents a matching combination of a query and a product or title, and may also be referred to as a query-title data pair. In the present invention, a query-title data pair can be a query-title data pair from an offline matching dictionary mined based on the user's search terms using a statistical model or a semantic relevance model, or a query-title data pair retrieved based on the user's search terms in an online query.
[0051] In the above step S104, the input query-title data pair is matched and filtered using the Trie tree of the filter dictionary according to the specified filtering rules.
[0052] As mentioned above, no matter what matching dictionary model is used, the mined query-title will inevitably have problems such as mismatching and cannot be used directly. It is necessary to build a filtering dictionary and set up some filtering rules to filter it.
[0053] In an optional implementation, the specified filtering rules may include: whether the subject of the data pair matches, whether the region matches, and / or whether sensitive words exist.
[0054] For example, if a user searches for air tickets but the results are for train tickets, this query-title pair is mismatched and should be filtered out. Another example is if the results contain information about leaders or pornographic content, which could be sensitive words in the query-title pair and should be removed accordingly.
[0055] In actual applications, filter dictionaries are constructed based on the filtering conditions of the query being filtered. For example, for hotel search queries, filter dictionaries related to regions and sensitive terms are constructed; for flight search queries, filter dictionaries related to topics and sensitive terms are constructed. Then, a Trie tree is constructed for each filter dictionary for information retrieval.
[0056] A Trie, also known as a dictionary tree, word lookup tree, or key tree, is a multi-branch tree that stores characters in a linked list format. Instead of containing one or more keywords, a node contains only a portion of a keyword (characters or numbers). Trie trees are typically used to count, sort, and store large numbers of strings. Their advantage lies in their ability to reduce query time by leveraging common prefixes in strings, minimizing unnecessary string comparisons and thus improving query efficiency.
[0057] In an embodiment of the present invention, a Trie tree of a filter dictionary is constructed by pushing each element in each filter dictionary into a tree structure.
[0058] Furthermore, each element in the filter dictionary is pushed into the tree structure in such a way that any path from the root node to the leaf node of the tree structure represents an element.
[0059] The following example illustrates the construction process of the Trie tree of the filter dictionary.
[0060] For example, for a regional filter dictionary, assuming the filter dictionary contains three regional term elements: Ulan Bator, Ukraine, and Ulan Bator, each node in the regional Trie tree constructed for the filter dictionary is a Chinese character, and any path from the root node to a leaf node represents a regional term. Specifically, the Trie tree structure constructed by these three regional term elements is:
[0061] The nodes in the first layer include: Wu, which has two child nodes "Lan" and "Ke".
[0062] The nodes in the second layer include: Lan, which has two child nodes "Bu" and "Ba"; Ke, which has one child node "Lan".
[0063] The nodes in the third layer include: Bu, which has a child node "Tong"; Lan, which is a leaf node; Ba, which has a child node "Tuo".
[0064] The nodes of the fourth layer include: Tong, which is a leaf node; Tuo, which is a leaf node.
[0065] As you can see, all child nodes of each node contain different characters. The concatenation of the characters along the path from the first-level nodes to each leaf node forms the geographical term element corresponding to that leaf node. Specifically, tracing back from the leaf node "Lan" to the root node yields the geographical term "Ukraine." Tracing back from the leaf node "Tong" to the root node yields the geographical term "Ulanbutong." Tracing back from the leaf node "Tuo" to the root node yields the geographical term "Ulaanbaatar."
[0066] The above describes the process of constructing a filter dictionary Trie. Before filtering an input query-title data pair, you can also select a corresponding filter dictionary Trie based on the required filtering conditions for the query to search for the query, thereby improving the purposefulness and efficiency of the filtering. For example, for a flight search query-title data pair, a topic filter dictionary Trie and a sensitive word filter dictionary Trie are selected. For a hotel search query-title data pair, a region filter dictionary Trie and a sensitive word filter dictionary Trie are selected, and so on.
[0067] In an optional embodiment of the present invention, the step of filtering the input query-product data pair using the Trie tree of the filter dictionary can be specifically implemented as follows:
[0068] The Trie tree of the filter dictionary is used to search the position of the element in the filter dictionary and the weight of the element in the query-title data pair, and the query-title data pair is filtered according to the position and weight of the element.
[0069] For example, if a sensitive word appears in the title of a recalled product, and its weight exceeds a predetermined threshold, the query-title data pair will be removed. If a sensitive word appears in the body of a recalled product, and its weight does not exceed a predetermined threshold, the word can be deleted and the product can be reordered to a lower position, and so on.
[0070] The above introduces Figure 1 The various implementation methods of each link of the embodiment shown are combined below. Figure 2 The implementation process of the Trie tree-based product filtering method of the present invention is described in detail through a specific embodiment.
[0071] Figure 2 The flowchart of the product filtering method based on Trie tree according to a specific embodiment of the present invention is shown. Figure 2 As shown, in this embodiment, filter dictionary 1, filter dictionary 2, ..., and filter dictionary N can be constructed in advance based on the filter conditions of all queries to be filtered. Then, each element in each filter dictionary is pushed into the tree structure in such a way that any path from the root node to the leaf node of the tree structure represents an element, and Trie trees 1, Trie tree 2, ..., and Trie tree N of filter dictionary 1, filter dictionary 2, ..., and filter dictionary N are constructed respectively.
[0072] The product filtering method based on the Trie tree may include the following steps:
[0073] Step 1: Input the query-title data pair mined based on the user's search terms through statistical models or semantic relevance models.
[0074] Step 2: Select the Trie tree of the corresponding filter dictionary based on the filter conditions of the input query.
[0075] Step 3: According to the specified filtering rules, use the Trie tree of the selected filtering dictionary to search the position of the element in the filtering dictionary and the weight of the element in the input query-title data pair, and filter the query-title data pair according to the position and weight of the element.
[0076] In this step, the specified filtering rules include: whether the subject of the query-title data pair matches, whether the region is consistent, and whether there are sensitive words.
[0077] Step 4: Output the filtered results.
[0078] This embodiment constructs a Trie tree for each filtering dictionary and uses the efficient index of the Trie tree to replace the brute force search method in the prior art, which significantly improves the filtering efficiency when the number of filtering dictionary entries is large (e.g., tens of thousands, hundreds of thousands, or even more).
[0079] Based on the same inventive concept, an embodiment of the present invention further provides a Trie-tree-based product filtering device, which is used to support the Trie-tree-based product filtering method provided by any one of the above embodiments or a combination thereof. Figure 3 FIG shows a schematic diagram of the structure of a product filtering device 300 based on a Trie tree according to an embodiment of the present invention. Figure 3 The device 300 may at least include: an input module 310, a filtering module 320 and an output module 330.
[0080] The functions of the components or devices of the Trie tree-based commodity filtering device 300 according to an embodiment of the present invention and the connection relationship between the components are now introduced:
[0081] The input module 310 is adapted to input query-product data pairs obtained based on user search terms.
[0082] The filtering module 320 is connected to the input module 310 and is adapted to filter the input query-product data pairs using a Trie tree of a filtering dictionary according to specified filtering rules, wherein the Trie tree of the filtering dictionary is constructed by pushing each element in the filtering dictionary into a tree structure.
[0083] The output module 330 is connected to the filtering module 320 and is adapted to output the filtered results.
[0084] In an optional embodiment of the present invention, the Trie tree of each filter dictionary is constructed by pushing each element in the filter dictionary into the tree structure in a manner such that any path from the root node to the leaf node represents an element.
[0085] In an optional embodiment of the present invention, the specified filtering rules may include at least one of the following:
[0086] Whether the theme is suitable, whether the region is appropriate, and whether there are sensitive words.
[0087] In an optional embodiment of the present invention, the filtering module 320 is further adapted to:
[0088] The Trie tree of the filter dictionary is used to search for the position of the element in the filter dictionary and the weight of the element in the query-product data pair, and the query-product data pair is filtered according to the position and weight of the element.
[0089] In an alternative embodiment of the present invention, see Figure 4 As shown, Figure 3 The illustrated Trie-based product filtering device 300 may further include a selection module 340. The selection module 340 is connected to the input module 310 and the filtering module 320, respectively, and is adapted to select a corresponding Trie tree of the filtering dictionary based on the filtering conditions of the query before the filtering module 320 uses the Trie tree of the filtering dictionary to filter the input query-product data pair.
[0090] In an optional embodiment of the present invention, the query-product data pair is obtained by mining through a statistical model or a semantic relevance model.
[0091] Based on the same inventive concept, an embodiment of the present invention further provides a computer storage medium storing computer program code that, when executed on a computing device, causes the computing device to execute the Trie-tree-based product filtering method according to any one or a combination of the above embodiments.
[0092] Based on the same inventive concept, an embodiment of the present invention further provides a computing device. The computing device may include:
[0093] processor; and
[0094] a memory storing computer program code;
[0095] When the computer program code is executed by a processor, the computing device is caused to execute the Trie tree-based commodity filtering method according to any one of the above embodiments or a combination thereof.
[0096] According to any one of the above optional embodiments or a combination of multiple optional embodiments, the embodiments of the present invention can achieve the following beneficial effects:
[0097] The Trie-tree-based product filtering method and device proposed in the embodiment of the present invention constructs a Trie tree for each filtering dictionary, and uses the Trie tree of the filtering dictionary to filter the query-product data pairs obtained based on the user search terms according to the specified filtering rules to remove some wrong matches or sensitive word matches, thereby ensuring the accuracy of product recall. The solution of the present invention uses the efficient index of the Trie tree to replace the brute force search method in the prior art, reducing the dimension of the search diameter, which can significantly improve the filtering efficiency, shorten the data production cycle, and increase the product iteration speed. In particular, when the number of filtering dictionary entries is large (for example, tens of thousands, hundreds of thousands, or even more), the number of filtering dictionary queries can be greatly reduced, saving iteration time and resource consumption.
[0098] Those skilled in the art will clearly understand that the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and for the sake of brevity, they will not be further described here.
[0099] In addition, the functional units in various embodiments of the present invention may be physically independent of each other, or two or more functional units may be integrated together, or all functional units may be integrated into a single processing unit. The above-mentioned integrated functional units may be implemented in the form of hardware, software, or firmware.
[0100] Those skilled in the art will understand that if the integrated functional unit is implemented in the form of software and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can essentially or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, which includes a number of instructions for enabling a computing device (such as a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention when running the instructions. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0101] Alternatively, all or part of the steps of implementing the aforementioned method embodiments may be accomplished by hardware associated with program instructions (such as a computing device such as a personal computer, a server, or a network device), and the program instructions may be stored in a computer-readable storage medium. When the program instructions are executed by a processor of a computing device, the computing device executes all or part of the steps of the method described in each embodiment of the present invention.
[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that within the spirit and principles of the present invention, they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some or all of the technical features therein. However, these modifications or replacements do not deviate from the scope of protection of the present invention.
Claims
1. A product filtering method based on a Trie tree, comprising: Input a query-product data pair obtained based on a user search term, wherein the query-product data pair is a query-product data pair in an offline matching dictionary mined based on the user search term using a statistical model or a semantic relevance model, or a query-product data pair recalled based on the user search term in an online query; Filtering the input query-product data pair using a Trie tree of a filter dictionary according to a specified filtering rule, wherein the Trie tree of the filter dictionary is constructed by pushing each element in the filter dictionary into a tree structure; Output the filtered results; The input query-product data pair is filtered using the Trie tree of the filter dictionary, including: The Trie tree of the filtering dictionary is used to search for the position of the element in the filtering dictionary and the weight of the element in the query-product data pair, and the query-product data pair is filtered according to the position and weight of the element.
2. The method according to claim 1, wherein Push each element in the filter dictionary into a tree structure, including: Each element in the filter dictionary is pushed into the tree structure in such a way that any path from the root node to the leaf node represents an element.
3. The method according to claim 1, wherein The specified filtering rules include at least one of the following: Whether the theme is suitable, whether the region is appropriate, and whether there are sensitive words.
4. The method according to claim 1, wherein Before filtering the input query-product data pair using the Trie tree of the filter dictionary, the following steps are also included: According to the filter conditions of the query, select the Trie tree of the corresponding filter dictionary.
5. The method according to any one of claims 1 to 4, wherein The query-product data pairs are obtained by mining through a statistical model or a semantic relevance model.
6. A product filtering device based on a Trie tree, comprising: An input module, adapted to input a query-product data pair obtained based on a user search term, wherein the query-product data pair is a query-product data pair in an offline matching dictionary mined based on the user search term through a statistical model or a semantic relevance model, or a query-product data pair recalled based on the user search term in an online query; a filtering module adapted to filter the input query-product data pairs using a Trie tree of a filtering dictionary according to specified filtering rules, wherein the Trie tree of the filtering dictionary is constructed by pushing each element in the filtering dictionary into a tree structure; and Output module, suitable for outputting filtered results; Wherein, the filtering module is also suitable for: The Trie tree of the filtering dictionary is used to search for the position of the element in the filtering dictionary and the weight of the element in the query-product data pair, and the query-product data pair is filtered according to the position and weight of the element.
7. The device according to claim 6, wherein The Trie tree of the filter dictionary is constructed by pushing each element in the filter dictionary into the tree structure in a manner that any path from the root node to the leaf node represents an element.
8. The device according to claim 6, wherein The specified filtering rules include at least one of the following: Whether the theme is suitable, whether the region is appropriate, and whether there are sensitive words.
9. The device according to claim 6, wherein Also includes: The selection module is adapted to select a corresponding Trie tree of the filter dictionary according to the filter condition of the query before the filter module filters the input query-product data pair using the Trie tree of the filter dictionary.
10. The device according to any one of claims 6 to 9, wherein: The query-product data pairs are obtained by mining through a statistical model or a semantic relevance model.
11. A computer storage medium storing a computer program code, wherein when the computer program code is executed on a computing device, the computing device is caused to execute the Trie tree-based commodity filtering method according to any one of claims 1 to 5.
12. A computing device comprising: processor; as well as a memory storing computer program code; When the computer program code is executed by the processor, it causes the computing device to execute the Trie tree-based commodity filtering method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Webpage filtration method with sensitivity calculation function
CN103678602A
Orient field self body intelligence library article search method
CN106446162A