Keyword extraction method, device, storage medium and equipment
By obtaining document attributes and using a keyword-attribute correlation dictionary to calculate the score of candidate keywords, the problem of accuracy and high cost of keyword extraction in the existing technology is solved, and more efficient and accurate keyword extraction is achieved.
Patent Information
- Application Number
- CN202011049625.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-29
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-09-29
AI Technical Summary
Existing keyword extraction methods have shortcomings in terms of accuracy and cost. In particular, unsupervised methods rely on corpus statistics and are not accurate enough, and supervised methods require a large amount of manually annotated data, resulting in high costs and low efficiency.
By obtaining document attributes to characterize the topic and semantic information of the target document, calculate the first score of the candidate keywords, and combine the pre-built keyword-attribute correlation dictionary and unsupervised methods to determine the target keywords, reducing the need for manual annotation The dependence on data improves the accuracy and efficiency of extraction results.
It improves the accuracy of keyword extraction and reduces costs, achieves more efficient and accurate keyword extraction results, and reduces the need for manual annotation of data.
Smart Images

Figure CN112257424B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a keyword extraction method, device, storage medium and equipment. Background Art
[0002] With the rapid development of mobile Internet, Internet of Things and artificial intelligence (AI) technology, a large amount of document information is generated every moment, resulting in a geometric growth in the amount of document information that needs to be processed. Therefore, in order to facilitate people to quickly and accurately obtain effective document information, keywords of the document are usually extracted as a summary of the main content of the document, which is used for web page indexing and information recommendation for users, so as to improve the accuracy of document recommendation results and document retrieval results in web pages.
[0003] At present, there are usually two methods for extracting keywords from documents: one is to extract keywords in an unsupervised way. For example, the term frequency-inverse document frequency (TF-IDF) can be used to score the pre-generated candidate keywords, and the keywords in the document can be extracted according to the scoring results. However, this extraction method requires statistics on a large-scale corpus, otherwise the statistical results of the inverse document frequency (IDF) are not accurate enough. And because this extraction method only considers the statistical properties of words, but does not consider the true understanding of the meaning of the words, the accuracy of the extracted keywords is not high enough and cannot accurately represent the key content of the document. Another commonly used keyword extraction method is to extract in a supervised manner. The core idea is to transform the keyword extraction process into a supervised machine learning problem. For example, keyword extraction can be transformed into a multi-label text classification problem. First, the bidirectional long short-term memory network (Bi-LSTM) is used to encode the document, and the attention mechanism is used to obtain the document's representation of each candidate keyword. Then, a multi-layer fully connected neural network is used to perform binary classification on the representation of each candidate keyword to obtain the confidence score of each candidate keyword. Then, the keywords in the document can be extracted based on the confidence score. However, this extraction method requires a large amount of high-quality keyword annotated corpus as training data for model training, otherwise it will be impossible to train a high-precision neural network model. However, in actual business, there is often a lack of keyword annotation data, and a large number of keywords need to be annotated manually, which is highly subjective and difficult to quantify. Not only is the annotation efficiency low, but it also requires a lot of human resources, resulting in a high cost of obtaining keyword annotated corpus. Summary of the invention
[0004] The embodiments of the present application provide a keyword extraction method, apparatus, storage medium and device, which help to overcome the shortcomings of existing keyword extraction methods, improve the accuracy of keyword extraction results, and reduce extraction costs.
[0005] In a first aspect, the present application provides a keyword extraction method, the method comprising: when performing keyword extraction, first obtaining the document attributes of the target document, wherein the document attributes are used to characterize the subject and semantic information of the target document, and the target document includes multiple candidate keywords; then, using the document attributes, calculating the first score of the candidate keywords, wherein the first score is used to characterize the correlation between the candidate keywords and the document attributes, and then the target keyword can be determined from the multiple candidate keywords based on the first scores of the candidate keywords.
[0006] Compared with traditional technologies, the embodiments of the present application take into account the document attributes that represent the subject and semantic information of the target document when extracting keywords from the target document, thereby improving the accuracy of the keyword extraction results. In addition, since there is no need to manually annotate keyword training data, the cost of keyword extraction is reduced, resulting in lower cost and more accurate extraction results.
[0007] In a possible implementation, the method further includes: calculating the second score of the candidate keyword using an unsupervised method; and determining the target keyword from the plurality of candidate keywords according to the first score, including: determining the target keyword from the plurality of candidate keywords according to the first score and the second score. In this way, the accuracy of the keyword extraction result can be further improved while fully considering the scores of the candidate keywords calculated using the unsupervised method.
[0008] In a possible implementation, using document attributes to calculate the first score of a candidate keyword includes: obtaining a correlation value between a document attribute and a candidate keyword from a pre-built keyword-attribute correlation dictionary, wherein the keyword-attribute correlation dictionary stores correlation values between keywords and document attributes; and calculating the first score of the candidate keyword according to the correlation value between the document attribute and the candidate keyword. In this way, the pre-built keyword-attribute correlation dictionary can be used to more quickly and accurately calculate the first score of the candidate keyword.
[0009] In a possible implementation, the method further includes: using a pre-built document library and a keyword dictionary to build a keyword-attribute relevance dictionary; wherein the document library stores multiple documents in multiple fields and document attributes corresponding to each document; and the keyword dictionary stores multiple keywords in multiple fields, so as to ensure the accuracy and completeness of the relevance values between document attributes and candidate keywords in the keyword-attribute relevance dictionary.
[0010] In a possible implementation, a keyword-attribute relevance dictionary is constructed using a pre-constructed document library and keyword dictionary, including: extracting document attributes of each document in the document library; calculating the relevance between each keyword in the keyword dictionary and each document attribute in the document library; and forming a keyword-attribute relevance dictionary from the relevance between each keyword and each document attribute, and between each keyword and each document attribute. Thus, a keyword-attribute relevance dictionary with higher accuracy and wider coverage can be constructed.
[0011] In a possible implementation, the method further includes: performing word segmentation processing on the target document to obtain multiple word segmentation terms, and selecting word segmentation terms that meet preset conditions from the multiple word segmentation terms as candidate keywords. In this way, the keywords contained in the target document can be determined more accurately and quickly.
[0012] In a possible implementation, the method further includes: performing denoising preprocessing on the target document to obtain the preprocessed target document; performing word segmentation processing on the target document to obtain multiple word segmentation terms, and selecting the word segmentation terms that meet the preset conditions from the multiple word segmentation terms as candidate keywords, including: performing word segmentation processing on the preprocessed target document to obtain multiple word segmentation terms, and selecting the word segmentation terms that meet the preset conditions from the multiple word segmentation terms as candidate keywords. Thereby, the accuracy of the target document data is further guaranteed.
[0013] In the second aspect, the present application also provides a keyword extraction device, which includes: an acquisition unit, used to acquire document attributes of a target document; wherein the document attributes are used to characterize the subject and semantic information of the target document; the target document includes multiple candidate keywords; a first calculation unit, used to calculate a first score of the candidate keywords using the document attributes; wherein the first score is used to characterize the correlation between the candidate keywords and the document attributes; a determination unit, used to determine the target keyword from multiple candidate keywords based on the first score.
[0014] In a possible implementation, the device further includes: a second calculation unit, configured to calculate a second score of the candidate keyword using an unsupervised method; and the determination unit is specifically configured to determine a target keyword from the plurality of candidate keywords according to the first score and the second score.
[0015] In one possible implementation, the first calculation unit is specifically used to: obtain the correlation value between the document attribute and the candidate keyword from a pre-built keyword-attribute correlation dictionary, wherein the keyword-attribute correlation dictionary stores the correlation value between the keyword and the document attribute; and calculate the first score of the candidate keyword based on the correlation value between the document attribute and the candidate keyword.
[0016] In one possible implementation, the device also includes: a construction unit, which is used to construct a keyword-attribute relevance dictionary using a pre-constructed document library and keyword dictionary; wherein the document library stores multiple documents in multiple fields and document attributes corresponding to each document; and the keyword dictionary stores multiple keywords in multiple fields.
[0017] In one possible implementation, the construction unit is specifically used to: extract document attributes of each document in the document library; calculate the correlation between each keyword in the keyword dictionary and each document attribute in the document library; and form a keyword-attribute correlation dictionary based on the correlation between each keyword and each document attribute, and between each keyword and each document attribute.
[0018] In a possible implementation, the device further includes: a selection unit, which is used to perform word segmentation processing on the target document to obtain a plurality of word segmentation terms, and select a word segmentation term that meets a preset condition from the plurality of word segmentation terms as a candidate keyword.
[0019] In one possible implementation, the device also includes: a preprocessing unit, which is used to perform denoising preprocessing on the target document to obtain a preprocessed target document; and the selection unit is specifically used to: perform word segmentation processing on the preprocessed target document to obtain multiple segmentation words, and select segmentation words that meet preset conditions from the multiple segmentation words as candidate keywords.
[0020] In a third aspect, the present application further provides a keyword extraction device, the keyword extraction device comprising: a memory, a processor;
[0021] A memory is used to store instructions; a processor is used to execute the instructions in the memory to execute the method in the above-mentioned first aspect and any possible implementation manner thereof.
[0022] In a fourth aspect, the present application further provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enables the computer to execute the method in the above-mentioned first aspect and any possible implementation thereof.
[0023] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0024] When performing keyword extraction, the embodiment of the present application first obtains the document attributes of the target document, wherein the document attributes are used to characterize the subject and semantic information of the target document, and the target document includes multiple candidate keywords; then, the first score of the candidate keyword is calculated using the document attributes, wherein the first score is used to characterize the correlation between the candidate keyword and the document attributes, and then the target keyword can be determined from the multiple candidate keywords based on the first score of each candidate keyword. It can be seen that, since the embodiment of the present application takes into account the document attributes that characterize the subject and semantic information of the target document when extracting the keywords of the target document, the accuracy of the keyword extraction results can be improved, and since there is no need to manually annotate the training data of the keywords, the cost of keyword extraction is also reduced, resulting in a lower cost and more accurate extraction result. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A schematic diagram of the structure of the artificial intelligence main framework provided in the embodiment of the present application;
[0026] Figure 2 A schematic diagram of an application scenario of an embodiment of the present application;
[0027] Figure 3 A flowchart of a keyword extraction method provided in an embodiment of the present application;
[0028] Figure 4 A structural block diagram of a keyword extraction device provided in an embodiment of the present application;
[0029] Figure 5 A schematic diagram of the structure of a keyword extraction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The embodiments of the present application provide a keyword extraction method, apparatus, storage medium and device, which improve the accuracy of keyword extraction results and reduce extraction costs.
[0031] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0032] First, the overall workflow of the artificial intelligence system is described. Figure 1 , Figure 1The figure shows a structural diagram of the main framework of artificial intelligence. The following is an explanation of the above artificial intelligence theme framework from the two dimensions of "intelligent information chain" (horizontal axis) and "IT value chain" (vertical axis). Among them, the "intelligent information chain" reflects a series of processes from data acquisition to processing. For example, it can be a general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, the data has undergone a condensation process of "data-information-knowledge-wisdom". The "IT value chain" reflects the value that artificial intelligence brings to the information technology industry from the underlying infrastructure of human intelligence, information (providing and processing technology implementation) to the industrial ecology process of the system.
[0033] (1) Infrastructure
[0034] The infrastructure provides computing power support for the AI system, enables communication with the outside world, and supports it through the basic platform. It communicates with the outside world through sensors; computing power is provided by smart chips (CPU, NPU, GPU, ASIC, FPGA and other hardware acceleration chips); the basic platform includes distributed computing frameworks and networks and other related platform guarantees and support, which can include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to obtain data, and these data are provided to the smart chips in the distributed computing system provided by the basic platform for calculation.
[0035] (2) Data
[0036] The data on the upper layer of the infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data of traditional devices, including business data of existing systems and perception data such as force, displacement, liquid level, temperature, and humidity.
[0037] (3) Data processing
[0038] Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making and other methods.
[0039] Among them, machine learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, and training.
[0040] Reasoning refers to the process of simulating human intelligent reasoning in computers or intelligent systems, using formalized information to perform machine thinking and solve problems based on reasoning control strategies. Typical functions are search and matching.
[0041] Decision-making refers to the process of making decisions after intelligent information is reasoned, usually providing functions such as classification, sorting, and prediction.
[0042] (4) General ability
[0043] After the data has undergone the data processing mentioned above, some general capabilities can be further formed based on the results of the data processing, such as an algorithm or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0044] (5) Smart products and industry applications
[0045] Smart products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of the overall artificial intelligence solution, which productizes intelligent information decision-making and realizes practical applications. Its application areas mainly include: smart terminals, smart transportation, smart medical care, autonomous driving, safe cities, etc.
[0046] This application can be applied to the field of natural language processing in the field of artificial intelligence. The application scenarios of the product will be introduced below.
[0047] The keyword extraction method provided in the embodiment of the present application can be applied to hardware scenarios including terminal devices and server devices. Figure 2 , Figure 2 Schematic diagram of application scenarios of the embodiments of the present application, such as Figure 2 As shown, the terminal device 201, as a data collection device, can obtain the document (here defined as the target document) that uses the embodiment of the present application to implement keyword extraction through various channels (such as manual input, web crawler, etc.), and input it to the server device 202, so that the AI system that implements the keyword extraction function in the server device 202 can extract the document attributes of the target document, wherein the document attribute refers to the nature of the target document from a certain aspect, such as the classification, author, source, etc. of the target document, which can characterize the entire document theme of the target document and the semantic information of the entire document. At the same time, the server device 202 can also perform data processing operations such as denoising and word segmentation on the target document to determine the candidate keywords contained in the target document, so that the document attributes of the target document can be used to calculate the first score of each candidate keyword, wherein the first score is used to characterize the correlation between the corresponding candidate keyword and the document attribute of the target document, and then according to the first score of each candidate keyword and the preset selection rule, a more accurate target keyword whose first score meets the preset rule can be determined from multiple candidate keywords as the keyword of the target document. Furthermore, after extracting the keywords of the target document, the server device 202 may also send the keyword extraction results to the terminal device 203 (or the terminal device 201) for subsequent processing such as web page indexing or information recommendation.
[0048] As an example, the terminal device 201 and the terminal device 203 can be the same terminal device or different terminal devices, and both can be mobile phones, tablets, laptops, smart wearable devices, etc. The terminal device 201 can obtain data information such as documents, dictionaries, and dictionaries through various channels, and send them to the server device 202 for subsequent processing. The server device 202 refers to a device that can communicate with the terminal device 201 and the terminal device 203, and provides data to the terminal device 201 for processing and sends the processing results to the terminal device 203. It should be understood that the embodiments of the present application can also be applied to other scenarios where document keyword extraction is required, and other application scenarios are not listed one by one here.
[0049] Based on the above application scenarios, the present application embodiment provides a keyword extraction method, which can be applied to the server device 202. Figure 3 As shown, the method includes:
[0050] S301: Obtain document attributes of a target document; wherein the document attributes are used to characterize the subject and semantic information of the target document; the target document includes a plurality of candidate keywords.
[0051] In this embodiment, any document that uses this embodiment to implement keyword extraction is defined as a target document. In addition, this embodiment does not limit the language type of the target document, for example, the target document can be a Chinese document, or an English document, etc.; this embodiment does not limit the length of the target document, for example, the target document can be a sentence document, or a chapter document; this embodiment does not limit the source of the target document, for example, the target document can be a result from speech recognition, or web document data collected from various websites on the Internet; this embodiment does not limit the type of the target document, for example, the target document can be a sentence in people's daily conversations, or a part of a speech, magazine article, sports news, literary work, etc.
[0052] It should be noted that a sentence document refers to a sentence, which is a collection of words, and a chapter document refers to a collection of a series of sentences. After obtaining a sentence document or a chapter document as the target document for extracting keywords, the document attributes of the target document can be further extracted according to the specific values of the document attributes by using corresponding extraction methods. For example, the document classification attribute of the target document can be determined by using document classification models such as the naive Bayes model, the maximum entropy model, or the decision tree; the document topic generation model (latent dirichlet allocation, LDA) or latent semantic analysis (latent semantic analysis, LSA) can also be used to extract the document topic attribute of the target document, and so on. And determine the candidate keywords contained in the target document, and then determine the keywords of the target document from these candidate keywords according to the document attributes according to the subsequent steps.
[0053] Among them, the document attributes of the target document can characterize the nature of the target document from a certain aspect, such as the classification of the subject content of the target document (such as sports, entertainment, military, etc.), emotion (such as positive, neutral, negative, etc.), source (such as from a certain website, a certain newspaper, etc.) and the author of the document, etc. These document attributes are used to represent the subject of the entire document of the target document and the semantic information of the entire document.
[0054] Specifically, the document attributes of the target document may include an attribute name and an attribute value, and each attribute name corresponds to at least one attribute value. The attribute name describes the attribute of the target document in a certain aspect, and the attribute value describes the specific value of the target document in this aspect. For example, the attribute name "classification" can be used to describe the attribution type of the subject content of the target document. The attribute value corresponding to the attribute name "classification" can be "entertainment", "sports" or "military", etc., and the corresponding attribution type of the subject content of the target document can be entertainment, sports or military, etc., that is, the target document can be an entertainment document (such as an entertainment news document), a sports document (such as a sports news document) or a military document (such as a military report document), etc. Based on this, it can be seen that the document attributes of the target document have a strong indicative effect on the determination of keywords in the target document. For example, assuming that the target document is classified as sports (such as the target document is a sports news document), the words representing the names of sports games and the names of athletes in the target document are likely to be the keywords of the target document.
[0055] In this embodiment, an optional implementation method is that after obtaining the target document, in order to be able to more accurately and quickly determine the keywords contained therein, it is necessary to first perform word segmentation processing on the target document to obtain multiple segmentation words contained in the target document, and further select segmentation words that meet preset conditions from these multiple segmentation words as candidate keywords, thereby further narrowing the scope of keyword determination.
[0056] Furthermore, in some implementations, before the target document is segmented, in order to ensure the accuracy of the target document data, the target document may be subjected to preprocessing operations such as denoising to obtain the preprocessed target document. Specifically, invalid data such as special symbols or emoticons in the target document may be filtered out first, and then the filtered target document may be subjected to normalization operations such as unification of English and Chinese capitalization and unification of traditional and simplified Chinese characters, and after obtaining the preprocessed target document, it may be segmented to obtain each prepared segmentation word. Then, each segmentation word may be tagged with a part of speech to determine the part of speech (such as name, verb, adjective, etc.) corresponding to each word.
[0057] Furthermore, in order to reduce the redundancy of keywords in the target document and obtain concise and more accurate keywords, the named entity words contained in the preprocessed target document can be determined first, because the named entity words are more likely to be keywords. For example, the preprocessed target document can be identified with a bidirectional long short-term memory (biLSTM) network or a conditional random field (CRF) to determine the named entity words contained in the preprocessed target document. The specific implementation process is consistent with the relevant method and will not be repeated here.
[0058] Based on this, according to the part of speech of each segmentation word in the preprocessed target document and the recognition results of the named entity words, the target segmentation words that meet the preset conditions can be selected from all the segmentation words as candidate keywords. Among them, the preset conditions refer to the pre-set judgment conditions for distinguishing whether the segmentation words can be used as candidate keywords. The specific conditions can be set according to the actual situation, and this application is not limited here. For example, words with a frequency of occurrence higher than the preset threshold in all segmentation words can be used as candidate keywords; or words with a part of speech of nouns and noun phrases composed of adjectives and nouns can be used as candidate keywords; or the identified named entity words can be directly used as candidate keywords; or, the pre-constructed keyword dictionary can be directly used to filter out candidate keywords from all segmentation words, wherein it should be noted that the keyword dictionary refers to a collection of keywords in multiple documents in all other fields that have been manually sorted in advance. If any segmentation word in the preprocessed target document appears in the keyword dictionary, it can be used as a candidate keyword for subsequent processing.
[0059] In this way, after obtaining the document attributes of the target document and the multiple candidate keywords included in the target document, the server device can use the AI system deployed thereon to implement the keyword extraction function to calculate the relevance of subsequent keywords and document attributes through subsequent steps S302-S303 to determine the keywords of the target document based on the calculation results.
[0060] S302: Calculate a first score of the candidate keyword using the document attribute; wherein the first score is used to represent the relevance between the candidate keyword and the document attribute.
[0061] In this embodiment, after obtaining the document attributes of the target document and the multiple candidate keywords included in the target document in step S301, a first score representing the correlation between the candidate keywords and the document attributes can be further calculated. The specific calculation formula is as follows:
[0062]
[0063] Where w represents the candidate keywords in the target document; P(v j |d,a i ) indicates that the attribute value corresponding to the i-th document attribute of the target document is v j The probability of; M represents the total number of attribute values corresponding to the i-th document attribute of the target document; Represents the attribute value v corresponding to the candidate keyword w and the i-th document attribute of the target document j The specific calculation method will be introduced in the subsequent embodiments; iIt represents the weight of the i-th document attribute of the target document. The specific value can be preset manually according to the actual situation and experience value. N represents the total number of document attributes corresponding to the target document. S1 represents the first score of the candidate keyword w.
[0064] In a possible implementation of this embodiment, the specific implementation process of step S302 may include the following steps AB:
[0065] Step A: Obtain the relevance value between the document attribute and the candidate keyword from a pre-constructed keyword-attribute relevance dictionary, wherein the keyword-attribute relevance dictionary stores the relevance value between the keyword and the document attribute.
[0066] In this implementation, in order to quickly and accurately determine the correlation between the candidate keywords and the attribute values corresponding to the document attributes, the above formula (1) is substituted to calculate the first score of the candidate keywords. First, the attributes matching the document attributes of the target document can be obtained from the pre-constructed keyword-attribute correlation dictionary (i.e., the document attributes of the target document are queried from the pre-constructed keyword-attribute correlation dictionary), and the keywords matching the candidate keywords of the target document can be obtained from it (i.e., the candidate keywords of the target document are queried from the pre-constructed keyword-attribute correlation dictionary). Furthermore, the correlation value between the two can be obtained from the keyword-attribute correlation dictionary.
[0067] It should be noted that the keyword-attribute relevance dictionary stores a large number of relevances between different attribute values corresponding to different document attributes and different keywords. In some implementations, the keyword-attribute relevance dictionary is constructed using a pre-constructed document library and keyword dictionary, wherein the document library stores multiple documents in multiple fields and document attributes corresponding to each document, and the keyword dictionary stores multiple keywords in multiple fields. Web crawlers or other forms can be used to obtain data such as documents, document attributes, and keywords in various fields from web pages or other self-media channels to construct the document library and keyword dictionary.
[0068] Specifically, in an optional implementation manner, the process of constructing the keyword-attribute relevance dictionary may include the following steps A1-A3:
[0069] Step A1: Extract document properties of each document in the document library.
[0070] In this implementation, after constructing a document library containing multiple documents in multiple fields, each document attribute corresponding to each document can be further extracted, and different extraction methods can be used for different document attributes. Next, this embodiment will briefly introduce the two document attributes of "classification" and "subject" of the document as an example, and the extraction process of other document attributes can refer to the implementation scheme of the relevant technology, which will not be repeated here.
[0071] (1) The implementation process of determining the classification of documents is as follows:
[0072] It should be noted that the classification of documents is usually manually defined, and is also a way to divide documents from the perspective of the subject content of the documents. In order to characterize the subject content of documents from different granularities, a hierarchical classification system can be designed. For example, the specific classification of documents can be refined layer by layer using multiple levels such as primary, secondary, and tertiary categories. Among them, the meaning of the primary category is usually more abstract, and the meanings of the secondary and tertiary categories are gradually concretized downward. For example, for each information flow document, these documents can be divided into primary categories such as entertainment, sports, military, and society. Further, under the sports classification, the documents can be further divided into secondary categories such as basketball and football. Further, under the basketball classification, they can be further divided into tertiary categories such as professional basketball leagues and college basketball leagues. In addition, when using a classification model to determine the classification of documents, it is usually necessary to manually pre-label a large amount of "document-classification" data as training data, and then use these training data to train the initial document classification model, and then use the trained document classification model to classify the documents. Among them, the initial document classification model can be a commonly used document classification model such as a naive Bayes model, a maximum entropy model, a decision tree, etc., or it can be other text classification models based on deep learning, such as an algorithm that uses a convolutional neural network to classify documents (textcnn), etc.
[0073] (2) The implementation process of determining the subject of the document is as follows:
[0074] It should be noted that the topic of a document is usually obtained by processing the document using a common topic model. A topic model refers to a statistical model that clusters the implicit semantic structure of a document in an unsupervised learning manner. Common topic models include LDA, LSA, etc.
[0075] It should also be noted that while extracting all the document attributes of each document in the document library, it is also possible to determine the attribute values corresponding to each document attribute (that is, different document attributes correspond to different attribute values), and the attribute value can be a fixed value, or it can be a probability distribution of a document attribute. For example, for the document attribute "classification" of a document, the corresponding attribute value can be a fixed value such as entertainment or sports, or it can be a probability value belonging to entertainment and sports. For example, the probability that the document belongs to the entertainment category can be 0.9, and the probability that it belongs to the sports category can be 0.1.
[0076] Furthermore, after the document attributes and corresponding attribute values of each document are extracted, they can be stored together with the corresponding documents in a document library for calculation in subsequent steps.
[0077] Step A2: Calculate the relevance between each keyword in the keyword dictionary and each document attribute in the document library.
[0078] In this implementation, after all document attributes and corresponding attribute values of each document in the document library are extracted in step A1, the correlation between each keyword in the keyword dictionary and the attribute value of each document attribute in the document library can be further calculated.
[0079] Specifically, when the attribute value corresponding to the document attribute is a fixed value, the calculation formula for the correlation between the keywords in the keyword dictionary and the attribute value in the document library is as follows:
[0080]
[0081] Among them, R w,v It represents the correlation between keyword w in the keyword dictionary and attribute value v in document library D; Count(w,D) represents the total number of times keyword w appears in each document in document library D; Count(w,v,D) represents the number of times keyword w and attribute value v co-occur in document library D, that is, the total number of times keyword w in document library D appears in documents with attribute value v in document library D.
[0082] For example: Assume that there are three documents in document library D, namely d1, d2 and d3, and d1 and d2 belong to the sports category, and d3 belongs to the entertainment category. The keyword "Guo" appears a total of 10 times in each document of document library D, among which it appears 3 times in document d1, 5 times in document d2, and 2 times in document d3. Then, for the document attribute "classification", the correlation between the keyword "Guo" and the attribute value "sports" can be calculated by the above formula (2) to be 0.8, that is, (3+5) / 10=0.8; similarly, the correlation between the keyword "Guo" and the attribute value "entertainment" can be calculated to be 0.2, that is, 2 / 10=0.2.
[0083] In addition, when the attribute value corresponding to the document attribute is a probability distribution value, the calculation formula for the correlation between the keywords in the keyword dictionary and the attribute value in the document library is as follows:
[0084]
[0085] Among them, R w,v It represents the correlation between keyword w in the keyword dictionary and attribute value v in document library D; Count(w,D) represents the total number of times keyword w appears in each document in document library D; Count(w,d) represents the number of times keyword w and attribute value v co-occur in document library D, that is, the total number of times keyword w in document library D appears in documents with attribute value v in document library D; P(v|d,a) represents the probability that document d in document library D has attribute value v corresponding to document attribute a.
[0086] For example: Assume that there are three documents in the document library D, namely d1, d2 and d3. Among them, the probability that d1 belongs to the sports category is 0.9, and the probability that it belongs to the entertainment category is 0.1. The probability that d2 belongs to the sports category is 0.7, and the probability that it belongs to the entertainment category is 0.3. The probability that d3 belongs to the sports category is 0.2, and the probability that it belongs to the entertainment category is 0.8. The total number of times the keyword "Guo" appears in each document in the document library D is still 10 times. Specifically, it appears 3 times in document d1, 5 times in document d2, and 2 times in document d3. For the document attribute "classification", the correlation between the keyword "Guo" and the attribute value "sports" can be calculated by the above formula (3) to be 0.66, that is, (3*0.9+5*0.7+2*0.2) / 10=0.66; similarly, the correlation between the keyword "Guo" and the attribute value "entertainment" can be calculated to be 0.34, that is, (3*0.1+5*0.3+2*0.8) / 10=0.34.
[0087] Step A3: A keyword-attribute relevance dictionary is formed based on the relevance between each keyword and each document attribute, and between each keyword and each document attribute.
[0088] In this implementation, after calculating the correlation between each keyword in the keyword dictionary and the attribute value of each document attribute in the document library through step A2, further, the correlation between each keyword and each document attribute, and the correlation between each keyword and the attribute value of each document attribute can be used to form a keyword-attribute correlation dictionary for subsequent calculations.
[0089] It should be noted that, in order to facilitate relevance queries, a keyword-attribute relevance dictionary can also be constructed for each document attribute, and the dictionary stores each attribute value and each keyword corresponding to the document attribute, as well as the relevance between each attribute value and each keyword.
[0090] Step B: Calculate the first score of the candidate keyword according to the relevance value between the document attribute and the candidate keyword.
[0091] In this implementation, the relevance value (ie, R ) between the document attribute and the candidate keyword in the pre-constructed keyword-attribute relevance dictionary in step A is obtained. w,v ), it can be further substituted into the above formula (1) to calculate the first score S1 of each candidate keyword to execute the subsequent step S303.
[0092] S303: Determine a target keyword from a plurality of candidate keywords according to the first score.
[0093] In this embodiment, after calculating the first score of each candidate keyword in step S302, the final target keyword can be selected by further judging whether the first score of each candidate keyword satisfies the preset selection rule. The preset selection rule can be set according to the actual situation and experience value, and the embodiment of the present application does not limit its specific value. For example, the preset selection rule can be set to select the first m (the value can be any integer) candidate keywords with higher first scores as target keywords, or the preset selection rule can be set to select all candidate keywords with first scores higher than n (the value can be any non-negative number) as target keywords, or the preset selection rule can be set to select the first m keywords with first scores higher than n as target keywords, and so on.
[0094] In a possible implementation of this embodiment, in order to further improve the accuracy of the keyword extraction results, an unsupervised method can also be used to calculate the second score of the candidate keyword, and then determine the target keyword from multiple candidate keywords based on the comprehensive result of the first score and the second score.
[0095] Specifically, in this implementation, since the unsupervised method is relatively simple to implement, its corresponding extraction result can be combined with the above extraction result to determine a more accurate target keyword. Specifically, after obtaining multiple candidate keywords of the target document through the above step S301, the scores of these candidate keywords that can be used as target keywords can be further calculated using common unsupervised methods (here defined as the second score). Taking the unsupervised method TF-IDF as an example, the calculation formula for the second score of the candidate keyword is as follows:
[0096] S2=TF w *IDF w *W te (4)
[0097] Where S2 represents the second score of the candidate keyword w; TF w Indicates the frequency of candidate keyword w in the target document; IDF w Indicates the prevalence of candidate keyword w, that is, the rarity of keyword w, IDF w The larger the value of, the more special (rare) the candidate keyword w is. w The smaller the value of, the more common (not rare) the candidate keyword w is. It should be noted that TF w and IDF w The calculation process of W is consistent with that of common related technologies and will not be repeated here. te represents the weight of the candidate keyword w. When the candidate keyword w appears in the title of the target document, it means that it has a larger weight and is more important. At this time, W te The value of is also large. For example, W te The value is 2.1. On the contrary, when the candidate keyword w does not appear in the title of the target document, it means that its weight is small and its importance is low. At this time, W te The value of is also small. For example, W te The value is 1.
[0098] It should be noted that in order to further improve the accuracy of the second score of the candidate keywords, a variety of common unsupervised methods can be used to calculate the second scores of the candidate keywords respectively, and then all the obtained second scores are weighted averaged to obtain a final second score with higher accuracy.
[0099] Furthermore, after determining the first score and the second score of the candidate keyword, the two scores can be processed comprehensively to calculate the final score of the candidate keyword to determine the target keyword. The specific calculation formula of the final score is as follows:
[0100] S=S2*(1+α*S1) (5)
[0101] Among them, S represents the final score of the candidate keyword w; S1 represents the first score of the candidate keyword w; S2 represents the second score of the candidate keyword w; α represents an adjustment parameter used to adjust the influence of the first score on the final score. The specific value can be determined according to actual conditions and experience. This embodiment does not limit this. For example, α can be set to 1.
[0102] On this basis, after calculating the final score of each candidate keyword, the target keyword can be further determined by judging whether the final score of each candidate keyword satisfies the preset determination rule. Among them, similar to the preset selection rule, the preset determination rule is also set according to the actual situation and experience value, and the embodiment of the present application does not limit its specific value. For example, the preset determination rule can be set to take the first t (the value can be any integer) candidate keywords with higher final scores as target keywords, or the preset determination rule can be set to take all candidate keywords with final scores higher than f (the value can be any non-negative number) as target keywords, or the preset determination rule can be set to take the first t keywords with first scores higher than f as target keywords, and so on.
[0103] For example: Assume that the title of the target document is: "Revisiting "Still Walking" and understanding the life philosophy of father and son in the film of Japanese director Hirokazu Koreeda", the document content of the target document is: "Speaking of family, every man cannot avoid a topic, that is, the relationship between father and son. In the life of father and son, there may be rebellion as a son, or helplessness as a father. These are propositions that all men explore throughout their lives. The writing and detailed portrayal of the life of father and son in "Still Walking" is warm but not tender, and the undercurrent of contradictions and conflicts is contained in the plainness. It touched my inner pain point and aroused my reflection on family relationships and life. This movie is also the most satisfying one for Japanese director Hirokazu Koreeda, and it can be said to be his peak masterpiece. The film won the 3rd Asian Film Award, and Hirokazu Koreeda also won the Best Director. Douban scored 8.8 points. This is the first time that director Hirokazu Koreeda, who is dubbed as a "film poet", has ventured into film narration based on his inner experience and feelings. Inspired by the company and memories of his mother before her death, it tells the story of an ordinary family's eldest son's ordinary two days and one night reunion on the anniversary of his death. Most of the reviews of "Still Walking" start with the themes of family and time, interpreting the love and estrangement in it. However, what touched me most was the portrayal of father and son, which is not only a reflection of the director's life experience, but also a manifestation of the social era. Today, Yifei will change the perspective and analyze the narrative art of the father-son relationship, the presentation of the theme, and the interpretation of symbols, and combine the director Hirokazu Koreeda's film style to talk about the thoughts brought by this movie."
[0104] First, after preprocessing and word segmentation of the target document, the candidate keywords of the target document are: Hirokazu Koreeda, never stop, movie, father and son, Japanese director, two days and one night, father and son, film, film review, poet, family, Douban score, family relationship, director, adventure, father-son relationship. Then, the target document is classified, and the probability that the target document belongs to the entertainment category is 0.9913635849952698, the probability that it belongs to the film and television category is 0.007857623510062695, and the probability that it belongs to the film and television category is 0.00040638275095261633. Next, using the above formulas (1), (4) and (5), we can calculate that the top 10 candidate keywords with the highest total scores are: Hirokazu Koreeda, movie, keep walking, Japanese director, film review, father-son relationship, father and son, two days and one night, father and son, and film. The scores of these 10 candidate keywords are 0.8491847591106054, 0.3180766030204272, and 0.20264372364 respectively. 551553, 0.11128570889518727, 0.06614821126009365, 0.060119279952710186, 0.04562916513726069, 0.042790203045320656, 0.03430414511557347, 0.030885619601073038.
[0105] If we only use the common unsupervised method to extract the keywords of the target document, the top 10 candidate keywords with the highest total scores are: Hirokazu Koreeda, keep walking, movie, father and son, Japanese director, father-son relationship, two days and one night, father and son, film review, poet. The scores of these 10 candidate keywords are 1.0510089395270272, 0.6938648998986487, 0.41465 0.86270270274、0.15200450597972975、0.14041675554054053、0.1395570945945946、0.11790977972972974、0.09479145405405404、0.0913635554054054、0.07512666891891892.
[0106] It can be seen that the keywords extracted by this application are more accurate, that is, the extracted words such as "film review" and "film" can better reflect the subject content and semantic information of the target document compared with words such as "father and son" and "poet", and their importance (criticality) is also higher.
[0107] In summary, the keyword extraction method provided by the present embodiment, when extracting keywords from a target document, first obtains the document attributes of the target document, wherein the document attributes are used to characterize the subject and semantic information of the target document, and the target document includes multiple candidate keywords; then, the first score of the candidate keyword is calculated using the document attributes, wherein the first score is used to characterize the relevance between the candidate keyword and the document attributes, and then the target keyword can be determined from the multiple candidate keywords based on the first scores of each candidate keyword. It can be seen that since the embodiment of the present application takes into account the document attributes that characterize the subject and semantic information of the target document when extracting keywords from the target document, the accuracy of the keyword extraction results can be improved, and since there is no need to manually annotate the training data for keywords, the cost of keyword extraction is reduced, resulting in a lower cost and more accurate extraction result.
[0108] In order to better implement the above solution of the embodiment of the present application, the following also provides related devices for implementing the above solution. Figure 4 As shown, the embodiment of the present application provides a keyword extraction device 400. The device 400 may include: an acquisition unit 401, a first calculation unit 402 and a determination unit 403. The acquisition unit 401 is used to support the device 400 to perform Figure 3 In the embodiment shown in S301, the first computing unit 402 is used to support the device 400 to execute Figure 3 S302 in the illustrated embodiment. The determining unit 403 is used to support the device 400 to execute Figure 3 S303 in the illustrated embodiment. Specifically,
[0109] The acquisition unit 401 is used to acquire the document attributes of the target document; wherein the document attributes are used to characterize the subject and semantic information of the target document; the target document includes a plurality of candidate keywords;
[0110] A first calculation unit 402 is used to calculate a first score of the candidate keyword using the document attribute; wherein the first score is used to represent the relevance between the candidate keyword and the document attribute;
[0111] The determination unit 403 is configured to determine a target keyword from a plurality of candidate keywords according to the first score.
[0112] In one implementation of this embodiment, the device further includes:
[0113] A second calculation unit, used to calculate a second score of the candidate keyword using an unsupervised method;
[0114] The determining unit 403 is specifically used for:
[0115] A target keyword is determined from a plurality of candidate keywords according to the first score and the second score.
[0116] In an implementation of this embodiment, the first calculation unit 402 is specifically configured to:
[0117] Obtaining correlation values between document attributes and candidate keywords from a pre-built keyword-attribute correlation dictionary, wherein the keyword-attribute correlation dictionary stores correlation values between keywords and document attributes; and calculating a first score of the candidate keyword based on the correlation value between the document attribute and the candidate keyword.
[0118] In one implementation of this embodiment, the device further includes:
[0119] A construction unit, for constructing a keyword-attribute relevance dictionary using a pre-constructed document library and a keyword dictionary;
[0120] The document library stores multiple documents in multiple fields and the document attributes corresponding to each document; the keyword dictionary stores multiple keywords in multiple fields.
[0121] In one implementation of this embodiment, the construction unit is specifically used to:
[0122] Extract document properties of each document in the document library;
[0123] Calculate the relevance between each keyword in the keyword dictionary and each document attribute in the document library; and form a keyword-attribute relevance dictionary from the relevance between each keyword and each document attribute, and between each keyword and each document attribute.
[0124] In one implementation of this embodiment, the device further includes:
[0125] The selection unit is used to perform word segmentation processing on the target document to obtain multiple word segmentation terms, and select the word segmentation terms that meet the preset conditions from the multiple word segmentation terms as candidate keywords.
[0126] In one implementation of this embodiment, the device further includes:
[0127] A preprocessing unit, used for performing denoising preprocessing on the target document to obtain a preprocessed target document;
[0128] The selection unit is specifically used for:
[0129] The preprocessed target document is segmented to obtain a plurality of segmented words, and segmented words that meet preset conditions are selected from the plurality of segmented words as candidate keywords.
[0130] In summary, the keyword extraction device provided by the present embodiment first obtains the document attributes of the target document when extracting keywords from the target document, wherein the document attributes are used to characterize the subject and semantic information of the target document, and the target document includes multiple candidate keywords; then, the first score of the candidate keyword is calculated using the document attributes, wherein the first score is used to characterize the correlation between the candidate keyword and the document attributes, and then the target keyword can be determined from the multiple candidate keywords based on the first scores of each candidate keyword. It can be seen that since the embodiment of the present application takes into account the document attributes that characterize the subject and semantic information of the target document when extracting keywords from the target document, the accuracy of the keyword extraction results can be improved, and since there is no need to manually annotate the training data of the keywords, the keyword extraction cost is also reduced, resulting in a lower cost and more accurate extraction result.
[0131] See also Figure 5 The embodiment of the present application provides a keyword extraction device 500, which includes a memory 501, a processor 502 and a communication interface 503.
[0132] Memory 501, used for storing instructions;
[0133] Processor 502 is used to execute instructions in memory 501 to execute the above application Figure 3 The keyword extraction method in the illustrated embodiment;
[0134] The communication interface 503 is used for communication.
[0135] The memory 501, the processor 502 and the communication interface 503 are interconnected via a bus 504; the bus 504 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0136] In a specific embodiment, the processor 502 is used to first obtain the document attributes of the target document when performing keyword extraction, wherein the document attributes are used to characterize the subject and semantic information of the target document, and the target document includes multiple candidate keywords; then, the first score of the candidate keyword is calculated using the document attributes, wherein the first score is used to characterize the relevance between the candidate keyword and the document attributes, and then the target keyword can be determined from the multiple candidate keywords based on the first score of each candidate keyword. Please refer to the above for the detailed processing process of the processor 502. Figure 3 The detailed description of S301, S302 and S303 in the illustrated embodiment will not be repeated here.
[0137] The above-mentioned memory 501 can be a random-access memory (RAM), a flash memory (flash), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a register, a hard disk, a mobile hard disk, a CD-ROM or any other form of storage medium known to those skilled in the art.
[0138] The processor 502 may be, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the embodiments of the present application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0139] The communication interface 503 may be, for example, an interface card, etc., and may be an Ethernet interface or an asynchronous transfer mode (ATM) interface.
[0140] The embodiment of the present application also provides a computer-readable storage medium, including instructions, which, when executed on a computer, enable the computer to execute the above-mentioned keyword extraction method.
[0141] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0143] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0145] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0146] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0147] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A keyword extraction method, characterized in that: The method comprises: Acquire document attributes of a target document; the document attributes are used to characterize the subject and semantic information of the target document; the target document includes a plurality of candidate keywords; Calculating a first score of the candidate keyword using the document attribute; the first score is used to represent the relevance between the candidate keyword and the document attribute; determining a target keyword from the plurality of candidate keywords according to the first score; The step of calculating the first score of the candidate keyword by using the document attribute includes: Obtaining a relevance value between the document attribute and the candidate keyword from a pre-constructed keyword-attribute relevance dictionary, wherein the keyword-attribute relevance dictionary stores relevance values between keywords and document attributes; A first score of the candidate keyword is calculated according to the relevance value between the document attribute and the candidate keyword.
2. The method according to claim 1, characterized in that The method further comprises: Calculate the second score of the candidate keyword using an unsupervised method; Determining a target keyword from the plurality of candidate keywords according to the first score includes: A target keyword is determined from the plurality of candidate keywords according to the first score and the second score.
3. The method according to claim 1, characterized in that The method further comprises: Using a pre-built document library and keyword dictionary, construct the keyword-attribute relevance dictionary; The document library stores a plurality of documents in a plurality of fields and document attributes corresponding to each document; the keyword dictionary stores a plurality of keywords in a plurality of fields.
4. The method according to claim 3, characterized in that The method of using the pre-built document library and keyword dictionary to build the keyword-attribute relevance dictionary includes: Extracting document properties of each document in the document library; Calculating the correlation between each keyword in the keyword dictionary and each document attribute in the document library; The keyword-attribute relevance dictionary is formed by the relevance between each keyword and each document attribute, and the relevance between each keyword and each document attribute.
5. The method according to claim 1, characterized in that The method further comprises: The target document is segmented to obtain a plurality of segmented words, and a segmented word satisfying a preset condition is selected from the plurality of segmented words as the candidate keyword.
6. The method according to claim 5, characterized in that The method further comprises: Performing denoising preprocessing on the target document to obtain a preprocessed target document; The step of performing word segmentation processing on the target document to obtain a plurality of word segmentation terms, and selecting a word segmentation term that meets a preset condition from the plurality of word segmentation terms as a candidate keyword includes: The preprocessed target document is segmented to obtain a plurality of segmented words, and a segmented word satisfying a preset condition is selected from the plurality of segmented words as the candidate keyword.
7. A keyword extraction device, characterized in that: The device comprises: An acquisition unit, used for acquiring document attributes of a target document; the document attributes are used for representing the subject and semantic information of the target document; the target document includes a plurality of candidate keywords; A first calculation unit, configured to calculate a first score of the candidate keyword using the document attribute; the first score is used to represent the relevance between the candidate keyword and the document attribute; a determining unit, configured to determine a target keyword from the plurality of candidate keywords according to the first score; The first computing unit is specifically configured to: Obtaining the correlation value between the document attribute and the candidate keyword from a pre-constructed keyword-attribute correlation dictionary, wherein the keyword-attribute correlation dictionary stores the correlation values between keywords and document attributes; and calculating the first score of the candidate keyword based on the correlation value between the document attribute and the candidate keyword.
8. The device according to claim 7, characterized in that The device also includes: A second calculation unit, used to calculate a second score of the candidate keyword using an unsupervised method; The determining unit is specifically used for: A target keyword is determined from the plurality of candidate keywords according to the first score and the second score.
9. The device according to claim 7, characterized in that The device also includes: A construction unit, configured to construct the keyword-attribute relevance dictionary using a pre-constructed document library and keyword dictionary; The document library stores a plurality of documents in a plurality of fields and document attributes corresponding to each document; the keyword dictionary stores a plurality of keywords in a plurality of fields.
10. The device according to claim 9, characterized in that The building blocks are specifically used for: Extracting document properties of each document in the document library; Calculating the relevance between each keyword in the keyword dictionary and each document attribute in the document library; and forming the keyword-attribute relevance dictionary from the relevance between each keyword and each document attribute, and between each keyword and each document attribute.
11. The device according to claim 7, characterized in that The device also includes: The selection unit is used to perform word segmentation processing on the target document to obtain multiple word segmentation terms, and select the word segmentation terms that meet the preset conditions from the multiple word segmentation terms as the candidate keywords.
12. The device according to claim 11, characterized in that The device also includes: A preprocessing unit, used for performing denoising preprocessing on the target document to obtain a preprocessed target document; The selection unit is specifically used for: The preprocessed target document is segmented to obtain a plurality of segmented words, and a segmented word satisfying a preset condition is selected from the plurality of segmented words as the candidate keyword.
13. A keyword extraction device, characterized in that: The device includes a memory and a processor; The memory is used to store instructions; The processor is used to execute the instructions in the memory and perform the method according to any one of claims 1 to 6.
14. A computer-readable storage medium comprising instructions, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and equipment for adding multi-media files
CN104866511A
Method and device for ontology alignment
CN106156082A
Text label extracting method and device
CN106156204A
Keyword extraction method and device and electronic equipment
CN107766318A
Keyword extraction method and device
CN108073568A
