Methods for determining interest point prediction models, prediction methods, devices, and media.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-06
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]然而,相关技术的POI预测方法仅仅使用POI之间的转换信息,忽略了用户的长期习惯信息,对POI预测的准确性较低,且相关技术中使用的POI预测模型的推理速度较慢,导致POI预测效率低下
[0013]一方面,本公开基于知识图谱嵌入子模型,可以对用户访问频率较低的兴趣点进行增强,缓解了用户访问兴趣点的数据稀疏问题,提高了兴趣点预测模型的预测准确性;另一方面,本公开将知识图谱嵌入子模型和预训练语言子模型进行结合,通过构建目标损失函数对知识图谱嵌入子模型和预训练语言子模型进行联合训练,知识图谱嵌入子模型可以学习输入数据的向量表达,预训练语言子模型可以有效的编码用户的长期习惯特征,从而进一步提高预测的准确性,且通过预训练语言子模型可以提高兴趣点预测模型的推理速度,进而提高模型的预测效率。
Smart Images

Figure CN118312683B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of information processing technology, and more specifically, to a method for determining an interest point prediction model, an apparatus for determining an interest point prediction model, an interest point prediction method, an interest point prediction apparatus, a computer-readable storage medium, and an electronic device. Background Technology
[0002] POI (Point of Interest) prediction uses a user's historical POI access data to model and predict which POIs the user might visit at some point in the future.
[0003] However, the POI prediction methods in related technologies only use the conversion information between POIs and ignore the user's long-term habit information, resulting in low accuracy in POI prediction. In addition, the inference speed of the POI prediction models used in related technologies is slow, leading to low efficiency in POI prediction.
[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] The purpose of this disclosure is to provide a method for determining an interest point prediction model, an apparatus for determining an interest point prediction model, an interest point prediction method, an interest point prediction apparatus, a computer-readable medium, and an electronic device, thereby improving the accuracy and efficiency of interest point prediction to at least a certain extent.
[0006] According to a first aspect of this disclosure, a method for determining an interest point prediction model is provided. The interest point prediction model includes a knowledge graph embedding sub-model and a pre-trained language sub-model. The method includes: acquiring a user's historical interest point access sequence; generating a knowledge triple corresponding to each historical interest point in the historical interest point access sequence; obtaining a first vector for each historical interest point in the historical interest point access sequence based on the knowledge graph embedding sub-model in the initial interest point prediction model, so as to generate a first vector sequence based on the first vector of each historical interest point in the historical interest point access sequence; training the initial interest point prediction model based on the knowledge triple, the first vector sequence, and a target loss function to obtain a target interest point prediction model; wherein the knowledge triple is the input of the knowledge graph embedding sub-model in the initial interest point prediction model, the first vector sequence is the input of the pre-trained language sub-model in the initial interest point prediction model, and the target loss function is determined based on the first loss function of the knowledge graph embedding sub-model and the second loss function of the pre-trained language sub-model.
[0007] According to a second aspect of this disclosure, a method for predicting points of interest is provided, comprising: obtaining a target historical point of interest access sequence of a user to be predicted before the current time; obtaining a third vector corresponding to each target historical point of interest in the target historical point of interest access sequence based on a knowledge graph embedding sub-model in a target point of interest prediction model, so as to generate a third vector sequence corresponding to the historical point of interest access sequence; inputting the third vector sequence into a pre-trained language sub-model in the target point of interest prediction model to obtain the next point of interest of the user to be predicted; wherein, the target point of interest prediction model is obtained according to the method for determining the point of interest prediction model described in the first aspect.
[0008] According to a third aspect of this disclosure, an apparatus for determining an interest point prediction model is provided. The interest point prediction model includes a knowledge graph embedding sub-model and a pre-trained language sub-model. The apparatus includes: a first acquisition module configured to acquire a user's historical interest point access sequence; a knowledge triple generation module configured to generate a knowledge triple corresponding to each historical interest point in the historical interest point access sequence; and a first vector sequence generation module configured to obtain a first vector for each historical interest point in the historical interest point access sequence based on the knowledge graph embedding sub-model in the initial interest point prediction model, so as to determine the first vector of each historical interest point in the historical interest point access sequence. The first vector of each historical point of interest in the historical point of interest access sequence generates a first vector sequence; the training module is configured to train the initial point of interest prediction model based on the knowledge triples, the first vector sequence, and the target loss function to obtain the target point of interest prediction model; wherein, the knowledge triples are the input of the knowledge graph embedding sub-model in the initial point of interest prediction model, the first vector sequence is the input of the pre-trained language sub-model in the initial point of interest prediction model, and the target loss function is determined according to the first loss function of the knowledge graph embedding sub-model and the second loss function of the pre-trained language sub-model.
[0009] According to a fourth aspect of this disclosure, an interest point prediction apparatus is provided, comprising: a second acquisition module configured to acquire a target historical interest point access sequence of a user to be predicted up to the current time; a third vector sequence generation module configured to obtain a third vector corresponding to each target historical interest point in the target historical interest point access sequence based on a knowledge graph embedding sub-model in the target interest point prediction model, thereby generating a third vector sequence corresponding to the historical interest point access sequence; and an interest point prediction module configured to input the third vector sequence into a pre-trained language sub-model in the target interest point prediction model to obtain the next interest point of the user to be predicted; wherein the target interest point prediction model is obtained according to the method for determining the interest point prediction model described in the first aspect.
[0010] According to a fifth aspect of this disclosure, a computer-readable storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the method described above.
[0011] According to a sixth aspect of this disclosure, an electronic device is provided, characterized in that it includes: one or more processors; and a memory for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the method described above.
[0012] The technical solution disclosed herein has the following beneficial effects:
[0013] On the one hand, this disclosure, based on a knowledge graph embedding sub-model, can enhance interest points with low user access frequency, alleviating the data sparsity problem of user access to interest points and improving the prediction accuracy of the interest point prediction model. On the other hand, this disclosure combines the knowledge graph embedding sub-model and the pre-trained language sub-model, and jointly trains the knowledge graph embedding sub-model and the pre-trained language sub-model by constructing a target loss function. The knowledge graph embedding sub-model can learn the vector representation of the input data, and the pre-trained language sub-model can effectively encode the long-term habit features of users, thereby further improving the prediction accuracy. Moreover, the pre-trained language sub-model can improve the inference speed of the interest point prediction model, thereby improving the prediction efficiency of the model.
[0014] In summary, this disclosure can improve the accuracy and efficiency of point of interest prediction.
[0015] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:
[0017] Figure 1 A schematic diagram of a system architecture to which exemplary embodiments of the present disclosure may be applied is shown;
[0018] Figure 2 A flowchart illustrating a method for determining a point-of-interest prediction model in an exemplary embodiment of this disclosure is shown.
[0019] Figure 3A flowchart illustrating the method for determining the knowledge graph embedding sub-model in the initial interest point prediction model in an exemplary embodiment of this disclosure is shown.
[0020] Figure 4 A schematic diagram illustrating a visualized knowledge graph in an exemplary embodiment of this disclosure;
[0021] Figure 5 This diagram illustrates a flowchart of a method for obtaining a knowledge graph embedding sub-model in an initial interest point prediction model based on knowledge triplet sample pairs in an exemplary embodiment of this disclosure.
[0022] Figure 6 This diagram illustrates the structure of the initial point of interest prediction model in an exemplary embodiment of this disclosure.
[0023] Figure 7 This diagram illustrates a flowchart of a method for training an initial interest point prediction model to obtain a target interest point prediction model, as shown in an exemplary embodiment of this disclosure.
[0024] Figure 8 A flowchart illustrating a method for training a pre-trained language sub-model according to an exemplary embodiment of this disclosure is shown.
[0025] Figure 9 A flowchart illustrating the point of interest prediction method in an exemplary embodiment of this disclosure is shown.
[0026] Figure 10 A schematic diagram illustrating the composition of an apparatus for determining a point of interest prediction model in an exemplary embodiment of this disclosure;
[0027] Figure 11 The figure illustrates a schematic diagram of the composition of an interest point prediction apparatus in an exemplary embodiment of the present disclosure;
[0028] Figure 12 A schematic diagram of an electronic device to which exemplary embodiments of the present disclosure may be applied is shown. Detailed Implementation
[0029] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0030] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0031] A Point of Interest (POI) is a record of a location on a map that someone finds useful or interesting. In a geographic information system, a POI can be a house, a shop, a mailbox, a bus stop, a tourist attraction, a restaurant, a gas station, a school, a park, and so on.
[0032] POI prediction uses a user's historical POI access data to model and predict which POI the user might visit at a future time, i.e., the next possible POI to visit. Based on the predicted POI, information can be recommended to the user. For example, if it is predicted that the POI the user may visit in the future is a shopping mall, relevant information about the shopping mall can be recommended to the user.
[0033] In one related technology, POI prediction typically uses time series modeling methods, including Markov chain-based time series prediction models and deep learning-based time series prediction models. These models mainly utilize the user's short-term features for modeling, and can also combine the user's long-term and short-term features for modeling.
[0034] However, due to the long-tail effect of POI access data, that is, only a small portion of a large number of real-world POIs are frequently accessed, while most POIs have very low user access. In other words, POI access data has a sparsity problem. For time series prediction models, it is difficult to learn the characteristics of POIs with low access and to capture the connections and similarities between POIs and users, resulting in low accuracy of POI prediction.
[0035] Another related technology can be used for POI prediction through knowledge graphs. This can transform the POI prediction problem into an entity relationship prediction problem of knowledge graphs, and use relationship completion algorithms for modeling.
[0036] While knowledge graph-based completion methods utilize the category relationships between POIs, the relatively static knowledge graph makes it difficult to characterize dynamic location movement issues, and current knowledge graph modeling methods struggle to capture users' long-term and short-term habit preferences.
[0037] In another related technique, knowledge graphs and time series data can be jointly modeled for POI prediction.
[0038] However, existing methods based on joint time series and knowledge graph modeling only utilize transformation information between POIs, neglecting user-level information such as long-term user habits. This results in lower prediction accuracy, and higher-level information about the POIs themselves, such as POI categories, is not fully utilized. Furthermore, these methods employ GRU (Gated Recurrent Unit) as the time series model, which has extremely slow training and inference speeds, leading to low POI prediction efficiency and making it difficult to apply in real-time prediction scenarios.
[0039] In view of the above problems, the exemplary embodiments of this disclosure provide a method for determining an interest point prediction model and an interest point prediction method.
[0040] Below, let's first combine Figure 1 The system architecture of the operating environment for this exemplary embodiment is described in an exemplary manner.
[0041] Figure 1 A schematic diagram of the system architecture is shown. System architecture 100 may include a terminal 110 and a network device 120. The terminal 110 may be a smartphone, tablet, desktop computer, laptop, smart wearable electronic device (such as a smartwatch), or other terminal device. The network device 120 may include a base station or other device that allows the terminal to access the network environment. The terminal 110 and network device 120 can be connected via a wired or wireless communication link for data exchange.
[0042] In one exemplary embodiment, the terminal 110 can execute the method for determining the point of interest prediction model and the point of interest prediction method of this disclosure. For example, with user authorization, the terminal can collect the user's historical point of interest access sequence, and then execute the method for determining the point of interest prediction model of this disclosure based on the collected historical point of interest access sequence to obtain the user's point of interest prediction model; or, based on the collected target historical point of interest access sequence before the current time, execute the point of interest prediction method of this disclosure to predict the user's next point of interest.
[0043] In one exemplary embodiment, the server 120 may also execute the method for determining the point of interest prediction model and the method for predicting the point of interest as disclosed herein. For example, the server may receive historical point of interest access sequences of multiple users sent by the terminal, and execute the method for determining the point of interest prediction model as disclosed herein based on the historical point of interest access sequences of multiple users to obtain a point of interest prediction model, which can be used to predict the point of interest of any user; or the server may collect historical point of interest access records of any user, determine the target historical point of interest access sequence of the user based on the collected access records, and thereby execute the point of interest prediction method as disclosed herein to predict the user's next point of interest.
[0044] As can be seen from the above, the method for determining the point of interest prediction model and the execution subject of the point of interest prediction method in this exemplary embodiment can be the aforementioned terminal 110 or server 120, and this disclosure does not limit them.
[0045] The following is combined with Figure 2 The method for determining the interest point prediction model in this exemplary embodiment is described. The interest point prediction model may include a knowledge graph embedding sub-model and a pre-trained language sub-model. Figure 2 An exemplary flow of the method for determining the point of interest prediction model is shown, which may include:
[0046] Step S210: Obtain the user's historical access sequence of points of interest;
[0047] Step S220: For each historical point of interest in the historical point of interest access sequence, generate a knowledge triple corresponding to the historical point of interest.
[0048] Step S230: Based on the knowledge graph embedding sub-model in the initial interest point prediction model, obtain the first vector of each historical interest point in the historical interest point access sequence, so as to generate a first vector sequence based on the first vector of each historical interest point in the historical interest point access sequence.
[0049] Step S240: Train the initial interest point prediction model based on the knowledge triples, the first vector sequence, and the target loss function to obtain the target interest point prediction model;
[0050] Wherein, the knowledge triplet is the input of the knowledge graph embedding sub-model in the initial interest point prediction model, the first vector sequence is the input of the pre-trained language sub-model in the initial interest point prediction model, and the target loss function is determined based on the first loss function of the knowledge graph embedding sub-model and the second loss function of the pre-trained language sub-model.
[0051] Based on the above methods, on the one hand, this disclosure, based on a knowledge graph embedding sub-model, can enhance interest points with low user access frequency, alleviating the data sparsity problem of user access to interest points and improving the prediction accuracy of the interest point prediction model. On the other hand, this disclosure combines the knowledge graph embedding sub-model and the pre-trained language sub-model, and jointly trains the knowledge graph embedding sub-model and the pre-trained language sub-model by constructing a target loss function. The knowledge graph embedding sub-model can learn the vector representation of the input data, and the pre-trained language sub-model can effectively encode the user's long-term habitual features, thereby further improving the prediction accuracy. Moreover, the pre-trained language sub-model can improve the inference speed of the interest point prediction model, thus improving the prediction efficiency of the model. In summary, this disclosure can improve the accuracy and prediction efficiency of interest point prediction.
[0052] The following is about Figure 2 Each step in the process will be explained in detail.
[0053] refer to Figure 2 In step S210, the user's historical points of interest access sequence is obtained.
[0054] For example, with user authorization and under privacy compliance, the user's geographic coordinates and collection time information can be collected based on the user's terminal device. For instance, the user's geographic coordinates can be collected at a preset frequency, and the time of collection can be recorded. Then, geographic service software can be used to determine the Point of Interest (POI) corresponding to the collected geographic coordinates. For example, if the user's current geographic coordinates (113.23, 23.58) are collected at time A, and this coordinates correspond to school A, then the POI visited by the user at time A can be determined to be school A. The collected POI records are then sorted according to chronological order to obtain the user's historical point of interest access sequence.
[0055] In one exemplary implementation, a user's access records of points of interest within a preset time period can be collected to generate a historical sequence of the user's points of interest accesses, such as collecting the user's points of interest access records within 3 months. The preset time period can be customized as needed, and this exemplary implementation does not impose any special limitations on it.
[0056] In one exemplary implementation, the historical point-of-interest (POI) access sequences of multiple users can be obtained and recorded in JSON (JavaScript Object Notation, a lightweight data interchange format) data format. For example, a user's historical POI access sequence can be recorded as {"userId":"djskjdkkjk","history":[["poi_id_1","time_stamp_1"],["poi_id_2","time_stamp_2"],…,["poi_id_n","time_stamp_n"]]}, where userId represents the user identifier used to distinguish different users, history represents the historical POI access sequence, poi_id_1 represents the first POI accessed by the user during the collection period, and time_stamp_1 represents the time when the user accessed the first POI, i.e., the collection time when the first POI was collected.
[0057] In another exemplary implementation, the geographic location change information of the user's terminal device can also be monitored in real time. When the geographic location of the terminal device changes, the terminal device actively reports the current geographic location information, thereby obtaining the user's historical point of interest access sequence based on the reporting time and the reported geographic location information of the terminal device.
[0058] In step S220, for each historical point of interest in the historical point of interest access sequence, a knowledge triplet corresponding to the historical point of interest is generated.
[0059] For example, one specific implementation of step S220 may include: for each historical point of interest in each user's historical point of interest access sequence, generating a knowledge triple corresponding to the historical point of interest based on the user's user identifier, the user's access time to the historical point of interest, and the identifier of the historical point of interest.
[0060] For example, a knowledge graph consists of entities, relations, and facts. Facts are represented as knowledge triples (head entity, relation, tail entity). That is, the relationships between entities in a knowledge graph can be understood as facts, and facts can be represented by knowledge triples. In other words, a knowledge graph can be generated from one or more facts.
[0061] For each historical point of interest in each user's historical point of interest access sequence, a knowledge triple (user identifier, access time, point of interest) can be generated. If a user's historical point of interest access sequence contains 100 points of interest, 100 knowledge triples can be generated based on these 100 points of interest. The knowledge triples generated in step S220 can be used to fine-tune the knowledge graph embedding sub-model in the initial point of interest prediction model. The specific implementation process will be explained in the subsequent step S240.
[0062] In step S230, the first vector of each historical interest point in the historical interest point access sequence is obtained according to the knowledge graph embedding sub-model in the initial interest point prediction model, so as to generate a first vector sequence based on the first vector of each historical interest point in the historical interest point access sequence.
[0063] For example, knowledge triple samples can be pre-generated to train an initial knowledge graph embedding sub-model, thereby obtaining a knowledge graph embedding sub-model in the initial interest point prediction model, and then obtaining a vector representation of each historical interest point in the user's historical interest point access sequence based on the obtained knowledge graph embedding sub-model in the initial interest point prediction model.
[0064] For example, Figure 3 This diagram illustrates a flowchart of a method for determining a knowledge graph embedding sub-model in an initial interest point prediction model according to an exemplary embodiment of this disclosure. (See reference) Figure 3 The method may include steps S310 to S350. Wherein:
[0065] In step S310, based on the terminal device used by the user, the user's access points of interest and the access time information of the user's access points of interest are obtained.
[0066] As mentioned earlier, with user authorization, information such as the points of interest visited by the user and the time of collection when those points of interest were collected can be gathered based on the terminal device used by the user. For specific implementation details, please refer to the relevant content in step S210 above, which will not be repeated here.
[0067] The collected time information can be processed to obtain the user's access time information for that point of interest. For example, the duration of each day can be divided into a preset number of time windows, and the user's access time information for that point of interest can be determined based on the time window to which the collected time information belongs.
[0068] For example, a 24-hour day can be divided into 48 time windows at 30-minute intervals. The first time window is from 0:00 to 0:30, the second time window is from 0:20 to 1:00, and so on. If the data collection time is between 0:00 and 0:30, then the access time information can be visit_1, indicating that the point of interest was visited in the first time window. The order of the time windows can be represented by visit_n, where n can be any integer from 1 to 48. For example, visit_1 represents the first time window, and visit_48 represents the 48th time window.
[0069] You can also divide weekdays and non-weekdays into separate time windows. For example, each weekday can be divided into 48 time windows, and each non-weekday can be divided into another 48 time windows, resulting in 96 time windows, namely visit_1 to visit_96. For example, the access time information corresponding to 0:00 to 0:30 on Saturday is visit_49.
[0070] Of course, the daily duration can also be divided into different time windows based on other preset durations, such as every 5 minutes or every hour, to determine the access time information. Alternatively, the time window division can be omitted, and the recorded collection time can be directly determined as the access time information. This exemplary implementation does not impose any special limitations on this approach.
[0071] In step S320, positive samples of knowledge triples are generated based on the user's access to points of interest and the access time information of the access to the points of interest.
[0072] As mentioned earlier, knowledge triples are the building blocks of a knowledge graph, and they can be represented in the form of (head entity, relation, tail entity). Similarly, positive samples of knowledge triples can also be determined based on the head entity, relation, and tail entity.
[0073] In one exemplary implementation, the head or tail entity in the positive knowledge triple sample includes the point of interest obtained in step S310, and the relation in the positive knowledge triple sample includes the access time information obtained in step S310. For example, for user 1, if user 1 accesses point of interest 1 from 0:00 to 0:30 on a weekday, a positive knowledge triple sample (user 1, visit_1, point of interest 1) can be generated.
[0074] In one exemplary implementation, the head or tail entity in the positive sample of the knowledge triple further includes one or more of the following: user identifier, first-level category to which the user's accessed point of interest belongs, second-level category to which the user's accessed point of interest belongs, third-level category to which the user's accessed point of interest belongs, urban functional area category to which the user's accessed point of interest belongs, and road to which the user's accessed point of interest belongs; the relationships in the positive sample of the knowledge triple further include one or more of the following: friend relationship between users, kinship relationship between users, time conversion relationship between points of interest, distance conversion relationship between points of interest, membership relationship between a point of interest and its third-level category, first subordinate relationship between each level of categories of points of interest, and second subordinate relationship between a point of interest and its road or urban functional area category; wherein, the time conversion relationship between points of interest is determined according to the duration level of the average transfer time when multiple users move between points of interest; the distance conversion relationship between points of interest is determined according to the distance level of the distance between points of interest.
[0075] The primary, secondary, and tertiary categories to which user-accessed points of interest (POIs) belong can be determined using POI information quadruples. For example, geographic service software can be used to obtain the three-level categories of collected POIs and store each POI's category as a quadruple. Taking POI "School A" as an example, the corresponding POI information quadruple can be represented as (School A, Primary School, School, Science, Education, Culture and Services), meaning School A belongs to Primary School, the next level above Primary School is School, and the next level above School is Science, Education, Culture and Services. Here, Primary School is the tertiary category, School is the secondary category, and Science, Education, Culture and Services is the primary category.
[0076] Regarding a user's friend relationships, it's possible to obtain a user's friends through third-party dating apps, while adhering to privacy regulations, to determine those relationships. Regarding a user's family relationships, it's possible to obtain those relationships through family space software on the user's device, while adhering to privacy regulations.
[0077] The city functional area category to which a user's point of interest belongs, and the road to which the user's point of interest belongs, can be obtained through road network and city area data.
[0078] Regarding the time transition relationship between points of interest, different duration levels can be determined based on their length. For example, 5 minutes or less is level one, more than 5 minutes but less than or equal to 10 minutes is level two, more than 10 minutes but less than or equal to 15 minutes is level three, and so on. Then, the average time spent by all users when transitioning between two points of interest is statistically analyzed. The time transition relationship between the two points of interest is determined based on the duration level to which the average time spent belongs. For example, if the average time spent is 3 minutes, the time transition relationship between the two points of interest can be represented as ttd_1; if the average time spent is 9 minutes, the time transition relationship between the two points of interest can be represented as ttd_2.
[0079] For distance transfer relationships between points of interest, distance levels can be determined based on different distances. For example, a distance of less than 100 meters is level one, a distance greater than or equal to 100 meters and less than 200 meters is level two, a distance greater than or equal to 200 meters and less than 300 meters is level three, and so on. If the distance between two points of interest is 178 meters, then their distance transfer relationship belongs to level two, which can be represented as tdd_2.
[0080] For example, the entities in the knowledge graph embedding sub-model of this disclosure may include the entity types shown in Table 1, and the relations in the knowledge graph embedding sub-model of this disclosure may include the relation types shown in Table 2.
[0081] Table 1 Entity Types in this Disclosure
[0082]
[0083]
[0084] Table 2. Types of Relationships in this Disclosure
[0085]
[0086] For example, in this disclosure, knowledge triples in a knowledge graph may include the following forms: (u,visit_n,p), (u,fri,u), (u,fam,u), (p,ttd_n,p), (p,tdd_n,p), (p,c,pc3), (pc3,b,pc2), (pc2,b,pc1), (p,loc,ufz), (p,loc,r).
[0087] Taking (p, ttd_n, p) as an example, it represents the time taken from the interest point corresponding to the head entity to the interest point corresponding to the tail entity, which is the duration represented by ttd_n. Figure 4 A schematic diagram illustrating a visualized knowledge graph in an exemplary embodiment of this disclosure is shown. For example... Figure 4 The relationship between entity A (school) and entity Elementary School is c, which means that school A belongs to the category of Elementary School.
[0088] Continue to refer to Figure 3 In step S330, for each positive knowledge triplet sample, the tail entity in the positive knowledge triplet sample is replaced with another entity of the same category to generate a negative knowledge triplet sample corresponding to the positive knowledge triplet sample.
[0089] For example, based on the collected entities and relationships, positive knowledge triples can be generated according to Tables 1 and 2 above. Then, the tail entity in each positive knowledge triple can be replaced with another entity of the same kind to generate the corresponding negative knowledge triple.
[0090] In step S340, for each positive knowledge triplet sample, a knowledge triplet sample pair is determined based on the positive knowledge triplet sample and the corresponding negative knowledge triplet sample.
[0091] In step S350, the knowledge triplet sample pairs are trained to obtain the knowledge graph embedding sub-model in the initial interest point prediction model.
[0092] For example, Figure 5 This diagram illustrates a flowchart of a method for obtaining a knowledge graph embedding sub-model in an initial interest point prediction model based on knowledge triplet sample pairs, as shown in an exemplary embodiment of this disclosure. (See reference...) Figure 5 The method may include steps S510 to S550. Wherein:
[0093] In step S510, the head entity, tail entity, and relation in each knowledge triple sample pair are initialized to obtain the head entity vector corresponding to the head entity, the tail entity vector corresponding to the tail entity, and the relation vector corresponding to the relation.
[0094] For example, the main function of the knowledge graph embedding sub-model is to convert entities and relations into corresponding vector representations. Taking the knowledge triple (h; r; t) as an example, where h represents the head entity, r represents the relation, and t represents the tail entity, we can first initialize the entity vectors h, t ∈ R. d Relation vector r∈R k This yields the head entity vector h corresponding to the head entity, the tail entity vector t corresponding to the tail entity, and the relation vector r corresponding to the relation.
[0095] In step S520, the head entity vector and the tail entity vector are mapped to the relation space according to the preset projection matrix to obtain the relation space head entity vector and the relation space tail entity vector.
[0096] For example, a preset projection matrix M can be constructed. r ∈R k×d Thus, the head entity vector and tail entity vector are mapped to each relation space through the constructed projection matrix: h r =hM r , t r =tM r Among them, h r t represents the header entity vector of the relation space. r Represents the tail entity vector of the relation space.
[0097] In step S530, for any knowledge triple sample, the virtual score of the knowledge triple sample is determined based on the relation space head entity vector, relation vector, and relation space tail entity vector corresponding to the knowledge triple sample.
[0098] For example, the virtual score of each knowledge triplet sample can be determined by scoring each knowledge triplet sample using the scoring function in formula (1).
[0099]
[0100] In other words, we can first determine the sum of the relation vector and the head entity vector of the relation space, and then determine the difference between the sum and the tail entity vector of the relation space. Based on the 2-norm of this difference, we can determine the virtual score of the knowledge triple.
[0101] Continue to refer to Figure 5 In step S540, the value of the first loss function is determined based on the virtual scores of the positive and negative samples of the knowledge triplet in each knowledge triplet sample pair.
[0102] For example, the first loss function can be determined by the following formula (2).
[0103] Loss kg =-Σlnσ(f kg (h;r;t′)-f kg (h;r;t)) (2)
[0104] In formula (2), f kg (h;r;t′) represents the virtual score of the negative sample in the knowledge triplet sample pair, f kg(h;r;t) represents the virtual score of the positive knowledge triple in the knowledge triple sample pair, σ is the sigmoid activation function, and ∑ represents the summation of the loss over all knowledge triple sample pairs in the training data.
[0105] By using the virtual scores of the positive and negative samples in the knowledge triplet positive and negative sample pairs, the value of the first loss function can be obtained based on the above formula (2).
[0106] Continue to refer to Figure 5 In step S550, training is performed based on the value of the first loss function to obtain the knowledge graph embedding sub-model in the initial interest point prediction model.
[0107] For the knowledge graph embedding sub-model, it can be trained to learn the embedding representations of entities and relations. The higher the scoring function value, the more reasonable the triple is, i.e., the greater the probability of it being correct. When training to learn the embedding representations of entities and relations, the optimization objective is to make the score of existing knowledge triples in the knowledge graph as high as possible compared to the score of non-existent knowledge triples.
[0108] For example, an initial knowledge graph embedding sub-model can be trained with the optimization objective of gradually reducing the value of the first loss function. When the value of the first loss function is less than a certain preset value, training is stopped, and the trained knowledge graph embedding sub-model is tested based on test samples. When the prediction accuracy of the test samples meets the requirements, the knowledge graph embedding sub-model is determined as the knowledge graph embedding sub-model in the initial interest point prediction model.
[0109] In one exemplary implementation, the knowledge graph embedding sub-model is equivalent to a vector representation dictionary. After obtaining the knowledge graph embedding sub-model in the initial interest point prediction model, the vector representation corresponding to each historical interest point in the historical interest point access sequence in step S210 can be found in the knowledge graph embedding sub-model to obtain the first vector sequence.
[0110] It should be noted that if a vector representation of a certain interest point is not found in the initial interest point prediction model, the first vector of that interest point can be determined based on the preset vector representing the unknown interest point.
[0111] Through steps S510 to S550 described above, the knowledge graph embedding sub-model in the initial interest point prediction model can be trained. This knowledge graph embedding sub-model can convert user entities and interest point entities into corresponding vector representations.
[0112] Steps S510 to S550 described above can be understood as a training method for a knowledge graph embedding model based on TransR (Learning Entity and Relation Embeddings for Knowledge Graph Completion). TransR embeds entities and relations into different spaces, implementing vector representations in the corresponding relation spaces. Of course, methods such as TransD (Knowledge Graph Embedding via Dynamic Mapping Matrix) and LineaRE can also be used to train the knowledge graph embedding sub-model; this exemplary embodiment does not impose any special limitations on this.
[0113] Continue to refer to Figure 2 In step S240, the initial interest point prediction model is trained based on the knowledge triples, the first vector sequence, and the target loss function to obtain the target interest point prediction model.
[0114] In this model, the knowledge triplet serves as the input to the knowledge graph embedding sub-model within the initial interest point prediction model, the first vector sequence serves as the input to the pre-trained language sub-model within the initial interest point prediction model, and the target loss function is determined based on the first loss function of the knowledge graph embedding sub-model and the second loss function of the pre-trained language sub-model. The target interest point prediction model can be used to predict the user's next point of interest.
[0115] For example, Figure 6 A schematic diagram illustrating the structure of an initial point of interest prediction model in an exemplary embodiment of this disclosure is shown. (Reference) Figure 6 In this disclosure, knowledge triples training samples can first be generated based on the entities in Table 1 and the relationships in Table 2 to train an initial knowledge graph embedding sub-model based on the knowledge, thereby obtaining the knowledge graph embedding sub-model 61 in the initial interest point prediction model. In 61, ① to ⑦ represent entity vectors, meaning the knowledge graph embedding sub-model can be used to convert entities into corresponding vector representations, such as ①user-emb representing the embedding vector representation of the user entity. Then, when training the initial interest point prediction model, the vector representation of each historical interest point in the input historical interest point access sequence can be obtained through the knowledge graph embedding sub-model in the initial interest point prediction model, generating a vector representation sequence corresponding to the historical interest point access sequence. This vector representation sequence is then used as input to the pre-trained language sub-model 62 in the initial interest point prediction model, thereby training the pre-trained language sub-model based on this vector representation sequence.
[0116] Knowledge graphs can augment knowledge for interest points with low user engagement, addressing the data sparsity problem. Therefore, knowledge graphs can improve the accuracy of the vector representation for each interest point. Meanwhile, pre-trained language sub-models, as temporal prediction models, can effectively encode long-term user habitual features and learn these features. By jointly training these two models using their respective loss functions as the target loss function, the prediction accuracy of the interest point prediction model can be significantly improved. Furthermore, compared to the GRU model in related technologies, pre-trained language sub-models, as temporal prediction models, have higher training and inference speeds, improving the training efficiency of the interest point prediction model and the efficiency of subsequent interest point predictions.
[0117] For example, Figure 7 This diagram illustrates a flowchart of a method for training an initial interest point prediction model to obtain a target interest point prediction model, as shown in an exemplary embodiment of this disclosure. (See reference...) Figure 7 The method may include steps S710 to S730. Wherein:
[0118] In step S710, the knowledge graph embedding sub-model in the initial interest point prediction model is trained based on the knowledge triples and the first loss function.
[0119] For example, one specific implementation of step S710 may include: determining knowledge triplet sample pairs based on the knowledge triplet, wherein the knowledge triplet sample pairs include positive samples and negative samples; initializing the head entity, tail entity, and relation of each knowledge triplet sample in the knowledge triplet sample pair to obtain the head entity vector corresponding to the head entity, the tail entity vector corresponding to the tail entity, and the relation vector corresponding to the relation; mapping the head entity vector and the tail entity vector to the relation space according to a preset projection matrix to obtain the relation space head entity vector and the relation space tail entity vector; for any knowledge For triple samples, a virtual score is determined based on the head entity vector, relation vector, and tail entity vector of the relation space corresponding to the knowledge triple sample. The value of a first loss function is determined based on the virtual scores of the positive and negative samples in the knowledge triple sample pair. Training is performed based on the value of the first loss function to obtain the knowledge graph embedding sub-model in the initial interest point prediction model. Specifically, the head entities and relations of the positive and negative samples in the knowledge triple sample pair are the same, and the tail entities of the positive and negative samples in the knowledge triple sample pair belong to different entities of the same category.
[0120] For example, after determining the knowledge graph embedding sub-model in the initial interest point prediction model through steps S310 to S350, the knowledge graph embedding sub-model in the initial interest point prediction model can be fine-tuned and trained based on the knowledge triples generated in step S220. This allows for joint training of the knowledge graph embedding sub-model and the pre-trained language sub-model based on the historical interest point sequence obtained in step S210, thereby improving the accuracy of model prediction.
[0121] The specific training process of the knowledge graph embedding sub-model has been described in detail in the foregoing embodiments and will not be repeated here.
[0122] In step S720, the pre-trained language sub-model in the initial interest point prediction model is trained based on the first vector sequence and the second loss function.
[0123] In one exemplary implementation, the pre-trained language sub-model includes a BERT (Bidirectional Encoder Representations from Transformer) model.
[0124] For example, one specific implementation of step S720 may include: dividing the first vector sequence according to a preset number window to generate multiple first vector sub-sequences, each first vector sub-sequence including n vectors; using the sequence of the first n-1 vectors in each first vector sub-sequence as an input sample, and the nth vector in each first vector sub-sequence as the label of the input sample; inputting the input sample into the pre-trained language sub-model in the initial interest point prediction model to obtain the predicted value of the input sample; determining the value of the second loss function based on the predicted value of the input sample and the label of the input sample, and training the pre-trained language sub-model in the initial interest point prediction model based on the value of the second loss function.
[0125] For example, the first vector sequence can be divided to generate multiple first vector subsequences, such as [[poi_1,poi_2,…,poi_n],[poi_2,poi_3,…,poi_n+1],[poi_3,poi_4,…,poi_n+2]]. The input samples for the BERT model are [[poi_1,poi_2,…,poi_n-1],[poi_2,poi_3,…,poi_n],[poi_3,poi_4,…,poi_n+1]], and the labels for the input samples are y = [poi_n,poi_n+1,poi_n+2]. That is, for each first vector subsequence, its nth vector can be masked, thus using the nth vector as the label. Based on the vector sequence composed of the first n-1 vectors, the nth vector can be predicted.
[0126] In one exemplary implementation, the second loss function can be determined by the following formula (3).
[0127]
[0128] In formula (3), y is the predicted value of the input sample, y^ is the label value of the input sample, and N is the number of POIs. For example, if POI prediction is performed for users in a certain city, then N can be the total number of POIs in that city. That is, the value of the second loss function can be determined based on the cross-entropy loss between the predicted value and the label value of the input sample.
[0129] For example, one specific implementation of step S720 may include: randomly masking any vector in the first vector sequence; determining an input sample based on a vector subsequence composed of vectors preceding the masked vector; determining the label of the input sample based on the masked vector; inputting the input sample into a pre-trained language sub-model in the initial interest point prediction model to obtain a predicted value for the input sample; determining the value of a second loss function based on the predicted value and the label of the input sample; and training the pre-trained language sub-model in the initial interest point prediction model based on the value of the second loss function.
[0130] For example, based on the BERT model's mask mechanism, any vector in the first vector sequence can be randomly masked, thereby predicting the given vector based on the vector sequence formed by the vectors preceding that vector, in order to train the BERT model.
[0131] For example, another specific implementation of step S720 can be as follows: Figure 8 As shown. Reference Figure 8 , Figure 8This diagram illustrates a method for training a pre-trained language sub-model according to an exemplary embodiment of the present disclosure. The method may include steps S810 to S830. Specifically: in step S810, a second vector corresponding to the user's identifier is obtained based on the knowledge graph embedding sub-model in the initial interest point prediction model; in step S820, the user's second vector is used as the classification embedding vector of the pre-trained language sub-model, and the first vector sequence corresponding to the user's historical interest point access sequence is used as the input vector sequence of the pre-trained language sub-model; in step S830, the pre-trained language sub-model in the initial interest point prediction model is trained based on the classification embedding vector, the input vector sequence, and the second loss function.
[0132] In this context, the classification embedding vector can be understood as the [CLS] character vector in the BERT model. The BERT model adds a [CLS] flag before the sentence, and the vector corresponding to this flag in the last layer can serve as the semantic representation of the entire sentence, thus enabling its use in downstream classification tasks.
[0133] In step S730, if the value of the target loss function is less than or equal to a preset value, a target interest point prediction model is obtained.
[0134] In this disclosure, a knowledge graph embedding sub-model and a pre-trained language sub-model can be jointly modeled. The overall loss function of the joint modeling is determined by a first loss function and a second loss function. The initial interest point prediction model is then trained with the overall loss function as the optimization objective to obtain the target interest point prediction model.
[0135] In one exemplary implementation, the target loss function can be determined by the following formula (4).
[0136] Loss = Loss kg +βLoss poi (4)
[0137] Here, the hyperparameter β is the adjustment coefficient for the first and second loss functions, which can be adjusted according to the data. Its function is to ensure that the values of the first and second loss functions are on the same order of magnitude. During model training, the model parameters are updated using gradient descent to optimize the joint loss of the knowledge graph embedding sub-model and the pre-trained language sub-model, i.e., the target loss function.
[0138] Furthermore, weights can be set for the first and second loss functions to determine the target loss function. For example, the target loss function can be the product of the first and second products. The first product is the product of the first loss function and the first weight, and the second product is the product of the second loss function and the second weight. The first and second weights can be set according to requirements, experience, or the confidence levels of the two sub-models; this exemplary implementation does not impose any special limitations on this.
[0139] For example, in this disclosure, a user's historical interest point access sequence can be obtained. Through the knowledge graph embedding sub-model in the initial interest point prediction model, the user's identifier and vector representations of interest points in the historical interest point access sequence are obtained to generate a vector representation sequence for each user. This vector representation sequence is then input into the BERT model to learn the temporal features between interest points. Finally, the first output vector T of the last layer of the BERT model is taken. H Connect a fully connected layer, then connect a multi-classification layer, such as... Figure 6 The softmax layer in the algorithm outputs neurons with a dimension equal to the total number of points of interest (POIs). For example, to predict the POIs of users in a specific city, the output neurons of the softmax layer could have a dimension equal to the total number of POIs in that city. Then, the POI with the highest probability is selected as the predicted POI.
[0140] The value of the second loss function is determined based on the predicted POI and the real POI. Simultaneously, the value of the first loss function is determined using the virtual scores of positive and negative samples in the knowledge triplet sample pairs generated for each historical interest point sequence, according to formula (2) above. Then, based on the values of the first and second loss functions, the value of the target loss function is determined using formula (4) above. The training objective is to optimize the target loss function, i.e., to reduce the value of the target loss function. Training continues until the value of the target loss function is less than or equal to a certain preset value, at which point training stops. Then, the prediction accuracy of the currently obtained interest point prediction model is tested using test samples. If the predicted accuracy obtained from the test is greater than a preset value that meets the prediction requirements, the currently trained interest point prediction model can be determined as the target interest point prediction model.
[0141] During training, the [CLS] character in the BERT model can be replaced with the user identifier, such as... Figure 6 The [User] keyword allows for training using the user identifier and the user's historical interest access sequences. This enables the learning of long-term user behavioral characteristics, while the first vector subsequence described above can be used to learn short-term user behavioral characteristics. By combining these long-term and short-term behavioral characteristics, the accuracy of the model's predictions can be improved.
[0142] Figure 6 In the BERT model, [SEP] is a clause segmentation symbol used to separate two sentences in the input corpus during natural language processing. In this disclosure, [SEP] can be used to separate the historical interest point access sequences of different users, enabling model training based on the historical interest point access sequences of multiple users within a preset region (such as a city or province). The trained target interest point prediction model can then be used to predict the interest points of any user within the preset region.
[0143] In one exemplary implementation, the word vector encoding of the BERT model can be replaced with a first vector sequence to train the initial point of interest prediction model. In another exemplary implementation, the BERT model can also take on multiple types of data as input, i.e., additional information about the POI can be added to the input, such as visit time (replacing the BERT's location encoding), POI category, POI region, etc., thereby predicting the POI based on multiple types of information to further improve the accuracy of the model's predictions.
[0144] In this disclosure, a POI knowledge graph is constructed based on knowledge graphs and joint time-series data modeling, alleviating the data sparsity problem in the modeling process. Building upon this, the BERT model is used to adjust the relevant input structure, jointly training long-term user habit features and short-term state representations to improve the model's inference speed and prediction accuracy.
[0145] In other words, on the one hand, this disclosure, based on a knowledge graph embedding sub-model, can enhance interest points with low user access frequency, alleviating the data sparsity problem of user access to interest points and improving the prediction accuracy of the interest point prediction model; on the other hand, this disclosure combines the knowledge graph embedding sub-model and the pre-trained language sub-model, and jointly trains the knowledge graph embedding sub-model and the pre-trained language sub-model by constructing a target loss function. The knowledge graph embedding sub-model can learn the vector representation of the input data, and the pre-trained language sub-model can effectively encode the user's long-term habit features, thereby further improving the prediction accuracy. Moreover, the pre-trained language sub-model can improve the inference speed of the interest point prediction model, thereby improving the prediction efficiency of the model.
[0146] Next, Figure 9 A flowchart illustrating an exemplary embodiment of the point of interest prediction method in this disclosure is shown. (Reference) Figure 9 The method may include steps S910 to S930. Wherein:
[0147] In step S910, the target historical points of interest access sequence of the user to be predicted before the current time is obtained.
[0148] For example, you can obtain n-1 historical points of interest of a user before the current moment, and then generate a target historical point of interest access sequence.
[0149] In step S920, based on the knowledge graph embedding sub-model in the target interest point prediction model, the third vector corresponding to each target historical interest point in the target historical interest point access sequence is obtained, so as to generate the third vector sequence corresponding to the historical interest point access sequence.
[0150] The vector representation of each interest point in the target historical interest point access sequence can be found in the knowledge graph embedding sub-model in the target interest point prediction model to obtain the third vector sequence.
[0151] In step S930, the third vector sequence is input into the pre-trained language sub-model in the target interest point prediction model to obtain the next interest point of the user to be predicted.
[0152] The target interest point prediction model is obtained according to the method for determining the interest point prediction model described above, which is the target interest point prediction model obtained in step S240 above. Further details will not be provided here.
[0153] The method for determining the point of interest prediction model and the method for predicting point of interest in this disclosure can be used to recommend information to users, such as recommending relevant information about the next point of interest that the user is expected to reach.
[0154] It should be noted that the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0155] Figure 10 This diagram illustrates the composition of an apparatus for determining an interest point prediction model in an exemplary embodiment of the present disclosure. The interest point prediction model includes a knowledge graph embedding sub-model and a pre-trained language sub-model. (Reference) Figure 10 The device 1000 includes: a first acquisition module 1010, a knowledge triple generation module 1020, a first vector sequence generation module 1030, and a training module 1040. Wherein:
[0156] The first acquisition module 1010 is configured to acquire the user's historical interest point access sequence;
[0157] The knowledge triple generation module 1020 is configured to generate a knowledge triple corresponding to each historical point of interest in the historical point of interest access sequence.
[0158] The first vector sequence generation module 1030 is configured to obtain the first vector of each historical interest point in the historical interest point access sequence based on the knowledge graph embedding sub-model in the initial interest point prediction model, so as to generate a first vector sequence based on the first vector of each historical interest point in the historical interest point access sequence.
[0159] The training module 1040 is configured to train the initial interest point prediction model based on the knowledge triples, the first vector sequence, and the target loss function to obtain the target interest point prediction model.
[0160] Wherein, the knowledge triplet is the input of the knowledge graph embedding sub-model in the initial interest point prediction model, the first vector sequence is the input of the pre-trained language sub-model in the initial interest point prediction model, and the target loss function is determined based on the first loss function of the knowledge graph embedding sub-model and the second loss function of the pre-trained language sub-model.
[0161] In one exemplary implementation, based on the foregoing embodiments, the training module 1040 may be specifically configured to: train the knowledge graph embedding sub-model in the initial interest point prediction model based on the knowledge triples and the first loss function; train the pre-trained language sub-model in the initial interest point prediction model based on the first vector sequence and the second loss function; and obtain the target interest point prediction model when the value of the target loss function is less than or equal to a preset value.
[0162] In one exemplary implementation, based on the foregoing embodiments, training the pre-trained language sub-model in the initial interest point prediction model based on the first vector sequence and the second loss function includes: dividing the first vector sequence according to a preset number window to generate multiple first vector sub-sequences, each first vector sub-sequence including n vectors; using the sequence of the first n-1 vectors in each first vector sub-sequence as an input sample, and the nth vector in each first vector sub-sequence as the label of the input sample; inputting the input sample into the pre-trained language sub-model in the initial interest point prediction model to obtain the predicted value of the input sample; determining the value of the second loss function based on the predicted value of the input sample and the label of the input sample, and training the pre-trained language sub-model in the initial interest point prediction model based on the value of the second loss function.
[0163] In one exemplary implementation, based on the foregoing embodiments, training the pre-trained language sub-model in the initial interest point prediction model based on the first vector sequence and the second loss function includes: randomly masking any vector in the first vector sequence; determining an input sample based on a vector sub-sequence composed of vectors preceding the masked vector; determining the label of the input sample based on the masked vector; inputting the input sample into the pre-trained language sub-model in the initial interest point prediction model to obtain a predicted value for the input sample; determining the value of the second loss function based on the predicted value and the label of the input sample, and training the pre-trained language sub-model in the initial interest point prediction model based on the value of the second loss function.
[0164] In one exemplary implementation, based on the foregoing embodiments, training the pre-trained language sub-model in the initial interest point prediction model based on the first vector sequence and the second loss function includes: obtaining a second vector corresponding to the user's user identifier according to the knowledge graph embedding sub-model in the initial interest point prediction model; using the user's second vector as the classification embedding vector of the pre-trained language sub-model, and using the first vector sequence corresponding to the user's historical interest point access sequence as the input vector sequence of the pre-trained language sub-model; and training the pre-trained language sub-model in the initial interest point prediction model based on the classification embedding vector, the input vector sequence, and the second loss function.
[0165] In one exemplary implementation, based on the foregoing embodiments, the knowledge triples are composed of head entities, relations, and tail entities; the step of training the knowledge graph embedding sub-model in the initial interest point prediction model based on the knowledge triples and the first loss function includes: determining knowledge triple sample pairs based on the knowledge triples, wherein each knowledge triple sample pair includes positive and negative samples; initializing the head entity, tail entity, and relation of each knowledge triple sample in the knowledge triple sample pair to obtain the head entity vector corresponding to the head entity, the tail entity vector corresponding to the tail entity, and the relation vector corresponding to the relation; and mapping the head entity vector and the tail entity vector to a preset projection matrix. The relation space is accessed to obtain the head entity vector and tail entity vector of the relation space. For any knowledge triple sample, the virtual score of the knowledge triple sample is determined based on the head entity vector, relation vector, and tail entity vector of the relation space corresponding to the knowledge triple sample. The value of the first loss function is determined based on the virtual scores of the positive and negative samples in the knowledge triple sample pair. Training is performed based on the value of the first loss function to obtain the knowledge graph embedding sub-model in the initial interest point prediction model. Wherein, the head entities and relations of the positive and negative samples in the knowledge triple sample pair are the same, and the tail entities of the positive and negative samples in the knowledge triple sample pair belong to different entities of the same category.
[0166] In one exemplary implementation, based on the foregoing embodiments, the knowledge triple generation module 1020 can be specifically configured to: for each historical point of interest in each user's historical point of interest access sequence, generate a knowledge triple corresponding to the historical point of interest based on the user's user identifier, the user's access time to the historical point of interest, and the identifier of the historical point of interest.
[0167] In one exemplary implementation, based on the foregoing embodiments, the determination method of the knowledge graph embedding sub-model in the initial interest point prediction model includes: obtaining the user's accessed interest points and access time information of the user's access to the interest points based on the terminal device used by the user; generating positive samples of knowledge triples based on the user's accessed interest points and access time information of the accessed interest points, wherein the positive samples of knowledge triples are determined based on head entities, relations, and tail entities, the head entity or tail entity in the positive samples of knowledge triples includes the interest points, and the relations in the positive samples of knowledge triples include the access time information; for each positive sample of knowledge triples, replacing the tail entity in the positive samples of knowledge triples with other entities of the same category to generate a negative sample of knowledge triples corresponding to the positive samples of knowledge triples; for each positive sample of knowledge triples, determining a knowledge triple sample pair based on the positive samples of knowledge triples and the negative samples of knowledge triples corresponding to the positive samples of knowledge triples; and training based on the knowledge triple sample pairs to obtain the knowledge graph embedding sub-model in the initial interest point prediction model.
[0168] In one exemplary implementation, based on the foregoing embodiments, the head or tail entity in the positive sample of the knowledge triple further includes one or more of the following: user identifier, first-level category to which the user's accessed point of interest belongs, second-level category to which the user's accessed point of interest belongs, third-level category to which the user's accessed point of interest belongs, urban functional area category to which the user's accessed point of interest belongs, and road to which the user's accessed point of interest belongs; the relationships in the positive sample of the knowledge triple further include one or more of the following: friend relationship between users, kinship relationship between users, time conversion relationship between points of interest, distance conversion relationship between points of interest, membership relationship between a point of interest and its third-level category, first subordinate relationship between each level of categories of points of interest, and second subordinate relationship between a point of interest and its road or urban functional area category; wherein, the time conversion relationship between points of interest is determined according to the duration level of the average transfer time when multiple users move between points of interest; the distance conversion relationship between points of interest is determined according to the distance level of the distance between points of interest.
[0169] In one exemplary implementation, based on the foregoing embodiments, the step of training based on the knowledge triplet sample pairs to obtain the knowledge graph embedding sub-model in the initial interest point prediction model includes: initializing the head entity, tail entity, and relation in each knowledge triplet of the knowledge triplet sample pair to obtain the head entity vector corresponding to the head entity, the tail entity vector corresponding to the tail entity, and the relation vector corresponding to the relation; mapping the head entity vector and the tail entity vector to the relation space according to a preset projection matrix to obtain the relation space head entity vector and the relation space tail entity vector; determining the virtual score of the knowledge triplet sample for any knowledge triplet sample based on the relation space head entity vector, relation vector, and relation space tail entity vector corresponding to the knowledge triplet sample; determining the value of a first loss function based on the virtual scores of the positive and negative knowledge triplet samples in each knowledge triplet sample pair; and training based on the value of the first loss function to obtain the knowledge graph embedding sub-model in the initial interest point prediction model.
[0170] Figure 11 This diagram illustrates the composition of an interest point prediction apparatus in an exemplary embodiment of the present disclosure, with reference to... Figure 11 The device may include a second acquisition module 1110, a third vector generation module 1120, and an interest point prediction module 1130. Wherein:
[0171] The second acquisition module 1110 is configured to acquire the target historical interest point access sequence of the user to be predicted before the current moment;
[0172] The third vector sequence generation module 1120 is configured to obtain the third vector corresponding to each target historical interest point in the target historical interest point access sequence based on the knowledge graph embedding sub-model in the target interest point prediction model, so as to generate the third vector sequence corresponding to the historical interest point access sequence.
[0173] The interest point prediction module 1130 is configured to input the third vector sequence into the pre-trained language sub-model in the target interest point prediction model to obtain the next interest point of the user to be predicted.
[0174] The target interest point prediction model is obtained according to the above-described method for determining the interest point prediction model.
[0175] The specific details of each module in the above-mentioned device have been described in detail in the method section of the implementation. For any undisclosed details, please refer to the implementation content of the method section, and therefore will not be repeated here.
[0176] Exemplary embodiments of this disclosure also provide an electronic device for performing the above-described method for determining and / or predicting interest points using a prediction model. This electronic device may be the aforementioned terminal 110. Generally, the electronic device may include a processor and a memory, the memory storing executable instructions of the processor, and the processor configured to perform the above-described method for determining and / or predicting interest points using the executable instructions.
[0177] The following is based on Figure 12 Taking the mobile terminal 1200 as an example, the construction of this electronic device will be described by way of example. Those skilled in the art will understand that, apart from components specifically designed for mobile purposes, Figure 12 The structure can also be applied to fixed types of equipment.
[0178] like Figure 12 As shown, the mobile terminal 1200 may specifically include: a processor 1201, a memory 1202, a bus 1203, a mobile communication module 1204, an antenna 1, a wireless communication module 1205, an antenna 2, a display screen 1206, a camera module 1207, an audio module 1208, a power module 1209, a sensor module 1210, and a positioning module 1211.
[0179] The processor 1201 may include one or more processing units, such as an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit).
[0180] The processor 1201 can be connected to the memory 1202 or other components via the bus 1203.
[0181] The memory 1202 can be used to store computer executable program code, which includes instructions. The processor 1201 executes various functional applications and data processing of the mobile terminal 1200 by running the instructions stored in the memory 1202. The memory 1202 can also store application data, such as images, videos, and other files.
[0182] The communication function of mobile terminal 1200 can be implemented through mobile communication module 1204, antenna 1, wireless communication module 1205, antenna 2, modem processor, and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Mobile communication module 1204 can provide 2G, 3G, 4G, and 5G mobile communication solutions for mobile terminal 1200. Wireless communication module 1205 can provide wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication for mobile terminal 1200.
[0183] The display screen 1206 is used to implement display functions, such as displaying the user interface, images, and videos. The camera module 1207 is used to implement shooting functions, such as capturing images and videos. The audio module 1208 is used to implement audio functions, such as playing audio and capturing voice. The power module 1209 is used to implement power management functions, such as charging the battery, supplying power to the device, and monitoring battery status. The sensor module 1210 may include a depth sensor 12101, a pressure sensor 12102, a gyroscope sensor 12103, and a barometric pressure sensor 12104, etc., to implement corresponding sensing and detection functions. The positioning module 1211 can determine the current location information of the mobile terminal 1200 based on satellite positioning.
[0184] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."
[0185] Exemplary embodiments of this disclosure also provide a computer-readable storage medium storing a program product capable of implementing the methods described above. In some possible embodiments, various aspects of this disclosure can also be implemented as a program product including program code that, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure, such as executing... Figure 2 Any one or more steps in the process.
[0186] The computer-readable medium disclosed herein may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0187] In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.
[0188] Furthermore, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0189] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0190] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for determining an interest point prediction model, characterized in that, The interest point prediction model includes a knowledge graph embedding sub-model and a pre-trained language sub-model, and the method includes: Obtain the user's historical access sequence of points of interest; For each historical point of interest in the historical point of interest access sequence, generate a knowledge triple corresponding to the historical point of interest. Based on the knowledge graph embedding sub-model in the initial interest point prediction model, the first vector of each historical interest point in the historical interest point access sequence is obtained, so as to generate a first vector sequence based on the first vector of each historical interest point in the historical interest point access sequence. The initial interest point prediction model is trained based on the knowledge triples, the first vector sequence, and the target loss function to obtain the target interest point prediction model. Wherein, the knowledge triplet is the input of the knowledge graph embedding sub-model in the initial interest point prediction model, the first vector sequence is the input of the pre-trained language sub-model in the initial interest point prediction model, and the target loss function is determined based on the first loss function of the knowledge graph embedding sub-model and the second loss function of the pre-trained language sub-model.
2. The method for determining the point of interest prediction model according to claim 1, characterized in that, The step of training the initial interest point prediction model based on the knowledge triples, the first vector sequence, and the target loss function to obtain the target interest point prediction model includes: The knowledge graph embedding sub-model in the initial interest point prediction model is trained based on the knowledge triples and the first loss function; The pre-trained language sub-model in the initial interest point prediction model is trained based on the first vector sequence and the second loss function. When the value of the target loss function is less than or equal to a preset value, a target interest point prediction model is obtained.
3. The method for determining the point of interest prediction model according to claim 2, characterized in that, The step of training the pre-trained language sub-model in the initial interest point prediction model based on the first vector sequence and the second loss function includes: The first vector sequence is divided according to a preset number window to generate multiple first vector subsequences, each of which includes n vectors; The sequence consisting of the first n-1 vectors in each of the first vector subsequences is used as the input sample, and the nth vector in each of the first vector subsequences is used as the label of the input sample; The input sample is input into the pre-trained language sub-model in the initial interest point prediction model to obtain the predicted value of the input sample; The value of the second loss function is determined based on the predicted value and the label of the input sample, and the pre-trained language sub-model in the initial interest point prediction model is trained based on the value of the second loss function.
4. The method for determining the point of interest prediction model according to claim 2, characterized in that, The step of training the pre-trained language sub-model in the initial interest point prediction model based on the first vector sequence and the second loss function includes: Randomly cover any vector in the first vector sequence, determine the input sample based on the vector subsequence formed by the vectors preceding the covered vector, and determine the label of the input sample based on the covered vector. The input sample is input into the pre-trained language sub-model in the initial interest point prediction model to obtain the predicted value of the input sample; The value of the second loss function is determined based on the predicted value and the label of the input sample, and the pre-trained language sub-model in the initial interest point prediction model is trained based on the value of the second loss function.
5. The method for determining the point of interest prediction model according to claim 2, characterized in that, The step of training the pre-trained language sub-model in the initial interest point prediction model based on the first vector sequence and the second loss function includes: The second vector corresponding to the user's user identifier is obtained from the knowledge graph embedding sub-model in the initial interest point prediction model; The user's second vector is used as the classification embedding vector of the pre-trained language sub-model, and the first vector sequence corresponding to the user's historical interest point access sequence is used as the input vector sequence of the pre-trained language sub-model. The pre-trained language sub-model in the initial interest point prediction model is trained based on the classification embedding vector, the input vector sequence, and the second loss function.
6. The method for determining the point of interest prediction model according to claim 2, characterized in that, The knowledge triple is composed of a head entity, a relation, and a tail entity; The step of training the knowledge graph embedding sub-model in the initial interest point prediction model based on the knowledge triples and the first loss function includes: Based on the knowledge triples, knowledge triple sample pairs are determined, and the knowledge triple sample pairs include positive samples and negative samples; The head entity, tail entity, and relation of each knowledge triple sample in the knowledge triple sample pair are initialized respectively to obtain the head entity vector corresponding to the head entity, the tail entity vector corresponding to the tail entity, and the relation vector corresponding to the relation. According to the preset projection matrix, the head entity vector and the tail entity vector are mapped to the relation space respectively to obtain the relation space head entity vector and the relation space tail entity vector. For any knowledge triple sample, the virtual score of the knowledge triple sample is determined based on the head entity vector, relation vector, and tail entity vector of the relation space corresponding to the knowledge triple sample. The value of the first loss function is determined based on the virtual scores of the positive and negative samples in the knowledge triplet sample pairs. Training is performed based on the value of the first loss function to obtain the knowledge graph embedding sub-model in the initial interest point prediction model; In this context, the positive and negative samples in the knowledge triplet sample pair have the same head entity and relation, and the tail entities of the positive and negative samples in the knowledge triplet sample pair belong to different entities of the same category.
7. The method for determining the point of interest prediction model according to any one of claims 1 to 6, characterized in that, The step of generating a knowledge triple corresponding to each historical point of interest in the historical point of interest access sequence includes: For each historical point of interest in each user's historical point of interest access sequence, a knowledge triplet corresponding to the historical point of interest is generated based on the user's user identifier, the user's access time to the historical point of interest, and the identifier of the historical point of interest.
8. The method for determining the point of interest prediction model according to claim 1, characterized in that, The method for determining the knowledge graph embedding sub-model in the initial interest point prediction model includes: Based on the terminal device used by the user, obtain the user's access points of interest and the access time information of the user's access points of interest; Based on the user's access to points of interest and the access time information of the access to the points of interest, a positive sample of knowledge triples is generated. The positive sample of knowledge triples is determined based on a head entity, a relation, and a tail entity. The head entity or tail entity in the positive sample of knowledge triples includes the points of interest, and the relation in the positive sample of knowledge triples includes the access time information. For each positive knowledge triplet sample, the tail entity in the positive knowledge triplet sample is replaced with another entity of the same category to generate a negative knowledge triplet sample corresponding to the positive knowledge triplet sample. For each positive knowledge triplet sample, a knowledge triplet sample pair is determined based on the positive knowledge triplet sample and the corresponding negative knowledge triplet sample. The knowledge graph embedding sub-model in the initial interest point prediction model is obtained by training based on the knowledge triple sample pairs.
9. The method for determining the point of interest prediction model according to claim 8, characterized in that, The head or tail entities in the positive sample of the knowledge triple also include one or more of the following: user identifier, first-level category to which the user's accessed point of interest belongs, second-level category to which the user's accessed point of interest belongs, third-level category to which the user's accessed point of interest belongs, urban functional area category to which the user's accessed point of interest belongs, and road to which the user's accessed point of interest belongs. The relationships in the positive samples of the knowledge triples also include: friend relationships between users, kinship relationships between users, time conversion relationships between points of interest, distance conversion relationships between points of interest, membership relationships between points of interest and the third-level categories to which the points of interest belong, first subordinate relationships between the categories of points of interest, and second subordinate relationships between points of interest and the road or urban functional area categories to which the points of interest belong; one or more of these relationships. The time conversion relationship between the points of interest is determined based on the duration level of the average transfer time when multiple users move between the points of interest; the distance conversion relationship between the points of interest is determined based on the distance level of the distance between the points of interest.
10. The method for determining the point of interest prediction model according to claim 8, characterized in that, The step of training based on the knowledge triplet sample pairs to obtain the knowledge graph embedding sub-model in the initial interest point prediction model includes: The head entity, tail entity, and relation in each knowledge triple sample pair are initialized to obtain the head entity vector corresponding to the head entity, the tail entity vector corresponding to the tail entity, and the relation vector corresponding to the relation. According to the preset projection matrix, the head entity vector and the tail entity vector are mapped to the relation space respectively to obtain the relation space head entity vector and the relation space tail entity vector. For any knowledge triple sample, the virtual score of the knowledge triple sample is determined based on the head entity vector, relation vector, and tail entity vector of the relation space corresponding to the knowledge triple sample. The value of the first loss function is determined based on the virtual scores of the positive and negative samples of the knowledge triplet in each knowledge triplet sample pair. Training is performed based on the value of the first loss function to obtain the knowledge graph embedding sub-model in the initial interest point prediction model.
11. A method for predicting points of interest, characterized in that, include: Obtain the target historical points of interest access sequence of the user to be predicted before the current moment; Based on the knowledge graph embedding sub-model in the target interest point prediction model, the third vector corresponding to each target historical interest point in the target historical interest point access sequence is obtained, so as to generate the third vector sequence corresponding to the historical interest point access sequence. The third vector sequence is input into the pre-trained language sub-model in the target interest point prediction model to obtain the next interest point of the user to be predicted. The target interest point prediction model is obtained according to the method for determining the interest point prediction model according to any one of claims 1 to 10.
12. A device for determining an interest point prediction model, characterized in that, The interest point prediction model includes a knowledge graph embedding sub-model and a pre-trained language sub-model, and the device includes: The first acquisition module is configured to acquire the user's historical access sequence of points of interest; The knowledge triple generation module is configured to generate a knowledge triple corresponding to each historical point of interest in the historical point of interest access sequence. The first vector sequence generation module is configured to obtain the first vector of each historical interest point in the historical interest point access sequence based on the knowledge graph embedding sub-model in the initial interest point prediction model, so as to generate a first vector sequence based on the first vector of each historical interest point in the historical interest point access sequence. The training module is configured to train the initial interest point prediction model based on the knowledge triples, the first vector sequence, and the target loss function to obtain the target interest point prediction model. Wherein, the knowledge triplet is the input of the knowledge graph embedding sub-model in the initial interest point prediction model, the first vector sequence is the input of the pre-trained language sub-model in the initial interest point prediction model, and the target loss function is determined based on the first loss function of the knowledge graph embedding sub-model and the second loss function of the pre-trained language sub-model.
13. An interest point prediction device, characterized in that, include: The second acquisition module is configured to acquire the target historical points of interest access sequence of the user to be predicted before the current moment; The third vector sequence generation module is configured to obtain the third vector corresponding to each target historical interest point in the target historical interest point access sequence based on the knowledge graph embedding sub-model in the target interest point prediction model, so as to generate the third vector sequence corresponding to the historical interest point access sequence. The interest point prediction module is configured to input the third vector sequence into the pre-trained language sub-model in the target interest point prediction model to obtain the next interest point of the user to be predicted. The target interest point prediction model is obtained according to the method for determining the interest point prediction model according to any one of claims 1 to 10.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 11.
15. An electronic device, characterized in that, include: One or more processors; as well as A memory for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the method as described in any one of claims 1 to 11.
Citation Information
Patent Citations
Interest point label optimization method and device, electronic equipment and computer readable medium
CN111310074A
Conversational interest point recommendation method and device, electronic equipment and storage medium
CN112925893A