CN-120687659-B - Item recommendation method, apparatus, device, readable storage medium, and program product
Abstract
The present application relates to an item recommendation method, apparatus, device, readable storage medium and program product. The method comprises the steps of determining attribute labels corresponding to all target text elements representing attribute information of the finest granularity of an article after normalization processing, obtaining a maximum connected subgraph representing association relations among the articles, determining N target nodes from all nodes according to centrality values of the nodes, traversing the rest nodes in the connected subgraph by taking the N target nodes as iteration starting nodes respectively, and carrying out iteration division on the maximum connected subgraph according to a shortest path until the number of clustered nodes meets preset iteration ending conditions, so that a relation graph is obtained. And inputting the relationship map data of the articles to be queried determined in the relationship map and the article structural data determined in the article structural database into a large language model as context information to obtain a query result matched with the query data. By adopting the method, the recommending efficiency and reliability of the article can be improved.
Inventors
- LI ZHENG
Assignees
- 杭州乒乓智能技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20250430
Claims (10)
- 1. A method of recommending items, the method comprising: determining all target text elements representing the attribute information of the finest granularity of the object and attribute tags corresponding to the target text elements after normalization processing; Obtaining a maximum connected subgraph representing the association relation among the articles, wherein each node in the connected subgraph represents an article, and each node has the attribute label; Determining the centrality value of each node, and determining N target nodes from all the nodes according to the centrality value; Traversing the rest nodes in the connected subgraph by taking N target nodes as iteration starting nodes respectively, determining the attribution positions of the rest nodes according to the shortest paths, carrying out iterative division on the maximum connected subgraph based on the attribution positions until the number of nodes which are divided into clusters meets the preset iteration ending condition, obtaining a plurality of target clusters, and determining the relation graph of the object according to the plurality of target clusters; Acquiring query data of an article to be queried, determining relationship graph data of the article to be queried from the relationship graph according to the query data, and determining article structural data of the article to be queried from an article structural database according to the query data; and inputting the relational graph data and the article structural data as context information into a large language model, and outputting a query result matched with the query data through the large language model.
- 2. The method according to claim 1, wherein determining all target text elements that characterize the finest granularity attribute of the object, and the attribute tags corresponding to each target text element after normalization processing, comprises: Acquiring article information of all articles in a preset database; Extracting the article information by using a preset large language model to obtain at least one target text element with the finest granularity attribute of each article; and acquiring a preset prompt word template, merging all the target text elements according to the preset prompt word template, and determining a plurality of merged text element sets and attribute tags corresponding to the merged text element sets, wherein each merged text element set at least comprises two target text elements.
- 3. The method of claim 1, wherein determining the home position of the remaining nodes according to the shortest path, and iteratively dividing the maximum connected subgraph based on the home position until the number of nodes that obtain the cluster after division satisfies a preset iteration end condition, to obtain a plurality of target clusters, includes: determining path distances between the rest nodes except the target nodes in the maximum connected subgraph and the iteration starting nodes by taking the target nodes as the iteration starting nodes; determining the attribution relation between the residual nodes and each target node according to the shortest path based on the path distance to obtain N estimated clusters; if the number of the nodes in each estimated cluster meets a preset iteration ending condition, determining the estimated cluster as a target cluster; If the number of the nodes with the target estimated clustering in the estimated clustering does not meet the preset iteration ending condition, the step of determining the central degree value of each node is executed aiming at the target estimated clustering, and N target nodes are determined from all the nodes according to the central degree value until the number of the nodes with the target estimated clustering meets the preset iteration ending condition after the partitioning, so that a plurality of target clustering is obtained.
- 4. A method according to any one of claims 1 to 3, characterized in that the method further comprises: determining the occupancy value of the target attribute label in each target cluster aiming at each target cluster; Polymerizing all the target clusters according to the ratio to obtain a plurality of complete clusters, wherein each complete cluster comprises complete association relations among the objects; and updating the relation map according to the complete clustering.
- 5. The method of claim 4, wherein said determining, for each of said target clusters, a occupancy value of a target attribute tag in each of said target clusters, comprises: Determining the number of labels of the target attribute labels in the target cluster and the total number of the attribute labels of the target cluster aiming at each target cluster; And determining the occupation ratio of the target attribute tags according to the tag number and the total attribute tag number.
- 6. The method of claim 4, wherein said polymerizing all of said target clusters according to said ratio results in a plurality of complete clusters, comprising: For all the target clusters, if a first duty ratio exists in a plurality of duty ratios, and the first duty ratio is in a first preset range, determining all first nodes corresponding to the first duty ratio as an independent complete cluster; If a second duty ratio in a second preset range and a third duty ratio in a third preset range exist in the plurality of duty ratios, all second nodes corresponding to the second duty ratio are cracked to obtain independent nodes, and all the cracked second nodes are divided through all the third nodes corresponding to the third duty ratio to obtain independent complete clusters.
- 7. An item recommendation device, the device comprising: The normalization processing module is used for determining all target text elements representing the finest granularity attribute of the object and attribute tags corresponding to the target text elements after normalization processing; The data acquisition module is used for acquiring a maximum connected subgraph representing the association relationship among the articles, wherein each node in the connected subgraph represents an article, and each node has the attribute label; The sub-graph dividing module is used for determining the centrality value of each node and determining N target nodes from all the nodes according to the centrality value; Traversing the rest nodes in the connected subgraph by taking N target nodes as iteration starting nodes respectively, determining the attribution positions of the rest nodes according to the shortest paths, carrying out iterative division on the maximum connected subgraph based on the attribution positions until the number of nodes which are divided into clusters meets the preset iteration ending condition, obtaining a plurality of target clusters, and determining the relation graph of the object according to the plurality of target clusters; The query and answer processing module is used for acquiring query data of the to-be-queried article, determining relationship map data of the to-be-queried article from the relationship map according to the query data, and determining article structural data of the to-be-queried article from an article structural database according to the query data; and inputting the relational graph data and the article structural data as context information into a large language model, and outputting a query result matched with the query data through the large language model.
- 8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
- 9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
- 10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
Description
Item recommendation method, apparatus, device, readable storage medium, and program product Technical Field The present application relates to the field of data processing technology, and in particular, to an article recommendation method, apparatus, device, readable storage medium, and program product. Background With the rapid development of electronic commerce platforms, in order to meet the demands of different users, electronic commerce platforms need to process massive commodity and user data so as to improve the shopping experience and satisfaction of the users. For example, the e-commerce platform needs to attract users through accurate merchandise selections and recommendations, and users want to quickly find target merchandise by reducing search costs. With the rapid development of artificial intelligence technology, particularly the rise of large language models (Large Language Models, LLM), large-scale language models have achieved a remarkable performance in understanding human intent and rapid response. The large language model is gradually applied to the generated questions and answers. In the related art, a recommendation scheme is generated from a large language model by inputting relevant parameters of goods into the large language model, however, this technology cannot satisfy the rapid determination of target sub-groups having similar demands, features or behavior patterns and the simultaneous comparison of various attributes of a plurality of similar goods, and thus a method capable of improving the goods recommendation efficiency and reliability is required. Disclosure of Invention In view of the foregoing, it is desirable to provide an item recommendation method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve item recommendation efficiency and reliability. In a first aspect, the present application provides an item recommendation method, including: determining all target text elements representing the finest granularity attribute of the object and attribute tags corresponding to the target text elements after normalization processing; Obtaining a maximum connected subgraph representing the association relation among the articles, wherein each node in the connected subgraph represents an article, and each node has the attribute label; Determining the centrality value of each node, and determining N target nodes from all the nodes according to the centrality value; Traversing the rest nodes in the connected subgraph by taking N target nodes as iteration starting nodes respectively, determining the attribution positions of the rest nodes according to the shortest paths, carrying out iterative division on the maximum connected subgraph based on the attribution positions until the number of nodes which are divided into clusters meets the preset iteration ending condition, obtaining a plurality of target clusters, and determining the relation graph of the object according to the plurality of target clusters; Acquiring query data of an article to be queried, determining relationship graph data of the article to be queried from the relationship graph according to the query data, and determining article structural data of the article to be queried from an article structural database according to the query data; and inputting the relational graph data and the article structural data as context information into a large language model, and outputting a query result matched with the query data through the large language model. In one embodiment, the determining all target text elements that characterize the finest granularity attribute of the object, and the attribute labels corresponding to the target text elements after normalization processing, includes: Acquiring article information of all articles in a preset database; Extracting the article information by using a preset large language model to obtain at least one target text element with the finest granularity attribute of each article; and acquiring a preset prompt word template, merging all the target text elements according to the preset prompt word template, and determining a plurality of merged text element sets and attribute tags corresponding to the merged element sets, wherein each merged text element set at least comprises two target text elements. In one embodiment, determining the home position of the remaining nodes according to the shortest path, and iteratively dividing the maximum connected subgraph based on the home position until the number of nodes of the divided clusters meets a preset iteration end condition, to obtain a plurality of target clusters, including: determining path distances between the rest nodes except the target nodes in the maximum connected subgraph and the iteration starting nodes by taking the target nodes as the iteration starting nodes; determining the attribution relation between the residual nodes and each target node according to the sho