Keyword determination method and device
By combining feature extraction models, language models and bidirectional long short-term memory networks, the problem of poor keyword extraction in existing technologies is solved, and more accurate and efficient keyword determination is achieved.
Patent Information
- Application Number
- CN202011639019.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2040-12-31
AI Technical Summary
The keyword extraction methods in the existing technology fail to effectively utilize the feature information of sentences and have weak generalization capabilities, resulting in poor keyword extraction results. In addition, both supervised and unsupervised methods have their own defects, high labor costs or insufficient generalization and transfer capabilities.
By receiving the sentences to be processed, the keyword dictionary is obtained, and the dictionary features, part-of-speech features and sentence features are obtained using the feature extraction model and language model. The keywords are determined by combining the bidirectional long short-term memory network and the conditional random field algorithm.
It achieves more accurate keyword extraction, expands the differentiation between keywords and non-keywords, and improves the accuracy and efficiency of keyword extraction.
Smart Images

Figure CN114692610B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a keyword determination method and apparatus, a computing device, and a computer-readable storage medium. Background Art
[0002] With the continuous development of electronic information technology and the increasing popularity of electronic resources, the amount of data in these resources is also increasing. Therefore, finding the required information from this massive amount of data and classifying and searching it are particularly important. To better classify data and facilitate data search and statistics, labels or index terms are generally extracted from sentences. These words that can identify the content of a sentence are called keywords.
[0003] Existing keyword extraction mainly obtains semantic information through a pre-trained feature extraction model, directly uses the feature representation of the sentence as the word embedding feature, and obtains the final output through a linear network. It does not effectively utilize other feature information of the sentence, has weak generalization ability, and has poor keyword extraction effect. Summary of the Invention
[0004] In view of this, embodiments of the present application provide a keyword determination method and apparatus, a computing device, and a computer-readable storage medium to address the technical deficiencies in the prior art.
[0005] According to a first aspect of an embodiment of the present application, a keyword determination method is provided, comprising:
[0006] Receive a statement to be processed and obtain a keyword dictionary corresponding to the statement to be processed;
[0007] Obtaining dictionary features of the keyword dictionary based on a feature extraction model, obtaining sentence features of the sentence to be processed based on a language model, and performing part-of-speech tagging on the sentence to be processed to obtain part-of-speech features corresponding to the part of speech of the sentence to be processed;
[0008] Keywords in the sentence to be processed are determined based on the dictionary features, the part-of-speech features, and the sentence features.
[0009] Optionally, after receiving the statement to be processed and before obtaining the keyword dictionary corresponding to the statement to be processed, the method further includes:
[0010] Determining attribute information of the statement to be processed, and obtaining a sample statement having at least one attribute information identical to that of the statement to be processed;
[0011] Sample keywords are extracted from the sample sentences, and a keyword dictionary corresponding to the sentence to be processed is constructed based on the sample keywords.
[0012] Optionally, after extracting sample keywords from the sample sentences and constructing a keyword dictionary corresponding to the sentences to be processed based on the sample keywords, the method further includes:
[0013] A keyword extraction rule is determined based on the sample keywords extracted from the sample sentences.
[0014] Optionally, obtaining dictionary features of the keyword dictionary based on a feature extraction model includes:
[0015] Determining a word vector for each keyword in the keyword dictionary based on the word vector table;
[0016] The word vectors of all keywords in the keyword dictionary are input into a feature extraction model to obtain dictionary features of the keyword dictionary.
[0017] Optionally, obtaining sentence features of the sentence to be processed based on the language model includes:
[0018] Obtaining a word vector for each word in the sentence to be processed by position encoding;
[0019] The word vectors of all words in the sentence to be processed are input into a language model to obtain sentence features of the sentence to be processed.
[0020] Optionally, the performing part-of-speech tagging on the sentence to be processed to obtain a part-of-speech feature corresponding to the part of speech of the sentence to be processed includes:
[0021] Performing part-of-speech tagging on the sentence to be processed based on a preset part-of-speech tagging tool to obtain a part-of-speech representation of the sentence to be processed;
[0022] Initialize the part-of-speech representation of the sentence to be processed to obtain the part-of-speech feature of the sentence to be processed.
[0023] Optionally, determining the keywords in the sentence to be processed based on the dictionary features, the part-of-speech features, and the sentence features includes:
[0024] fusing the dictionary features, the part-of-speech features, and the sentence features to obtain initial features of the sentence to be processed, and inputting the initial features into a first bidirectional long short-term memory network to obtain candidate features of the sentence to be processed;
[0025] Performing attention calculation on the candidate features and the dictionary features based on a preset algorithm to obtain an attention value of the sentence to be processed, and inputting the attention value into a second bidirectional long short-term memory network to obtain a target feature of the sentence to be processed;
[0026] The target features of the sentence to be processed are input into a keyword extraction model to obtain keywords in the sentence to be processed.
[0027] Optionally, inputting the attention value into a second bidirectional long short-term memory network to obtain a target feature of the sentence to be processed includes:
[0028] Inputting the attention value into a second bidirectional long short-term memory network, and multiplying the attention value by the candidate feature in the second bidirectional long short-term memory network to obtain a correlation feature between the word in the sentence to be processed and the keyword dictionary;
[0029] The correlation feature is output through the second bidirectional long short-term memory network to obtain the target feature of the sentence to be processed.
[0030] Optionally, after obtaining the keywords in the sentence to be processed, the method further includes:
[0031] The keywords in the sentence to be processed are modified based on the keyword dictionary and the keyword extraction rule.
[0032] Optionally, the feature extraction model includes a convolutional neural network model, the language model includes a BERT model, and the keyword extraction model includes a conditional random field algorithm model.
[0033] According to a second aspect of an embodiment of the present application, a keyword determination device is provided, including:
[0034] A statement receiving module is configured to receive a statement to be processed and obtain a keyword dictionary corresponding to the statement to be processed;
[0035] a feature acquisition module configured to obtain dictionary features of the keyword dictionary based on a feature extraction model, obtain sentence features of the sentence to be processed based on a language model, and perform part-of-speech tagging on the sentence to be processed to obtain part-of-speech features corresponding to the part of speech of the sentence to be processed;
[0036] The keyword determination module is configured to determine keywords in the sentence to be processed based on the dictionary features, the part-of-speech features, and the sentence features.
[0037] Optionally, the device further includes:
[0038] The dictionary building module is configured as follows:
[0039] Determining attribute information of the statement to be processed, and obtaining a sample statement having at least one attribute information identical to that of the statement to be processed;
[0040] Sample keywords are extracted from the sample sentences, and a keyword dictionary corresponding to the sentence to be processed is constructed based on the sample keywords.
[0041] Optionally, the device further includes:
[0042] The rule determination module is configured to:
[0043] A keyword extraction rule is determined based on the sample keywords extracted from the sample sentences.
[0044] Optionally, the feature acquisition module is further configured to:
[0045] Determining a word vector for each keyword in the keyword dictionary based on the word vector table;
[0046] The word vectors of all keywords in the keyword dictionary are input into a feature extraction model to obtain dictionary features of the keyword dictionary.
[0047] Optionally, the feature acquisition module is further configured to:
[0048] Obtaining a word vector for each word in the sentence to be processed by position encoding;
[0049] The word vectors of all words in the sentence to be processed are input into a language model to obtain sentence features of the sentence to be processed.
[0050] Optionally, the feature acquisition module is further configured to:
[0051] Performing part-of-speech tagging on the sentence to be processed based on a preset part-of-speech tagging tool to obtain a part-of-speech representation of the sentence to be processed;
[0052] Initialize the part-of-speech representation of the sentence to be processed to obtain the part-of-speech feature of the sentence to be processed.
[0053] Optionally, the keyword determination module is further configured to:
[0054] fusing the dictionary features, the part-of-speech features, and the sentence features to obtain initial features of the sentence to be processed, and inputting the initial features into a first bidirectional long short-term memory network to obtain candidate features of the sentence to be processed;
[0055] Performing attention calculation on the candidate features and the dictionary features based on a preset algorithm to obtain an attention value of the sentence to be processed, and inputting the attention value into a second bidirectional long short-term memory network to obtain a target feature of the sentence to be processed;
[0056] The target features of the sentence to be processed are input into a keyword extraction model to obtain keywords in the sentence to be processed.
[0057] Optionally, the keyword determination module is further configured to:
[0058] Inputting the attention value into a second bidirectional long short-term memory network, and multiplying the attention value by the candidate feature in the second bidirectional long short-term memory network to obtain a correlation feature between the word in the sentence to be processed and the keyword dictionary;
[0059] The correlation feature is output through the second bidirectional long short-term memory network to obtain the target feature of the sentence to be processed.
[0060] Optionally, the device further includes:
[0061] The correction module is configured to correct the keywords in the sentence to be processed based on the keyword dictionary and the keyword extraction rule.
[0062] Optionally, the feature extraction model includes a convolutional neural network model, the language model includes a BERT model, and the keyword extraction model includes a conditional random field algorithm model.
[0063] According to a third aspect of an embodiment of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the keyword determination method when executing the instructions.
[0064] According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, which stores computer instructions, and when the instructions are executed by a processor, the steps of the keyword determination method are implemented.
[0065] The embodiment of the present application provides the keyword determination method and device, wherein the keyword determination method includes receiving a sentence to be processed and obtaining a keyword dictionary corresponding to the sentence to be processed; obtaining the dictionary features of the keyword dictionary based on a feature extraction model, and obtaining the sentence features of the sentence to be processed based on a language model, and performing part-of-speech tagging on the sentence to be processed to obtain the part-of-speech features corresponding to the part-of-speech of the sentence to be processed; and determining the keywords in the sentence to be processed based on the dictionary features, the part-of-speech features, and the sentence features. Specifically, the keyword determination method uses a pre-trained language model as a feature extraction tool for the sentence to be processed, and adds rich underlying information such as part-of-speech features and dictionary features to expand the differentiation of words, so that the difference between keywords and non-keywords in the sentence to be processed is clearer, so that the keywords in the sentence to be processed can be obtained more accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1is a structural block diagram of a computing device provided in an embodiment of the present application;
[0067] Figure 2 This is a flowchart of a keyword determination method provided by an embodiment of the present application;
[0068] Figure 3 This is a specific processing flow chart of a keyword determination method provided by an embodiment of the present application;
[0069] Figure 4 It is a structural diagram of a keyword determination device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] The following description sets forth many specific details to facilitate a thorough understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of the present application. Therefore, the present application is not limited to the specific implementations disclosed below.
[0071] The terms used in one or more embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include 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 the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0072] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of the present application, first may also be referred to as second, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "in response to determining."
[0073] First, the terms involved in one or more embodiments of the present invention are explained.
[0074] Keyphrase Extraction: Keyphrase extraction, where a keyphrase is a phrase composed of keywords. The phrase has richer semantics and can more comprehensively summarize the content theme. Whether it is text-based recommendation or text-based search, there is a heavy reliance on text keyphrases. The accuracy of keyphrase extraction is directly related to the final effect of the recommendation system or search system. In the existing technology, supervised keyphrase extraction algorithms, unsupervised keyphrase extraction algorithms, and semi-supervised keyphrase extraction algorithms can be used.
[0075] BERT (Bidirectional Encoder Representations from Transformers) is a bidirectional encoder representation based on the Transformer. The BERT model is based on the Transformer and is derived from the concept of attention is all you need. The bidirectional design means that when processing a word, it can take into account information about the preceding and following words to capture the contextual semantics.
[0076] Glove word vector: Global Vectors for Word Representation, based on the co-occurrence information between words, assuming that the element X ij is the number of times word j appears in the context of word i. "Context" can be defined in a variety of ways. For example, in a text sequence, if word j appears no more than 10 words to the left or right of word i, we consider word j to appear in the context of word i once.
[0077] LAC: Lexical Analysis of Chinese, a lexical analysis tool, can perform Chinese word segmentation, part-of-speech tagging, proper name recognition, and other functions. In specific use, it uses a deep learning model to jointly learn word segmentation, part-of-speech tagging, and proper name recognition tasks, with an overall F1 value exceeding 0.91, a part-of-speech tagging F1 value exceeding 0.94, and a proper name recognition F1 value exceeding 0.85, demonstrating excellent results. Furthermore, by streamlining model parameters and combining the performance optimization of the Paddle prediction library, the CPU single-thread performance reaches 800QPS, demonstrating good efficiency. It also implements a simple and controllable intervention mechanism to accurately match the user's dictionary to intervene in the model. The dictionary supports long snippets, making intervention more precise. It supports one-click installation and provides Python, Java, and C++ calling interfaces and examples for fast calling and integration. Furthermore, the customized ultra-lightweight model is only 2MB in size, and its single-thread performance reaches 200QPS on mainstream 1,000-yuan mobile phones, meeting the needs of most mobile applications.
[0078] CCN: Convolutional Neural Networks, a type of feedforward neural network with a deep structure that includes convolution calculations, is one of the representative algorithms of deep learning. In this application, the character-level features corresponding to each word are obtained through CNN network encoding.
[0079] Attention Mechanism: The attention mechanism is a means of dealing with information overload. Specifically, it pays different attention to different areas of an image or related words in a sentence. Usually, a lot of attention is allocated to the part of interest.
[0080] LSTM (Long Short-Term Memory) is a time-recurrent neural network and a special type of RNN. It is designed to address the vanishing and exploding gradient problems during long sequence training. Compared to ordinary RNNs, LSTM performs better on longer sequences.
[0081] CRF (Conditional Random Field) is a probabilistic graphical model based on Markov properties. It combines the characteristics of the maximum entropy model and the hidden Markov model. It is an undirected graphical model that has achieved excellent results in sequence labeling tasks such as word segmentation, part-of-speech tagging, and named entity recognition. The conditional random field is a typical discriminant model. Its joint probability can be expressed as the product of several potential functions, the most commonly used of which is the linear chain conditional random field.
[0082] Sequence Tagging: Sequence tagging can be used to solve a series of character classification problems, such as word segmentation, part-of-speech tagging, named entity recognition, relationship extraction, etc. Commonly used models include: Hidden Markov Model (HMM), Conditional Random Field (CRF), BiLSTM+CRF.
[0083] One-hot encoding: This is a process of converting categorical variables into a form that can be easily used by machine learning algorithms by representing them as binary vectors. This is a word feature representation method in natural language processing (NLP). Each word is represented as a vector whose length is equal to the vocabulary size. The position corresponding to the current word is 1, and all other positions are 0.
[0084] Existing keyword extraction is mainly divided into supervised and unsupervised extraction methods. Unsupervised extraction methods are widely used because they do not require data annotation. They mainly include statistical methods based on TF-IDF (term frequency–inverse document frequency), topic model methods based on LDA (Latent Dirichlet Allocation), graph network methods based on TextRank (text ranking), and methods that utilize word embedding information such as characters, grammar, and semantics. Supervised extraction methods require training on labeled datasets and mainly include machine learning algorithms based on SVM (support vector machines) and CRF, deep learning methods based on RNN (Recurrent Neural Network) and CNN, and methods that obtain extraction results by fine-tuning pre-trained feature extraction models and connecting shallow networks for training.
[0085] However, unsupervised keyword extraction methods lack a standard dataset and rely primarily on the calculation of quantitative feature indicators without understanding semantic information. Consequently, keyword extraction accuracy is low and high-quality text is required, resulting in high keyword extraction costs. While supervised methods can effectively leverage semantic information and word dependency information for keyword extraction, they require significant effort to label data, resulting in high labor costs. They also lack generalization and transfer capabilities and interpretability. Furthermore, the underlying features used are insufficient, resulting in limited differentiation and unclear distinctions between keywords and non-keywords, leading to inaccurate keyword extraction.
[0086] Based on this, in order to solve the above technical problems, in this application, a keyword determination method and apparatus, a computing device and a computer-readable storage medium are provided, which are described in detail one by one in the following embodiments.
[0087] Figure 1 1 shows a block diagram of a computing device 100 according to an embodiment of the present application. Components of the computing device 100 include, but are not limited to, a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and a database 150 is used to store data.
[0088] The computing device 100 also includes an access device 140 that enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of network interface (e.g., a network interface card (NIC)), whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0089] In one embodiment of the present application, the above components of the computing device 100 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 1 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0090] The computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 100 may also be a mobile or stationary server.
[0091] The processor 120 may execute Figure 2 The steps in the keyword determination method are shown. Figure 2 A flowchart of a keyword determination method provided according to an embodiment of the present application is shown, which specifically includes the following steps.
[0092] Step 202: Receive a sentence to be processed, and obtain a keyword dictionary corresponding to the sentence to be processed.
[0093] The sentences to be processed include but are not limited to sentences in any field with keywords to be extracted, such as sentences in the medical field, the financial field, or the communication field with keywords to be extracted.
[0094] If the statement to be processed is a statement in the financial field, "What problems still exist in my country's business environment?", then the statement to be processed is received, and a keyword dictionary corresponding to the statement to be processed is obtained. This can be understood as receiving the statement to be processed, "What problems still exist in my country's business environment?", and obtaining a keyword dictionary corresponding to the statement to be processed, "What problems still exist in my country's business environment?"
[0095] Specifically, after receiving the statement to be processed and before obtaining the keyword dictionary corresponding to the statement to be processed, the method further includes:
[0096] Determining attribute information of the statement to be processed, and obtaining a sample statement having at least one attribute information identical to that of the statement to be processed;
[0097] Sample keywords are extracted from the sample sentences, and a keyword dictionary corresponding to the sentence to be processed is constructed based on the sample keywords.
[0098] The attribute information of the statement to be processed includes but is not limited to the field information, statement length, and semantic information corresponding to the statement to be processed. Continuing with the above example, the attribute information of the statement to be processed is: financial field.
[0099] Taking the attribute information of the statement to be processed as the field corresponding to the statement to be processed as an example, after determining the field of the statement to be processed, multiple sample sentences with the same field as the statement to be processed are obtained, and then sample keywords in each sample sentence are extracted, and a keyword dictionary corresponding to the statement to be processed is constructed based on the sample keywords.
[0100] In specific implementation, the sample sentences are sentences with the same attribute information as the sentence to be processed. Continuing with the above example, the sample sentences are multiple different sample sentences in the financial field. After obtaining multiple sample sentences, the keywords in each sample sentence are extracted based on the manually labeled data, and a keyword dictionary for the financial field is constructed based on the extracted keywords.
[0101] In addition, taking the example of the attribute information of the sentence to be processed being the sentence length corresponding to the sentence to be processed, after determining the sentence length of the sentence to be processed, multiple sample sentences with the same sentence length as the sentence to be processed are obtained, and then sample keywords in each sample sentence are extracted, and a keyword dictionary corresponding to the sentence to be processed is constructed based on the sample keywords; or taking the example of the attribute information of the sentence to be processed being the semantic information corresponding to the sentence to be processed, after determining the semantic information of the sentence to be processed through an existing semantic extraction model, multiple sample sentences with the same semantic information as the sentence to be processed are obtained, and then sample keywords in each sample sentence are extracted, and a keyword dictionary corresponding to the sentence to be processed is constructed based on the sample keywords. In addition, in the case where there are multiple attribute information of the sentence to be processed, two or more attribute information of the sentence to be processed can also be combined according to actual needs to obtain sample sentences with the same attribute information as the sentence to be processed.
[0102] Specifically, keyword extraction, also known as key phrase extraction, is the task of automatically extracting a set of representative phrases from sample sentences. The extracted phrases can concisely and accurately describe the subject content of the corresponding sample sentences.
[0103] Continuing with the above example, I BI, country II, D, business BI, business II, environment II, environment II, also D, exist D, in D, which D, some D, questions D, problems D, among which "What problems still exist in my country's business environment" is the sample sentence, and "BI, II, D" is the annotation of each word in the sample sentence through manual or other algorithms. The "B, I" before each "-" represents "Begin, Inside" respectively. The word labeled "BI" indicates the beginning of the keyword in the sample sentence, the word labeled "II" indicates the remaining part of the keyword, and the word labeled "D" indicates that it is not a keyword in the sample sentence. Then, through this label annotation, the keywords "my country, business environment" of the sample sentence can be extracted. In this way, the sample keywords in all sample sentences with the same attribute information as the sentence to be processed are extracted to construct a keyword dictionary corresponding to the sentence to be processed.
[0104] In practical applications, the construction of a keyword dictionary is the process of annotating data. For example, the representative word "business environment" in the above sample sentence is extracted as the dictionary content. Later, when a new sentence to be processed comes and "business environment" appears in it, "business environment" can be directly used as one of the keywords of the new sentence to be processed. This can greatly save the time of keyword extraction and improve the efficiency of keyword extraction.
[0105] Specifically, after receiving the statement to be processed, a keyword dictionary corresponding to the statement to be processed can be constructed based on the attribute information of the statement to be processed through the above method. Before determining the keywords in the statement to be processed based on the keyword determination method, a keyword dictionary can be constructed in advance for each field based on the above method. For example, sample sentences for each field are obtained, sample keywords in the sample sentences of each field are extracted, and a keyword dictionary corresponding to each field is constructed based on the sample keywords of each field. Then, in actual application, after receiving the statement to be processed and determining the attribute information of the statement to be processed, the keyword dictionary corresponding to the attribute information of the statement to be processed is directly selected based on the attribute information of the statement to be processed.
[0106] In an embodiment of this specification, a keyword dictionary corresponding to the sentence to be processed is obtained, and then the dictionary features of the keyword dictionary are obtained based on a feature extraction model. The dictionary features are used to expand the differentiation between keywords and non-keywords in the sentence to be processed, so as to better extract keywords in the sentence to be processed.
[0107] In addition, after extracting sample keywords from the sample sentences and constructing a keyword dictionary corresponding to the sentences to be processed based on the sample keywords, the method further includes:
[0108] A keyword extraction rule is determined based on the sample keywords extracted from the sample sentences.
[0109] In specific implementation, when extracting sample keywords from sample sentences, we can use the word attributes corresponding to the keywords, such as whether the keywords are verbs, nouns, etc., and then use the rules as keyword extraction rules.
[0110] In practical applications, corresponding keyword extraction rules can also be determined based on the field corresponding to the extracted sample sentence. When subsequently extracting keywords from other sentences, the keyword extraction rules corresponding to the field corresponding to the other sentences can be selected to extract keywords, thereby improving the accuracy of keyword extraction. For example, if the field of the sample sentence is the medical field, and the keywords extracted from the sample sentence are "hospital", "medicine", "medical care", etc., it can be determined that the keywords in the medical field are generally words related to health, and the keyword extraction rule can be determined as: all words similar to health are keywords.
[0111] In the embodiments of this specification, in the process of extracting sample keywords from sample sentences, the extraction rules of sample keywords can be summarized, or the extraction features of sample keywords in sample sentences can be determined through machine learning. These rules and features can be used as keyword extraction rules, which can be used in the subsequent process of extracting sample keywords from new sample sentences. Through this keyword extraction rule, the sample keywords in the new sample sentences can be obtained more quickly and conveniently, thereby improving the efficiency of constructing the keyword dictionary.
[0112] Step 204: Obtain dictionary features of the keyword dictionary based on the feature extraction model, obtain sentence features of the sentence to be processed based on the language model, and perform part-of-speech tagging on the sentence to be processed to obtain part-of-speech features corresponding to the part of speech of the sentence to be processed.
[0113] Specifically, after receiving a sentence to be processed and obtaining a keyword dictionary corresponding to the sentence to be processed, the dictionary features of the keyword dictionary can be obtained based on a feature extraction model. The specific implementation method is as follows:
[0114] The obtaining of dictionary features of the keyword dictionary based on a feature extraction model includes:
[0115] Determining a word vector for each keyword in the keyword dictionary based on the word vector table;
[0116] The word vectors of all keywords in the keyword dictionary are input into a feature extraction model to obtain dictionary features of the keyword dictionary.
[0117] Among them, the preset word vector table includes but is not limited to the Glove word vector table; in actual applications, the feature extraction model can be a convolutional neural network model, that is, a CNN model.
[0118] Specifically, after obtaining the keyword dictionary corresponding to the sentence to be processed, each keyword in the keyword dictionary is mapped to a word vector by querying the Glove word vector table. After the mapping is completed, the word vectors of all keywords in the keyword dictionary are input into the CNN model, and the word vectors of all keywords are pooled through the pooling layer of the CNN model to obtain the pooled word vectors of all keywords as the vector of the entire keyword dictionary, and the vector of the keyword dictionary is used as the keyword dictionary feature.
[0119] In the embodiments of this specification, the dictionary features of the keyword dictionary corresponding to the sentence to be processed are obtained through the Glove word vector table and the CNN model. When the keyword is subsequently extracted from the sentence to be processed, the differentiation of each word in the sentence to be processed can be expanded based on the dictionary features to achieve more accurate acquisition of the keywords in the sentence to be processed.
[0120] In a specific implementation, the sentence features of the sentence to be processed are obtained based on the language model, including:
[0121] Obtaining a word vector for each word in the sentence to be processed by position encoding;
[0122] The word vectors of all words in the sentence to be processed are input into a language model to obtain sentence features of the sentence to be processed.
[0123] Among them, the language model can be understood as the BERT model, and the positional encoding can be understood as one-hot encoding.
[0124] Specifically, when obtaining the sentence features of the sentence to be processed based on the BERT model, the BERT model generates a vocabulary, and maps each character or word in the sentence to be processed to the corresponding position in the vocabulary through one-hot encoding. This is equivalent to giving each character in the sentence to be processed an encoding number through the vocabulary, converting all the characters in the sentence to be processed into digital vectors, and then inputting the digital vectors corresponding to all the characters in the sentence to be processed into the BERT model for encoding to obtain the feature representation corresponding to the sentence to be processed, that is, the sentence features of the sentence to be processed.
[0125] In actual applications, the BERT model has been fine-tuned using the same task before this application, so that the output of its encoding layer can better adapt to the task. For example, before the actual application, a sample training set is obtained, where the sample training set includes at least one sample sentence and a sample label corresponding to each sample sentence. Specifically, the at least one sample sentence can be the sample sentence in the above embodiment, that is, a sample sentence with the same domain as the sentence to be processed, and the sample label corresponding to each sample sentence is the sentence feature corresponding to each sample sentence.
[0126] The BERT model is trained based on the training samples, using a portion of the samples in the training set as training samples and the remaining portion as test samples. The BERT model is then tested based on the test samples, and the network parameters of the BERT model are adjusted based on the test results to obtain a better BERT model.
[0127] In the embodiments of this specification, the BERT pre-trained model is used as a feature extraction tool for the sentences to be processed to obtain rich semantic information in the sentences to be processed. Subsequently, this semantic information is combined with the above-mentioned dictionary features, etc., so that better results can be achieved in extracting keywords from the sentences to be processed.
[0128] In another embodiment of the present specification, the part-of-speech tagging of the sentence to be processed to obtain a part-of-speech feature corresponding to the part of speech of the sentence to be processed includes:
[0129] Performing part-of-speech tagging on the sentence to be processed based on a preset part-of-speech tagging tool to obtain a part-of-speech representation of the sentence to be processed;
[0130] Initialize the part-of-speech representation of the sentence to be processed to obtain the part-of-speech feature of the sentence to be processed.
[0131] The preset part-of-speech tagging tool includes but is not limited to the LAC part-of-speech tagging tool.
[0132] Specifically, the LAC part-of-speech tagging tool is used to tag the sentence to be processed, and parts of speech such as verbs, pronouns, and nouns are obtained. These part-of-speech information is used as the part-of-speech representation of the sentence to be processed; then the part-of-speech representation of the sentence to be processed is randomly initialized as the part-of-speech feature of the sentence to be processed.
[0133] Continuing with the above example, we perform part-of-speech tagging on the sentence to be processed, “What problems still exist in my country’s business environment?” See Table 1 for details.
[0134] Table 1
[0135]
[0136]
[0137] It can be concluded from Table 1 that ['r', 'n', 'u, 'n', 'n', 'd', 'v', 'r', 'n'] corresponding to the sentence to be processed ['I', 'country', 'the', 'business', 'environment', 'still', 'exist', 'which', 'problems'] is the part-of-speech tag of the sentence to be processed. After obtaining the part-of-speech tag of the sentence to be processed, the part-of-speech tag of the sentence to be processed is randomly initialized to obtain the part-of-speech representation (part-of-speech vector) of the sentence to be processed, which is used as the part-of-speech feature of the sentence to be processed.
[0138] In the embodiment of this specification, the part-of-speech tagging tool is used to tag the part-of-speech of the sentence to be processed, and the part-of-speech identifier of the sentence to be processed is randomly initialized to obtain the part-of-speech features of the sentence to be processed. Subsequently, the sentence features of the sentence to be processed obtained by the BERT model and the dictionary features of the keyword dictionary obtained by the CNN model can be combined to achieve accurate extraction of keywords in the sentence to be processed.
[0139] Step 206: Determine keywords in the sentence to be processed based on the dictionary features, the part-of-speech features, and the sentence features.
[0140] Specifically, determining the keywords in the sentence to be processed based on the dictionary features, the part-of-speech features, and the sentence features includes:
[0141] fusing the dictionary features, the part-of-speech features, and the sentence features to obtain initial features of the sentence to be processed, and inputting the initial features into a first bidirectional long short-term memory network to obtain candidate features of the sentence to be processed;
[0142] Performing attention calculation on the candidate features and the dictionary features based on a preset algorithm to obtain an attention value of the sentence to be processed, and inputting the attention value into a second bidirectional long short-term memory network to obtain a target feature of the sentence to be processed;
[0143] The target features of the sentence to be processed are input into a keyword extraction model to obtain keywords in the sentence to be processed.
[0144] The preset algorithm is implemented by the following formula 1:
[0145]
[0146] Among them, Q represents the global feature vector (ie, the candidate feature mentioned above), K represents the feature vector of the keyword dictionary (ie, the dictionary feature of the keyword dictionary mentioned above), T represents matrix transpose, dk represents a constant, and softmax represents a function.
[0147] In practical applications, the keyword extraction model can be a conditional random field algorithm model, namely a CRF model.
[0148] Specifically, after obtaining the dictionary features of the keyword dictionary corresponding to the sentence to be processed, the part-of-speech features and sentence features of the sentence to be processed, the dictionary features, part-of-speech features and sentence features are fused and spliced, and input into the first bidirectional LSTM as the underlying representation (i.e., initial features) of the sentence to be processed. The global features (i.e., candidate features) of the sentence to be processed are obtained through the first bidirectional LSTM calculation.
[0149] Among them, when calculating the global features of the statement to be processed, the calculation can be performed through two or more first bidirectional LSTMs. The specific number of first bidirectional LSTMs used can be set based on the actual application, and this application does not impose any restrictions on this.
[0150] After obtaining the candidate features of the sentence to be processed, the candidate features of the sentence to be processed and the dictionary features of the keyword dictionary are input into Formula 1 for attention calculation to obtain the attention value corresponding to the sentence to be processed, and then the attention value of the sentence to be processed is input into the second bidirectional long short-term memory network to obtain the target feature of the sentence to be processed; finally, the target feature is input into the CRF model to obtain the keywords in the sentence to be processed. Among them, the second bidirectional long short-term memory network can also be calculated by two or more second bidirectional LSTMs. The specific number of second bidirectional LSTMs used can be set based on the actual application, and this application does not impose any restrictions on this.
[0151] In the embodiments of this specification, the dictionary features, part-of-speech features and sentence features are fused and spliced, and the global features of the sentence to be processed are obtained through the first bidirectional LSTM, and the attention values obtained based on the global features and the dictionary features are used to obtain the target features of the sentence to be processed through the second bidirectional LSTM. Finally, the target features obtained by the two-layer LSTM are input into a pre-trained keyword extraction model, so that more accurate keywords of the sentence to be processed can be obtained.
[0152] Optionally, inputting the attention value into a second bidirectional long short-term memory network to obtain a target feature of the sentence to be processed includes:
[0153] Inputting the attention value into a second bidirectional long short-term memory network, and multiplying the attention value by the candidate feature in the second bidirectional long short-term memory network to obtain a correlation feature between the word in the sentence to be processed and the keyword dictionary;
[0154] The correlation feature is output through the second bidirectional long short-term memory network to obtain the target feature of the sentence to be processed.
[0155] Specifically, after obtaining the attention value of the data to be processed by the candidate features and the dictionary features according to the preset algorithm, the attention value is input into the second bidirectional LSTM. In the second bidirectional LSTM, the attention value is multiplied by the candidate features of the sentence to be processed to obtain the feature representation of the correlation between the words in the sentence to be processed and the keyword dictionary, which is then output to the second bidirectional LSTM to obtain the hidden layer representation corresponding to the entire sentence to be processed, that is, the target feature; finally, the target feature is input into the CRF model to obtain the keywords in the sentence to be processed.
[0156] For example, the hidden layer representation corresponding to the entire sentence to be processed is input into the CRF model, and the CRF model is trained on the hidden layer representation corresponding to the sentence to be processed using the "BI, II, D" sequence labeling method for constructing the keyword dictionary mentioned above, so as to obtain the prediction result of the CRF model, that is, the keyword in the sentence to be processed; specifically, the CRF model can obtain a three-dimensional probability value of the sentence to be processed, wherein the probability value of the first dimension represents the BI label, the probability value of the second dimension represents the II label, and the probability value of the third dimension represents the D label, that is, the corresponding hidden layer representation of the sentence to be processed is input into the CRF model, and the probability value corresponding to each dimension label can be obtained, and then the text corresponding to the label with the largest probability value is used as the keyword of the sentence to be processed. For example, the probability value of the label BI corresponding to the current text is the largest, then the label corresponding to the current text is BI, and the probability value of the label II corresponding to the current text is the largest, then the label corresponding to the current word is II. Using the above example, for "our country", its corresponding labels are "BI, II", then "our country" is the keyword. In the embodiment of this specification, the correct method for extracting keywords is to combine the two labels BI and II. For a keyword, the first character label of the word is BI, and the second to last label is II.
[0157] In the embodiments of this specification, the keyword determination method uses a pre-trained language model as a feature extraction tool for the sentence to be processed, and adds rich underlying information such as part-of-speech features and dictionary features to expand the differentiation of words, so that the difference between keywords and non-keywords in the sentence to be processed is clearer, so that the keywords in the sentence to be processed can be obtained more accurately.
[0158] In another embodiment of the present specification, after obtaining the keywords in the sentence to be processed, the method further includes:
[0159] The keywords in the sentence to be processed are modified based on the keyword dictionary and the keyword extraction rule.
[0160] Specifically, a keyword in the sentence to be processed can be obtained through the keyword dictionary, and another keyword in the sentence to be processed can be obtained through the keyword extraction rule. Then, the keyword of the sentence to be processed obtained through the CRF model is compared with the above two keywords to realize the correction of the keyword of the sentence to be processed obtained through the CRF model and obtain the final keyword extraction result of the sentence to be processed.
[0161] In the embodiment of this specification, after the keywords of the sentence to be processed are obtained through the CRF model, the keywords extracted from the sentence to be processed can be verified and adjusted based on these keyword extraction rules, so that the keywords extracted from the sentence to be processed can be more accurate.
[0162] Continuing with the above example, if the keywords in the sentence to be processed obtained by the above method are "our country, business environment", and the keywords extracted from the sentence to be processed through the keyword dictionary and keyword extraction rules are also "our country, business environment", then it can be determined that the keyword determination method provided by the embodiment of this specification has a higher accuracy.
[0163] If the keywords in the sentence to be processed obtained by the above method are "our country, business environment", and the keywords extracted from the sentence to be processed through the keyword dictionary are "our country, business environment", but the keywords extracted from the sentence to be processed through the keyword extraction rules are also "our country, business environment, existence", then it can be determined that the probability that the keywords are "our country, business environment" is higher, then it can still be determined that the accuracy of the keyword determination method provided by the embodiment of this specification is higher.
[0164] If the keywords in the sentence to be processed obtained by the above method are "our country, business environment, existence", but the keywords extracted from the sentence to be processed through the keyword dictionary and keyword extraction rules are all "our country, business environment", then it can be determined that the keywords extracted by the keyword determination method provided in the embodiment of this specification may be wrong. At this time, it is necessary to correct it based on the keywords "our country, business environment" extracted through the keyword dictionary and keyword extraction rules to obtain the corrected accurate keywords "our country, business environment"; at the same time, the keyword determination method provided in the embodiment of this specification can also be optimized to improve user experience.
[0165] The keyword determination method provided in the embodiment of this specification can reduce the data annotation cost and annotation time by combining the BERT pre-training model, keyword extraction rules, and keyword dictionary, greatly enhance the model's migration ability, and integrate rich underlying information such as the part-of-speech features, sentence features, and dictionary features of the sentence to be processed to expand the differentiation of words in the sentence to be processed and improve the performance of the model, so as to accurately obtain the keywords of the sentence to be processed. In addition, the keywords in the extracted sentence to be processed can be corrected through the keyword dictionary and keyword extraction rules to obtain better extraction results for the keywords in the sentence to be processed.
[0166] See also Figure 3 , Figure 3 A specific processing flow chart of a keyword determination method provided by an embodiment of the present application is shown, which specifically includes the following steps.
[0167] Step 302: Receive a statement to be processed.
[0168] Step 304: Determine the attribute information of the sentence to be processed, and obtain a keyword dictionary corresponding to the sentence to be processed based on the attribute information of the sentence to be processed.
[0169] Step 306: Construct a word vector for the keyword dictionary by querying the Glove word vector table.
[0170] Step 308: Input the word vectors of all keywords in the keyword dictionary into the CNN model, and obtain the dictionary features of the keyword dictionary through the pooling layer of the CNN model.
[0171] Step 310: Obtain a word vector for each word in the sentence to be processed by one-hot encoding.
[0172] Step 312: Input the word vectors of all words in the sentence to be processed into the BRET model to obtain the sentence features of the sentence to be processed.
[0173] Step 314: Perform part-of-speech tagging on the sentence to be processed based on the LAC part-of-speech tagging tool to obtain a part-of-speech representation of the sentence to be processed.
[0174] Step 316: Randomly initialize the part-of-speech representation of the sentence to be processed to obtain the part-of-speech feature of the sentence to be processed.
[0175] Step 318: The dictionary features, part-of-speech features, and sentence features are fused and concatenated, and input into the first bidirectional LSTM as the underlying feature representation to obtain global features.
[0176] Step 320: Perform attention calculation on the global features and the dictionary features to obtain an attention value, and input the attention value into the second bidirectional LSTM to obtain the hidden layer representation corresponding to the sentence to be processed.
[0177] Specifically, in the second bidirectional LSTM, the attention value is multiplied by the global feature to obtain the correlation feature representation of the characters in the sentence to be processed and the keyword dictionary, which is output to the second bidirectional LSTM to obtain the hidden layer representation corresponding to the sentence to be processed.
[0178] Step 322: Input the hidden layer representation corresponding to the sentence to be processed into the CRF model to obtain the keywords in the sentence to be processed.
[0179] In the embodiments of this specification, the keyword determination method uses a pre-trained language model as a feature extraction tool for the sentence to be processed, and adds rich underlying information such as part-of-speech features and dictionary features to expand the differentiation of words, so that the difference between keywords and non-keywords in the sentence to be processed is clearer, so that the keywords in the sentence to be processed can be obtained more accurately.
[0180] Corresponding to the above method embodiment, the present application also provides a keyword determination device embodiment, Figure 4FIG. 1 shows a schematic diagram of a keyword determination device according to an embodiment of the present application. Figure 4 As shown, the device includes:
[0181] The statement receiving module 402 is configured to receive a statement to be processed and obtain a keyword dictionary corresponding to the statement to be processed;
[0182] The feature acquisition module 404 is configured to obtain dictionary features of the keyword dictionary based on the feature extraction model, obtain sentence features of the sentence to be processed based on the language model, and perform part-of-speech tagging on the sentence to be processed to obtain part-of-speech features corresponding to the part of speech of the sentence to be processed;
[0183] The keyword determination module 406 is configured to determine keywords in the sentence to be processed based on the dictionary features, the part-of-speech features, and the sentence features.
[0184] Optionally, the device further includes:
[0185] The dictionary building module is configured as follows:
[0186] Determining attribute information of the statement to be processed, and obtaining a sample statement having at least one attribute information identical to that of the statement to be processed;
[0187] Sample keywords are extracted from the sample sentences, and a keyword dictionary corresponding to the sentence to be processed is constructed based on the sample keywords.
[0188] Optionally, the device further includes:
[0189] The rule determination module is configured to:
[0190] A keyword extraction rule is determined based on the sample keywords extracted from the sample sentences.
[0191] Optionally, the feature acquisition module 404 is further configured to:
[0192] Determining a word vector for each keyword in the keyword dictionary based on the word vector table;
[0193] The word vectors of all keywords in the keyword dictionary are input into a feature extraction model to obtain dictionary features of the keyword dictionary.
[0194] Optionally, the feature acquisition module 404 is further configured to:
[0195] Obtaining a word vector for each word in the sentence to be processed by position encoding;
[0196] The word vectors of all words in the sentence to be processed are input into a language model to obtain sentence features of the sentence to be processed.
[0197] Optionally, the feature acquisition module 404 is further configured to:
[0198] Performing part-of-speech tagging on the sentence to be processed based on a preset part-of-speech tagging tool to obtain a part-of-speech representation of the sentence to be processed;
[0199] Initialize the part-of-speech representation of the sentence to be processed to obtain the part-of-speech feature of the sentence to be processed.
[0200] Optionally, the keyword determination module 406 is further configured to:
[0201] fusing the dictionary features, the part-of-speech features, and the sentence features to obtain initial features of the sentence to be processed, and inputting the initial features into a first bidirectional long short-term memory network to obtain candidate features of the sentence to be processed;
[0202] Performing attention calculation on the candidate features and the dictionary features based on a preset algorithm to obtain an attention value of the sentence to be processed, and inputting the attention value into a second bidirectional long short-term memory network to obtain a target feature of the sentence to be processed;
[0203] The target features of the sentence to be processed are input into a keyword extraction model to obtain keywords in the sentence to be processed.
[0204] Optionally, the keyword determination module 406 is further configured to:
[0205] Inputting the attention value into a second bidirectional long short-term memory network, and multiplying the attention value by the candidate feature in the second bidirectional long short-term memory network to obtain a correlation feature between the word in the sentence to be processed and the keyword dictionary;
[0206] The correlation feature is output through the second bidirectional long short-term memory network to obtain the target feature of the sentence to be processed.
[0207] Optionally, the device further includes:
[0208] The correction module is configured to correct the keywords in the sentence to be processed based on the keyword dictionary and the keyword extraction rule.
[0209] Optionally, the feature extraction model includes a convolutional neural network model, the language model includes a BERT model, and the keyword extraction model includes a conditional random field algorithm model.
[0210] The keyword determination device provided in the embodiment of this specification uses a pre-trained language model as a feature extraction tool for the sentence to be processed, and adds rich underlying information such as part-of-speech features and dictionary features to expand the differentiation of words, so that the difference between keywords and non-keywords in the sentence to be processed is clearer, thereby being able to obtain keywords in the sentence to be processed more accurately.
[0211] The above is a schematic scheme of a keyword determination device of this embodiment. It should be noted that the technical scheme of the keyword determination device and the technical scheme of the keyword determination method described above are based on the same concept. For details not described in detail in the technical scheme of the keyword determination device, please refer to the description of the technical scheme of the keyword determination method described above.
[0212] It should be noted that the components in a device claim should be understood as the functional modules necessary to implement each step of the program flow or method. The individual functional modules are not defined by actual functional division or separation. 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, rather than a physical device that primarily implements the solution through hardware.
[0213] In one embodiment of the present application, a computing device is further provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the keyword determination method when executing the instructions.
[0214] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned keyword determination method are of the same concept. For details not described in detail in the technical scheme of the computing device, please refer to the description of the technical scheme of the above-mentioned keyword determination method.
[0215] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the keyword determination method as described above.
[0216] The above is a schematic diagram of a computer-readable storage medium of this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the above-mentioned keyword determination method are based on 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 above-mentioned keyword determination method.
[0217] The foregoing description describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0218] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0219] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0220] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0221] The preferred embodiments of the present application disclosed above are intended only to help illustrate the present application. The optional embodiments do not describe all details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of this application. This application selects and describes these embodiments in detail in order to better explain the principles and practical applications of this application, so that those skilled in the art can better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.
Claims
1. A keyword determination method, characterized in that: include: receiving a sentence to be processed and obtaining a keyword dictionary corresponding to the sentence to be processed, wherein the keyword dictionary is constructed based on sample keywords and corresponds to the sentence to be processed, and the sample keywords are obtained by extracting from a sample sentence having at least one attribute information identical to that of the sentence to be processed; Obtaining dictionary features of the keyword dictionary based on a feature extraction model, obtaining sentence features of the sentence to be processed based on a language model, and performing part-of-speech tagging on the sentence to be processed to obtain part-of-speech features corresponding to the part-of-speech of the sentence to be processed, wherein the dictionary features of the keyword dictionary are obtained by pooling word vectors of all keywords in the keyword dictionary, and the sentence features of the sentence to be processed are obtained by encoding digital vectors of all words in the sentence to be processed; Keywords in the sentence to be processed are determined based on the dictionary features, the part-of-speech features, and the sentence features.
2. The keyword determination method according to claim 1, wherein: After receiving the statement to be processed and before obtaining the keyword dictionary corresponding to the statement to be processed, the method further includes: Determining attribute information of the statement to be processed, and obtaining a sample statement having at least one attribute information identical to that of the statement to be processed; Sample keywords are extracted from the sample sentences, and a keyword dictionary corresponding to the sentence to be processed is constructed based on the sample keywords.
3. The keyword determination method according to claim 2, characterized in that: After extracting sample keywords from the sample sentences and constructing a keyword dictionary corresponding to the sentences to be processed based on the sample keywords, the method further includes: A keyword extraction rule is determined based on the sample keywords extracted from the sample sentences.
4. The keyword determination method according to claim 1 or 3, characterized in that: The obtaining of dictionary features of the keyword dictionary based on a feature extraction model includes: Determining a word vector for each keyword in the keyword dictionary based on the word vector table; The word vectors of all keywords in the keyword dictionary are input into a feature extraction model to obtain dictionary features of the keyword dictionary.
5. The keyword determination method according to claim 1 or 3, characterized in that: The obtaining of sentence features of the sentence to be processed based on the language model includes: Obtaining a word vector for each word in the sentence to be processed by position encoding; The word vectors of all words in the sentence to be processed are input into a language model to obtain sentence features of the sentence to be processed.
6. The keyword determination method according to claim 1 or 3, characterized in that: The step of performing part-of-speech tagging on the sentence to be processed to obtain a part-of-speech feature corresponding to the part-of-speech of the sentence to be processed includes: Performing part-of-speech tagging on the sentence to be processed based on a preset part-of-speech tagging tool to obtain a part-of-speech representation of the sentence to be processed; Initialize the part-of-speech representation of the sentence to be processed to obtain the part-of-speech feature of the sentence to be processed.
7. The keyword determination method according to claim 1 or 3, characterized in that: The determining of keywords in the sentence to be processed based on the dictionary features, the part-of-speech features, and the sentence features includes: fusing the dictionary features, the part-of-speech features, and the sentence features to obtain initial features of the sentence to be processed, and inputting the initial features into a first bidirectional long short-term memory network to obtain candidate features of the sentence to be processed; Performing attention calculation on the candidate features and the dictionary features to obtain an attention value of the sentence to be processed, and inputting the attention value into a second bidirectional long short-term memory network to obtain a target feature of the sentence to be processed; The target features of the sentence to be processed are input into a keyword extraction model to obtain keywords in the sentence to be processed.
8. The keyword determination method according to claim 7, characterized in that: Inputting the attention value into a second bidirectional long short-term memory network to obtain a target feature of the sentence to be processed includes: Inputting the attention value into a second bidirectional long short-term memory network, and multiplying the attention value by the candidate feature in the second bidirectional long short-term memory network to obtain a correlation feature between the word in the sentence to be processed and the keyword dictionary; The correlation feature is output through the second bidirectional long short-term memory network to obtain the target feature of the sentence to be processed.
9. The keyword determination method according to claim 3, characterized in that: After obtaining the keywords in the sentence to be processed, the method further includes: The keywords in the sentence to be processed are modified based on the keyword dictionary and the keyword extraction rule.
10. The keyword determination method according to claim 8, characterized in that: The feature extraction model includes a convolutional neural network model, the language model includes a BERT model, and the keyword extraction model includes a conditional random field algorithm model.
11. A keyword determination device, characterized in that: include: a sentence receiving module configured to receive a sentence to be processed and obtain a keyword dictionary corresponding to the sentence to be processed, wherein the keyword dictionary is constructed based on sample keywords and corresponds to the sentence to be processed, and the sample keywords are obtained by extracting from a sample sentence having at least one attribute information identical to that of the sentence to be processed; a feature acquisition module, configured to obtain dictionary features of the keyword dictionary based on a feature extraction model, obtain sentence features of the sentence to be processed based on a language model, and perform part-of-speech tagging on the sentence to be processed to obtain part-of-speech features corresponding to the part-of-speech of the sentence to be processed, wherein the dictionary features of the keyword dictionary are obtained by pooling the word vectors of all keywords in the keyword dictionary, and the sentence features of the sentence to be processed are obtained by encoding the digital vectors of all words in the sentence to be processed; The keyword determination module is configured to determine keywords in the sentence to be processed based on the dictionary features, the part-of-speech features, and the sentence features.
12. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein: When the processor executes the instructions, the steps of the keyword determination method according to any one of claims 1 to 10 are implemented.
13. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by the processor, the steps of the keyword determination method according to any one of claims 1 to 10 are implemented.