Method for constructing criticality judgment model for keyword extraction
By constructing a criticality judgment model, combining subdomain type and word form syntax information, the problem of insufficient keyword extraction accuracy in the existing technology is solved, and a more efficient keyword extraction effect is achieved.
Patent Information
- Application Number
- CN202411174395.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-08-26
AI Technical Summary
The existing keyword extraction methods have not yet systematically analyzed and integrated the interactive relationship between different subdomains and word keywords, and have failed to effectively distinguish the syntactic, semantic, chapter and other levels of word keywords, resulting in insufficient keyword extraction accuracy.
Build a criticality judgment model, including candidate keyword recognition model and criticality representation model, and use neural network training to combine subdomain types, word form syntax information, heuristic features and representative features to share criticality judgments within the language community. Improve the accuracy of keyword extraction.
The accuracy and efficiency of keyword extraction are significantly improved. Through the mutual transmission influence of independent and dependent characteristics, the community-shared key characteristics are simulated, ensuring the accurate sorting and extraction of keywords.
Smart Images

Figure CN119150854A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of keyword extraction, and more specifically, relates to a method for constructing a criticality judgment model for keyword extraction. Background Art
[0002] Keyword extraction methods can extract important keywords from documents, allowing readers to quickly understand the core content of the document. Therefore, they are widely used in fields such as information retrieval, text classification, and text clustering. Keyword extraction is essentially a ranking problem, not a classification problem (Jiang et al. 2009; Zhang et al. 2017). Taking keyword extraction as a ranking task is to construct a function that maps the features of candidate keywords to key scores (i.e., the probability of becoming a keyword).
[0003] The latest literature shows a trend of introducing neural networks into ranking tasks. Sarkar et al. (2010) trained a multilayer perceptron neural network using a feature set consisting of the frequency, IDF, length, and position information of candidate keywords. Mu et al. (2020) first obtained the candidate keyword basis on BERT, extracted the feature vector of the candidate keyword using Bi-LSTM, and then ranked the candidates using a fully connected feedforward network with a sigmoid activation function. Xiong et al. (2019) used word embedding, position embedding, and visual features (such as position, font size, and HTML-DOM features) to represent candidate keywords, applied a neural network based on the convolutional Transformer architecture to model the interactions between words within the candidate keywords, and used a feedforward layer to rank the candidate keywords.
[0004] However, the existing keyword extraction methods have not yet clarified the interactive relationship between different sub-domains and word criticality in theory, have not yet systematically analyzed and integrated the statistical information of syntactic, semantic, and discourse features that distinguish word criticality, and have not yet found an effective general method for keyword extraction applicable to each sub-domain. The accuracy of keyword extraction still cannot meet the needs of various applications and needs further research. Summary of the invention
[0005] In view of the defects and improvement needs of the prior art, the present invention provides a method for constructing a criticality judgment model for keyword extraction, which aims to improve the accuracy of keyword extraction.
[0006] To achieve the above object, according to one aspect of the present invention, a method for constructing a criticality judgment model for keyword extraction is provided, comprising:
[0007] Construct a candidate keyword recognition model: The model is obtained by training a neural network based on a training sample set, wherein each training sample includes a feature corresponding to an N-gram substring and a label indicating whether the N-gram substring is a keyword in the text in which it is located; each N-gram substring is a word fragment composed of n consecutive words in the text in which it is located; the feature corresponding to each N-gram substring is the word form and syntax information of the N-gram substring obtained by judging the syntactic integrity;
[0008] Construct a key characterization model for candidate keywords: The model is obtained by training a neural network based on a training sample set, where each training sample includes an independent key feature and a dependent key feature corresponding to a candidate keyword t and the key label of the candidate keyword; the independent key feature includes the subdomain type τ D and the candidate keyword length ι t , the dependent key features include heuristic features Unique Features and representative features The criticality representation model is expressed as
[0009] The candidate keyword recognition model and the criticality representation model constitute a criticality judgment model to complete the construction, wherein the criticality judgment model is shared within the language community to which the training text belongs.
[0010] Furthermore, the specific training method of the candidate keyword recognition model is:
[0011] S1. Construct a training sample set, including a positive sample set and a negative sample set. Each sample includes a feature vector corresponding to an N-ary substring and a label indicating whether the N-ary substring is a keyword in the target text. The number of positive samples and the number of negative samples are both p.
[0012] S2. Iteratively train the neural network recognition model based on the current training sample set. When the number of iterations reaches the round threshold, re-acquire p negative samples to form a new negative sample set; use the neural network recognition model obtained by the current training to identify and delete the positive samples from the new negative sample set to obtain an updated negative sample set; the updated negative sample set and the positive sample set constitute a new training sample set; repeat this step based on the new training sample set until the iteration termination condition is obtained, and the training of the candidate keyword recognition model is completed.
[0013] Furthermore, the network structure of the candidate keyword recognition model includes four parts:
[0014] The first part is an embedding layer, which is used to convert the input morphological and syntactic features into an embedded form; the second part includes two convolutional layers, two maximum pooling layers and a Transformer encoder, which are used to capture morphological and syntactic patterns; the third part includes two linear layers and a non-linear activation layer, which are used to convert morphological and syntactic patterns into binary probability vectors, wherein the binary probability vector includes a structure-incomplete probability i-prob and a structure-intact probability w-prob; the fourth part is a recognition unit, which is used to calculate the difference ω=(w-prob)-(i-prob) between the structure-intact probability and the structure-incomplete probability in the binary probability vector corresponding to each N-ary substring, and take the N-ary substring corresponding to ω greater than 0 as a candidate keyword.
[0015] Furthermore, the specific training method of the key degree representation model of the candidate keywords is:
[0016] S1. Construct a training sample set, including a positive sample set and a negative sample set. Each sample includes an independent key feature and a dependent key feature corresponding to a candidate keyword and a key label of the candidate keyword in the text in which it is located. The key label of the positive sample is 1, the key label of the negative sample is 0, and the number of negative samples is θ times the number of positive samples p.
[0017] S2. Iteratively train the neural network ranking model based on the current training sample set. When the number of iterations reaches the round threshold, use the sampling method to re-acquire p×θ negative samples to form a new negative sample set; use the neural network ranking model obtained by the current training to identify and delete the positive samples from the new negative sample set to obtain an updated negative sample set; the updated negative sample set and the positive sample set constitute a new training sample set; repeat this step based on the new training sample set until the iteration termination condition is obtained, and the training of the neural network recognition model is completed.
[0018] Furthermore, the network structure of the key degree representation model of the candidate keywords includes:
[0019] The first part consists of two embedding layers and a dot product unit. The two embedding layers are used to convert the sub-domain type and the candidate keyword length into an embedding form respectively. The dot product unit is used to perform dot products between the dependent key features and the embedding forms of the sub-domain type and the candidate keyword length.
[0020] The second part includes two Transformer encoders, three convolutional layers, and three pooling layers to capture critical information;
[0021] The third part includes a linear layer, which is used to calculate the negative criticality score N-score and the positive criticality score P-score corresponding to each candidate keyword based on the criticality information, and take the difference between the positive criticality score and the negative criticality score corresponding to each candidate keyword r = (P-score) - (N-score) as the criticality of the candidate keyword.
[0022] Further, the heuristic features include: capitalization key value, first occurrence position key value, frequency key value, and contextual diversity key value;
[0023] The unique features include: TF-IDF key value, effective difference key value, word uniqueness key value;
[0024] The representative features include: divergence, word-based personalized centrality index, and topic-based centrality index.
[0025] Further, the case key value It is expressed as: In the formula, n is the number of times the candidate keyword t appears in the text where it is located, t i is the i-th instance of the candidate keyword t in the text where it is located, M t is the number of words in the candidate keyword t, that is, the value of the number N corresponding to the candidate keyword t; t i The number of capitalized words in the
[0026] The first occurrence position key value It is expressed as: In the formula, is the first occurrence position of candidate keyword t in D, N S,D is the total number of sentences in D;
[0027] The frequency key value It is expressed as: Where n t is the frequency of candidate keyword t, is the average frequency of the N-tuple substrings to which the candidate keyword t belongs, σ ngram is the standard deviation of the N-ary substrings to which the candidate keyword t belongs;
[0028] The TF-IDF key values TF-IDF It is expressed as: Where D| is the number of texts in the reference corpus used to construct the training sample set, d j is the jth text in the reference corpus containing the candidate keyword t;
[0029] The effective difference key value s effect-size It is expressed as: In the formula, is the probability of candidate keyword t in D, is the probability of candidate keyword t in the reference corpus;
[0030] The divergence s sentence-dispersion It is expressed as: In the formula, C t is the number of sentences in which the candidate keyword t appears in D, N D is the number of sentences appearing in D;
[0031] The personalized centrality index based on words is obtained by means of a graph, including position sorting key values, TF-IDF sorting key values, word sorting key values and simple sorting key values;
[0032] The topic-based centrality index is obtained by graph calculation, including eigenvector centrality score, closeness centrality score and betweenness centrality score.
[0033] The present invention also provides a keyword extraction method, comprising:
[0034] The target text is subjected to normalization and dependency syntactic analysis in turn to generate a list of N-gram substrings, each of which is a word fragment consisting of n consecutive words in the target text;
[0035] Obtaining the criticality judgment model of the language community to which the target text belongs constructed by the method described above, and using the candidate keyword recognition model therein to recognize candidate keywords from the N-gram substring list, each candidate keyword being an N-gram substring;
[0036] Calculate the independent key features and dependent key features described in the above method for each candidate keyword;
[0037] Adopting the criticality representation model in the criticality judgment model based on the criticality of each candidate keyword;
[0038] The candidate keywords are ranked based on their criticality, and keyword extraction is completed based on the ranking results and in combination with actual needs.
[0039] Furthermore, it also includes:
[0040] Cluster all candidate keywords;
[0041] According to the maximum criticality of the candidate keywords in each class, the categories are sorted. Based on the sorting results and combined with actual needs, the candidate keywords corresponding to the maximum criticality in the first k classes are determined as the final keyword extraction results.
[0042] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above method when executed by a processor.
[0043] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:
[0044] (1) The present invention regards supervised keyword extraction as a keyword ranking task, proposes the assertion that the language community shares the key judgment model, and based on this, proposes a formal model for the ranking task, namely, an implementation framework based on a convolutional neural network. Furthermore, the key judgment model proposed by the present invention includes a candidate keyword recognition model and a key characterization model. Regarding the key characterization model, it is creatively designed as That is, given a candidate keyword t in document D, its criticality The calculation depends on two types of features: independent features and dependent features. Independent features affect dependent features, and the value of dependent features will change along the dimension of independent features. The above formula specifies two types of independent features: subdomain type (τ D ) and candidate keyword length ( t ), they have a mutually transitive influence on the three types of dependent features (indicated by the multiplication sign x). The three types of dependent features are: heuristic features Unique Features and representative features The present invention theoretically proposes the above-mentioned criticality judgment model, which is based on the criticality calculation of the model and is shared in a specific language community for use in segmenting keywords in texts. This method of simulating the criticality representation model shared by the community through a neural network greatly improves the accuracy and efficiency of keyword extraction.
[0045] (2) The present invention also proposes a training strategy based on positive sample label missing learning related research. Since whether a keyword is a keyword is the result of an individual's subjective judgment, the training set inevitably contains unlabeled positive samples, that is, candidate keywords that another individual may identify as keywords. Based on this, the positive sample label missing learning method proposed in this preferred method ensures the accuracy of model training. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A flowchart of a method for constructing a criticality judgment model for keyword extraction provided by an embodiment of the present invention;
[0047] Figure 2 A result diagram of a candidate keyword recognition model provided by an embodiment of the present invention;
[0048] Figure 3A structural diagram of a criticality representation model of candidate keywords provided in an embodiment of the present invention;
[0049] Figure 4 The overall framework diagram of keyword extraction provided by the embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0051] Embodiment 1
[0052] A method for constructing a criticality judgment model for keyword extraction, such as Figure 1 As shown, including:
[0053] Construct a candidate keyword recognition model: construct a training sample set, each training sample includes a feature corresponding to an N-ary substring and a label indicating whether the N-ary substring is a keyword in the text in which it is located; the feature corresponding to each N-ary substring is the syntactic semantic information of the N-ary substring obtained based on syntactic semantic integrity; train a neural network based on the training sample set to obtain a candidate keyword recognition model; each N-ary substring is a word fragment composed of n consecutive words in the text in which it is located; n is any integer from 1 to m, and m is preferably 4, and the n values corresponding to different training samples in the training sample set may be different;
[0054] Construct a key characterization model for candidate keywords: Construct a training sample set, each of which includes an independent key feature and a dependent key feature corresponding to a candidate keyword t and a key label of the candidate keyword; wherein the independent key feature includes the subdomain type τ D and the candidate keyword length ι t , the dependent key features include heuristic features Unique Features and representative features Based on the training sample set, the neural network is trained to obtain the criticality representation model, which is expressed as
[0055] The candidate keyword recognition model and the candidate keyword criticality representation model constitute a criticality judgment model, which is shared within the language community of the training text.
[0056] This embodiment regards supervised keyword extraction as a keyword ranking task, proposes a language community shared criticality judgment model, and based on this, proposes a formal model for the ranking task, that is, an implementation framework based on a convolutional neural network. Furthermore, regarding the criticality representation model, this embodiment creatively designs it as Given a candidate keyword t in document D, its criticality The calculation depends on two types of features: independent features and dependent features. Independent features affect dependent features, and the value of dependent features will change along the dimension of independent features. The above formula specifies two types of independent features: subdomain type (τ D ) and candidate keyword length ( t ), they have a mutually transitive influence on the three types of dependent features (indicated by the multiplication sign x). The three types of dependent features are: heuristic features Unique Features and representative features
[0057] Existing keyword extraction does not classify features, nor does it have a macro-holistic understanding of the role of various features (theoretically lacking). This embodiment theoretically proposes a key judgment model, which is based on the key calculation of the model and is shared in a specific language community to distinguish which words in the text are keywords and which are not. The method of this embodiment simulates the key representation model shared by the community through a neural network method, which greatly improves the accuracy and efficiency of keyword extraction.
[0058] As a preferred implementation, the specific training method of the candidate keyword recognition model is:
[0059] S1. Construct a training sample set, including a positive sample set and a negative sample set, each training sample includes a feature vector corresponding to an N-ary substring and a label indicating whether the N-ary substring is a keyword in the text in which it is located; the number of positive samples and the number of negative samples are both p; further, it can be preferred that the feature vector corresponding to each N-ary substring is m four-tuple feature groups, if n=m, then the m four-tuple feature groups are composed of the four-tuple feature groups of each word in the N-ary substring, if n is less than m, then n four-tuple feature groups in the m four-tuple feature groups are composed of the four-tuple feature groups of each word in the N-ary substring, and each four-tuple feature group in the remaining mn four-tuple feature groups is filled with a default label; wherein the four-tuple feature group of each word is composed of part of speech, case, whether it is a stop word, and dependency type;
[0060] S2. Iteratively train the neural network recognition model based on the current training sample set. When the number of iterations reaches the round threshold, re-acquire p negative samples to form a new negative sample set; use the neural network recognition model obtained by the current training to identify and delete the positive samples from the new negative sample set to obtain an updated negative sample set; the updated negative sample set and the positive sample set constitute a new training sample set; repeat this step based on the new training sample set until the iteration termination condition is obtained, and the training of the candidate keyword recognition model is completed.
[0061] The feature of each word is a four-tuple:
[0062] <Part of speech, capitalization, whether to use stop words, dependency type>
[0063] For example, the list of symbols for the triple string Atlantic hurricane season is as follows:
[0064] <NNP,UPPER-CASE,NOT-STOP,amod> ,
[0065] <NN,LOWER-CASE,NOT-STOP,compound> ,
[0066] <NN,LOWER-CASE,NOT-STOP,nsubj> ,
[0067] <UNK,UNK,UNK,UNK> ]
[0068] Among them, NNP and NN are word classes, amod, compound and nsubj are syntactic dependency types, and UNK is a filler tag.
[0069] Since whether a keyword is a keyword is the result of an individual's subjective judgment, the training set inevitably contains unlabeled positive samples, that is, candidate keywords that another individual may identify as keywords. Based on this, this preferred method proposes a training strategy based on related research on positive sample label missing learning (Positive Unlabelled Learning) to ensure training accuracy.
[0070] It can be used as a preferred embodiment, such as Figure 2 As shown in the figure, the network structure of the candidate keyword recognition model consists of four parts:
[0071] The first part is an embedding layer, which is used to convert morphological and syntactic features into an embedded form; the second part includes two convolutional layers, two maximum pooling layers and a Transformer encoder, which are used to capture morphological and syntactic patterns; the third part includes two linear layers and a non-linear activation layer, which are used to convert morphological and syntactic patterns into binary probability vectors, wherein the binary probability vectors include a structure-incomplete probability i-prob and a structure-complete probability w-prob; the fourth part is a recognition unit, which is used to calculate the difference ω between the structure-complete probability and the structure-incomplete probability in the binary probability vector corresponding to each N-ary substring, and when ω is greater than 0, the N-ary substring is used as a candidate keyword.
[0072] As a preferred implementation, the specific training method of the key characterization model of candidate keywords is:
[0073] S1. Construct a training sample set, including a positive sample set and a negative sample set. Each training sample includes a feature vector corresponding to a candidate keyword and a key label of the N-ary substring in the text in which it is located. The key label of the positive sample is 1, which is a real keyword. The key label of the negative sample is 0. The number of negative samples is θ times the number of positive samples p.
[0074] S2. Iteratively train the neural network ranking model based on the current training sample set. When the number of iterations reaches the round threshold, re-acquire p×θ negative samples to form a new negative sample set; use the neural network ranking model obtained by the current training to identify and delete positive samples from the new negative sample set to obtain an updated negative sample set; the updated negative sample set and the positive sample set constitute a new training sample set; repeat this step based on the new training sample set until the iteration termination condition is obtained, and complete the construction of the neural network recognition model.
[0075] The same as the training of the candidate keyword recognition model, since whether a keyword is a keyword is the result of an individual's subjective judgment, the training set inevitably contains unlabeled positive samples, that is, candidate keywords that another individual may identify as keywords. Based on this, this preferred method proposes a training strategy based on related research on positive sample label missing learning (Positive Unlabelled Learning) to ensure training accuracy.
[0076] It can be used as a preferred embodiment, such as Figure 3 As shown in FIG. 1 , the network structure of the key degree representation model of candidate keywords includes:
[0077] The first part consists of two embedding layers and a dot product unit. The two embedding layers are used to convert the sub-domain type and the candidate keyword length into an embedding form respectively. The dot product unit is used to perform dot products between the dependent key features and the embedding forms of the sub-domain type and the candidate keyword length.
[0078] The second part includes two Transformer encoders, three convolutional layers, and three pooling layers to capture critical information;
[0079] The third part includes a linear layer, which is used to calculate the negative criticality score N-score and the positive criticality score P-score corresponding to each candidate keyword; and calculate the difference r = (P-score) - (N-score) between the positive criticality score and the negative criticality score in the tuple corresponding to each candidate keyword as the criticality of the candidate keyword.
[0080] Depend on Figure 3 The neural network shown is executed. As shown in the formula As mentioned above, the influence of independent features on dependent features is Figure 3 The embedding of the subdomain type and the length of the candidate keyword, as well as the dot product between the remaining 17 dependent key-value feature vectors, are then encoded using the positional encoding method proposed in Vaswanietal. (2017). Two Transformer Encoders, three convolutional layers, and three pooling layers in the neural network are used to capture the key-degree pattern. The last linear layer (dimensionality reduction) outputs a tuple consisting of a negative key-degree score (N-score) and a positive key-degree score P-score, from which the final key-degree score is calculated as follows: r = P-score-N-score.
[0081] The above-mentioned various features proposed by the method of this embodiment are described as follows:
[0082] (1) Independent key features include subdomain type τ D and the candidate keyword length ι t .
[0083] On the Subregister Type τ D , changes in subdomain types lead to changes in the properties of several key features. Ranking by degree should involve a top-down cognitive process that brings expectations about the content and structure of the text type. Domain-specific algorithms can generate better keywords than general algorithms. Keyword extraction systems need to be parameterized according to different text types, because term length limits, stop word lists, and the number of keywords are different in different text types.
[0084] About the length of candidate keywords t,The length of candidate keywords is an independent feature because the length of a word is related to its position, morphological-syntactic form, and feature statistical distribution. Word length is important in keyword extraction. The distribution of keywords varies along the length dimension, and bigram keywords dominate in several sub-language domains. TF-IDF provides very robust performance on different datasets. Many keyword extraction algorithms differ in identifying keywords of different lengths. Setting the right length for keywords is as important as other design choices (such as weighting schemes). Length is an important but often overlooked factor for keywords.
[0085] (2) Dependent key features include heuristic features Unique Features and representative features As a preferred implementation method, the heuristic features include: case key values, first occurrence position key values, frequency key values, and context diversity key values; the uniqueness features include: TF-IDF key values, effective difference key values, word uniqueness key values; representative features include: divergence, word-based personalized centrality indicators, and topic-based centrality indicators.
[0086] Regarding heuristic features, heuristic features are derived from empirical observations. This embodiment uses four indicators as heuristic features: capitalization key value, first occurrence position key value, frequency key value, and context diversity key value. Among them,
[0087] Case is important in keyword extraction because many keywords are capitalized terms. In addition, terms can be combined with lowercase words to form new keywords. In this embodiment, the case key value (hcase) is obtained by calculating the average capitalization percentage of all t instances in the text D. It is expressed as: In the formula, n is the number of times the candidate keyword t appears in the text where it is located, t i is the i-th instance of the candidate keyword t in the text where it is located, M t is the number of words in the candidate keyword t, that is, the value of the number N corresponding to the candidate keyword t; t i The number of capitalized words in the text.
[0088] The position of a word in a document is an important key indicator. The first occurrence key value is preferred. It is expressed as: In the formula, is the first occurrence position of candidate keyword t in D, N S,D is the total number of sentences in D.
[0089] Frequency is another important key indicator, but their relationship is not proportional. This embodiment is based on the word length of the candidate keyword, such as one-word string, two-word string, three-word string and four-word string. The frequency key value It is expressed as: Where n t is the frequency of candidate keyword t, is the average frequency of the N-tuple substrings to which the candidate keyword t belongs, σ ngram is the standard deviation of the N-ary substrings to which the candidate keyword t belongs.
[0090] Term context diversity is referred to as the relevance of a term to its context. The intuitive idea is that terms with more diverse contexts are less likely to be keywords.
[0091] Regarding the uniqueness feature, this embodiment preferably uses three indicators to measure the uniqueness of a candidate keyword in a specific document compared with other documents, namely, the TF-IDF key value, the effective difference key value and the vocabulary-specific key value.
[0092] This embodiment distinguishes different types of substrings, such as unigram substrings, unigram substrings, ternary substrings, and quaternary substrings, and calculates the TF-IDF key value using the following formula: Where |D| is the number of texts in the reference corpus used to construct the training sample set, d j is the jth text in the reference corpus containing the candidate keyword t.
[0093] The effective difference key value is calculated using KL divergence and is expressed as: In the formula, is the probability of candidate keyword t in D, is the probability of candidate keyword t in the reference corpus. KL divergence has a good foundation in information theory and has little correlation with frequency.
[0094] Lexical specificity is defined as the negative logarithm of the hypergeometric distribution, defined as follows: Among them, P hypergeo is the probability that t appears exactly k times in D, based on the number of words in the document (N D ), the frequency of words in the document (f D ), the frequency of the word in the reference corpus (f R )) and the number of words in the reference corpus (N R ) is calculated using the hypergeometric distribution parameterized by . Since the hypergeometric distribution represents the discrete probability of k successes in n draws without replacement, a lower probability of a word appearing at a frequency of k in a document means a higher specificity score.
[0095] Regarding representative features, representative features refer to the ability of candidate keywords to summarize the content of documents compared with other words. Two subtypes are used to measure representativeness: divergence and centrality.
[0096] Divergence refers to the uniformity of a word's occurrence in the entire document. sentence-dispersion It is expressed as: In the formula, C t is the number of sentences in which the candidate keyword t appears in D, N D is the number of sentences appearing in D.
[0097] In keyword extraction, centrality is mainly captured by graph-based methods. This embodiment distinguishes two types of centrality indicators: personalized centrality indicators based on words and (referred to as personalized indicators) and centrality indicators based on topics (referred to as topic indicators). Personalized indicators are calculated using a graph constructed with all candidate keywords as nodes and co-occurrence within sentences as the standard for establishing connections. The nodes are then personalized and scored using the first appearance position score, TF-IDF score, lexical specificity, or the default value of 1 (no scoring), and the nodes are sorted to obtain position sorting key values, TF-IDF sorting key values, word sorting key values, and simple sorting key values.
[0098] About topic indicators. To build a graph from documents, candidate keywords are first clustered into groups. Each group is then used as a node in the graph, and connections between nodes are established through intra-sentence co-occurrences of terms in the group. This embodiment preferably uses three topic-based centrality scores: eigenvector centrality score, closeness centrality score, and betweenness centrality score.
[0099] Both eigenvector centrality and closeness centrality fall under the category of radial centrality, while betweenness centrality falls under the category of medial centrality. The centrality measured by radial centrality makes sense in a network with the core-periphery assumption. Therefore, closeness centrality and eigenvector centrality are good ways to measure keywords in a document that are consistent with a topic.
[0100] Embodiment 2
[0101] A keyword extraction method, comprising:
[0102] The target text is subjected to normalization and dependency syntactic analysis in turn to generate a list of N-gram substrings, each of which is a word fragment consisting of n consecutive words in the target text;
[0103] Obtaining a criticality judgment model of the language community to which the target text belongs constructed by the method described in Example 1, and using the candidate keyword recognition model therein to recognize candidate keywords from the N-gram substring list, each candidate keyword being an N-gram substring;
[0104] Calculate the independent key features and dependent key features described in the above method for each candidate keyword;
[0105] Adopt the criticality representation model in the criticality judgment model based on the criticality of each candidate keyword;
[0106] Sort each candidate keyword based on its criticality, and complete keyword extraction based on the sorting results and actual needs.
[0107] As a preferred embodiment, it also includes:
[0108] Cluster all candidate keywords;
[0109] According to the maximum criticality of the candidate keywords in each class, the categories are sorted. Based on the sorting results and combined with actual needs, the candidate keywords corresponding to the maximum criticality in the first k classes are determined as the final keyword extraction results.
[0110] like Figure 1 The overall implementation framework of this embodiment is given. The framework processes input documents through preprocessing, candidate keyword generation, candidate keyword criticality characterization, sorting, etc., and outputs sorted keyword clusters for further processing. The preprocessing component normalizes the input document and performs syntactic analysis on it using a dependency syntax analyzer. The candidate keyword generation component generates N-gram strings from the input document, uses a convolutional network model to identify candidate keywords in the generated N-gram strings, and clusters these candidates into clusters. The criticality characterization component obtains the criticality feature pattern of the candidate keyword words, and then uses a convolutional network to characterize the criticality.
[0111] First, the document is normalized, URLs, bullets (symbols used to indicate lists), and various types of tags are replaced with specific tags, fancy (unconventional) quotation marks are replaced with equivalent ASCII tags, and extra hyphens and spaces are deleted (uncommon symbols are deleted or replaced to ensure improved word segmentation accuracy). Then, a dependency parser is used to perform dependency syntactic analysis on the document to obtain syntactic information, including part of speech, case, dependency type, and whether it is a stop word.
[0112] When clustering the identified candidate keywords, the SentenceTransformer model can be first used to represent the candidate keywords as phrase embeddings, and the similarity calculation method between phrase embeddings is cosine, and then the hierarchical clustering method is used for clustering. This preferred method outputs not terms with ranking scores, but clustered candidate keyword clusters, with the highest ranking score contained in the candidate keyword cluster as the ranking score of the cluster. Therefore, this preferred method outputs key concepts represented by keyword clusters, rather than keywords, so that the keyword extraction results are more accurate.
[0113] The relevant technical solution is the same as that in Embodiment 1 and will not be described in detail here.
[0114] Embodiment 3
[0115] A computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the storage medium is located is controlled to execute the method described in the first embodiment above.
[0116] The relevant technical solution is the same as that in Embodiment 1 and will not be described in detail here.
[0117] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for constructing a criticality judgment model for keyword extraction, It is characterized in that include: Construct a candidate keyword recognition model: The model is obtained by training a neural network based on a training sample set, wherein each training sample includes a feature corresponding to an N-gram substring and a label indicating whether the N-gram substring is a keyword in the text in which it is located; each N-gram substring is a word fragment composed of n consecutive words in the text in which it is located; the feature corresponding to each N-gram substring is the word form and syntax information of the N-gram substring obtained by judging the syntactic integrity; Construct a key characterization model for candidate keywords: The model is obtained by training a neural network based on a training sample set, where each training sample includes an independent key feature and a dependent key feature corresponding to a candidate keyword t and the key label of the candidate keyword; the independent key feature includes the subdomain type τ D and the candidate keyword length ι t , the dependent key features include heuristic features Unique Features and representative features The criticality representation model is expressed as The candidate keyword recognition model and the criticality representation model constitute a criticality judgment model to complete the construction, wherein the criticality judgment model is shared within the language community to which the training text belongs.
2. According to the criticality judgment model construction method of claim 1, It is characterized in that The specific training method of the candidate keyword recognition model is: S1. Construct a training sample set, including a positive sample set and a negative sample set, each sample including a feature vector corresponding to an N-ary substring and a label indicating whether the N-ary substring is a keyword in the target text; The number of positive samples and the number of negative samples are both p; S2. Iteratively train the neural network recognition model based on the current training sample set. When the number of iterations reaches the round threshold, re-acquire p negative samples to form a new negative sample set; use the neural network recognition model obtained by the current training to identify and delete the positive samples from the new negative sample set to obtain an updated negative sample set; the updated negative sample set and the positive sample set constitute a new training sample set; repeat this step based on the new training sample set until the iteration termination condition is obtained, and the training of the candidate keyword recognition model is completed.
3. According to the criticality judgment model construction method of claim 2, It is characterized in that The network structure of the candidate keyword recognition model includes four parts: The first part is the embedding layer, which is used to convert the input morphological and syntactic features into an embedded form; The second part includes two convolutional layers, two maximum pooling layers and a Transformer encoder, which are used to capture morphological syntactic patterns; the third part includes two linear layers and a non-linear activation layer, which are used to convert morphological syntactic patterns into binary probability vectors, wherein the binary probability vectors include a structure-incomplete probability i-prob and a structure-intact probability w-prob; the fourth part is a recognition unit, which is used to calculate the difference ω=(w-prob)-(i-prob) between the structure-intact probability and the structure-incomplete probability in the binary probability vector corresponding to each N-ary substring, and take the N-ary substring corresponding to ω greater than 0 as a candidate keyword.
4. According to the criticality judgment model construction method of claim 1, It is characterized in that The specific training method of the key degree representation model of the candidate keywords is: S1. Construct a training sample set, including a positive sample set and a negative sample set. Each sample includes an independent key feature and a dependent key feature corresponding to a candidate keyword and a key label of the candidate keyword in the text in which it is located. The key label of the positive sample is 1, the key label of the negative sample is 0, and the number of negative samples is θ times the number of positive samples p. S2, iteratively train the neural network ranking model based on the current training sample set, when the number of iterations reaches the round threshold, use the sampling method to re-acquire p×θ negative samples to form a new negative sample set; use the neural network ranking model obtained by the current training to identify and delete positive samples from the new negative sample set to obtain an updated negative sample set; the updated negative sample set and the positive sample set constitute a new training sample set; This step is repeated based on the new training sample set until the iteration termination condition is obtained, thus completing the training of the neural network recognition model.
5. According to the criticality judgment model construction method of claim 4, It is characterized in that The network structure of the key degree representation model of the candidate keywords includes: The first part consists of two embedding layers and a dot product unit. The two embedding layers are used to convert the sub-domain type and the candidate keyword length into an embedding form respectively. The dot product unit is used to perform dot products between the dependent key features and the embedding forms of the sub-domain type and the candidate keyword length. The second part includes two Transformer encoders, three convolutional layers, and three pooling layers to capture critical information; The third part includes a linear layer, which is used to calculate the negative criticality score N-score and the positive criticality score P-score corresponding to each candidate keyword based on the criticality information, and take the difference between the positive criticality score and the negative criticality score corresponding to each candidate keyword r = (P-score) - (N-score) as the criticality of the candidate keyword.
6. According to the criticality judgment model construction method of claim 1, It is characterized in that The heuristic features include: case key value, first occurrence position key value, frequency key value, and context diversity key value; The unique features include: TF-IDF key value, effective difference key value, word uniqueness key value; The representative features include: divergence, word-based personalized centrality index, and topic-based centrality index.
7. The method for constructing a criticality judgment model according to claim 6, It is characterized in that The case key value It is expressed as: In the formula, n is the number of times the candidate keyword t appears in the text where it is located, t i is the i-th instance of the candidate keyword t in the text where it is located, M t is the number of words in the candidate keyword t, that is, the value of the number N corresponding to the candidate keyword t; t i The number of capitalized words in the The first occurrence position key value It is expressed as: In the formula, is the first occurrence position of candidate keyword t in D, N S,D is the total number of sentences in D; The frequency key value It is expressed as: Where n t is the frequency of candidate keyword t, is the average frequency of the N-tuple substrings to which the candidate keyword t belongs, σ ngram is the standard deviation of the N-ary substrings to which the candidate keyword t belongs; The TF-IDF key values TF-IDF It is expressed as: Where |D| is the number of texts in the reference corpus used to construct the training sample set, d j is the jth text in the reference corpus containing the candidate keyword t; The effective difference key value s effect-size It is expressed as: In the formula, is the probability of candidate keyword t in D, is the probability of candidate keyword t in the reference corpus; The divergence s sentence-dispersion It is expressed as: In the formula, C t is the number of sentences in which the candidate keyword t appears in D, N D is the number of sentences appearing in D; The personalized centrality index based on words is obtained by means of a graph, including position sorting key values, TF-IDF sorting key values, word sorting key values and simple sorting key values; The topic-based centrality index is obtained by graph calculation. Includes eigenvector centrality score, closeness centrality score, and betweenness centrality score.
8. A keyword extraction method, It is characterized in that include: The target text is subjected to normalization and dependency syntactic analysis in turn to generate a list of N-gram substrings, each of which is a word fragment consisting of n consecutive words in the target text; Obtaining a criticality judgment model of the language community to which the target text belongs constructed by the criticality judgment model construction method according to any one of claims 1 to 7, and using the candidate keyword recognition model therein to recognize candidate keywords from the N-gram substring list, each candidate keyword being an N-gram substring; Calculating the independent key features and the dependent key features of each candidate keyword as described in the method for constructing a key degree judgment model as described in any one of claims 1 to 7; Adopting the criticality representation model in the criticality judgment model based on the criticality of each candidate keyword; The candidate keywords are ranked based on their criticality, and keyword extraction is completed based on the ranking results and in combination with actual needs.
9. A keyword extraction method according to claim 8, It is characterized in that Also includes: Cluster all candidate keywords; According to the maximum criticality of the candidate keywords in each class, the categories are sorted. Based on the sorting results and combined with actual needs, the candidate keywords corresponding to the maximum criticality in the first k classes are determined as the final keyword extraction results.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method for constructing a criticality judgment model as described in any one of claims 1 to 7 and / or the method for extracting keywords as described in any one of claims 8 to 9 are implemented.
Citation Information
Patent Citations
Keyword extraction method integrating theme information and bidirectional LSTM
CN109933804A
Theme information extraction method of government affair text and storage medium
CN115455155A
Knowledge extraction method based on multi-semantic features
CN115688752A
Keyword extraction method and device and medium
CN117852538A
Automatic keyword extraction method and apparatus, and device and storage medium
WO2023060795A1
Cited By
Open source software license clause detection method based on graph neural network
CN120930112A
A Method for Detecting Open Source Software License Terms Based on Graph Neural Networks
CN120930112B
