Keyword acquisition method, device, computing device and storage medium
Through the node2vec and word2vec models, the word graphs are sampled and word vector training are solved, and the problem of keyword association and high-quality keyword group mining in the existing technology is achieved, efficient keyword acquisition and association on billion-level corpus is achieved, and the accuracy is improved. degree and recall rate.
Patent Information
- Application Number
- CN202110557654.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-21
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2041-05-21
AI Technical Summary
The prior art has difficulties in quickly and accurately extracting and associating keywords from large-scale text information, especially in semantic similarity calculations and high-quality keyword group mining, and traditional methods are difficult to quickly process on billions of corpus. This leads to lower accuracy and recall of keyword association mining.
The node2vec model is used to sample the word graph of the three-level nodes of phrase-word-word, and the word2vec model is used to train word vectors. By calculating the similarity of the average word vector and filtering of regular expressions, high-performance keyword acquisition and association are achieved. , large-scale corpus processing is carried out based on high-performance graph computing platform and distributed computing platform.
It significantly improves the accuracy and recall rate of keyword associations, reduces the errors caused by manual definition rules, can handle corpus of billions at the minute level, and improves the proportion and accuracy of keyword groups.
Smart Images

Figure CN113761123B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence text mining technology, and in particular to a keyword acquisition method and apparatus, a computing device, and a computer-readable storage medium. Background Art
[0002] The continuous development of information technology has led to an explosive growth of information in many fields, and a large amount of text information has been digitized. Electronic resources such as digital libraries, electronic paper libraries, corporate websites, product introductions, etc. have brought great convenience to people in collecting, storing and analyzing information based on information. With the continuous increase of electronic information, quickly and accurately extracting and associating keywords from large-scale text information, and analyzing specific fields based on the obtained keywords are effective means to quickly obtain the information, and are also the core technology in the field of text mining, playing a very important role. Summary of the invention
[0003] In view of this, the present application provides a keyword acquisition method and apparatus, a computing device, and a computer-readable storage medium.
[0004] According to the first aspect of the present application, a keyword acquisition method is provided, including: acquiring seed keywords; performing regular screening on keywords in a full corpus based on the seed keywords to obtain recall keywords: acquiring the average word vector of the recall keywords and the average word vector of positive keywords in a positive keyword library; calculating the similarity between the average word vector of the recall keywords and the average word vector of the positive keywords; extracting recall keywords whose similarity is greater than a predetermined threshold as candidate keywords; sorting the candidate keywords with a predetermined frequency as a weight, and outputting the sorted keywords.
[0005] According to another aspect of the present application, a keyword acquisition device is provided, including an acquisition module, a screening module and a keyword association module. The acquisition module is configured to acquire seed keywords. The screening module is configured to perform regular screening on keywords in the full corpus based on the seed keywords to obtain recalled keywords. The keyword association module is configured to perform the following steps on the recalled keywords: obtain the average word vector of the recalled keywords and the average word vector of the positive keyword library; calculate the similarity between the average word vector of the recalled keywords and the average word vector of the positive keyword; extract the recalled keywords with a similarity greater than a predetermined threshold as candidate keywords; sort the candidate keywords using word frequency-inverse document frequency as weights, and output the sorted keywords.
[0006] According to another aspect of the present application, a computing device is provided, which includes: a memory configured to store computer-executable instructions; and a processor configured to execute a method as described in any one of the embodiments of the aforementioned method for eliminating echoes when the computer-executable instructions are executed by the processor.
[0007] According to another aspect of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions. When the computer-executable instructions are executed, the method described in any one of the embodiments of the method for eliminating echo is executed.
[0008] Utilizing the method, apparatus, computing device or computer-readable storage medium provided by the embodiments of the present application, the word graph model consisting of three levels of phrase-word-character is sampled by using the node2vec model; the word vector is trained using the word2vec model for the sampling sequence of the node, thereby improving the accuracy and recall rate of associative mining of keywords compared to related technologies. This method can mine high-quality keyword groups from the corpus. The proportion of keyword groups mined is higher than that of traditional methods, while reducing downstream errors caused by manually defined rules for keyword reorganization. Based on a high-performance graph computing platform and a distributed computing platform, association and mining of keywords at the billion level are achieved, with a processing speed of the order of minutes. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Embodiments of the present disclosure will now be described in more detail and with reference to the accompanying drawings, in which:
[0010] Figure 1 The structure of a network architecture in which the technical solution according to the embodiment of the present application can be implemented is schematically shown;
[0011] Figure 2A A flowchart of a method for automatically extracting keywords based on distributed word vector calculation in the related art is schematically shown;
[0012] Figure 2B A flowchart schematically shows another method for automatically extracting keywords based on distributed word vector calculation in the related art;
[0013] Figures 3A-3C An example of a scenario in which the method for obtaining keywords provided in an embodiment of the present application is applied is schematically shown;
[0014] Figure 4 A flowchart of a method for keyword association according to an embodiment of the present application is schematically shown;
[0015] Figure 5 An example of text word graph construction of an enterprise's business scope is schematically shown;
[0016] Figure 6 The node sampling strategy of the node2vec algorithm is schematically shown;
[0017] Figure 7 An example flow chart of a method for acquiring keywords according to an embodiment of the present application is schematically shown;
[0018] Figure 8 An example block diagram of an apparatus for acquiring keywords according to an embodiment of the present application is schematically shown;
[0019] Fig. 9 An example system is schematically illustrated that includes an example computing device that represents one or more systems and / or devices that may implement the various techniques described herein. DETAILED DESCRIPTION
[0020] The technical solutions in this application will be described clearly and completely below in conjunction with the accompanying drawings. The described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of this application.
[0021] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a technology that simulates human cognitive ability through machines. Artificial intelligence is a comprehensive discipline that covers a wide range of fields, including perception, learning and decision-making capabilities, and has both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. The core ability of artificial intelligence is to make judgments or predictions based on given input. For example, in human face recognition applications, the person in the photo can be judged based on the input photo. In medical diagnosis, the cause and nature of the disease can be judged based on the input medical images.
[0022] In artificial intelligence software technology, machine learning is an important technology that makes computers have intelligent characteristics. Machine learning is a multi-disciplinary interdisciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. Machine learning specializes in how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning usually includes artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning and other technologies.
[0023] In order to facilitate the understanding of the embodiments of the present application, several concepts are briefly introduced below.
[0024] A regular expression is a pattern that describes a string match, which is used to check whether a string contains a certain substring, replace the matching substring, or extract the substring that meets the conditions from a substring.
[0025] Word embedding is a general term for language models and representation learning techniques in natural language processing. Conceptually, it means embedding a high-dimensional space with the same dimension as the number of all words into a continuous vector space with a much lower dimension, where each word or phrase is mapped to a vector in the real number field.
[0026] Graph embedding refers to the process of mapping graph data (usually high-dimensional sparse matrices) into low-dimensional dense vectors. The embedding vector of each graph node can capture some topological structures of the graph. The embedding vector is similar to a word vector and is also a distributed expression.
[0027] Keyword association means mining and discovering related keywords based on given seed keywords. The results must be similar to the given seed keywords within a certain semantic range. For example, if the given seed keyword is "doors and windows", if the extracted keywords are "mosquito screens", "rolling doors", "security doors", etc., they meet the relevant restrictions. If they are "tires", "buying vegetables", etc., they are not keywords related to doors and windows and are irrelevant.
[0028] The embodiment of the present application provides a technical solution for keyword acquisition. Using this technical solution, when a seed keyword is given to generate similar keywords by association, the word vector is first obtained by the word vector training method proposed in this application, the seed keyword is input, and based on the semantic similarity calculation, the candidate keyword list is recalled and recommended. Then, the keywords are screened and the iterative discovery process continues. As a result, the entire keyword acquisition process only requires a small amount of manual screening to complete, and the diversity and relevance of the keywords are higher than those of related methods.
[0029] Figure 1The diagram shows an example of a network system structure in which the technical solution according to the embodiment of the present application can be implemented. Examples of scenarios where the network system is applied include but are not limited to industry keyword discovery scenarios for corporate portraits, keyword-based corporate business scope classification scenarios, keyword-based public opinion news classification scenarios, etc. Figure 1 As shown, different users can use different or the same terminal devices, and the terminal device can be any mobile terminal or fixed terminal with human-computer interaction function. Examples of terminal devices include but are not limited to mobile phones, desktop computers, tablet computers, laptops and PDAs. Each terminal device can be connected to the server through a network respectively, so that each terminal device can interact with the server for data. The server can be, for example, an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, and big data and artificial intelligence platforms. Alternatively, the network system may not include a server, that is, different terminal devices can directly establish communication, thereby implementing the technical solution for keyword acquisition in the embodiment of the present application.
[0030] Figure 2A The flowchart of a method for automatically extracting keywords based on distributed word vector calculation in the related art is schematically shown. Figure 2A In the method, the original data set is first obtained and divided into an initial training set, a domain keyword set, and a test text set. Then, the initial training set and the test text set are preprocessed. Thereafter, the word vector is trained based on the text of the preprocessed training set to obtain a word vector table. All keywords in the domain keyword set are converted into distributed expression word vectors. The arithmetic average semantic distance of the distributed expression word vectors of all words in the test text set is calculated, the distances are sorted, and the keyword with the smallest distance after sorting is selected as the result output.
[0031] Figure 2B Another text keyword extraction method in the related art is schematically shown. In this method, first in S1, an irrelevant document in the training text set is opened. In S2, the document is segmented and tagged with parts of speech. In S3, meaningful content words are extracted through the "stop word" table. In S4, the frequency of occurrence of all content words is counted. In S5, content words with an absolute word frequency of 1 are deleted. Finally, in S6, the TF-IDF formula is used to calculate the weights of all content words in a single text so as to extract a certain proportion of keywords from it.
[0032] Above Figure 2AThe solution in cannot perform associative mining based on a given seed keyword to discover keywords in the corpus that are semantically similar to the seed keyword. For example, the solution cannot mine keywords related to doors and windows from the corpus when the input is "metal doors and windows". Figure 2B The solution in the paper is difficult to recall keywords with unclear statistical significance. For example, it is difficult to recall high-quality keyword groups based on simple word vector calculations. For example, the solution cannot automatically discover keywords through clustering, and relies on a large number of candidate keyword inputs for calculation, and high-quality candidate keywords themselves are a difficult problem. Figure 2A and 2B The related technologies in the paper are all versions that run on a single machine, and it is difficult to quickly associate and mine keywords of a category on a large-scale corpus (for example, a corpus of hundreds of millions or more).
[0033] In response to the defects in the related art, the present application constructs a word graph with three-level nodes of phrase-word-character, uses the graph embedding node2vec technology to generate training samples, and uses word2vec to train word vectors. For a class of seed keywords input, the word vector is converted into an average word vector, the center of this class of keywords is calculated, and regular expressions are used for rough screening to quickly recall related texts. The semantic similarity is calculated by calculating the distance, and a more fine-grained sorting is performed to output the results of related keywords. The solution of the present application is based on a high-performance graph computing platform and a distributed computing platform to achieve association and mining of keywords at the billion level, with a processing speed of the order of minutes. As an example, the algorithm development and running environment of the present application can be set as follows: the commonly used algorithm implementation language is Python version 3.6; the running environment can use the distributed computing framework Apache Spark version 2.3.1 or the high-performance distributed graph computing framework Plato version 0.1; the Chinese word segmentation component can use Jieba version 0.39.
[0034] Figures 3A-3C Examples of various scenarios for applying the keyword acquisition method provided in the embodiments of the present application are schematically shown. Figure 3A The following schematic diagram shows the scenario in which the keyword acquisition method provided in the embodiment of the present application is applied to generate a corporate portrait. Through the seed keyword "door industry", the industry keywords of the enterprise can be mined from the business scope corpus of the enterprise for functions such as industrial analysis of the enterprise. Then, the corporate portrait is generated based on the generated corporate keywords. Figure 3B The method for obtaining keywords provided in the embodiment of the present application is schematically shown in the scenario of classifying the scope of enterprises. Based on the input seed keyword "door industry", the scope of enterprises is classified and a list of enterprises in related industries is displayed. Figure 3CSchematically shows that the keyword acquisition method provided by the embodiments of the present application is applied to the scenario of public opinion news analysis based on keywords. Here, when the seed keyword is "door industry", the associated keywords can be obtained based on the keywords provided by the embodiments of the present application, and the associated keywords are used for rapid recall and classification of public opinion news texts.
[0035] Figure 4 Schematically shows a flowchart of a method 400 for keyword association according to an embodiment of the present application. First, preprocess the enterprise business scope corpus 401. The preprocessing mainly includes offline training of word vectors 402 based on the enterprise business scope corpus and obtaining a word vector library 403. The word vector library 403 is used for subsequent semantic calculations for keyword association. Specifically, the pre-training includes the following steps:
[0036] Segment the enterprise business scope corpus 401. When the text is in Chinese, the levels of the text include "phrase", "word", and "character". Perform phrase segmentation on this text. The method is to segment based on the punctuation marks in the text. For each word, perform word segmentation based on a word segmentation component (for example, the jieba word segmentation component) and remove stop words (such as "is", "of", etc.). Further, divide each word into "characters".
[0037] Construct a word graph: Set the phrases, words, and characters obtained in step (1) as the nodes of the word graph. Figure 5 Schematically shows an example of constructing a text word graph of the enterprise business scope. Here, connect the words within a certain size window (for example, take a window size of 5) in the business scope text and set the weight of this edge (for example, the weight is 1.0); connect the phrase-word nodes and set the weight of this edge (for example, the weight is 0.5); connect the word-character nodes and set the weight of this edge (for example, the weight is 0.1). As understood by those skilled in the art, the weight of the edge can also be other values.
[0038] Train word vectors based on a graph embedding algorithm. Here, the graph embedding algorithm uses node2vec to sample the nodes in the word graph to generate a node sequence (v1, v2, v3,...) composed of nodes. In one embodiment, the specific sampling algorithm is: When given the current node v, the probability of accessing the next node is:
[0039]
[0040] where π vx is the unnormalized transition probability between node v and node x, Z is the normalization constant, c i =x is the probability of accessing node x, c i-1=v is the probability of visiting node v. In addition, in the node2vec algorithm, there are two hyperparameters p and q that control the random walk sampling strategy. Figure 6 The node sampling strategy of node2vec is schematically shown. Assume that the current random walk passes through the edge (t,v) to reach vertex v. Let π vx =α pq (t, x)·w vx , w vx is the edge weight between node v and node x, then
[0041]
[0042] d tx is the shortest path distance between node t and node x. In one embodiment, parameters p=100 and q=5 are used. In another embodiment, the step length of the random walk is 10. As those skilled in the art will appreciate, other appropriate values may be selected for the hyperparameters p, q and step length.
[0043] After obtaining the node sequence sample by sampling, the sequence is trained to obtain the word2vec word vector. Next, the keyword association and acquisition are performed based on the word vector library 403 obtained above. In step 404, a small number of seed keywords are first input. In some embodiments, the number of seed keywords can be 1 to 10. In step 405, a regular expression is used for rough screening, and the corpus T1 is recalled. In step 406, the keywords recalled after rough screening are calculated and sorted. Here, the Chinese of T1 is segmented, and the corresponding segmented word vector is found in the word vector library 403. The average word vector is taken as the representation of the text T1. The regular keyword library is segmented, and the average word vector is obtained as the vector center C1 of the keyword. When the regular keyword library is initialized, the input seed keyword is used as the initial regular keyword in the regular keyword library. Calculate the similarity between the average word vector of T1 and the average word vector of C1. In one embodiment, the cosine similarity between the average word vector of T1 and the average word vector of C1 is calculated. As those skilled in the art will appreciate, similarity can also be calculated by calculating other distances between the average word vector of T1 and the average word vector of C1. Then, words with similarity greater than a predetermined threshold are extracted as candidate keywords. Below, the candidate keywords are sorted using TF-IDF as the weight. Here tf-idf(w) = tf(w)*idf(w). Where tf(w) is the word frequency, which is the frequency of a word appearing in the coarse-screened corpus T1, idf(w) is the inverse document frequency, which is pre-calculated in the full corpus, and In step 407, according to the sorted output of the above TF-IDF weight size, the top K (K is a positive integer) outputs are selected and presented to the expert for labeling. In one embodiment, K can be, for example, the top 100 outputs sorted according to TF-IDF. The K outputs can be presented on the interface and corresponding labels can be provided for the expert to label. The label can be, for example: a label "Y" that identifies the candidate keyword as a positive keyword, and a label "N" that identifies the candidate keyword as not a positive keyword. Thus, a round of labeling is completed from steps 405 to 409. In 409, the iteration stop condition is judged. In one embodiment, the iteration stop condition is, for example, that the iteration reaches a predetermined number of iterations. When the number of iterations reaches the predetermined number of iterations, the iteration is stopped and the keywords in the positive keyword library are output as the result of the discovery, and the process ends. In one embodiment, the iteration can also be stopped manually, that is, after the iteration is manually stopped, the iteration is stopped and the keywords in the positive keyword library are output as the result of the discovery. When the predetermined number of iterations is not reached, return to step 405 to perform regular rough screening recall for the next iteration round.
[0044] The keyword acquisition solution uses the node2vec model to sample the graph model composed of three levels: phrase-word-character; the word2vec model is used to train the word vector for the sampling sequence of nodes. The accuracy and recall rate of the associative mining of keywords in this solution are greatly improved compared with the related technologies. The keyword acquisition technology solution of this application has greatly improved the accuracy of the keyword acquisition technology of the TF-IDF method and the Word2vec word vector method. In an example, the Top100 accuracy of the TF-IDF method is 9.06%, the Top100 accuracy of the Word2vec word vector method is 21.76%, and the Top100 accuracy of this application is 40.87%.
[0045] The technical solution of the present application can mine high-quality keyword phrases from the corpus. The proportion of keyword phrases mined is higher than that of traditional methods, while reducing downstream errors caused by manually defining 1 rule for keyword reorganization. In the absence of manually defined rules for connecting words into phrases, the keyword phrase ratio and keyword phrase accuracy of the present application are greatly improved relative to the related art. In an example, the keyword phrase ratio of the TF-IDF method is 0.187, and the keyword phrase ratio of the present application is 0.252; the keyword phrase accuracy of the TF-IDF method is 0.204, and the keyword phrase accuracy of the present application is 0.260.
[0046] In addition, the keyword acquisition method of the present application can be used to process large-scale text corpora, thereby increasing the speed of keyword mining. For example, the calculation speed for 220 million business scope texts is about 3 to 5 minutes.
[0047] Figure 7 An example flow chart of a method 700 for obtaining keywords according to an embodiment of the present application is schematically shown. In step 701, seed keywords are obtained. First, a small number of seed keywords are input. In some embodiments, the number of seed keywords can be 1 to 10. In step 702, regular screening is performed on the keywords in the full corpus based on the seed keywords to obtain recalled keywords. Rough screening is performed using regular expressions, and corpus T1 is recalled. In step 703, the average word vector of the recalled keywords and the average word vector of the positive keyword library are obtained.
[0048] In one embodiment, obtaining the average word vector of the recalled keywords and the average word vector of the positive keyword in the positive keyword library includes: searching for the word vector corresponding to the recalled keywords and the word vector corresponding to the positive keyword in the pre-trained word vector library based on the recalled keywords and the positive keyword, respectively; calculating the average word vector of the recalled keywords and the average word vector of the positive keyword based on the word vector corresponding to the recalled keywords and the word vector corresponding to the positive keyword, respectively.
[0049] In one embodiment, the pre-trained word vector library is trained based on the following steps: selecting the full corpus based on predetermined conditions; segmenting the text in the full corpus to obtain texts of different levels; constructing a word graph with texts of different levels as nodes; sampling the nodes to generate node sequences; and training word vectors based on the node sequences.
[0050] In one embodiment, selecting the full corpus based on a predetermined condition includes: selecting the full corpus based on a product scope or an enterprise scope.
[0051] In one embodiment, segmenting the text in the full corpus to obtain texts at different levels includes: segmenting the text in the full corpus to obtain texts at phrase, word, and character levels.
[0052] In one embodiment, texts at phrase, word and character levels are used as nodes, and each phrase, text at phrase and word level, and text at phrase and word level within a window of a predetermined size are connected as phrase-phrase edges, phrase-word edges, and word-word edges of a word graph. The phrase-phrase edges, phrase-word edges, and word-word edges of a word graph have different weights. For example, words within a window of a certain size (for example, a window of size 5) in the business scope text are connected, and the weight of the edge is set (for example, a weight of 1.0); the phrase-word nodes are connected (for example, a weight of 0.5); and the word-word nodes are connected (for example, a weight of 0.1).
[0053] Perform node sampling on the nodes and generate a node sequence including:
[0054] The node2vec algorithm is used for node sampling. When the random walk passes through the edge (t, v) and reaches the node v, starting from the current node v, the node2vec algorithm includes:
[0055] Starting from the current node v, the probability of visiting the next node is:
[0056]
[0057] Among them, π vx is the unnormalized transition probability between node v and node x, Z is the normalization constant, c i = x is the probability of visiting node x, c i-1 =v is the probability of visiting node v,
[0058] π vx =α pq (t, x)·w vx ,
[0059] w vx is the edge weight between node v and node x, p and q are hyperparameters that control random walk sampling, and α pq (t, x) is the transition probability between node t and node x,
[0060]
[0061] d tx is the shortest path distance between node t and node x.
[0062] In step 704, the similarity between the average word vector of the recalled keywords and the average word vector of the positive keyword is calculated. Here, the cosine distance is used as the semantic distance between the keywords. As those skilled in the art will appreciate, other distance methods may also be used to calculate the similarity.
[0063] In step 705, the recalled keywords with similarity greater than a predetermined threshold are extracted as candidate keywords. Similarly, the similarity here can be cosine distance or other distance similarity.
[0064] In step 706, the candidate keywords are sorted by using the word frequency-inverse document frequency as the weight, and the sorted keywords are output. Here, tf-idf(w)=tf(w)*idf(w). Where tf(w) is the word frequency, which is the frequency of a word appearing in the coarse-screened corpus T1, and idf(w) is the inverse document frequency, which is pre-calculated in the full corpus, and
[0065]
[0066] In some embodiments, the keyword acquisition method performs the following steps on the recalled keywords: selecting the top K keywords in the sorted keywords; further screening the top K keywords to obtain the screened keywords; and adding the screened keywords to the positive keyword library. Here, further screening can be labeling by experts. In one embodiment, K can be, for example, the top 100 outputs sorted by TF-IDF. The K outputs can be presented on an interface and corresponding labels can be provided for experts to label. The label can be, for example: a label "Y" that identifies the candidate keyword as a positive keyword, and a label "N" that identifies the candidate keyword as not a positive keyword. The above steps thus complete a round of labeling.
[0067] In some embodiments, the method performs the above steps: obtaining the average word vector of the recalled keywords and the average word vector of the positive keyword library; calculating the similarity between the average word vector of the recalled keywords and the average word vector of the positive keyword; extracting the recalled keywords with a similarity greater than a predetermined threshold as candidate keywords; sorting the candidate keywords with a predetermined frequency as a weight, and outputting the sorted keywords; selecting the top K keywords in the sorted keywords, where K is a positive integer; further screening the top K keywords to obtain the screened keywords; adding the screened keywords to the positive keyword library for M iterations, where M is a pre-set number of iterations and M is a positive integer. When the number of iterations reaches a predetermined number, the iteration is stopped. In addition, the iteration can also be stopped manually.
[0068] The keyword acquisition method uses the node2vec model to sample the graph model composed of three levels: phrase-word-character; the word2vec model is used to train the word vector of the node sampling sequence. The precision and recall rate of association mining are greatly improved compared with related technologies. It can mine high-quality keyword groups from the corpus. The proportion of keyword groups mined is higher than that of traditional methods, and the downstream errors caused by manually defined rules for keyword reorganization are reduced. Based on the high-performance graph computing platform and distributed computing platform, it realizes the association and mining of keywords at the billion level, and the processing speed is in the order of minutes.
[0069] Figure 8An example of a device 800 for acquiring keywords according to an embodiment of the present application is schematically shown. The device 800 includes an acquisition module 801, a screening module 802, and a keyword association module 803. The acquisition module 801 is configured to acquire seed keywords. The screening module 802 is configured to perform regular screening on keywords in the full corpus based on the seed keywords to obtain recalled keywords. The keyword association module 803 is configured to perform the following steps on the recalled keywords: obtain the average word vector of the recalled keywords and the average word vector of the positive keyword library; calculate the similarity between the average word vector of the recalled keywords and the average word vector of the positive keyword; extract the recalled keywords whose similarity is greater than a predetermined threshold as candidate keywords; sort the candidate keywords using word frequency-inverse document frequency as weights, and output the sorted keywords.
[0070] In some embodiments, the keyword association module 803 is configured to perform the following steps: select the top K keywords in the sorted keywords; further screen the top K keywords to obtain the screened keywords; and add the screened keywords to the positive keyword library. The above steps: obtain the average word vector of the recalled keywords and the average word vector of the positive keyword library; calculate the similarity between the average word vector of the recalled keywords and the average word vector of the positive keyword; extract the recalled keywords with a similarity greater than a predetermined threshold as candidate keywords; sort the candidate keywords with a predetermined frequency as a weight, and output the sorted keywords; select the top K keywords in the sorted keywords, K is a positive integer; further screen the top K keywords to obtain the screened keywords; add the screened keywords to the positive keyword library for M iterations, M is a pre-set number of iterations and M is a positive integer.
[0071] The device uses the node2vec model to sample the graph model composed of three levels: phrase-word-character; the word2vec model is used to train the word vector of the sampling sequence of the node. The precision and recall rate of associative mining are greatly improved compared with related technologies. It can mine high-quality keyword groups from the corpus. The proportion of keyword groups mined is higher than that of traditional methods, and the downstream errors caused by manually defined rules for keyword reorganization are reduced. Based on the high-performance graph computing platform and distributed computing platform, it realizes the association and mining of keywords at the billion level, and the processing speed is in the order of minutes.
[0072] Another aspect of the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computing device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computing device executes the keyword acquisition method described in the above embodiments.
[0073] Fig. 9 An example system 900 is illustrated, which includes an example computing device 910 that represents one or more systems and / or devices that can implement the technical solutions described in various embodiments of this document. The computing device 910 can be, for example, a server of a service provider, a device associated with a server, a system on a chip, and / or any other suitable computing device or computing system. Figure 8 The described apparatus 800 for keyword acquisition may take the form of a computing device 910. Alternatively, the apparatus 800 for keyword acquisition may be implemented as a computer program in the form of an application 916.
[0074] The example computing device 910 as shown in FIG9 includes a processing system 911, one or more computer-readable media 912, and one or more I / O interfaces 913 that are communicatively coupled to each other. Although not shown, the computing device 910 may also include a system bus or other data and command transmission system that couples the various components to each other. The system bus may include any one or combination of different bus structures, such as a memory bus or memory controller, a peripheral bus, a universal serial bus, and / or a processor or local bus utilizing any of a variety of bus architectures. Various other examples are also contemplated, such as control and data lines.
[0075] Processing system 911 represents the functionality of performing one or more operations using hardware. Thus, processing system 911 is illustrated as including hardware elements 914 that may be configured as processors, functional blocks, and the like. This may include other logic devices implemented in hardware as application specific integrated circuits or formed using one or more semiconductors. Hardware elements 914 are not limited by the materials from which they are formed or the processing mechanisms employed therein. For example, a processor may be composed of (multiple) semiconductors and / or transistors (e.g., electronic integrated circuits (ICs)). In such a context, processor executable instructions may be electronic executable instructions.
[0076] Computer-readable media 912 is illustrated as including memory / storage 915. Memory / storage 915 represents memory / storage capacity associated with one or more computer-readable media. Memory / storage 915 may include volatile media (such as random access memory (RAM)) and / or non-volatile media (such as read-only memory (ROM), flash memory, optical disks, magnetic disks, etc.). Memory / storage 915 may include fixed media (e.g., RAM, ROM, fixed hard drives, etc.) and removable media (e.g., flash memory, removable hard drives, optical disks, etc.). Computer-readable media 912 may be configured in various other ways as further described below.
[0077] One or more I / O interfaces 913 represent functionality that allows a user to input commands and information to the computing device 910 using various input devices and optionally also allows information to be presented to the user and / or other components or devices using various output devices. Examples of input devices include a keyboard, a cursor control device (e.g., a mouse), a microphone (e.g., for voice input), a scanner, touch functionality (e.g., a capacitive or other sensor configured to detect physical touch), a camera (e.g., that can detect motion that does not involve touch as gestures using visible or invisible wavelengths (such as infrared frequencies)), and the like. Examples of output devices include a display device (e.g., a projector), a speaker, a printer, a network card, a tactile response device, and the like. Thus, the computing device 910 can be configured in various ways as further described below to support user interaction.
[0078] The computing device 910 also includes an application 916. The application 916 may be, for example, a reference Figure 8 The described keyword acquisition apparatus 800 is a software instance and implements the techniques described herein in combination with other elements in the computing device 910 .
[0079] Various techniques may be described herein in the general context of software hardware elements or program modules. Generally, these modules include routines, programs, objects, elements, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The terms "module", "function" and "component" as used herein generally represent software, firmware, hardware or a combination thereof. The features of the techniques described herein are platform-independent, meaning that these techniques can be implemented on a variety of computing platforms with a variety of processors.
[0080] An implementation of the described modules and techniques may be stored on or transmitted across some form of computer-readable media. Computer-readable media may include various media accessible by computing device 910. By way of example and not limitation, computer-readable media may include “computer-readable storage media” and “computer-readable signal media”.
[0081] In contrast to a simple signal transmission, carrier wave, or signal itself, "computer-readable storage medium" refers to a medium and / or device capable of persistently storing information, and / or a tangible storage device. Therefore, a computer-readable storage medium refers to a non-signal-bearing medium. Computer-readable storage media include hardware such as volatile and non-volatile, removable and non-removable media and / or storage devices implemented in a method or technology suitable for storing information (such as computer-readable instructions, data structures, program modules, logic elements / circuits, or other data). Examples of computer-readable storage media may include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical storage device, hard disk, cassette, magnetic tape, magnetic disk storage device or other magnetic storage device, or other storage device, tangible medium, or article of manufacture suitable for storing desired information and accessible by a computer.
[0082] "Computer-readable signal media" refers to signal-bearing media that is configured to send instructions to the hardware of the computing device 910, such as via a network. Signal media typically can embody computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave, data signal, or other transport mechanism. Signal media also include any information transfer media. The term "modulated data signal" refers to a signal that has one or more of its characteristics set or changed so as to encode information into the signal. By way of example and not limitation, communication media include wired media such as a wired network or direct connection and wireless media such as acoustic, RF, infrared, and other wireless media.
[0083] As previously described, hardware elements 914 and computer-readable media 912 represent instructions, modules, programmable device logic, and / or fixed device logic implemented in hardware form, which in some embodiments can be used to implement at least some aspects of the technology described herein. Hardware elements can include integrated circuits or systems on a chip, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), complex programmable logic devices (CPLDs), and other implementations in silicon or components of other hardware devices. In this context, hardware elements can be used as processing devices for executing program tasks defined by instructions, modules, and / or logic embodied by hardware elements, as well as hardware devices for storing instructions for execution, such as the computer-readable storage media described previously.
[0084] The aforementioned combination may also be used to implement the various techniques and modules described herein. Therefore, software, hardware or program modules and other program modules may be implemented as one or more instructions and / or logic embodied on some form of computer-readable storage medium and / or by one or more hardware elements 914. The computing device 910 may be configured to implement specific instructions and / or functions corresponding to the software and / or hardware modules. Therefore, for example, by using a computer-readable storage medium and / or hardware element 914 of a processing system, the module may be implemented as a module executable by the computing device 910 as software, at least in part, in hardware. Instructions and / or functions may be executable / operable by one or more articles (e.g., one or more computing devices 910 and / or processing systems 911) to implement the techniques, modules and examples described herein.
[0085] In various embodiments, computing device 910 can adopt various different configurations. For example, computing device 910 can be implemented as a computer-type device including a personal computer, a desktop computer, a multi-screen computer, a laptop computer, a netbook, etc. Computing device 910 can also be implemented as a mobile device-type device including mobile devices such as mobile phones, portable music players, portable game devices, tablet computers, multi-screen computers, etc. Computing device 910 can also be implemented as a television-type device, which includes a device with or connected to a generally larger screen in a casual viewing environment. These devices include televisions, set-top boxes, game consoles, etc.
[0086] The techniques described herein may be supported by these various configurations of computing device 910 and are not limited to the specific examples of the techniques described herein. Functionality may also be implemented in whole or in part on the "cloud" 920 by using a distributed system, such as through a platform 922 as described below.
[0087] Cloud 920 includes and / or represents a platform 922 for resources 924. Platform 922 abstracts the underlying functionality of the hardware (e.g., servers) and software resources of cloud 920. Resources 924 may include other applications and / or data that may be used when performing computer processing on a server remote from computing device 910. Resources 924 may also include services provided over the Internet and / or over a subscriber network such as a cellular or Wi-Fi network.
[0088] The platform 922 may abstract resources and functionality to connect the computing device 910 with other computing devices. The platform 922 may also be used to abstract hierarchies of resources to provide hierarchies of corresponding levels of demand encountered for resources 924 implemented via the platform 922. Thus, in an interconnected device embodiment, the implementation of the functionality described herein may be distributed throughout the system 900. For example, functionality may be implemented in part on the computing device 910 and through the platform 922 that abstracts the functionality of the cloud 920.
[0089] It should be understood that, for the sake of clarity, embodiments of the present disclosure are described with reference to different functional units. However, it will be apparent that, without departing from the present disclosure, the functionality of each functional unit can be implemented in a single unit, in multiple units, or as a part of other functional units. For example, the functionality that is described as being performed by a single unit can be performed by multiple different units. Therefore, reference to a specific functional unit is only considered as a reference to a suitable unit for providing the described functionality, rather than indicating a strict logical or physical structure or organization. Therefore, the present disclosure can be implemented in a single unit, or can be physically and functionally distributed between different units and circuits.
[0090] It will be understood that although the first, second, third, etc. terms may be used to describe various devices, elements, parts or portions in this article, these devices, elements, parts or portions should not be limited by these terms. These terms are only used to distinguish one device, element, part or portion from another device, element, part or portion.
[0091] Although the present disclosure has been described in conjunction with some embodiments, it is not intended to be limited to the specific forms set forth herein. On the contrary, the scope of the present disclosure is limited only by the appended claims. Additionally, although individual features may be included in different claims, these may possibly be advantageously combined, and inclusion in different claims does not imply that the combination of features is not feasible and / or advantageous. The order of features in the claims does not imply any specific order in which the features must work. Furthermore, in the claims, the word "comprising" does not exclude other elements, and the term "one" or "an" does not exclude a plurality. The figure marks in the claims are provided only as clear examples and should not be interpreted as limiting the scope of the claims in any way.
Claims
1. A keyword acquisition method, comprising: Get seed keywords; Based on the seed keywords, regular screening is performed on the keywords in the full corpus to obtain recalled keywords; Searching for a word vector corresponding to the recall keyword and a word vector corresponding to the positive keyword in a pre-trained word vector library based on the recall keyword and the positive keyword in the positive keyword library respectively; Calculating an average word vector of the recalled keyword and an average word vector of the positive example keyword based on the word vector corresponding to the recalled keyword and the word vector corresponding to the positive example keyword respectively; Calculate the similarity between the average word vector of the recalled keywords and the average word vector of the positive example keywords; Extracting the recalled keywords whose similarity is greater than a predetermined threshold as candidate keywords; sorting the candidate keywords by using a predetermined frequency as a weight, and outputting the sorted keywords, The pre-trained word vector library is trained based on the following steps: selecting a full corpus based on a predetermined condition; performing word segmentation on the text in the full corpus to obtain texts at different levels; A word graph is constructed using texts at different levels as nodes; a node2vec algorithm is used to perform node sampling to generate a node sequence; and a word2vec algorithm is used to train the node sequence to obtain word vectors corresponding to phrases, words, and characters.
2. The method of claim 1, further comprising: Select the top K keywords among the sorted keywords, where K is a positive integer; Further screening the top K keywords in the ranking to obtain screened keywords; The screened keywords are added to the positive keyword library.
3. The method of claim 2, further comprising: Iterate the following steps M times, where M is a pre-set number of iterations and M is a positive integer: Obtaining an average word vector of the recalled keywords and an average word vector of the positive keyword library; Calculate the similarity between the average word vector of the recalled keywords and the average word vector of the positive example keywords; Extracting the recalled keywords whose similarity is greater than a predetermined threshold as candidate keywords; sorting the candidate keywords using a predetermined frequency as a weight, and outputting the sorted keywords; Select the top K keywords among the sorted keywords, where K is a positive integer; Further screening the top K keywords in the ranking to obtain screened keywords; The screened keywords are added to the positive keyword library.
4. The method according to claim 1, wherein the selecting the full corpus based on a predetermined condition comprises: Select the full corpus based on product scope or enterprise scope.
5. The method according to claim 1, wherein the step of segmenting the text in the entire corpus to obtain text at different levels comprises: The text in the entire corpus is segmented to obtain text at the phrase, word and character levels.
6. The method as claimed in claim 5, wherein the step of constructing a word graph using texts at different levels as nodes comprises: Taking the texts at the phrase, word and character levels as nodes, each phrase within a window of a predetermined size, the texts at the phrase and word levels, and the texts at the phrase and word levels are connected respectively as phrase-phrase edges, phrase-word edges and word-character edges of the word graph.
7. The method as claimed in claim 6, wherein the phrase-phrase edges, phrase-word edges and word-character edges of the word graph have different weights respectively.
8. The method according to any one of claims 1 to 3, wherein the predetermined frequency is tf(w)**idf(w), tf(w) is term frequency, which is the frequency of a term in the recalled keywords, and idf(w) is inverse document frequency, which is pre-calculated in the full corpus based on the following expression: idf(w) = log(total number of documents in the full corpus / number of documents containing the term + 1).
9. A keyword acquisition device, comprising: An acquisition module, configured to acquire seed keywords; A screening module is configured to perform regular screening on the keywords in the full corpus based on the seed keywords to obtain recalled keywords, and The keyword association module is configured to perform the following steps on the recalled keywords: Searching for a word vector corresponding to the recall keyword and a word vector corresponding to the positive keyword in a pre-trained word vector library based on the recall keyword and the positive keyword in the positive keyword library respectively; Calculating an average word vector of the recalled keyword and an average word vector of the positive example keyword based on the word vector corresponding to the recalled keyword and the word vector corresponding to the positive example keyword respectively; Calculate the similarity between the average word vector of the recalled keywords and the average word vector of the positive example keywords; Extracting the recalled keywords whose similarity is greater than a predetermined threshold as candidate keywords; sorting the candidate keywords by using a predetermined frequency as a weight, and outputting the sorted keywords, The pre-trained word vector library is trained based on the following steps: selecting a full corpus based on a predetermined condition; performing word segmentation on the text in the full corpus to obtain texts at different levels; A word graph is constructed using texts at different levels as nodes; a node2vec algorithm is used to perform node sampling to generate a node sequence; and a word2vec algorithm is used to train the node sequence to obtain word vectors corresponding to phrases, words, and characters.
10. A computing device comprising a memory configured to store computer-executable instructions; A processor, which is configured to perform the method according to any one of claims 1 to 8 when the computer executable instructions are executed by the processor.
11. A computer-readable storage medium storing computer-executable instructions, wherein when the computer-executable instructions are executed, the method according to any one of claims 1 to 8 is executed.
