Item recommendation method, device, equipment, readable storage medium and program product
By constructing and segmenting the relationship graph of items, and combining large language models and structured data, the problem of low efficiency and reliability of item recommendation in existing technologies is solved, and fast and accurate product selection and market segmentation identification are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU PINGPONG INTELLIGENT TECH CO LTD
- Filing Date
- 2025-04-30
- Publication Date
- 2026-05-05
AI Technical Summary
Existing technologies cannot quickly identify target subgroups with similar needs, characteristics, or behavioral patterns, and cannot effectively compare multiple attributes of several similar items, resulting in low efficiency and reliability of item recommendations.
By identifying the target text elements of the finest-grained attributes of items and their normalized attribute labels, a maximum connected subgraph is constructed and divided into multiple target clusters. The query results are output using a large language model, and recommendations are made in conjunction with the item's structured data.
It improves the efficiency and reliability of product recommendations, enabling quick identification of niche markets and accurate comparison of multiple similar products based on various attributes, thus meeting sellers' product selection needs.
Smart Images

Figure CN120687659B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device, readable storage medium, and program product for recommending items. Background Technology
[0002] With the rapid development of e-commerce platforms, in order to meet the needs of diverse users, these platforms need to process massive amounts of product and user data to improve the user shopping experience and satisfaction. For example, e-commerce platforms need to attract users through precise product selection and recommendations, and users hope to quickly find their target products by reducing search costs. With the rapid development of artificial intelligence technology, especially the rise of Large Language Models (LLMs), large-scale language models have achieved remarkable performance in understanding human intent and responding quickly. Large language models are increasingly being applied to generative question answering.
[0003] In related technologies, product-related parameters are input into a large language model, which then generates a recommendation scheme. However, this technology cannot quickly identify target subgroups with similar needs, characteristics, or behavioral patterns, or simultaneously compare multiple attributes of similar items. Therefore, a method that can improve the efficiency and reliability of item recommendations is needed. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the efficiency and reliability of item recommendation in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a method for recommending items, including:
[0006] Identify all target text elements that represent the finest-grained attributes of an item, and the attribute labels corresponding to each target text element after normalization.
[0007] Obtain the largest connected subgraph representing the relationships between the items; each node in the connected subgraph represents an item, and each node contains the attribute label.
[0008] Determine the centrality value of each node, and determine N target nodes from all the nodes based on the centrality value;
[0009] Taking N target nodes as the starting nodes of the iteration, the remaining nodes in the connected subgraph are traversed, and the belonging position of the remaining nodes is determined according to the shortest path. The maximum connected subgraph is iteratively divided based on the belonging position until the number of nodes in the resulting clusters meets the preset iteration termination condition, resulting in multiple target clusters. The relationship graph of the items is determined based on the multiple target clusters.
[0010] Obtain query data for the item to be queried, determine the relationship graph data of the item to be queried from the relationship graph based on the query data, and determine the item structured data of the item to be queried from the item structured database based on the query data;
[0011] The relationship graph data and the structured data of the items are input into the large language model as contextual information, and the large language model outputs query results that match the query data.
[0012] In one embodiment, determining all target text elements representing the finest-grained attributes of an item, and the attribute labels corresponding to each of the target text elements after normalization, includes:
[0013] Retrieve item information for all items in the preset database;
[0014] The information of each item is extracted using a pre-defined large language model to obtain the target text element of at least one finest-grained attribute of each item;
[0015] Obtain a preset prompt word template, merge all the target text elements according to the preset prompt word template, determine multiple merged text element sets, and attribute tags corresponding to each merged text element set; each merged text element set includes at least two target text elements.
[0016] In one embodiment, the remaining nodes are determined according to the shortest path, and the maximum connected subgraph is iteratively partitioned based on the partitioned locations until the number of nodes in the resulting clusters meets a preset iteration termination condition, resulting in multiple target clusters, including:
[0017] Using each of the target nodes as the iteration start node, determine the path distance between the remaining nodes in the maximum connected subgraph (excluding the target nodes) and each of the iteration start nodes;
[0018] Based on the path distance, the affiliation relationship between the remaining nodes and each of the target nodes is determined according to the shortest path, resulting in N estimated clusters.
[0019] If the number of nodes in each of the estimated clusters meets the preset iteration termination condition, then the estimated cluster is determined as the target cluster.
[0020] If the number of nodes in the estimated cluster does not meet the preset iteration end condition, then for the target estimated cluster, the steps of determining the centrality value of each node and determining N target nodes from all the nodes based on the centrality value are performed until the number of nodes in the resulting cluster meets the preset iteration end condition, thus obtaining multiple target clusters.
[0021] In one embodiment, the method further includes:
[0022] For each target cluster, determine the proportion of target attribute tags in each target cluster;
[0023] Based on the stated percentage, all the target subgroups are aggregated to obtain multiple complete subgroups; each complete subgroup includes the complete association relationship between the items.
[0024] The relationship graph is updated based on the complete cluster.
[0025] In one embodiment, determining the proportion of target attribute tags in each target cluster includes:
[0026] For each target cluster, determine the number of target attribute tags in the target cluster and the total number of attribute tags in the target cluster;
[0027] The proportion of the target attribute tag is determined based on the number of tags and the total number of attribute tags.
[0028] In one embodiment, the aggregation of all the target clusters according to the proportion value to obtain multiple complete clusters includes:
[0029] For all the target clusters, if there is a first percentage value among the multiple percentage values, and the first percentage value is within a first preset range, then all the first nodes corresponding to the first percentage value are determined as an independent complete cluster.
[0030] If among the multiple percentage values there exists a second percentage value within a second preset range and a third percentage value within a third preset range, then all second nodes corresponding to the second percentage value are split to obtain independent nodes. All the split second nodes are then divided using all the third nodes corresponding to the third percentage value to obtain independent complete clusters.
[0031] Secondly, this application also provides an item recommendation device, comprising:
[0032] The normalization module is used to determine all target text elements that represent the finest-grained attributes of an item, as well as the attribute labels corresponding to each target text element after normalization.
[0033] The data acquisition module is used to acquire the largest connected subgraph representing the relationships between the items; each node in the connected subgraph represents an item, and each node has the attribute label;
[0034] The subgraph partitioning module is used to determine the centrality value of each node and to determine N target nodes from all the nodes based on the centrality value.
[0035] Taking N target nodes as the starting nodes of the iteration, the remaining nodes in the connected subgraph are traversed, and the belonging position of the remaining nodes is determined according to the shortest path. The maximum connected subgraph is iteratively divided based on the belonging position until the number of nodes in the resulting clusters meets the preset iteration termination condition, resulting in multiple target clusters. The relationship graph of the items is determined based on the multiple target clusters.
[0036] The question-and-answer processing module is used to obtain the query data of the item to be queried, and determine the relationship graph data of the item to be queried from the relationship graph based on the query data;
[0037] The relation graph data is input into the large language model as contextual information, and the large language model outputs query results that match the query data.
[0038] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any of the above-mentioned methods.
[0039] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0040] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the above-mentioned methods.
[0041] The aforementioned item recommendation methods, devices, computer equipment, computer-readable storage media, and computer program products normalize the target text elements of the item's smallest granularity attribute information to obtain the corresponding attribute labels after normalization. This establishes a mapping relationship between each target text element and its normalized attribute labels, avoiding the problems of complex item categories and unclear classification boundaries. Based on this, by splitting and recombining the largest connected subgraph representing item relationships, a predetermined number of target clusters are obtained, constructing an item relationship graph. Then, based on query data, the relationship graph data of the item to be queried is determined from the relationship graph. The relationship graph data and the item's structured data are input as contextual information into a large language model, which outputs query results matching the query data. This satisfies the seller's need to quickly find niche markets and simultaneously compare multiple similar products with various attributes, thereby improving product selection efficiency and accuracy. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0043] Figure 1 This is a diagram illustrating the application environment of the item recommendation method in one embodiment;
[0044] Figure 2 This is a flowchart illustrating an item recommendation method in one embodiment;
[0045] Figure 3 This is a flowchart illustrating step 202 in one embodiment;
[0046] Figure 4 This is a flowchart illustrating a method for splitting a connected subgraph in one embodiment;
[0047] Figure 5 This is a flowchart illustrating the item recommendation method in another embodiment;
[0048] Figure 6 This is a structural block diagram of an item recommendation device in one embodiment;
[0049] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0051] KAG (Knowledge-Augmented Generation): A technology that enhances the accuracy and relevance of generated content by integrating external knowledge bases.
[0052] RAG (Retrieval-Augmented Generation): A method that combines a retrieval system and a generative model to first retrieve relevant information and then generate a response, thereby improving the accuracy of the output facts.
[0053] LLM (Large Language Model): A deep learning model based on large-scale parameters and training data, capable of understanding and generating human-like natural language text.
[0054] NL2SQL (Natural Language to SQL): A technology that automatically converts natural language queries into structured SQL queries, enabling non-technical users to interact with databases using everyday language.
[0055] Amazon has nearly 20,000 subcategories, and some products have mixed categories and unclear boundaries. To help customers better identify blue ocean markets, further product categorization is needed. For example, the bird toy category needs to be further subdivided into parrot toys, chick toys, marking tools, stands, props, etc. It is necessary to determine whether the sub-market is a red ocean or a blue ocean market based on the relevance of the products.
[0056] In related technologies, the method of inputting relevant parameters of products into a large language model to generate recommendation schemes has low product selection efficiency and reliability, and cannot meet the needs of sellers to quickly find niche markets and compare multiple similar products with multiple attributes at the same time. Therefore, a product relationship graph question-and-answer product selection system based on KAG is proposed. This system can query basic information and related information of products based on natural language, and conduct question-and-answer based on this information, which greatly improves product selection efficiency and product selection experience.
[0057] The item recommendation method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server. The terminal retrieves item information from the server. Based on this information, it identifies all target text elements representing the finest-grained attributes of the items, as well as the attribute labels corresponding to each target text element after normalization. It then obtains the largest connected subgraph representing the relationships between items. Each node in the connected subgraph represents an item, and each node has an attribute label. The terminal determines the centrality value of each node and identifies N target nodes from all nodes based on these values. Starting with the N target nodes, it iterates through the remaining nodes in the connected subgraph, determining their location based on the shortest path. Based on these locations, it iteratively partitions the largest connected subgraph until the number of nodes in each partition meets a preset iteration termination condition, resulting in multiple target clusters. Based on these target clusters, it determines the item relationship graph. Finally, it retrieves query data for the item to be queried, determines the relationship graph data for the item to be queried from the relationship graph based on the query data, and determines the item structure data for the item to be queried from the item structure database based on the query data. The relationship graph data and item structure data are input as contextual information into a large language model, which then outputs query results matching the query data.
[0058] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. The server 104 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.
[0059] In one exemplary embodiment, such as Figure 2 As shown, an item recommendation method is provided, which can be applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps 202 to 212. Wherein:
[0060] Step 202: Determine all target text elements that represent the finest-grained attributes of the item, and the attribute labels corresponding to each target text element after normalization.
[0061] In this context, the target text element can be understood as the core key phrases representing the smallest granular attribute information of an item. It's important to note that multiple attribute descriptions for the same dimension of the same item can exist. To address this, it's crucial to avoid mixing item categories and unclear boundaries, which could hinder accurate recommendations. For example, consider athletic shoes. Their uppers are primarily made of mesh and leather. Different vendors might offer descriptions like "mesh + leather," "leather and mesh combination," "breathable mesh with leather," "mesh and leather combination," and "leather and mesh upper." If an e-commerce platform categorizes "mesh + leather" as "mesh" and "leather and mesh combination" as "leather," the shoe might not be found during a search, and it would be impossible to accurately determine whether "mesh and leather combination" and "leather and mesh combination" refer to the same material. Furthermore, when using LLM to merge and normalize target text elements, attributes containing multiple sub-attributes within the target text element are broken down into the finest granularity. For instance, "mesh + leather" is broken down into the fine granularity of "mesh" and "leather."
[0062] For example, taking color as an example, white might have different descriptions such as gray-white, light-white, and combinations of gray and white. These different descriptions make it difficult to normalize different attributes. Furthermore, when using LLM to merge and normalize target text elements, gray-white cannot be further separated because it is a combined attribute. Therefore, it is necessary to normalize each target text element. Normalization can be understood as merging target text elements belonging to the same item subclass after deduplication, obtaining the mapping relationship between the original key information (i.e., target text elements) and the merged key information. The merged key information is the normalized attribute label. It should be noted that the target text element normalization method can be implemented using existing methods, which will not be elaborated here.
[0063] Step 204: Obtain the largest connected subgraph representing the relationships between items; each node in the connected subgraph represents an item, and each node has an attribute label.
[0064] The maximum connected subgraph can be a relationship graph representing the association between items and similar items, constructed by the e-commerce platform using collaborative filtering. The specific method for determining the maximum connected subgraph is based on existing implementations and will not be elaborated here. Attribute tags are determined by merging the target text elements as described above to obtain the merged key information. The relationship between ASIN and attribute tags can be one-to-many. Product attributes are generally at the ASIN granularity, i.e., SKU variant granularity. For example, if an item is a water cup, its ASIN is xxx. Water cups come in three colors (red, blue, white) and three sizes (S, M, L), resulting in nine SKU variant granularities. The relationship between target text elements and attribute tags can also be one-to-many. Because LLM merges target text elements, it splits attributes containing multiple sub-attributes into the finest granularity.
[0065] It's important to note that e-commerce platforms collect millions of edge relationships daily for similar item recommendations, resulting in maximum connected subgraphs with tens of thousands of nodes. The sheer volume of information in the graph can become overwhelming, leading to sparse connections between nodes and significantly increasing the complexity of operations such as calculating connectivity, similarity, and paths. This can require substantial computational resources, ultimately resulting in unreliable accuracy and low efficiency in item recommendations. Therefore, it's necessary to split the maximum connected subgraph.
[0066] Step 206: Determine the centrality value of each node, and determine N target nodes from all nodes based on the centrality value.
[0067] The centrality value can be determined by adding the in-degree and out-degree of each node, or by other methods. The attribute labels of the N target nodes are different.
[0068] For example, the centrality value of each node is calculated, the maximum connected subgraph is divided, the total number of clusters N is estimated according to N nodes in each cluster, and N target nodes with different attribute labels corresponding to the top N centrality values are determined from all nodes based on the centrality values. This includes considering the maximum concentrated distribution interval of hot products, the length limit of the LLM context, and the upper limit of products for comparison.
[0069] Step 208: Using N target nodes as the starting nodes of the iteration, traverse the remaining nodes in the connected subgraph, determine the belonging position of the remaining nodes according to the shortest path, and iteratively divide the largest connected subgraph based on the belonging position until the number of nodes in the resulting clusters meets the preset iteration termination condition, thus obtaining multiple target clusters. Determine the relationship graph of the items based on the multiple target clusters.
[0070] The shortest path can be determined using Dijkstra's shortest path algorithm. A preset iteration termination condition is that if the number of cluster nodes exceeds a preset number, the iteration is paused, indicating that the market corresponding to the cluster is saturated.
[0071] For example, with N target nodes as the starting nodes of the iteration, the Dijkstra shortest path algorithm is used to determine the belonging position of the remaining nodes in the maximum connected subgraph excluding the N target nodes. This process continues until all remaining nodes have their corresponding belonging positions, completing the initial partitioning of the maximum connected subgraph. If the number of nodes in all clusters of the estimated total number of clusters N obtained from the initial partitioning meets the preset iteration termination condition, the iteration ends, resulting in multiple target clusters. The relationship graph of the items is then determined based on the multiple target clusters.
[0072] If the number of nodes in all clusters of the estimated total number of clusters N obtained in the initial partitioning does not meet the preset iteration termination condition, then the centrality value of each cluster determined by the partitioned nodes is recalculated, and the step of selecting N target nodes with different attribute labels corresponding to the top N centrality values is executed to determine the belonging position of each node until the number of nodes in the clusters obtained after partitioning meets the preset iteration termination condition, resulting in multiple target clusters.
[0073] Step 210: Obtain the query data of the item to be queried, determine the relationship graph data of the item to be queried from the relationship graph based on the query data, and determine the item structure data of the item to be queried from the item structure database.
[0074] The query data can be at least one of the following: related items to the item to be queried, the average price of related items to the item to be queried, sales data of related items to the item to be queried, feature analysis data of related items to the item to be queried, or market segments that can be divided into which demand dimensions related items to the item to be queried.
[0075] A structured product database can be understood as a knowledge graph defined based on product information. It includes basic attribute information such as the product's basic profile information written according to its ASIN (Association Name), including ASIN, pasin, highest-exposure keywords, and sales figures for the past 30 days. It's important to note that product attributes are generally at the ASIN granularity, which is the SKU variant granularity. A pasin is a product concept; for example, a cup corresponds to one pasin, and different colors correspond to different ASINs.
[0076] For example, query data for the item to be queried is obtained. This query data is then transformed into a Cyper query statement using an LLM-based approach. The Cyper query statement is used to determine the relationship graph data of the item to be queried from the relationship graph. Based on the NL2SQL prompt template, the query data is converted into an SQL query statement. The SQL query statement is then used to retrieve the item structured data of the item to be queried from the item structured database. The prompt template includes the query scope and query quantity limits for the SQL query statement. The query scope and query quantity limits for the SQL query statement may be related to the selection of the top-k items in the rag search; generally, the top 2k items are considered in the recall phase, and the top-k items are considered in the ranking phase.
[0077] Step 212: Input the relationship graph data and the structured data of the items as contextual information into the large language model, and output the query results that match the query data through the large language model.
[0078] Optionally, the query data can be the related items to the item to be queried, and the corresponding output query result is a relationship graph; the query data can be the average price of the related items to the item to be queried, and the corresponding output is a relationship graph and structured data statistics; the query data can be the sales data of the related items to the item to be queried, and the corresponding output is a relationship graph and structured data statistics sales; the query data can be the feature analysis data of the related items to the item to be queried, and the corresponding output is a relationship graph, structured data, and analysis data of a large language model.
[0079] For example, relationship graph data and item structured data are integrated as contextual information. The contextual information and query data are taken as a complete input and fed into a large language model to perform rag-based question and answer retrieval, and output query results that match the query data.
[0080] The aforementioned item recommendation method normalizes the target text elements of the item's smallest granularity attribute information to obtain the corresponding attribute labels after normalization. This establishes a mapping relationship between each target text element and the normalized attribute labels, avoiding the problems of complex item categories and unclear classification boundaries. Based on this, the method splits and reorganizes the maximum connected subgraph representing item relationships to obtain a predetermined number of target clusters, constructing an item relationship graph. Then, based on query data, the relationship graph data of the item to be queried is determined from the relationship graph. Dividing the graph into maximum connected subgraphs simplifies its complexity and reduces data processing volume. Compared to directly using a large language model for recommendation, this method uses relationship graph data as contextual information input into the large language model, outputting query results that match the query data. This integrates an external knowledge base to enhance the accuracy of generated content, improves product selection efficiency, and meets the needs of sellers to quickly find niche markets and simultaneously compare multiple attributes of similar products.
[0081] In one exemplary embodiment, such as Figure 3 As shown, step 202 includes steps 302 to 306.
[0082] in:
[0083] Step 302: Obtain item information for all items in the preset database.
[0084] The item information includes the item description, which is used on e-commerce platforms to display the characteristics of an item. This description may include the product's core functions or main features, material or quality information, applicable scenarios or target audience, additional information or services, and user reviews. Describing an item as a commodity involves obtaining its five-point product description.
[0085] For example, market analysis tools based on big data analytics and artificial intelligence algorithms are used to obtain the relationship between product descriptions and keywords in market segments. Based on the relationship between product descriptions and keywords, a large language model (e.g., Qwen2.5) is further trained through SFT (Supervised Fine-Tuning) to enable it to better understand and process product information, resulting in a trained large language model LLM.
[0086] Step 304: Extract information from each item using a pre-defined large language model to obtain target text elements with at least one finest-grained attribute for each item.
[0087] For example, the trained large language model is used to extract the target text elements of the finest-grained attributes of each item from the five-point description, that is, to extract key phrases to represent item information.
[0088] Step 306: Obtain a preset prompt word template, merge all target text elements according to the preset prompt word template, determine multiple merged text element sets, and the attribute tags corresponding to each merged text element set; each merged text element set includes at least two target text elements.
[0089] The preset prompt word template includes a merging strategy and output format requirements for the merged data. The merging strategy may include merging target text elements with similarity within a preset range, merging invalid or unclassifiable target text elements into other categories, and controlling the number of characters in the merged target text elements within a preset range. The output format requirements include returning the processing result in JSON format, which includes both original key information and merging key information. Here, merging key information refers to the attribute labels determined after normalization of target text elements with similarity within a preset range. Original key information refers to the target text elements themselves. For example, the preset prompt word template is obtained, and target text elements with similarity within a preset range are determined according to the template. This involves dividing the text into batches based on identical words. If a single batch is too large, it is randomly and evenly split multiple times according to the LLMtoken context constraints to obtain multiple sets of merged text elements that meet the text length limit, and the attribute labels corresponding to each merged set. In other words, a mapping relationship is obtained between the target text elements and the normalized attribute labels. This mapping relationship can be expressed as:
[0090] {asin1:[tag1, tag2], asin2:[tag1, tag3, tag4]}, where asin1 and asin2 represent different attribute tags. Target text elements that are mapped to asin1 include tag1 and tag2, and target text elements that are mapped to asin2 include tag1, tag3, and tag4. In this embodiment, by extracting the target text elements of the finest-grained attributes, the extracted target text elements under the same subclass are merged according to batches by a large language model to obtain the attribute tags corresponding to each target text element. This achieves normalization of attribute information and avoids the situation of mixed item categories and unclear boundaries.
[0091] It should be noted that e-commerce platforms collect millions of edge relationships from data sources associated with products every day when recommending similar products, and the largest connected subgraph has more than 10,000 nodes. Recommending products based on this will result in low efficiency. Therefore, how to further split the connected subgraph is a technical problem that urgently needs to be solved.
[0092] In one exemplary embodiment, a method for splitting a connected subgraph is provided, such as... Figure 4 As shown, it includes the following steps:
[0093] Step 402: Determine the centrality value of each node, and determine N target nodes from all nodes based on the centrality value.
[0094] Step 404: Using each target node as the iteration start node, determine the path distance between the remaining nodes in the maximum connected subgraph (excluding the target nodes) and each iteration start node.
[0095] Step 406: Based on the path distance, determine the affiliation relationship between the remaining nodes and each target node according to the shortest path to obtain N estimated clusters; if the number of nodes in each estimated cluster meets the preset iteration termination condition, then the estimated cluster is determined as the target cluster.
[0096] Step 408: If the number of nodes in the estimated cluster that are the target estimated clusters does not meet the preset iteration end condition, then for the target estimated clusters, perform the steps of determining the centrality value of each node and determining N target nodes from all nodes based on the centrality value, until the number of nodes in the clusters obtained after partitioning meets the preset iteration end condition, and obtain multiple target clusters.
[0097] The above-described method of splitting a connected subgraph determines multiple target nodes as the starting nodes for cluster iterations by determining the centrality values of the nodes in the connected subgraph. The remaining nodes in the connected subgraph are then assigned positions based on the shortest distance. After one iteration, if all the resulting clusters meet the preset iteration termination condition, the iteration ends. If not, the same iteration principle is applied to the clusters that do not meet the preset termination condition until the number of nodes in the resulting clusters meets the preset iteration termination condition. This completes the partitioning and re-merging of the connected subgraph. This method can obtain clusters that meet the requirements for item segmentation. In the case of recommendations, it avoids problems such as excessive computation and errors in edges that lead to low recommendation efficiency and accuracy.
[0098] It is understandable that some items in a connected subgraph may not be directly related due to the recommendation algorithm mechanism (collaborative filtering), yet they are still recommended; conversely, some items may have the same information, but collaborative filtering results in them not being in the same connected subgraph, leading to inaccurate item recommendations. To address this situation, the following methods are provided for decoupling and associating information:
[0099] In an exemplary embodiment, for each target subgroup, the proportion of target attribute tags in each target subgroup is determined; all target subgroups are aggregated according to the proportion to obtain multiple complete subgroups; each complete subgroup includes the complete association relationship between items, and the relationship graph is updated according to the complete subgroups.
[0100] The percentage value is determined based on the number of target attribute tags in the target cluster and the total number of attribute tags in the target cluster. The number of target attribute tags refers to the number of attribute tags matched by the target text element of the node. Each target cluster can include multiple attribute tags, and correspondingly, there will be multiple percentage values. Therefore, the aggregation strategy is determined based on the multiple percentage values of each target cluster and the preset indicator range.
[0101] Optionally, in an exemplary embodiment, for each target cluster, determining the proportion of target attribute tags in each target cluster includes: for each target cluster, determining the number of target attribute tags in the target cluster and the total number of attribute tags in the target cluster; and determining the proportion of target attribute tags based on the number of tags and the total number of attribute tags. The target attribute tag can be the attribute tag with the most tag hits. The proportion can be determined in the following way:
[0102]
[0103] The aggregation strategy is determined based on multiple percentage values for each target cluster and a preset indicator range. Specifically, all target clusters are aggregated according to their percentage values to obtain multiple complete clusters, including:
[0104] For all target clusters, if a first proportion value exists among multiple label centrality indicators, and the first proportion value is within a first preset range, then all first nodes corresponding to the first proportion value are determined as an independent complete cluster.
[0105] If multiple label centrality indices have a second proportion value within a second preset range and a third proportion value within a third preset range, then all second nodes corresponding to the second proportion value are split to obtain independent nodes. All the split second nodes are then divided using all the third nodes corresponding to the third proportion value to obtain independent complete clusters.
[0106] Here, different preset ranges are used to characterize the completeness of node relationships within the corresponding clusters. The first preset range is larger than the third preset range, and the second preset range is smaller than the third preset range. The first proportion value within the first preset range can indicate that the corresponding target cluster, i.e., the subgraph, has good self-organization and has decoupled the item information recommended without direct association due to the recommendation algorithm mechanism (collaborative filtering), as well as the association of items with partial associations that are not determined to exist in the connected subgraph. Partial association information can be some cold-start items, such as products on e-commerce platforms that lack a preset amount of user interaction data (such as purchases, browsing, reviews, etc.). These products can be newly added, and for such items, there is a lack of collaborative filtering recommendation mechanisms, so it is necessary to supplement them through the edge relationships of the product information relationship graph.
[0107] The second proportion, within the second preset range, indicates that the corresponding target cluster (i.e., subgraph) has poor organization, lacks decoupling information, and fails to associate information that is not definitively related to other connected subgraphs. The third proportion, within the third preset range, indicates that the corresponding target cluster (i.e., subgraph) has decoupled item information recommended without direct association due to the recommendation algorithm mechanism (collaborative filtering), or has associated information that is definitively related to other connected subgraphs. All second nodes corresponding to the second proportion are split to obtain independent nodes. All third nodes corresponding to the third proportion are then used to divide all the split second nodes to obtain independent complete clusters. This can be achieved by attempting to reclassify these independent nodes according to their central labels until each cluster is reassigned.
[0108] The above method determines the proportion of attribute tags in each target subgroup, decouples the recommendation algorithm mechanism to recommend items that have no direct association, and associates information that is not determined to have some association in the connected subgraph. It also segments different types of items and recombines the same items, which can achieve detailed comparison of multiple competing products, greatly improve the efficiency of product selection and ensure the reliability of product selection.
[0109] In one exemplary embodiment, such as Figure 5 As shown, an item recommendation method is provided, which can be applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps 502 to 516. Wherein:
[0110] Step 502: Determine all target text elements that represent the finest-grained attribute information of the item, and the attribute labels corresponding to each target text element after normalization.
[0111] Step 504: Obtain the largest connected subgraph representing the relationships between items; each node in the connected subgraph represents an item, and each node has an attribute label.
[0112] Step 506: Determine the centrality value of each node, and determine N target nodes from all nodes based on the centrality value.
[0113] Step 508: Using N target nodes as the starting nodes of the iteration, traverse the remaining nodes in the connected subgraph, determine the belonging position of the remaining nodes according to the shortest path, and iteratively divide the largest connected subgraph based on the belonging position until the number of nodes in the resulting clusters meets the preset iteration termination condition, thus obtaining multiple target clusters. Determine the relationship graph of the items based on the multiple target clusters.
[0114] Step 510: For each target subgroup, determine the percentage of target attribute tags in each target subgroup.
[0115] Step 512: Aggregate all target subgroups according to the proportion value to obtain multiple complete subgroups; each complete subgroup includes the complete association relationship between items, and update the relationship graph according to the complete subgroups.
[0116] Step 514: Obtain the query data of the item to be queried, determine the relationship graph data of the item to be queried from the relationship graph based on the query data, and determine the item structure data of the item to be queried from the item structure database based on the query data.
[0117] Step 516: Input the relationship graph data and the structured data of the items as contextual information into the large language model, and output the query results that match the query data through the large language model.
[0118] It should be noted that the specific implementation method of this embodiment can be achieved through the above-mentioned limitations, and will not be elaborated here.
[0119] In the above embodiments, by normalizing the target text elements of the item's smallest granularity attribute information, the corresponding attribute labels are obtained after normalization. This establishes a mapping relationship between each target text element and its normalized attribute labels, avoiding the problems of complex item categories and unclear classification boundaries. Based on this, a relationship graph is constructed using the maximum connected subgraph between the item and similar items, and the item structured database is defined as a knowledge graph. Intelligent question answering is performed using a KAG approach. The relationship graph data and item structured data are input as contextual information into a large language model. The large language model outputs query results that match the query data, satisfying the seller's need to quickly find niche markets and simultaneously compare multiple similar products with various attributes. This improves product selection efficiency and accuracy, allowing for quick and accurate acquisition of relevant results. In practical applications, it can quickly locate blue ocean products within red ocean markets, improving product selection efficiency and accuracy.
[0120] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0121] Based on the same inventive concept, this application also provides an item recommendation device for implementing the item recommendation method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more item recommendation device embodiments provided below can be found in the limitations of the item recommendation method described above, and will not be repeated here.
[0122] In one exemplary embodiment, such as Figure 6 As shown, an item recommendation device is provided, including: a normalization processing module 602, a data acquisition module 604, a subgraph partitioning module 606, and a question-and-answer processing module 608, wherein:
[0123] The normalization processing module 602 is used to determine all target text elements that represent the finest-grained attributes of an item, as well as the attribute labels corresponding to each target text element after normalization processing.
[0124] The data acquisition module 604 is used to acquire the largest connected subgraph representing the relationships between items; each node in the connected subgraph represents an item, and each node has an attribute label.
[0125] The subgraph partitioning module 606 is used to determine the centrality value of each node, and to determine N target nodes from all nodes based on the centrality value. Taking the N target nodes as the starting nodes of the iteration, the remaining nodes in the connected subgraph are traversed, and the belonging position of the remaining nodes is determined according to the shortest path. The largest connected subgraph is iteratively partitioned based on the belonging position until the number of nodes in the partitioned clusters meets the preset iteration termination condition, resulting in multiple target clusters. The relationship graph of items is determined based on the multiple target clusters.
[0126] The question-answering processing module 608 is used to obtain the query data of the item to be queried, determine the relationship graph data of the item to be queried from the relationship graph based on the query data, and determine the item structure data of the item to be queried from the item structure database based on the query data; input the relationship graph data and item structure data as context information into the large language model, and output the query results that match the query data through the large language model.
[0127] The aforementioned item recommendation device normalizes the target text elements of the item's smallest granular attribute information to obtain the corresponding attribute labels after normalization. This establishes a mapping relationship between each target text element and the normalized attribute labels, avoiding the problems of complex item categories and unclear classification boundaries. Based on this, the device splits and reorganizes the largest connected subgraph representing item relationships to obtain a preset number of target clusters, constructing an item relationship graph. Then, based on query data, it determines the relationship graph data of the item to be queried from the relationship graph. The relationship graph data and the item's structured data are input as contextual information into a large language model, which outputs query results matching the query data. This satisfies the seller's need to quickly find niche markets and simultaneously compare multiple similar products with various attributes, thereby improving product selection efficiency and accuracy.
[0128] In an exemplary embodiment, the normalization processing module 602 is further configured to obtain item information of all items in a preset database;
[0129] The information of each item is extracted using a pre-defined large language model to obtain the target text element of at least one finest-grained attribute for each item.
[0130] Obtain a preset prompt word template, merge all target text elements according to the preset prompt word template, determine multiple merged text element sets, and the attribute tags corresponding to each merged text element set; each merged text element set includes at least two target text elements.
[0131] In an exemplary embodiment, the subgraph partitioning module 606 is further configured to use each target node as the iteration start node to determine the path distance between the remaining nodes in the maximum connected subgraph other than the target nodes and each iteration start node.
[0132] Based on the path distance, the affiliation between the remaining nodes and each target node is determined according to the shortest path, resulting in N estimated clusters.
[0133] If the number of nodes in each estimated cluster meets the preset iteration termination condition, then the estimated cluster is determined as the target cluster.
[0134] If the number of nodes in the estimated cluster that are the target estimated clusters does not meet the preset iteration termination condition, then for the target estimated clusters, the steps of determining the centrality value of each node and determining N target nodes from all nodes based on the centrality value are performed until the number of nodes in the resulting clusters meets the preset iteration termination condition, resulting in multiple target clusters.
[0135] In an exemplary embodiment, the item recommendation device further includes a sub-image merging module, which is used to determine the proportion of target attribute tags in each target sub-group for each target sub-group.
[0136] All target subgroups are aggregated based on their percentage values to obtain multiple complete subgroups; each complete subgroup includes the complete relationships between items, and the relationship graph is updated based on the complete subgroups.
[0137] In an exemplary embodiment, the subgraph merging module is used to determine, for each target cluster, the number of target attribute labels in the target cluster and the total number of attribute labels in the target cluster.
[0138] Determine the percentage of the target attribute tag based on the number of tags and the total number of attribute tags.
[0139] In an exemplary embodiment, the subgraph merging module is used to determine all first nodes corresponding to the first percentage value as an independent complete cluster if a first percentage value exists among multiple percentage values and the first percentage value is within a first preset range for all target clusters.
[0140] If among multiple percentage values there exists a second percentage value within a second preset range and a third percentage value within a third preset range, then all second nodes corresponding to the second percentage value are split to obtain independent nodes. All the split second nodes are then divided using all third nodes corresponding to the third percentage value to obtain independent complete clusters.
[0141] Each module in the aforementioned item recommendation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0142] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements an item recommendation method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0143] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0144] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0145] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0146] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0147] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0148] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0149] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0150] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for recommending items, characterized in that, The method includes: Identify all target text elements that represent the finest-grained attribute information of an item, and the attribute labels corresponding to each target text element after normalization. Obtain the largest connected subgraph representing the relationships between the items; each node in the connected subgraph represents an item, and each node contains the attribute label. Determine the centrality value of each node, and determine N target nodes from all the nodes based on the centrality value; Taking N target nodes as the starting nodes of the iteration, the remaining nodes in the connected subgraph are traversed, and the belonging position of the remaining nodes is determined according to the shortest path. The maximum connected subgraph is iteratively divided based on the belonging position until the number of nodes in the resulting clusters meets the preset iteration termination condition, resulting in multiple target clusters. The relationship graph of the items is determined based on the multiple target clusters. Obtain query data for the item to be queried, determine the relationship graph data of the item to be queried from the relationship graph based on the query data, and determine the item structured data of the item to be queried from the item structured database based on the query data; The relationship graph data and the structured data of the items are input into the large language model as contextual information, and the large language model outputs query results that match the query data.
2. The method according to claim 1, characterized in that, The determination of all target text elements representing the finest-grained attributes of an item, and the attribute labels corresponding to each of the target text elements after normalization, includes: Retrieve item information for all items in the preset database; The information of each item is extracted using a pre-defined large language model to obtain the target text element of at least one finest-grained attribute of each item; Obtain a preset prompt word template, merge all the target text elements according to the preset prompt word template, determine multiple merged text element sets, and attribute tags corresponding to each merged text element set; each merged text element set includes at least two target text elements.
3. The method according to claim 1, characterized in that, The remaining nodes are assigned positions according to the shortest path. Based on these positions, the maximum connected subgraph is iteratively partitioned until the number of nodes in the resulting clusters meets a preset iteration termination condition, resulting in multiple target clusters, including: Using each of the target nodes as the iteration start node, determine the path distance between the remaining nodes in the maximum connected subgraph (excluding the target nodes) and each of the iteration start nodes; Based on the path distance, the affiliation between the remaining nodes and each of the target nodes is determined according to the shortest path, resulting in N estimated clusters. If the number of nodes in each of the estimated clusters meets the preset iteration termination condition, then the estimated cluster is determined as the target cluster. If the number of nodes in the estimated cluster does not meet the preset iteration end condition, then for the target estimated cluster, the steps of determining the centrality value of each node and determining N target nodes from all the nodes based on the centrality value are performed until the number of nodes in the resulting cluster meets the preset iteration end condition, thus obtaining multiple target clusters.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: For each target cluster, determine the proportion of target attribute tags in each target cluster; Based on the stated percentage, all the target subgroups are aggregated to obtain multiple complete subgroups; each complete subgroup includes the complete association relationship between the items. The relationship graph is updated based on the complete cluster.
5. The method according to claim 4, characterized in that, Determining the proportion of target attribute tags in each target cluster includes: For each target cluster, determine the number of target attribute tags in the target cluster and the total number of attribute tags in the target cluster; The proportion of the target attribute tag is determined based on the number of tags and the total number of attribute tags.
6. The method according to claim 4, characterized in that, The aggregation of all target clusters based on the proportion value yields multiple complete clusters, including: For all the target clusters, if there is a first percentage value among the multiple percentage values, and the first percentage value is within a first preset range, then all the first nodes corresponding to the first percentage value are determined as an independent complete cluster. If among the multiple percentage values there exists a second percentage value within a second preset range and a third percentage value within a third preset range, then all second nodes corresponding to the second percentage value are split to obtain independent nodes. All the split second nodes are then divided using all the third nodes corresponding to the third percentage value to obtain independent complete clusters.
7. An item recommendation device, characterized in that, The device includes: The normalization module is used to determine all target text elements that represent the finest-grained attributes of an item, as well as the attribute labels corresponding to each target text element after normalization. The data acquisition module is used to acquire the largest connected subgraph representing the relationships between the items; each node in the connected subgraph represents an item, and each node has the attribute label; The subgraph partitioning module is used to determine the centrality value of each node and to determine N target nodes from all the nodes based on the centrality value. Taking N target nodes as the starting nodes of the iteration, the remaining nodes in the connected subgraph are traversed, and the belonging position of the remaining nodes is determined according to the shortest path. The maximum connected subgraph is iteratively divided based on the belonging position until the number of nodes in the resulting clusters meets the preset iteration termination condition, resulting in multiple target clusters. The relationship graph of the items is determined based on the multiple target clusters. The question-and-answer processing module is used to obtain the query data of the item to be queried, determine the relationship graph data of the item to be queried from the relationship graph based on the query data, and determine the item structure data of the item to be queried from the item structure database based on the query data. The relationship graph data and the structured data of the items are input into the large language model as contextual information, and the large language model outputs query results that match the query data.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. 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 to 6.
10. A computer program product, comprising a computer program, 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 to 6.
Citation Information
Patent Citations
Relational query method implemented on large-scale data set
CN102332009A