Explainable job recommendation method and device based on knowledge graph and attention network
By introducing knowledge graphs and attention networks into the job recommendation algorithm and building multiple knowledge perception modules, the problem of poor interpretability of the existing job recommendation algorithm is solved, and higher trust and recommendation effects are achieved.
Patent Information
- Application Number
- CN202411570174.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-11-06
AI Technical Summary
The existing job recommendation algorithm is poorly interpretable, and the specific reasons for the inability to provide job seekers with recommended positions, resulting in low trust.
The interpretable job recommendation method based on knowledge graph and attention network is adopted, and interpretable job recommendation results are generated by constructing user resume and job data embedding modules, entity links and knowledge embedding modules, multiple knowledge perceived attention modules, and vector fusion and model prediction modules.
It improves the interpretability of job recommendations, enables job seekers to understand the specific reasons for recommended positions, enhances trust, and is better than traditional job recommendation algorithms.
Smart Images

Figure CN119067625B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of person-job matching, and specifically relates to an explainable job recommendation method and device based on knowledge graph and attention network. Background Art
[0002] With the popularization of the Internet, online recruitment has become the mainstream way for companies to recruit, and it has also become one of the main ways for job seekers to find jobs. In recent years, with the rapid development of higher education in my country and the increasing scale of enrollment, it has become a hot topic of social concern that applicants have difficulty finding jobs and companies have difficulty recruiting. However, among the massive number of positions provided by online recruitment platforms, the positions recommended by the platform often do not fully meet the basic conditions of job seekers, that is, the platform's job recommendation algorithm has low recommendation quality and is difficult to gain the trust of job seekers.
[0003] The existing job recommendation algorithms have the following challenging problems: The existing job recommendation algorithms are poorly explainable. Existing job recommendation algorithms are often based on content or collaborative filtering, which cannot provide job seekers with specific reasons for recommending jobs, and job seekers have low trust. Summary of the invention
[0004] In order to solve the problem of poor interpretability of existing job recommendation algorithms, the present invention provides an explainable job recommendation method based on knowledge graph and attention network.
[0005] In order to achieve the above object, the present invention is implemented through the following technical solutions:
[0006] An explainable job recommendation method based on knowledge graph and attention network includes the following steps:
[0007] S1. Obtaining person-job matching data and constructing a person-job matching data set, wherein the person-job matching data includes user resumes and job description texts, and dividing the person-job matching data set into a training set and a test set;
[0008] S2. Construct an interpretable job recommendation model based on knowledge graph and attention network, wherein the interpretable job recommendation model based on knowledge graph and attention network includes: a user resume and job data embedding module, an entity linking and knowledge embedding module, a multiple knowledge perception attention module, and a vector fusion and model prediction module. The interpretable job recommendation model based on knowledge graph and attention network is trained using the data in the training set to obtain a trained interpretable job recommendation model based on knowledge graph and attention network;
[0009] S3. Construct a job recommendation result explanation generation module. The data in the test set is predicted by a trained explainable job recommendation model based on knowledge graph and attention network to obtain the recommendation result. Then, the job recommendation result explanation generation module is used to give the reasons corresponding to the recommendation result.
[0010] Furthermore, the user resume and job data embedding module in step S2 specifically includes: the user resume and job description text are processed by a BERT encoder to obtain user resume entity perception vectors respectively. and the candidate position text-aware vector q.
[0011] Furthermore, the entity linking and knowledge embedding module in step S2 specifically includes:
[0012] S21. Use entity linking technology to associate candidate job texts with predefined entities in the recruitment domain knowledge graph: First, perform entity recognition on the candidate job text to obtain job description entities, extract relationship links between job description entities from the recruitment domain knowledge graph, and then complete the association of job description entities in the candidate job text to obtain the target entity sequence ;
[0013] S22. Define the entity context of the target entity in the target entity sequence as the nearest neighbor in the recruitment domain knowledge graph, extract the neighbor entity with a one-hop distance from the current entity, and obtain the job description entity context perception , the calculation formula is as follows:
[0014]
[0015] Among them, rel represents the relationship between two entities, G represents the knowledge graph of the recruitment field, and c represents the current entity. represents the target entity;
[0016] S23. The average value of the job description entity context is used as the job description entity context perception vector, and the job description entity context perception vector is obtained by knowledge embedding through the TransE algorithm. The calculation formula is as follows:
[0017] ,
[0018] in, Indicates The context-aware vector of the job description entity corresponding to each job.
[0019] Furthermore, the multiple knowledge-aware attention module in step S2 includes resume-position-aware attention t-dattention and resume-position-entity-aware attention tde attention, specifically including:
[0020] In resume-position perception attention, the user resume entity perception vector t is used as the query K, the candidate position text perception vector q is used as the key Q and the value V, and the resume-position perception vector d is obtained by calculating the semantic similarity between the user resume and the candidate position description text. The calculation formula is as follows:
[0021] ,
[0022] ,
[0023] ,
[0024] Among them, t represents the entity perception vector of the user resume, q represents the text perception vector of the candidate position, and W Q , W K , W V denote the parameter matrices of Q, K, and V respectively, and α denotes the attention distribution of resume-position-aware attention;
[0025] In resume-position-entity-aware attention, the user resume entity-aware vector t is used as the query K, the candidate position text-aware vector q is used as the key Q, and the position entity context-aware vector ec is used as the query K. i As the value V, by calculating the semantic similarity between the user resume and the entity corresponding to the candidate position, the resume-position-entity perception vector e is obtained. The calculation formula is as follows:
[0026] ,
[0027] ,
[0028] ,
[0029] Among them, β represents the attention distribution of resume-position-entity perception attention, and e represents the resume-position-entity perception vector.
[0030] Furthermore, the vector fusion and model prediction module in step S2 specifically includes:
[0031] The user resume entity perception vector t, resume-position perception vector d and resume-position-entity perception vector e are connected in series to obtain a series representation form Z, which is expressed as follows:
[0032] ,
[0033] The series representation Z is sequentially passed through a fully connected layer, a hidden layer, a multi-layer fully connected neural network layer and a softmax function to obtain a job recommendation result.
[0034] Furthermore, in step S2, the interpretable job recommendation model based on the knowledge graph and the attention network is trained, which specifically includes:
[0035] The Sigmoid cross entropy loss function is used to calculate the loss between the logical output and the label. The loss function calculation formula is as follows:
[0036] ,
[0037] Where D represents the training set, N represents the number of person-job matching samples, f(x) represents the prediction result output by the perceptron, y represents the classification label category, and the loss function is used. Supervise the training of an explainable job recommendation model based on knowledge graph and attention network to obtain a trained explainable job recommendation model based on knowledge graph and attention network.
[0038] Furthermore, in step S3, the job recommendation result explanation generation module gives the reasons corresponding to the recommendation results, which specifically include:
[0039] The module is filled with similarity scores and co-reality entities between resumes and recommended positions, and the recommendation results and their reasons are displayed to job seekers. The co-reality entities between resumes and recommended positions are entities whose similarity between the user resume entity perception vector t and the resume-position-entity perception vector e is greater than 0.6. The similarity score calculation formula adopts the cosine similarity calculation method.
[0040] The present invention also provides an explainable job recommendation device based on knowledge graph and attention network, comprising:
[0041] An acquisition unit, the acquisition unit is used to acquire person-job matching data;
[0042] A construction unit, wherein the construction unit is used to construct an interpretable job recommendation model based on a knowledge graph and an attention network, wherein the interpretable job recommendation model based on a knowledge graph and an attention network comprises: a user resume and job data embedding module, an entity linking and knowledge embedding module, a multiple knowledge perception attention module, and a vector fusion and model prediction module, wherein the interpretable job recommendation model based on a knowledge graph and an attention network is trained using data in a training set to obtain a trained interpretable job recommendation model based on a knowledge graph and an attention network;
[0043] A generation unit is used to construct a job recommendation result explanation generation module. The data in the test set is predicted by a trained interpretable job recommendation model based on knowledge graph and attention network to obtain the recommendation result, and then the job recommendation result explanation generation module is used to give the reason corresponding to the recommendation result.
[0044] The advantages of the present invention are:
[0045] The explainable job recommendation method based on knowledge graph and attention network proposed in the present invention, the model represents the user resume and job description text through encoders respectively, conducts knowledge linking between candidate job entities and recruitment domain knowledge graph, extracts job entity context, further mines the potential similarities of job seeker resumes, job texts, and related entities in recruitment domain knowledge graph through multiple knowledge perception modules, performs vector fusion of the three groups of representation vectors for prediction, and obtains the final prediction result. The explainable job recommendation method based on knowledge graph and attention network proposed in the present invention is superior to other traditional job recommendation algorithms, and can provide explanations for job recommendation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0047] Figure 1 is a flow chart of the method of the present invention;
[0048] Figure 2 It is the multi-knowledge-aware attention module of the present invention. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] Example 1
[0051] In this embodiment, Figure 1 As shown in the figure, an explainable job recommendation method based on knowledge graph and attention network is provided. The specific steps include:
[0052] S1. Obtaining person-job matching data and constructing a person-job matching data set, wherein the person-job matching data includes user resumes and job description texts, and dividing the person-job matching data set into a training set and a test set;
[0053] S2. Construct an interpretable job recommendation model based on knowledge graph and attention network, wherein the interpretable job recommendation model based on knowledge graph and attention network includes: a user resume and job data embedding module, an entity linking and knowledge embedding module, a multiple knowledge perception attention module, and a vector fusion and model prediction module. The interpretable job recommendation model based on knowledge graph and attention network is trained using the data in the training set to obtain a trained interpretable job recommendation model based on knowledge graph and attention network;
[0054] S3. Construct a job recommendation result explanation generation module. The data in the test set is predicted by a trained explainable job recommendation model based on knowledge graph and attention network to obtain the recommendation result. Then, the job recommendation result explanation generation module is used to give the reasons corresponding to the recommendation result.
[0055] Specifically, the user resume and job description text are processed by the BERT encoder to obtain the user resume entity perception vector and the candidate position text perception vector q.
[0056] Specifically, in the entity linking and knowledge embedding module, the entity linking technology is used to associate the candidate job text with the predefined entities in the recruitment domain knowledge graph: first, entity recognition is performed on the candidate job text to obtain the job description entity, and the relationship link between the job description entities is extracted from the recruitment domain knowledge graph, and then the association of the job description entities in the candidate job text is completed to obtain the target entity sequence. ; Define the entity context of the target entity in the target entity sequence as the nearest neighbor in the recruitment domain knowledge graph, extract the neighbor entity with a one-hop distance from the current entity, and obtain the job description entity context perception , the calculation formula is as follows:
[0057]
[0058] Among them, rel represents the relationship between two entities, G represents the knowledge graph of the recruitment field, and c represents the current entity. Represents the target entity; the average value of the job description entity context is taken as the job description entity context perception vector, and the job description entity context perception vector is obtained by knowledge embedding through the TransE algorithm. The calculation formula is as follows:
[0059] ,
[0060] in, Indicates The context-aware vector of the job description entity corresponding to each job.
[0061] Specifically, Figure 2 As shown, the multi-knowledge-aware attention module includes resume-position-aware attention t-dattention and resume-position-entity-aware attention tde attention. In resume-position-aware attention, the user resume entity-aware vector t is used as the query K, the candidate position text-aware vector q is used as the key Q and the value V, and the resume-position-aware vector d is obtained by calculating the semantic similarity between the user resume and the candidate position description text. The calculation formula is as follows:
[0062] ,
[0063] ,
[0064] ,
[0065] Among them, t represents the entity perception vector of the user resume, q represents the text perception vector of the candidate position, and W Q , W K , W V denote the parameter matrices of Q, K, and V respectively, and α denotes the attention distribution of resume-position-aware attention;
[0066] In resume-position-entity-aware attention, the user resume entity-aware vector t is used as the query K, the candidate position text-aware vector q is used as the key Q, and the position entity context-aware vector ec is used as the query K. i As the value V, by calculating the semantic similarity between the user resume and the entity corresponding to the candidate position, the resume-position-entity perception vector e is obtained. The calculation formula is as follows:
[0067] ,
[0068] ,
[0069] ,
[0070] Among them, β represents the attention distribution of resume-position-entity perception attention, and e represents the resume-position-entity perception vector.
[0071] Specifically, in the vector fusion and model prediction module, the user resume entity perception vector t, resume-position perception vector d and resume-position-entity perception vector e are connected in series to obtain a series representation form Z, which is expressed as follows:
[0072] ,
[0073] The series representation Z is sequentially passed through a fully connected layer, a hidden layer, a multi-layer fully connected neural network layer and a softmax function to obtain a job recommendation result.
[0074] Specifically, the Sigmoid cross entropy loss function is used to calculate the loss between the logical output and the label, and the interpretable job recommendation model based on the knowledge graph and attention network is trained. The loss function calculation formula is as follows:
[0075] ,
[0076] Where D represents the training set, N represents the number of person-job matching samples, f(x) represents the prediction result output by the perceptron, y represents the classification label category, and the loss function is used. Supervise the training of an explainable job recommendation model based on knowledge graph and attention network to obtain a trained explainable job recommendation model based on knowledge graph and attention network.
[0077] Specifically, the module is filled with similarity scores and co-reality entities between resumes and recommended positions, and the recommendation results and their reasons are displayed to job seekers. The co-reality entities between resumes and recommended positions are entities whose similarity between the user resume entity perception vector t and the resume-position-entity perception vector e is greater than 0.6. The similarity score calculation formula adopts the cosine similarity calculation method.
[0078] Example 2
[0079] Table 1 Comparison of experimental data between the method of the present invention and the existing method
[0080]
[0081] In this embodiment, Table 1 is the experimental data comparison results of the method of the present invention and the recommendation method based on deep learning and the recommendation method based on knowledge graph. The present invention uses precision (Precision), recall (Recall), the harmonic mean of precision and recall (F1 value), accuracy (Accuracy), and the area under the curve (AUC) as evaluation indicators of the model. From the data in the table, it can be seen that the accuracy of the model proposed by the present invention reached 71.76%, the recall rate reached 70.79, the F1 value reached 71.29, the ACC value was 71.80, and the AUC value was 75.16, which are all better than other advanced baseline models. Among the listed comparative algorithms, the job recommendation algorithms KCNN, DKN, and KG-DPJF based on knowledge graphs achieved good results, proving that introducing knowledge graphs into recommendation systems can greatly improve the performance of job recommendation algorithms; among them, DKN achieved the best results. Compared with the best baseline model DKN, the accuracy of the proposed model is improved by 6.73 percentage points, the recall rate is improved by 0.89 percentage points, the F1 value is improved by 3.97 percentage points, the ACC is improved by 3 percentage points, and the AUC is improved by 2.86 percentage points. The experimental results show that the interpretable job recommendation method based on knowledge graph and attention network proposed in the present invention has achieved good results. Compared with other algorithms based on knowledge graph, the performance of the proposed method is improved a lot, which proves the effectiveness of the proposed method.
[0082] Table 2 Job recommendation result explanation and generated data table
[0083]
[0084] In this embodiment, taking the recommendation result explanation information shown in the fourth row of Table 2 as an example, the model can generate a corresponding job recommendation result explanation based on the job seeker's resume and the candidate job text information to understand the specific reasons why the algorithm recommends the job, the match between the job seeker and the candidate job, and the job seeker's main abilities, qualities, professional skills and experience that meet the job seeker's requirements.
[0085] Model input: ① Text data of a candidate position: "Job responsibilities 1. Responsible for formulating teaching plans and teaching materials, providing students with systematic JAVA programming language training courses, ensuring training content and teaching quality...; Job requirements 1. Full-time bachelor's degree or above, computer-related major; 2. 2 years or more of software development experience; 3. Have the basic knowledge and advanced application skills of teaching JAVA programming language; 4. Have excellent judgment and learning ability." ② Job applicant resume data: "Computer Technology Major at xxx University, has systematically studied Java, Oracle and Web and is proficient in... CET-4, I have good teamwork and learning abilities, and have 2 years or more of software development experience..."
[0086] Model output: ① Model prediction result y. If the output result is y=1, it proves that the position can be recommended to the user. ② Person-position similarity. ③ The co-existence of candidate position entities and job seeker resume entities calculated by cosine similarity, i.e. "computer technology", "Java", "oracle", "web", "learning ability", "R&D experience", etc. Finally, fill the content output by the model into the template in the prediction stage.
[0087] Example 3
[0088] In this embodiment, an explainable job recommendation device based on knowledge graph and attention network is provided, including:
[0089] An acquisition unit, the acquisition unit is used to acquire person-job matching data;
[0090] A construction unit, wherein the construction unit is used to construct an interpretable job recommendation model based on a knowledge graph and an attention network, wherein the interpretable job recommendation model based on a knowledge graph and an attention network comprises: a user resume and job data embedding module, an entity linking and knowledge embedding module, a multiple knowledge perception attention module, and a vector fusion and model prediction module, wherein the interpretable job recommendation model based on a knowledge graph and an attention network is trained using data in a training set to obtain a trained interpretable job recommendation model based on a knowledge graph and an attention network;
[0091] A generation unit is used to construct a job recommendation result explanation generation module. The data in the test set is predicted by a trained interpretable job recommendation model based on knowledge graph and attention network to obtain the recommendation result, and then the job recommendation result explanation generation module is used to give the reason corresponding to the recommendation result.
[0092] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An explainable job recommendation method based on knowledge graph and attention network, characterized in that: The following steps are involved: S1. Obtaining person-job matching data and constructing a person-job matching data set, wherein the person-job matching data includes user resumes and job description texts, and dividing the person-job matching data set into a training set and a test set; S2. Construct an interpretable job recommendation model based on knowledge graph and attention network, wherein the interpretable job recommendation model based on knowledge graph and attention network includes: a user resume and job data embedding module, an entity linking and knowledge embedding module, a multiple knowledge perception attention module, and a vector fusion and model prediction module. The interpretable job recommendation model based on knowledge graph and attention network is trained using the data in the training set to obtain a trained interpretable job recommendation model based on knowledge graph and attention network; The user resume and job data embedding module specifically includes: the user resume and job description text are processed by a BERT encoder to obtain the user resume entity perception vector and the candidate job text perception vector q; The entity linking and knowledge embedding module specifically includes: The entity linking technology is used to associate the candidate job text with the predefined entities in the recruitment domain knowledge graph: First, entity recognition is performed on the candidate job text to obtain the job description entity, and the relationship links between the job description entities are extracted from the recruitment domain knowledge graph, and then the association of the job description entities in the candidate job text is completed to obtain the target entity sequence ; Define the entity context of the target entity in the target entity sequence as the nearest neighbor in the recruitment domain knowledge graph, extract the neighbor entity with a one-hop distance from the current entity, and obtain the job description entity context perception , the calculation formula is as follows: Among them, rel represents the relationship between two entities, G represents the knowledge graph of the recruitment field, and c represents the current entity. Represents the target entity; The average value of the job description entity context is used as the job description entity context perception vector. The job description entity context perception vector is obtained by knowledge embedding through the TransE algorithm. The calculation formula is as follows: , in, Indicates The context-aware vector of the job description entity corresponding to each job; The multiple knowledge perception attention module includes resume-position perception attention td attention and resume-position-entity perception attention tde attention, specifically including: In resume-position perception attention, the user resume entity perception vector t is used as the query K, the candidate position text perception vector q is used as the key Q and value V, and the resume-position perception vector d is obtained by calculating the semantic similarity between the user resume and the candidate position description text. The calculation formula is as follows: , , , Among them, t represents the entity perception vector of the user resume, q represents the text perception vector of the candidate position, and W Q , W K , W V denote the parameter matrices of Q, K, and V respectively, and α denotes the attention distribution of resume-position-aware attention; In resume-position-entity-aware attention, the user resume entity-aware vector t is used as the query K, the candidate position text-aware vector q is used as the key Q, and the position description entity context-aware vector ec is used as the query K. i As the value V, by calculating the semantic similarity between the user resume and the entity corresponding to the candidate position, the resume-position-entity perception vector e is obtained. The calculation formula is as follows: , , , Among them, β represents the attention distribution of resume-position-entity perception attention, and e represents the resume-position-entity perception vector; The vector fusion and model prediction module specifically includes: connecting the user resume entity perception vector t, the resume-position perception vector d and the resume-position-entity perception vector e in series to obtain a series representation form Z, which is expressed as follows: , The series representation Z is sequentially passed through a fully connected layer, a hidden layer, a multi-layer fully connected neural network layer, and a softmax function to obtain a job recommendation result; S3. Construct a job recommendation result explanation generation module. The data in the test set is predicted by a trained explainable job recommendation model based on knowledge graph and attention network to obtain the recommendation result. Then, the job recommendation result explanation generation module is used to give the reasons corresponding to the recommendation result.
2. The explainable job recommendation method based on knowledge graph and attention network according to claim 1 is characterized in that: In step S2, the interpretable job recommendation model based on the knowledge graph and the attention network is trained, which specifically includes: The Sigmoid cross entropy loss function is used to calculate the loss between the logical output and the label. The loss function calculation formula is as follows: , Where D represents the training set, N represents the number of person-job matching samples, f(x) represents the prediction result output by the perceptron, y represents the classification label category, and the loss function is used. Supervise the training of an explainable job recommendation model based on knowledge graph and attention network to obtain a trained explainable job recommendation model based on knowledge graph and attention network.
3. The explainable job recommendation method based on knowledge graph and attention network according to claim 1 is characterized in that: In step S3, the job recommendation result explanation generation module gives the reasons corresponding to the recommendation results, which specifically include: The module is filled with similarity scores and co-reality entities between resumes and recommended positions, and the recommendation results and their reasons are displayed to job seekers. The co-reality entities between resumes and recommended positions are entities whose similarity between the user resume entity perception vector t and the resume-position-entity perception vector e is greater than 0.
6. The similarity score calculation formula adopts the cosine similarity calculation method.
4. An explainable job recommendation device based on knowledge graph and attention network, executing the explainable job recommendation method based on knowledge graph and attention network as described in any one of claims 1 to 3, characterized in that: The device comprises: An acquisition unit, the acquisition unit is used to acquire person-job matching data; A construction unit, wherein the construction unit is used to construct an interpretable job recommendation model based on a knowledge graph and an attention network, wherein the interpretable job recommendation model based on a knowledge graph and an attention network comprises: a user resume and job data embedding module, an entity linking and knowledge embedding module, a multiple knowledge perception attention module, and a vector fusion and model prediction module, wherein the interpretable job recommendation model based on a knowledge graph and an attention network is trained using data in a training set to obtain a trained interpretable job recommendation model based on a knowledge graph and an attention network; A generation unit is used to construct a job recommendation result explanation generation module. The data in the test set is predicted by a trained interpretable job recommendation model based on knowledge graph and attention network to obtain the recommendation result, and then the job recommendation result explanation generation module is used to give the reason corresponding to the recommendation result.
Citation Information
Patent Citations
Recommendation algorithm performance optimization method based on knowledge graph
CN112417306A
Employment recommendation system based on multi-modal knowledge graph and pre-training large model fusion
CN117541202A