Keyword extraction method, device, equipment and storage medium

By combining the first factor of word frequency and semantic similarity and the second factor of importance, keywords are selected, which solves the problem that the TFIDF-based keyword extraction method in the existing technology is difficult to use semantic information, and achieves more accurate key words. Word extraction and document understanding.

CN114330335BActive Publication Date: 2024-09-10CHINA MOBILE COMM LTD RES INST +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202011079979.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-10
Publication Date
2024-09-10
Estimated Expiration
2040-10-10

AI Technical Summary

Technical Problem

Existing keyword extraction methods are based on TFIDF and only consider the statistical information of words, making it difficult to effectively utilize the semantic information of the document, making it difficult to obtain a keyword set that represents the document.

Method used

By preprocessing the target document to be extracted, the first factor and the second factor of the word are obtained, and the word with the largest second factor is selected as the keyword. The first factor represents the word frequency and semantic similarity of the word, and the second factor represents the word. The importance of the collection.

Benefits of technology

It achieves more accurate acquisition of keyword sets representing target documents, improving the understanding of document content and the efficiency of subsequent applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114330335B
    Figure CN114330335B
Patent Text Reader

Abstract

The present invention discloses a keyword extraction method, device, equipment and storage medium. The method comprises: preprocessing a target document to be used for keyword extraction to obtain a word set of the target document; obtaining the first factor of each word in the word set; based on the first factor of each word, selecting a set number of words with the largest second factor in the target document to form a keyword set of the target document; wherein the first factor represents the importance of the corresponding word determined based on the word frequency and the semantic similarity between the word and the target document, and the second factor represents the importance of the set composed of the corresponding set number of words. Since the first factor and the second factor are comprehensively considered, the keyword set representing the target document can be obtained more accurately, which is conducive to quickly understanding the content of the target document and subsequent applications based on the content of the target document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of text processing, and in particular to a keyword extraction method, device, equipment and storage medium. Background Art

[0002] With the advent of the era of big data, the number of electronic documents is increasing, and there is an urgent need for machines to automatically identify the keywords that best represent the documents. Keyword extraction of documents is an effective means of highly condensing document information. By selecting multiple words in the document to accurately summarize the topic of the document, it helps users quickly understand the document information. Document keywords have been widely used in text search, web page recommendation and data mining.

[0003] Existing keyword extraction methods often perform keyword extraction based on TFIDF (Term Frequency Inverse Document Frequency), which only considers the statistical information of words and has a low degree of utilization of the semantic information of documents, making it difficult to obtain a keyword set that effectively represents the document. Summary of the invention

[0004] In view of this, embodiments of the present invention provide a keyword extraction method, apparatus, device and storage medium, aiming to obtain a keyword set that effectively represents a document.

[0005] The technical solution of the embodiment of the present invention is achieved as follows:

[0006] An embodiment of the present invention provides a keyword extraction method, comprising:

[0007] Preprocessing the target document for extracting keywords to obtain a word set of the target document;

[0008] Finding the first factor of each word in the word set;

[0009] Based on the first factor of each word, select a set number of words with the largest second factor in the target document to form a keyword set of the target document;

[0010] The first factor represents the importance of the corresponding word based on the word frequency and the semantic similarity between the word and the target document, and the second factor represents the importance of the set of the corresponding set of words.

[0011] The embodiment of the present invention further provides a keyword extraction device, comprising:

[0012] A preprocessing module, used for preprocessing the target document for extracting keywords to obtain a word set of the target document;

[0013] A first operation module, used for obtaining the first factor of each word in the word set;

[0014] A second operation module, configured to select a set number of words with the largest second factors in the target document based on the first factors of each word, to form a keyword set of the target document;

[0015] The first factor represents the importance of the corresponding word based on the word frequency and the semantic similarity between the word and the target document, and the second factor represents the importance of the set of the corresponding set of words.

[0016] An embodiment of the present invention further provides a keyword extraction device, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein the processor is used to execute the steps of the method described in the embodiment of the present invention when running the computer program.

[0017] An embodiment of the present invention further provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the embodiment of the present invention are implemented.

[0018] The technical solution provided by the embodiment of the present invention obtains the first factor of each word in the word set of the target document to extract keywords; based on the first factor of each word, selects a set number of words with the largest second factor in the target document to form a keyword set for the target document; wherein the first factor represents the importance of the corresponding word based on the word frequency and the semantic similarity between the word and the target document, and the second factor represents the importance of the set composed of the corresponding set number of words. Since the first factor and the second factor are comprehensively considered, the keyword set representing the target document can be obtained more accurately, which is conducive to quickly understanding the content of the target document and subsequent applications based on the content of the target document. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 Schematic diagram of the flow of a keyword extraction method according to an embodiment of the present invention;

[0020] Figure 2 This is a flow chart of a text keyword extraction method based on doc2vec, an application example of the present invention;

[0021] Figure 3 A schematic diagram of the principle of selecting the largest set of global key factors for an application example of the present invention;

[0022] Figure 4 It is a structural schematic diagram of a keyword extraction device according to an embodiment of the present invention;

[0023] Figure 5 It is a structural schematic diagram of a keyword extraction device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The present invention will be described in further detail below in conjunction with the accompanying drawings and embodiments.

[0025] 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.

[0026] In related technologies, keyword extraction of documents mainly includes the following methods:

[0027] 1) Keyword extraction based on TFIDF

[0028] The TFIDF method counts the term frequency (TF) and inverse document frequency (IDF) of each word in the document, calculates the weight of each word in the document based on these two statistical information, and then selects multiple words with the largest weight as the keywords of the document. The TFIDF method only considers the statistical information of the word and has a low degree of utilization of the semantic information of the document.

[0029] 2) Keyword extraction based on topic model

[0030] The idea of ​​extracting keywords based on topic models is that a document is composed of multiple topics, and the words in the document are selected from the topics with a certain probability, that is, there is a topic set between the document and the words. Under different topics, the probability distribution of word appearance is different. Each word and each document can be represented as a point in the space composed of multiple topic distributions. By calculating the similarity between each word and the document, the similarity result between each document and each word in the document can be obtained, and the words with the highest similarity are taken as the keywords of the document. Related topic model methods include LSA (Latent Semantic Analysis, latent semantic analysis model) and LDA (Latent Dirichlet Allocation, text topic generation model).

[0031] Keywords extracted based on topic models are relatively broad and cannot reflect the document theme well. In addition, topic models have high time complexity and require a lot of time to train, which affects the efficiency of keyword extraction.

[0032] 3) Keyword extraction based on word vector clustering

[0033] The main idea of ​​the document keyword extraction method based on word vector clustering is: first, each word in the document is represented by a word vector, where the word vector model can be trained using algorithms such as word2vec (word vectorization) and GloVe; then, the words in the document are clustered using the K-Means (K-means) clustering algorithm, and multiple words closest to the cluster center are selected as document keywords.

[0034] Although the word vector clustering method takes into account the distribution information of words in the document, it ignores the relationship between keywords and document semantics. For example, it is very likely that several keywords closest to the cluster center are not related to the document semantics, resulting in errors in extracting key information.

[0035] Based on this, in various embodiments of the present invention, the first factor of each word in the word set of the target document to extract keywords is obtained; based on the first factor of each word, a set number of words with the largest second factor in the target document are selected to form a keyword set for the target document; wherein the first factor represents the importance of the corresponding word based on the word frequency and the semantic similarity between the word and the target document, and the second factor represents the importance of the set consisting of the corresponding set number of words. Since the first factor and the second factor are comprehensively considered, the keyword set representing the target document can be obtained more accurately, which is conducive to quickly understanding the content of the target document and subsequent applications based on the content of the target document.

[0036] like Figure 1 As shown, an embodiment of the present invention provides a keyword extraction method, which is applied to a keyword extraction device, which can be a server or terminal device with information processing capabilities, and can extract keywords from local documents or documents obtained through the Internet. The method includes:

[0037] Step 101, preprocessing the target document to be extracted with keywords to obtain a word set of the target document;

[0038] Step 102, obtaining the first factor of each word in the word set;

[0039] Step 103 : Based on the first factor of each word, a set number of words with the largest second factor in the target document are selected to form a keyword set of the target document.

[0040] Here, the first factor represents the importance of the corresponding word based on the word frequency and the semantic similarity between the word and the target document, and the second factor represents the importance of the set of the corresponding set of words.

[0041] Exemplarily, in step 101, the target document for which keywords are to be extracted is preprocessed to obtain a set of words of the target document, including:

[0042] The target document for which keywords are to be extracted is subjected to word segmentation and stop word removal processing to obtain a set of words of the target document.

[0043] Here, the target document can be segmented based on a word segmentation algorithm, for example, segmented based on a dictionary-based method, a statistics-based method, a rule-based method, etc. Stop words are words that appear frequently but are of no help for searching and need to be filtered out, for example, words such as "de", "shi", "zai", etc. Stop word removal processing is to remove the stop words in the target document. Specific word segmentation and stop word removal processing can refer to related technologies and will not be elaborated here.

[0044] Exemplarily, in step 102, obtaining the first factor of each word in the set of words includes:

[0045] Determine the TFIDF (term frequency-inverse document frequency) weight value of each word in the set of words;

[0046] Obtain the text vector of the target document and the word vectors of each word in the set of words;

[0047] Based on the text vector of the target document and the word vectors of each word in the set of words, obtain the distance value of each word in the set of words, where the distance value is the cosine distance between the word vector and the text vector;

[0048] Based on the TFIDF weight value and the distance value of each word, determine the first factor of each word.

[0049] Here, determining the TFIDF weight value of each word in the set of words may include:

[0050] Obtain the term frequency and inverse document frequency of each word in the set of words, and obtain the TFIDF weight value based on the product of the term frequency and inverse document frequency of each word.

[0051] Exemplarily, obtaining the text vector of the target document and the word vectors of each word in the set of words includes:

[0052] Train a vector model based on a corpus and a text vectorization algorithm;

[0053] Based on the vector model, obtain the text vector of the target document and the word vectors of each word in the set of words.

[0054] For example, the preprocessed corpus can be used to train a vector model based on the doc2vec (text vectorization) algorithm. The trained vector model contains both the word vector representation of each word in the corpus and the word vector representation of each word in the corpus. It also contains the text vector representation of each document in the corpus

[0055] It is understandable that the doc2vec algorithm is an upgrade of the word2vec (word vectorization) algorithm. Exemplarily, the word vector representation model trained by the word2vec algorithm takes a window of appropriate size (generally 5 words) as input to train the neural network model, maps each word into an n-dimensional vector of fixed length, puts all vectors together to form a word vector space, and each vector is a point in the space, so the similarity between them can be judged according to the distance between the words. This word-dimensional word vector representation model has certain semantic characteristics, and the meaning of the word can be inferred based on the context or meaning of the adjacent words. Although the vector model trained by the doc2vec algorithm also uses the neural network model, its input is not just a few words in the neighborhood window, but also adds the global information of the corpus text, and trains the neural network model with the global context and the neighborhood words, which is equivalent to using the semantics of the entire sentence every time the probability of a word is predicted. The doc2vec vector model can map each article or a text into a text vector, and can also use the semantics of the entire sentence to map a word into a word vector. The vector model of doc2vec can have stronger semantic characteristics and contextual "semantic analysis" capabilities.

[0056] In the embodiment of the present invention, based on the text vector of the target document and the word vector of each word in the word set, the distance value of each word in the word set is obtained, and the distance value can represent the semantic similarity between the word and the text.

[0057] Exemplarily, the first factor of each word is the product of the TFIDF weight value of each word and the distance value. In this way, the first factor comprehensively considers the word frequency statistics in the target document and the semantic similarity between the word and the text, and can more accurately reflect the importance of the word in the target document.

[0058] Exemplarily, in step 103, based on the first factor of each word, a set number of words with the largest second factor in the target document are selected to form a keyword set of the target document, including:

[0059] sorting each word in the word set based on the first factor;

[0060] Based on the first factor, a set number of words are selected in descending order to form an initial keyword set;

[0061] Traversing the other words in the word set except the keyword set;

[0062] Obtain a comparison result of the second factors before and after the currently traversed word replaces each word in the keyword set; if the second factor after replacement is greater than the second factor before replacement, update the keyword set; until the traversal is completed, obtain the keyword set with the largest second factor as the keyword set of the target document.

[0063] It can be understood that after selecting a set number of words based on the first factor in descending order to form the initial keyword set, it is necessary to obtain the second factor of the keyword set and traverse other words in the word set of the target document, for example, based on the first factor in descending order, traverse other words in sequence, and replace the words in the keyword set with each currently traversed word in turn, compare the second factors of the sets before and after replacement, if the second factor after replacement is greater than the second factor before replacement, then the set after replacement is used as the current keyword set, otherwise, the current keyword set is not updated. In this way, the keyword set with the largest second factor can be obtained, and this keyword set is the final keyword set of the target document.

[0064] Exemplarily, obtaining the second factor includes:

[0065] Calculating the arithmetic square root of the mean square distance between each word in the set number of words as the difference factor of the set number of words;

[0066] The second factors of the set number of words are determined based on the sum of the first factors of each word in the set number of words and the product of the difference factor.

[0067] It is understandable that the set number can be reasonably set based on demand. For example, the set number can be any value between 4 and 20.

[0068] In this way, the final keyword set obtained comprehensively considers the statistical information of the keywords, the semantic similarity between the keywords and the text, and the degree of difference between the keywords. Specifically, the statistical importance of the keywords in the document is represented by the TFIDF weight value; the text vector and the word vector are trained simultaneously based on the doc2vec algorithm, and the cosine distance between the word vector and the text vector is used as the semantic similarity between the text and the keyword; the degree of difference between the keywords is measured by the arithmetic square root of the mean square distance between the keywords. By combining the above three types of information, the method of the embodiment of the present invention can more accurately obtain a keyword set that reflects the semantics of the text, and at the same time, there is a good difference between the keywords.

[0069] In some embodiments, the keyword extraction method further includes at least one of the following:

[0070] Matching the search request information based on the keyword set of the target document;

[0071] Pushing the target document based on a keyword set of the target document;

[0072] The target documents are clustered based on the keyword sets of the target documents.

[0073] Here, after the keyword extraction device determines the keyword set of the target document, the search request information can be matched based on the keyword set. For example, after the keyword extraction device obtains the search request information input by the user, the search request information can be matched based on the keyword set. If a match is found, the target document is returned to the user. In this way, the search request information can be matched based on the content of the target document, thereby reducing the search results of irrelevant information and making the search match higher.

[0074] Exemplarily, the keyword extraction device may also generate tags for each document based on the determined keyword set, and push documents and other content matching the tag information to the user in combination with the tag information subscribed by the user.

[0075] Exemplarily, the keyword extraction device can also obtain a more accurate feature representation of the digital content of each document based on the determined keyword set relative to the original description, and cluster each document, thereby further improving the classification and clustering accuracy of the digital content, so that the retrieved content set is more in line with the theme. It can be understood that the keyword extraction method of the embodiment of the present invention can be applied to multiple fields such as intelligent customer service, smart medical care, and information retrieval. For example, intelligent customer service uses artificial intelligence technology to accurately understand user needs and perform semantic recognition of customer natural language expressions. On this basis, it realizes intelligent matching of customer questions and answers, and responds to customer questions according to the characteristics of the service scenario. Among them, accurately parsing the information expressed by the user and identifying user needs are important indicators for measuring the performance of intelligent customer service. Based on the keyword extraction method of the embodiment of the present invention, the core keywords in the user information can be extracted, and the accuracy of text semantic retrieval can be effectively improved, so as to better understand the user's intention, accurately reply to the user, and improve satisfaction. For example, in the field of smart medical care, based on the keyword extraction method of the embodiment of the present invention, the keywords in the user's condition description information can be accurately extracted, the matching accuracy between patients and relevant hospital departments can be improved, and the quality of Internet medical information services can be improved. For example, in the field of information retrieval, based on the keyword extraction method of the present invention, keywords can be accurately extracted from digital content description information, and better matched with user search keywords, thereby improving the accuracy of data retrieval, and ultimately improving the user experience of related products, attracting more users to use related products.

[0076] The embodiments of the present invention are further described in detail below with reference to application examples.

[0077] like Figure 2 As shown, this application example provides a text keyword extraction method based on doc2vec, which comprehensively considers the semantic relevance between keywords and document topics, the importance of keywords, and the differences between keywords, so as to obtain a keyword set that accurately reflects document information. The keyword extraction method includes:

[0078] Step 201, preprocessing the target document;

[0079] Here, the target document is segmented, stop words are removed, and the document d is represented as a word set W.

[0080] Step 202, calculating the TFIDF weight value of each word in the word set of the target document;

[0081] Here, we calculate the value of each word c in document d. i ∈W,i∈[1,n], the TFIDF weight values ​​are as follows:

[0082]

[0083] Where n is the number of words in document d, v i The corpus contains word c i The number of documents, n i c i The number of occurrences in document d, N d is the sum of the occurrences of all words in document d, and m is the total number of documents in the corpus.

[0084] Step 203, training a vector model using a doc2vec algorithm;

[0085] Here, we can train a vector model based on the doc2vec (text vectorization) algorithm for the preprocessed corpus. The trained vector model contains both the word vector representation of each word in the corpus and the word vector representation of each word in the corpus. It also contains the text vector representation of each document in the corpus

[0086] Step 204, calculating the text vector of the target document and the word vector of each word;

[0087] The text vector of the target document and the word vector of each word in the word set are obtained based on the doc2vec vector model.

[0088] Step 205, calculating the cosine distance between the word vector and the text vector of each word in the target document;

[0089] Exemplarily, the cosine distance between the word vector and the text vector of each word is calculated as follows:

[0090]

[0091] Among them, sim(c,d) is the word vector of word c with the text vector of document d The cosine distance between .

[0092] Step 206, calculating the importance factor of each word;

[0093] Here, the importance factor is the first factor mentioned above, calculated as follows:

[0094] weight(c)=TFIDF(c)×sim(c,d)

[0095] Among them, weight(c) is the importance factor of word c, TFIDF(c) is the TFIDF weight value of word c, that is, the importance factor of a word is the product of the TFIDF weight value of the word and the cosine distance between the word vector and the text vector.

[0096] Step 207, sorting the words from high to low according to the importance factor;

[0097] Rearrange the words in document d from high to low according to the importance factor, and get

[0098] Step 208: Select the set with the largest global key factor as the keyword set of the target document.

[0099] Here, the global key factor is the second factor mentioned above. Assume that the set number is k, that is, the number of selected keywords is k. A set of k keywords with the largest global key factors is selected as the keyword set of the target document.

[0100] Exemplarily, the arithmetic square root of the mean square distance between keywords is used as a measure of the degree of difference of the keyword set, that is, the difference factor mentioned above. The global key factor of the keyword set is calculated by multiplying the sum of the importance factors of all words in a set number of keyword sets by the difference factor of the keyword set, and the formula is as follows:

[0101]

[0102]

[0103] Among them, Z represents For the selected k keywords, E(Z) is the difference factor of set Z, and g(Z) is the global key factor of set Z; It represents the number of combinations of two elements selected from a set number k.

[0104] Since k keywords are selected from document d, there are When the number of words in a document is large, a large amount of calculation will be generated. Figure 3 As shown in the figure, for each word in the document, the importance factor of the word is obtained, and the words are sorted from large to small based on the importance factor to ensure that the words with high importance are ranked first; Take the first k words to form the initial keyword set Z; continue from Take a word w in order and replace the words z in the set Z with w. i , and calculate the global key factor of the replaced set Z. If it is greater than the global key factor of Z before, W will replace z. i ; Traverse The set Z obtained later is the keyword set of text d.

[0105] In order to implement the method of the embodiment of the present invention, the embodiment of the present invention also provides a keyword extraction device, which corresponds to the above-mentioned keyword extraction method, and each step in the above-mentioned keyword extraction method embodiment is also completely applicable to the embodiment of the present keyword extraction device.

[0106] like Figure 4 As shown, the keyword extraction device includes: a preprocessing module 401, a first operation module 402 and a second operation module 403, wherein the preprocessing module 401 is used to preprocess the target document for extracting keywords to obtain the word set of the target document; the first operation module 402 is used to obtain the first factor of each word in the word set; the second operation module 403 is used to select a set number of words with the largest second factor in the target document based on the first factor of each word to form the keyword set of the target document; the first factor represents the importance of the corresponding word based on the word frequency and the semantic similarity between the word and the target document, and the second factor represents the importance of the set consisting of the corresponding set number of words.

[0107] In some embodiments, the first operation module 402 is specifically used to:

[0108] Determine the term frequency inverse document frequency (TFIDF) weight value of each term in the term set;

[0109] Obtaining a text vector of the target document and a word vector of each word in the word set;

[0110] Based on the text vector of the target document and the word vector of each word in the word set, obtaining a distance value of each word in the word set, wherein the distance value is a cosine distance between the word vector and the text vector;

[0111] Based on the TFIDF weight value and the distance value of each word, a first factor of each word is determined.

[0112] In some embodiments, the first operation module 402 obtains the text vector of the target document and the word vector of each word in the word set, including:

[0113] Train vector models based on corpus and text vectorization algorithms;

[0114] The text vector of the target document and the word vector of each word in the word set are obtained based on the vector model.

[0115] In some embodiments, the second operation module 403 is specifically used to:

[0116] sorting each word in the word set based on the first factor;

[0117] Based on the first factor, a set number of words are selected in descending order to form an initial keyword set;

[0118] Traversing the other words in the word set except the keyword set;

[0119] Obtain a comparison result of the second factors before and after the currently traversed word replaces each word in the keyword set; if the second factor after replacement is greater than the second factor before replacement, update the keyword set; until the traversal is completed, obtain the keyword set with the largest second factor as the keyword set of the target document.

[0120] In some embodiments, the second operation module 403 obtains the second factor, including:

[0121] Calculating the arithmetic square root of the mean square distance between each word in the set number of words as the difference factor of the set number of words;

[0122] The second factors of the set number of words are determined based on the sum of the first factors of each word in the set number of words and the product of the difference factor.

[0123] In some embodiments, the preprocessing module 401 is specifically used for:

[0124] The target document for extracting keywords is segmented and stop words are removed to obtain a word set of the target document.

[0125] In some embodiments, the keyword extraction device further includes: a processing module 404, which is specifically used for at least one of the following:

[0126] Matching the search request information based on the keyword set of the target document;

[0127] Pushing the target document based on a keyword set of the target document;

[0128] The target documents are clustered based on the keyword sets of the target documents.

[0129] In actual application, the preprocessing module 401, the first operation module 402, the second operation module 403 and the processing module 404 can be implemented by a processor in the keyword extraction device. Of course, the processor needs to run the computer program in the memory to implement its function.

[0130] It should be noted that: the keyword extraction device provided in the above embodiment only uses the division of the above program modules as an example when performing keyword extraction. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the keyword extraction device provided in the above embodiment and the keyword extraction method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0131] Based on the hardware implementation of the above program modules and in order to implement the method of the embodiment of the present invention, the embodiment of the present invention further provides a keyword extraction device. Figure 5 Only an exemplary structure of the keyword extraction device is shown, not the entire structure, and it can be implemented as needed. Figure 5 Partial or complete structure shown.

[0132] like Figure 5 As shown, the keyword extraction device 500 provided in the embodiment of the present invention includes: at least one processor 501, a memory 502, a user interface 503 and at least one network interface 504. The various components in the keyword extraction device 500 are coupled together through a bus system 505. It can be understood that the bus system 505 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 505 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, in Figure 5 Various buses are labeled as bus system 505 .

[0133] The user interface 503 may include a display, a keyboard, a mouse, a trackball, a click wheel, keys, buttons, a touch pad or a touch screen.

[0134] The memory 502 in the embodiment of the present invention is used to store various types of data to support the operation of the keyword extraction device. Examples of such data include: any computer program used to operate on the keyword extraction device.

[0135] The keyword extraction method disclosed in the embodiment of the present invention can be applied to the processor 501, or implemented by the processor 501. The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the keyword extraction method can be completed by the hardware integrated logic circuit in the processor 501 or the instructions in the form of software. The above-mentioned processor 501 can be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 501 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general-purpose processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, and the storage medium is located in the memory 502. The processor 501 reads the information in the memory 502 and completes the steps of the keyword extraction method provided in the embodiment of the present invention in combination with its hardware.

[0136] In an exemplary embodiment, the keyword extraction device can be implemented by one or more application-specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), FPGA, general-purpose processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.

[0137] It can be understood that the memory 502 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memories.

[0138] In an exemplary embodiment, the embodiment of the present invention further provides a storage medium, namely a computer storage medium, which can be a computer-readable storage medium, for example, a memory 502 storing a computer program, and the computer program can be executed by a processor 501 of the keyword extraction device to complete the steps described in the method of the embodiment of the present invention. The computer-readable storage medium can be a memory such as a ROM, a PROM, an EPROM, an EEPROM, a Flash Memory, a magnetic surface memory, an optical disk, or a CD-ROM.

[0139] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0140] In addition, the technical solutions described in the embodiments of the present invention can be arbitrarily combined without conflict.

[0141] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A keyword extraction method, characterized in that: include: Preprocessing the target document for extracting keywords to obtain a word set of the target document; Finding the first factor of each word in the word set; Based on the first factor of each word, a set number of words with the largest second factor in the target document are selected to form a keyword set of the target document; The first factor represents the importance of the corresponding word based on the word frequency and the semantic similarity between the word and the target document, and the second factor represents the importance of the set of the corresponding set of words.

2. The method according to claim 1, characterized in that The step of obtaining the first factor of each word in the word set includes: Determine the term frequency inverse document frequency (TFIDF) weight value of each term in the term set; Obtaining a text vector of the target document and a word vector of each word in the word set; Based on the text vector of the target document and the word vector of each word in the word set, obtaining a distance value of each word in the word set, wherein the distance value is a cosine distance between the word vector and the text vector; Based on the TFIDF weight value and the distance value of each word, a first factor of each word is determined.

3. The method according to claim 2, characterized in that The obtaining of the text vector of the target document and the word vector of each word in the word set includes: Train vector models based on corpus and text vectorization algorithms; The text vector of the target document and the word vector of each word in the word set are obtained based on the vector model.

4. The method according to claim 1, characterized in that: The step of selecting a set number of words with the largest second factor in the target document based on the first factor of each word to form a keyword set of the target document includes: sorting each word in the word set based on the first factor; Based on the first factor, a set number of words are selected in descending order to form an initial keyword set; Traversing the other words in the word set except the keyword set; Obtain a comparison result of the second factors before and after the currently traversed word replaces each word in the keyword set; if the second factor after replacement is greater than the second factor before replacement, update the keyword set; until the traversal is completed, obtain the keyword set with the largest second factor as the keyword set of the target document.

5. The method according to claim 4, characterized in that Obtaining the second factor includes: Calculating the arithmetic square root of the mean square distance between each word in the set number of words as the difference factor of the set number of words; The second factors of the set number of words are determined based on the sum of the first factors of each word in the set number of words and the product of the difference factor.

6. The method according to claim 1, characterized in that The target document for extracting keywords is preprocessed to obtain a word set of the target document, including: The target document for extracting keywords is segmented and stop words are removed to obtain a word set of the target document.

7. The method according to claim 1, characterized in that The method further comprises at least one of the following: Matching the search request information based on the keyword set of the target document; Pushing the target document based on a keyword set of the target document; The target documents are clustered based on the keyword sets of the target documents.

8. A keyword extraction device, characterized in that: include: A preprocessing module, used for preprocessing the target document for extracting keywords to obtain a word set of the target document; A first operation module, used for obtaining the first factor of each word in the word set; A second operation module, configured to select a set number of words with the largest second factors in the target document based on the first factors of each word, to form a keyword set of the target document; The first factor represents the importance of the corresponding word based on the word frequency and the semantic similarity between the word and the target document, and the second factor represents the importance of the set of the corresponding set of words.

9. A keyword extraction device, characterized in that: include: A processor and a memory for storing a computer program that can be executed on the processor, wherein: The processor is used to execute the steps of the method according to any one of claims 1 to 7 when running a computer program.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method and device for extracting keyword, storage medium and electronic device

    CN108334533A

  • A method and a device for extracting keywords from a document text

    CN109190111A

  • Method and device for automatically extracting Chinese text keyword

    CN110362678A

  • Semantic similarity analysis method based on text clustering

    CN110825877A

  • Electronic equipment device, method for calculating similarity between texts, and program

    JP2005122515A