Information recommendation method based on knowledge graph and bayesian personalized ranking (BPR) algorithm

CN118227883BActive Publication Date: 2026-11-03CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410437517.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-11
Publication Date
2026-11-03
Estimated Expiration
2044-04-11

AI Technical Summary

Technical Problem

Existing recommendation algorithms suffer from the cold start problem when facing new users, resulting in inaccurate recommendation information. Neural network-based methods require a large amount of data and computing resources, and the model has poor interpretability.

Method used

By introducing the Bayesian Personalized Ranking (BPR) algorithm, and using knowledge graphs and the Bayesian Personalized Ranking (BPR) algorithm, combined with the Translation Embedded Model (TransH-HC) and Multilayer Perceptron (MLP), information recommendation is performed.

Benefits of technology

It improves the accuracy and personalization of recommendation algorithms when facing new users, and solves the cold start problem.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118227883B_ABST
    Figure CN118227883B_ABST
Patent Text Reader

Abstract

The application discloses an information recommendation method based on a knowledge graph and a Bayesian personalized ranking (BPR) algorithm. The method comprises the following steps: obtaining target data generated by a target object when the target object operates on a platform, and building an initial knowledge graph by using the target data; performing semantic feature extraction on the initial knowledge graph by using a translation embedding (TransH-HC) model to obtain a plurality of semantic feature vectors; scoring to-be-recommended information contained in the target data based on the semantic feature vectors by using a target model to obtain a score value of each to-be-recommended information, wherein the target model is a neural collaborative filtering model into which the Bayesian personalized ranking (BPR) algorithm is fused; and sorting the to-be-recommended information in a descending order of the score values to output a recommendation list. The application solves the technical problem of inaccurate predicted recommendation information caused by the cold start problem of the recommendation algorithm of the related technology when facing new users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of recommendation algorithm technology, and more specifically, to an information recommendation method based on knowledge graphs and Bayesian personalized ranking (BPR) algorithm. Background Technology

[0002] With the continuous advancement of computer and internet technologies, and the rapid development of the economy and service industries, a massive amount of information has emerged on the internet, giving rise to recommendation algorithms. Among related technologies, collaborative filtering-based and neural network-based recommendation algorithms are commonly used. Collaborative filtering-based algorithms recommend relevant information by analyzing users' historical behavior; however, this method is sensitive to new users or items, suffering from the cold-start problem (due to insufficient data or inappropriate parameter initialization, the model cannot effectively learn and predict) and the tendency for recommendation results to be homogenized. Neural network-based recommendation algorithms, which learn user interests and item features to recommend information, require a large amount of data and computational resources to train the model, and the model has poor interpretability, resulting in low accuracy of predicted recommendations.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This application provides an information recommendation method based on knowledge graphs and Bayesian personalized ranking (BPR) algorithm, which at least solves the technical problem of inaccurate predicted recommendation information caused by the cold start problem of related recommendation algorithms when facing new users.

[0005] According to one aspect of the embodiments of this application, an information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm is provided, comprising: acquiring target data generated when a target object operates on a platform, and constructing an initial knowledge graph using the target data, wherein the target data includes at least: the target object's identification information and the target object's browsing information; extracting semantic features from the initial knowledge graph using a translation embedding TransH-HC model to obtain multiple semantic feature vectors; using a target model to score the information to be recommended contained in the target data based on the semantic feature vectors to obtain a score value for each piece of information to be recommended, wherein the target model is a neural collaborative filtering model incorporating the Bayesian personalized ranking (BPR) algorithm; and sorting the information to be recommended according to the score values ​​from high to low to output a recommendation list.

[0006] Optionally, an initial knowledge graph is constructed using the target data, including: for each target data, converting the target data into the form of triples, wherein the data in the target data that serves as the subject is the head entity in the triple, the data in the target data that serves as the object is the tail entity in the triple, and the data in the target data that indicates the relationship between the subject and the object is the relation in the triple; and constructing an initial knowledge graph using multiple triples corresponding to multiple target data, wherein the head entity and the tail entity serve as nodes in the initial knowledge graph, and the relations in the triples serve as edges in the initial knowledge graph.

[0007] Optionally, semantic features are extracted from the initial knowledge graph using the TransH-HC model to obtain multiple semantic feature vectors. This includes: converting each node in the initial knowledge graph into a corresponding first-class vector and each edge in the initial knowledge graph into a corresponding second-class vector; determining the similarity score between any two first-class vectors using any second-class vector and a hyperplane; clustering first-class vectors with similarity scores greater than a preset value into a cluster to obtain multiple clusters; determining the distance between each pair of clusters and merging the two clusters with the minimum distance into a target cluster, until the number of fusions reaches a preset number to obtain multiple target clusters; and generating multiple semantic feature vectors based on the multiple target clusters using the TransH-HC model.

[0008] Optionally, the TransH-HC model generates multiple semantic feature vectors based on multiple target clusters, including: determining the first target cluster to which the target head entity belongs and the second target cluster to which the target tail entity belongs, wherein the target head entity and the target tail entity are the head entity and tail entity in any positive triplet, and the positive triplet is a triplet generated by transforming the target data; for each positive triplet, the target head entity is replaced with any entity in the first target cluster, and the target tail entity is replaced with any entity in the second target cluster, resulting in a negative triplet; the TransH-HC model is trained using multiple positive triplets and multiple negative triplets until the number of iterations reaches a preset number, resulting in the trained TransH-HC model; the initial knowledge graph is used as the input information of the trained TransH-HC model to obtain multiple semantic feature vectors output by the trained TransH-HC model.

[0009] Optionally, the target model includes a multilayer perceptron (MLP) and a Bayesian personalized ranking (BPR) layer; the target model is used to score the information to be recommended contained in the target data based on semantic feature vectors, including: inputting multiple semantic feature vectors into the improved target model to obtain a first result output by the MLP for the semantic feature vectors, and obtaining a second result output by the BPR layer for the semantic feature vectors; concatenating the first result and the second result into a new vector, and using the new vector to score the information to be recommended, to obtain a score value for each piece of information to be recommended.

[0010] Optionally, the target model is trained using the following method: obtaining the identification information of the target object in the target data and obtaining the negative example triples generated based on the target data; combining the identification information of a target object, a negative example triple, and a semantic feature vector into a sample group to obtain multiple sample groups; using multiple sample groups as training data to train the target model until the loss function value of the BPR layer reaches a preset value, and outputting the target parameters obtained from the last training; and replacing the model parameters of the improved neural collaborative filtering model with the target parameters.

[0011] Optionally, the loss function value of the BPR layer is calculated by: determining the first dot product of the target object's identification information score and the semantic feature vector score, and determining the second dot product of the target object's identification information score and the negative example triplet score; determining the difference between the first dot product and the second dot product, and converting the difference into a probability value; and determining the loss function value of the BPR layer based on the probability value.

[0012] According to another aspect of the embodiments of this application, an information recommendation device based on knowledge graph and Bayesian personalized ranking (BPR) algorithm is also provided, comprising: an acquisition module, used to acquire target data generated when a target object operates on a platform, and to construct an initial knowledge graph using the target data, wherein the target data includes at least: the identification information of the target object and the browsing information of the target object; a feature extraction module, used to extract semantic features from the initial knowledge graph through a translation embedding TransH-HC model to obtain multiple semantic feature vectors; a scoring module, used to score the information to be recommended contained in the target data based on the semantic feature vectors using a target model to obtain a score value for each piece of information to be recommended, wherein the target model is a neural collaborative filtering model incorporating the Bayesian personalized ranking (BPR) algorithm; and an output module, used to sort the information to be recommended according to the score value from high to low and output a recommendation list.

[0013] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, in which a computer program is stored, wherein the above-mentioned information recommendation method based on knowledge graph and Bayesian personalized ranking BPR algorithm is executed by running the computer program on the device where the non-volatile storage medium is located.

[0014] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor. The memory stores a computer program, and the processor is configured to execute the above-described information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm through the computer program.

[0015] According to another aspect of the embodiments of this application, a computer program product is also provided, including computer instructions, which, when executed by a processor, implement the steps of the above-described information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm.

[0016] In this embodiment, target data generated when a target object operates on the platform is acquired, and an initial knowledge graph is constructed using this target data. The target data includes at least: the target object's identification information and browsing information. Semantic features are extracted from the initial knowledge graph using a TransH-HC model to obtain multiple semantic feature vectors. The target model is then used to score the recommended information contained in the target data based on these semantic feature vectors, obtaining a score value for each piece of information to be recommended. The target model is a neural collaborative filtering model incorporating the Bayesian personalized ranking algorithm (BPR). The recommended information is sorted according to its score from highest to lowest, and a recommendation list is output. By simultaneously introducing the Bayesian personalized ranking algorithm (BPR) and the knowledge graph into the recommendation algorithm, the knowledge graph provides rich entity semantic association auxiliary information, increasing the data information dimension. The Bayesian ranking algorithm (BPR) is used to sort the user-facing recommended information based on its score. This achieves the goal of avoiding the cold start problem of recommendation algorithms when facing new users, thereby improving the accuracy and personalization level of recommendation algorithms. It also solves the technical problem of inaccurate predicted recommendation information caused by the cold start problem of related recommendation algorithms when facing new users. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1This is a hardware structure block diagram of a computer terminal for implementing an information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm, according to an embodiment of this application.

[0019] Figure 2 This is a flowchart illustrating the steps of an information recommendation method based on knowledge graphs and Bayesian personalized ranking (BPR) algorithm according to an embodiment of this application.

[0020] Figure 3 This is a structural diagram of an information recommendation device based on a knowledge graph and Bayesian personalized ranking (BPR) algorithm according to an embodiment of this application.

[0021] Figure 4 This is a flowchart of a target model (NCF-BPR) according to an embodiment of this application;

[0022] Figure 5 This is a schematic diagram of the hit rate variation curves of different translation distance models under different embedding dimensions according to embodiments of this application;

[0023] Figure 6 This is a schematic diagram of the average ranking change curves of different translation distance models under different embedding dimensions according to embodiments of this application;

[0024] Figure 7 This is a schematic diagram of the hit rate variation curves of a translation embedding TransH-HC model under different embedding dimensions according to an embodiment of this application;

[0025] Figure 8 This is a schematic diagram of the average ranking variation curve of a translation embedding TransH-HC model under different embedding dimensions according to an embodiment of this application;

[0026] Figure 9 This is a schematic diagram of the hit rate variation curve of a translation embedding TransH-HC model according to an embodiment of this application under different margin values;

[0027] Figure 10 This is a schematic diagram of the average ranking variation curve of a translation embedding TransH-HC model according to an embodiment of this application under different margin values;

[0028] Figure 11 This is a model evaluation result table according to an embodiment of this application;

[0029] Figure 12 This is a schematic diagram of the hit rate versus the number of hidden units curve of a multilayer perceptron (MLP) according to an embodiment of this application;

[0030] Figure 13This is a schematic diagram illustrating the hit rate of a target model using different fusion methods according to an embodiment of this application. Detailed Implementation

[0031] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0033] To better understand the embodiments of this application, the technical terms involved in the embodiments of this application are explained below:

[0034] Triples: Triples are a commonly used data structure in information representation and knowledge graphs. They consist of three parts: "head entity", "relation" and "tail entity". They are usually represented in the format of subject (head entity) - predicate (relation) - object (tail entity) to represent related information.

[0035] Hierarchical clustering: an unsupervised learning method that includes two types: agglomerative hierarchical clustering and splitting hierarchical clustering; it is mainly used for classification and cluster analysis of datasets. Unlike other clustering algorithms, hierarchical clustering can display the hierarchical structure of similarity between objects in a dataset, while providing users with more information about the dataset structure.

[0036] Bayesian Personalized Ranking (BPR) is based on probabilistic ranking theory and aims to generate an optimal ranking list for each user. The core idea of ​​BPR is to establish a preference relationship between users and items and use this relationship to infer the user's relative ranking of items. The BPR algorithm can be combined with various models to optimize personalized recommendation rankings for users.

[0037] Translational Hierarchical Hyperbolic Cosine (TransH-HC): A model for knowledge graph representation learning that uses hierarchical clustering to model "relationships," thereby better capturing the relationships between entities.

[0038] Semantic relationships refer to the semantic or logical connections between words, phrases, or sentences; including synonymy, antonymy, belonging, comparison, and causality.

[0039] Hyperplane: A mathematical term used to describe an (n-1)-dimensional subspace within an n-dimensional space. In two-dimensional space, a hyperplane is a straight line; in three-dimensional space, it is a plane; and in higher-dimensional spaces, it is an (n-1)-dimensional subspace. A hyperplane divides an n-dimensional space into two half-spaces and is commonly used for data classification and segmentation.

[0040] In related technologies, recommendation algorithms based on collaborative filtering suffer from a cold start problem when making recommendations to new users, leading to inaccurate recommendation results. Neural network-based recommendation algorithms require large amounts of data and computational resources to train the model, and the model's interpretability is poor, also resulting in inaccurate recommendation results when recommending information to new users. To address these issues, this application provides relevant solutions, which are detailed below.

[0041] According to an embodiment of this application, a method embodiment of an information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0042] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware block diagram of a computer terminal for implementing an information recommendation method based on knowledge graphs and the Bayesian Personalized Ranking (BPR) algorithm is shown. Figure 1As shown, the computer terminal 10 may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0043] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as processor control (e.g., selection of a variable resistor termination path connected to an interface).

[0044] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0045] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0046] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.

[0047] This application provides an information recommendation method based on knowledge graphs and Bayesian personalized ranking (BPR) algorithms that can run in the above-described operating environment. Figure 2 This is a flowchart illustrating the steps of an information recommendation method based on knowledge graphs and the Bayesian personalized ranking (BPR) algorithm, such as... Figure 2 As shown, the method includes the following steps:

[0048] Step S202: Obtain target data generated when the target object operates on the platform, and use the target data to build an initial knowledge graph. The target data includes at least: the target object's identification information and the target object's browsing information.

[0049] The recommendation algorithm provided in this application embodiment incorporates both knowledge graphs and BPR algorithms. The (initial) knowledge graph for each user (target object) is constructed based on (target) data generated when the user operates on the platform provided in this application embodiment. This target data includes: unique identifiers for each user (target object), and browsing information (e.g., news, items, preference tags, etc., browsed by the user on this platform and / or other platforms associated with it). It should be noted that the acquired target data is information and data authorized by the user (i.e., the target object) or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data comply with relevant national and regional laws, regulations, and standards, and necessary confidentiality measures are taken, without violating public order and good morals. Additionally, a corresponding operation entry point is provided to the user before acquiring the target data, allowing the user to choose to authorize or refuse.

[0050] Optionally, an initial knowledge graph is constructed using the target data, including: for each target data, converting the target data into the form of triples, wherein the data in the target data that serves as the subject is the head entity in the triple, the data in the target data that serves as the object is the tail entity in the triple, and the data in the target data that indicates the relationship between the subject and the object is the relation in the triple; and constructing an initial knowledge graph using multiple triples corresponding to multiple target data, wherein the head entity and the tail entity serve as nodes in the initial knowledge graph, and the relations in the triples serve as edges in the initial knowledge graph.

[0051] The target data obtained in step S202 is unprocessed data input by the user. Target data typically consists of three parts: subject, predicate, and object. In this embodiment, before building a knowledge graph using the target data, it needs to be preprocessed. Specifically, the target data is converted into a triple (h, r, t). For each piece of target data, the data representing the subject is converted into a head entity h, the data representing the object is converted into a tail entity t, and the data representing the predicate is converted into a relation r. The head entity h, the tail entity t, and the relation r together form the triple corresponding to that piece of target data. Multiple triples are used to construct the (initial) knowledge graph. When constructing the (initial) knowledge graph, the entities in the triples (including the head entity h and the tail entity t) are used as nodes in the (initial) knowledge graph, and the relations r in the triples are used as edges in the (initial) knowledge graph to connect entities with related relationships (head entity h and tail entity t). For example, the target data includes: Data 1: City A is the capital of City B. Before constructing the knowledge graph, Data 1 is first converted into the corresponding triples ( , , ), where the data corresponding to "city a" is converted into a header entity. The data corresponding to "the capital of city b" is converted into a tail entity. The data corresponding to "is" is converted into a relation. When constructing a knowledge graph, with , As a node As edges, in a well-constructed knowledge graph The corresponding side general Corresponding nodes and The corresponding nodes are connected together.

[0052] Step S204: Extract semantic features from the initial knowledge graph by using the TransH-HC model to obtain multiple semantic feature vectors.

[0053] After constructing the (initial) knowledge graph based on the target data, in step S204, the TransH-HC model is used to extract semantic features from the (initial) knowledge graph to obtain semantic feature vectors. The semantic feature vectors are vector representations in low-dimensional space of the semantic relationships between each pair of entities (i.e., nodes) and relations (i.e. edges) in the (initial) knowledge graph.

[0054] Optionally, semantic features are extracted from the initial knowledge graph using the TransH-HC model to obtain multiple semantic feature vectors. This includes: converting each node in the initial knowledge graph into a corresponding first-class vector and each edge in the initial knowledge graph into a corresponding second-class vector; determining the similarity score between any two first-class vectors using any second-class vector and a hyperplane; clustering first-class vectors with similarity scores greater than a preset value into a cluster to obtain multiple clusters; determining the distance between each pair of clusters and merging the two clusters with the minimum distance into a target cluster, until the number of fusions reaches a preset number to obtain multiple target clusters; and generating multiple semantic feature vectors based on the multiple target clusters using the TransH-HC model.

[0055] Semantic feature extraction using the TransH-HC model is essentially a negative sample sampling method based on hierarchical clustering, including two types of operations: translation and hierarchical clustering. In this embodiment, the TransH-HC model extracts semantic features from the (initial) knowledge graph using the following steps: Step 1, obtain the embedding vector representations of the entity set and relation set for further operations in the embedding space; Step 2: classify the entities using a hierarchical clustering method. Specifically, in Step 1, the head and tail entities (i.e., nodes in the initial knowledge graph) are first translated into their corresponding vector forms, where the head entity vector (i.e., the first-class vector) is denoted as h, and the tail entity vector (i.e., the first-class vector) is denoted as t; the relations (i.e., edges in the initial knowledge graph) are translated into their corresponding relation vectors r (i.e., the second-class vectors); next, according to formula a: For any two entity vectors (h and t), a similarity score is calculated, where, This represents the hyperplane offset corresponding to the relation vector r. Let r be the normal vector of the hyperplane corresponding to the relation vector r. For vectors The transpose of . Formula a above is based on the general model scoring function. The formula for the projection of the head entity h onto the normal vector of the hyperplane is as follows: The formula for the projection of the tail entity t onto the normal vector of the hyperplane. The results were derived jointly, among which, Let h be the projection of the head entity h onto the hyperplane normal vector. Let be the projection of the tail entity t onto the hyperplane normal vector. The scoring results for each pair of head entity h and tail entity t. The similarity r is used to measure the relationship r between the head entity h and the tail entity t. In step 2, the similarity score from step 1 is used... Clustering of entity vectors (i.e., first-class vectors), specifically, similarity scoring. Head entities h and tail entities t with values ​​greater than a preset threshold are clustered into one cluster, resulting in multiple clusters formed by entity vectors h and r. The distance between each cluster is calculated, and the two clusters with the smallest distance are merged into a single (target) cluster. Simultaneously, after each cluster fusion, the distance matrix is ​​updated, with each element representing the distance between any two clusters. This fusion process and distance matrix update are repeated until a preset number of fusions is reached, at which point fusion stops. The TransH-HC model extracts semantic feature vectors based on the multiple target clusters generated after the last fusion.

[0056] According to some optional embodiments of this application, the TransH-HC model generates multiple semantic feature vectors based on multiple target clusters, including: determining a first target cluster to which the target head entity belongs and a second target cluster to which the target tail entity belongs, wherein the target head entity and the target tail entity are the head entity and tail entity in any positive triplet, and the positive triplet is a triplet generated by transforming the target data; for each positive triplet, replacing the target head entity with any entity in the first target cluster and replacing the target tail entity with any entity in the second target cluster to obtain a negative triplet; training the TransH-HC model using multiple positive triplets and multiple negative triplets until the number of iterations reaches a preset number to obtain the trained TransH-HC model; using the initial knowledge graph as the input information of the trained TransH-HC model to obtain multiple semantic feature vectors output by the trained TransH-HC model.

[0057] In this embodiment, the TransH-HC model processes the target clusters generated in the above embodiments using negative sample sampling, and finally extracts semantic feature vectors; for any knowledge graph (G), G = ( (Head entity set), R (relation set), The process of negative sample sampling for (tail entity set) can be represented by the following formula:

[0058] ,r,t ≠h; ,r,t ; ≠t;

[0059] in, Representing negative triplet, The substitute entity representing the head entity, Represents the head entity set, Represents the set of tail entities; This represents the set of positive triples. When sampling negative examples, the TransH-HC model first identifies a positive triple, which is a triple containing a known relationship between a pair of entities. Therefore, all triples converted from the target data used to generate the initial knowledge graph are positive triples. Next, the head and tail entities in the positive triples are replaced. The replacement operation is as follows: The cluster (first target) to which the head entity h in a positive triple belongs is determined. And the (second target) cluster to which the tail entity t in the same positive triple belongs. Select an entity vector that is different from the head entity h in the (first target) cluster to which the head entity h belongs. And select an entity vector different from tail entity t in the (second target) cluster to which tail entity t belongs. ;transfer entity vector Entity vector This forms a negative triple with the relation vector r, where the relation vector r is the semantic vector of the "relation" between the head entity h and the tail entity t, and the entity vector... Entity vector The relationship between entity vectors is unknown. and entity vector The "relationship" between them; the corresponding vector is not necessarily the relation vector r, therefore, the entity vector Entity vector A triple consisting of entity vector r and relation vector r is a triple containing an unknown relation between an entity pair. Therefore, the triple formed by entity vector r... Entity vector The triple formed by the relation vector r is a negative triple. Next, the TransH-HC model is trained using the positive triple and multiple negative triples generated by the above method until the preset number of iterations is reached. Then, training is stopped, and the semantic feature vector is extracted from the initial knowledge graph using the trained TransH-HC model.

[0060] It should be noted that before using the TransH-HC model to extract semantic feature vectors, the TransH-HC model needs to be trained. The completion of training can be determined by the number of training iterations or by the loss function value of the TransH-HC model. The loss function value of the TransH-HC model is expressed by the formula loss = The calculation yielded that, Therefore, the loss function value can also be calculated using the following formula:

[0061] loss=

[0062] in, To replace the head entity vector With alternative tail entity vector Relationship The similarity.

[0063] Step S206: The target model is used to score the information to be recommended contained in the target data based on the semantic feature vector, and the score value of each piece of information to be recommended is obtained. The target model is a neural collaborative filtering model that incorporates the Bayesian personalized ranking BPR algorithm.

[0064] In step S206, a neural collaborative filtering model (i.e., the target model) incorporating the Bayesian personalized ranking (BPR) algorithm is invoked to score the information to be recommended to the user (i.e., the target object). The information to be recommended is selected from the user's (i.e., the target object's) browsing information. For example, if the browsing information records the user's product browsing history, then the information to be recommended is the various products to be recommended to the user; if the browsing information records the user's news browsing history, then the information to be recommended is the various news articles to be recommended to the user. The BPR algorithm for scoring the recommendation information uses a probabilistic ranking algorithm to score each piece of information to be recommended.

[0065] According to an optional embodiment of this application, the target model includes a multilayer perceptron (MLP) and a Bayesian personalized ranking (BPR) layer; the target model is used to score the information to be recommended contained in the target data based on semantic feature vectors, including: inputting multiple semantic feature vectors into the improved target model to obtain a first result output by the MLP for the semantic feature vectors, and obtaining a second result output by the BPR layer for the semantic feature vectors; concatenating the first result and the second result into a new vector, and using the new vector to score the information to be recommended, to obtain a score value for each piece of information to be recommended.

[0066] The method provided in this application integrates the Bayesian Personalized Ranking (BPR) algorithm into the Neural Collaborative Filtering (NCF) model to obtain the target model (NCF-BPR). In the target model (NCF-BPR), the Multilayer Perceptron (MLP) part of the NCF model is retained. The MLP processes semantic feature vectors to capture the nonlinear feature interaction between users and items (i.e., the information to be recommended), and outputs high-order feature information (i.e., the first result) to represent the features of the information to be recommended (such as goods, items, and news) that the user prefers more. At the same time, the original Generalized Matrix Factorization (GMF) layer in the NCF is replaced with the BPR layer; the BPR layer uses a probabilistic ranking algorithm to output the user's preference for different information to be recommended (i.e., the second result). The target model (NCF-BPR) concatenates the high-order feature information output from the MLP layer (i.e., the first result) and the user's preference for different recommended information output from the BPR layer (i.e., the second result) into a new vector at the fusion layer, so as to simultaneously consider the linear and non-linear feature interactions between users and items (i.e., recommended information). Finally, the output layer of the target model above the fusion layer uses the new vector generated by the fusion layer to score the recommended information, and obtains the final score value of each recommended information.

[0067] Optionally, the target model is trained using the following method: obtaining the identification information of the target object in the target data and obtaining the negative example triples generated based on the target data; combining the identification information of a target object, a negative example triple, and a semantic feature vector into a sample group to obtain multiple sample groups; using multiple sample groups as training data to train the target model until the loss function value of the BPR layer reaches a preset value, and outputting the target parameters obtained from the last training; and replacing the model parameters of the improved neural collaborative filtering model with the target parameters.

[0068] In this embodiment, when training the target model (NCF-BPR) incorporating the BPR algorithm, the parameter update steps of the general NCF model are improved. The specific process is as follows: The user (i.e., target object) identification information from the target data, the negative example triples generated based on the target data, and the extracted semantic feature vector are used as input data. The user identification information is used as (Uid), the negative example triples represent the identification information of the negative sample products (Nid), and the semantic feature vector is used as the identifier of the information to be recommended (Pid). One piece of information representing Uid, one piece of information representing Pid, ​​and one piece of information representing Nid are combined into a sample group to obtain multiple sample groups. The target model (NCF-BPR) is trained using these multiple sample groups. During training, the above sample groups and model parameters are used as input information. The model parameters include the learning rate (…). ), regularization coefficients (λ), and latent space dimension (k); first, initialize all embedding layer weights, including BPR embedding layer weights and MLP embedding layer weights; then, set the input weight matrix of the embedding layer ( ) and the output weight matrix of the embedding layer ( The model is initialized with random values ​​following a normal distribution N(0, 0.01) with a mean of 0 and a standard deviation of 0.01. Using a normal distribution for initialization provides a good starting point for the model, making it easier for the model to converge to a suitable solution during training. Next, the BPR layer and the target model (NCF-BPR) are trained simultaneously. During training, the loss function value (BPRLoss) of the BPR layer is continuously monitored until BPRLoss reaches a preset value, indicating successful training of the BPR layer of the target model (NCF-BPR). The target model concatenates the ranking information from the BPR layer output with the high-order feature information from the MLP layer output into a new vector; the new vector = concatenate( Layer output, The new vector is output to the output layer of the target model (NCF-BPR). The new vector passes through a weighted output layer and an activation function (sigmoid / ). The role of the rating scale is transformed into predicted values ​​in the range (0, 1); predicted values New vector ,in, Let b be the weight of the new vector i, b be the bias term, and d be the dimension of the new vector i. The model parameters are iteratively updated by minimizing the cross-entropy loss between the predicted value and the target value. The target value is the true output score corresponding to the input data. In this embodiment, the target value is also converted to a value within the range of (0, 1) according to a preset scoring table; for example, attribute values ​​with scores greater than or equal to 4 are set to 1, and other attribute values ​​are set to 0. During iterative updating of the model parameters, a regularization coefficient (λ) is introduced to regularize the model parameters to prevent overfitting. Throughout the training process, the completion of training is determined by whether the loss function of the target model (NCF-BPR) converges; if the loss function converges, the model training is complete, and the BPR embedding layer weight matrix is ​​output. ) and BPR embedding layer weight matrix ( Otherwise, continue iteratively updating the model parameters. The loss function (Loss) of the target model (NCF-BPR) = Where N is the number of sample groups, It is the actual output value (i.e., the target value) corresponding to the input information. For predicted values, The coefficient of the regularization term, Weight matrix The elements in Weight matrix The elements in the array. During training, weights and biases are adjusted using gradient descent or other optimization algorithms to minimize the loss function (Loss). Convergence checks of the loss function (Loss) are typically performed by monitoring changes in its value. After each iteration, the current value of the loss function is recorded, denoted as... If the change in the loss function is less than a predetermined threshold If the change in loss function is reached, then the loss function is considered to have converged, and training can be stopped. The specific expression is as follows: Change in loss function = | - |; If the change in the loss function is < If the loss function converges, then the loss function is considered to have converged. This is the loss function value from the previous iteration. Regularly checking changes in the loss function effectively monitors the model's progress during training. If the change in the loss function is small enough, it indicates that the model may have converged, and training can be terminated early to avoid unnecessary computation.

[0069] According to some optional embodiments of this application, the loss function value of the BPR layer is calculated by the following method: determining the first dot product of the score value of the target object's identification information and the score value of the semantic feature vector, and determining the second dot product of the score value of the target object's identification information and the score value of the negative example triple; determining the difference between the first dot product and the second dot product, and converting the difference into a probability value; and determining the loss function value of the BPR layer based on the probability value.

[0070] The loss function of the BPR layer ( The predicted score is calculated by obtaining the BPR layer's output of the target object's identifier information (Uid). The predicted score output by the BPR layer on the semantic feature vector (Pid) The predicted score output by the BPR layer for negative sample information (i.e., negative triples). ; Calculate the score value of the input target object identification information ( The score of the output recommendation information (i.e., semantic feature vector, Pid) and the score of the output recommendation information (i.e., semantic feature vector, Pid). The (first) dot product of ) ): ; Calculate the score of the identification information of the input target object ( The score of the output negative sample information (Nid) and the score of the output negative sample information (Nid) The (second) dot product ( ): ; Calculate the difference between these two dot products ( ) And through the activation function ( ) During the transformation, the predicted score output by the BPR layer is substituted into Z in the formula to obtain the probability value (x). The loss of the BPR embedding layer, the Korean BPRLoss, is then calculated using the x value. .

[0071] Step S208: Sort the recommended information according to the score from high to low, and output the recommendation list.

[0072] After the target model (NCF-BPR) is iteratively updated, the BPR embedding layer weights can be used to calculate a recommendation score for the recommendation information of any user u. The BPR layer sorts the recommendation information from largest to smallest according to the calculated score; and outputs a recommendation list for user u.

[0073] Through the above steps, a knowledge graph embedding layer is added to the NCF model and embedded independently with the neural network module. The hidden layer outputs of both are then fused to achieve a more accurate recommendation list. Hierarchical clustering is introduced into the TransH-HC model, enabling it to better handle many-to-many and asymmetric relationships, resulting in better performance in knowledge graph prediction tasks. Furthermore, the idea of ​​Bayesian Personalized Ranking (BPR) is introduced to improve the neural network-based collaborative filtering model (NCF), enhancing recommendation accuracy. Additionally, knowledge graphs are incorporated as auxiliary information in the recommendation process, achieving more accurate and faster recommendations.

[0074] Figure 3 This is a structural diagram of an information recommendation device based on knowledge graphs and Bayesian personalized ranking (BPR) algorithm, according to an embodiment of this application. Figure 3 As shown, the device includes: an acquisition module 30, used to acquire target data generated when the target object operates on the platform, and to build an initial knowledge graph using the target data, wherein the target data includes at least: the identification information of the target object and the browsing information of the target object on the platform; a feature extraction module 32, used to extract semantic features from the initial knowledge graph through a translation embedding TransH-HC model to obtain multiple semantic feature vectors; a scoring module 34, used to score the information to be recommended contained in the target data based on the semantic feature vectors using a target model to obtain a score value for each piece of information to be recommended, wherein the target model is a neural collaborative filtering model incorporating the Bayesian personalized ranking BPR algorithm; and an output module 36, used to sort the information to be recommended according to the score value from high to low and output a recommendation list.

[0075] It should be noted that, Figure 3 Preferred embodiments of the shown examples can be found in [reference needed]. Figure 2 The relevant descriptions of the embodiments shown will not be repeated here.

[0076] The trained target model (NCF-BPR) is embedded into an information recommendation device based on knowledge graphs and Bayesian personalized ranking (BPR) algorithms. When this device outputs a recommendation list to the user, it receives target data through acquisition module 30. This target data includes the identifier information Uid of user u (i.e., the target object) and the browsing information of user u (i.e., the target object). Acquisition module 30 constructs an initial knowledge graph about user u based on the received target data and transmits the initial indicator graph to feature extraction module 32 after construction. Feature extraction module 32 calls the TransH-HC model, which incorporates hierarchical clustering algorithm, to extract semantic features from the initial knowledge feature graph. The extracted semantic feature vector is input to scoring module 34, using the extracted semantic feature vector as auxiliary information to assist the target model (NCF-BPR) in scoring and ranking the recommendation information for user u (i.e., the target object). Figure 4 This is a flowchart of the target model (NCF-BPR) workflow, such as... Figure 4As shown, the target model (NCF-BPR) processes the user's (i.e., the target object's) identifier information Uid in the user embedding layer to capture user preferences; it processes the negative triplets (Nid) and semantic feature vectors (Pid) generated from the target data in the item embedding layer to capture data similarity and correlation; it then performs dimensionality reduction (Flatten) on the outputs of the user embedding layer (Uid_Emb and Uid_MLP) and the item embedding layer (Pid_Emb, Pid_MLP, Nid_Emb, Nid_MLP) to obtain vectors mapped to a lower-dimensional space; next, it processes the mapped Uid_Emb, Pid_Emb, and Nid_Emb in the BPR layer, and the mapped Uid_MLP, Pid_MLP, and Nid_MLP in the MLP layer. MLP; obtain the output vectors of the BPR layer and the MLP layer; concatenate the output vectors of the BPR layer and the MLP layer in the fusion layer, and process the concatenated vector in the output layer using the activation function (sigmoid / ReLU) to finally output the model's prediction result; this prediction result is the score value for each recommendation. In the MLP layer, data processing begins with processing the data in the first layer (MLP Layer 1). Next, an activation function (ReLU) is applied to the output data of MLP Layer 1, introducing non-linear characteristics. Then, batch normalization is performed on the data processed by the activation function to accelerate data convergence. The batch normalized data is then regularized (Dropout) before being input into the second layer (MLP Layer 2). The second layer (MLP Layer 2) repeats the data processing, ReLU activation function processing, batch normalization, and dropout process. Finally, the vector output from the third layer (MLP Layer 3) is merged with the vector output from the BPR layer. The final output module 36 outputs a recommendation list sorted according to the rating values.

[0077] To demonstrate that the TransH-HC model, which incorporates a hierarchical clustering algorithm, provided in this application embodiment exhibits superior performance compared to traditional translation distance models (TransE and TransH), the following experiments were conducted. Hit rate was used as the evaluation metric to reflect the accuracy of the ranking. For example, Hit@10 indicates that if the actual triplet is in the top 10 of the test set, the hit rate will increase accordingly. The final calculated hit rate is the proportion of the number of top 10 triplets to the total number of triplets. To evaluate the performance of the TransH-HC model in prediction tasks, traditional translation distance models TransE and TransH were selected as comparative experiments, and their respective parameters were set accordingly: learning rate, margin, embedding vector dimension, batch size, number of cluster centers, and number of iterations. By comparing the hit rate (Hit@10) and mean rank of these models under different conditions, the practical application value and effectiveness of the improved knowledge representation learning framework were verified. The experimental results are as follows: Figure 5 and Figure 6 As shown. Figure 5 These are the hit rate curves of different translation distance models under different embedding dimensions, showing the trend of hit rate (Hit@10) of traditional translation distance models TransE and TransH, as well as the improved translation distance model TransH-HC, in the embedding dimension (emb_dim) range of 100-600. Figure 6 The curves show the average ranking changes of different translation distance models under different embedding dimensions, illustrating the changing trends of the traditional translation distance models TransE and TransH, as well as the improved translation distance model TransH-HC, in terms of the average ranking (Meanrank) across embedding dimensions (emb_dim) ranging from 100 to 600; Analysis Figure 5 and Figure 6 It can be clearly observed that as the embedding vector dimension of the optimized TransH-HC translation distance model gradually increases, the top ten hit rate exhibits a trend of first rising and then falling. Hit@10 reaches its highest point when `emb_dim` reaches a certain value. Similarly, the average ranking (Meanrank) also shows a trend of first decreasing and then increasing, achieving its optimal average ranking at a certain value. Compared to traditional translation distance models, TransH-HC demonstrates significant advantages in both top ten hit rate and average ranking, and its performance is even more significant compared to the TransE model, which handles one-to-one relationships.

[0078] To find the optimal parameter settings for the TransH-HC algorithm, multiple comparative experiments were conducted. The basic parameters for these experiments included: learning rate, margin, embedding vector dimension, batch size (BatchSize=128), number of cluster centers (k=32), and number of iterations (n=300). The experimental results are as follows: Figure 7 and Figure 8 As shown, Figure 7 The curves show the hit rate of the TransH-HC model under different embedding dimensions, specifically the hit rate of the TransH-HC model with embedding dimensions ranging from 100 to 600. Figure 8 The curves show the average ranking of the TransH-HC model under different embedding dimensions, illustrating the variation in average ranking across embedding dimensions from 100 to 600. Experimental results reveal that embedding dimension significantly impacts model performance, with 300 being the most suitable. Within the 300-dimensional embedding space, the hit rate of the TransH-HC model exhibits a trend of first increasing and then decreasing, reaching an optimal hit rate of 60.51%. The hit rates for the top 20, top 50, and top 100 are 67.34%, 74.10%, and 76.07%, respectively. Simultaneously, the average ranking shows a trend of first decreasing and then increasing across various embedding dimensions, reaching its lowest point at 282.5 with an embedding dimension of 300. At this embedding dimension, both hit rate and average ranking perform well, with a hit rate exceeding 60% and an average ranking placing it in the top half of the dataset. Therefore, with an embedding dimension of 300, the TransH-HC model, exhibiting high predictive performance, is suitable for applications such as recommendation algorithms. In subsequent recommendation algorithm applications, we will choose to use the model with an embedding dimension of 300. In this embodiment, the relationship between the hit rate and margin of the TransH-HC model was also tested while keeping the embedding dimension unchanged, and the results were as follows: Figure 9 and Figure 10 The experimental results; Figure 9 The curves show the hit rate of the TransH-HC model under different margin values, illustrating the trend of hit rate changes of the TransH-HC model with margin values ​​ranging from 1 to 20. Figure 10This is a curve showing the change in the average ranking of the TransH-HC model under different margin values, illustrating the trend of the average ranking of the TransH-HC model with margin values ​​ranging from 1 to 20. With a fixed embedding vector dimension of 400, the changes in hit rate and average ranking were observed by adjusting the margin values. The margin values ​​included a series of values ​​(1, 2, 5, 10, 20). By comparing and analyzing the performance under different margin values, we determined the most suitable margin value for the model. In the experiment, as the margin value increased, the hit rate of the model gradually improved, and the average ranking decreased accordingly. When the margin was set to 10, the experimental results were ideal: the hit rate (Hit@10) reached 72.23%, the hit rate (Hit@20) for the top 20 was 76.52%, the hit rate (Hit@50) for the top 50 was 79.57%, the hit rate (Hit@100) for the top 100 was 81.49%, and the average ranking (Meanrank) decreased to 234.98. To ensure both model performance and training efficiency, we chose a margin of 10 as the margin value for subsequent experiments. This margin value helps to shorten training time while maintaining good model performance, thereby achieving high efficiency in prediction for knowledge representation learning tasks. Therefore, the margin value of the TransH-HC model used in this embodiment is set to 10, and the embedding dimension is set to 300.

[0079] To demonstrate that the target model (NCF-BPR) provided in this application has superior performance compared to other benchmark methods, the target model (NCF-BPR) and other traditional models were tested using two evaluation metrics: HR@10 (the number of items actually clicked by the user in the top 10 recommendation results) and NDCG@10 (the average relevance ranking score of items actually clicked by the user in the top 10 recommendation results). The results are as follows: Figure 11 The experimental results shown Figure 11 This is the model evaluation results table; such as Figure 11As shown, when recommending services / items / information to the same user, the Factorization Maximization Algorithm (FMG) has an HR@10 of 0.603 and an NDCG@10 of 0.351, improving efficiency by 22.22%; the Item-based Collaborative Filtering Algorithm (ItemKNN) has an HR@10 of 0.619 and an NDCG@10 of 0.358, improving efficiency by 19.06%; the BPR algorithm has an HR@10 of 0.676 and an NDCG@10 of 0.415, improving efficiency by 4.69%; the Explicit Alternating Least Squares (eALS) algorithm has an HR@10 of 0.704 and an NDCG@10 of 0.426, improving efficiency by 4.69%; and the Neural Matrix Factorization algorithm... Factorization (NeuMF) achieved an HR@10 of 0.721 and NDCG@10 of 0.429, improving efficiency by 2.22%. Common Knowledge Embedding (CKE) achieved an HR@10 of 0.728 and NDCG@10 of 0.441, improving efficiency by 1.24%. The target model (NCF-BPR) used a neural collaborative filtering algorithm incorporating BPR, achieving an HR@10 of 0.736 and NDCG@10 of 0.448. The Neural Graph Neural Collaborative Filtering (NeuMF) algorithm achieved an HR@10 of 0.721 and NDCG@10 of 0.429, while the Knowledge Graph Neural Collaborative Filtering (KCPE) algorithm achieved an HR@10 of 0.721 and NDCG@10 of 0.429. The HR@10 of the KGNCF algorithm is 0.724, and the NDCG@10 is 0.438. In the KGNCF-BPR model, the knowledge graph-neural collaborative filtering-relational path and semantic algorithm (KGNCF-BPR-semantic) with the removal of the representation learning process for semantic knowledge extraction has an HR@10 of 0.729 and an NDCG@10 of 0.448. According to... Figure 11As can be seen, compared with other methods, the NCF-BPR algorithm can not only capture linear and nonlinear features, but also take into account the feature vectors in the knowledge graph and combine them with BPR to achieve personalized ranking. Our method achieves better results in both accuracy and NDCG, demonstrating that KGNCF-BPR has significant advantages in performance and practicality. Therefore, KGNCF-BPR is a promising recommendation algorithm that can provide more efficient, accurate, and personalized recommendation services for recommendation systems, thereby meeting the needs of different users and improving user experience.

[0080] This application also conducted two sets of experiments on a multilayer perceptron (MLP): one set of experiments fixed the number of layers and changed the number of hidden units. While maintaining a neural network of 3 layers, we progressively tried setting the number of hidden units in the first layer to 16, 32, 64, and 128, and observed the model performance after each layer was halved. The experimental results are recorded in... Figure 12 middle, Figure 12 This is the hit rate curve of a multilayer perceptron (MLP) versus the number of hidden units, as shown below. Figure 12 As shown, when the number of hidden units in the first layer is set to 64, the model can learn features better and achieve optimal performance. Another set of experiments fixed the number of hidden units and changed the number of layers, fixing the number of hidden units in the first layer at 64, to study the impact of the number of hidden layers (1, 2, 3, 4 layers) on the model's performance. The experimental results show that increasing the number of hidden layers can improve model performance to some extent. However, too many hidden layers can make the model overly complex. Therefore, the Multilayer Perceptron (MLP) in this embodiment uses 3 hidden layers, setting the number of hidden units to [64, 32, 16] respectively to achieve optimal performance. This embodiment also conducts experiments on different fusion methods, using three different methods (sum, average, and concat) to fuse the output of the BPR layer and the output of the MLP layer. Summation means adding the two outputs, averaging means averaging them, and concat means connecting them; the experimental results are shown below. Figure 13 As shown, Figure 13 The results show the hit rate of the target model using different fusion methods. They also show the final hit rate of the target model when processing the output of the BPR layer and the output of the MLP layer using different fusion methods. According to the experimental results, the averaging method can achieve the best results.

[0081] This application also provides a non-volatile storage medium storing a computer program, wherein the device containing the non-volatile storage medium executes the above-mentioned information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm by running the computer program.

[0082] The aforementioned non-volatile storage medium is used to store programs that perform the following functions: acquiring target data generated when the target object operates on the platform, and using the target data to build an initial knowledge graph, wherein the target data includes at least: the target object's identification information and the target object's browsing information; extracting semantic features from the initial knowledge graph through a translation embedding TransH-HC model to obtain multiple semantic feature vectors; using the target model to score the information to be recommended contained in the target data based on the semantic feature vectors, obtaining a score value for each piece of information to be recommended, wherein the target model is a neural collaborative filtering model incorporating the Bayesian personalized ranking (BPR) algorithm; sorting the information to be recommended according to the score values ​​from high to low, and outputting a recommendation list.

[0083] This application also provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor is configured to execute the above-described information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm through the computer program.

[0084] The processor in the aforementioned electronic device is used to run a program that performs the following functions: acquiring target data generated when the target object operates on the platform, and using the target data to build an initial knowledge graph, wherein the target data includes at least: the target object's identification information and the target object's browsing information; extracting semantic features from the initial knowledge graph through a translation embedding TransH-HC model to obtain multiple semantic feature vectors; using the target model to score the information to be recommended contained in the target data based on the semantic feature vectors, obtaining a score value for each piece of information to be recommended, wherein the target model is a neural collaborative filtering model incorporating the Bayesian personalized ranking (BPR) algorithm; sorting the information to be recommended according to the score values ​​from high to low, and outputting a recommendation list.

[0085] This application also provides a computer program product, including a non-volatile computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the steps of the information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm in various embodiments of this application.

[0086] It should be noted that the modules in the information recommendation device based on knowledge graphs and Bayesian personalized ranking (BPR) algorithm can be program modules (e.g., a set of program instructions to implement a specific function) or hardware modules. For the latter, they can be represented in the following forms, but are not limited to these: each of the above modules is represented by a processor, or the functions of each of the above modules are implemented by a processor.

[0087] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0088] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0089] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0090] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0091] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0092] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0093] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. An information recommendation method based on knowledge graphs and Bayesian personalized ranking (BPR) algorithm, characterized in that, include: The target data generated when the target object operates on the platform is obtained, and the target data is used to build an initial knowledge graph. The target data includes at least: the identification information of the target object and the browsing information of the target object. Semantic feature extraction is performed on the initial knowledge graph using the TransH-HC model to obtain multiple semantic feature vectors. This includes: converting each node in the initial knowledge graph into a corresponding first-class vector and each edge in the initial knowledge graph into a corresponding second-class vector; determining the similarity score between any two first-class vectors using any second-class vector and a hyperplane; clustering the first-class vectors with similarity scores greater than a preset value into a cluster, resulting in multiple clusters; determining the distance between any two clusters and merging the two clusters with the smallest distance into a target cluster, repeating this process until a preset number of fusions is reached, resulting in multiple target clusters; and identifying the first target cluster to which the target head entity belongs and the second target cluster to which the target tail entity belongs among the multiple target clusters. The target head entity and the target tail entity are the head entity and tail entity in any positive triplet, and the positive triplet is a triplet generated by the target data transformation. For each positive triplet, the target head entity is replaced with any entity in the first target cluster, and the target tail entity is replaced with any entity in the second target cluster to obtain a negative triplet. The TransH-HC model is trained using multiple positive triplets and multiple negative triplets until the number of iterations reaches a preset number to obtain the trained TransH-HC model. The initial knowledge graph is used as the input information of the trained TransH-HC model to obtain multiple semantic feature vectors output by the trained TransH-HC model. The target model is used to score the information to be recommended contained in the target data based on the semantic feature vector, and a score value is obtained for each piece of information to be recommended. The target model is a neural collaborative filtering model that incorporates the Bayesian personalized ranking (BPR) algorithm. The information to be recommended is sorted from highest to lowest according to the rating values, and a recommendation list is output.

2. The method according to claim 1, characterized in that, Constructing an initial knowledge graph using the target data includes: For each target data, the target data is converted into a triple, wherein the data that serves as the subject in the target data is the head entity in the triple, the data that serves as the object in the target data is the tail entity in the triple, and the data that indicates the relationship between the subject and the object in the target data is the relation in the triple; The initial knowledge graph is constructed using multiple triples corresponding to multiple target data, wherein the head entity and the tail entity serve as nodes in the initial knowledge graph, and the relations in the triples serve as edges in the initial knowledge graph.

3. The method according to claim 1, characterized in that, The target model includes a multilayer perceptron (MLP) and a Bayesian personalized ranking (BPR) layer. The target model is used to score the information to be recommended contained in the target data based on the semantic feature vector, including: The multiple semantic feature vectors are input into the improved target model to obtain the first result output by the MLP for the semantic feature vectors, and the second result output by the BPR layer for the semantic feature vectors is obtained. The first result and the second result are concatenated into a new vector, and the new vector is used to score the information to be recommended, so as to obtain a score value for each piece of information to be recommended.

4. The method according to claim 3, characterized in that, The target model is trained using the following method: Obtain the identification information of the target object, and obtain the negative triplet generated based on the target data; The identification information of a target object, a negative triplet, and a semantic feature vector are combined into a sample group to obtain multiple sample groups. The target model is trained using multiple sample groups as training data until the loss function value of the BPR layer reaches a preset value, and the target parameters obtained from the last training are output. Replace the model parameters of the improved neural collaborative filtering model with the target parameters.

5. The method according to claim 4, characterized in that, The loss function value of the BPR layer is calculated using the following method: Determine the first dot product between the score value of the target object's identification information and the score value of the semantic feature vector, and determine the second dot product between the score value of the target object's identification information and the score value of the negative example triple; Determine the difference between the first dot product and the second dot product, and convert the difference into a probability value; The loss function value of the BPR layer is determined based on the probability value.

6. An information recommendation device based on knowledge graphs and Bayesian personalized ranking (BPR) algorithm, characterized in that, include: The acquisition module is used to acquire target data generated when the target object operates on the platform, and to build an initial knowledge graph using the target data. The target data includes at least: the identification information of the target object and the browsing information of the target object. The feature extraction module is used to extract semantic features from the initial knowledge graph using a translation embedding TransH-HC model to obtain multiple semantic feature vectors. This includes: converting each node in the initial knowledge graph into a corresponding first-class vector and each edge in the initial knowledge graph into a corresponding second-class vector; determining a similarity score between any two first-class vectors using any second-class vector and a hyperplane; clustering the first-class vectors with similarity scores greater than a preset value into a cluster, obtaining multiple clusters; determining the distance between every two clusters, and merging the two clusters corresponding to the smallest distance value into a target cluster, until the merging count reaches a preset number, obtaining multiple target clusters; and determining the first target cluster to which the target head entity belongs and the second target cluster to which the target tail entity belongs among the multiple target clusters. Two target clusters are defined, wherein the target head entity and the target tail entity are the head entity and tail entity in any positive triplet, and the positive triplet is a triplet generated by the transformation of the target data; for each positive triplet, the target head entity is replaced with any entity in the first target cluster, and the target tail entity is replaced with any entity in the second target cluster, resulting in a negative triplet; the TransH-HC model is trained using multiple positive triplets and multiple negative triplets until the number of iterations reaches a preset number, resulting in the trained TransH-HC model; the initial knowledge graph is used as the input information of the trained TransH-HC model to obtain multiple semantic feature vectors output by the trained TransH-HC model; The scoring module is used to score the information to be recommended contained in the target data based on the semantic feature vector using the target model, and obtain a score value for each piece of information to be recommended. The target model is a neural collaborative filtering model that incorporates the Bayesian personalized ranking (BPR) algorithm. The output module is used to sort the information to be recommended according to the rating values ​​from high to low, and output a recommendation list.

7. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a computer program, wherein the device containing the non-volatile storage medium executes the information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm as described in any one of claims 1 to 5 by running the computer program.

8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm as described in any one of claims 1 to 5 through the computer program.

9. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the information recommendation method based on knowledge graph and Bayesian personalized ranking (BPR) algorithm as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Chinese traveling domain knowledge map construction method and system

    CN106777274A

  • Translation model-based knowledge graph representation method

    CN106951499A