Synonym push method, device, electronic device and medium
Through the synonym push method, the ultra-large word vector model and the binary tree structure are used to solve the problem of low efficiency for users to manually enter keywords in AI interviews, achieve full quantity and objectivity of keywords, and improve the accuracy of interview analysis.
Patent Information
- Application Number
- CN202010136905.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-02
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-03-02
AI Technical Summary
In the artificial intelligence interview rule configuration system, users need to manually input a large amount of information to fill in answer keywords. The system cannot provide synonym recommendations, resulting in low writing efficiency for users and the entered keywords may not be complete and objective.
Using the synonym push method, we obtain interview questions, configure keywords, train the target word vector model based on the ultra-large word vector model, build word vector matrices and binary trees, query candidate word vectors, remove duplications, and push synonyms for users to choose.
It improves users' writing efficiency during AI interviews, ensures the full quantity and objectivity of keywords, and facilitates human resources to analyze job seekers' answers more accurately.
Smart Images

Figure CN111460798B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a synonym push method, device, electronic equipment and storage medium. Background Art
[0002] The project requirement is that in the artificial intelligence (AI) interview rule configuration system, users of some companies can update the answer keywords in the expert rules in real time. However, when users fill in the answer keywords, they need to manually and purely manually input a lot of information. The system cannot provide help to users when entering keywords, such as recommending synonyms. This operation reduces the user's writing efficiency and is extremely dependent on the user's personal understanding of the answer keywords. It cannot guarantee whether the keywords entered by the user are relatively complete and objective. Summary of the invention
[0003] In view of the above content, it is necessary to propose a synonym push method, device, electronic device and storage medium, which can provide users with fast synonym push when conducting AI interviews.
[0004] A first aspect of the present invention provides a synonym push method, the method comprising:
[0005] Get interview questions;
[0006] Configuring a first preset number of keywords corresponding to the answers to the interview questions;
[0007] The target word vector model is obtained based on the pre-training of the super large word vector model;
[0008] Constructing a word vector matrix according to the target word vector model to obtain a word-index file, wherein the word-index file includes a correspondence between word vectors and indexes;
[0009] Construct a binary tree based on all word vectors in the target word vector model;
[0010] Traversing the binary tree, searching for a first candidate word vector whose distance from the keyword is greater than a preset distance threshold from the binary tree, and constructing a priority queue based on the first candidate word vector;
[0011] Deduplication of the first candidate word vectors in the priority queue;
[0012] Get the target word vectors that are ranked second in the priority queue after deduplication;
[0013] Based on the second preset number of target word vectors and word-index files, a second preset number of synonyms are pushed for user selection.
[0014] Preferably, the step of configuring a first preset number of keywords corresponding to the answer to the interview question includes:
[0015] Analyze the interview questions according to a pre-built question parsing model to obtain the corresponding question intention;
[0016] Determine the answer to the interview question based on the question intent and the pre-established knowledge base; and
[0017] A first preset number of keywords are extracted according to the corresponding answers.
[0018] Preferably, the step of obtaining a target word vector model by pre-training based on a super large word vector model comprises:
[0019] Expanding the robot interview scenario corpus in the super-large word vector model, including performing word segmentation, stop word removal, and word vector training based on the CBOW model on the robot interview scenario corpus;
[0020] The target word vector model is obtained by training the super large word vector model after expanding the corpus.
[0021] Preferably, the step of constructing a word vector matrix according to the target word vector model to obtain a word-index file includes:
[0022] Construct a word vector matrix with the dimension of each word as the number of rows and the total number of all words in the target word vector model as the number of columns;
[0023] Each row in the word vector matrix corresponds to an index;
[0024] A word-index file is constructed according to the word vector matrix, and the word-index file is output.
[0025] Preferably, the pushing of the second preset number of synonyms for user selection based on the second preset number of target word vectors and word-index files includes:
[0026] Obtain target indexes corresponding to the second preset number of target word vectors;
[0027] Querying the word vector corresponding to the target index according to the word-index file;
[0028] The synonyms corresponding to the word vector are pushed for the user to choose.
[0029] Preferably, the querying from the binary tree to obtain a first candidate word vector whose distance from the keyword is greater than a preset distance threshold and constructing a priority queue based on the first candidate word vector comprises:
[0030] Using the keyword as the root node of the binary tree;
[0031] Traverse all intermediate nodes under the root node;
[0032] Calculate the distance between the root node and each intermediate node;
[0033] Determine the intermediate node corresponding to the target distance greater than the preset distance threshold as the first-layer target node;
[0034] Traverse all intermediate nodes under the first layer target node until the last layer leaf node;
[0035] Take the word vectors in all leaf nodes as the first candidate word vectors;
[0036] Calculating the similarity between the first candidate word vector and the keyword;
[0037] The first candidate word vectors are inserted into the priority queue according to the order of similarity.
[0038] Preferably, the second preset number of synonyms found are screened according to preset rules, wherein the preset rules include at least one of the following rules:
[0039] Adjusting the order of the second preset number of synonyms found according to the number of words;
[0040] Filtering a second preset number of synonyms found by vocabulary type;
[0041] The words whose number of characters in the second preset number of synonyms is greater than the preset number of characters in the keyword are removed.
[0042] A second aspect of the present invention provides a synonym pushing device, the device comprising:
[0043] Acquisition module, used to obtain interview questions;
[0044] A configuration module, used to configure a first preset number of keywords corresponding to the answers to the interview questions;
[0045] The training module is used to pre-train the target word vector model based on the super large word vector model;
[0046] A construction module, used to construct a word vector matrix according to the target word vector model to obtain a word-index file, wherein the word-index file includes a correspondence between word vectors and indexes;
[0047] The construction module is further used to construct a binary tree based on all word vectors in the target word vector model;
[0048] A traversal module, configured to traverse the binary tree, query a first candidate word vector whose distance from the keyword is greater than a preset distance threshold from the binary tree, and construct a priority queue based on the first candidate word vector;
[0049] A deduplication module, used for deduplicating the first candidate word vectors in the priority queue;
[0050] The acquisition module is further used to acquire the target word vectors of the second preset number in the priority queue after deduplication; and
[0051] A push module is used to push a second preset number of synonyms for user selection based on the second preset number of target word vectors and word-index files.
[0052] A third aspect of the present invention provides an electronic device, the electronic device comprising a processor and a memory, the processor being configured to implement the synonym push method when executing a computer program stored in the memory.
[0053] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the synonym push method when executed by a processor.
[0054] The synonym push method, device, electronic device and storage medium of the present invention. By configuring a first preset number of keywords corresponding to the answer to the interview question, searching for a second preset number of synonyms corresponding to each keyword in a pre-trained word vector model, and pushing the second preset number of synonyms for user selection. More synonyms of keywords corresponding to the answers to the interview questions can be configured for the robot interview process. It is convenient for human resources HR to configure more comprehensive answers to interview questions when interviewing job applicants. Therefore, when receiving the job applicant's answer to the interview question, the job applicant's answer can be analyzed more accurately, which is convenient for human resources to give a more comprehensive analysis of the job applicant. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0056] Figure 1 It is a flow chart of the synonym push method provided by the first embodiment of the present invention.
[0057] Figure 2 It is a functional module diagram of the pushing device provided in the second embodiment of the present invention.
[0058] Figure 3 It is a schematic diagram of an electronic device provided in Embodiment 3 of the present invention.
[0059] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0060] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0061] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0063] The terms "first", "second", "third", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variation thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0064] The synonym push method of the embodiment of the present invention is applied in an electronic device. For the electronic device that needs to push synonyms, the synonym push function provided by the method of the present invention can be directly integrated on the electronic device, or a client for implementing the method of the present invention can be installed. For another example, the method provided by the present invention can also be run on a server or other device in the form of a software development kit (SDK), and an interface for the synonym push function is provided in the form of SDK, and the electronic device or other device can implement the synonym push function through the provided interface.
[0065] Embodiment 1
[0066] Figure 1 This is a flow chart of the synonym push method provided by Embodiment 1 of the present invention. According to different requirements, the execution order in the flow chart can be changed, and some steps can be omitted.
[0067] In order to better determine whether the job applicants have answered the interview questions correctly during the robot interview process, and to score the job applicants according to the answer results. It is necessary to configure keywords according to the answers corresponding to the interview questions, and extract keywords according to the input answers after receiving the answers entered by the job applicants. The extracted keywords are matched with the configured keywords to obtain matching results, and the job applicants are scored according to the matching results. When configuring keywords according to the answers corresponding to the interview questions, in order to avoid the situation where the keywords are not comprehensive enough, the present application provides a method for expanding the keywords entered by the interviewer when configuring keywords and pushing synonyms / synonyms. The method comprises:
[0068] Step S1, obtaining interview questions.
[0069] During the robot interview process, different interview questions will be assigned according to different positions. For example, interview questions for R&D positions include "What programming languages are you familiar with?", "How to jump out of the current multi-nested loop in Java?" and "Does Java have memory leaks? Please describe briefly."
[0070] In this embodiment, the robot interview needs to pre-configure the interview questions and answers. However, different job seekers give different answers to the same interview questions. In order to comprehensively evaluate the ability of job seekers, when configuring the interview questions and answers, it is necessary to configure detailed, complete and comprehensive answers according to the interview questions.
[0071] Step S2, configuring a first preset number of keywords corresponding to the answer to the interview question.
[0072] In one embodiment, the step of configuring a first preset number of keywords corresponding to the answer to the interview question includes:
[0073] Query the answer corresponding to the interview question configuration in a pre-established interview question and answer correspondence table to obtain a query result;
[0074] Extracting keywords from the query result, wherein the keywords are a first preset number.
[0075] It is understandable that the keyword may also be a keyword related to the query result obtained by performing semantic analysis on the query result.
[0076] In another embodiment, the step of configuring a first preset number of keywords corresponding to the answer to the interview question includes:
[0077] (1) Analyze the interview questions according to the pre-constructed question parsing model to obtain the corresponding question intention.
[0078] In this embodiment, the question parsing model can analyze the question features of the interview question. The question features can include the question stem intention and key information. For example, when the interview question is "What programming languages are you good at", the question stem intention is the programming language you are good at, and the key information can be the programming language.
[0079] (2) Determine the answer corresponding to the interview question based on the question intent and the pre-established knowledge base.
[0080] For example, when the interview question is "What programming languages are you good at?", the pre-established knowledge base may include C / C++, Java, C#, and SQL, etc.
[0081] (3) Extracting a first preset number of keywords based on the corresponding answers.
[0082] Step S3, pre-training the target word vector model based on the super large word vector model.
[0083] In this embodiment, a suitable target word vector model is obtained by pre-training based on a super-large word vector model. Specifically, it includes: expanding the robot interview scene corpus in the super-large word vector model, including segmenting the robot interview scene corpus, removing stop words, and performing word vector training operations based on the CBOW model; and obtaining the target word vector model based on the super-large word vector model after the expanded corpus.
[0084] Specifically, the training corpus of the super-large word vector model covers a large amount of news, web pages, novels, Baidu Encyclopedia, Wikipedia and other corpora of different dimensions. However, for the robot interview scenario, the corpus of the specific scenario in the super-large word vector model is insufficient. Therefore, the corpus of the robot interview scenario is integrated on the basis of the super-large word vector model, and the corpus such as question and answer text and similar question text in the robot interview is expanded. The target word vector model is a word vector model that includes the expectations of the robot interview.
[0085] Then, the robot interview scene corpus is segmented, stop words are removed, and word vectors are incrementally trained based on the CBOW model to expand its performance in the robot interview scenario. The final trained target word vector model covers more than 8 million words, and the dimension of each word is about 200 dimensions. This makes the target word vector model corpus extensive, and each word vector therein can well reflect the semantics of each word. At the same time, the order of 8 million words can completely replace the traditional way of building a synonym dictionary, which can well solve the problem of not finding words.
[0086] It should be noted that the method of obtaining a target word vector model based on pre-training of a super-large word vector model is an existing technology and will not be described in detail here.
[0087] Step S4, constructing a word vector matrix according to the target word vector model to obtain a word-index file, wherein the word-index file includes a correspondence between word vectors and indexes.
[0088] In this implementation, constructing a word vector matrix according to the target word vector model to obtain a word-index file may include:
[0089] (a1) constructing a word vector matrix with the dimension of each word as the number of rows and the total number of all words in the target word vector model as the number of columns;
[0090] (a2) Each row in the word vector matrix corresponds to an index;
[0091] (a3) constructing a word-index file according to the word vector matrix, and outputting the word-index file.
[0092] Specifically, the word vector matrix is a matrix composed of the dimension of each word as the number of rows and the total number of all words as the number of columns. In this embodiment, the dimension of each word is 200, and the target word vector model includes 8 million words. Then, a word vector matrix with 200 columns and 8 million rows can be obtained.
[0093] Each row in the word vector matrix has an index, so the index corresponding to each word can be obtained. Thus, the word-index file is output according to the word vector matrix. At the same time, the corresponding relationship between each index and each word vector can also be obtained.
[0094] Step S5, constructing a binary tree based on all word vectors in the target word vector model.
[0095] In this embodiment, a binary tree structure is constructed based on all word vectors in the target word vector model.
[0096] The word vector is a 200-dimensional vector, that is, a 200-dimensional high-dimensional data space. Each word vector represents a point in the high-dimensional data space. The data space corresponding to all word vectors in the target word vector model can be represented as 8 million points. The binary tree is constructed according to the target word vector model by the following method:
[0097] (1) Randomly select two points as initial nodes and connect the two initial nodes to form an equidistant hyperplane;
[0098] (2) constructing an equidistant vertical hyperplane according to the midpoint vertical line of the line connecting the two initial nodes, dividing the data space corresponding to all word vectors in the target word vector model into two parts, and obtaining two subspaces;
[0099] (3) Multiply each point in each subspace by the normal vector of the equidistant hyperplane (vector dot product), find the sign of the angle between each point and the normal vector, and use the sign to distinguish whether it belongs to the left subtree or the right subtree of the binary tree;
[0100] (4) Similarly, by repeating the above steps (1) to (3) in the two subspaces respectively, the data space can be divided into multiple subspaces, and a binary tree structure can be constructed based on the multiple subspaces.
[0101] Preferably, when there are only k points in each subspace at most, the subspace is no longer divided. Preferably, k is greater than or equal to 8 and less than or equal to 10. In this embodiment, the value of k is 10.
[0102] The segmentation conditions of each node in the above binary tree structure are those equidistant vertical hyperplanes, and finally, the word vector is the leaf node on the binary tree. That is, the binary tree includes a root node, multiple layers of intermediate nodes and a last layer of leaf nodes, wherein each leaf node represents a word vector. In the present application, there is no need to save the word vector on the leaf node, only the index corresponding to the word vector needs to be saved. In this way, similar word vectors are closer in position on the binary tree, providing a faster speed for subsequent queries of synonyms.
[0103] Step S6, traverse the binary tree, query the first candidate word vector whose distance to the keyword is greater than a preset distance threshold from the binary tree, and build a priority queue based on the first candidate word vector.
[0104] The specific method for constructing a priority queue is: taking the keyword as the root node of the binary tree; traversing all intermediate nodes under the root node; calculating the distance between the root node and each intermediate node; determining the intermediate node corresponding to the target distance greater than a preset distance threshold as the first-level target node; traversing all intermediate nodes under the first-level target node until the last-level leaf node; taking the word vectors in all leaf nodes as the first candidate word vector; calculating the similarity between the first candidate word vector and the keyword; and inserting the first candidate word vector into the priority queue in order of similarity.
[0105] Step S7, deduplicate the first candidate word vectors in the priority queue.
[0106] Step S8, obtaining the target word vectors of the second preset number in the priority queue after deduplication.
[0107] Step S9: Pushing a second preset number of synonyms for user selection based on the second preset number of target word vectors and word-index files.
[0108] In this embodiment, the method for pushing a second preset number of synonyms for user selection based on the second preset number of target word vectors and word-index files includes: obtaining the target index corresponding to the second preset number of target word vectors; querying the word vector corresponding to the target index according to the word-index file; and pushing the synonyms corresponding to the word vector for user selection.
[0109] In this embodiment, the binary tree structure file and the word-index file are stored together. When it is necessary to search for the top N words that are close to a certain keyword, only these two files need to be used for indexing.
[0110] In this embodiment, by pushing a second preset number of synonyms for users to filter, it is convenient for users to more comprehensively configure the keywords of the answers corresponding to the interview questions. Therefore, when job applicants answer questions, they will not be scored one-sidedly based on their answers. The synonym search function supported by this application is more innovative and convenient. It can generate synonyms for 5 keywords at a time, and push 8 synonyms each time. It supports users to click "Change Batch" to replace another round of 8 synonyms, which is convenient for users to view and use. For example, a "Change Batch" button is displayed on the push interface. After the user clicks the button, the original synonyms can be updated and more synonyms can be pushed.
[0111] Preferably, since many words are not answers to the interview questions, preset rules are added to filter the queried words, wherein the preset rules include at least one of the following rules:
[0112] (1) Adjusting the order of the queried words according to the word count. For example, words with the same word count as the keyword are returned first. For words with different word counts than the keyword, a preset distance (such as 0.1) is added when sorting the queried words for each increase / decrease in word count.
[0113] (2) Filter the queried words by word type, which includes Chinese, English and numbers. For example, words that are consistent with the keyword type are returned first. In addition, if Chinese is input and English is returned, or English is input and Chinese is returned, the return is normal. However, if Chinese is input and numbers are returned, or English is input and numbers are returned, the synonym is directly deleted. It should be noted that a single English letter or a single Chinese character represents 1 character.
[0114] (3) Removing words that have more characters than the keyword by a preset number, for example, words that have more than 5 characters than the keyword.
[0115] It is understandable that the above method can also be used to push synonyms.
[0116] In summary, the synonym push method provided by the present invention includes obtaining an interview question; configuring a first preset number of keywords corresponding to the answer to the interview question; searching for a second preset number of synonyms corresponding to each keyword in a pre-trained word vector model; and pushing the second preset number of synonyms for user selection. The word vector used in this application covers a wide range, and the vector dimension of the word representation is 200 dimensions. The vector of each word can well reflect the actual semantics of each word; the word vector model of this application includes 8 million words, which well solves the problem of traditional out-of-word matching. The word vector model used in this application greatly reduces the memory usage, greatly reduces the memory usage by sampling the word-index file, and greatly increases the system stability. In addition, the query return speed of this application is greatly increased. The query time of a word originally required about ten seconds, and now it is reduced to less than 0.01s. Finally, this application can configure more synonyms of keywords corresponding to the answers to the interview questions for the robot interview process. Therefore, when receiving the job seeker's answer to the interview question, the job seeker's answer can be analyzed more accurately, which is convenient for human resources to give a more comprehensive analysis of the job seeker.
[0117] The above is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. For ordinary technicians in this field, improvements can be made without departing from the creative concept of the present invention, but these all belong to the protection scope of the present invention.
[0118] Combine the following Figure 2 and Figure 3, the functional modules and hardware structure of the electronic device that implements the above-mentioned synonym push method are introduced respectively.
[0119] Embodiment 2
[0120] Figure 2 It is a functional module diagram of a preferred embodiment of the synonym pushing device of the present invention.
[0121] In some embodiments, the synonym push device 20 (referred to as "push device" for ease of description) runs in an electronic device. The push device 20 may include a plurality of functional modules composed of program code segments. The program code of each program segment in the push device 20 may be stored in a memory and executed by at least one processor to perform the synonym push function.
[0122] In order to better determine whether the job seeker's answers to the interview questions in the interview process are correct through the robot during the robot interview, and to score the job seeker according to the answer results. It is necessary to configure keywords according to the answers corresponding to the interview questions, and extract keywords according to the input answers after receiving the answers entered by the job seeker. Match the extracted keywords with the configured keywords to obtain matching results, and score the job seeker according to the matching results. When configuring keywords according to the answers corresponding to the interview questions, in order to avoid the situation where the keywords are not comprehensive enough, the present application provides a push device 20 that expands the keywords entered by the interviewer when configuring keywords and pushes synonyms / synonyms. The functional modules of the push device 20 may include: an acquisition module 201, a configuration module 202, a training module 203, a construction module 204, a traversal module 205, a deduplication module 206 and a push module 207. The functions of each module will be described in detail in subsequent embodiments. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory.
[0123] The acquisition module 201 is used to obtain interview questions.
[0124] During the robot interview process, different interview questions will be assigned according to different positions. For example, interview questions for R&D positions include "What programming languages are you familiar with?", "How to jump out of the current multi-nested loop in Java?" and "Does Java have memory leaks? Please describe briefly."
[0125] In this embodiment, the robot interview needs to pre-configure the interview questions and answers. However, different job seekers give different answers to the same interview questions. In order to comprehensively evaluate the ability of job seekers, when configuring the interview questions and answers, it is necessary to configure detailed, complete and comprehensive answers according to the interview questions.
[0126] The configuration module 202 is used to configure a first preset number of keywords of answers corresponding to the interview questions.
[0127] In one embodiment, the configuring of the first preset number of keywords corresponding to the answer to the interview question includes:
[0128] Query the answer corresponding to the interview question configuration in a pre-established interview question and answer correspondence table to obtain a query result;
[0129] Extracting keywords from the query result, wherein the keywords are a first preset number.
[0130] It is understandable that the keyword may also be a keyword related to the query result obtained by performing semantic analysis on the query result.
[0131] In another embodiment, configuring the first preset number of keywords corresponding to the interview question includes:
[0132] (1) Analyze the interview questions according to the pre-constructed question parsing model to obtain the corresponding question intention.
[0133] In this embodiment, the question parsing model can analyze the question features of the interview question. The question features can include the question stem intention and key information. For example, when the interview question is "What programming languages are you good at", the question stem intention is the programming language you are good at, and the key information can be the programming language.
[0134] (2) Determine the answer corresponding to the interview question based on the question intent and the pre-established knowledge base.
[0135] For example, when the interview question is "What programming languages are you good at?", the pre-established knowledge base may include C / C++, Java, C#, and SQL, etc.
[0136] (3) Extracting a first preset number of keywords based on the corresponding answers.
[0137] The training module 203 is used to obtain a target word vector model based on the super large word vector model through pre-training.
[0138] In this embodiment, a suitable target word vector model is obtained by pre-training based on a super-large word vector model. Specifically, it includes: expanding the robot interview scene corpus in the super-large word vector model, including segmenting the robot interview scene corpus, removing stop words, and performing word vector training operations based on the CBOW model; and obtaining the target word vector model based on the super-large word vector model after the expanded corpus.
[0139] Specifically, the training corpus of the super-large word vector model covers a large amount of news, web pages, novels, Baidu Encyclopedia, Wikipedia and other corpora of different dimensions. However, for the robot interview scenario, the corpus of the specific scenario in the super-large word vector model is insufficient. Therefore, the corpus of the robot interview scenario is integrated on the basis of the super-large word vector model, and the corpus such as question and answer text and similar question text in the robot interview is expanded. The target word vector model is a word vector model that includes the expectations of the robot interview.
[0140] Then, the robot interview scene corpus is segmented, stop words are removed, and word vectors are incrementally trained based on the CBOW model to expand its performance in the robot interview scenario. The final trained target word vector model covers more than 8 million words, and the dimension of each word is about 200 dimensions. This makes the target word vector model corpus extensive, and each word vector therein can well reflect the semantics of each word. At the same time, the order of 8 million words can completely replace the traditional way of building a synonym dictionary, which can well solve the problem of not finding words.
[0141] It should be noted that the method of obtaining a target word vector model based on pre-training of a super-large word vector model is an existing technology and will not be described in detail here.
[0142] The construction module 204 is used to construct a word vector matrix according to the target word vector model to obtain a word-index file, wherein the word-index file includes a correspondence between word vectors and indexes.
[0143] In this implementation, constructing a word vector matrix according to the target word vector model to obtain a word-index file may include:
[0144] (a1) constructing a word vector matrix with the dimension of each word as the number of rows and the total number of all words in the target word vector model as the number of columns;
[0145] (a2) Each row in the word vector matrix corresponds to an index;
[0146] (a3) constructing a word-index file according to the word vector matrix, and outputting the word-index file.
[0147] Specifically, the word vector matrix is a matrix composed of the dimension of each word as the number of rows and the total number of all words as the number of columns. In this embodiment, the dimension of each word is 200, and the target word vector model includes 8 million words. Then, a word vector matrix with 200 columns and 8 million rows can be obtained.
[0148] Each row in the word vector matrix has an index, so the index corresponding to each word can be obtained. Thus, the word-index file is output according to the word vector matrix. At the same time, the corresponding relationship between each index and each word vector can also be obtained.
[0149] The construction module 204 is further configured to construct a binary tree based on all word vectors in the target word vector model.
[0150] In this embodiment, all word vectors in the target word vector model are constructed into a binary tree structure.
[0151] The word vector is a 200-dimensional vector, that is, a 200-dimensional high-dimensional data space. Each word vector represents a point in the high-dimensional data space. The data space corresponding to all word vectors in the target word vector model can be represented as 8 million points. The binary tree is constructed according to the target word vector model by the following method:
[0152] (1) Randomly select two points as initial nodes and connect the two initial nodes to form an equidistant hyperplane.
[0153] (2) constructing an equidistant vertical hyperplane according to the midpoint vertical line of the line connecting the two initial nodes, dividing the data space corresponding to all word vectors in the target word vector model into two parts, and obtaining two subspaces.
[0154] (3) Multiply each point in each subspace by the normal vector of the equidistant hyperplane (vector dot product), find the sign of the angle between each point and the normal vector, and use the sign to distinguish whether it belongs to the left subtree or the right subtree of the binary tree.
[0155] (4) Similarly, by repeating the above steps (1) to (3) in the two subspaces respectively, the data space can be divided into multiple subspaces, and a binary tree structure can be constructed based on the multiple subspaces.
[0156] Preferably, when there are only k points in each subspace at most, the subspace is no longer divided. Preferably, k is greater than or equal to 8 and less than or equal to 10. In this embodiment, the value of k is 10.
[0157] The segmentation conditions of each node in the above binary tree structure are those equidistant vertical hyperplanes. Finally, the word vector is the leaf node on the binary tree. In this application, there is no need to save the word vector on the leaf node, only the index corresponding to the word vector needs to be saved. In this way, similar word vectors are closer in position on the binary tree, which provides a faster speed for subsequent queries of synonyms.
[0158] The traversal module 205 is used to traverse the binary tree, query the first candidate word vector whose distance to the keyword is greater than a preset distance threshold from the binary tree, and construct a priority queue based on the first candidate word vector.
[0159] The specific method for constructing a priority queue is: taking the keyword as the root node of the binary tree; traversing all intermediate nodes under the root node; calculating the distance between the root node and each intermediate node; determining the intermediate node corresponding to the target distance greater than a preset distance threshold as the first-level target node; traversing all intermediate nodes under the first-level target node until the last-level leaf node; taking the word vectors in all leaf nodes as the first candidate word vector; calculating the similarity between the first candidate word vector and the keyword; and inserting the first candidate word vector into the priority queue in order of similarity.
[0160] The deduplication module 206 is used to deduplicate the first candidate word vectors in the priority queue.
[0161] The acquisition module 201 is further used to acquire the target word vectors of the second preset number that are ranked first in the priority queue after deduplication.
[0162] The push module 207 is used to push a second preset number of synonyms for user selection based on the second preset number of target word vectors and word-index files.
[0163] In this embodiment, the method for pushing a second preset number of synonyms for user selection based on the second preset number of target word vectors and word-index files includes: obtaining the target index corresponding to the second preset number of target word vectors; querying the word vector corresponding to the target index according to the word-index file; and pushing the synonyms corresponding to the word vector for user selection.
[0164] In this embodiment, the binary tree structure file and the word-index file are stored together. When it is necessary to search for the top N words that are close to a certain keyword, only these two files need to be used for indexing.
[0165] In this embodiment, by pushing a second preset number of synonyms for users to filter, it is convenient for users to more comprehensively configure the keywords of the answers corresponding to the interview questions. Therefore, when job applicants answer questions, they will not be scored one-sidedly based on their answers. The synonym search function supported by this application is more innovative and convenient. It can generate synonyms for 5 keywords at a time, and push 8 synonyms each time. It supports users to click "Change Batch" to replace another round of 8 synonyms, which is convenient for users to view and use. For example, a "Change Batch" button is displayed on the push interface. After the user clicks the button, the original synonyms can be updated and more synonyms can be pushed.
[0166] Preferably, since many words are not answers to the interview questions, preset rules are added to filter the queried words, wherein the preset rules include at least one of the following rules:
[0167] (1) Adjusting the order of the queried words according to the word count. For example, words with the same word count as the keyword are returned first. For words with different word counts than the keyword, a preset distance (such as 0.1) is added when sorting the queried words for each increase / decrease in word count.
[0168] (2) Filter the queried words by word type, which includes Chinese, English and numbers. For example, words that are consistent with the keyword type are returned first. In addition, if Chinese is input and English is returned, or English is input and Chinese is returned, the return is normal. However, if Chinese is input and numbers are returned, or English is input and numbers are returned, the synonym is directly deleted. It should be noted that a single English letter or a single Chinese character represents 1 character.
[0169] (3) Removing words that have more characters than the keyword by a preset number, for example, words that have more than 5 characters than the keyword.
[0170] It can be understood that the above-mentioned pushing device 20 can also be used to push synonyms.
[0171] In summary, the push device 20 described in the present invention includes an acquisition module 201, a configuration module 202, a training module 203, a construction module 204, a traversal module 205, a deduplication module 206 and a push module 207. The acquisition module 201 is used to obtain interview questions; the configuration module 202 is used to configure a first preset number of keywords corresponding to the answers to the interview questions; the training module 203 is used to pre-train based on the super-large word vector model to obtain a target word vector model; the construction module 204 is used to construct a word vector matrix according to the target word vector model to obtain a word-index file, wherein the word-index file includes the correspondence between word vectors and indexes; the construction module 204 is also used to construct a binary tree based on all word vectors in the target word vector model; the traversal module 205 is used to traverse the binary tree, query the first candidate word vector whose distance to the keyword is greater than a preset distance threshold from the binary tree and construct a priority queue based on the first candidate word vector; the deduplication module 206 is used to deduplicate the first candidate word vector in the priority queue; the acquisition module 201 is also used to obtain the second preset number of target word vectors ranked first in the priority queue after deduplication; and the push module 207 is used to push a second preset number of synonyms for user selection based on the second preset number of target word vectors and the word-index file.
[0172] The word vector used in this application covers a wide range, and the vector dimension of the word representation is 200 dimensions. The vector of each word can well reflect the actual semantics of each word; the word vector model of this application includes 8 million words, which solves the traditional problem of out-of-word matching. The memory usage of the word vector model used in this application is greatly reduced, and the memory usage rate is greatly reduced by sampling the word-index file, and the system stability is greatly increased. In addition, the query return speed of this application is greatly increased. The query time for a word originally required about ten seconds, and now it is reduced to less than 0.01s. Return. Finally, this application can configure more synonyms of keywords corresponding to the answers to the interview questions in the robot interview process. It is convenient for human resources HR to configure more comprehensive answers for interview questions when interviewing job applicants. Therefore, when receiving the job applicant's answer to the interview question, the job applicant's answer can be analyzed more accurately, which is convenient for human resources to give a more comprehensive analysis of the job applicant.
[0173] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for enabling a computer device (which can be a personal computer, a dual-screen device, or a network device, etc.) or a processor to execute a part of the method described in each embodiment of the present invention.
[0174] Figure 3 This is a schematic diagram of an electronic device provided in Embodiment 3 of the present invention.
[0175] The electronic device 3 includes: a memory 31 , at least one processor 32 , a computer program 33 stored in the memory 31 and executable on the at least one processor 32 , at least one communication bus 34 , and a database 35 .
[0176] When the at least one processor 32 executes the computer program 33, the steps in the above-mentioned synonym push method embodiment are implemented.
[0177] Exemplarily, the computer program 33 may be divided into one or more modules / units, which are stored in the memory 31 and executed by the at least one processor 32 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 33 in the electronic device 3.
[0178] The electronic device 3 may be a mobile phone, a tablet computer, a personal digital assistant (PDA), or other device with an application installed. Figure 3 It is only an example of the electronic device 3 and does not constitute a limitation of the electronic device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 3 may also include input and output devices, network access devices, buses, etc.
[0179] The at least one processor 32 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 32 may be a microprocessor or any conventional processor, etc. The processor 32 is the control center of the electronic device 3, and uses various interfaces and lines to connect various parts of the entire electronic device 3.
[0180] The memory 31 can be used to store the computer program 33 and / or modules / units. The processor 32 realizes various functions of the electronic device 3 by running or executing the computer program and / or modules / units stored in the memory 31 and calling the data stored in the memory 31. The memory 31 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device 3 (such as audio data, etc.), etc. In addition, the memory 31 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
[0181] The memory 31 stores program codes, and the at least one processor 32 can call the program codes stored in the memory 31 to execute related functions. For example, Figure 2 The various modules described in (acquisition module 201, configuration module 202, training module 203, construction module 204, traversal module 205, deduplication module 206 and push module 207) are program codes stored in the memory 31 and executed by the at least one processor 32, thereby realizing the functions of the various modules to achieve the purpose of synonym push.
[0182] The acquisition module 201 is used to obtain interview questions;
[0183] The configuration module 202 is used to configure a first preset number of keywords corresponding to the answer to the interview question;
[0184] The training module 203 is used to obtain a target word vector model based on the super large word vector model in advance;
[0185] The construction module 204 is used to construct a word vector matrix according to the target word vector model to obtain a word-index file, wherein the word-index file includes a correspondence between word vectors and indexes;
[0186] The construction module 204 is also used to construct a binary tree based on all word vectors in the target word vector model;
[0187] The traversal module 205 is used to traverse the binary tree, query the first candidate word vector whose distance to the keyword is greater than a preset distance threshold from the binary tree, and construct a priority queue based on the first candidate word vector;
[0188] The deduplication module 206 is used to dedupe the first candidate word vectors in the priority queue;
[0189] The acquisition module 201 is further used to acquire the target word vectors of the second preset number in the priority queue after deduplication; and
[0190] The push module 207 is used to push the second preset number of synonyms for the user to select from the second preset number of target word vectors and word-index files.
[0191] The database 35 is a warehouse established on the electronic device 3 that organizes, stores and manages data according to a data structure. Databases are generally divided into three types: hierarchical databases, network databases and relational databases. In this embodiment, the database 35 is used to store information such as interview questions.
[0192] If the module / unit integrated in the electronic device 3 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).
[0193] In the several embodiments provided by the present invention, it should be understood that the disclosed electronic device and method can be implemented in other ways. For example, the electronic device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation.
[0194] In addition, each functional unit in each embodiment of the present invention may be integrated into the same processing unit, each unit may exist physically separately, or two or more units may be integrated into the same unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0195] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or, and the singular does not exclude the plural. Multiple units or devices stated in the system claim may also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0196] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A synonym push method, characterized in that: The method comprises: Get interview questions; Configuring a first preset number of keywords corresponding to the answers to the interview questions; Pre-training a target word vector model based on a super large word vector model includes: expanding the robot interview scene corpus in the super large word vector model, including performing word segmentation, stop word removal, and word vector training based on the CBOW mode increment on the robot interview scene corpus; training the target word vector model based on the super large word vector model after the expanded corpus; Constructing a word vector matrix according to the target word vector model to obtain a word-index file, including: constructing a word vector matrix with the dimension of each word as the number of rows and the total number of all words in the target word vector model as the number of columns; each row in the word vector matrix corresponds to an index; constructing a word-index file according to the word vector matrix, and outputting the word-index file, wherein the word-index file includes a corresponding relationship between word vectors and indexes; Constructing a binary tree based on all word vectors in the target word vector model, including: (1) randomly selecting two points as initial nodes, connecting the two initial nodes to form an equidistant hyperplane; (2) constructing an equidistant vertical hyperplane based on the midpoint vertical line of the line connecting the two initial nodes, dividing the data space corresponding to all word vectors in the target word vector model into two parts, and obtaining two subspaces; (3) multiplying each point in each subspace by the normal vector of the equidistant hyperplane, respectively, and calculating the positive and negative angle between each point and the normal vector, and using the positive and negative angle to distinguish whether the point belongs to the left subtree or the right subtree of the binary tree; and so on, repeating the above (1) to (3) in the two subspaces respectively, so that the data space can be divided into multiple subspaces, and the binary tree can be constructed based on the multiple subspaces; Traversing the binary tree, searching for a first candidate word vector whose distance from the keyword is greater than a preset distance threshold from the binary tree, and constructing a priority queue based on the first candidate word vector; Deduplication of the first candidate word vectors in the priority queue; Get the target word vectors that are ranked second in the priority queue after deduplication; Based on the second preset number of target word vectors and word-index files, a second preset number of synonyms are pushed for user selection.
2. The synonym push method according to claim 1, characterized in that: The step of configuring a first preset number of keywords corresponding to the answer to the interview question includes: Analyze the interview questions according to a pre-built question parsing model to obtain the corresponding question intention; Determine the answer to the interview question based on the question intent and the pre-established knowledge base; and A first preset number of keywords are extracted according to the corresponding answers.
3. The synonym push method according to claim 1, characterized in that: The pushing of the second preset number of synonyms for user selection based on the second preset number of target word vectors and word-index files comprises: Obtain target indexes corresponding to the second preset number of target word vectors; Querying the word vector corresponding to the target index according to the word-index file; The synonyms corresponding to the word vector are pushed for the user to choose.
4. The synonym push method according to claim 1, characterized in that: The step of searching the binary tree for a first candidate word vector whose distance from the keyword is greater than a preset distance threshold and constructing a priority queue based on the first candidate word vector comprises: Using the keyword as the root node of the binary tree; Traverse all intermediate nodes under the root node; Calculate the distance between the root node and each intermediate node; Determine the intermediate node corresponding to the target distance greater than the preset distance threshold as the first-layer target node; Traverse all intermediate nodes under the first layer target node until the last layer leaf node; Take the word vectors in all leaf nodes as the first candidate word vectors; Calculating the similarity between the first candidate word vector and the keyword; The first candidate word vectors are inserted into the priority queue according to the order of similarity.
5. The synonym push method according to claim 1, characterized in that: The second preset number of synonyms found are filtered according to preset rules, wherein the preset rules include at least one of the following rules: Adjusting the order of the second preset number of synonyms found according to the number of words; Filtering a second preset number of synonyms found by vocabulary type; The words whose number of characters in the second preset number of synonyms is greater than the preset number of characters in the keyword are removed.
6. A synonym pushing device, characterized in that: The device comprises: Acquisition module, used to obtain interview questions; A configuration module, used to configure a first preset number of keywords corresponding to the answers to the interview questions; A training module is used to obtain a target word vector model based on a super large word vector model through pre-training, including: expanding the robot interview scene corpus in the super large word vector model, including performing word segmentation, stop word removal and word vector training based on the CBOW mode increment on the robot interview scene corpus; obtaining a target word vector model through training based on the super large word vector model after the expanded corpus; A construction module, used to construct a word vector matrix according to the target word vector model to obtain a word-index file, including: constructing a word vector matrix with the dimension of each word as the number of rows and the total number of all words in the target word vector model as the number of columns; each row in the word vector matrix corresponds to an index; constructing a word-index file according to the word vector matrix, and outputting the word-index file, wherein the word-index file includes a corresponding relationship between word vectors and indexes; The construction module is also used to construct a binary tree based on all word vectors in the target word vector model, including: (1) randomly selecting two points as initial nodes, connecting the two initial nodes to form an equidistant hyperplane; (2) constructing an equidistant vertical hyperplane based on the midpoint vertical line of the line connecting the two initial nodes, dividing the data space corresponding to all word vectors in the target word vector model into two parts, and obtaining two subspaces; (3) multiplying each point in each subspace by the normal vector of the equidistant hyperplane, respectively, and calculating the positive and negative angle between each point and the normal vector, and using the positive and negative angle to distinguish whether the point belongs to the left subtree or the right subtree of the binary tree; and so on, repeating the above (1) to (3) in the two subspaces respectively, so that the data space can be divided into multiple subspaces, and the binary tree can be constructed based on the multiple subspaces; A traversal module, configured to traverse the binary tree, query a first candidate word vector whose distance from the keyword is greater than a preset distance threshold from the binary tree, and construct a priority queue based on the first candidate word vector; A deduplication module, used for deduplicating the first candidate word vectors in the priority queue; The acquisition module is further used to acquire the target word vectors of the second preset number in the priority queue after deduplication; and A push module is used to push a second preset number of synonyms for user selection based on the second preset number of target word vectors and word-index files.
7. An electronic device, characterized in that: The electronic device includes a processor and a memory, and the processor is used to implement the synonym push method according to any one of claims 1 to 5 when executing a computer program stored in the memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the synonym pushing method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Cross-language vocabulary synonym prediction method and device and electronic equipment
CN109597988A
Question and answer processing method and device and question and answer system
CN109947922A
