Clustering and content recommendation method, equipment, medium and computer program product
The clustering method addresses noise-related issues by using connectivity rates to manage node and cluster merging, improving clustering performance and applicability in content recommendation and denoising.
Patent Information
- Application Number
- CN202310800529.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-12-31
AI Technical Summary
Existing clustering methods are susceptible to noise nodes, leading to the mixing of different categories and failing to effectively cluster nodes with large individual differences within the same category.
A clustering method that utilizes node-cluster connectivity rates and cluster-cluster connectivity rates to determine the merging or deletion of nodes, avoiding noise nodes and setting appropriate merging conditions to improve clustering performance.
Effectively avoids mixing clusters of different categories due to noise nodes while allowing for larger individual differences within the same category, enhancing clustering performance and applicability in content recommendation and denoising scenarios.
Smart Images

Figure CN119226821A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a clustering and content recommendation method, device, medium and computer program product. Background Art
[0002] The process of dividing a collection of physical or abstract objects into multiple classes consisting of similar objects is called clustering. In other words, it is the process of grouping "same" objects together. For example, in the field of content recommendation, the content stored in the server is clustered as objects. Usually, high-dimensional features are used to represent an object (node) in clustering, and the similarity between two nodes is measured by calculating the distance between the two nodes. If the similarity reaches a certain threshold, the two nodes are judged to be the same and are clustered into one class. Although this method is simple and efficient, it is easily affected by noise and does not use more global information. Summary of the invention
[0003] The purpose of the present invention is to provide a clustering and content recommendation method, device, medium and computer program product to solve the technical problem of how to avoid the adverse effects of noise nodes in clustering.
[0004] A first embodiment of the present invention discloses a clustering method for electronic devices, the method comprising:
[0005] Initializing a first cluster and a cluster set, the cluster set including the first cluster, and the first cluster including a first node among a plurality of nodes to be clustered;
[0006] For each other node in the plurality of nodes:
[0007] Determining the number of clusters in the cluster set that are connected to the node;
[0008] Based on the number, deleting the node or merging the node with a cluster in the cluster set;
[0009] The cluster set is taken as the clustering result.
[0010] Optionally, deleting the node or merging the node with a cluster in the cluster set based on the quantity includes:
[0011] When the number is 0, a new cluster including the node is created in the cluster set;
[0012] When the number is 1, merging the node into a cluster connected to the node;
[0013] When the number is 2, if the two clusters connected to the node are connected, the node and the two clusters are merged; if the two clusters connected to the node are exclusive, the node is deleted; otherwise, the node is merged into one of the two clusters connected to the node;
[0014] When the number is any other value, the node is deleted.
[0015] Optionally, determining the number of clusters in the cluster set connected to the node includes:
[0016] For each cluster in the set of clusters:
[0017] Determining a node-cluster connectivity ratio between the cluster and the node, wherein the node-cluster connectivity ratio is equal to a ratio of the number of nodes in the cluster that have edges with the node to the number of all nodes in the cluster, wherein it is determined that there is an edge between two nodes whose cosine distance is less than or equal to a first predetermined threshold;
[0018] When the node-cluster connectivity ratio is greater than or equal to a second predetermined threshold, it is determined that the cluster is connected to the node.
[0019] Optionally, if the two clusters connected to the node are connected, merging the node and the two clusters comprises:
[0020] Determining a cluster-cluster connectivity ratio between the two clusters, where the cluster-cluster connectivity ratio is equal to a ratio of the number of node pairs with edges between the two clusters to the number of all node pairs between the two clusters;
[0021] When the cluster-cluster connectivity ratio is greater than or equal to a third predetermined threshold, it is determined that the two clusters are connected.
[0022] Optionally, if there is a discrepancy between the two clusters connected to the node, deleting the node comprises:
[0023] When the cluster-cluster connectivity ratio is less than a fourth predetermined threshold, it is determined that the two clusters are excluded.
[0024] Optionally, otherwise merging the node into one of two clusters connected to the node comprises:
[0025] If the node-cluster connectivity rates of the two clusters and the node are not equal, merging the node into a cluster of the two clusters having a larger node-cluster connectivity rate with the node;
[0026] If the node-cluster connectivity rates of the two clusters and the node are equal, the node is merged into the cluster with a larger number of nodes among the two clusters.
[0027] A second embodiment of the present invention discloses a content recommendation method for an electronic device, the method comprising:
[0028] Using the clustering method according to the first embodiment of the present invention, clustering the content to be recommended;
[0029] Based on the clustering result, the content is recommended.
[0030] The third embodiment of the present invention discloses an electronic device, which includes a memory storing computer-executable instructions and a processor. When the instructions are executed by the processor, the electronic device implements the clustering method according to the first embodiment of the present invention or the content recommendation method according to the second embodiment of the present invention.
[0031] The fourth embodiment of the present invention discloses a computer storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer executes the clustering method according to the first embodiment of the present invention or the content recommendation method according to the second embodiment of the present invention.
[0032] A fifth embodiment of the present invention discloses a computer program product, comprising computer executable instructions, wherein the instructions are executed by a processor to implement the clustering method according to the first embodiment of the present invention or the content recommendation method according to the second embodiment of the present invention.
[0033] Compared with the prior art, the main differences and effects of the embodiments of the present invention are:
[0034] In the present invention, the clustering method effectively avoids mixing clusters of different categories due to noise nodes through the node-cluster connectivity rate and cluster-cluster connectivity rate. At the same time, the cluster merging conditions are not too harsh, and large individual differences within the same category can be accepted to improve the clustering performance. In addition, the present invention has universal applicability and can be used not only in common clustering scenarios such as content recommendation, but also in tracking tasks or other scenarios of denoising within a sequence. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1A A schematic diagram showing single-chain clustering according to an embodiment of the present application is shown.
[0036] Figure 1B A schematic diagram of full-chain clustering according to an embodiment of the present application is shown.
[0037] Figure 2A flow chart of a clustering method according to an embodiment of the present application is shown.
[0038] Figure 3A A schematic diagram showing a clustering process of nodes 1 to 8 according to an embodiment of the present application.
[0039] Figure 3B A schematic diagram showing a clustering process of nodes 1 to 8 according to an embodiment of the present application.
[0040] Figure 3C A schematic diagram showing a clustering process of nodes 1 to 8 according to an embodiment of the present application.
[0041] Figure 3D A schematic diagram showing a clustering process of nodes 1 to 8 according to an embodiment of the present application.
[0042] Figure 3E A schematic diagram showing a clustering process of nodes 1 to 8 according to an embodiment of the present application.
[0043] Figure 3F A schematic diagram showing a clustering process of nodes 1 to 8 according to an embodiment of the present application.
[0044] Figure 4 A scene diagram showing recommendations of content according to an embodiment of the present application.
[0045] Figure 5 A schematic diagram showing a note according to an embodiment of the present application.
[0046] Figure 6 A hardware structure block diagram of an electronic device that implements clustering and content recommendation according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0047] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0048] Clustering methods involve the concepts of nodes and clusters, where nodes are represented by high-dimensional features, such as 128-dimensional, 256-dimensional, 512-dimensional and other commonly used feature dimensions. Different nodes are distinguished by subscripts in this article; clusters are composed of several "similar" nodes, and different clusters are distinguished by subscripts in this article.
[0049] Common clustering methods include single-link clustering and full-link clustering. In the single-link clustering process, the distance between a node and the node closest to the node in a cluster satisfies the condition. If so, the node is added to the cluster. Figure 1ANodes 1 to 7 are shown. When nodes 1 to 4 have been clustered into cluster A and nodes 5 to 7 have been clustered into cluster B, if the distance between the two nodes 3 and 7 that are closest to cluster A and cluster B meets certain conditions, single-chain clustering will merge cluster A and cluster B into one cluster. However, in such single-chain clustering, the conditions for merging clusters are too loose, and it is easy for two clusters of different types to be merged together through a noise node, resulting in clustering failure.
[0050] In the clustering process, the full-link clustering will determine whether the distance between the farthest nodes in the two clusters meets the conditions. If so, the two clusters will be merged. Figure 1B Nodes 1 to 7 are shown. When nodes 1 to 4 have been clustered into cluster A and nodes 5 to 7 have been clustered into cluster B, if the distance between nodes 2 and 6, the two farthest from cluster A and cluster B, meets certain conditions, then full-chain clustering will merge cluster A and cluster B into one cluster. However, in such full-chain clustering, the conditions for merging clusters are too harsh, which may result in nodes with large differences within the cluster being unable to be effectively clustered together.
[0051] In view of the above defects of single-chain clustering and full-chain clustering, the embodiment of the present application discloses a clustering method for electronic devices. Figure 2 A flow chart of the method is shown, which includes:
[0052] S202, initializing a first cluster and a cluster set, the cluster set including the first cluster, the first cluster including a first node among a plurality of nodes to be clustered;
[0053] For example, Figure 3A As shown, nodes 1 to 8 are nodes to be clustered. In the field of content services, these nodes can be notes and other content uploaded by users to the server. In order to cluster these nodes, any node can be obtained from nodes 1 to 8, for example, node 1 (the first node). Specifically, nodes 1 to 8 can be initialized as a node list node_list, and then the first node node_list[0] in node_list is obtained, for example, node_list[0] is node 1; then a cluster C (the first cluster) is initialized for node 1, and cluster C includes node 1; then a cluster set (or cluster container) S including cluster C is initialized.
[0054] S204, determining the number of clusters in the cluster set that are connected to an unclustered other node in the multiple nodes;
[0055] For example, any other node other than node 1 in nodes 1-8 is obtained, specifically, the second node node_list[1] in node_list may be obtained, for example, node 2. Then, the number of clusters connected to node 2 in the current cluster set S is determined.
[0056] According to some embodiments of the present application, determining the number of clusters in the cluster set that are connected to another unclustered node in the multiple nodes includes: for each cluster in the cluster set: determining a node-cluster connectivity ratio between the cluster and the node, the node-cluster connectivity ratio being equal to the ratio of the number of nodes in the cluster that have edges with the node to the number of all nodes in the cluster, wherein determining that there is an edge between two nodes whose cosine distance is less than or equal to a first predetermined threshold; and determining that the cluster is connected to the node when the node-cluster connectivity ratio is greater than or equal to a second predetermined threshold.
[0057] For example, in this application, the edge between any two nodes node1 and node2 is defined as bridge(node1,node2), which represents the cosine distance between node1 and node2. If bridge(node1,node2)≥thr1, it is considered that node1 and node2 have an edge, which is recorded as: bridge(node1,node2) * , where thr1 is a first predetermined threshold;
[0058] Define the node-cluster connectivity rate between any node node1 and cluster Cluster1 as: bridge(node1,Cluster1), which represents the ratio of the number of nodes in Cluster1 that have edges with node1 to the number of all nodes in Cluster1, that is:
[0059] node x ∈Cluster1
[0060] If bridge(node1,Cluster1)≥thr2, then node node1 and cluster Cluster1 are considered to be connected, denoted as: bridge(node1,Cluster1) * , where thr2 is the second predetermined threshold.
[0061] for Figure 3A In the case of , the number of clusters connected to the node 2 in the current cluster set S is determined. At this time, there is only cluster C in the cluster set S. If cluster C is connected to node 2, the number of clusters connected to the node 2 in the current cluster set S is recorded as 1. If cluster C is not connected to node 2, the number of clusters connected to the node 2 in the current cluster set S is recorded as 0.
[0062] S206, based on the number of clusters in the cluster set that are connected to an unclustered other node in the multiple nodes, delete the node or merge it with a cluster in the cluster set;
[0063] According to some embodiments of the present application, based on the number of clusters in the cluster set connected to an unclustered other node in the multiple nodes, deleting the node or merging the node with the cluster in the cluster set includes:
[0064] When the number is 0, a new cluster including the node is created in the cluster set.
[0065] When the number is 1, the node is merged into the cluster connected to the node.
[0066] When the number is 2:
[0067] A) If the two clusters connected to the node are connected, merge the node and the two clusters;
[0068] B) If the two clusters connected to the node are mutually exclusive, the node is deleted because in such a case, the node may be a noise node; wherein the connection or exclusion between the two clusters is determined in the following manner:
[0069] Define the connectivity rate between any cluster Cluster1 and cluster Cluster2 as: bridge(Cluster1,Cluster2), which means all nodes in cluster Cluster1 x And all nodes in cluster Cluster2 y The number of node pairs with edges between them and the number of all nodes in cluster 1 x And all nodes in cluster Cluster2 y The ratio of the number of node pairs between , that is:
[0070]
[0071] node x ∈Cluster1,node y ∈Cluster2
[0072] If bridge(Cluster1, Cluster2)≥thr3, then Cluster1 and Cluster2 are considered to be connected, denoted as bridge(Cluster1, Cluster2) *, if bridge(Cluster1,Cluster2) < thr4, it is considered that Cluster1 and Cluster2 are exclusive, denoted as: bridge(Cluster1,Cluster2) ** , where thr3 is the third predetermined threshold and thr4 is the fourth predetermined threshold.
[0073] C) If the two clusters connected to the node are neither connected nor exclusive, merge the node into one of the two clusters connected to the node. Specifically:
[0074] a) If the node-cluster connection rates of the two clusters to the node are not equal, merge the node into the cluster with the larger node-cluster connection rate among the two clusters;
[0075] b) If the node-cluster connection rates of the two clusters to the node are equal, merge the node into the cluster with the larger number of nodes among the two clusters.
[0076] D) In the case where the quantity is other values, delete the node because in such a situation, the node may be a noise node.
[0077] For example, for Figure 3A the situation, if node 2 is not connected to cluster C, create a new cluster D including node 2 in the cluster set S, as Figure 3B shown;
[0078] Next, for Figure 3B the situation, obtain the next unclustered node 3. If node 3 is connected to cluster C and not connected to cluster D, then add (i.e., merge) node 3 into cluster C, as Figure 3C shown;
[0079] Next, for Figure 3C the situation, obtain the next unclustered node 4. If node 4 is connected to both cluster C and cluster D, and cluster C and cluster D are connected, then merge node 4, cluster C, and cluster D into one cluster, for example, merge into cluster E, as Figure 3D shown;
[0080] Next, for Figure 3D the situation, continue to obtain unclustered nodes one by one in the above manner for similar processing, forming another cluster F other than cluster E, as Figure 3E shown;
[0081] Next, for Figure 3EIn the case of , get the next unclustered node 8. If node 8 is connected to cluster E and cluster F, and cluster E and cluster F are mutually exclusive, delete node 8, because in this case, node 8 may be a noise node, such as Figure 3F shown.
[0082] S208, determining whether there are other unclustered nodes among the multiple nodes, if yes, returning to S204, if no, executing S210;
[0083] S210, taking the cluster set as the clustering result. Figure 3F In the case that there are no unclustered nodes, the cluster set S is output as the clustering result.
[0084] In the present invention, the clustering method effectively avoids mixing clusters of different categories due to noise nodes through the node-cluster connectivity rate and cluster-cluster connectivity rate. At the same time, the cluster merging conditions are not too harsh, and large individual differences within the same category can be accepted to improve the clustering performance. In addition, the present invention has universal applicability and can be used not only in common clustering scenarios such as content recommendation, but also in tracking tasks or other scenarios of denoising within a sequence.
[0085] The embodiments of the present application also disclose a content recommendation method for an electronic device, the method comprising: clustering the content to be recommended using the clustering method according to the embodiments of the present application; and recommending the content based on the clustering result.
[0086] The technical solution provided in the embodiment of the present application is applicable to the recommendation scenarios of multimedia content such as text, pictures (including static pictures in jpeg and other formats and dynamic pictures in gif and other formats), and videos. The present application mainly uses the recommendation of similar notes as an example. Among them, a note can be a note on a certain platform that includes at least one of the multimedia contents such as text, pictures, and videos, and is used to record the user's experience or opinions on a certain topic. Figure 4 The scenario diagram of content recommendation according to an embodiment of the present application is shown. Specifically, the scenario includes a terminal 401 , a server 402 , and a network 403 .
[0087] Terminal 401 may be a desktop terminal or a mobile terminal, and the mobile terminal may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. Terminal 401 may be installed with an application that can browse notes, such as a browser or a client. The application involved in the embodiment of the present application may be a software client, or a client such as a web page or a small program. If the application is a client such as a web page or a small program, the background server is a background server corresponding to the software or the web page or small program, and the specific type of the client is not limited. Among them, the user can browse the notes by logging in to his or her own user on the application, and while browsing the notes, the method of the embodiment of the present application can be used to determine the multimedia content recommended to the user, and the multimedia content can be displayed on the note interface. It should be noted that even if the user does not log in, generally speaking, the server corresponding to the client will identify the user, for example, it can be identified through the terminal used by the user, so the identification can also be understood as the user of the user.
[0088] Server 402 is an electronic device that implements the clustering and content recommendation method according to the embodiment of the present application. It can be a background server corresponding to the application installed on terminal 401, for example, it can be an independent physical server or a server cluster or distributed system composed of multiple servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, but is not limited to this. Server 402 includes a database that can be used to store notes browsed by users and multi-dimensional data such as text, pictures, annotations, etc. of the notes. The steps of the content recommendation method provided in the embodiment of the present application are used to determine the content recommended to the user, and then push the content to the target user to push the content in terminal 401.
[0089] The terminal 401 and the server 402 are connected via a network 403 , which includes one or more and may include various connection types, such as wired or wireless communication links, clouds, or fiber optic cables, etc. Specific examples of the above-mentioned networks may include the Internet provided by the communication provider of the terminal 401 .
[0090] The following describes in detail some embodiments of the present application. Figure 4The server 402 receives user information from the terminal 401 and determines the note currently browsed by the user. The server 402 determines the candidate notes in the database that need to be clustered, for example, all the notes in the database, or some notes in the database selected according to conditions. These candidate notes are represented by high-dimensional features, or these candidate notes are converted into high-dimensional feature representations. Then, these candidate notes are used as nodes to be clustered, and the clustering method according to the implementation of the present application is used to cluster the nodes to be clustered. For example, Figure 5 As shown, the candidate notes include: note 501, note 502, note 503, note 504, note 505, note 506, note 507, and note 508. Note 501, note 503, note 505, and note 506 are related to potted plants, corresponding to Figures 3A-3F Node 1, Node 2, Node 3, Node 4 in the text; Notes 504, 507, and 508 are related to indoor seats, corresponding to Figures 3A-3F Nodes 5, 6, and 7 in Note 502 are related to books, corresponding to Figures 3A-3F Node 8 in. Using the clustering method according to the embodiment of the present application, nodes 1 to node 8 are clustered, that is, notes 1 to note 8 are clustered. After clustering, nodes 1 to node 4 are in the same cluster, nodes 5 to node 7 are in the same cluster, and node 8 is determined to be a noise node and deleted. That is, the corresponding notes 501, note 503, note 505 and note 506 are classified into one category, notes 504, note 507 and note 508 are classified into one category, and note 502 is not considered (it can also be considered as a separate category in practice). Server 402 receives user information from terminal 401, determines that the user is currently browsing note 505, and recommends one or more of notes 501, note 503 and note 506 of the same category as note 505 to terminal 401 for display to the user. The technical solution in the present application is a clustering method that effectively avoids mixing clusters of different categories due to noise nodes through the node-cluster connectivity rate and the cluster-cluster connectivity rate. At the same time, the cluster merging conditions are not too harsh, and larger individual differences within the same category can be accepted, thereby improving the performance of clustering and achieving good recommendation effects in content recommendation scenarios.
[0091] Figure 6 It is a hardware structure block diagram of an electronic device that implements clustering and content recommendation according to an embodiment of the present application.
[0092] like Figure 6As shown, the electronic device 600 may include one or more processors 602, a system motherboard 608 connected to at least one of the processors 602, a system memory 604 connected to the system motherboard 608, a non-volatile memory (NVM) 606 connected to the system motherboard 608, and a network interface 610 connected to the system motherboard 608.
[0093] The processor 602 may include one or more single-core or multi-core processors. The processor 602 may include any combination of a general-purpose processor and a special-purpose processor (e.g., a graphics processor, an application processor, a baseband processor, etc.). In an embodiment of the present invention, the processor 602 may be configured to execute the processing according to FIG. Figure 5 One or more of the various embodiments shown.
[0094] In some embodiments, system board 608 may include any suitable interface controller to provide any suitable interface to at least one of processors 602 and / or any suitable device or component in communication with system board 608 .
[0095] In some embodiments, the system board 608 may include one or more memory controllers to provide an interface to the system memory 604. The system memory 604 may be used to load and store data and / or instructions. In some embodiments, the system memory 604 of the electronic device 600 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).
[0096] NVM, 606 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, NVM, 606 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of a HDD (Hard, Disk, Drive), a CD (Compact Disc, Optical Disc) drive, and a DVD (Digital, Versatile, Disc, Digital Versatile Disc) drive.
[0097] The NVM 606 may include a portion of storage resources installed on a device of the electronic device 600, or it may be accessible by the device but not necessarily a portion of the device. For example, the NVM 606 may be accessed over a network via the network interface 610.
[0098] In particular, the system memory 604 and the NVM 606 may include a temporary copy and a permanent copy of the instruction 620, respectively. The instruction 620 may include: when executed by at least one of the processors 602, the electronic device 600 implements the Figure 5In some embodiments, instructions 620, hardware, firmware and / or software components thereof may additionally / alternatively be located in system board 608, network interface 610 and / or processor 602.
[0099] The network interface 610 may include a transceiver for providing a radio interface for the electronic device 600, thereby communicating with any other suitable device (e.g., a front-end module, an antenna, etc.) through one or more networks. In some embodiments, the network interface 610 may be integrated with other components of the electronic device 600. For example, the network interface 610 may be integrated with at least one of the processor 602, the system memory 604, the NVM, 606, and a firmware device (not shown) having instructions. When at least one of the processors 602 executes the instructions, the electronic device 600 implements FIG. 1- Figure 5 One or more of the various embodiments shown.
[0100] The network interface 610 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 610 may be a network adapter, a wireless network adapter, a telephone modem, and / or a wireless modem.
[0101] In one embodiment, at least one of the processors 602 may be packaged together with one or more controllers for the system motherboard 608 to form a system in package (SiP). In one embodiment, at least one of the processors 602 may be integrated on the same die with one or more controllers for the system motherboard 608 to form a system on a chip (SoC).
[0102] The electronic device 600 may further include an input / output (I / O) device 612 connected to the system motherboard 608. The I / O device 612 may include a user interface to enable a user to interact with the electronic device 600; the design of the peripheral component interface enables the peripheral components to interact with the electronic device 600. In some embodiments, the electronic device 600 further includes a sensor for determining at least one of an environmental condition and location information related to the electronic device 600.
[0103] In some embodiments, I / O device 612 may include, but is not limited to, a display (e.g., a liquid crystal display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., a still image camera and / or a video camera), a flashlight (e.g., an LED flash), and a keyboard.
[0104] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.
[0105] In some embodiments, the sensors may include, but are not limited to, gyroscope sensors, accelerometers, proximity sensors, ambient light sensors, and positioning units. The positioning unit may also be part of or interact with the network interface 610 to communicate with components of a positioning network (e.g., global positioning system (GPS) satellites).
[0106] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 600. In other embodiments of the present application, the electronic device 600 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0107] Program code can be applied to input instructions to perform the functions described in the present invention and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a system for processing instructions including processor 602 includes any system having a processor such as a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0108] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in the present invention is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.
[0109] One or more aspects of at least one embodiment may be implemented by instructions stored on a computer-readable storage medium, which, when read and executed by a processor, enables an electronic device to implement the method of the embodiment described in the present invention.
[0110] According to some embodiments of the present application, a computer storage medium is disclosed, on which instructions are stored. When the instructions are executed on a computer, the computer executes the clustering method or content recommendation method according to the embodiments of the present application.
[0111] The first embodiment is a method implementation method corresponding to the present embodiment, and the present embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in the present embodiment, and are not repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in the present embodiment can also be applied in the first embodiment.
[0112] According to some embodiments of the present application, a computer program product is disclosed, including computer executable instructions, where the instructions are executed by a processor to implement the clustering method or content recommendation method according to the embodiments of the present application.
[0113] The first embodiment is a method implementation method corresponding to the present embodiment, and the present embodiment can be implemented in conjunction with the first embodiment. The relevant technical details mentioned in the first embodiment are still valid in the present embodiment, and are not repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in the present embodiment can also be applied in the first embodiment.
[0114] It is to be understood that the specific embodiments described herein are only for explaining the present application, rather than limiting the present application. In addition, for ease of description, only some but not all structures or processes related to the present application are shown in the accompanying drawings. It should be noted that in this specification, similar reference numerals and letters represent similar items in the accompanying drawings.
[0115] It should be understood that although the terms "first", "second", etc. may be used herein to describe various features, these features should not be limited by these terms. These terms are used only to distinguish and should not be understood as indicating or implying relative importance. For example, a first feature may be referred to as a second feature, and similarly a second feature may be referred to as a first feature without departing from the scope of the exemplary embodiments.
[0116] In the description of this application, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this embodiment can be understood according to specific circumstances.
[0117] Illustrative embodiments of the present application include, but are not limited to, methods, apparatus, media, and computer program products for clustering and content recommendation.
[0118] The various aspects of the illustrative embodiments will be described using terms commonly used by those skilled in the art to convey the essence of their work to other persons skilled in the art. However, it is apparent to those skilled in the art that some alternative embodiments may be implemented using the features described in part. For purposes of explanation, specific numbers and configurations are set forth to provide a more thorough understanding of the illustrative embodiments. However, it is apparent to those skilled in the art that alternative embodiments may be implemented without the specific details. In some other cases, some well-known features are omitted or simplified herein to avoid obscuring the illustrative embodiments of the present application.
[0119] In addition, various operations will be described as multiple separate operations in a manner that is most helpful for understanding the illustrative embodiments; however, the order of description should not be interpreted as implying that these operations must rely on the order of description, and many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can also be rearranged. When the described operations are completed, the process can be terminated, but can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0120] References in the specification to "one embodiment," "an embodiment," "an illustrative embodiment," etc., indicate that the described embodiment may include a particular feature, structure, or property, but each embodiment may or may not necessarily include the particular feature, structure, or property. Moreover, these phrases are not necessarily referring to the same embodiment. In addition, when particular features are described in conjunction with a specific embodiment, the knowledge of those skilled in the art can affect the combination of these features with other embodiments, whether or not these embodiments are explicitly described.
[0121] Unless the context dictates otherwise, the terms "comprising," "having," and "including" are synonymous. The phrase "A and / or B" means "(A), (B), or (A and B)."
[0122] As used herein, the term "module" may refer to, be part of, or include: memory (shared, dedicated, or group) for running one or more software or firmware programs, application-specific integrated circuits (ASICs), electronic circuits and / or processors (shared, dedicated, or group), combinational logic circuits, and / or other suitable components that provide the described functionality.
[0123] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order is not necessary. Instead, in some embodiments, these features may be described in a manner and / or order different from that shown in the illustrative drawings. In addition, the structural or method features included in a specific figure do not mean that all embodiments need to include such features. In some embodiments, these features may not be included or may be combined with other features.
[0124] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented in the form of instructions or programs carried or stored on one or more transient or non-transient machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors, etc. When the instructions or programs are run by the machine, the machine may perform the aforementioned various methods. For example, the instructions may be distributed via a network or other computer-readable medium. Therefore, the machine-readable medium may include, but is not limited to, any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, such as a floppy disk, an optical disk, a compact disk read-only memory (CD-ROMs), a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an erasable programmable read-only memory (EPROM), an electronically erasable programmable read-only memory (EEPROM), a magnetic card or an optical card, or a flash memory or a tangible machine-readable memory for transmitting network information via electrical, optical, acoustic, or other forms of signals (e.g., carrier waves, infrared signals, digital signals, etc.). Accordingly, machine-readable media includes any form of machine-readable media suitable for storing or transmitting electronic instructions or information readable by a machine (eg, a computer).
[0125] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the use of the technical solution of the present application is not limited to the various applications mentioned in the embodiments of the present application. Various structures and modifications can be easily implemented with reference to the technical solution of the present application to achieve the various beneficial effects mentioned herein. Various changes made within the knowledge of ordinary technicians in the field without departing from the purpose of the present application should all fall within the scope of the patent coverage of the present application.
Claims
1. A clustering method for electronic equipment, characterized in that: The method comprises: Initializing a first cluster and a cluster set, the cluster set including the first cluster, and the first cluster including a first node among a plurality of nodes to be clustered; For each other node in the plurality of nodes: Determining the number of clusters in the cluster set that are connected to the node; Based on the number, deleting the node or merging the node with a cluster in the cluster set; The cluster set is taken as the clustering result.
2. The method according to claim 1, characterized in that The deleting the node based on the quantity, or merging the node with a cluster in the cluster set, comprises: When the number is 0, a new cluster including the node is created in the cluster set; When the number is 1, merging the node into a cluster connected to the node; When the number is 2, if the two clusters connected to the node are connected, the node and the two clusters are merged; if the two clusters connected to the node are exclusive, the node is deleted; otherwise, the node is merged into one of the two clusters connected to the node; When the number is any other value, the node is deleted.
3. The method according to claim 2, characterized in that The determining the number of clusters in the cluster set connected to the node includes: For each cluster in the set of clusters: Determining a node-cluster connectivity ratio between the cluster and the node, wherein the node-cluster connectivity ratio is equal to a ratio of the number of nodes in the cluster that have edges with the node to the number of all nodes in the cluster, wherein it is determined that there is an edge between two nodes whose cosine distance is less than or equal to a first predetermined threshold; When the node-cluster connectivity ratio is greater than or equal to a second predetermined threshold, it is determined that the cluster is connected to the node.
4. The method according to claim 3, characterized in that If the two clusters connected to the node are connected, merging the node and the two clusters comprises: Determining a cluster-cluster connectivity ratio between the two clusters, wherein the cluster-cluster connectivity ratio is equal to a ratio of the number of node pairs with edges between the two clusters to the number of all node pairs between the two clusters; When the cluster-cluster connectivity ratio is greater than or equal to a third predetermined threshold, it is determined that the two clusters are connected.
5. The method according to claim 4, characterized in that If there is a discrepancy between the two clusters connected to the node, deleting the node comprises: When the cluster-cluster connectivity ratio is less than a fourth predetermined threshold, it is determined that the two clusters are excluded.
6. The method according to claim 3, characterized in that Otherwise merging the node into one of two clusters connected to the node comprises: If the node-cluster connectivity rates of the two clusters and the node are not equal, merging the node into a cluster of the two clusters having a larger node-cluster connectivity rate with the node; If the node-cluster connectivity rates of the two clusters and the node are equal, the node is merged into the cluster with a larger number of nodes among the two clusters.
7. A content recommendation method for an electronic device, characterized in that: The method comprises: Clustering the content to be recommended using the clustering method according to any one of claims 1 to 6; Based on the clustering result, the content is recommended.
8. An electronic device, characterized in that: The electronic device comprises a memory storing computer executable instructions and a processor. When the instructions are executed by the processor, the electronic device implements the method according to any one of claims 1 to 7.
9. A computer storage medium, characterized in that Instructions are stored on the computer storage medium. When the instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The method comprises computer executable instructions which are executed by a processor to implement the method according to any one of claims 1 to 7.
