Method and apparatus for text matching
By using knowledge graphs in the recruitment system to extract keywords and combining neural network models to generate text vectors, the problem of low accuracy of resumes and positions matching in the prior art is solved, and more efficient job or resume recommendation services are achieved.
Patent Information
- Application Number
- CN202010097271.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-17
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2040-02-17
AI Technical Summary
In the prior art, the accuracy of matching resume and job information is low, resulting in low accuracy of job or resume recommendations.
By extracting keywords in resume text and job text based on the knowledge graph, and using the trained neural network model to generate text vectors, calculate the similarity of vectors to judge the matching.
Improve the matching accuracy of resume text and job text, thereby improving the accuracy of job or resume recommendation services.
Smart Images

Figure CN113268560B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for text matching. Background Art
[0002] With the development of Internet technology, online recruitment and job hunting have become important channels for recruiters and job seekers. Faced with a large number of positions posted online, it is usually difficult for job seekers to quickly find a suitable position for themselves. At the same time, it is usually difficult for recruiters to quickly find resumes suitable for the positions they posted. How to achieve accurate matching of resumes and job information, and then provide accurate recommendation services, is the key to solving the above problems.
[0003] In the process of implementing the present invention, the inventor of the present invention found that: in the prior art, job or resume recommendations are usually made based on the user's browsing history, and few job or resume recommendations are made by calculating whether the resume matches the job information. Even if there are job or resume recommendations made by calculating whether the resume matches the job information, there are still problems such as low accuracy in matching the resume with the job information and poor accuracy in job or resume recommendations. Summary of the invention
[0004] In view of this, the present invention provides a method and device for text matching, which can improve the matching accuracy of resume text and position text, thereby improving the accuracy of position or resume recommendation services.
[0005] To achieve the above objective, according to a first aspect of the present invention, a method for text matching is provided.
[0006] The method for text matching of the present invention includes: extracting keywords from a resume text and a position text based on a knowledge graph; generating a vector of the resume text and a vector of the position text based on a trained first neural network model when the number of keywords in the resume text and the position text is greater than a preset threshold; determining the similarity between the vector of the resume text and the vector of the position text, and then judging whether the resume text and the position text match based on the similarity.
[0007] Optionally, the method also includes: when the number of keywords in the resume text or the number of keywords in the position text is less than a preset threshold, generating a vector of the resume text and a vector of the position text based on a trained second neural network model; wherein the second neural network model is a pre-trained model.
[0008] Optionally, the method also includes: constructing a first twin network based on the first neural network model, and constructing a second twin network based on the second neural network model; performing supervised training on the first twin network according to the first training sample set to obtain the trained first neural network model; performing supervised training on the second twin network according to the second training sample set to obtain the trained second neural network model; wherein the first training sample set and the second training sample set include: sample pairs of resume text and position text with category labels; the category labels are used to indicate whether the sample pairs match.
[0009] Optionally, the method further includes: obtaining sample pairs of resume text and position text with category labels, performing data augmentation on the sample pairs, and then constructing a first training sample set and a second training sample set based on the sample pairs after data augmentation.
[0010] Optionally, the first neural network model is a TextCNN model; the second neural network model includes: a BERT model, and a fully connected layer.
[0011] Optionally, the generating of the resume text vector and the position text vector based on the trained first neural network model includes: vectorizing each keyword in the resume text to obtain a word vector corresponding to each keyword; inputting the word vector corresponding to each keyword in the resume text into the trained TextCNN model to obtain the resume text vector; vectorizing the keywords in the position text to obtain a word vector corresponding to each keyword; inputting the word vector corresponding to each keyword in the position text into the trained TextCNN model to obtain the position text vector.
[0012] Optionally, generating a vector of a resume text and a vector of a position text based on a trained second neural network model includes: dividing the resume text into multiple paragraph texts of equal length, and inputting the multiple paragraph texts into a trained BERT model to obtain a vector corresponding to each paragraph text; inputting the vector corresponding to each paragraph text into a trained fully connected layer to obtain a vector of the resume text; converting the position text into a text of the same length as the paragraph text, and then inputting it into the trained BERT model and the trained fully connected layer in sequence to obtain a vector of the position text.
[0013] To achieve the above objective, according to a second aspect of the present invention, a resume recommendation method is provided.
[0014] The resume recommendation method of the present invention includes: extracting keywords from resume text and position text based on a knowledge graph; generating a vector of the resume text and a vector of the position text based on a trained first neural network model when the number of keywords in the resume text and the position text is greater than a preset threshold; determining the similarity between the vector of the resume text and the vector of the position text, and judging whether the resume text and the position text match based on the similarity; generating a resume recommendation list based on the resume text that matches the position text, and sending the resume recommendation list to the recruitment user terminal corresponding to the position text.
[0015] To achieve the above objective, according to a third aspect of the present invention, a job recommendation method is provided.
[0016] The job recommendation method of the present invention includes: extracting keywords from a resume text and a job text based on a knowledge graph; generating a vector of the resume text and a vector of the job text based on a trained first neural network model when the number of keywords in the resume text and the job text is greater than a preset threshold; determining the similarity between the vector of the resume text and the vector of the job text, and judging whether the resume text and the job text match based on the similarity; generating a job recommendation list based on the job text that matches the resume text, and sending the job recommendation list to a job seeker terminal corresponding to the resume text.
[0017] To achieve the above objective, according to a fourth aspect of the present invention, a device for text matching is provided.
[0018] The device for text matching of the present invention includes: an extraction module, which is used to extract keywords in a resume text and a position text based on a knowledge graph; a generation module, which is used to generate a vector of the resume text and a vector of the position text based on a trained first neural network model when the number of keywords in the resume text and the position text is greater than a preset threshold; and a judgment module, which is used to determine the similarity between the vector of the resume text and the vector of the position text, and then judge whether the resume text and the position text match based on the similarity.
[0019] To achieve the above objective, according to a fifth aspect of the present invention, a resume recommendation device is provided.
[0020] The resume recommendation device of the present invention includes: an extraction module, which is used to extract keywords in the resume text and the position text based on the knowledge graph; a generation module, which is used to generate a vector of the resume text and a vector of the position text based on a trained first neural network model when the number of keywords in the resume text and the position text is greater than a preset threshold; a judgment module, which is used to determine the similarity between the vector of the resume text and the vector of the position text, and judge whether the resume text and the position text match based on the similarity; a resume recommendation module, which is used to generate a resume recommendation list based on the resume text that matches the position text, and send the resume recommendation list to the recruitment user terminal corresponding to the position text.
[0021] To achieve the above objective, according to a sixth aspect of the present invention, a job recommendation device is provided.
[0022] The job recommendation device of the present invention includes: an extraction module, which is used to extract keywords in a resume text and a job text based on a knowledge graph; a generation module, which is used to generate a vector of the resume text and a vector of the job text based on a trained first neural network model when the number of keywords in the resume text and the job text is greater than a preset threshold; a judgment module, which is used to determine the similarity between the vector of the resume text and the vector of the job text, and judge whether the resume text and the job text match based on the similarity; a job recommendation module, which is used to generate a job recommendation list based on the job text matching the resume text, and send the job recommendation list to the job seeker user terminal corresponding to the resume text.
[0023] To achieve the above objective, according to a seventh aspect of the present invention, an electronic device is provided.
[0024] The electronic device of the present invention comprises: one or more processors; and a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the text matching method or resume recommendation method or job recommendation method of the present invention.
[0025] To achieve the above objective, according to an eighth aspect of the present invention, a computer readable medium is provided.
[0026] The computer-readable medium of the present invention stores a computer program thereon, and when the program is executed by a processor, the method for text matching or the resume recommendation method or the position recommendation method of the present invention is implemented.
[0027] An embodiment of the above invention has the following advantages or beneficial effects: by extracting keywords from resume text and position text based on a knowledge graph, when the number of keywords in the resume text and the position text is greater than a preset threshold, generating a vector of the resume text and a vector of the position text based on a trained first neural network model, determining the similarity between the vector of the resume text and the vector of the position text, and then judging whether the resume text and the position text match based on the similarity. These steps can improve the matching accuracy of the resume text and the position text, thereby improving the accuracy of the position or resume recommendation service.
[0028] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0030] Figure 1 is a schematic diagram of the main flow of a method for text matching according to a first embodiment of the present invention;
[0031] Figure 2 is a partial flow chart of a method for text matching according to a second embodiment of the present invention;
[0032] Figure 3 is a partial flow chart of a method for text matching according to a second embodiment of the present invention;
[0033] Figure 4 is a schematic diagram of the main flow of the resume recommendation method according to the third embodiment of the present invention;
[0034] Figure 5 is a schematic diagram of the main flow of a job recommendation method according to a fourth embodiment of the present invention;
[0035] Figure 6 is a schematic diagram of main modules of an apparatus for text matching according to a fifth embodiment of the present invention;
[0036] Figure 7 is a schematic diagram of main modules of a resume recommendation device according to a sixth embodiment of the present invention;
[0037] Figure 8 is a schematic diagram of main modules of a job recommendation device according to a seventh embodiment of the present invention;
[0038] Fig. 9 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0039] Fig.10It is a schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0041] It should be pointed out that the embodiments of the present invention and the features in the embodiments may be combined with each other if there is no conflict.
[0042] Figure 1 FIG. 1 is a schematic diagram of the main flow of the method for text matching according to the first embodiment of the present invention. Figure 1 As shown, the method for text matching in an embodiment of the present invention includes:
[0043] Step S101: extract keywords from resume text and job text based on the knowledge graph.
[0044] The knowledge graph is a graph-based data structure consisting of nodes and edges. In the knowledge graph, each node represents an "entity" that exists in the real world, and each edge is a "relationship" between entities. In layman's terms, the knowledge graph is a relationship network obtained by connecting all heterogeneous information together.
[0045] Exemplarily, step S101 may specifically include: 1. Identifying keywords in a resume text or a job text based on a knowledge graph, wherein the keywords are mainly skill vocabulary. For example, if the word "vue" in the resume text appears in the knowledge graph and is a skill vocabulary, the word can be extracted; 2. Merging synonyms based on the knowledge graph. For example, "vue", "vue.js", "vuejs", "vue framework" and "vue front-end framework" all have the same meaning. These synonyms can be merged based on the knowledge graph, such as uniformly representing them as "vue".
[0046] In specific implementation, the knowledge graph can be stored in a graph database (such as Neo4j), and then the keywords in the resume text and the position text can be extracted by accessing the knowledge graph in the graph database. In addition, in order to facilitate quick online access, the knowledge graph can also be stored in the memory in the form of a document, and the keywords in the resume text and the position text can be extracted by accessing the document corresponding to the knowledge graph. Among them, the document corresponding to the knowledge graph may include: a vocabulary index table, a relationship index table, and a relationship table. The vocabulary index table may include the index of each word in the knowledge graph, such as the index of Vue is 1 and the index of Vue.js is 2; the relationship index may include the index of various relationships in the knowledge graph, such as the index of the relationship of "synonym" is 1, the index of the relationship of "same scope" is 2, the index of the relationship of "sub-skill" is 3, and the index of the relationship of "parent skill" is 4; the relationship table may include the relationship between various words, which can be expressed in the form of "subject-relationship-object", such as "1 1 2" means "Vue and Vue.js are synonyms".
[0047] In the embodiment of the present invention, considering that resumes involve various industry fields, it is difficult to maintain a certain accuracy in various industry fields if word segmentation is performed based on ordinary dictionaries. Since the knowledge graph carries clear industry field information, this problem can be solved by introducing the knowledge graph to extract keywords. Moreover, since the knowledge graph contains the relationship between words, such as synonym relationships, these words with the same meaning can be merged by introducing the knowledge graph, which helps to improve the subsequent matching accuracy, and it is also convenient to extract more keywords through synonym relationships.
[0048] Step S102: When the number of keywords in the resume text and the position text is greater than a preset threshold, a vector of the resume text and a vector of the position text are generated based on the trained first neural network model.
[0049] For example, in a specific application scenario, the preset threshold can be set to 5. When the number of keywords extracted from the resume text is greater than 5 and the number of keywords extracted from the position text is greater than 5, it is considered that the number of keywords extracted through the knowledge graph is sufficient, and then the resume text vector and the position text vector can be generated based on the trained first neural network model. The preset threshold related to the number of keywords can be flexibly set without affecting the implementation of the present invention.
[0050] Exemplarily, the trained first neural network model can be obtained in the following manner: constructing a first twin network based on the first neural network model, and performing supervised training on the first twin network according to a first training sample set to obtain the trained first neural network model; the first training sample set includes: sample pairs of resume text and position text with category labels; the category labels are used to indicate whether the sample pairs match.
[0051] Among them, the first Siamese Network has two sub-networks with the same structure and shared weights. The two sub-networks receive one of the sample pairs (i.e., one receives the resume text in the sample pair, and the other receives the position sample in the sample pair) and converts it into a vector. During the training process, the loss function can be calculated based on the two output vectors to continuously perform back-propagation optimization on the Siamese Network, so that the distance between the matching position text and the resume text in the vector space is close, and the distance between the unmatched position text and the resume text in the vector space is far.
[0052] In an optional exemplary embodiment, the first neural network model is a TextCNN model. The TextCNN model is a convolutional neural network model. In this optional example, a vector of the resume text and a vector of the position text can be generated based on the trained TextCNN model. In addition, in a specific implementation, the first neural network model can also adopt an LSTM (Long Short-Term Memory Network) model, or other models that can be used to generate vector representations of text.
[0053] Step S103: determine the similarity between the vector of the resume text and the vector of the position text, and then determine whether the resume text and the position text match based on the similarity.
[0054] In this step, the cosine similarity (or "cosine distance") between the vector of the resume text and the vector of the position text can be calculated, and the cosine similarity can be used as the similarity calculation result. In addition, in the specific implementation, other methods can be used to calculate the similarity between the vector of the resume text and the vector of the position text. For example, the Euclidean distance between the vector of the resume text and the vector of the position text can be calculated, and the Euclidean distance can be used as the similarity calculation result.
[0055] Exemplarily, judging whether the resume text and the position text match according to the similarity includes: comparing the similarity between the resume text vector and the position text vector with a preset threshold; if the similarity is greater than the preset threshold, determining that the resume text matches the position text; otherwise, determining that the resume text does not match the position text. The preset threshold can be flexibly set. For example, the preset threshold can be set to 0.9, 0.8 or other values.
[0056] In an embodiment of the present invention, by extracting keywords from a resume text and a position text based on a knowledge graph, when the number of keywords in the resume text and the position text is greater than a preset threshold, a vector of the resume text and a vector of the position text are generated based on a trained first neural network model, the similarity between the vector of the resume text and the vector of the position text is determined, and then whether the resume text and the position text match is determined based on the similarity. These steps can improve the matching accuracy of the resume text and the position text, thereby improving the accuracy of the position or resume recommendation service.
[0057] Figure 2 FIG. 1 is a partial flow chart of a method for text matching according to a second embodiment of the present invention. Figure 2 As shown, the method for text matching in an embodiment of the present invention includes:
[0058] Step S201: extract keywords from resume text and job text based on the knowledge graph.
[0059] The knowledge graph is a graph-based data structure consisting of nodes and edges. In the knowledge graph, each node represents an "entity" that exists in the real world, and each edge is a "relationship" between entities. In layman's terms, the knowledge graph is a relationship network obtained by connecting all heterogeneous information together.
[0060] Exemplarily, step S201 may specifically include: 1. Identifying keywords in a resume text or a job text based on a knowledge graph, wherein the keywords are mainly skill vocabulary. For example, if the word "vue" in the resume text appears in the knowledge graph and is a skill vocabulary, the word can be extracted; 2. Merging synonyms based on the knowledge graph. For example, "vue", "vue.js", "vuejs", "vue framework" and "vue front-end framework" all have the same meaning. These synonyms can be merged based on the knowledge graph, for example, they can be uniformly represented as "vue".
[0061] In specific implementation, the knowledge graph can be stored in a graph database (such as Neo4j), and then the keywords in the resume text and the position text can be extracted by accessing the knowledge graph in the graph database. In addition, in order to facilitate quick online access, the knowledge graph can also be stored in the memory in the form of a document, and the keywords in the resume text and the position text can be extracted by accessing the document corresponding to the knowledge graph. Among them, the document corresponding to the knowledge graph may include: a vocabulary index table, a relationship index table, and a relationship table. The vocabulary index table may include the index of each word in the knowledge graph, such as the index of Vue is 1 and the index of Vue.js is 2; the relationship index may include the index of various relationships in the knowledge graph, such as the index of the relationship of "synonym" is 1, the index of the relationship of "same scope" is 2, the index of the relationship of "sub-skill" is 3, and the index of the relationship of "parent skill" is 4; the relationship table may include the relationship between various words, which can be expressed in the form of "subject-relationship-object", such as "1 1 2" means "Vue and Vue.js are synonyms".
[0062] In the embodiment of the present invention, considering that resumes involve various industry fields, it is difficult to maintain a certain accuracy in various industry fields if word segmentation is performed based on ordinary dictionaries. Since the knowledge graph carries clear industry field information, this problem can be solved by introducing the knowledge graph to extract keywords. Moreover, since the knowledge graph contains the relationship between words, such as synonym relationships, these words with the same meaning can be merged by introducing the knowledge graph, which helps to improve the subsequent matching accuracy, and it is also convenient to extract more keywords through synonym relationships.
[0063] Step S202: Determine whether the number of keywords in the resume text and the position text is greater than a preset threshold. If the determination result is yes, step S203 may be executed; if the determination result is no, step S204 may be executed.
[0064] Considering that it is usually difficult to perfect the knowledge graph in actual situations, when extracting keywords based on the knowledge graph, it may be encountered that the number of extracted keywords is insufficient and cannot support the first neural network model for processing. In view of this, in the embodiment of the present invention, step S202 can be used to determine whether the number of extracted keywords is sufficient, and step S203 or step S204 is subsequently executed according to different judgment results.
[0065] For example, in a specific application scenario, the preset threshold can be set to 5. When the number of keywords extracted from the resume text is greater than 5 and the number of keywords extracted from the job text is greater than 5, it is considered that the number of keywords extracted through the knowledge graph is sufficient; when the number of keywords extracted from the resume text is less than or equal to 5, or the number of keywords extracted from the job text is less than or equal to 5, it is considered that the number of keywords extracted through the knowledge graph is insufficient. In specific implementation, the preset threshold can be flexibly set according to needs.
[0066] Step S203: Generate a vector of the resume text and a vector of the position text based on the trained first neural network model.
[0067] The first neural network model may be a TextCNN model, which is a convolutional neural network model.
[0068] In an embodiment of the present invention, generating a vector of a resume text and a vector of a position text based on a trained TextCNN model may specifically include: steps a1 to a4.
[0069] Step a1: vectorize each keyword in the resume text to obtain a word vector corresponding to each keyword. For example, the keywords extracted from the resume text can be input into a word2vec model to obtain a word vector corresponding to each keyword.
[0070] Step a2: Input the word vectors corresponding to each keyword in the resume text into the trained TextCNN model to obtain the vector of the resume text. In this step, the word vectors corresponding to each keyword in the resume text form a matrix, which can be input into the trained TextCNN model to output a resume text vector of a specified length (e.g., 32 dimensions).
[0071] Step a3: vectorize the keywords in the job text to obtain word vectors corresponding to each keyword. For example, the keywords extracted from the job text can be input into a word2vec model to obtain word vectors corresponding to each keyword.
[0072] Step a4: Input the word vectors corresponding to each keyword in the job text into the trained TextCNN model to obtain the vector of the job text. In this step, the word vectors corresponding to each keyword in the job text form a matrix, which can be input into the trained TextCNN model to output a vector of the job text of a specified length (e.g., 32 dimensions).
[0073] Step S204: Generate a resume text vector and a position text vector based on the trained second neural network model.
[0074] Among them, the second neural network model is a pre-trained model. In specific implementation, the trained second neural network model can be obtained by fine-tuning the pre-trained model. Exemplarily, the second neural network model may include: a BERT model, and a fully connected layer. In this example, generating a vector of the resume text and a vector of the position text based on the trained second neural network model includes: steps b1 to b3. The BERT model is a pre-trained model developed by Google, and its full name is Bidirectional Encoder Representations from Transformer. In specific implementation, different BERT models can be selected according to different NLP (natural language processing) tasks.
[0075] Step b1: divide the resume text into multiple paragraphs of equal length, and input the multiple paragraphs into a trained (or fine-tuned) BERT model to obtain vectors corresponding to each paragraph.
[0076] Taking into account that the number of words in a resume text is usually much larger than that in a position text, the difference in the number of words is likely to affect the subsequent matching accuracy. In view of this, in an embodiment of the present invention, the resume text is divided into multiple paragraph texts of equal length, and the position text is converted into a text of the same length as the paragraph text. For example, the resume text can be divided into 4 paragraph texts, each paragraph text is 150 characters. Among them, the position, major and self-description parts in the resume text can be divided into one paragraph text, the job description part is divided into one paragraph text, the job responsibilities part can be divided into one paragraph text, and the project description part is divided into one paragraph text. Afterwards, the four divided paragraph texts can be input into the trained BERT model to obtain vectors corresponding to the four paragraph texts (such as 4 768-dimensional vectors).
[0077] Step b2: Input the vectors corresponding to each paragraph text into the trained fully connected layer to obtain the vector of the resume text.
[0078] In this step, by inputting the vectors corresponding to each paragraph text into the trained fully connected layer, the vectors corresponding to each paragraph text can be merged into a resume text vector. For example, by inputting the vectors corresponding to four 768-dimensional paragraph texts into a 4*768*32 fully connected layer, a 32-dimensional resume text vector can be obtained.
[0079] Step b3: convert the job text into a text of the same length as the paragraph text, and then input it into the trained BERT model and the trained fully connected layer in sequence to obtain the vector of the job text.
[0080] For example, the job text can be converted into a paragraph text with a length of 150 characters, and then input into the trained BERT model and a trained 768*32 fully connected layer in sequence to obtain a 32-dimensional vector of the job text.
[0081] Step S205: Determine the similarity between the vector of the resume text and the vector of the position text.
[0082] In this step, the cosine similarity (or "cosine distance") between the vector of the resume text and the vector of the position text can be calculated, and the cosine similarity can be used as the similarity calculation result. In addition, in the specific implementation, other methods can be used to calculate the similarity between the vector of the resume text and the vector of the position text. For example, the Euclidean distance between the vector of the resume text and the vector of the position text can be calculated, and the Euclidean distance can be used as the similarity calculation result.
[0083] Step S206: Determine whether the similarity is greater than a preset threshold. If the similarity is greater than the preset threshold, step S207 may be executed; if the similarity is less than or equal to the preset threshold, step S208 may be executed.
[0084] The preset threshold value may be flexibly set, for example, the preset threshold value may be set to 0.9, 0.8, or other values.
[0085] Step S207: Determine whether the resume text matches the position text.
[0086] Step S208: Determine that the resume text and the position text do not match.
[0087] In an embodiment of the present invention, keywords in resume text and position text are extracted based on a knowledge graph, and according to the difference in the comparison result of the number of keywords in the resume text and the position text with a preset threshold, a vector of the resume text and a vector of the position text are selectively generated based on a trained first neural network model or a trained second neural network model. Thereafter, the similarity between the vector of the resume text and the vector of the position text is determined, and whether the resume text and the position text match is judged based on the similarity. These steps can improve the matching accuracy of the resume text and the position text, thereby improving the accuracy of the position or resume recommendation service, and at the same time, can improve the applicability of the matching method of the resume text and the position text.
[0088] Figure 3 FIG. 4 is a partial flowchart of a method for text matching according to a second embodiment of the present invention. Figure 3 This article mainly describes the training process of the first neural network model and the second neural network model. Figure 3As shown, the method of the embodiment of the present invention also includes:
[0089] Step S301: Obtain sample pairs of resume text and position text with category labels, and perform data augmentation on the sample pairs.
[0090] The category label is used to indicate whether the resume text and the position text in the sample pair match. In this step, the data augmentation can be performed in various forms, such as randomly changing the order of sentences, randomly changing the order of words in sentences, randomly deleting words, and randomly deleting sentences. For example, after dividing the resume text into multiple paragraphs, the order of sentences can be randomly changed in each part, the order of words in sentences can be randomly changed, and the like.
[0091] In the embodiment of the present invention, by performing data augmentation on labeled sample pairs, the number of labeled sample pairs can be increased, which solves the problem that supervised learning requires a large number of labeled samples and helps to improve the subsequent model training effect.
[0092] Step S302: construct a first training sample set and a second training sample set according to the sample pairs after data augmentation.
[0093] Step S303: Perform supervised training on the first twin network according to the first training sample set to obtain a trained first neural network model.
[0094] Among them, the first Siamese Network is mainly built based on the first neural network model (such as the TextCNN model), and has two sub-networks with the same structure and shared weights. The two sub-networks receive one of the sample pairs (i.e., one receives the resume text in the sample pair, and the other receives the position sample in the sample pair) and converts it into a vector. During the training process, the loss function can be calculated based on the two output vectors to continuously perform back-propagation optimization on the first Siamese Network, so that the matching position text and the resume text are close in the vector space, and the mismatched position text and the resume text are far apart in the vector space.
[0095] Step S304: Perform supervised training on the second twin network according to the second training sample set to obtain a trained second neural network model.
[0096] Among them, the second Siamese Network is mainly built based on the second neural network model, and has two sub-networks with the same structure and shared weights. The two sub-networks receive one of the sample pairs (i.e., one receives the resume text in the sample pair, and the other receives the position sample in the sample pair) and converts it into a vector. During the training process, the loss function can be calculated based on the two output vectors to continuously perform back propagation optimization on the second Siamese Network, so that the distance between the matching position text and the resume text in the vector space is close, and the distance between the unmatched position text and the resume text in the vector space is far.
[0097] Wherein, the second neural network model is a pre-trained model. When the second neural network model is a pre-trained model, the process of supervised training of the second twin network can be understood as the process of fine-tuning the second twin network. Exemplarily, the second neural network model can be composed of a BERT model and a fully connected layer.
[0098] In an embodiment of the present invention, the above steps can be used to train the first neural network model and the second neural network model so that the distance between the matching position text and the resume text in the vector space is close, and the distance between the unmatched position text and the resume text in the vector space is far, thereby optimizing the quality of the text vectors generated by the first neural network model and the second neural network model, which helps to improve the subsequent matching accuracy of the resume text and the position text.
[0099] Figure 4 FIG. 4 is a schematic diagram of the main flow of the resume recommendation method according to the third embodiment of the present invention. Figure 4 As shown, the resume recommendation method of the embodiment of the present invention includes:
[0100] Step S401: extract keywords from resume text and job text based on the knowledge graph.
[0101] Exemplarily, step S401 may specifically include: 1. Identifying keywords in a resume text or a job text based on a knowledge graph, wherein the keywords are mainly skill vocabulary. For example, if the word "vue" in the resume text appears in the knowledge graph and is a skill vocabulary, the word can be extracted; 2. Merging synonyms based on the knowledge graph. For example, "vue", "vue.js", "vuejs", "vue framework" and "vue front-end framework" all have the same meaning. These synonyms can be merged based on the knowledge graph, such as being uniformly represented as "vue".
[0102] In the embodiment of the present invention, considering that resumes involve various industry fields, it is difficult to maintain a certain accuracy in various industry fields if word segmentation is performed based on ordinary dictionaries. Since the knowledge graph carries clear industry field information, this problem can be solved by introducing the knowledge graph to extract keywords. Moreover, since the knowledge graph contains the relationship between words, such as synonym relationships, these words with the same meaning can be merged by introducing the knowledge graph, which helps to improve the subsequent matching accuracy, and it is also convenient to extract more keywords through synonym relationships.
[0103] Step S402: When the number of keywords in the resume text and the position text is greater than a preset threshold, a vector of the resume text and a vector of the position text are generated based on the trained first neural network model.
[0104] Considering that it is usually difficult to perfect the knowledge graph in actual situations, when extracting keywords based on the knowledge graph, it may be encountered that the number of extracted keywords is insufficient and cannot support the first neural network model for processing. In view of this, in an embodiment of the present invention, when it is determined that the number of extracted keywords is sufficient, the vector of the resume text and the vector of the position text can be generated based on the trained first neural network model.
[0105] In an optional exemplary embodiment, the first neural network model is a TextCNN model. The TextCNN model is a convolutional neural network model. In this optional example, a vector of the resume text and a vector of the position text can be generated based on the trained TextCNN model. In addition, in a specific implementation, the first neural network model can also adopt an LSTM (Long Short-Term Memory Network) model, or other models that can be used to generate vector representations of text.
[0106] Furthermore, the method of the embodiment of the present invention may also include the following steps: when the number of keywords in the resume text or the number of keywords in the position text is less than or equal to a preset threshold, generating a vector of the resume text and a vector of the position text based on a trained second neural network model.
[0107] In an optional example, the second neural network model may include: a BERT model, and a fully connected layer. In this example, generating a vector of a resume text and a vector of a position text based on a trained second neural network model includes: dividing the resume text into multiple paragraph texts of equal length, and inputting the multiple paragraph texts into a trained BERT model to obtain vectors corresponding to each paragraph text; inputting the vectors corresponding to each paragraph text into a trained fully connected layer to obtain a vector of the resume text; converting the position text into a text of the same length as the paragraph text, and then inputting it into the trained BERT model and the trained fully connected layer in sequence to obtain a vector of the position text.
[0108] Step S403: determine the similarity between the vector of the resume text and the vector of the position text, and determine whether the resume text and the position text match based on the similarity.
[0109] The similarity of the resume and the position text is compared with a preset threshold; if the similarity is greater than the preset threshold, it is determined that the resume text matches the position text; otherwise, it is determined that the resume text does not match the position text. The preset threshold can be flexibly set. For example, the preset threshold can be set to 0.9, 0.8 or other values.
[0110] Step S404: Generate a resume recommendation list based on the resume text matching the position text, and send the resume recommendation list to the recruitment user terminal corresponding to the position text.
[0111] For example, assuming there are 100 resume texts, and through steps S401 to S403 it is determined that there are 20 resume texts matching position text 1, a resume recommendation list can be generated based on these 20 matching resume texts, and the resume recommendation list can be sent to the recruitment user terminal corresponding to position text 1.
[0112] In the embodiment of the present invention, the above steps can improve the matching accuracy of the resume text and the position text, thereby improving the accuracy of the resume recommendation service.
[0113] Figure 5 FIG. 4 is a schematic diagram of the main flow of the job recommendation method according to the fourth embodiment of the present invention. Figure 5 As shown, the job recommendation method of the embodiment of the present invention includes:
[0114] Step S501: extract keywords from resume text and position text based on the knowledge graph.
[0115] In step S501, for details on how to extract keywords from resume text and job text based on the knowledge graph, please refer to Figure 4Relevant content in the illustrated embodiment.
[0116] Step S502: When the number of keywords in the resume text and the position text is greater than a preset threshold, a vector of the resume text and a vector of the position text are generated based on the trained first neural network model.
[0117] Considering that it is usually difficult to perfect the knowledge graph in actual situations, when extracting keywords based on the knowledge graph, it may be encountered that the number of extracted keywords is insufficient and cannot support the first neural network model for processing. In view of this, in an embodiment of the present invention, when it is determined that the number of extracted keywords is sufficient, the vector of the resume text and the vector of the position text can be generated based on the trained first neural network model.
[0118] In an optional exemplary embodiment, the first neural network model is a TextCNN model. The TextCNN model is a convolutional neural network model. In this optional example, a vector of the resume text and a vector of the position text can be generated based on the trained TextCNN model. In addition, in a specific implementation, the first neural network model can also adopt an LSTM (Long Short-Term Memory Network) model, or other models that can be used to generate vector representations of text.
[0119] Furthermore, the method of the embodiment of the present invention may also include the following steps: when the number of keywords in the resume text or the number of keywords in the position text is less than or equal to a preset threshold, generating a vector of the resume text and a vector of the position text based on a trained second neural network model.
[0120] In an optional example, the second neural network model may include: a BERT model, and a fully connected layer. In this example, generating a vector of a resume text and a vector of a position text based on a trained second neural network model includes: dividing the resume text into multiple paragraph texts of equal length, and inputting the multiple paragraph texts into a trained BERT model to obtain vectors corresponding to each paragraph text; inputting the vectors corresponding to each paragraph text into a trained fully connected layer to obtain a vector of the resume text; converting the position text into a text of the same length as the paragraph text, and then inputting it into the trained BERT model and the trained fully connected layer in sequence to obtain a vector of the position text.
[0121] Step S503: determine the similarity between the vector of the resume text and the vector of the position text, and determine whether the resume text and the position text match based on the similarity.
[0122] In this step, the cosine similarity (or "cosine distance") between the vector of the resume text and the vector of the position text can be calculated, and the cosine similarity can be used as the similarity calculation result. In addition, in the specific implementation, other methods can be used to calculate the similarity between the vector of the resume text and the vector of the position text. For example, the Euclidean distance between the vector of the resume text and the vector of the position text can be calculated, and the Euclidean distance can be used as the similarity calculation result.
[0123] Exemplarily, in step S503, judging whether the resume text and the position text match according to the similarity includes: comparing the similarity of the resume text vector and the position text vector with a preset threshold; if the similarity is greater than the preset threshold, determining that the resume text matches the position text; otherwise, determining that the resume text does not match the position text. The preset threshold can be flexibly set. For example, the preset threshold can be set to 0.9, 0.8 or other values.
[0124] Step S504: Generate a job recommendation list based on the job texts matching the resume text, and send the job recommendation list to the job seeker terminal corresponding to the resume text.
[0125] For example, assuming there are 200 job texts in total, and through steps S501 to S503 it is determined that there are 10 job texts that match resume text 1, a job recommendation list can be generated based on these 10 matching job texts and sent to the job seeker terminal corresponding to resume text 1.
[0126] In the embodiment of the present invention, the above steps can improve the matching accuracy of the resume text and the position text, thereby improving the accuracy of the position recommendation service.
[0127] Figure 6 FIG. 4 is a schematic diagram of the main modules of the apparatus for text matching according to the fifth embodiment of the present invention. Figure 6 As shown, the apparatus 600 for text matching according to the embodiment of the present invention includes: an extraction module 601 , a generation module 602 , and a judgment module 603 .
[0128] The extraction module 601 is used to extract keywords from resume text and job text based on the knowledge graph.
[0129] The knowledge graph is a graph-based data structure consisting of nodes and edges. In the knowledge graph, each node represents an "entity" that exists in the real world, and each edge is a "relationship" between entities. In layman's terms, the knowledge graph is a relationship network obtained by connecting all heterogeneous information together.
[0130] Exemplarily, the extraction module 601 extracts keywords from resume text and job text based on the knowledge graph, which may specifically include: 1. The extraction module 601 identifies keywords in the resume text or job text based on the knowledge graph, wherein the keywords are mainly skill vocabulary. For example, the word "vue" in the resume text appears in the knowledge graph and is a skill vocabulary, so the word can be extracted; 2. The extraction module 601 merges synonyms based on the knowledge graph. For example, "vue", "vue.js", "vuejs", "vue framework" and "vue front-end framework" all have the same meaning. These synonyms can be merged based on the knowledge graph, such as uniformly expressing them as "vue".
[0131] In specific implementation, the knowledge graph can be stored in a graph database (such as Neo4j), and then the keywords in the resume text and the position text can be extracted by accessing the knowledge graph in the graph database. In addition, in order to facilitate quick online access, the knowledge graph can also be stored in the memory in the form of a document, and the keywords in the resume text and the position text can be extracted by accessing the document corresponding to the knowledge graph. Among them, the document corresponding to the knowledge graph may include: a vocabulary index table, a relationship index table, and a relationship table. The vocabulary index table may include the index of each word in the knowledge graph, such as the index of Vue is 1 and the index of Vue.js is 2; the relationship index may include the index of various relationships in the knowledge graph, such as the index of the relationship of "synonym" is 1, the index of the relationship of "same scope" is 2, the index of the relationship of "sub-skill" is 3, and the index of the relationship of "parent skill" is 4; the relationship table may include the relationship between various words, which can be expressed in the form of "subject-relationship-object", such as "1 1 2" means "Vue and Vue.js are synonyms".
[0132] In the embodiment of the present invention, considering that resumes involve various industry fields, it is difficult to maintain a certain accuracy in various industry fields if word segmentation is performed based on ordinary dictionaries. Since the knowledge graph carries clear industry field information, this problem can be solved by introducing the knowledge graph to extract keywords. Moreover, since the knowledge graph contains the relationship between words, such as synonym relationships, these words with the same meaning can be merged by introducing the knowledge graph, which helps to improve the subsequent matching accuracy, and it is also convenient to extract more keywords through synonym relationships.
[0133] The generation module 602 is used to generate a vector of the resume text and a vector of the position text based on the trained first neural network model when the number of keywords in the resume text and the position text is greater than a preset threshold.
[0134] For example, in a specific application scenario, the preset threshold can be set to 5. When the number of keywords extracted from the resume text is greater than 5 and the number of keywords extracted from the position text is greater than 5, it is considered that the number of keywords extracted through the knowledge graph is sufficient, and then the resume text vector and the position text vector can be generated based on the trained first neural network model. The preset threshold related to the number of keywords can be flexibly set without affecting the implementation of the present invention.
[0135] Exemplarily, the trained first neural network model can be obtained in the following manner: constructing a first twin network based on the first neural network model, and performing supervised training on the first twin network according to a first training sample set to obtain the trained first neural network model; the first training sample set includes: sample pairs of resume text and position text with category labels; the category labels are used to indicate whether the sample pairs match.
[0136] Among them, the first Siamese Network has two sub-networks with the same structure and shared weights. The two sub-networks receive one of the sample pairs (i.e., one receives the resume text in the sample pair, and the other receives the position sample in the sample pair) and converts it into a vector. During the training process, the loss function can be calculated based on the two output vectors to continuously perform back-propagation optimization on the Siamese Network, so that the distance between the matching position text and the resume text in the vector space is close, and the distance between the unmatched position text and the resume text in the vector space is far.
[0137] In an optional exemplary embodiment, the first neural network model is a TextCNN model. The TextCNN model is a convolutional neural network model. In this optional example, a vector of the resume text and a vector of the position text can be generated based on the trained TextCNN model. In addition, in a specific implementation, the first neural network model can also adopt an LSTM (Long Short-Term Memory Network) model, or other models that can be used to generate vector representations of text.
[0138] Furthermore, the generation module 602 can also be used to generate a vector of the resume text and a vector of the position text based on the trained second neural network model when the number of keywords in the resume text or the number of keywords in the position text is less than a preset threshold.
[0139] In an optional example, the second neural network model may include: a BERT model, and a fully connected layer. In this example, the generation module 602 generates a vector of the resume text and a vector of the position text based on the trained second neural network model, including: dividing the resume text into multiple paragraph texts of equal length, and inputting the multiple paragraph texts into the trained BERT model to obtain the vectors corresponding to each paragraph text; inputting the vectors corresponding to each paragraph text into the trained fully connected layer to obtain the vector of the resume text; converting the position text into a text of the same length as the paragraph text, and then inputting it into the trained BERT model and the trained fully connected layer in sequence to obtain the vector of the position text.
[0140] The judgment module 603 is used to determine the similarity between the vector of the resume text and the vector of the position text, and then judge whether the resume text and the position text match based on the similarity.
[0141] Exemplarily, the judgment module 603 can calculate the cosine similarity (or "cosine distance") between the vector of the resume text and the vector of the position text, and use the cosine similarity as the similarity calculation result. In addition, in specific implementation, the judgment module 603 can also use other methods to calculate the similarity between the vector of the resume text and the vector of the position text. For example, the judgment module 603 can calculate the Euclidean distance between the vector of the resume text and the vector of the position text, and use the Euclidean distance as the similarity calculation result.
[0142] Exemplarily, judging module 603 judging whether the resume text and the position text match according to the similarity includes: judging module 603 comparing the similarity between the resume text vector and the position text vector with a preset threshold; if the similarity is greater than the preset threshold, judging module 603 determines that the resume text matches the position text; otherwise, judging module 603 determines that the resume text does not match the position text. The preset threshold can be flexibly set. For example, the preset threshold can be set to 0.9, 0.8 or other values.
[0143] In the device of the embodiment of the present invention, by extracting keywords from the resume text and the position text based on the knowledge graph, when the number of keywords in the resume text and the position text is greater than a preset threshold, a vector of the resume text and a vector of the position text are generated based on the trained first neural network model, the similarity between the vector of the resume text and the vector of the position text is determined, and then whether the resume text and the position text match is judged based on the similarity. These steps can improve the matching accuracy of the resume text and the position text, and thereby improve the accuracy of the position or resume recommendation service.
[0144] Figure 7 FIG. 4 is a schematic diagram of the main modules of a resume recommendation device according to a sixth embodiment of the present invention. Figure 7 As shown, the resume recommendation device 700 of the embodiment of the present invention includes: an extraction module 701, a generation module 702, a judgment module 703, and a resume recommendation module 704.
[0145] Extraction module 701 is used to extract keywords from resume text and job text based on knowledge graph. For details on how extraction module 701 extracts keywords from resume text and job text based on knowledge graph, please refer to Figure 6 Relevant content of the illustrated embodiment.
[0146] The generation module 702 is used to generate a vector of the resume text and a vector of the position text based on the trained first neural network model when the number of keywords in the resume text and the position text is greater than a preset threshold. In an optional exemplary embodiment, the first neural network model is a TextCNN model. The TextCNN model is a convolutional neural network model. In this optional example, the vector of the resume text and the vector of the position text can be generated based on the trained TextCNN model. In addition, in a specific implementation, the first neural network model can also adopt an LSTM (Long Short-Term Memory Network) model, or other models that can be used to generate vector representations of text.
[0147] The generation module 702 is also used to generate a vector of the resume text and a vector of the position text based on the trained second neural network model when the number of keywords in the resume text or the number of keywords in the position text is less than a preset threshold. In an optional example, the second neural network model may include: a BERT model, and a fully connected layer. In this example, the generation module 702 generates a vector of the resume text and a vector of the position text based on the trained second neural network model, including: dividing the resume text into multiple paragraph texts of equal length, and inputting the multiple paragraph texts into the trained BERT model to obtain vectors corresponding to each paragraph text; inputting the vectors corresponding to each paragraph text into the trained fully connected layer to obtain the vector of the resume text; converting the position text into a text of the same length as the paragraph text, and then inputting it into the trained BERT model and the trained fully connected layer in sequence to obtain the vector of the position text.
[0148] The judgment module 703 is used to determine the similarity between the vector of the resume text and the vector of the position text, and then judge whether the resume text and the position text match according to the similarity. For how the judgment module 703 determines the similarity between the vector of the resume text and the vector of the position text, and how the judgment module 703 judges whether the resume text and the position text match according to the similarity, please refer to Figure 6 Relevant content of the illustrated embodiment.
[0149] The resume recommendation module 704 is used to generate a resume recommendation list based on the resume texts matching the position texts, and send the resume recommendation list to the recruitment user terminal corresponding to the position texts. For example, assuming that there are 100 resume texts, and it is determined through steps S401 to S403 that there are 20 resume texts matching the position text 1, a resume recommendation list can be generated based on the 20 matching resume texts, and the resume recommendation list can be sent to the recruitment user terminal corresponding to the position text 1.
[0150] The device of the embodiment of the present invention can improve the matching accuracy of resume text and position text, thereby improving the accuracy of resume recommendation service.
[0151] Figure 8 FIG. 2 is a schematic diagram of the main modules of the job recommendation device according to the seventh embodiment of the present invention. Figure 8 As shown, the position recommendation device 800 of the embodiment of the present invention includes: an extraction module 801 , a generation module 802 , a judgment module 803 , and a position recommendation module 804 .
[0152] Extraction module 801 is used to extract keywords from resume text and job text based on knowledge graph. For details on how extraction module 801 extracts keywords from resume text and job text based on knowledge graph, please refer to Figure 6 Relevant content of the illustrated embodiment.
[0153] The generation module 802 is used to generate a vector of the resume text and a vector of the position text based on the trained first neural network model when the number of keywords in the resume text and the position text is greater than a preset threshold.
[0154] In an optional exemplary embodiment, the first neural network model is a TextCNN model. The TextCNN model is a convolutional neural network model. In this optional example, a vector of the resume text and a vector of the position text can be generated based on the trained TextCNN model. In addition, in a specific implementation, the first neural network model can also adopt an LSTM (Long Short-Term Memory Network) model, or other models that can be used to generate vector representations of text.
[0155] The generation module 802 is also used to generate a vector of the resume text and a vector of the position text based on the trained second neural network model when the number of keywords in the resume text or the number of keywords in the position text is less than a preset threshold.
[0156] In an optional example, the second neural network model may include: a BERT model, and a fully connected layer. In this example, the generation module 802 generates a vector of the resume text and a vector of the position text based on the trained second neural network model, including: dividing the resume text into multiple paragraph texts of equal length, and inputting the multiple paragraph texts into the trained BERT model to obtain vectors corresponding to each paragraph text; inputting the vectors corresponding to each paragraph text into the trained fully connected layer to obtain the vector of the resume text; converting the position text into a text of the same length as the paragraph text, and then inputting it into the trained BERT model and the trained fully connected layer in sequence to obtain the vector of the position text.
[0157] The judgment module 803 is used to determine the similarity between the vector of the resume text and the vector of the position text, and then judge whether the resume text and the position text match according to the similarity. For how the judgment module 803 determines the similarity between the vector of the resume text and the vector of the position text, and how the judgment module 803 judges whether the resume text and the position text match according to the similarity, please refer to Figure 6 Relevant content of the illustrated embodiment.
[0158] The job recommendation module 804 is used to generate a job recommendation list based on the job texts matching the resume text, and send the job recommendation list to the job seeker user terminal corresponding to the resume text. For example, assuming that there are 200 job texts in total, and it is determined through steps S501 to S503 that there are 10 job texts matching resume text 1, a job recommendation list can be generated based on these 10 matching job texts, and the job recommendation list can be sent to the job seeker user terminal corresponding to resume text 1.
[0159] The device of the embodiment of the present invention can improve the matching accuracy of resume text and position text, thereby improving the accuracy of the position recommendation service.
[0160] Fig. 9 An exemplary system architecture 900 is shown to which the method for text matching, the resume recommendation method, the job recommendation method, the device for text matching, the resume recommendation device, or the job recommendation device according to the embodiments of the present invention can be applied.
[0161] like Fig. 9 As shown, system architecture 900 may include terminal devices 901, 902, 903, network 904 and server 905. Network 904 is used to provide a medium for communication links between terminal devices 901, 902, 903 and server 905. Network 904 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0162] Users can use terminal devices 901, 902, 903 to interact with server 905 through network 904 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 901, 902, 903, such as recruitment websites, shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0163] The terminal devices 901 , 902 , and 903 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.
[0164] The server 905 may be a server that provides various services, such as a background management server that provides support for recruitment websites browsed by users using the terminal devices 901, 902, and 903. The background management server may analyze data such as resume texts and job texts, and feed back the processing results (such as a job recommendation list or a resume recommendation list) to the terminal device.
[0165] It should be noted that the method for text matching or the resume recommendation method or the position recommendation method provided in the embodiments of the present invention is generally executed by the server 905. Accordingly, the device for text matching or the resume recommendation device or the position recommendation device is generally set in the server 905.
[0166] It should be understood that Fig. 9 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0167] Reference below Fig.10 , which shows a schematic diagram of the structure of a computer system 1000 of an electronic device suitable for implementing an embodiment of the present invention. Fig.10 The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0168] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the system 1000 are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0169] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0170] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, the above-mentioned functions defined in the system of the present invention are executed.
[0171] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0172] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0173] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes an extraction module, a generation module, and a judgment module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the extraction module may also be described as a "module for extracting keywords".
[0174] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device executes the following process: extracting keywords from resume text and position text based on the knowledge graph; when the number of keywords in the resume text and the position text is greater than a preset threshold, generating a vector of the resume text and a vector of the position text based on a trained first neural network model; determining the similarity between the vector of the resume text and the vector of the position text, and then judging whether the resume text and the position text match based on the similarity.
[0175] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for text matching, characterized in that: The method comprises: Extract keywords from resume text and job text based on knowledge graph; When the number of keywords in the resume text and the position text is greater than a preset threshold, generating a vector of the resume text and a vector of the position text based on the trained first neural network model; When the number of keywords in the resume text or the number of keywords in the position text is less than a preset threshold, a vector of the resume text and a vector of the position text are generated based on a trained second neural network model; wherein the second neural network model is a pre-trained model; specifically comprising: dividing the resume text into a plurality of paragraph texts of equal length, and generating a vector of the resume text according to the plurality of paragraph texts; converting the position text into a text of the same length as the paragraph text to obtain a vector of the position text; Determine the similarity between the vector of the resume text and the vector of the position text, and then determine whether the resume text and the position text match based on the similarity.
2. The method according to claim 1, characterized in that The method further comprises: A first twin network is constructed based on the first neural network model, and a second twin network is constructed based on the second neural network model; the first twin network is supervisedly trained according to the first training sample set to obtain the trained first neural network model; the second twin network is supervisedly trained according to the second training sample set to obtain the trained second neural network model; wherein the first training sample set and the second training sample set include: sample pairs of resume text and position text with category labels; the category labels are used to indicate whether the sample pairs match.
3. The method according to claim 2, characterized in that The method further comprises: Sample pairs of resume text and position text with category labels are obtained, data augmentation is performed on the sample pairs, and then a first training sample set and a second training sample set are constructed according to the sample pairs after data augmentation.
4. The method according to claim 1, characterized in that The first neural network model is a TextCNN model; the second neural network model includes: a BERT model and a fully connected layer.
5. The method according to claim 4, characterized in that The generating of the resume text vector and the position text vector based on the trained first neural network model includes: Each keyword in the resume text is vectorized to obtain a word vector corresponding to each keyword; the word vector corresponding to each keyword in the resume text is input into the trained TextCNN model to obtain a vector of the resume text; the keywords in the position text are vectorized to obtain a word vector corresponding to each keyword; the word vector corresponding to each keyword in the position text is input into the trained TextCNN model to obtain a vector of the position text.
6. The method according to claim 4, characterized in that The generating of the resume text vector and the position text vector based on the trained second neural network model also includes: The multiple paragraph texts are input into the trained BERT model to obtain the vectors corresponding to each paragraph text; the vectors corresponding to each paragraph text are input into the trained fully connected layer to obtain the vectors of the resume text; and then the converted position text is input into the trained BERT model and the trained fully connected layer in turn to obtain the vectors of the position text.
7. A resume recommendation method, characterized in that: The method comprises: Extract keywords from resume text and job text based on knowledge graph; When the number of keywords in the resume text and the position text is greater than a preset threshold, generating a vector of the resume text and a vector of the position text based on the trained first neural network model; When the number of keywords in the resume text or the number of keywords in the position text is less than a preset threshold, a vector of the resume text and a vector of the position text are generated based on a trained second neural network model; wherein the second neural network model is a pre-trained model; specifically comprising: dividing the resume text into a plurality of paragraph texts of equal length, and generating a vector of the resume text according to the plurality of paragraph texts; converting the position text into a text of the same length as the paragraph text to obtain a vector of the position text; Determine the similarity between the vector of the resume text and the vector of the position text, and determine whether the resume text and the position text match based on the similarity; A resume recommendation list is generated according to the resume text matching the position text, and the resume recommendation list is sent to a recruitment user terminal corresponding to the position text.
8. A method for recommending a position, characterized in that: The method comprises: Extract keywords from resume text and job text based on knowledge graph; When the number of keywords in the resume text and the position text is greater than a preset threshold, generating a vector of the resume text and a vector of the position text based on the trained first neural network model; When the number of keywords in the resume text or the number of keywords in the position text is less than a preset threshold, a vector of the resume text and a vector of the position text are generated based on a trained second neural network model; wherein the second neural network model is a pre-trained model; specifically comprising: dividing the resume text into a plurality of paragraph texts of equal length, and generating a vector of the resume text according to the plurality of paragraph texts; converting the position text into a text of the same length as the paragraph text to obtain a vector of the position text; Determine the similarity between the vector of the resume text and the vector of the position text, and determine whether the resume text and the position text match based on the similarity; A job recommendation list is generated according to the job text matching the resume text, and the job recommendation list is sent to a job seeker terminal corresponding to the resume text.
9. A device for text matching, characterized in that: The device comprises: Extraction module, used to extract keywords from resume text and job text based on knowledge graph; A generation module, used to generate a vector of the resume text and a vector of the position text based on a trained first neural network model when the number of keywords in the resume text and the position text is greater than a preset threshold; and also used to generate a vector of the resume text and a vector of the position text based on a trained second neural network model when the number of keywords in the resume text or the number of keywords in the position text is less than a preset threshold; wherein the second neural network model is a pre-trained model; specifically comprising: dividing the resume text into a plurality of paragraph texts of equal length, generating a vector of the resume text according to the plurality of paragraph texts; converting the position text into a text of equal length to the paragraph text to obtain a vector of the position text; The judgment module is used to determine the similarity between the vector of the resume text and the vector of the position text, and then judge whether the resume text and the position text match according to the similarity.
10. A resume recommendation device, characterized in that: The device comprises: Extraction module, used to extract keywords from resume text and job text based on knowledge graph; A generation module, used to generate a vector of the resume text and a vector of the position text based on a trained first neural network model when the number of keywords in the resume text and the position text is greater than a preset threshold; and also used to generate a vector of the resume text and a vector of the position text based on a trained second neural network model when the number of keywords in the resume text or the number of keywords in the position text is less than a preset threshold; wherein the second neural network model is a pre-trained model; divide the resume text into a plurality of paragraph texts of equal length, and generate a vector of the resume text according to the plurality of paragraph texts; convert the position text into a text of the same length as the paragraph text to obtain a vector of the position text; A judgment module, used to determine the similarity between the vector of the resume text and the vector of the position text, and judge whether the resume text and the position text match according to the similarity; The resume recommendation module is used to generate a resume recommendation list based on the resume text matching the position text, and send the resume recommendation list to the recruitment user terminal corresponding to the position text.
11. A job recommendation device, characterized in that: The device comprises: Extraction module, used to extract keywords from resume text and job text based on knowledge graph; A generation module, used to generate a vector of the resume text and a vector of the position text based on a trained first neural network model when the number of keywords in the resume text and the position text is greater than a preset threshold; and also used to generate a vector of the resume text and a vector of the position text based on a trained second neural network model when the number of keywords in the resume text or the number of keywords in the position text is less than a preset threshold; wherein the second neural network model is a pre-trained model; divide the resume text into a plurality of paragraph texts of equal length, and generate a vector of the resume text according to the plurality of paragraph texts; convert the position text into a text of the same length as the paragraph text to obtain a vector of the position text; A judgment module, used to determine the similarity between the vector of the resume text and the vector of the position text, and judge whether the resume text and the position text match according to the similarity; The position recommendation module is used to generate a position recommendation list according to the position text matching the resume text, and send the position recommendation list to the job seeker terminal corresponding to the resume text.
12. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
13. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Personalized position recommendation method based on knowledge graph
CN108920544A
Text recognition method and device
CN110569361A