Post recommendation method based on knowledge graph and large language model and related products
By constructing an interaction mechanism between a dynamic professional knowledge graph and a large language model, the problems of semantic understanding, human-computer interaction, and data bias in intelligent recruitment systems have been solved, enabling more accurate job recommendations and career planning suggestions, and improving the fairness and accuracy of the system.
Patent Information
- Application Number
- CN202511625701.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-02-06
AI Technical Summary
Existing intelligent recruitment systems have shortcomings in semantic understanding, human-computer interaction, and data, resulting in inaccurate recommendations, inability to provide effective suggestions, and the potential to learn and amplify social biases, affecting fairness and objectivity.
By constructing a job recommendation method based on knowledge graphs and large language models, including identifying and filtering semantic biases, constructing a dynamic occupational knowledge graph, and training the large language model to interact with the knowledge graph, job recommendations and career planning suggestions are generated.
It enhances the intelligent recruitment system's ability to understand complex career information, its level of personalized interaction, and the fairness of recommendation results, providing more timely career development advice and ensuring the accuracy and reliability of the model.
Smart Images

Figure CN121481489A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to job recommendation methods and related products based on knowledge graphs and large language models, and particularly to natural language processing, knowledge graph construction, and human resource information processing technologies. Background Technology
[0002] With the development of artificial intelligence technology, its application in the field of human resources is becoming increasingly widespread, especially in automated recruitment and job recommendation. Existing intelligent recruitment systems or devices, such as self-service job search kiosks or online recommendation platforms, typically use algorithms to match job seekers with job information to improve recruitment efficiency.
[0003] However, these systems still have some shortcomings in terms of technical implementation.
[0004] First, at the semantic understanding level, many recommendation algorithms rely primarily on keyword or tag matching between job seekers' resumes and job descriptions. This approach struggles to deeply explore the inherent connections between skills, potential career development paths, and the true context of job requirements, potentially leading to inaccurate recommendation results.
[0005] Secondly, regarding human-computer interaction, although some systems have introduced digital humans or chatbots to enhance the user experience, their interaction logic is mostly based on pre-set question-and-answer databases or fixed scripts. This makes them ill-equipped to handle complex career planning consultations and unable to provide truly effective advice.
[0006] Finally, at the data level, the massive amounts of recruitment data that form the basis for training AI models may contain outdated information and subtle social biases. If left unchecked, models trained on this data may learn and amplify these biases, affecting the fairness and objectivity of job recommendations. Summary of the Invention
[0007] In order to solve the above-mentioned technical problems, the present invention aims to provide a job recommendation method and related products based on knowledge graphs and large language models, which improves the existing intelligent recruitment system's ability to deeply understand complex professional information, the level of personalization of interaction, and the fairness of recommendation results.
[0008] This invention is achieved through the following technical solution:
[0009] A job recommendation method based on knowledge graphs and large language models includes:
[0010] S1. Acquire and process recruitment data, identify semantic biases in the recruitment data, filter out biased data, perform data balancing and enhancement on the recruitment data, and generate a dedicated training dataset.
[0011] S2. Based on the training dataset, construct a dynamic occupational knowledge graph, wherein the entities and relations in the dynamic occupational knowledge graph include temporal attributes;
[0012] S3. Train a large language model in the recruitment field and establish an interaction mechanism between the large language model and the dynamic occupational knowledge graph. When the large language model generates text for job recommendations or career planning suggestions, its generation process is constrained by the logical path and facts of the dynamic occupational knowledge graph.
[0013] Optionally, step S1 specifically includes:
[0014] S11. Collect raw recruitment data from multiple data sources containing unstructured text, and extract entities and relationships between entities from them.
[0015] S12. Quantify the semantic bias score of each document in the recruitment data using a semantic model;
[0016] S13. Based on a preset bias threshold, filter out documents with semantic bias scores higher than the bias threshold;
[0017] S14. For categories in the filtered recruitment data that are not representative enough, perform data balancing and data augmentation to generate the dedicated training dataset.
[0018] Optionally, methods for quantifying semantic bias scores include:
[0019] Calculate vocabulary bias score : ;
[0020] Calculate job description documents semantic bias score : ;
[0021] in, A set of vocabulary related to the target concept;
[0022] It is a set of two opposing attribute concept words;
[0023] For document The first in One word;
[0024] For words Word vectors obtained from a pre-trained language model;
[0025] For the target concept set The mean vector of all word vectors in the text. ;
[0026] For vectors and Cosine similarity between them;
[0027] For a single word Relative to attribute set and Bias score;
[0028] A set of words that carry biased information;
[0029] This is an indicator function; its value is 1 when the condition is true, and 0 otherwise.
[0030] For words In the document Attention weights in the context of attention.
[0031] Alternatively, the methods for performing data balancing and data augmentation are as follows:
[0032] S141. Construct a generative adversarial network containing a generator and a discriminator, and use the generator to generate recruitment data text for data augmentation;
[0033] S142. The generative adversarial network is trained using a composite loss function, wherein the composite loss function includes a knowledge graph consistency loss term, which is used to ensure that the text generated by the generator conforms to the constraints of the dynamic occupational knowledge graph in terms of semantic logic.
[0034] S143. Using the trained generator, generate new recruitment data text for categories that are underrepresented;
[0035] S144. Merge the new recruitment data text with the filtered recruitment data to form a dedicated training dataset.
[0036] Among them, the knowledge graph consistency loss term Calculated using the following formula: ;
[0037] Text generated by a generator for generating adversarial networks;
[0038] Entity relation triples extracted from generated text A set;
[0039] These are the vector representations of the head entity, relation, and tail entity in the knowledge graph embedding space, respectively.
[0040] It is a distance metric between vectors;
[0041] These are the boundary hyperparameters used to control the rational boundary of ternary combinatorial systems.
[0042] Optionally, step S2 specifically includes:
[0043] S21. Using the entities in the training dataset as nodes and the relationships between entities as edges with timestamps, construct the basic structure of the dynamic occupational knowledge graph.
[0044] S22. A time-aware relational attention network is used to aggregate the neighbor node information of each node, and the embedding vector of each node in the basic structure is trained and updated by combining the relational attention coefficient and the time decay function.
[0045] S23. After the network training converges, obtain the final embedding vectors of all nodes in the knowledge graph;
[0046] S24. Combine the basic structure of the dynamic occupational knowledge graph with the final embedding vector to form the dynamic occupational knowledge graph;
[0047] S25. When new recruitment data is obtained, the new entities and new relationships contained in the new recruitment data are incrementally added to the infrastructure, and the training update of step S22 is performed on the affected local subgraph.
[0048] Alternatively, each node can be updated through hierarchical propagation. Embedded vector ,in The first representing the network The layer update rules are as follows: ;
[0049] Relationship Attention Coefficient : ;
[0050] Time decay function : ;
[0051] in, For entity nodes In the network Layer 3D embedding vector;
[0052] For nodes All neighboring nodes and their correspondence A set;
[0053] For relation types Related, in the The learnable linear transformation matrix of the layer;
[0054] It is a non-linear activation function;
[0055] For reference time points;
[0056] For connecting nodes and The timestamp of the relation edge;
[0057] For relation types Relevant, learnable decay rate parameters;
[0058] The attention coefficient represents the relationship between the two factors. and reference time Next, node For nodes Importance weights;
[0059] The unnormalized attention score;
[0060] For relation types Related, in the The learnable attention mechanism weight vector of the layer;
[0061] Nonlinear activation function;
[0062] For nodes Among the neighbors, through relationships A set of connected nodes.
[0063] Optionally, step S3 specifically includes:
[0064] S31. A large language model for the recruitment domain is trained using a composite loss function to align the internal knowledge representation of the large language model with the logical structure of the dynamic professional knowledge graph; the composite loss function includes autoregressive language model loss and relational path consistency loss.
[0065] S32. Upon receiving a user query, identify the key entities in the query, and use the key entities as the starting point or end point to search for high-confidence logical paths connecting the key entities in the dynamic occupational knowledge graph.
[0066] S33. Using the high-confidence logical path as a structured constraint, guide the large language model to generate text for job recommendations or career planning suggestions based on the constraint.
[0067] Optionally, the composite loss function ;in, For autoregressive language model loss, For relationship path consistency loss, To balance the weights;
[0068] The method for determining the consistency loss of the relational path includes:
[0069] S311, For the input text sequence Identify the set of entities existing in the dynamic occupational knowledge graph. And randomly sample the connected entities with a length of Relationship path ;
[0070] S312. Based on the embedding vectors of entities and relationships in the dynamic professional knowledge graph, calculate the graph path authenticity score. ; ;in, and These are the temporal embedding vectors of entities and relations, respectively;
[0071] S313, Utilizing the aforementioned large language model and the additional linear header Calculate the path score predicted by the large language model for the relation path. : ,in, The hidden state vector output by the large language model;
[0072] S314. Based on the mean squared error between the authenticity score of the graph path and the predicted path score of the large language model, the relationship path consistency loss term is calculated. : ;in, This is a set of relational paths sampled from the training text.
[0073] A job recommendation terminal based on knowledge graphs and large language models includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the job recommendation method based on knowledge graphs and large language models as described above.
[0074] A computer program product includes a computer program / instructions that, when executed by a processor, implement the job recommendation method based on knowledge graphs and large language models as described above.
[0075] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0076] This invention constructs a dedicated training dataset through semantic bias measurement and text generation technology constrained by knowledge graphs; then, it uses a temporal-aware relational attention network to construct a temporal knowledge graph that reflects the dynamic evolution characteristics of professional knowledge; finally, it achieves deep integration and logical alignment between a large language model in the recruitment field and the temporal knowledge graph.
[0077] This invention introduces semantic bias identification and data augmentation techniques during the data preprocessing stage to filter out and correct biases in the original data at the source, thereby improving the fairness and objectivity of the final recommendation results.
[0078] This invention constructs a dynamic occupational knowledge graph that can capture and infer trends in skill popularity, salary levels, and other factors over time, thereby providing job seekers with more timely career development advice.
[0079] This invention trains a large language model using graph path consistency loss and introduces path search and generation calibration mechanisms during inference, ensuring that the model is always constrained by facts and logic, thereby enhancing the accuracy and reliability of job recommendations and career planning suggestions. Attached Figure Description
[0080] The accompanying drawings illustrate exemplary embodiments of the present invention and, together with the description thereof, serve to explain the principles of the invention. These drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, but do not constitute a limitation on the embodiments of the present invention.
[0081] Figure 1 This is a flowchart illustrating the job recommendation method based on knowledge graphs and large language models according to the present invention.
[0082] Figure 2 This is a flowchart illustrating Embodiment 2 of the present invention.
[0083] Figure 3This is a flowchart illustrating Embodiment 3 of the present invention.
[0084] Figure 4 This is a flowchart illustrating Embodiment 4 of the present invention. Detailed Implementation
[0085] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0086] It should also be noted that, for ease of description, only the parts relevant to the present invention are shown in the accompanying drawings.
[0087] Where there is no conflict, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0088] To enable those skilled in the art to better understand the technical solutions of the present invention, some of the technical terms involved in the invention will be explained below.
[0089] Large Language Model (LLM): Refers to a neural network model based on deep learning and pre-trained on massive amounts of text data. This type of model possesses powerful natural language understanding and generation capabilities, able to generate logically sound and grammatically correct text based on the input context. In this invention, it specifically refers to a model fine-tuned using a recruitment-specific dataset to understand user intent and generate job recommendations and career planning suggestions.
[0090] Knowledge graph: A structured semantic network used to represent entities and their relationships in the real world. It consists of nodes and edges, where nodes represent entities (such as "company" or "skill") and edges represent relationships between entities (such as "requirement" or "located").
[0091] Dynamic Occupational Knowledge Graph: The special knowledge graph constructed by this invention is "dynamic" in that the relation edges in the graph not only represent the connection between entities, but also have "temporal attributes" (such as timestamps), and the "embedding vectors" of the nodes in the graph will dynamically evolve according to these temporal attributes, thereby capturing and reflecting the real-time changing trends of the occupational market.
[0092] Semantic bias refers to unfairness hidden in textual data that targets specific groups (such as gender, age, or region). In recruitment data, this often manifests as subtle biases in job descriptions, where the words used subtly favor a particular group, thus affecting the fairness of the algorithm.
[0093] Word vectors: These are vectors that map words in a text into a continuous, dense, low-dimensional vector space. In this space, each word is represented as a numerical vector, and semantically similar words are closer together in the space.
[0094] Generative Adversarial Networks (GANs) are deep learning model frameworks consisting of a generator G and a discriminator D. The generator is responsible for generating data samples similar to real data; the discriminator is responsible for determining whether the input data is real or fabricated by the generator. Through mutual interaction and joint training, the two ultimately enable the generator to create high-quality synthetic data.
[0095] Embedded vector: In the field of artificial intelligence, it refers to a dense vector that represents a discrete object (such as an entity, a relation, or a word) as a real value.
[0096] Time-aware relational attention network: Time-aware refers to the network's ability to process and utilize timestamp information in relations; relation refers to the network's specific ability to process multiple types of relations in the graph; attention refers to the network's ability to give different neighboring nodes different levels of attention (weights) when aggregating information, just like humans.
[0097] Relational Path Consistency Loss: During training, it penalizes situations where the entity relation logic expressed within the large language model is inconsistent with the existing high-confidence multi-step reasoning paths in the knowledge graph, thereby forcing the model to learn and internalize the structured knowledge of the knowledge graph.
[0098] Structured constraints refer to injecting high-confidence logical paths (usually a series of fact triples) found in the knowledge graph as a strong guiding signal into the input of the large language model to ensure that the core logic of the generated content is accurate.
[0099] Example 1
[0100] like Figure 1 As shown, this embodiment provides a job recommendation method based on knowledge graphs and large language models. This method can be applied to intelligent recruitment devices or online recruitment platforms. First, a high-quality data foundation is built; second, a dynamically evolving domain knowledge core is constructed; and finally, an intelligent model is trained to achieve the final application goal.
[0101] like Figure 1 As shown below, the key steps in this process will be explained in detail:
[0102] S1. Acquire and process recruitment data, identify semantic biases in the recruitment data, filter out biased data, perform data balancing and enhancement on the recruitment data, and generate a dedicated training dataset.
[0103] First, a massive amount of raw recruitment data was acquired from multiple channels. This data was then deeply processed to identify and quantify potential semantic biases in the text, and biased data was filtered out. After data purification, categories with insufficient representativeness were balanced and augmented, ultimately forming a specialized dataset.
[0104] S2. Based on the training dataset, construct a dynamic occupational knowledge graph, wherein the entities and relationships in the dynamic occupational knowledge graph include temporal attributes.
[0105] A knowledge graph is a structured knowledge base that uses information such as "company" and "job" as entities and "required skills" as relationships. The entity relationships in the graph include temporal attributes, such as the timestamp of information publication, enabling the knowledge graph to capture and reflect the dynamic changes in the job market.
[0106] S3. Train a large language model in the recruitment field and establish an interaction mechanism between the large language model and the dynamic occupational knowledge graph. When the large language model generates text for job recommendations or career planning suggestions, its generation process is constrained by the logical path and facts of the dynamic occupational knowledge graph.
[0107] The dataset from step S1 is used to fine-tune a general-purpose large language model, giving it expertise in the recruitment field. A special interaction mechanism is established to ensure that when the large language model generates content (e.g., recommending jobs or providing career advice to users), its thinking and output processes are strictly constrained and guided by the factual logic and reasoning paths in the dynamic career knowledge graph constructed in step S2, rather than engaging in unfounded free generation.
[0108] Example 2
[0109] This embodiment is based on Embodiment 1, and elaborates on step S1 in detail, such as... Figure 2 As shown, step S1 specifically includes:
[0110] S11. Collect raw recruitment data from multiple data sources containing unstructured text, and extract entities and relationships between entities from them.
[0111] The system collects raw recruitment data, i.e., "unstructured text," containing a large amount of natural language descriptions from multiple online data sources, such as major recruitment websites and official company websites. Then, the system uses natural language processing technology to identify and extract preset key information from this text. For example, it identifies "Alibaba" as a "company" entity and "Java" as a "skill" entity, and extracts the "requirement" relationships between them, thereby transforming the raw, unordered text information into structured data.
[0112] S12. Quantify the semantic bias score of each document in the recruitment data using a semantic model.
[0113] S13. Based on a preset bias threshold, filter out documents with semantic bias scores higher than the bias threshold.
[0114] The system will iterate through the semantic bias scores of all documents and identify those documents with scores exceeding the bias threshold as highly biased data, and then remove them from the dataset.
[0115] S14. For categories in the filtered recruitment data that are not representative enough, perform data balancing and data augmentation to generate the dedicated training dataset.
[0116] After filtering, certain job categories in the dataset (e.g., emerging or less popular positions) may become sparsely represented, i.e., "underrepresented categories." To prevent the model from performing poorly on these categories due to insufficient training samples, data balancing and data augmentation techniques are employed. For example, algorithms automatically generate a batch of new recruitment data texts that are highly similar to these sparse categories semantically and logically, thus expanding the sample size. Finally, this augmented data is merged with the original clean data to form the final dedicated training dataset.
[0117] The following describes the method for quantifying the semantic bias score in step S12. First, the bias tendency of a single word is determined by calculating the difference in cosine similarity between the target word and the two sets of opposing attribute words in the semantic space. Then, the bias degree of all relevant bias words in a document and their attention weight in the document context are considered comprehensively, and the final bias score of the entire document is calculated by weighted averaging.
[0118] Specific calculation methods include:
[0119] Calculate the basic vocabulary bias score for a single word or a group of words. : .
[0120] Calculate job description documents semantic bias score : ;
[0121] in, A set of target concept words (e.g., words related to men or women).
[0122] For two sets of opposing attribute concept vocabulary (e.g., It can be words related to hard skills such as "technology" and "analysis," while These are words related to soft skills such as "assistance" and "support");
[0123] For document The first in One word;
[0124] For words Word vectors obtained from a pre-trained language model;
[0125] For the target concept set The mean vector of all word vectors in the text. ;
[0126] For vectors and The cosine similarity between two word vectors is used to measure the angle between them in space, thereby determining their semantic similarity.
[0127] For a single word Relative to attribute set and Bias score;
[0128] A set of words that carry biased information;
[0129] This is an indicator function; its value is 1 when the condition is true, and 0 otherwise.
[0130] For words In the document Attention weights in the context of attention.
[0131] The following section details the methods for data balancing and data augmentation:
[0132] S141. Construct a generative adversarial network containing a generator and a discriminator. Use the generator to generate recruitment data text for data augmentation. The generator can generate new recruitment data text out of thin air. The discriminator determines whether a piece of text is real original data or forged by the generator.
[0133] S142. The generative adversarial network is trained using a composite loss function, wherein the composite loss function includes a knowledge graph consistency loss term, which is used to ensure that the text generated by the generator conforms to the constraints of the dynamic occupational knowledge graph in terms of semantic logic.
[0134] If the generated content contradicts the facts in the knowledge graph in terms of professional logic (for example, generating an unreasonable description that a "junior accountant" position requires "ten years of management experience"), the loss item will generate a penalty signal, thereby forcing the generator to learn and generate content that is more in line with domain common sense.
[0135] S143. Using the trained generator, generate new recruitment data text for categories that are underrepresented.
[0136] Once the generative adversarial network (GAN) reaches the preset standards through the above training, its generator will possess the ability to generate high-quality text. At this point, the system will use this trained generator to specifically generate entirely new recruitment data text for categories that are "underrepresented" in the dataset.
[0137] S144. Merge the new recruitment data text with the filtered recruitment data to form a dedicated training dataset.
[0138] Among them, the knowledge graph consistency loss term Calculated using the following formula: ;
[0139] Text generated by a generator for generating adversarial networks;
[0140] Entity relation triples extracted from generated text A set;
[0141] These are the vector representations of the head entity, relation, and tail entity in the knowledge graph embedding space, respectively.
[0142] It is a distance metric between vectors;
[0143] These are the boundary hyperparameters used to control the rational boundary of ternary combinatorial systems.
[0144] Example 3
[0145] This embodiment provides a detailed explanation of the construction of the dynamic occupational knowledge graph in step S2, such as... Figure 3 As shown, it specifically includes:
[0146] S21. Using the entities in the training dataset as nodes and the relationships between entities as edges with timestamps, construct the basic structure of the dynamic occupational knowledge graph.
[0147] All entities extracted from the training dataset (such as "Alibaba", "Data Scientist", "Python Skills" etc.) are used as "nodes" in the graph, and the relationships between entities (such as "recruitment", "requirements" etc.) are used as "edges" connecting the nodes. Each "edge" is appended with a "timestamp", which is usually derived from the release date of the original recruitment information.
[0148] S22. A time-aware relational attention network is used to aggregate the neighbor node information of each node, and the embedding vector of each node in the basic structure is trained and updated by combining the relational attention coefficient and the time decay function.
[0149] The temporal-aware relational attention network updates its embedding vector by aggregating information from each node's neighbors. During aggregation, relational attention coefficients allow the model to automatically determine which neighboring nodes are more significant to the current node, thus assigning them higher weights. The temporal decay function dynamically adjusts the influence of historical information on the current node's state based on the timestamps on relational edges, making more recent information have a greater impact.
[0150] S23. After the network training converges, obtain the final embedding vectors of all nodes in the knowledge graph.
[0151] After repeated training and optimization of the neural network in step S22, when the model's performance reaches a stable state (i.e., "convergence"), the embedding vector of each node in the system learns its best semantic representation in the entire knowledge network.
[0152] S24. The basic structure of the dynamic occupational knowledge graph is combined with the final embedding vector to form the dynamic occupational knowledge graph.
[0153] S25. When new recruitment data is obtained, the new entities and new relationships contained in the new recruitment data are incrementally added to the infrastructure, and the training update of step S22 is performed on the affected local subgraph.
[0154] That is, only the new entities and new relationships contained in the new data are added to the basic structure of the graph, and then the training and update process of step S22 is performed only on the "local subgraphs" affected by this new information.
[0155] The update rule for the temporal-aware relational attention network in step S22 can be precisely defined by the following mathematical formula:
[0156] Update each node using a layered propagation method. Embedded vector ,in The first representing the network The layer update rules are as follows: ;
[0157] Relationship Attention Coefficient : ;
[0158] Time decay function : ;
[0159] in, For entity nodes In the network Layer 3D embedding vector;
[0160] For nodes All neighboring nodes and their correspondence A set;
[0161] For relation types Related, in the The learnable linear transformation matrix of the layer;
[0162] It is a non-linear activation function;
[0163] For reference time points;
[0164] For connecting nodes and The timestamp of the relation edge;
[0165] For relation types Relevant, learnable decay rate parameters;
[0166] The attention coefficient represents the relationship between the two factors. and reference time Next, node For nodes Importance weights;
[0167] The unnormalized attention score;
[0168] For relation types Related, in the The learnable attention mechanism weight vector of the layer;
[0169] Nonlinear activation function;
[0170] For nodes Among the neighbors, through relationships A set of connected nodes.
[0171] Example 4
[0172] This embodiment elaborates on the process of training a large language model in the recruitment domain and establishing its interaction mechanism with a dynamic professional knowledge graph in step S3, such as... Figure 4 As shown, step S3 specifically includes:
[0173] S31. A large language model for the recruitment domain is trained using a composite loss function to align the internal knowledge representation of the large language model with the logical structure of the dynamic professional knowledge graph; the composite loss function includes autoregressive language model loss and relational path consistency loss.
[0174] The goal of autoregressive language model loss is to enable the model to learn the language itself and generate fluent sentences.
[0175] The role of relational path consistency loss is to continuously compare the model's internal knowledge representation with the logical structure of the dynamic occupational knowledge graph during the training process. If the two are inconsistent, a penalty signal is generated, thereby forcing the large language model to learn and internalize the facts and logic in the knowledge graph while learning the language.
[0176] S32. Upon receiving a user query, identify the key entities in the query, and use the key entities as the starting point or end point to search for high-confidence logical paths connecting the key entities in the dynamic occupational knowledge graph.
[0177] Upon receiving a user's query, the system first uses a large language model to identify key entities in the query (e.g., the user wants to transition from "marketing specialist" to "product manager"). Then, using these key entities as starting or ending points, the system searches a dynamic career knowledge graph to find high-confidence logical paths connecting these entities (e.g., the path might include facts such as "product manager" requiring "data analysis" skills and an average salary of "25k / month").
[0178] S33. Using the high-confidence logical path as a structured constraint, guide the large language model to generate text for job recommendations or career planning suggestions based on the constraint.
[0179] In addition, the composite loss function in step S31 is defined by the following formula. ;in, For autoregressive language model loss, For relationship path consistency loss, To balance the weights;
[0180] The method for determining the consistency loss of the relational path includes:
[0181] S311, For the input text sequence Identify the set of entities existing in the dynamic occupational knowledge graph. And randomly sample the connected entities with a length of Relationship path ;
[0182] S312. Based on the embedding vectors of entities and relationships in the dynamic professional knowledge graph, calculate the graph path authenticity score. ; ;in, and These are the temporal embedding vectors of entities and relations, respectively. This is achieved by measuring the translation distance between the entity and relation vectors at each step in the path. The higher the score, the more reasonable the path is in the structure of the knowledge graph.
[0183] S313, Utilizing the aforementioned large language model and the additional linear header Calculate the path score predicted by the large language model for the relation path. : ,in, The hidden state vector output by the large language model;
[0184] S314. Based on the mean squared error between the authenticity score of the graph path and the predicted path score of the large language model, the relationship path consistency loss term is calculated. : ;in, This is a set of relational paths sampled from the training text.
[0185] Example 5
[0186] A job recommendation terminal based on knowledge graphs and large language models includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the job recommendation method based on knowledge graphs and large language models as described above.
[0187] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instruction data structures, program modules, or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid-state storage technologies, CD-ROM, DVD or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types. The aforementioned system memories and mass storage devices can be collectively referred to as memory.
[0188] A computer program product includes a computer program / instructions that, when executed by a processor, implement the job recommendation method based on knowledge graphs and large language models as described above.
[0189] Computer program products include computer programs or instruction sets used to perform specific tasks or achieve specific functions. These programs or instructions are designed to be executed by a processor to implement a series of predefined steps or operations. The program product may be stored in various forms of computer storage media, such as memory, hard disks, solid-state drives, optical discs, or other forms of digital storage devices. It may exist in the form of compiled binary code or in the form of scripts or bytecode that can be executed by an interpreter. Through carefully designed algorithms and logical instructions, the program product enables the processor to process data in a specific order and manner, performing various functions such as data analysis, user interaction, and device control.
[0190] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment / mode or example is included in at least one embodiment / mode or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.
[0191] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0192] Those skilled in the art should understand that the above embodiments are merely for illustrating the present invention and are not intended to limit the scope of the invention. Those skilled in the art can make other changes or modifications based on the above invention, and these changes or modifications still fall within the scope of the present invention.
Claims
1. A job recommendation method based on knowledge graphs and large language models, characterized in that, include: S1. Acquire and process recruitment data, identify semantic biases in the recruitment data, filter out biased data, perform data balancing and enhancement on the recruitment data, and generate a dedicated training dataset. S2. Based on the training dataset, construct a dynamic occupational knowledge graph, wherein the entities and relations in the dynamic occupational knowledge graph include temporal attributes; S3. Train a large language model in the recruitment field and establish an interaction mechanism between the large language model and the dynamic occupational knowledge graph. When the large language model generates text for job recommendations or career planning suggestions, its generation process is constrained by the logical path and facts of the dynamic occupational knowledge graph.
2. The job recommendation method based on knowledge graph and large language model according to claim 1, characterized in that, Step S1 specifically includes: S11. Collect raw recruitment data from multiple data sources containing unstructured text, and extract entities and relationships between entities from them. S12. Quantify the semantic bias score of each document in the recruitment data using a semantic model; S13. Based on a preset bias threshold, filter out documents with semantic bias scores higher than the bias threshold; S14. For categories in the filtered recruitment data that are not representative enough, perform data balancing and data augmentation to generate the dedicated training dataset.
3. The job recommendation method based on knowledge graphs and large language models according to claim 2, characterized in that, Methods for quantifying semantic bias scores include: Calculate vocabulary bias score : ; Calculate job description documents semantic bias score : ; in, A set of vocabulary related to the target concept; It is a set of two opposing attribute concept words; For document The first in One word; For words Word vectors obtained from a pre-trained language model; For the set of target concepts The mean vector of all word vectors in the text. ; For vectors and Cosine similarity between them; For a single word Relative to attribute set and Bias score; A set of words that carry biased information; This is an indicator function; its value is 1 when the condition is true, and 0 otherwise. For words In the document Attention weights in the context of attention.
4. The job recommendation method based on knowledge graphs and large language models according to claim 2, characterized in that, The methods for performing data balancing and data augmentation are as follows: S141. Construct a generative adversarial network containing a generator and a discriminator, and use the generator to generate recruitment data text for data augmentation; S142. The generative adversarial network is trained using a composite loss function, wherein the composite loss function includes a knowledge graph consistency loss term, which is used to ensure that the text generated by the generator conforms to the constraints of the dynamic occupational knowledge graph in terms of semantic logic. S143. Using the trained generator, generate new recruitment data text for categories that are underrepresented; S144. Merge the new recruitment data text with the filtered recruitment data to form a dedicated training dataset. Among them, the knowledge graph consistency loss term Calculated using the following formula: ; Text generated by a generator for generating adversarial networks; Entity relation triples extracted from generated text A set; These are the vector representations of the head entity, relation, and tail entity in the knowledge graph embedding space, respectively. It is a distance metric between vectors; These are the boundary hyperparameters used to control the rational boundary of ternary combinatorial systems.
5. The job recommendation method based on knowledge graphs and large language models according to claim 1, characterized in that, Step S2 specifically includes: S21. Using the entities in the training dataset as nodes and the relationships between entities as edges with timestamps, construct the basic structure of the dynamic occupational knowledge graph. S22. A time-aware relational attention network is used to aggregate the neighbor node information of each node, and the embedding vector of each node in the basic structure is trained and updated by combining the relational attention coefficient and the time decay function. S23. After the network training converges, obtain the final embedding vectors of all nodes in the knowledge graph; S24. Combine the basic structure of the dynamic occupational knowledge graph with the final embedding vector to form the dynamic occupational knowledge graph; S25. When new recruitment data is obtained, the new entities and new relationships contained in the new recruitment data are incrementally added to the infrastructure, and the training update of step S22 is performed on the affected local subgraph.
6. The job recommendation method based on knowledge graphs and large language models according to claim 5, characterized in that, Update each node using a layered propagation method. Embedded vector ,in The first representing the network The layer update rules are as follows: ; Relationship Attention Coefficient : ; Time decay function : ; in, For entity nodes In the network Layer 3D embedding vector; For nodes All neighboring nodes and their correspondence A set; For relation types Related, in the The learnable linear transformation matrix of the layer; It is a non-linear activation function; For reference time points; For connecting nodes and The timestamp of the relation edge; For relation types Relevant, learnable decay rate parameters; The attention coefficient represents the relationship between the two factors. and reference time Next, node For nodes Importance weights; The unnormalized attention score; For relation types Related, in the The learnable attention mechanism weight vector of the layer; Nonlinear activation function; For nodes Among the neighbors, through relationships A set of connected nodes.
7. The job recommendation method based on knowledge graphs and large language models according to claim 1, characterized in that, Step S3 specifically includes: S31. A large language model for the recruitment domain is trained using a composite loss function to align the internal knowledge representation of the large language model with the logical structure of the dynamic professional knowledge graph; the composite loss function includes autoregressive language model loss and relational path consistency loss. S32. Upon receiving a user query, identify the key entities in the query, and use the key entities as the starting point or end point to search for high-confidence logical paths connecting the key entities in the dynamic occupational knowledge graph. S33. Using the high-confidence logical path as a structured constraint, guide the large language model to generate text for job recommendations or career planning suggestions based on the constraint.
8. The job recommendation method based on knowledge graph and large language model according to claim 7, characterized in that, The composite loss function ;in, For autoregressive language model loss, For relationship path consistency loss, To balance the weights; The method for determining the consistency loss of the relational path includes: S311, For the input text sequence Identify the set of entities existing in the dynamic occupational knowledge graph. And randomly sample the connected entities with a length of Relationship path ; S312. Based on the embedding vectors of entities and relationships in the dynamic professional knowledge graph, calculate the graph path authenticity score. ; ;in, and These are the temporal embedding vectors of entities and relations, respectively; S313, Utilizing the aforementioned large language model and the additional linear header Calculate the path score predicted by the large language model for the relation path. : ,in, The hidden state vector output by the large language model; S314. Based on the mean squared error between the authenticity score of the graph path and the predicted path score of the large language model, the relationship path consistency loss term is calculated. : ; in, This is a set of relational paths sampled from the training text.
9. A job recommendation terminal based on knowledge graphs and large language models, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the job recommendation method based on knowledge graph and large language model as described in any one of claims 1-8.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the job recommendation method based on knowledge graphs and large language models as described in any one of claims 1-8.
Citation Information
Cited By
Data processing method and device and storage medium
CN116911683A
