Keyword extraction method and apparatus
By determining the knowledge graph based on the text type, and comparing the entity and attribute information in the knowledge graph with the keyword similarity, the problem of inaccurate keyword extraction caused by insufficient training samples is solved, and highly accurate keyword extraction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-14
- Publication Date
- 2026-04-03
AI Technical Summary
In existing technologies, the accuracy of keyword extraction depends on the number of training samples. When the number of samples is small, keywords cannot be extracted effectively, which fails to meet the requirements.
By obtaining the text type of the text to be processed, the corresponding knowledge graph is determined. The entity information and attribute information in the knowledge graph are compared with the extracted keywords for similarity. Based on the comparison results, the target keywords are determined, and accurate keywords are selected by combining the preset threshold.
It improves the accuracy of keyword extraction, ensuring that the extracted keywords are highly relevant to the field to which the text belongs, resulting in more accurate and complete results.
Smart Images

Figure CN115204156B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and in particular to a keyword extraction method. This application also relates to a keyword extraction apparatus, a computing device, and a computer-readable storage medium. Background Technology
[0002] With the development of internet technology, keyword extraction technology has been widely applied in various fields. Keyword extraction is a fundamental task in text mining research, including text retrieval, summary generation, document classification, and clustering. In particular, extracting keywords from news articles and meeting minutes allows readers to quickly grasp the main idea of the content.
[0003] Currently, keyword extraction typically involves pre-training a neural network model with a large set of training samples carrying keyword labels, and then using this trained model to extract keywords. However, the accuracy of keyword extraction depends heavily on the quantity of samples in the training set; a lack of samples directly impacts the accuracy. Therefore, with a limited number of training samples, it is impossible to use a neural network model for keyword extraction, thus failing to meet user needs. Summary of the Invention
[0004] In view of this, embodiments of this application provide a keyword extraction method to address the technical deficiencies in the prior art. Embodiments of this application also provide a keyword extraction apparatus, a computing device, and a computer-readable storage medium.
[0005] According to a first aspect of the embodiments of this application, a keyword extraction method is provided, including:
[0006] Obtain the text to be processed and identify the text type of the text to be processed;
[0007] Based on the text type, determine the knowledge graph corresponding to the text type;
[0008] Extract keywords from the text to be processed;
[0009] The information in the knowledge graph is compared with the extracted keywords to determine the target keywords of the text to be processed.
[0010] Optionally, the information in the knowledge graph includes entity information and attribute information;
[0011] The information in the knowledge graph is compared with the extracted keywords to determine the target keywords for the text to be processed, including:
[0012] Identify the reference words corresponding to entity information and attribute information in the knowledge graph;
[0013] The extracted keywords are compared with each reference word in turn to obtain the keyword similarity.
[0014] If the similarity is greater than or equal to the first preset threshold, then the keyword is determined to be the target keyword.
[0015] Optionally, after determining the reference words corresponding to the entity information and attribute information in the knowledge graph, the above method further includes:
[0016] Each reference word is matched with the text to be processed, and target reference words that appear in the text to be processed but are not keywords in the text to be processed are extracted as target keywords.
[0017] Optionally, target reference words that appear in the text to be processed but are not keywords in the text to be processed are extracted as target keywords, including:
[0018] Extract target reference words that appear in the text to be processed but are not keywords in the text to be processed;
[0019] Input the target reference word into a pre-trained keyword recognition model to obtain the keyness of the target reference word;
[0020] If the criticality is greater than or equal to the second preset threshold, then the target reference word is determined as the target keyword.
[0021] Optionally, after inputting the target reference word into a pre-trained keyword recognition model to obtain the keyness of the target reference word, the above method further includes:
[0022] If the keyword importance is less than the second preset threshold, then the target reference word is deleted.
[0023] Optionally, after comparing the extracted keywords with each reference word in turn to obtain the keyword similarity, the above method further includes:
[0024] If the similarity is less than the first preset threshold, the keyword will be deleted.
[0025] Optionally, the text type includes the vertical domain to which the text belongs;
[0026] Identify the text type of the text to be processed, including:
[0027] The text to be processed is input into a pre-trained domain recognition model to obtain the target vertical domain to which the text to be processed belongs. The domain recognition model is obtained by training a pre-set neural network using sample texts carrying vertical domain labels.
[0028] Based on the text type, determine the knowledge graph corresponding to the text type, including:
[0029] Based on the target vertical domain, search the knowledge graph library that has been built in advance based on the vertical domain to determine the knowledge graph corresponding to the target vertical domain. The knowledge graph library records the knowledge graphs corresponding to different vertical domains.
[0030] According to a second aspect of the embodiments of this application, a keyword extraction device is provided, comprising:
[0031] The recognition module is configured to acquire the text to be processed and identify the text type of the text to be processed;
[0032] The knowledge graph determination module is configured to determine the knowledge graph corresponding to a text type based on the text type.
[0033] The extraction module is configured to extract keywords from the text to be processed;
[0034] The target keyword determination module is configured to compare the similarity between the information in the knowledge graph and the extracted keywords, and determine the target keywords of the text to be processed based on the comparison results.
[0035] Optionally, the information in the knowledge graph includes entity information and attribute information;
[0036] The target keyword determination module is further configured as follows:
[0037] Identify the reference words corresponding to entity information and attribute information in the knowledge graph;
[0038] The extracted keywords are compared with each reference word in turn to obtain the keyword similarity.
[0039] If the similarity is greater than or equal to the first preset threshold, then the keyword is determined to be the target keyword.
[0040] Optionally, the target keyword determination module is further configured as follows:
[0041] Each reference word is matched with the text to be processed, and target reference words that appear in the text to be processed but are not keywords in the text to be processed are extracted as target keywords.
[0042] Optionally, the target keyword determination module is further configured as follows:
[0043] Extract target reference words that appear in the text to be processed but are not keywords in the text to be processed;
[0044] Input the target reference word into a pre-trained keyword recognition model to obtain the keyness of the target reference word;
[0045] If the criticality is greater than or equal to the second preset threshold, then the target reference word is determined as the target keyword.
[0046] Optionally, the target keyword determination module is further configured as follows:
[0047] If the keyword importance is less than the second preset threshold, then the target reference word is deleted.
[0048] Optionally, the target keyword determination module is further configured as follows:
[0049] If the similarity is less than the first preset threshold, the keyword will be deleted.
[0050] Optionally, the text type includes the vertical domain to which the text belongs;
[0051] The recognition module is further configured as follows:
[0052] The text to be processed is input into a pre-trained domain recognition model to obtain the target vertical domain to which the text to be processed belongs. The domain recognition model is obtained by training a pre-set neural network using sample texts carrying vertical domain labels.
[0053] The knowledge graph identification module is further configured as follows:
[0054] Based on the target vertical domain, search the knowledge graph library that has been built in advance based on the vertical domain to determine the knowledge graph corresponding to the target vertical domain. The knowledge graph library records the knowledge graphs corresponding to different vertical domains.
[0055] According to a third aspect of the embodiments of this application, a computing device is provided, comprising:
[0056] Memory and processor;
[0057] The memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions to implement the steps of the keyword extraction method.
[0058] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the keyword extraction method.
[0059] According to a fifth aspect of the embodiments of this application, a chip is provided that stores computer instructions, which, when executed by the chip, implement the steps of the keyword extraction method.
[0060] The keyword extraction method provided in this application obtains the text to be processed, identifies its text type, determines the corresponding knowledge graph based on the text type, extracts keywords from the text, compares the information in the knowledge graph with the extracted keywords for similarity, and determines the target keywords of the text based on the comparison results. This method utilizes the text type of the text to determine the knowledge graph corresponding to the domain of the text type. Then, it compares the entity and attribute information in the knowledge graph with the keywords in the text. Based on the similarity comparison results, keywords with high similarity to the entity and attribute information in the knowledge graph are selected as target keywords in the text. This allows for the extraction of accurate target keywords that are highly relevant to the domain of the text, improving the accuracy of keyword extraction. Attached Figure Description
[0061] Figure 1 A schematic diagram of a keyword extraction system according to an embodiment of this application is shown;
[0062] Figure 2 A flowchart of a keyword extraction method according to an embodiment of this application is shown;
[0063] Figure 3 A flowchart of a first target keyword determination method according to an embodiment of this application is shown;
[0064] Figure 4 A flowchart of a second target keyword determination method according to an embodiment of this application is shown;
[0065] Figure 5 A flowchart of a third target keyword determination method according to an embodiment of this application is shown;
[0066] Figure 6 A flowchart of a fourth target keyword determination method according to an embodiment of this application is shown;
[0067] Figure 7 A flowchart of a fifth target keyword determination method according to an embodiment of this application is shown;
[0068] Figure 8 A flowchart of a method for determining a target vertical domain and knowledge graph according to an embodiment of this application is shown;
[0069] Figure 9 A flowchart illustrating a keyword extraction method for conference papers according to an embodiment of this application is shown.
[0070] Figure 10 A schematic diagram of a keyword extraction device according to an embodiment of this application is shown;
[0071] Figure 11 A structural block diagram of a computing device according to an embodiment of this application is shown. Detailed Implementation
[0072] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.
[0073] The terminology used in one or more embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this application. The singular forms “a,” “the,” and “the” used in one or more embodiments of this application and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used in one or more embodiments of this application refers to and includes any or all possible combinations of one or more associated listed items.
[0074] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this application, and similarly, second may also be referred to as first.
[0075] First, the terminology used in one or more embodiments of the present invention will be explained.
[0076] Term Frequency-Inverse Document Frequency (TF-IDF) is a weighted technique used in information retrieval and data mining to evaluate the importance of a word to a document in a document set or corpus. The importance of a word increases proportionally to the number of times it appears in the document, but decreases inversely proportionally to the frequency of its appearance in the corpus.
[0077] This application provides a keyword extraction method. This application also relates to a keyword extraction device, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.
[0078] Figure 1A schematic diagram of a keyword extraction system according to an embodiment of this application is shown.
[0079] The keyword extraction system provided in this application includes a training end and an application end. The training end and the application end can be two or more different devices, or two or more different components within the same device; no specific limitations are made here. The training end is used for model training, and the application end is used to extract keywords from the input text using the model trained on the training end.
[0080] Keyword extraction from the text to be processed on the application side can be achieved as follows: Obtain the text to be processed, identify its text type, determine the corresponding knowledge graph based on the text type, extract keywords from the text to be processed, compare the similarity between the information in the knowledge graph and the extracted keywords, and determine the target keywords for the text to be processed based on the comparison results. The specific steps for identifying the text type and extracting keywords can be achieved using a model trained on the training side; the specific implementation process and model training process will be described in subsequent embodiments.
[0081] By using the above method, the knowledge graph corresponding to the domain of the text type can be determined based on the text type of the text to be processed. Then, the similarity between the knowledge graph and the keywords in the text to be processed can be compared, thereby extracting accurate target keywords that are highly related to the domain of the text to be processed, thus improving the accuracy of keyword extraction.
[0082] Figure 2 The flowchart illustrates a keyword extraction method according to an embodiment of this application, which specifically includes the following steps:
[0083] S202. Obtain the text to be processed and identify the text type of the text to be processed.
[0084] In this embodiment, the text to be processed refers to the text for which keyword extraction is required. The entity that performs keyword extraction can be a computing device with keyword extraction function, such as a server or terminal with keyword matching function.
[0085] To extract keywords from text, the first step is to identify the text type. The text type represents the text's domain, structure, and attributes. Once the text type is identified, target keywords highly relevant to that type can be extracted.
[0086] In one possible implementation of the embodiments of this specification, the text type of the text to be processed can be the vertical domain of the text to be processed. The vertical domain of the text to be processed refers to the specific domain to which the text to be processed belongs, which is vertically subdivided under a large domain. For example, under the large domain of health, the vertical domain of the text to be processed can be the wellness domain, the medical domain, the hygiene domain, etc.
[0087] After acquiring the text to be processed, the executing entity identifies its text type. There are several ways to identify the text type. One approach is to pre-set a text type lookup table in a database. Upon acquiring the text, the entity identifies its identifier (such as a title or number) and matches it against the pre-set lookup table, using the matched text type as the text type of the text to be processed. Another approach is to use a pre-trained neural network model to identify the text type. For example, a set of texts carrying text type labels (such as medical or health-related labels) can be used as a training sample set to train a neural network model for Natural Language Processing (NLP). Each training sample in the text set corresponds to one or more text type labels. The text to be processed is then input into the trained NLP model to obtain its text type. This application does not limit the method used to identify the text type.
[0088] S204. Based on the text type, determine the knowledge graph corresponding to the text type.
[0089] A knowledge graph is a semantic network that interconnects entities in the real world and the relationships between them. Nodes in a knowledge graph represent entities, and edges between entities represent the various semantic relationships between them. Knowledge graphs can enable comprehensive mining and analysis of semantic search and information retrieval, and demonstrate the interrelationships between entities.
[0090] The basic unit of a knowledge graph is a triplet description rule consisting of "entity"-"relation"-"entity" or "entity"-"attribute"-"attribute value". That is, an entity is the basic element in a knowledge graph. For example, in a knowledge graph in the field of education, "student A" and "teacher B" are two entities, and "teacher-student" represents the relationship between "student A" and "teacher B", described by the triplet rule "entity"-"relation"-"entity", i.e., "student A"-"teacher-student"-"teacher B". As another example, for "teacher B", the attribute is "teacher" and the attribute value is "high school", described by the triplet rule "entity"-"attribute"-"attribute value", i.e., "teacher B"-"teacher"-"high school".
[0091] The establishment of a knowledge graph includes the following steps:
[0092] First, it is necessary to extract entities, attributes, and the relationships between entities from various types of data sources. Specifically, entity extraction refers to automatically identifying named entities from various types of data sources, mainly through rule-based methods and statistical machine learning methods. After entity extraction, a series of discrete named entities are obtained. To obtain semantic information, it is also necessary to extract the relationships between entities from related corpora. Only by linking entities through these relationships can a network-like knowledge structure be formed. The main methods for relation extraction include manually constructed grammatical and semantic rules, statistical machine learning, and relation extraction techniques for open domains. The goal of attribute extraction is to collect attribute information of specific entities from different data sources. For example, for a public task, information such as nickname, birthday, nationality, and educational background can be obtained from publicly available online information.
[0093] After extracting entities, attributes, and relationships between entities from various types of data sources, they need to be expressed in a computer-storable and computational structure. Specifically, this can be achieved by using the triplet (SPO, Subject Property Object) description rules of the Resource Description Framework (RDF) to describe the relationships between entities and attributes.
[0094] Because the extracted entities, attributes, and relationships between entities may contain a large amount of redundant and erroneous information, and the relationships between the data are flat and lack hierarchy and logic, knowledge fusion is necessary to logically summarize the extracted entities, attributes, and relationships and filter out erroneous information. This can be achieved through two processes: entity linking and knowledge merging. After knowledge fusion, the knowledge graph can be successfully constructed.
[0095] In this embodiment, the text type of the text to be processed carries corresponding tag information. After constructing several knowledge graphs, the knowledge graphs are pre-stored in the database of the server or terminal. Each knowledge graph corresponds to one or more text type tag information. Once the executing entity determines the text type of the text to be processed, it can search the database for the knowledge graph corresponding to the text to be processed based on the tag information carried by the text type.
[0096] In one possible implementation of the embodiments of this specification, after obtaining the text to be processed, the text type of the text to be processed is identified, that is, the tag information carried by the text type of the text to be processed is identified as "education". Then, the executing entity searches for the knowledge graph corresponding to "education" in the database of the server or terminal, and determines the knowledge graph as the knowledge graph corresponding to the text type.
[0097] S206. Extract keywords from the text to be processed.
[0098] After determining the knowledge graph corresponding to the text type of the text to be processed, the executing agent extracts keywords from the text. This keyword extraction lays the foundation for subsequent similarity comparison and the identification of target keywords.
[0099] Keyword extraction from the text to be processed can be achieved by pre-training a neural network model and then inputting the text into the trained model; alternatively, unsupervised algorithms can be used. This manual does not limit the method used for keyword extraction from the text to be processed.
[0100] In this embodiment, unsupervised algorithms can be used to extract keywords from the text to be processed. For example, the TF-IDF method can be used to extract keywords from the text to be processed. TF in TF-IDF refers to term frequency, that is, the frequency of a given target word in the text, which can be calculated using the following formula (1):
[0101]
[0102] Where f refers to the number of times the target word appears in the text, and w refers to the total number of words in the text.
[0103] IDF refers to Inverse Text Frequency. In order to accurately extract keywords, a corpus needs to be introduced. The corpus is used to simulate the language usage environment. For example, the corpus can be a pre-set text library containing content from various fields. IDF can be calculated using the following formula (2):
[0104]
[0105] Where r refers to the total number of texts in the corpus, and y refers to the number of texts in the corpus that contain the target word;
[0106] The higher the term frequency-inverse text frequency (TF-IDF) of the target word in the text, the more critical the target word is in the text, and the more likely it is to be used as a keyword in the text. The TF-IDF can be calculated using the following formula (3):
[0107] TF-IDF = TF*IDF (3)
[0108] S208. Compare the similarity between the information in the knowledge graph and the extracted keywords, and determine the target keywords of the text to be processed based on the comparison results.
[0109] After extracting the keywords from the text to be processed, the information in the knowledge graph corresponding to the text to be processed is compared with the extracted keywords for similarity, and the target keywords of the text to be processed are determined based on the similarity comparison results.
[0110] There are several ways to compare the similarity between information in a knowledge graph and extracted keywords. For example, a pre-defined neural network model can be used to compare the similarity between information in a knowledge graph and extracted keywords to obtain the similarity comparison results. Alternatively, unsupervised algorithms (such as TF-IDF) can be used to calculate the similarity between information in a knowledge graph and extracted keywords.
[0111] In this embodiment, Pointwise Mutual Information (PMI) can be used to calculate the similarity between information in the knowledge graph and the extracted keywords. PMI measures the similarity between two things (e.g., two words); a larger PMI indicates a higher similarity between the two things, and vice versa. The specific implementation process for comparing the similarity between information in the knowledge graph and the extracted keywords will be described in subsequent embodiments.
[0112] In the above implementation, the text to be processed is acquired, its text type is identified, and then a knowledge graph corresponding to the text type is determined based on the text type. Keywords are extracted from the text, and the information in the knowledge graph is compared with the extracted keywords for similarity. Based on the comparison results, the target keywords of the text to be processed are determined. This method utilizes the text type of the text to be processed to determine a knowledge graph corresponding to the domain of the text type. Then, by comparing the similarity between the knowledge graph and the keywords in the text, accurate target keywords highly relevant to the domain of the text to be processed can be extracted, improving the accuracy of keyword extraction.
[0113] against Figure 2 The specific implementation process of S208 in the illustrated embodiment is as follows: Figure 3 As shown, Figure 3 The flowchart illustrates a first target keyword determination method according to an embodiment of this application, which specifically includes the following steps:
[0114] S302. Determine the reference words corresponding to entity information and attribute information in the knowledge graph.
[0115] S304. The extracted keywords are compared with each reference word in turn to obtain the keyword similarity.
[0116] S306. If the similarity is greater than or equal to the first preset threshold, then the keyword is determined as the target keyword.
[0117] In this embodiment, reference words refer to the words or phrases that entity information and attribute information point to in the knowledge graph corresponding to the text to be processed. Since the basic unit of the knowledge graph is a triple description rule consisting of "entity"-"relation"-"entity" or "entity"-"attribute"-"attribute value", and each "entity" and "attribute" points to a word or phrase, the words or phrases attached to the "entity" and "attribute" can be used as reference words to compare their similarity with the keywords in the text to be processed.
[0118] The reference words corresponding to entity information and attribute information in the knowledge graph are determined as follows: Based on the triple description rules ("entity"-"relationship"-"entity" or "entity"-"attribute"-"attribute value") used as the basic unit to describe the relationship between entities and attributes in the knowledge graph, the entity information and attribute information are determined accordingly using the triple description rules. Based on the entity information and attribute information, multiple corresponding words in the knowledge graph are determined and identified as reference words in the knowledge graph.
[0119] In one implementation, a corresponding regular expression can be set based on the triplet description rule. This regular expression is then used to retrieve reference words corresponding to entity and attribute information from the knowledge graph. In another implementation, multiple knowledge graph samples can be constructed, each based on a triplet description rule. A text recognition model is trained using these samples, and then the text recognition model is used to determine the reference words corresponding to entity and attribute information in the knowledge graph. The text recognition model can be a CNN (Convolutional Neural Network) or an RNN (Recurrent Neural Network), and is not limited thereto.
[0120] In one implementation, keywords and reference words in the text to be processed can be input into a preset neural network model for similarity comparison. Then, the similarity between each keyword in the text to be processed and the reference word in the knowledge graph is output. The higher the similarity, the greater the correlation between the keyword in the text to be processed and the knowledge graph corresponding to the text to be processed.
[0121] In this embodiment, pointwise mutual information (PMI) can be used to calculate the similarity between information in the knowledge graph and the extracted keywords. PMI can measure the degree of similarity between two words. The larger the PMI, the higher the similarity between the two things, and vice versa.
[0122] In one possible implementation of the embodiments of this specification, a similarity threshold is first preset as the first preset threshold. After the keywords in the text to be processed are extracted, the extracted keywords are compared with each reference word in turn to obtain the keyword comparison results. For example, the keyword extracted from the text to be processed is "hospital" and the reference word is "doctor". The probability of "hospital" appearing in the knowledge graph, the probability of "doctor" appearing in the knowledge graph, and the probability of "hospital" and "doctor" appearing in the knowledge graph at the same time are calculated respectively. Then, the similarity between the extracted keyword "hospital" and the reference word "doctor" is calculated using the PMI algorithm. If the similarity is greater than or equal to the first preset threshold, the keyword in the text to be processed is determined to be the target keyword. Specifically, the similarity between the keyword and the reference word can be calculated by the following formula (4):
[0123]
[0124] Where x and y represent different words; p(x) represents the probability of word x appearing in the text; p(y) represents the probability of word y appearing in the text; p(x,y) represents the probability of words x and y appearing in the text at the same time; the larger the PMI, the higher the similarity between x and y; conversely, the lower the similarity.
[0125] In the above implementation, reference words corresponding to entity information and attribute information in the knowledge graph are determined. Then, the extracted keywords are compared with each reference word in turn to obtain the keyword similarity. If the similarity is greater than or equal to a first preset threshold, the keyword is determined as the target keyword. By using the reference words corresponding to entity information and attribute information in the knowledge graph and comparing their similarity with keywords in the text to be processed, target keywords with a high degree of relevance to the domain of the text to be processed can be extracted, improving the accuracy of keyword extraction.
[0126] against Figure 3 After S302 in the illustrated embodiment, Figure 4 The flowchart illustrates a second method for determining target keywords according to an embodiment of this application, which specifically includes the following steps:
[0127] S402. Determine the reference words corresponding to entity information and attribute information in the knowledge graph.
[0128] S404. Match each reference word with the text to be processed, and extract the target reference words that appear in the text to be processed but are not keywords in the text to be processed as target keywords.
[0129] In this embodiment, if the target keywords in the text to be processed are extracted by simply comparing the similarity between the reference words corresponding to the entity information and attribute information of the knowledge graph and the keywords of the text to be processed, the extracted target keywords may be incomplete.
[0130] Therefore, in addition to using the reference words corresponding to the entity information and attribute information of the knowledge graph to compare similarity with the keywords of the text to be processed to extract target keywords, it is also necessary to match the reference words corresponding to the entity information and attribute information of the knowledge graph with the text to be processed, and then extract the target reference words that appear in the text to be processed but are not keywords in the text to be processed as the target keywords of the text to be processed.
[0131] In one possible implementation of the embodiments of this specification, after determining the content corresponding to multiple triplet description rules of the knowledge graph, and extracting the corresponding reference words based on entity information and attribute information, each reference word is matched with the overall text content of the text to be processed. Based on entity information and attribute information, target reference words that appear in the text to be processed but are not keywords in the text to be processed are extracted from the knowledge graph as target keywords. For example, after determining that the reference words for entity information and attribute information in the knowledge graph are "artificial intelligence", "machine training", and "neural network", the reference words are matched with the overall text content of the text to be processed. Based on the keyword matching results, the target reference word that appears in the text to be processed but is not a keyword in the text to be processed is selected as "neural network". Then, "neural network" is selected as the target keyword of the text to be processed, and the target keyword is extracted.
[0132] In the above embodiments, by matching each reference word with the text to be processed, target reference words that appear in the text to be processed but are not keywords in the text to be processed are extracted as target keywords. This method enables keyword extraction from the entire text content to be processed, resulting in more accurate and complete keyword extraction results.
[0133] against Figure 4 The specific implementation process of S404 in the illustrated embodiment is as follows: Figure 5 As shown, Figure 5 The flowchart illustrates a third method for determining target keywords according to an embodiment of this application, which specifically includes the following steps:
[0134] S502. Extract target reference words that appear in the text to be processed but are not keywords in the text to be processed.
[0135] S504. Input the target reference word into the pre-trained keyword recognition model to obtain the keyness of the target reference word.
[0136] S506. If the criticality is greater than or equal to the second preset threshold, then the target reference word is determined as the target keyword.
[0137] Keyword recognition model refers to any model that can identify the degree of keyness of keywords. It can use a trained neural network model to identify target reference words and thus obtain the keyness of the target keywords. For example, a large number of words or phrases carrying keyness labels can be used as a training sample set to train the neural network model. Each word or phrase in the training sample set can be obtained from a pre-established corpus. Then, each target reference word is input into the trained neural network model to obtain the keyness corresponding to each target reference word.
[0138] The keyness of the target reference word can also be calculated using the TF-IDF method. For example, first, the frequency (TF) of the target reference word in the text to be processed is calculated, which can be obtained by formula (1) above. Then, a text library containing content from various fields is preset as a corpus. Based on the corpus, the IDF of the text to be processed is calculated, which can be obtained by formula (2) above. Based on the TF of the target reference word and the IDF of the text to be processed, the TF-IDF of the target reference word in the text to be processed is calculated, which can be obtained by formula (3) above. The larger the TF-IDF, the higher the keyness of the target reference word in the text to be processed. This specification does not limit the types of keyword recognition models.
[0139] In this embodiment, after determining the reference words corresponding to the entity information and attribute information in the knowledge graph based on the keywords of the text to be processed, each reference word is matched with the text content of the entire text to be processed. Based on the keyword matching results, keywords that appear in the text to be processed but are not in the text to be processed are extracted from the reference words as target reference words. Then, the target reference words are input into the pre-trained keyword recognition model to obtain the keyness of the target reference words. If the keyness is greater than or equal to the second preset threshold, the target reference word is determined as the target keyword.
[0140] In one possible implementation of the embodiments of this specification, when the text type of the text to be processed is identified as artificial intelligence, the keywords of the text to be processed are then extracted as "artificial intelligence", "machine learning", "funds" and "costs".
[0141] Based on the text type of the text to be processed, the reference words for entity information and attribute information in the knowledge graph corresponding to the field of artificial intelligence are determined to be "artificial intelligence", "machine training", "neural network", "deep learning" and "model building".
[0142] Then, each reference word in the entity information and attribute information of the knowledge graph is matched with the text content of the entire text to be processed. Based on the matching results, the keyword that appears in the text to be processed but is not in the text to be processed is identified as "deep learning". In other words, "deep learning" and "model building" are identified as target reference words in the knowledge graph reference words.
[0143] Then, a keyness threshold is preset as the second preset threshold, where the second preset threshold is set to 5. The target reference words "deep learning" and "model building" are input into the pre-trained keyword recognition model, and the keyness of the target reference words in the entire text to be processed is calculated. That is, the keyness of "deep learning" is 8 and the keyness of "model building" is 5. The keyness of the target reference words "deep learning" and "model building" meets the condition of the preset keyness threshold (keyness is greater than or equal to the second preset threshold), that is, the target reference words "deep learning" and "model building" are determined as the target keywords of the text to be processed.
[0144] In the above embodiments, by matching each reference word with the text to be processed, keywords that appear in the text to be processed but are not in the text to be processed are extracted as target reference words. These target reference words are then input into a pre-trained keyword recognition model to obtain their criticality. If the criticality is greater than or equal to a second preset threshold, the target reference word is determined as the target keyword. This method enables keyword extraction from the entire text content of the text to be processed, resulting in more accurate and complete keyword extraction results.
[0145] against Figure 5 After S504 in the illustrated embodiment, Figure 6 The flowchart illustrates a fourth method for determining target keywords according to an embodiment of this application, which specifically includes the following steps:
[0146] S602. Input the target reference word into the pre-trained keyword recognition model to obtain the keyness of the target reference word.
[0147] S604. If the keyword importance is less than the second preset threshold, then delete the target reference word.
[0148] In this embodiment, the target reference word is input into the pre-trained keyword recognition model. After obtaining the keyness of the target reference word, if the keyness is less than the second preset threshold, it means that the extracted keyword that appears in the text to be processed but is not in the text to be processed has low importance in the text to be processed and cannot be used as the target keyword of the text to be processed. Therefore, the target reference word is deleted, so that the keyword extraction result is more accurate and complete.
[0149] In one possible implementation of the embodiments of this specification, the keywords of the text to be processed are "artificial intelligence", "machine learning", "funds", and "cost"; the reference words for entity information and attribute information in the knowledge graph are "artificial intelligence", "machine training", "neural network", "deep learning", "model building", and "robot model", respectively.
[0150] Based on each reference word, keyword matching is performed with the entire text content of the text to be processed. Based on the matching results, the target reference words are determined to be "deep learning", "model building", and "robot model".
[0151] Then, a keyness threshold is preset as a second preset threshold, where the second preset threshold is 5. The above target reference words are input into the pre-trained keyword recognition model, and the keyness of the above target reference words in the entire text to be processed is calculated. That is, the keyness of "deep learning" is 8, the keyness of "model building" is 5, and the keyness of "robot model" is 4. The keyness of the target reference word "robot model" does not meet the condition of the preset keyness threshold (keyness is greater than or equal to the second preset threshold), so the target reference word "robot model" is deleted. "Deep learning" and "model building" that meet the preset keyness threshold conditions are determined as the target keywords of the text to be processed.
[0152] In the above implementation, if the keyness is less than the second preset threshold, the target reference word is deleted. This method allows target reference words that do not meet the preset keyness threshold to be deleted, while retaining those that do meet the threshold as target keywords for the text to be processed, thus making the keyword extraction results more accurate and complete.
[0153] against Figure 3 After S304 in the illustrated embodiment, Figure 7 The flowchart illustrates a fifth method for determining target keywords according to an embodiment of this application, which specifically includes the following steps:
[0154] S702. The extracted keywords are compared with each reference word in turn to obtain the keyword similarity.
[0155] S704. If the similarity is less than the first preset threshold, then delete the keyword.
[0156] In this embodiment, after extracting keywords from the text to be processed, the keywords are compared with each reference word in turn. After obtaining the similarity between the keywords and each reference word, if the similarity is less than the first preset threshold, it means that the keywords extracted from the text to be processed have a low degree of correlation with the entity information and attribute information in the knowledge graph and cannot be used as the target keywords of the text to be processed. Therefore, the keyword is deleted, so that the keyword extraction results are more accurate and complete.
[0157] In one possible implementation of the embodiments of this specification, the keywords extracted from the text to be processed are "student", "middle school", "university", "investment cost" and "construction".
[0158] The reference words for entity information and attribute information in the knowledge graph were identified as "student", "student education", "school", and "educational resources".
[0159] Then, a similarity threshold is preset as the first preset threshold, which is 5.
[0160] The keywords in the text to be processed are compared with the reference words of entity information and attribute information in the knowledge graph corresponding to the education field. The similarity comparison results are as follows: "student" has a similarity of 10, "middle school" has a similarity of 6, "university" has a similarity of 5, "investment cost" has a similarity of 4, and "construction" has a similarity of 0. The keywords with similarity comparison results greater than or equal to the first preset threshold of 5 are "student", "middle school", and "university", and the keywords with similarity comparison results less than the first preset threshold of 5 are "investment cost" and "construction". The keywords "investment cost" and "construction" are then deleted from the text to be processed. Finally, "student", "middle school", and "university" are determined as the target keywords of the text to be processed, and the target keywords are extracted.
[0161] In the above implementation, the extracted keywords are compared with each reference word in turn to obtain the keyword similarity. If the similarity is less than a first preset threshold, the keyword is deleted. This method allows for the deletion of keywords in the text that do not meet the preset similarity threshold, while retaining keywords that do meet the threshold as target keywords for the text. This improves the accuracy of keyword extraction by extracting target keywords that are highly relevant to the domain of the text.
[0162] against Figure 2 The specific implementation process of S202 and S024 in the illustrated embodiment is as follows: Figure 8 As shown, Figure 8 The flowchart illustrates a method for determining a target vertical domain and knowledge graph according to an embodiment of this application, specifically including the following steps:
[0163] S802. Input the text to be processed into a pre-trained domain recognition model to obtain the target vertical domain to which the text to be processed belongs.
[0164] S804. Based on the target vertical domain, search the knowledge graph library that has been pre-established based on the vertical domain, and determine the knowledge graph corresponding to the target vertical domain.
[0165] Domain identification models are models that can identify the vertical domain to which the text to be processed belongs. In particular, domain identification models are trained on a pre-set neural network using sample texts carrying vertical domain labels.
[0166] In this embodiment, the training end can train the domain recognition model using the following method:
[0167] Domain recognition models can be BERT models. BERT is a pre-trained language model that, through training on a large amount of data, can acquire the meaning of keywords in sentences at multiple different levels.
[0168] First, obtain a large set of texts carrying vertical domain tags. The so-called vertical domain of text refers to the specific domains that the text is vertically subdivided into under a large domain. For example, if the large domain corresponding to the text content belongs to the health domain, then the vertical domain corresponding to the text content can be the wellness domain, the medical domain, the hygiene domain, etc.
[0169] After obtaining the text set carrying vertical domain labels, the preset keywords of all texts carrying vertical domain labels are also labeled with the corresponding vertical domain labels, and these preset keywords are used as the training sample set for the domain recognition model. For example, in a text carrying the vertical domain labels of "medical" and "health", the preset keywords are also labeled with the corresponding vertical domain labels, and this is used as the training sample set for the domain recognition model. For instance, if the preset keyword in the text is "hospital", then "hospital" is also labeled with the "medical" and "health" vertical domain labels, and "hospital" is used as the training sample set for the domain recognition model.
[0170] After labeling the preset keywords in all text sets carrying vertical domain labels with corresponding vertical domain labels, all preset keywords carrying vertical domain labels are used as the training sample set of the BERT model. Then, a portion of the preset keywords are randomly covered. By adjusting the model parameters, the BERT model is made to predict the covered preset keywords. After multiple iterations of training, the recognition accuracy finally reaches a preset threshold. The BERT model with the recognition accuracy reaching the preset threshold is used as the trained domain recognition model.
[0171] After the domain recognition model is trained, text without vertical domain labels is input into the domain recognition model, and the model can then identify the vertical domain corresponding to the text.
[0172] It should be noted that the domain recognition model is not limited to the BERT model. Any neural network model with text as input and text as output in the corresponding vertical domain can be used as the domain recognition model in this application. This application does not impose any restrictions on the type of domain recognition model.
[0173] The text type of the text to be processed includes the vertical domain to which the text belongs. The vertical domain to which the text belongs corresponds to a knowledge graph; one vertical domain to which a text belongs can correspond to one or more pre-defined knowledge graphs. The knowledge graph is pre-stored in a knowledge graph repository, which records the knowledge graphs corresponding to different vertical domains.
[0174] In this embodiment, the acquired text to be processed is input into a pre-trained domain recognition model to obtain the target vertical domain to which the text belongs. Then, based on the target vertical domain, a knowledge graph library pre-built based on the vertical domain is searched to determine the knowledge graph corresponding to the target vertical domain. The reason for using the target vertical domain to determine the knowledge graph corresponding to the target vertical domain is that the vertical domain of the text to be processed refers to the various specific domains vertically subdivided under a large domain. Therefore, the target vertical domain and the text content of the text to be processed have a strong correlation. By comparing the similarity between the knowledge graph determined by the target vertical domain to which the text belongs and the keywords in the text to be processed, accurate target keywords with a high degree of correlation with the domain to which the text belongs can be extracted, thereby improving the accuracy of keyword extraction.
[0175] In one possible implementation of the embodiments of this specification, a preset neural network is first trained using sample texts carrying vertical domain labels. For example, a set of training sample texts carrying entertainment domain labels, medical domain labels, education domain labels, and artificial intelligence domain labels can be used to train the convolutional neural network model. After multiple iterations of training, the convolutional neural network model whose recognition accuracy reaches a preset threshold is finally used as the trained domain recognition model.
[0176] After obtaining the text to be processed, it can be input into a pre-trained domain recognition model. If the target vertical domain of the text to be processed is "artificial intelligence", then according to the target vertical domain, the knowledge graph corresponding to "artificial intelligence" can be found in the knowledge graph library stored in the server data. There can be one or more knowledge graphs corresponding to "artificial intelligence".
[0177] After obtaining the knowledge graph corresponding to the vertical domain of the text to be processed, the keywords in the text to be processed are extracted. Then, the reference words corresponding to the entity information and attribute information in the knowledge graph are compared with the extracted keywords in the text to be processed. Based on the comparison results, the target keywords in the text to be processed are determined.
[0178] By using the above method, the text to be processed is input into a pre-trained domain recognition model, which can determine the knowledge graph corresponding to the domain to which the text type belongs. Then, the similarity between the knowledge graph and the keywords in the text to be processed is compared, thereby extracting accurate target keywords that are highly related to the domain to which the text to be processed belongs, thus improving the accuracy of keyword extraction.
[0179] The following is in conjunction with the appendix Figure 9 Taking the keyword extraction method provided in this application to conference papers in the field of artificial intelligence as an example, the keyword extraction method will be further explained. Among other things, Figure 9 This application provides a flowchart illustrating a keyword extraction method for conference papers according to an embodiment of the present application, which specifically includes the following steps:
[0180] S902: Obtain conference papers;
[0181] S904: Use a pre-trained neural network model to identify conference papers in the field of artificial intelligence and obtain the text type of the conference paper;
[0182] The papers presented at this conference are in the field of artificial intelligence.
[0183] S906: Determine the corresponding knowledge graph based on the text type of the conference paper;
[0184] For example, the knowledge graph corresponding to the field of artificial intelligence is: Artificial Intelligence – Methods – Machine Learning, Machine Learning – Includes – Deep Learning, Neural Networks – Includes – Convolutional Neural Networks, Convolutional Neural Networks – Structure – Hidden Layers, Convolutional Layers – Front and Back Structures – Activation Layers.
[0185] S908: Extract keywords from the conference paper using the term frequency-inverse text frequency method;
[0186] For example, the keywords extracted from the conference papers are: artificial intelligence, neural network, convolutional neural network, and convolutional layer.
[0187] S910: Based on the entity information and attribute information of the keywords, extract target reference words from the knowledge graph that appear in the text to be processed but are not keywords in the text to be processed.
[0188] For example, based on the entity information of the keywords "artificial intelligence", "neural network", "convolutional neural network", "convolutional layer" and the attribute information "method", "encompassing", "structure", "preceding structure", the target reference words extracted from the knowledge graph are: machine learning, hidden layer, activation layer.
[0189] S912: Input the target reference word into the pre-trained keyword recognition model and use the word frequency-inverse text frequency method to calculate the keyness of the target reference word;
[0190] For example, the keyness of the target reference word is calculated as follows: Machine Learning 8, Hidden Layer 6, Activation Layer 2.
[0191] S914: If the keyness is greater than or equal to the keyness preset threshold, then the target reference word is determined as the target keyword;
[0192] For example, the keyness preset threshold is 5, and the target reference words "machine learning" and "hidden layer" with keyness greater than the keyness preset threshold are retained as target keywords.
[0193] S916: If the key score is less than the preset key score threshold, delete the target reference word;
[0194] Delete the target reference word "activation layer" whose keyness is less than the preset keyness threshold.
[0195] S918: Calculate the similarity between each target keyword and its corresponding target reference word sequentially using the point mutual information method to obtain the similarity of each target keyword;
[0196] For example, the similarity between each target keyword and each target reference word is calculated sequentially using the point mutual information method. The similarity between the target keyword "artificial intelligence" and the target reference word "machine learning" is 78%, and the similarity between the target keyword "convolutional neural network" and the target reference word "hidden layer" is 43%.
[0197] S920: If the similarity is greater than or equal to the preset similarity threshold, the target keyword will be retained;
[0198] For example, the similarity preset threshold is 50%, and the keyword "artificial intelligence" with a similarity greater than the similarity preset threshold is determined as the target keyword.
[0199] S922: If the similarity is less than the preset similarity threshold, then delete the target keyword;
[0200] For example, the keyword "convolutional neural network" with a similarity score less than a preset similarity threshold is deleted.
[0201] S924: Obtain the target keywords that remain after two deletions.
[0202] The target keyword that was retained is "artificial intelligence".
[0203] The keyword extraction method for conference papers provided in this application utilizes a pre-trained neural network model to identify the conference paper's text type. Based on this text type, a corresponding knowledge graph is determined. Since the knowledge graph contains multiple reference words, it lays the foundation for subsequent target keyword identification. Keywords in the conference paper are extracted using a term frequency-inverse text frequency (TIF) method. Based on the entity and attribute information of the keywords, target reference words that appear in the text to be processed but are not keywords in the text itself are extracted from the knowledge graph, ensuring the accuracy of the extracted keywords. Simultaneously, the accuracy and completeness of the target reference words are guaranteed. The pre-trained keyword recognition model uses the TIF-inverse text frequency method to calculate the keyness of the reference words, filtering the target reference words and ensuring the accuracy of subsequent comparisons between keywords and target reference words. Finally, the point mutual information method is used to sequentially calculate the similarity between the keywords and each target reference word, filtering the target keywords and retaining accurate target keywords with a high degree of relevance to the domain of the text to be processed, thus improving the accuracy of the final target keywords.
[0204] Corresponding to the above method embodiments, this application also provides embodiments of keyword extraction devices. Figure 10 A schematic diagram of a keyword extraction device according to an embodiment of this application is shown. Figure 10 As shown, the device includes:
[0205] The recognition module 1002 is configured to acquire the text to be processed and identify the text type of the text to be processed;
[0206] The knowledge graph determination module 1004 is configured to determine the knowledge graph corresponding to the text type based on the text type.
[0207] Extraction module 1006 is configured to extract keywords from the text to be processed;
[0208] The target keyword determination module 1008 is configured to compare the similarity between the information in the knowledge graph and the extracted keywords, and determine the target keywords of the text to be processed based on the comparison results.
[0209] Optionally, the information in the knowledge graph includes entity information and attribute information;
[0210] The target keyword determination module 1008 is further configured as follows:
[0211] Identify the reference words corresponding to entity information and attribute information in the knowledge graph;
[0212] The extracted keywords are compared with each reference word in turn to obtain the keyword similarity.
[0213] If the similarity is greater than or equal to the first preset threshold, then the keyword is determined to be the target keyword.
[0214] Optionally, the target keyword determination module 1008 is further configured as follows:
[0215] Entity and attribute information in knowledge graphs are determined using triplet description rules.
[0216] Based on entity information and attribute information, multiple corresponding words in the knowledge graph are identified and designated as reference words in the knowledge graph.
[0217] Optionally, the target keyword determination module 1008 is further configured as follows:
[0218] Each reference word is matched with the text to be processed, and target reference words that appear in the text to be processed but are not keywords in the text to be processed are extracted as target keywords.
[0219] Optionally, the target keyword determination module 1008 is further configured as follows:
[0220] Extract target reference words that appear in the text to be processed but are not keywords in the text to be processed;
[0221] Input the target reference word into a pre-trained keyword recognition model to obtain the keyness of the target reference word;
[0222] If the criticality is greater than or equal to the second preset threshold, then the target reference word is determined as the target keyword.
[0223] Optionally, the target keyword determination module 1008 is further configured as follows:
[0224] If the keyword importance is less than the second preset threshold, then the target reference word is deleted.
[0225] Optionally, the target keyword determination module 1008 is further configured as follows:
[0226] If the similarity is less than the first preset threshold, the keyword will be deleted.
[0227] Optionally, the text type includes the vertical domain to which the text belongs;
[0228] The recognition module 1002 is further configured as follows:
[0229] The text to be processed is input into a pre-trained domain recognition model to obtain the target vertical domain to which the text to be processed belongs. The domain recognition model is obtained by training a pre-set neural network using sample texts carrying vertical domain labels.
[0230] The knowledge graph determination module 1004 is further configured as follows:
[0231] Based on the target vertical domain, search the knowledge graph library that has been built in advance based on the vertical domain to determine the knowledge graph corresponding to the target vertical domain. The knowledge graph library records the knowledge graphs corresponding to different vertical domains.
[0232] The keyword extraction device provided in this application acquires the text to be processed, identifies the text type of the text, then determines the corresponding knowledge graph based on the text type, extracts keywords from the text to be processed, compares the information in the knowledge graph with the extracted keywords for similarity, and determines the target keywords of the text to be processed based on the comparison results. Through this method, by utilizing the text type of the text to be processed, a knowledge graph corresponding to the domain to which the text type belongs can be determined. Then, by comparing the similarity between the knowledge graph and the keywords in the text to be processed, accurate target keywords with a high degree of relevance to the domain to which the text to be processed can be extracted, thus improving the accuracy of keyword extraction.
[0233] The above is a schematic scheme of a keyword extraction device according to this embodiment. It should be noted that the technical solution of this keyword extraction device and the technical solution of the aforementioned keyword extraction method belong to the same concept. Details not described in detail in the technical solution of the keyword extraction device can be found in the description of the technical solution of the aforementioned keyword extraction method. Furthermore, the components in the device embodiment should be understood as functional modules necessary to implement each step of the program flow or each step of the method; these functional modules are not actual functional divisions or separations. A device claim defined by such a set of functional modules should be understood as a functional module architecture that primarily implements the solution through the computer program described in the specification, and not as a physical device that primarily implements the solution through hardware.
[0234] Figure 11 A structural block diagram of a computing device 1100 according to an embodiment of this application is shown. The components of the computing device 1100 include, but are not limited to, a memory 1110 and a processor 1120. The processor 1120 is connected to the memory 1110 via a bus 1130, and a database 1150 is used to store data.
[0235] The computing device 1100 also includes an access device 1140, which enables the computing device 1100 to communicate via one or more networks 1160. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 1140 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Controller (NIC)), such as an IEEE 802.11 Wireless Local Area Networks (WLAN) wireless interface, a Wi-MAX (World Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0236] In one embodiment of this application, the aforementioned components of the computing device 1100 and Figure 11 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 11 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.
[0237] The computing device 1100 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 1100 can also be a mobile or stationary server.
[0238] The processor 1120 is used to execute computer-executable instructions for the keyword extraction method.
[0239] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the keyword extraction method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the keyword extraction method described above.
[0240] An embodiment of this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, are used for a keyword extraction method.
[0241] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the keyword extraction method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the keyword extraction method described above.
[0242] This application discloses a chip that stores computer instructions, which, when executed by a processor, implement the steps of the keyword extraction method described above.
[0243] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0244] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0245] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0246] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0247] The preferred embodiments disclosed above are merely illustrative of this application. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this application. These embodiments are selected and specifically described in this application to better explain the principles and practical applications of this application, thereby enabling those skilled in the art to better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.
Claims
1. A keyword extraction method, characterized in that, include: Obtain the text to be processed and identify the text type of the text to be processed; Based on the text type, determine the knowledge graph corresponding to the text type; Extract keywords from the text to be processed; The information in the knowledge graph is compared with the extracted keywords, and the target keywords of the text to be processed are determined based on the comparison results. Extract target reference words that appear in the text to be processed but are not keywords in the text to be processed; The target reference word is input into a pre-trained keyword recognition model to obtain the keyness of the target reference word; If the keyness is greater than or equal to the second preset threshold, then the target reference word is determined as the target keyword.
2. The method according to claim 1, characterized in that, The information in the knowledge graph includes entity information and attribute information; The step of comparing the information in the knowledge graph with the extracted keywords and determining the target keywords of the text to be processed based on the comparison results includes: Determine the reference words corresponding to the entity information and attribute information in the knowledge graph; The extracted keywords are compared with each reference word in turn to obtain the similarity of the keywords; If the similarity is greater than or equal to a first preset threshold, then the keyword is determined to be the target keyword.
3. The method according to claim 2, characterized in that, After determining the reference words corresponding to the entity information and attribute information in the knowledge graph, the method further includes: Each reference word is matched with the text to be processed, and target reference words that appear in the text to be processed but are not keywords in the text to be processed are extracted as target keywords.
4. The method according to claim 1, characterized in that, After inputting the target reference word into a pre-trained keyword recognition model to obtain the keyness of the target reference word, the method further includes: If the keyness is less than the second preset threshold, then the target reference word is deleted.
5. The method according to any one of claims 2-3, characterized in that, After comparing the extracted keywords with each reference word in turn to obtain the similarity score of the keywords, the method further includes: If the similarity is less than the first preset threshold, then the keyword is deleted.
6. The method according to any one of claims 1-3, characterized in that, The text type includes the vertical domain to which the text belongs; The identification of the text type of the text to be processed includes: The text to be processed is input into a pre-trained domain recognition model to obtain the target vertical domain to which the text to be processed belongs. The domain recognition model is obtained by training a preset neural network using sample texts carrying vertical domain labels. The step of determining the knowledge graph corresponding to the text type includes: Based on the target vertical domain, a knowledge graph library pre-established based on the vertical domain is searched to determine the knowledge graph corresponding to the target vertical domain. The knowledge graph library records knowledge graphs corresponding to different vertical domains.
7. A keyword extraction device, characterized in that, include: The recognition module is configured to acquire the text to be processed and identify the text type of the text to be processed; The knowledge graph determination module is configured to determine the knowledge graph corresponding to the text type based on the text type. The extraction module is configured to extract keywords from the text to be processed; The target keyword determination module is configured as follows: The information in the knowledge graph is compared with the extracted keywords, and the target keywords of the text to be processed are determined based on the comparison results. Extract target reference words that appear in the text to be processed but are not keywords in the text to be processed; The target reference word is input into a pre-trained keyword recognition model to obtain the keyness of the target reference word; If the keyness is greater than or equal to the second preset threshold, then the target reference word is determined as the target keyword.
8. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the keyword extraction method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing computer instructions, characterized in that, When executed by the processor, this instruction implements the steps of the keyword extraction method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Text analysis method and related equipment
CN110096573A
Text key information extraction method and device, equipment and storage medium
CN113282763A