Recommendation model training method, post recommendation method and computer equipment
Through weighted comparison learning and nearest neighbor method, the problem of inaccurate recommendations in person-position matching is solved, more comprehensive similarity measurement and personalized recommendation are achieved, and the accuracy and efficiency of person-position matching is improved.
Patent Information
- Application Number
- CN202410746008.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-12-17
AI Technical Summary
The existing personnel matching technology has the problem of inaccurate recommendations, especially the difficulty in capturing subtle differences in user interests and ignoring context information, resulting in a lack of personalization of recommendation results and insufficient similarity measurement.
The person-job matching method based on weighted comparison learning is adopted, and the nearest neighbor samples of the positive sample are obtained through the nearest neighbor method, the sample similarity and sample weight are calculated, the training samples are generated, the data information is enhanced, and the accuracy and training efficiency of the recommended model are improved.
A more comprehensive similarity measurement is achieved, the accuracy and personalization of the recommendation model are enhanced, and the accuracy and efficiency of person-position matching are improved.
Smart Images

Figure CN119151492A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a training method for a recommendation model, a job recommendation method, and a computer device. Background Art
[0002] Person-job matching refers to the process of matching the applicant's abilities and experience with the job requirements during the recruitment process to determine the most suitable candidate. Person-job matching plays a key role in the field of human resource management and recruitment, helping companies find the most suitable talents and also helping job seekers find the most suitable positions for themselves. Summary of the invention
[0003] The present application provides a recommendation model training method, a job recommendation method and a computer device to solve the problem of inaccurate recommendations.
[0004] In a first aspect, the present application provides a training method for a recommendation model, comprising:
[0005] Determine the nearest neighbor samples of the positive samples;
[0006] Determine the neighbor sample with the smallest similarity to the positive sample among the neighbor samples as a negative sample;
[0007] Determining a sample similarity between the positive sample and the negative sample and a sample weight of the positive sample and the negative sample;
[0008] Determine a first loss according to the sample similarity and the sample weight;
[0009] Determine a second loss according to the positive sample;
[0010] The recommendation model is trained according to the first loss and the second loss.
[0011] In a second aspect, the present application provides a job recommendation method, comprising:
[0012] Obtaining user characteristics of the user and job characteristics of the job;
[0013] The user characteristics and the job characteristics are input into a recommendation model for prediction, and a job recommendation result for the user is output. The recommendation model is trained according to the method described in the first aspect and any possible design of the first aspect.
[0014] In a third aspect, the present application provides a training device for a recommendation model, comprising:
[0015] An acquisition module is used to determine the neighboring samples of the positive sample; determine the neighboring sample with the smallest similarity to the positive sample among the neighboring samples as a negative sample; determine the sample similarity between the positive sample and the negative sample and the sample weights of the positive sample and the negative sample;
[0016] A training module is used to determine a first loss according to the sample similarity and the sample weight; determine a second loss according to the positive sample; and train a recommendation model according to the first loss and the second loss.
[0017] In a fourth aspect, the present application provides a job recommendation device, comprising:
[0018] An acquisition module, used to acquire user characteristics of users and job characteristics of jobs;
[0019] A recommendation module is used to input the user characteristics and the job characteristics into a recommendation model for prediction and output the job recommendation result for the user. The recommendation model is trained according to the method described in the first aspect and any possible design of the first aspect.
[0020] In a fifth aspect, the present application provides a computer device, including: a memory and a processor;
[0021] The memory is used to store computer programs; the processor is used to execute the training method of the recommendation model in the first aspect and any possible design of the first aspect, and the job recommendation method in the second aspect and any possible design of the second aspect according to the computer programs stored in the memory.
[0022] In a sixth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program includes program instructions, and when the program instructions are executed by at least one processor of a computer device, the computer device executes the training method of the recommendation model in the first aspect and any possible design of the first aspect, and the job recommendation method in the second aspect and any possible design of the second aspect.
[0023] In the seventh aspect, the present application provides a computer program product, which includes computer program code. When at least one processor of a computer device executes the computer program code, the computer device executes the training method of the recommendation model in the first aspect and any possible design of the first aspect, and the job recommendation method in the second aspect and any possible design of the second aspect.
[0024] The present application provides a training method for a recommendation model, a job recommendation method and a computer device. The present application obtains the nearest neighbor samples of the positive sample, and selects the nearest neighbor sample with the smallest similarity to the positive sample from the nearest neighbor samples as the negative sample corresponding to the positive sample. In the generation process of the training sample, the nearest neighbor method is introduced to make up for the problem of incomplete information, so that the positive sample and the negative sample are contrasted, and data enhancement is achieved. The present application calculates the first loss by calculating the sample similarity between the positive sample and the negative sample and the sample weights of the positive sample and the negative sample. At the same time, the present application can also use the positive sample to calculate the second loss. The present application uses the first loss and the second loss to achieve the training of the recommendation model. The use of the first loss and the second loss in the training of the recommendation model improves the recommendation accuracy of the recommendation model and the training efficiency of the recommendation model. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0026] Figure 1 A training flow chart of a recommendation model provided in one embodiment of the present application;
[0027] Figure 2 A data preprocessing flow chart of a recommendation model provided in an embodiment of the present application;
[0028] Figure 3 A model training flow chart of a recommendation model provided in one embodiment of the present application;
[0029] Figure 4 A flowchart of job recommendation provided for an embodiment of the present application;
[0030] Figure 5 A schematic diagram of the structure of a training device for a recommendation model provided in one embodiment of the present application;
[0031] Figure 6 A schematic diagram of the structure of a job recommendation device provided in one embodiment of the present application;
[0032] Figure 7 A schematic diagram of the hardware structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0034] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0035] Person-job matching refers to the process of matching the applicant's abilities and experience with the job requirements during the recruitment process to determine the most suitable candidate. Person-job matching plays a key role in human resource management and recruitment, helping companies find the most suitable talents and also helping applicants find the most suitable jobs for themselves. In the past, person-job matching mainly relied on manual screening and interviews. This method has problems such as being time-consuming, highly subjective, and difficult to handle large-scale resumes and job information.
[0036] With the development of science and technology, people-job matching has gradually introduced automated and intelligent methods to improve matching efficiency and accuracy. In related technologies, people-job matching methods include text-based matching methods, keyword- and skill-based matching methods, data-driven matching methods, matching methods that consider contextual information, and matching methods based on graph models.
[0037] Text-based matching methods mainly use natural language processing (NLP) and deep learning methods to encode and match job seekers' resumes and job requirements, and recommend jobs to job seekers or match job seekers according to jobs based on the calculated matching degree.
[0038] The keyword and skill-based matching method calculates the matching degree between job seekers and positions by extracting and matching keywords, skills and other information in job seekers' resumes and job requirements.
[0039] The data-driven matching algorithm mainly uses machine learning and deep learning technology to train a recommendation model for matching people and jobs. The recommendation model can build a model by learning a large number of job seekers' resumes and job information to predict the matching degree. The recommendation model can better consider multiple features and contextual information, thereby improving the accuracy of matching people and jobs.
[0040] In addition to considering keyword and skill matching, the context-based matching algorithm also fully considers the context information of job seekers and positions. This context information can include work experience, project experience, educational background, etc. The use of this information can provide a more comprehensive evaluation and matching basis, thereby improving the accuracy of person-job matching.
[0041] The matching method based on graph model is to represent job seekers, positions and other related information as nodes of the graph, and use technologies such as Graph Neural Networks (GNN) to build information transmission between nodes, so as to achieve matching degree prediction.
[0042] For example, in related method 1, the computer device can screen the initial candidate resumes based on the job description information to determine the candidate resumes that match the job description information from the initial candidate resumes. The computer device can sort the candidate resumes according to the matching degree. The computer device can display the candidate resumes and the explanatory information of the candidate resumes according to the sorting result. After calculating the matching degree between the job description information and the candidate resumes, this method 1 can sort the job description information based on the matching degree. However, related method 1 lacks analysis of user historical behavior characteristics. Moreover, this related method 1 uses an unsupervised algorithm to sort the person-job matching degree, which cannot effectively deal with the person-job matching problem in real scenarios. Among them, the user's historical behavior characteristics can include the user's delivery history, click history and other behaviors.
[0043] For another example, the related method 2 provides a method for accurate recall recommendation of job matching based on prediction. The method constructs a recommendation model for prediction based on information of several resumes and positions. The computer device can use the recommendation model to recall resumes based on the positions to be recruited to obtain a candidate resume set. The computer device can contact the candidate corresponding to the candidate resume in the form of intelligent contact. If the candidate expresses his willingness to understand, the computer device can notify the full-time HR to be responsible for subsequent understanding and resume update, so as to ensure that the latest resume is in the system. The use of the related method 2 can accurately and quickly activate the dormant historical resumes in the enterprise talent pool, and at the same time use smart phones to collect the intentions of candidates, reduce the workload of recruitment specialists, improve recruitment efficiency, and save recruitment costs. In addition, the related method 2 can also build a job matching recommendation system based on the recommendation model, and combine the job matching recommendation system with the intelligent calling system, use the intelligent calling system to dial the smart phone, and determine the intention of the candidate in advance. HR can communicate next based on the intention of the candidate, which improves the work efficiency of HR. However, although the related method 2 improves the efficiency of job matching, the number of features used is small, and there is a problem of poor recall effect. Furthermore, related method 2 also does not analyze the user's historical user behavior.
[0044] In summary, although the person-job matching of related technologies has improved the matching efficiency and accuracy through technical means, helping companies and job seekers to better achieve recruitment goals and job search goals, and improving the accuracy and comprehensiveness of person-job matching. However, the person-job matching of related technologies does not fully utilize the user's historical user behavior, and there is a situation where it is difficult to capture the subtle differences in user interests, which easily leads to the problem of lack of personalization in the recommendation results. In addition, when considering user characteristics and job information, the person-job matching of related technologies tends to ignore some important contextual information, which leads to inaccurate recommendations. In addition, in the person-job matching of related technologies, the measurement of similarity is mostly based on descriptive information or user behavior, while ignoring the correlation between descriptive information and user behavior, so that it is impossible to capture user interests in time when user interests change, which leads to the inability to adapt to changes in user needs.
[0045] In view of the current status of person-job matching in related technologies, this application proposes a person-job matching method based on weighted contrast learning.
[0046] First, in the present application, the computer device can use the nearest neighbor method for each positive sample to obtain the neighbor sample corresponding to the positive sample. The computer device can calculate the similarity between the neighbor sample and the positive sample. Based on the similarity, the computer device can select a neighbor sample from the neighbor sample as the negative sample corresponding to the positive sample. Among them, the similarity between the neighbor sample and the positive sample can be obtained by fusing the content similarity and the behavior similarity to obtain a comprehensive similarity. The use of this comprehensive similarity solves the deficiency of calculating the similarity based only on the description information or user behavior in the prior art, fully considers the correlation between the description information and the user behavior, and more comprehensively evaluates the similarity between the positive sample and the neighbor sample. Secondly, the present application trains the recommendation model by using the training samples composed of the positive samples and negative samples, thereby realizing data enhancement of the training samples, compensating for the problem of incomplete information, and improving the accuracy of the recommendation model.
[0047] Figure 1 A flowchart of a training method for a recommendation model provided in an embodiment of the present application is shown.
[0048] like Figure 1 As shown, with a computer device as the execution subject, the method of this embodiment may include the following steps:
[0049] S101, determine the neighboring samples of the positive sample.
[0050] In this embodiment, the computer device may first determine a positive sample. Optionally, the positive sample includes a first job feature that has an interactive behavior with the first user feature. Optionally, the computer device may obtain one of the user features from all the user features as the first user feature corresponding to the positive sample. When the first user feature does not have an interactive behavior with any job feature, the computer device may reselect a user feature as the first user feature. The computer device may obtain at least one job feature that has an interactive behavior with the first user feature. The computer device may select a job feature from the at least one job feature as the first job feature of the positive sample.
[0051] The computer device may determine at least one neighbor sample corresponding to the positive sample by a nearest neighbor algorithm based on the positive sample. Optionally, each neighbor sample may include at least one job feature. Optionally, each neighbor sample may also include a first user feature. The first user feature is the first user feature in the positive sample. Optionally, the job feature in the neighbor sample may be a job feature having a high similarity to the first job feature in the positive sample.
[0052] In one example, the specific process of the computer device determining the neighboring sample of the positive sample may include the following steps:
[0053] Step 10: Determine the codebook index of the first position feature.
[0054] In this step, the computer device can obtain the first position feature in the positive sample. The computer device can divide the first position feature into multiple first position sub-features. Optionally, the computer device can rotate the first position sub-feature after obtaining the first position sub-feature. The computer device can obtain multiple pre-generated spatial codebooks. Each spatial codebook can correspond to a codebook index. The computer device can determine the spatial codebook corresponding to each first position sub-feature by searching the multiple first position sub-features in multiple spatial codebooks. Specifically, the computer device can use the rotated first position sub-feature to calculate the similarity with the rotated first position text sub-feature in the codebook space. The computer device can obtain the first position text sub-feature with the minimum similarity to each first position sub-feature. The computer device can determine the spatial codebook corresponding to the first position sub-feature based on the spatial codebook corresponding to the first position text sub-feature. Optionally, the present application can realize the encoding reconstruction of the first position sub-feature by rotating the first position sub-feature. The rotated first position sub-feature is a discrete code vector. The computer device uses the rotated first position feature and the rotated first position text sub-feature in the codebook space to perform similarity calculation, thereby improving the similarity calculation efficiency.
[0055] The computer device may calculate the similarity between each first job sub-feature and the cluster center of the spatial codebook in which it is located. The computer device may determine the codebook index corresponding to the spatial codebook in which the first job sub-feature corresponding to the smallest similarity is located as the codebook index corresponding to the first job feature.
[0056] Optionally, before generating the training samples, after obtaining all the job features, the computer device may use these job features as the first job text features for generating the spatial codebook, and generate multiple spatial codebooks. Each spatial codebook may correspond to a codebook index. The generation process of the spatial codebook may include the following steps:
[0057] Step 11: Obtain the first position text sub-feature of the first position text feature.
[0058] In this step, after the computer device obtains all the first position text features, it can divide the high-dimensional first position text features into multiple first position text sub-features. Each first position text sub-feature can be a subspace. The dimensions of the multiple subspaces are the same. Optionally, the computer device can implement the division of the sub-feature according to a fixed dimension. Optionally, the fixed dimension can be any dimension of the first position text feature. For example, the size of the first position text feature can be m×n×k. The computer device can divide the first position text feature into k m×n first position text sub-features according to the dimension k, where k, n, and m are all positive integers.
[0059] Step 12: cluster the first position text sub-features to obtain a spatial codebook corresponding to each first position text sub-feature.
[0060] In this step, the computer device can cluster all the first post text sub-features to obtain multiple classes. Optionally, the cluster center and the number of classes can be determined according to the preset value of the technician. Or, the cluster center and the number of classes can be determined by the algorithm in the clustering process. Optionally, the clustering algorithm can be an existing algorithm such as Density-Based Spatial Clustering of Applications with Noise (DBSCAN), K-Means Clustering Algorithm (k-means), Balanced Iterative Reducing and Clustering using Hierarchies (BIRCH) using a hierarchical method, or an improved algorithm of the existing algorithm. Optionally, the computer device can determine multiple spatial codebooks based on the multiple classes obtained by clustering. Among them, each class can correspond to a spatial codebook. Optionally, a spatial codebook can include all the first post text sub-features of the class. Each spatial codebook can correspond to a codebook index. Optionally, since one spatial codebook corresponds to one class, the spatial codebook may also correspond to the cluster center of the class.
[0061] Step 13: Map each first position text sub-feature to a corresponding spatial codebook to obtain a codebook index corresponding to each first position text sub-feature.
[0062] In this step, the computer device can determine the spatial codebook corresponding to the first post text sub-feature in each class according to the spatial codebook corresponding to the class. The computer device can determine the codebook index corresponding to each first post text sub-feature according to the codebook index corresponding to the spatial codebook. According to the codebook index, the computer device can quickly determine the spatial codebook corresponding to the first post text sub-feature.
[0063] Optionally, after completing the construction of the codebook space, the computer device can rotate each first position text sub-feature in the codebook space through a rotation matrix to obtain a rotated first position text sub-feature. Optionally, the rotation process can reduce the dimension of the first position text sub-feature, make the first position text sub-feature more dispersed in dimension, reduce redundant information in the first position text sub-feature, and achieve the effect of reducing the complexity of calculation and improving retrieval efficiency. Optionally, the use of the rotation matrix can also minimize the quantization error between spatial codebooks, so that similar first position text sub-features are in adjacent positions in the quantized spatial codebook, thereby improving the accuracy of the recommendation model.
[0064] Step 20: Determine a target sample similar to the positive sample according to the first job feature and the codebook index corresponding to the first job feature.
[0065] In this step, after obtaining the positive sample, the computer device can determine the first job feature included in the positive sample. The computer device can determine the corresponding spatial codebook according to the codebook index corresponding to the first job feature, and obtain multiple first job text sub-features included in the spatial codebook. The computer device can obtain the first job text feature corresponding to each first job text sub-feature. The computer device can use the first job text feature as the target job feature and the first user feature in the positive sample as the target user feature. The computer device can form a target sample with the target job feature and the target user feature. Optionally, the number of target samples obtained by the computer device can be one or more.
[0066] Optionally, the target sample determination process may include the following steps:
[0067] Step 21: Find the target space codebook where the codebook index of the rotated first position text sub-feature is located.
[0068] In this step, the computer device may determine the spatial codebook corresponding to the codebook index according to the codebook index corresponding to the first job feature. The computer device may obtain the first job text sub-feature in the spatial codebook. The computer device may use the spatial codebook as the target spatial codebook.
[0069] Step 22: determine the first post text sub-feature in the target space codebook as the target sample.
[0070] In this step, the computer device may obtain the first position text sub-feature in the target space codebook. The computer device may determine the first position text feature corresponding to each first position text sub-feature. The computer device may use these first position text features as target position features. The computer device may use the first user feature in the positive sample as the target user feature. The computer device may form a target sample with each target position feature and the target user feature.
[0071] Step 30: Calculate the behavior similarity between the user behavior features of the target sample.
[0072] In this step, the computer device can generate the similarity matrix according to the user characteristics and the job characteristics after obtaining the user characteristics and the job characteristics. The computer device can obtain the behavior data of each user characteristic and determine whether there is an interactive behavior between each user characteristic and each job characteristic according to the behavior data.
[0073] In the similarity matrix, each horizontal dimension can correspond to a user feature, and each vertical dimension can correspond to a job feature. Each element in the similarity matrix can correspond to the interaction between the user feature and the job feature. For example, the (i, j) element in the matrix corresponds to the interaction between the ith user feature and the jth job feature. For example, when there is an interaction between the ith user feature and the jth job feature, the value corresponding to the (i, j) element in the matrix can be 1. Otherwise, when there is no interaction between the ith user feature and the jth job feature, the value corresponding to the (i, j) element in the matrix can be 0, where i and j are positive integers.
[0074] Therefore, in the similarity matrix, each column may correspond to a user behavior feature corresponding to a user feature. The computer device may use a similarity algorithm to calculate the similarity of two columns of data in the similarity matrix to obtain the behavior similarity between the two user behavior features. Optionally, the similarity algorithm may be a distance algorithm such as Euclidean distance, cosine distance or Manhattan distance.
[0075] In this step, the computer device can obtain the user behavior feature corresponding to the first user feature and the user behavior feature corresponding to each target user feature. The computer device can calculate the similarity between the user behavior feature corresponding to the first user feature and the user behavior feature corresponding to each target user feature, and obtain the behavior similarity between the positive sample and each target sample.
[0076] Step 40: Obtain fusion similarity based on the target user characteristics of the target sample, the target job characteristics of the target sample, and the number of interactions between the target user characteristics and the target job characteristics.
[0077] In this step, the computer device may use a similarity algorithm to calculate the first similarity between the target user feature and the target sample feature. Optionally, the similarity algorithm may be a distance algorithm such as Euclidean distance, cosine distance, or Manhattan distance. Therefore, the smaller the similarity, the more similar the neighbor sample is to the positive sample. The larger the similarity, the greater the difference between the neighbor sample and the positive sample.
[0078] The computer device may also obtain the number of interactions according to the interaction behavior between the target user feature and the target job feature. Optionally, the interaction behavior may be the interaction behavior between the target user feature and the target job feature in the feedback data. Optionally, the number of interactions may include the number of times the target user feature clicks on the target job feature, and the number of times the target user feature applies for the target job feature. Optionally, the more the number of interactions, the higher the correlation between the target user feature and the target job feature. Conversely, the fewer the number of interactions, the lower the correlation between the target user feature and the target job feature.
[0079] The computer device may use the number of interactions to optimize the first similarity to obtain a fused similarity that combines the number of interactions and the first similarity.
[0080] Optionally, the calculation process of the fusion similarity may specifically include the following steps:
[0081] Step 41: Determine a first similarity between target user characteristics and target job characteristics.
[0082] In this step, the computer device can use algorithms such as Euclidean distance, cosine distance, Manhattan distance, etc. to calculate the distance between the target user feature and the target job feature, and use the distance as the first similarity. Generally, the smaller the first similarity, the higher the similarity between the user feature and the job feature. Otherwise, the larger the first similarity, the lower the similarity between the user feature and the job feature.
[0083] Step 42: Determine the interaction frequency value between the target user characteristics and the target job characteristics according to the number of interactions between the target user characteristics and the target job characteristics.
[0084] In this step, the computer device can count the number of interactions between the target user characteristics and the target job characteristics according to the interaction behavior between the target user characteristics and the target job characteristics. Optionally, the computer device can determine the interaction frequency value between the target user characteristics and the target job characteristics according to the number of interactions. Optionally, the computer device can also count the number of clicks and the number of applications respectively according to the interaction behavior.
[0085] In one implementation, the computer device may determine the interaction frequency value corresponding to the number of interactions between the target user feature and the target job feature using a preset formula or a preset mapping table. Optionally, the mapping table may include a mapping relationship between each possible number of interactions and the interaction frequency value.
[0086] In another implementation, the mapping table may include a mapping relationship between the number of clicks and the click frequency value and a mapping relationship between the number of applications and the application frequency value. The computer device may search the mapping table to obtain the click frequency value and the application frequency value based on the number of clicks and the number of applications. The computer device may also perform weighted summation of the click coefficient and the application weight based on the click weight and the application weight to obtain the final interaction frequency value. Optionally, the weights of the click frequency value and the application frequency value may be preset values. Alternatively, the weights of the click frequency value and the application frequency value may be calculated based on an algorithm such as an attention mechanism. Optionally, the sum of the weights of the click frequency value and the application frequency value may be 1.
[0087] In another implementation, the computer device may obtain the comprehensive interaction number by performing a weighted summation on the number of clicks and the number of applications. The computer device may determine the interaction frequency value corresponding to the number of interactions based on the comprehensive interaction number using a preset formula or a preset mapping table. Optionally, the mapping table may include a mapping relationship between each possible comprehensive interaction number and the interaction frequency value. Optionally, the weights of the number of clicks and the number of applications may be preset values. Alternatively, the weights of the number of clicks and the number of applications may be calculated based on an algorithm such as an attention mechanism. Optionally, the sum of the weights of the number of clicks and the number of applications may be 1. For example, the weight of the number of clicks may be 0.2, and the weight of the number of applications may be 0.8. For another example, the weight of the number of clicks may be 0.5, and the weight of the number of applications may be 0.5. For another example, the weight of the number of clicks may be 0.7, and the weight of the number of applications may be 0.3.
[0088] Step 43: Obtain fusion similarity according to the first similarity and the interaction frequency value.
[0089] In this step, the computer device implements the weighted fusion of the first similarity and the interaction frequency value to obtain the fused similarity. Optionally, the weights of the first similarity and the interaction frequency value can be preset values. Or, the weights of the first similarity and the interaction frequency value can be calculated according to an algorithm such as an attention mechanism. Optionally, the sum of the weights of the first similarity and the interaction frequency value can be 1. Optionally, the use of the weights of the first similarity and the interaction frequency value is used to achieve a balance between the first similarity and the interaction frequency value. The setting of the weights of the first similarity and the interaction frequency value determines the contribution of content and user behavior to the final similarity. The present application implements a more comprehensive and accurate similarity measurement through the fusion of the first similarity and the interaction frequency value, more effectively performs the nearest neighbor calculation, and improves the accuracy and personalization of recommendations. For example, the weight of the first similarity can be 0.2, and the weight of the interaction frequency value can be 0.8. For another example, the weight of the first similarity can be 0.5, and the weight of the interaction frequency value can be 0.5. For another example, the weight of the first similarity can be 0.7, and the weight of the interaction frequency value can be 0.3.
[0090] Step 50: Determine the nearest neighbor samples according to the behavior similarity and the fusion similarity.
[0091] In this step, the computer device may use the behavior similarity and fusion similarity to screen the target sample and obtain a neighboring sample.
[0092] In one implementation, the computer device may set a behavior threshold and a fusion threshold respectively according to the behavior similarity and the fusion similarity. The computer device may screen target samples whose behavior similarity is greater than the behavior threshold and whose fusion similarity is greater than the fusion threshold as neighboring samples.
[0093] In another implementation, the computer device may calculate the weighted sum of the behavior similarity and the fusion similarity to obtain a new fusion similarity. The computer device may use the new fusion similarity to sort the target samples and select a first preset number of target samples as neighbor samples. Alternatively, the computer device may select target samples whose new fusion similarity is greater than the screening threshold as neighbor samples based on a preset screening threshold.
[0094] S102: Determine the neighbor sample with the smallest similarity to the positive sample as a negative sample.
[0095] In this embodiment, the computer device can calculate the similarity between the neighbor sample and the positive sample. The computer device can use the neighbor sample with the smallest similarity as a negative sample. The negative sample can be a sample with high similarity and the smallest reward. The use of the negative sample can form a contrast between the positive sample and the negative sample, achieve data enhancement, make up for the problem of incomplete information, improve the accuracy of the recommendation, and achieve the optimization of the quantization error.
[0096] In one implementation, after obtaining a target job feature of a neighboring sample and a first job feature of a positive sample, the computer device may calculate the similarity between the target job feature and the first job feature through a similarity algorithm. The computer device may use the similarity between the target job feature and the first job feature as the similarity between the neighboring sample and the positive sample.
[0097] In another implementation, the computer device may concatenate the target user feature and the target job feature in the neighbor sample to obtain the neighbor feature. The computer device may concatenate the first user feature and the first job feature in the positive sample to obtain the positive sample feature. The computer device may use a similarity algorithm to calculate the similarity between the neighbor feature and the positive sample feature. The computer device may use the similarity as the similarity between the neighbor sample and the positive sample.
[0098] Optionally, the similarity algorithm may be a distance algorithm such as Euclidean distance, cosine distance or Manhattan distance. Therefore, the smaller the similarity, the more similar the neighbor sample is to the positive sample. The larger the similarity, the greater the difference between the neighbor sample and the positive sample.
[0099] Optionally, the positive sample and its corresponding negative sample may constitute a training sample, which may be applied to training of a recommendation model.
[0100] S103: Determine the sample similarity between the positive sample and the negative sample and the sample weights of the positive sample and the negative sample.
[0101] In this embodiment, the computer device can obtain the training samples used in each iteration of model training. The training samples used in one iteration can be a portion of training samples randomly selected from all training samples. The computer device can use the training samples of this iteration to calculate the sample similarity and sample weight between each positive sample and its corresponding negative sample in these training samples. Among them, the positive sample may include a first user feature and a first job feature. The negative sample may include a first user feature and a second job feature. The second job feature can be a neighboring sample with a minimum reward behavior determined based on the first job feature in the positive sample.
[0102] Computer devices can calculate the similarity between positive samples and negative samples through the sim() function. The sample similarity between positive samples and negative samples can be recorded as sim(x pos ,x neg ). Among them, x pos Can represent positive samples, x neg Can represent negative samples. In one implementation, the x posThe first position feature in the positive sample can be included in x neg The second job feature in the negative sample may be included in x. In another implementation, the x pos The first user feature and the first job feature in the positive sample may be included in the splicing feature. neg The may include the concatenated features of the first user feature and the second job feature in the negative sample.
[0103] The computer device may also determine the weight of the positive sample according to the interaction between the first user feature and the first job feature in the positive sample. And, the computer device may also determine the weight of the negative sample according to the interaction between the first user feature and the second job feature in the negative sample. Optionally, the interaction may include clicking and applying. Optionally, the interaction may be obtained from feedback data. Optionally, the positive sample weight and the negative sample weight are combined into the sample weight in the cost step.
[0104] Optionally, the computer device may implement the first loss according to the sample weight. Also, the computer device may input the sample weight corresponding to each training sample while inputting the training sample during the training process of the recommendation model.
[0105] In one example, the process of calculating sample weights by a computer device may include the following steps:
[0106] Step 10: Count the number of clicks and the number of applications for the first job feature and the second job feature.
[0107] In this step, the computer device may count the number of clicks and the number of applications for the first position feature. Optionally, the computer device may count all the behavior data of the first position feature. Alternatively, the computer device may count the behavior data of the first position feature in the feedback data. Optionally, the computer device may only count the number of clicks and the number of applications between the first position feature and the first user feature. Alternatively, the computer device may only count the number of clicks and the number of applications between the first position feature and the first user feature in the feedback data.
[0108] The computer device may count the number of clicks and the number of applications for the second position feature. Optionally, the computer device may count all the behavior data of the second position feature. Alternatively, the computer device may count the behavior data of the second position feature in the feedback data. Optionally, the computer device may only count the number of clicks and the number of applications between the second position feature and the first user feature. Alternatively, the computer device may only count the number of clicks and the number of applications between the second position feature and the first user feature in the feedback data.
[0109] Step 20: Determine the click weight based on the ratio of the number of applications to the number of clicks and the initial click weight.
[0110] In this step, the computer device may obtain an initial click weight. Optionally, the initial click weight may be determined according to a preset value of a technician. Alternatively, the initial click weight may also be determined according to a click weight calculated last time.
[0111] The computer device may calculate the ratio of the number of applications to the number of clicks. The computer device may use the product of the ratio and the initial click weight as the increment of the new click weight. The computer device may use the sum of the initial click weight and the increment to determine the click weight. Specifically, the calculation formula of the click weight may be:
[0112]
[0113] Among them, W click_new Indicates click weight. click is the initial click weight. N apply_click Indicates the number of applications. N click Indicates the number of clicks. Indicates the proportion of positions that users clicked and applied for, out of all the positions clicked.
[0114] Step 30: Determine the application weight according to the number of applications and the initial application weight.
[0115] In this step, the computer device may obtain an initial application weight. Optionally, the initial application weight may be determined according to a preset value of a technician. Alternatively, the initial application weight may also be determined according to an application weight calculated last time.
[0116] The computer device may also obtain the number of applications. The computer device may calculate the product of the number of applications and the initial application weight. The computer device may calculate the sum of the initial application weight and the product to obtain the application weight. The calculation formula for the application weight may be:
[0117] W apply_new =W apply ×(1+N apply )
[0118] Among them, W apply_new Indicates the application weight. N apply Indicates the number of application behaviors of the user.
[0119] Step 40: Determine the sample weight according to the click weight and the application weight.
[0120] In this step, the computer device can determine the sample weight of the training sample by calculating the weighted sum of the click weight and the application weight. When the training sample is a positive sample, the sample weight is the positive sample weight. When the training sample is a negative sample, the sample weight is the negative sample weight. Optionally, the weights of the click weight and the application weight can be preset values. Alternatively, the weights of the click weight and the application weight can be calculated according to an algorithm such as an attention mechanism. For example, the weight of the click weight can be 1, and the weight of the application weight can be 1. For another example, the weight of the click weight can be 0.6, and the weight of the application weight can be 0.4.
[0121] S104: Determine a first loss according to sample similarity and sample weight.
[0122] In this embodiment, the computer device can calculate the first loss of the job recommendation model at each iteration during the job recommendation model training process. Optionally, the first loss can be calculated using a weighted contrast learning method. Optionally, the use of the first loss enables the comparison of the similarity between positive samples and negative samples, which can better capture the gap between positive and negative samples, thereby maximizing the gap between positive and negative samples, so that positive samples obtain higher similarity scores and reduce the similarity of negative samples. The use of the first loss in the recommendation model training improves the accuracy and effect of the recommendation.
[0123] In one implementation, after obtaining the sample similarity and sample weight of the training samples applied to the iteration, the computer device can calculate the first loss according to the sample similarity and sample weight of the training samples. Optionally, the calculation formula of the first loss can be:
[0124]
[0125] Among them, L cvl is the first loss. N is the number of training samples used in this iteration. i is the sample weight. Each training sample can correspond to a sample weight. The setting of the sample weight can be used to increase the user interest level corresponding to different training samples. α is an adjustment factor used to control the loss function. sim(x pos ,x neg ) represents the similarity between positive samples and negative samples. Optionally, x pos Can represent positive samples, x neg It can represent a negative sample. i and j are used to indicate the i-th training sample and the j-th training sample in the training sample.
[0126] Another implementation method, according to the above implementation method, the calculation formula of the first loss can be optimized as follows:
[0127] L cvl = = max(sim(x neg )-sim(x pos )+ω)
[0128] Among them, L cvl is the first loss. sim(x pos ) is the similarity between the first user feature and the first job feature in the positive sample. sim(x neg ) is the similarity between the first user feature and the second job feature in the positive and negative samples. ω is the boundary value.
[0129] Assuming the boundary value is 0.2, the similarity of the positive sample pair is 0.9, and the similarity of the negative sample pair is 0.3, the calculation process of the above formula can be:
[0130] L cvl =max(0.3-0.9+0.2)=0.2
[0131] Optionally, the first loss is used to train a weighted contrastive learning model to optimize model parameters.
[0132] S105. Determine a second loss according to the positive sample.
[0133] In this embodiment, the computer device can obtain the predicted score of the positive sample after inputting the positive sample into the job recommendation model. Optionally, the second loss can be a cross entropy loss. According to the predicted score, the computer device uses the cross entropy loss to calculate the second loss as follows:
[0134] L ce = -log(P pos )
[0135] Among them, P pos is the prediction score of the positive sample. L ce For the second loss.
[0136] S106. Train the recommendation model according to the first loss and the second loss.
[0137] In this embodiment, in each iteration of model training, the computer device may input the positive sample and its corresponding negative sample into the recommendation model. The computer device may use the recommendation model of this iteration to predict the prediction scores of the positive sample and the negative sample. The computer device may calculate the cross entropy loss and the weighted contrastive learning loss. The computer device may calculate the total loss function based on the weighted sum of the two losses. The computer device may use the back propagation algorithm to optimize the parameters of the model so as to minimize the loss function. The computer device may repeat the above steps for multiple rounds of iterations to implement the training of the recommendation model.
[0138] Optionally, the computer device may terminate the iteration and output the trained job recommendation model when the value of the loss function is less than the loss threshold. Alternatively, the computer device may terminate the iteration and output the trained job recommendation model when the value of the loss function converges. Alternatively, the computer device may terminate the iteration and output the trained job recommendation model when the number of training rounds reaches a number threshold.
[0139] Optionally, when calculating the weighted sum of the first loss and the second loss, the weights of the first loss and the second loss may be preset values. Alternatively, the weights of the first loss and the second loss may be calculated according to an algorithm such as an attention mechanism. For example, the weight of the first loss may be 1, and the weight of the second loss may be 1. For another example, the weight of the first loss may be 0.6, and the weight of the second loss may be 0.4.
[0140] In one implementation, in each iteration of the recommendation model, the data input into the recommendation model by the computer device may include a recommended job sequence, job characteristics, user characteristics, and sample weights.
[0141] The recommendation model generation method provided in the present application is that the computer device can generate a neighbor sample of the positive sample after obtaining the positive sample. The computer device can select a neighbor sample with the smallest similarity to the positive sample from the neighbor samples as a negative sample. The computer device can calculate the sample similarity between the positive sample and the negative sample. The computer device can calculate the sample weights of the positive sample and the negative sample. The computer device can calculate the first loss based on the sample similarity and the sample weight. The computer device can also calculate the second loss based on the positive sample. The computer device can implement the training of the job recommendation model based on the first loss and the second loss. The present application, by introducing the nearest neighbor method, realizes the generation of training samples. The use of the training sample forms a contrast between the positive sample and the negative sample, and realizes data enhancement. The present application realizes the calculation of the first loss and the second loss by applying the training sample to the training of the recommendation model, and based on the first loss and the second loss, realizes the improvement of the training efficiency of the recommendation model and the improvement of the prediction accuracy of the recommendation model.
[0142] exist Figure 1 Prior to the embodiment shown, Figure 2 As shown, the computer device first needs to collect a job data set and a user data set, and generate corresponding user features and job features based on the job data set and the user data set.
[0143] In this process, the computer device first needs to prepare data. In the data preparation stage, the computer device can first collect the job data set and the user data set.
[0144] Among them, the position data set may include position information of a large number of positions. Optionally, the positions in the position data set may be positions that are being recruited and positions that have completed recruitment. Optionally, the position information of each position may include information such as the position title, description, and requirements. For example, the position data set acquired by the computer device may include position information of position 1, position information of position 2, and position information of position 3. Optionally, the computer device may also acquire external data such as industry trends and market demand, and apply these external data to the extraction of position features.
[0145] Computer equipment can process the job information through feature engineering to obtain Figure 1 The job features shown in the embodiment. The computer device can process the job information using a first feature extraction model to obtain text features. Optionally, the first feature extraction model can be a Bert pre-training model. The computer device can also construct category features according to the job category. The computer device can encode the category features of the job according to the category information of the job. The computer device can generate job features according to the text features and category features of each job. The job features can be represented by vectors. Optionally, the computer device can also reconstruct the job encoding vector of the job features after obtaining the job features, so that the job features can be quantized from the text feature representation to a discrete encoding vector, thereby more efficiently realizing the calculation of similarity. Optionally, the encoding vector reconstruction of the job features can be achieved by a rotation matrix. Optionally, the job features can be used to implement the vector representation of the job, and the identification of the reward features in the job.
[0146] The user data set may include user information of a large number of users. Optionally, the users in the user data set may be users who are seeking jobs and users who have finished seeking jobs. Optionally, the user information may include personal information, interactive behaviors and preferences used to describe the users. Specifically, the user information may include user behaviors. The user behaviors may include interactive behaviors such as user clicks, applications, and favorites. The user information may also include user attributes. The user attributes may include personal information such as work experience, education, and skills. The user information may also include feedback data. The feedback data may include information such as clicks, applications, ratings, and comments. For example, the user data set acquired by the computer device may include user 1 and user 2. The user information of user 1 may include user 1's work experience, user 1's click records on position 2, and user 1's skills. The user information of user 2 may include user 2's education, user 2's application records for position 3, and user 2's location.
[0147] Computer equipment can process the user information through feature engineering to obtain Figure 1The user features shown in the embodiment are also represented by vectors.
[0148] Specifically, the computer device may perform feature engineering on the user attributes in the user information to obtain user attribute features. The computer device may integrate the user attributes and feedback data to obtain the user's interest features. The computer device may input the interest features into a second feature extraction model to generate user features. Optionally, the second feature extraction model may be a Bert pre-training model. The computer device may achieve learning of user interests and capturing of the evolution of user interests by processing the user information.
[0149] For the user behavior in the user information, the computer device can use the third prediction model to learn the user's behavior pattern. Optionally, the third prediction model can be a Bert pre-training model. Optionally, the third prediction model can be composed of multiple Transformer blocks. Optionally, the third prediction model can be a memory network model. Optionally, the user behavior can include a user's interaction sequence. In the learning process of the behavior pattern, the computer device can input the interaction sequence into the third prediction model, and learn the user's behavior pattern after encoding the interaction sequence in the third prediction model. Optionally, one execution of the third prediction model can be one time step. One execution of the third prediction model can be used to predict the position that the user is most likely to choose to interact with at this time step. Therefore, when the computer device uses the third prediction model to continuously execute multiple time steps, the third prediction model can predict and construct a user-position interaction sequence. In the user-position interaction sequence, the number of positions that the user interacts with is the number of time steps executed. The computer device can obtain the user-position interaction sequence based on the prediction and convert the position corresponding to each time step into a position feature. Optionally, the third prediction model may be a functional module composed of some Transformer blocks in the recommendation model.
[0150] exist Figure 1 Before the illustrated embodiment, the computer device also needs to build a recommendation model. The recommendation model consists of multiple Transformer blocks, each of which may include a self-attention mechanism and a feedforward neural network. The recommendation model stacks multiple Transformer blocks together to form a deep model structure. In the recommendation model, the output of the Transformer block of the previous layer can be used as the input of the Transformer block of the next layer, thereby achieving multi-level feature extraction. And, in each Transformer block, the output of the self-attention mechanism is the input of the feedforward neural network.
[0151] Among them, the self-attention mechanism is used to capture the association between different time steps in the interaction sequence and realize the transmission of interactive information between different time steps. Optionally, one execution of the self-attention mechanism is a time step. The input of the self-attention mechanism part includes three parts: query (Query, Q), key (Key, K) and value (Value, V). The input of the self-attention mechanism part can be obtained by linear transformation of the computer device after obtaining the input interaction sequence. And in the self-attention mechanism part, the recommendation model can pay attention to the interaction between different positions in the interaction sequence by calculating the attention weight.
[0152] Each Transformer block includes a feedforward neural network. The feedforward neural network is used to perform nonlinear transformation on the information output by the attention mechanism at each time step. The network structure of the feedforward neural network consists of a fully connected layer and an activation function, which is used to extract higher-order features. After obtaining the user-position interaction information output by the attention mechanism at each time step, the feedforward neural network can convert the user-position interaction information into an embedding vector. Optionally, the embedding vector can be obtained by encoding the user ID, position features, timestamp, etc. in the user-position interaction information.
[0153] The last layer of the recommendation model can be a fully connected layer. The fully connected layer can map the features obtained by multi-level feature extraction by multiple Transformer blocks to the user's interest score, and use the sigmoid activation function to convert the interest score into a probability value for output. The probability value is the final prediction score obtained by the recommendation model.
[0154] The recommendation model can be trained using a training sample set, and back-propagation and optimization algorithms are used to update the model parameters.
[0155] Optionally, the loss function of the recommendation model may be mean-square error (MSE). The calculation formula may be:
[0156]
[0157] Among them, N is used to indicate the number of samples input into the job recommendation model. i is the prediction score of the i-th training sample, is the sample label of the i-th training sample. When the training sample is a positive sample, the sample label is 1, and when the training sample is a negative sample, the sample label is 0.
[0158] The recommendation model designed in this application realizes the effect of learning the user's behavior model from the user's interactive behavior, obtaining the user's interest, capturing the time relationship and context information in the interaction sequence, and improving the recommendation accuracy.
[0159] Optionally, based on the recommendation model, and the above Figure 1 The training process of the recommendation model shown in Figure 3 As shown, the above model training process can be divided into three parts: neighbor sample acquisition and data enhancement, weighted contrast learning and model learning, and model optimization and iteration. In the neighbor sample acquisition and data enhancement stage, the computer device realizes the generation of multiple training samples of the recommendation model. In the weighted contrast learning and model learning stage, the computer device realizes the calculation of the first loss of weighted contrast learning based on the positive samples and negative samples in the training samples. The first loss and the second loss are applied to model training. In the model optimization and iteration process, the computer device optimizes the recommendation model through iterative training and obtains the final recommendation model.
[0160] Figure 4 A flowchart of a job recommendation method provided by an embodiment of the present application is shown. Figures 1 to 3 Based on the embodiment shown, Figure 4 As shown, with a computer device as the execution subject, the method of this embodiment may include the following steps:
[0161] S201. Obtain user characteristics of the user and job characteristics of the job.
[0162] In this embodiment, the computer device can obtain the job characteristics of the job. Optionally, the job characteristics can be a feature vector obtained by extracting the characteristics of the job information of the job. Optionally, the feature extraction of the job characteristics can be implemented by a BERT model. Optionally, the computer device can also obtain external data. The external data can include industry trends, market demand, etc. Optionally, the computer device can extract the characteristics of the job information and the external data to obtain the job characteristics. Optionally, the job can be a job that is currently in the recruitment state in the database.
[0163] The computer device can obtain the user characteristics of the user. Optionally, the user characteristics can be a feature vector obtained by extracting the characteristics of the user's user information. Optionally, the user is the user who currently needs to query the matching position. Optionally, the user information can include user behavior and user attributes. After obtaining the user behavior and user attributes of the user, the computer device can fuse and extract the user behavior and user attributes to obtain the user characteristics. The fusion of the user behavior and user attributes in the user characteristics can dynamically capture the changes in the user's interests and effectively solve the problem of difficulty in capturing subtle differences in user interests. By using the user characteristics, personalized information can be obtained and more personalized job recommendations can be achieved. Optionally, the user characteristics can integrate the user's work experience, education, skills and other personal information, clicks, applications, favorites and other historical interactive behaviors, and other user-related characteristics.
[0164] In one example, the process of extracting the user features may include the following steps:
[0165] Step 1: Encode user attributes to obtain user attribute features.
[0166] In this step, the computer device may obtain user attributes. The user attributes may include work experience, education, skills, place of origin, etc. Optionally, the user attributes may be extracted from user information.
[0167] The computer device may format the user attribute after obtaining the user attribute. The computer device may preset multiple key-value data structures. The key is a fixed content. For example, the key may be a title such as work experience, education, skills, place of origin, self-introduction, etc. The value is used to write the content extracted from the user attributes such as user resume and account information.
[0168] The computer device may input the user attributes into a first encoding model to encode the user features. Optionally, the first encoding model may be a Bert model. Optionally, the Bert model may include one or more Transformer blocks.
[0169] Optionally, the user attribute input by the computer device into the first coding model may be a formatted user attribute. Alternatively, the user attribute input by the computer device into the first coding model may be a character string converted from the formatted user attribute. For example, the character string may be "work experience: XXX; education: XXX; skills: XXX; ..." Optionally, the first coding model may perform feature extraction on the user attribute after converting the text in the character string corresponding to the user attribute into a code.
[0170] Step 2: Encode user behavior to obtain user behavior characteristics.
[0171] In this step, the computer device may obtain user behavior. The user behavior may include operations performed by the user when using the client corresponding to the present application. Optionally, the client may be an interactive interface of an application, an interactive interface of a web page, an interactive interface of a mini-program, an interactive interface of a microservice, etc. Optionally, the user behavior may specifically include interactive behaviors such as clicking, applying, and collecting.
[0172] After acquiring the user behavior, the computer device may format the user behavior and convert it into a behavior sequence. For example, the user's click record on Position 1 may be formatted as [User 1, click, Position 1]. For another example, the user's application record for Position 2 may be formatted as [User 1, application, Position 3]. Optionally, the computer device may combine multiple user behaviors according to the order of events that occurred to generate an interaction sequence.
[0173] The computer device may input the interaction sequence into a second encoding model to encode and obtain a user behavior vector. Optionally, the second encoding model may be a Bert model. Optionally, the Bert model may include one or more Transformer blocks.
[0174] Step 3: Obtain user characteristics based on user behavior characteristics and user attribute characteristics.
[0175] In this step, the computer device may also use a third coding model and weights of user behavior features and user attribute features to perform weighted coding on the user behavior vector and the user feature to obtain the user feature.
[0176] Optionally, the weights of the user behavior feature and the user attribute feature may be preset values. Alternatively, the weights of the user behavior feature and the user attribute feature may be calculated based on an algorithm such as an attention mechanism. For example, the weight of the user behavior feature may be 0.2, and the weight of the user attribute feature may be 0.8. For another example, the weight of the user behavior feature may be 0.5, and the weight of the user attribute feature may be 0.5. For another example, the weight of the user behavior feature may be 0.7, and the weight of the user attribute feature may be 0.3.
[0177] Optionally, the third encoding model may be a BERT model. Optionally, the BERT model may include one or more Transformer blocks. Optionally, the BERT model may learn the user's interest representation to achieve the fusion extraction of the user's features.
[0178] In one implementation, the computer device may use the weights of the user behavior feature and the user attribute feature to perform a weighted summation on the user behavior vector and the user feature. The computer device may use the third coding model to perform feature extraction on the result of the weighted summation to obtain the final user feature.
[0179] In another implementation, the weights of the user behavior feature and the user attribute feature of the computer device are weighted to the user behavior vector and the user feature. The computer device can splice the weighted user behavior vector and the user attribute vector. The computer device can use a third coding model to extract features from the spliced user behavior vector and the user attribute vector to obtain the final user feature.
[0180] It should be noted that the user feature extraction method used in this embodiment is different from Figure 1 The method of extracting user features in the illustrated embodiments is the same.
[0181] S202: Input user characteristics and job characteristics into the recommendation model for prediction, and output the job recommendation result for the user.
[0182] In this embodiment, the computer device may input user characteristics and job characteristics into the recommendation model. The computer device may output the prediction scores of the user characteristics and some job characteristics. Optionally, the part of users may be some job characteristics after the recommendation model has screened all job characteristics. Optionally, the number of job characteristics for which the prediction scores are output may be set according to user needs.
[0183] The computer device may sort the job characteristics according to the prediction scores. The computer device may output the job characteristics in sequence according to the sorting completion. Alternatively, the computer device may output some of the job characteristics in sequence according to the sorting results. The computer device may generate a job recommendation result according to the output job characteristics. The computer device may send the job recommendation result to the user.
[0184] For example, when 10,000 job features are included, the computer device can output the prediction scores of the 1,000 job features and output the job recommendation results consisting of 100 job features.
[0185] Optionally, the user can view the job recommendation results through the client.
[0186] In one implementation, the specific process of the recommendation model generating job recommendation results may include the following two steps:
[0187] Step 1, the computer device inputs the user characteristics and the comprehensive similarity between the user characteristics and each position characteristic into the recommendation model. The decoder part in the recommendation model can decode and obtain the recommended position sequence according to the above information. Optionally, the number of positions included in the recommended position sequence can be determined based on a first preset value. For example, when the first preset value is 1000, the recommended position sequence output by the computer device may include 1000 positions. Optionally, the recommended position sequence may include a position identifier. The position identifier can be used to uniquely identify a position. For example, when the input positions include position 1, position 2, and position 3, the recommended position sequence can be [position 1, position 3]. Among them, position 1, position 2, and position 3 are position identifiers.
[0188] Step 2, the computer device can input the recommended job sequence, job characteristics and user characteristics into the prediction part of the recommendation model. The prediction part can determine the corresponding job characteristics based on the job identification in the recommended job sequence. The prediction part can calculate the prediction score of the user characteristics and the job characteristics based on the user characteristics and the job characteristics of each job in the recommended job sequence. The prediction score can be the interest level of the user corresponding to the user characteristics in the job corresponding to the job characteristics. The computer device can sort multiple jobs in the recommended job sequence according to the prediction score to obtain the final job recommendation result. For example, the job recommendation result can be [Job 3, Job 1].
[0189] Among them, the decoder part in the recommendation model is equivalent to an action decoder (Gate Recurrent Unit, GRU) model. After the user features are obtained by the recommendation model, the decoder part can decode the user interests therein and generate a recommended position sequence. Optionally, the decoder part of the recommendation model can be obtained by training user features and behavior sequences. Optionally, each execution of the decoder part can be a time step. The decoder part can determine the interest level or similarity of the user features corresponding to each position in each time step based on the user features. The interest level or similarity can be used to indicate the user's preference program for different positions, as well as the probability of the user selecting each position in this time step. Therefore, in each time step, the decoder part can output a position that the user is most likely to select in this time step.
[0190] Optionally, after the computer device obtains the user features and behavior sequence, the user features and behavior sequence can be used as the initial input of the decoder part to initialize the hidden state. The decoder part can provide context information for the generated recommended job sequence based on the hidden state.
[0191] Optionally, the computer device may determine the number of times the decoder part needs to be executed according to a first preset value. The decoder part executes once, which is one time step for the decoder part to execute. The decoder part may receive the recommended positions and hidden states outputted at the previous time step when executing at the current time step. The decoder part may also generate a new hidden state and output a new recommended position when executing at the current time step. The recommended positions at each time step may constitute the recommended position list finally outputted by the decoder part.
[0192] Optionally, the recommended job sequence output by the decoder part may include job identifiers. The computer device may input the recommended job sequence into the prediction part of the recommendation model.
[0193] In the job recommendation method provided in the present application, a computer device can obtain user characteristics of a user and job characteristics of an existing job. The user characteristics are obtained by integrating the user's user behavior and user attributes. The computer device can input the user characteristics and job characteristics into a recommendation model to predict a prediction score between the user characteristics and the job characteristics. The computer device can select part of the job characteristics to generate a job recommendation result based on the prediction score. In the present application, by using a recommendation model, the effect of improving the generation efficiency of job recommendation results is achieved.
[0194] Based on the above embodiment, the computer device can also periodically evaluate and update the model after the recommendation model is put into use to adapt to the changing user behavior and job information. The computer device can recommend more accurate job recommendation results to users based on user characteristics and behaviors by regularly optimizing the recommendation model, thereby improving the recommendation efficiency.
[0195] Optionally, when optimizing the recommendation model, the computer device may obtain feedback data from each user. The feedback data may include user behaviors of user clicks and applications. Based on the user behaviors in the feedback data, the computer device may recalculate the sample weights of each training data. The computer device may train the recommendation model using the training data and the new sample weights to obtain an optimized recommendation model.
[0196] During the model optimization process, computer equipment can optimize click weights and application weights based on the click and application behaviors in the feedback data, thereby achieving dynamic adjustment of clicks and applications, which can more accurately reflect changes in user interests and provide users with more accurate and diversified job recommendation services.
[0197] Figure 5 A structural diagram of a training device for a recommendation model provided in an embodiment of the present application is shown. Figure 5As shown, the training device 10 of the recommendation model of this embodiment is used to implement the operation corresponding to the computer device in any of the above method embodiments. The training device 10 of the recommendation model of this embodiment includes:
[0198] An acquisition module 11 is used to determine the neighboring samples of the positive sample; determine the neighboring sample with the smallest similarity to the positive sample among the neighboring samples as a negative sample; determine the sample similarity between the positive sample and the negative sample and the sample weights of the positive sample and the negative sample;
[0199] The training module 12 is used to determine a first loss according to sample similarity and sample weight; determine a second loss according to positive samples; and train a recommendation model according to the first loss and the second loss.
[0200] Optionally, the positive sample includes a first position feature having an interactive behavior with the first user feature, and the acquisition module 11 is used to:
[0201] Determine a codebook index of a first position feature;
[0202] Determine a target sample similar to the positive sample according to the first position feature and the codebook index corresponding to the first position feature;
[0203] Calculate the behavioral similarity between the user behavior features of the target samples;
[0204] According to the target user characteristics of the target sample, the target job characteristics of the target sample, and the number of interactions between the target user characteristics and the target job characteristics, the fusion similarity is obtained;
[0205] Determine the nearest neighbor samples based on behavior similarity and fusion similarity.
[0206] Optionally, the acquisition module 11 is used to: determine a codebook index of a job feature.
[0207] The acquisition module 11 is used to:
[0208] Obtain the first post text sub-feature of the first post text feature;
[0209] Performing clustering processing on the first post text sub-features to obtain a spatial codebook corresponding to each first post text sub-feature;
[0210] Each first position text sub-feature is mapped to a corresponding spatial codebook to obtain a codebook index corresponding to each first position text sub-feature.
[0211] Optionally, the acquisition module 11 is used to:
[0212] Each first position text sub-feature is rotated by using a rotation matrix to obtain a rotated first position text sub-feature.
[0213] Optionally, the acquisition module 11 is used to:
[0214] Find the target space codebook where the codebook index of the rotated first post text sub-feature is located;
[0215] The first post text sub-feature in the target space codebook is determined as the target sample.
[0216] Optionally, the negative sample includes a second job feature, and the acquisition module 11 is used to:
[0217] Count the number of clicks and applications for the first and second job features;
[0218] Determine the click weight based on the ratio of the number of applications to the number of clicks and the initial click weight;
[0219] Determine the application weight based on the number of applications and the initial application weight;
[0220] Determine the sample weight based on the click weight and application weight.
[0221] Optionally, the training module 12 is used to:
[0222] Determine the first similarity between the target user characteristics and the target job characteristics;
[0223] According to the number of interactions between the target user characteristics and the target job characteristics, the interaction frequency value between the target user characteristics and the target job characteristics;
[0224] According to the first similarity and the interaction frequency value, a fusion similarity is obtained.
[0225] Optionally, the training module 12 is used to:
[0226] Based on the preset mapping relationship, the interaction frequency value is determined according to the number of interactions between the target user characteristics and the target position characteristics.
[0227] The training device 10 of the recommendation model provided in the embodiment of the present application can execute the above method embodiment. Its specific implementation principle and technical effects can be found in the above method embodiment, and this embodiment will not be repeated here.
[0228] Figure 6 FIG. 1 shows a schematic diagram of a job recommendation device provided by an embodiment of the present application. Figure 6 As shown, the job recommendation device 20 of this embodiment is used to implement the operation corresponding to the computer device in any of the above method embodiments. The job recommendation device 20 of this embodiment includes:
[0229] An acquisition module 21, used to acquire user characteristics of the user and job characteristics of the job;
[0230] The recommendation module 22 is used to input user characteristics and job characteristics into a recommendation model for prediction and output the job recommendation result for the user. The recommendation model is trained according to any one of the methods of claims 1-8.
[0231] Optionally, the acquisition module 21 is used to:
[0232] Encode user attributes to obtain user attribute features;
[0233] Encode user behavior to obtain user behavior characteristics;
[0234] User characteristics are obtained based on user behavior characteristics and user attribute characteristics.
[0235] The job recommendation device 20 provided in the embodiment of the present application can execute the above method embodiment. Its specific implementation principle and technical effects can be found in the above method embodiment, and this embodiment will not be repeated here.
[0236] Figure 7 FIG. 1 is a schematic diagram showing the hardware structure of a computer device provided in an embodiment of the present application. Figure 7 As shown, the computer device 30 is used to implement the operations corresponding to the computer device in any of the above method embodiments. The computer device 30 of this embodiment may include: a memory 31, a processor 32 and a communication interface 34.
[0237] The memory 31 is used to store computer program codes. The memory 31 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a disk, or an optical disk.
[0238] The processor 32 is used to execute the computer program code stored in the memory to implement the job recommendation method and the training method of the recommendation model in the above-mentioned embodiment. For details, please refer to the relevant description in the above-mentioned method embodiment. The processor 32 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the invention can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0239] Optionally, the memory 31 may be independent or integrated with the processor 32 .
[0240] When the memory 31 is a device independent of the processor 32, the computer device 30 may further include a bus 33. The bus 33 is used to connect the memory 31 and the processor 32. The bus 33 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0241] The communication interface 34 can be connected to the processor 31 through the bus 33. The processor 32 can control the communication interface 34 to realize communication with the user terminal, so as to obtain the user ID of the current user when viewing the user position interface. The processor 32 can obtain the user behavior data and user attribute data of the current user according to the user ID, complete the person-position matching algorithm, and generate the position recommendation result. The communication interface 34 can also return the position recommendation result to the user terminal, so that the user can view the targeted position recommendation.
[0242] The computer device provided in this embodiment can be used to execute the above-mentioned job recommendation method and recommendation model training method. Its implementation method and technical effect are similar, and this embodiment will not be repeated here.
[0243] The present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a computer device, they are used to implement the methods provided in the various embodiments described above.
[0244] Among them, the computer-readable storage medium can be a computer storage medium or a communication medium. The communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The computer storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer. For example, a computer-readable storage medium is coupled to a processor so that the processor can read information from the computer-readable storage medium and write information to the computer-readable storage medium. Of course, the computer-readable storage medium can also be a component of the processor. The processor and the computer-readable storage medium can be located in an application-specific integrated circuit (ASIC). In addition, the ASIC can be located in a user device. Of course, the processor and the computer-readable storage medium can also exist in a communication device as discrete components.
[0245] Specifically, the computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0246] The present application also provides a computer program product, which includes a computer program code, and the computer program code is stored in a computer-readable storage medium. At least one processor of the device can read the computer program code from the computer-readable storage medium, and at least one processor executes the computer program code so that the device implements the methods provided in the various embodiments described above.
[0247] An embodiment of the present application also provides a chip, which includes a memory and a processor, the memory is used to store computer programs, and the processor is used to call and run the computer programs from the memory, so that a device equipped with the chip executes the methods in various possible implementation modes as described above.
[0248] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0249] Among them, each module can be physically separated, for example, installed in different locations of a device, or installed on different devices, or distributed on multiple network units, or distributed on multiple processors. Each module can also be integrated together, for example, installed in the same device, or integrated in a set of codes. Each module can exist in the form of hardware, or can also exist in the form of software, or can also be implemented in the form of software plus hardware. The present application can select some or all of the modules according to actual needs to achieve the purpose of the present embodiment.
[0250] When each module is implemented as an integrated module in the form of a software function module, it can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to perform some steps of the methods of each embodiment of the present application.
[0251] It should be understood that, although the various steps in the flowcharts in the above-described embodiments are sequentially displayed according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and they can be executed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily to be carried out sequentially, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0252] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the above embodiments can still be modified, or some or all of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A training method for a recommendation model, characterized in that: The method comprises: Determine the nearest neighbor samples of the positive samples; Determine the neighbor sample with the smallest similarity to the positive sample among the neighbor samples as a negative sample; Determining a sample similarity between the positive sample and the negative sample and a sample weight of the positive sample and the negative sample; Determine a first loss according to the sample similarity and the sample weight; Determine a second loss according to the positive sample; The recommendation model is trained according to the first loss and the second loss.
2. The method according to claim 1, characterized in that The positive sample includes a first position feature having an interactive behavior with the first user feature, and the determining of a neighboring sample of the positive sample includes: Determining a codebook index of the first position feature; Determining a target sample similar to the positive sample according to the first job feature and a codebook index corresponding to the first job feature; Calculating the behavior similarity between the user behavior features of the target samples; Obtaining fusion similarity according to the target user characteristics of the target sample, the target job characteristics of the target sample, and the number of interactions between the target user characteristics and the target job characteristics; The neighbor samples are determined according to the behavior similarity and the fusion similarity.
3. The method according to claim 2, characterized in that The determining of the codebook index of the first position characteristic includes: Obtaining a first position text sub-feature of the first position text feature; Performing clustering processing on the first position text sub-features to obtain a spatial codebook corresponding to each of the first position text sub-features; Each of the first position text sub-features is mapped to a corresponding spatial codebook to obtain a codebook index corresponding to each of the first position text sub-features.
4. The method according to claim 3, characterized in that After determining the codebook index of the first position feature, the method further includes: Each of the first position text sub-features is rotated by using a rotation matrix to obtain a rotated first position text sub-feature.
5. The method according to claim 4, characterized in that Determining a target sample similar to the positive sample according to the first job feature and a codebook index corresponding to the first job feature includes: Searching the target space codebook where the codebook index of the rotated first post text sub-feature is located; The first post text sub-feature in the target space codebook is determined as the target sample.
6. The method according to claim 5, characterized in that The negative sample includes a second job feature, and the determining of sample weights of the positive sample and the negative sample includes: Counting the number of clicks and the number of applications for the first job feature and the second job feature; Determine the click weight according to the ratio of the number of applications to the number of clicks and the initial click weight; Determining the application weight according to the number of applications and the initial application weight; The sample weight is determined according to the click weight and the application weight.
7. The method according to claim 2, characterized in that The obtaining of fusion similarity according to the target user characteristics of the target sample, the target job characteristics of the target sample, and the number of interactions between the target user characteristics and the target job characteristics includes: Determine a first similarity between the target user feature and the target position feature; Determining an interaction frequency value between the target user feature and the target job feature according to the number of interactions between the target user feature and the target job feature; The fusion similarity is obtained according to the first similarity and the interaction frequency value.
8. The method according to claim 7, characterized in that The determining the interaction frequency value between the user and the position according to the number of interactions between the user and the position includes: Based on a preset mapping relationship, the interaction frequency value is determined according to the number of interactions between the target user feature and the target position feature.
9. A job recommendation method, characterized in that: The method comprises: Obtaining user characteristics of the user and job characteristics of the job; The user characteristics and the job characteristics are input into a recommendation model for prediction, and a job recommendation result for the user is output, wherein the recommendation model is trained according to the method described in any one of claims 1 to 8.
10. The method according to claim 9, characterized in that Get the user's user characteristics, including: Encoding the user attributes to obtain user attribute features; Encoding the user behavior to obtain user behavior features; The user characteristics are obtained according to the user behavior characteristics and the user attribute characteristics.
11. A computer device, characterized in that: The computer device comprises: a memory and a processor; The memory is used to store a computer program; the processor is used to implement the method according to any one of claims 1 to 8, or the method according to any one of claims 9 to 10, according to the computer program stored in the memory.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer device, the computer device executes the method according to any one of claims 1 to 8, or the method according to any one of claims 9 to 10.
13. A computer program product, characterized in that The computer program product comprises: a computer program code, which, when executed on a computer, enables a computer device to execute the method according to any one of claims 1 to 8, or any one of claims 9 to 10.
Citation Information
Cited By
Traffic flow prediction method and device based on attention mechanism, equipment and medium
CN119741834A
