Text keyword extraction method, model training method, device and electronic equipment

By using a keyword recognition model trained with a truncated cross-entropy loss function, text keywords are extracted during the data element matching process, solving the problem of low accuracy in data element matching and achieving higher matching accuracy and efficiency.

CN116384392BActive Publication Date: 2026-11-27ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310458542.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-24
Publication Date
2026-11-27
Estimated Expiration
2043-04-24

AI Technical Summary

Technical Problem

In existing technologies, the processing of original field annotations during data element benchmarking leads to low accuracy in data element benchmarking, and there is an urgent need to improve the accuracy of data element benchmarking.

Method used

A keyword recognition model is trained using the truncated cross-entropy loss function. By obtaining the annotation information to be processed and inputting it into the trained keyword recognition model, the model can extract text keywords. The model can focus more on samples that are difficult to distinguish, alleviate overfitting, and achieve accurate keyword extraction.

Benefits of technology

It improved the accuracy of data element matching, effectively alleviated the overfitting problem of the model, and improved the efficiency of data element matching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116384392B_ABST
    Figure CN116384392B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of word processing, and provides a text keyword extraction method, a model training method and device, and electronic equipment. The method comprises the following steps: obtaining to-be-processed annotation information contained in to-be-processed text; inputting the to-be-processed annotation information into a trained keyword recognition model to obtain text keywords of the to-be-processed annotation information; and using the generated text keywords for data element pair marking. The keyword recognition model is obtained by training a language extraction model using training sample data, the training sample data comprises field annotation text with keyword labels, and a target loss function of the keyword recognition model is a truncated cross-entropy loss function. The method can make the model pay more attention to samples that are difficult to distinguish, consciously distinguish ambiguous samples, effectively alleviate overfitting of the model, accurately extract keywords of original field annotations, and improve the accuracy of data element pair marking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of text processing technology, and in particular to a text keyword extraction method, a model training method, an apparatus, and an electronic device. Background Technology

[0002] In natural language processing (NLP), regardless of whether the task is text generation, text classification, machine translation, or any other type, ensuring data quality is crucial for achieving good performance. Therefore, regardless of the task, data needs to be processed to transform it into a form that the model can better understand.

[0003] The same applies to data element benchmarking. Essentially, data element benchmarking can be understood as a text matching problem. It involves calculating the similarity between the data to be benchmarked and existing data in a database, and then retrieving the data element with the highest similarity as its benchmark. In this text matching task, the key lies in the representation of field annotation text; the better the text representation, the better the benchmarking effect. However, data element benchmarking faces many challenges, one of the most pressing being the processing of original field annotations. These annotations typically include explanations and descriptions of the field to help others better understand its meaning. Data element benchmarking also needs to utilize these representations for text matching.

[0004] In related technologies, the information from the original field annotations is typically used as input to the model for data element benchmarking, which can easily lead to low accuracy in data element benchmarking. Therefore, providing a method to improve the accuracy of data element benchmarking is of significant practical importance. Summary of the Invention

[0005] This application provides a text keyword extraction method, a model training method, an apparatus, and an electronic device to extract keywords from original field annotations, thereby improving the accuracy of data element mapping.

[0006] To achieve the above objectives, the technical solution of this application embodiment is implemented as follows: In a first aspect, embodiments of this application provide a method for extracting text keywords, wherein the text keywords are used for data element mapping; the method includes: Obtain the annotation information contained in the text to be processed; The annotation information to be processed is input into the trained keyword recognition model to obtain the text keywords of the annotation information to be processed; The keyword recognition model is obtained by training a language extraction model using training sample data, which includes field annotation text with keyword tags. The language extraction model is used to obtain keywords from the input annotation information, and the trained keyword recognition model is obtained when the target loss function of the language extraction model converges to a preset target condition. The target loss function is a truncated cross-entropy loss function. The truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge. The predicted probability of the first type of sample falls within the probability control region between the first control value and the second control value. The predicted probability of the second type of sample does not fall within the probability control region.

[0007] The text keyword extraction method provided in this application involves obtaining unprocessed annotation information contained in the text to be processed; inputting the unprocessed annotation information into a trained keyword recognition model to obtain the text keywords of the unprocessed annotation information; and using the generated text keywords for data element mapping. The target loss function of the keyword recognition model is the truncated cross-entropy loss function. This method allows the model to focus more on samples that are difficult for the model to distinguish, enabling the model to consciously differentiate ambiguous samples, effectively alleviating model overfitting, achieving accurate extraction of keywords from the original field annotations, and improving the accuracy of data element mapping.

[0008] In one optional embodiment, the keyword recognition model is trained in the following manner: Obtain training sample data, which includes field annotation text with keyword tags; Based on the training sample data, a batch training corpus is selected; the batch training corpus includes a portion of the field annotation text; The batch training corpus is input into the language extraction model to be trained for training, and the recognition loss value of the target loss function of the language extraction model to be trained is determined; the target loss function is a truncated cross-entropy loss function; the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region; the predicted probability represents the probability that the keyword in the batch training corpus is the keyword label; If the batch training corpus is determined to be the second type of sample, the parameters of the language extraction model to be trained are not adjusted and the training is performed again. If the batch training corpus is determined to be the first type of sample, then it is determined whether the recognition loss value has converged to the preset target value. If the determination result is no, then the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and retrained. If the determination result is yes, then the training ends and the trained keyword recognition model is obtained.

[0009] The method of this embodiment trains a language extraction model by inputting the batch training corpus into the model to be trained, and determines the recognition loss value of the target loss function of the language extraction model to be trained; the target loss function is a truncated cross-entropy loss function; the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls within the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall within the probability control region; the predicted probability represents the probability that the keyword in the batch training corpus is the keyword label; if it is determined that the If the batch training corpus consists of samples of the second type, the parameters of the language extraction model to be trained are not adjusted and retraining is performed. If the batch training corpus is determined to be samples of the first type, it is determined whether the recognition loss value has converged to the preset target value. If the determination result is no, the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and retraining is performed. If the determination result is yes, the training ends and a trained keyword recognition model is obtained. This allows the trained keyword recognition model to consciously distinguish ambiguous samples, effectively alleviate overfitting of the model, and achieve accurate extraction of keywords from the original field annotations, thereby improving the accuracy of data element mapping.

[0010] In an optional embodiment, before obtaining the training sample data, the method further includes: Collect text datasets in the target domain; Based on the text dataset, an unsupervised language model is trained on a preset language model to obtain the language extraction model.

[0011] In this embodiment, the method involves collecting a text dataset from the target domain; based on the text dataset, an unsupervised language model is trained on a preset language model to obtain the language extraction model. This allows for the direct extraction of text keywords from annotation information to be processed based on a deep learning model, effectively saving manpower costs and improving the efficiency of the data element benchmarking process.

[0012] Secondly, embodiments of this application also provide a method for training a keyword recognition model, used to generate the keyword recognition model used in the above-mentioned text keyword extraction method, the training method comprising: Obtain training sample data, which includes field annotation text with keyword tags; Based on the training sample data, a batch training corpus is selected; the batch training corpus includes a portion of the field annotation text; The batch training corpus is input into the language extraction model to be trained for training, and the recognition loss value of the target loss function of the language extraction model to be trained is determined; the target loss function is a truncated cross-entropy loss function; the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region; the predicted probability represents the probability that the keyword in the batch training corpus is the keyword label; If the batch training corpus is determined to be the first type of sample, then it is determined whether the recognition loss value has converged to the preset target value. If the determination result is yes, then the training ends and the trained keyword recognition model is obtained. If the determination result is no, then the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and retrained. And, if the batch training corpus is determined to be the second type of sample, then the parameters of the language extraction model to be trained are not adjusted and retrained.

[0013] The keyword recognition model training method provided in this application includes: obtaining training sample data, wherein the training sample data includes field annotation text with keyword tags; selecting batch training corpora based on the training sample data; wherein the batch training corpora include a portion of the field annotation text; inputting the batch training corpora into a language extraction model to be trained for training, and determining the recognition loss value of the target loss function of the language extraction model to be trained; wherein the target loss function is a truncated cross-entropy loss function; wherein the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls The predicted probability of the second type of sample does not fall within the probability control region; the predicted probability represents the probability that the keyword in the batch training corpus is the keyword label; if the batch training corpus is determined to be the first type of sample, it is determined whether the recognition loss value converges to the preset target value. If the determination result is yes, the training ends and a trained keyword recognition model is obtained; if the determination result is no, the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and retrained; and if the batch training corpus is determined to be the second type of sample, the parameters of the language extraction model to be trained are not adjusted and retrained. This method enables the obtained trained keyword recognition model to consciously distinguish ambiguous samples, effectively alleviates model overfitting, achieves accurate extraction of keywords from the original field annotations, and improves the accuracy of data element mapping.

[0014] In an optional embodiment, before obtaining the training sample data, the method further includes: Collect text datasets in the target domain; Based on the text dataset, an unsupervised language model is trained on a preset language model to obtain the language extraction model.

[0015] The method in this embodiment first collects a text dataset of the target domain; based on the text dataset, it performs unsupervised language model training on a preset language model to obtain the language extraction model. This method can directly extract the text keywords of the annotation information to be processed based on a deep learning model, which can effectively save manpower costs and effectively improve the efficiency of the data element benchmarking process.

[0016] In one optional embodiment, the step of training a preset language model unsupervised based on the text dataset to obtain the language extraction model includes: Based on the text dataset, an unsupervised language model is trained on a preset language model to obtain a pre-trained language model; the pre-trained language model includes a Bert encoder. The pre-trained language model is reconstructed by an encoder to obtain the language extraction model; the encoder reconstruction is to connect a TextCNN module after the Bert encoder.

[0017] The method of this embodiment, based on the text dataset, performs unsupervised language model training on a preset language model to obtain a pre-trained language model; the pre-trained language model includes a BERT encoder; the encoder of the pre-trained language model is reconstructed to obtain the language extraction model; the reconstructed encoder is a TextCNN module connected after the BERT encoder. By reconstructing the pre-trained language model including the BERT encoder and connecting a TextCNN module after the BERT encoder, BERT and TextCNN are combined. Each layer output of BERT can be used as an input channel of TextCNN, entering the TextCNN to obtain the final text representation. This makes the obtained text representation more comprehensively consider the multi-layer representation of the model, further improving the accuracy of data element mapping.

[0018] In one alternative embodiment, the target domain is a data element domain.

[0019] In an optional embodiment, adjusting the parameters of the language extraction model to be trained and retraining it based on the determined recognition loss value includes: The parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value until the recognition loss value converges to the preset target value. The resulting language extraction model is then used as the trained keyword recognition model.

[0020] Thirdly, embodiments of this application also provide a text keyword extraction device, wherein the text keywords are used for data element mapping; the device includes: The annotation information acquisition unit is used to acquire the annotation information to be processed contained in the text to be processed; A keyword generation unit is used to input the annotation information to be processed into a trained keyword recognition model to obtain the text keywords of the annotation information to be processed. The keyword recognition model is obtained by training a language extraction model using training sample data, which includes field annotation text with keyword tags. The language extraction model is used to obtain the keywords of the input annotation information, and the trained keyword recognition model is obtained when the target loss function of the language extraction model converges to a preset target condition. The target loss function is a truncated cross-entropy loss function. The truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge. The predicted probability of the first type of sample falls within the probability control region between the first control value and the second control value. The predicted probability of the second type of sample does not fall within the probability control region.

[0021] In an optional embodiment, the system further includes a model training unit, which is used to train the keyword recognition model in the following manner: Obtain training sample data, which includes field annotation text with keyword tags; Based on the training sample data, a batch training corpus is selected; the batch training corpus includes a portion of the field annotation text; The batch training corpus is input into the language extraction model to be trained for training, and the recognition loss value of the target loss function of the language extraction model to be trained is determined; the target loss function is a truncated cross-entropy loss function; the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region; the predicted probability represents the probability that the keyword in the batch training corpus is the keyword label; If the batch training corpus is determined to be the second type of sample, the parameters of the language extraction model to be trained are not adjusted and the training is performed again. If the batch training corpus is determined to be the first type of sample, then it is determined whether the recognition loss value has converged to the preset target value. If the determination result is no, then the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and retrained. If the determination result is yes, then the training ends and the trained keyword recognition model is obtained.

[0022] In an optional embodiment, the model training unit is further configured to: collect a text dataset in the target domain; Based on the text dataset, an unsupervised language model is trained on a preset language model to obtain the language extraction model.

[0023] Fourthly, embodiments of this application also provide a training apparatus for a keyword recognition model, used to generate the keyword recognition model used in the third aspect, the training apparatus comprising: A training data acquisition unit is used to obtain training sample data, which includes field annotation text with keyword tags; and to select batch training corpora based on the training sample data; the batch training corpora include a portion of the field annotation text. The model training execution unit is used to input the batch training corpus into the language extraction model to be trained for training, and to determine the recognition loss value of the target loss function of the language extraction model to be trained; the target loss function is a truncated cross-entropy loss function; the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, and makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region; the predicted probability represents the probability that the keyword of the batch training corpus is the keyword label; if the batch training corpus is determined to be the first type of sample, it is determined whether the recognition loss value has converged to the preset target value; if the determination result is yes, the training ends and the trained keyword recognition model is obtained; if the determination result is no, the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and retrained; and if the batch training corpus is determined to be the second type of sample, the parameters of the language extraction model to be trained are not adjusted and retrained.

[0024] In an optional embodiment, the apparatus further includes a model pre-training unit, the model pre-training unit being configured to: Before obtaining the training sample data, a text dataset of the target domain is collected; Based on the text dataset, an unsupervised language model is trained on a preset language model to obtain the language extraction model.

[0025] In one optional embodiment, the model pre-training unit is specifically used for: Based on the text dataset, an unsupervised language model is trained on a preset language model to obtain a pre-trained language model; the pre-trained language model includes a Bert encoder. The pre-trained language model is reconstructed by an encoder to obtain the language extraction model; the encoder reconstruction is to connect a TextCNN module after the Bert encoder.

[0026] In one alternative embodiment, the target domain is a data element domain.

[0027] In one optional embodiment, the model training execution unit is specifically used for: The parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value until the recognition loss value converges to the preset target value. The resulting language extraction model is then used as the trained keyword recognition model.

[0028] Fifthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in either the first or second aspect.

[0029] In a sixth aspect, embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the computer program is executed by the processor, the processor causes the processor to implement the method described in either the first aspect or the second aspect.

[0030] The technical effects of any of the implementation methods in aspects three through six can be found in the technical effects of the corresponding implementation methods in aspects one through two, and will not be repeated here. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 A flowchart illustrating a text keyword extraction method provided in this application embodiment; Figure 2 A flowchart illustrating the process of obtaining a keyword recognition model using a text keyword extraction method provided in this application embodiment; Figure 3 A flowchart illustrating the process of obtaining a language extraction model using a text keyword extraction method provided in this embodiment of the application; Figure 4 A flowchart illustrating a training method for a keyword recognition model provided in an embodiment of this application; Figure 5 A flowchart illustrating another method for training a keyword recognition model provided in an embodiment of this application; Figure 6 This is one of the structural schematic diagrams of a text keyword extraction device provided in an embodiment of this application; Figure 7 This is a second schematic diagram of a text keyword extraction device provided in an embodiment of this application; Figure 8 One of the structural schematic diagrams of a training device for a keyword recognition model provided in an embodiment of this application; Figure 9 A second schematic diagram of the structure of a training device for a keyword recognition model provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0034] It should be noted that the terms "comprising" and "having" and their variations used in this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or device.

[0035] The following are explanations of some of the words that appear in the text: (1) BERT Model: The BERT model is an unsupervised pre-trained language model for natural language processing tasks. The BERT model adopts dual encoding and is a natural language processing model based on the Transformer model. It has an encoder-decoder architecture, which allows BERT to utilize all the contextual information of each word in the process of encoding the input text. Compared with the unidirectional encoder that can only use pre-order information to extract semantics, it can use more contextual information to assist in the current semantic judgment. The semantic information extraction capability of the BERT model is stronger.

[0036] (2) TextCNN: TextCNN is a convolutional neural network used for text classification. The structure of TextCNN is relatively simple. The input data first passes through an embedding layer to obtain the embedding representation of the input sentence, then through a convolution layer to extract the features of the sentence, and finally through a fully connected layer to obtain the final output.

[0037] (3) Whole Word Masking (WWM): Also known as full word coverage. In the BERT model, the original WordPiece-based segmentation method divides a complete word into several sub-words. When generating training samples, these separated sub-words are randomly masked. In Whole Word Masking, if a portion of a WordPiece sub-word of a complete word is masked, then other parts belonging to the same word will also be masked.

[0038] (4) LAMB Optimizer: The LAMB optimizer adjusts the learning rate during model training by reducing the trust ratio through more accurate stratification. In some embodiments of this application, the training time of the BERT model is reduced by using the LAMB optimizer.

[0039] (5) MLM (Masked Language Model) Loss: MLM loss refers to the loss in predicting masked words in an MLM language model. In an MLM language model, a specific percentage of words in a given sentence are typically masked, and the model expects to predict these masked words based on the other words in the sentence. This training scheme makes the model inherently bidirectional because the representation of the masked words is learned from the words that appear, similar to a fill-in-the-blank question statement.

[0040] In natural language processing (NLP), regardless of whether the task is text generation, text classification, machine translation, or any other type, ensuring data quality is crucial for achieving good performance. Therefore, regardless of the task, data needs to be processed to transform it into a form that the model can better understand.

[0041] The same applies to data element benchmarking. Essentially, data element benchmarking can be understood as a text matching problem. It involves calculating the similarity between the data to be benchmarked and existing data in a database, and then retrieving the data element with the highest similarity as its benchmark. In this text matching task, the key lies in the representation of field annotation text; the better the text representation, the better the benchmarking effect. However, data element benchmarking faces many challenges, one of the most pressing being the processing of original field annotations. These annotations typically include explanations and descriptions of the field to help others better understand its meaning. Data element benchmarking also needs to utilize these representations for text matching.

[0042] In related technologies, the information from the original field annotations is typically used as input to the model for data element benchmarking, which easily leads to low accuracy in data element benchmarking. Therefore, providing a method to improve the accuracy of data element benchmarking is an urgent problem to be solved and has significant practical implications.

[0043] To address existing technical problems, this application provides a text keyword extraction method, a model training method, an apparatus, and an electronic device. The text keyword extraction method involves: acquiring annotation information contained in the text to be processed; inputting the annotation information into a trained keyword recognition model to obtain text keywords from the annotation information; using text keywords for data element mapping; the keyword recognition model is trained using training sample data, which includes field annotation text with keyword tags; the language extraction model is used to acquire keywords from the input annotation information; and the trained keyword recognition model is obtained when the target loss function of the language extraction model converges to a preset target condition; the target loss function is a truncated cross-entropy loss function; the truncated cross-entropy loss function is a cross-entropy loss function that converges the loss value corresponding to the first type of sample but does not converge the loss value corresponding to the second type of sample; the predicted probability of the first type of sample falls within the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall within the probability control region. This method obtains the annotation information contained in the text to be processed; the annotation information is input into a trained keyword recognition model to obtain the text keywords of the annotation information. The generated text keywords are used for data element mapping. The target loss function of the keyword recognition model is the truncated cross-entropy loss function, which allows the model to focus more on samples that are difficult for the model to distinguish. This allows the model to consciously distinguish ambiguous samples, effectively alleviates the overfitting of the model, and achieves accurate extraction of keywords from the original field annotations, thereby improving the accuracy of data element mapping.

[0044] To make the inventive objectives, technical solutions, and advantages of the embodiments of this application clearer, the present application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0045] It should be noted that the application scenarios described in the following embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0046] Figure 1 This application illustrates a method for extracting text keywords, which are used for data element mapping. Figure 1 As shown, the method includes the following steps: Step S101: Obtain the annotation information to be processed contained in the text to be processed.

[0047] For example, obtain the unprocessed annotation information Text_i contained in the text to be processed File_01.

[0048] Step S102: Input the annotation information to be processed into the trained keyword recognition model to obtain the text keywords of the annotation information to be processed. The keyword recognition model is obtained by training the language extraction model with training sample data. The training sample data includes field annotation text with keyword labels. The language extraction model is used to obtain the keywords of the input annotation information. The trained keyword recognition model is obtained when the target loss function of the language extraction model converges to the preset target condition.

[0049] The target loss function is the truncated cross-entropy loss function; the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region.

[0050] For example, the annotation information Text_i to be processed is input into the trained keyword recognition model KW_mold_Tr to obtain the text keyword Key_w_i of the annotation information Text_i. Here, the keyword recognition model KW_mold_Tr is obtained by training the language extraction model Lan_Deal_Mold using training sample data. The training sample data Train_data includes the annotation text Text_Ini with keyword labels Label_Key. The language extraction model Lan_Deal_Mold is used to obtain the keywords of the input annotation information, and the trained keyword recognition model KW_mold_Tr is obtained when the target loss function of the language extraction model Lan_Deal_Mold converges to a preset target condition. The target loss function is a truncated cross-entropy loss function, which is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge. The predicted probability of the first type of sample falls within the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall within the probability control region.

[0051] In some alternative embodiments, such as Figure 2 As shown, the keyword recognition model is trained through the following steps: Step S201: Obtain training sample data, which includes field annotation text with keyword labels.

[0052] In the embodiments of this application, a large number of field annotation texts can be annotated to identify keywords, and the annotated keywords can be used as keyword tags to obtain training sample data.

[0053] Step S202: Based on the training sample data, select a batch of training corpus; the batch of training corpus includes a portion of the field annotation text.

[0054] In the embodiments of this application, the batch training corpus is obtained by randomly selecting from the training sample data. The batch training corpus includes a portion of the field annotation text; for example, the batch training corpus may include N randomly selected field annotation texts.

[0055] Step S203: Input the batch training corpus into the language extraction model to be trained for training, and determine the recognition loss value of the target loss function of the language extraction model to be trained; the target loss function is the truncated cross-entropy loss function.

[0056] Wherein, the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region; the predicted probability represents the probability that the keyword of the batch training corpus is the keyword label.

[0057] Step S204: If the batch training corpus is determined to be a second type of sample, the parameters of the language extraction model to be trained are not adjusted and the model is trained again.

[0058] Step S205: If the batch training corpus is determined to be a first-class sample, then determine whether the recognition loss value has converged to the preset target value. If the judgment result is no, then adjust the parameters of the language extraction model to be trained according to the determined recognition loss value and train again. If the judgment result is yes, then end the training and obtain the trained keyword recognition model.

[0059] In some embodiments of this application, such as Figure 3 As shown, the keyword recognition model is trained through the following steps: Step S301: Collect a text dataset in the target domain.

[0060] In practice, a large amount of text dataset from the target domain can be collected first, and some simple text processing can be performed to facilitate the subsequent training of the language model. In this embodiment, the target domain is used as the data meta-domain for illustration.

[0061] Step S302: Based on the text dataset, perform unsupervised language model training on the preset language model to obtain the language extraction model.

[0062] In specific implementation, the process involves unsupervised language model training based on a pre-defined language model using a text dataset, employing a full-word masking strategy. In some embodiments of this application, by using a masking strategy, when a sub-word of a complete word is masked, other sub-words belonging to that complete word will also be masked, allowing the language extraction model to consciously recover complete words. Furthermore, the optimizer can be the LAMB optimizer. The LAMB optimizer is suitable for large-batch data computation, employing a general adaptation strategy and providing insights into convergence through theoretical analysis, thereby accelerating training. Additionally, the language model is still trained using MLM loss as the loss function. After obtaining the language extraction model from the pre-trained language model, the model files are saved for later use.

[0063] Step S303: Obtain training sample data, which includes field annotation text with keyword labels.

[0064] Step S304: Select a batch of training corpus based on the training sample data; the batch of training corpus includes a portion of the field annotation text.

[0065] Step S305: Input the batch training corpus into the language extraction model to be trained for training, and determine the recognition loss value of the target loss function of the language extraction model to be trained; the target loss function is the truncated cross-entropy loss function.

[0066] Wherein, the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region; the predicted probability represents the probability that the keyword of the batch training corpus is the keyword label.

[0067] Step S306: If the batch training corpus is determined to be a second type of sample, the parameters of the language extraction model to be trained are not adjusted and the model is trained again.

[0068] Step S307: If the batch training corpus is determined to be a first-class sample, then determine whether the recognition loss value has converged to the preset target value. If the judgment result is no, then adjust the parameters of the language extraction model to be trained according to the determined recognition loss value and train again. If the judgment result is yes, then end the training and obtain the trained keyword recognition model.

[0069] The text keyword extraction method provided in the above embodiments obtains the annotation information to be processed contained in the text to be processed; the annotation information to be processed is input into a trained keyword recognition model to obtain the text keywords of the annotation information to be processed. The generated text keywords are used for data element mapping. The target loss function of the keyword recognition model is the truncated cross-entropy loss function, which allows the model to focus more on samples that are difficult for the model to distinguish. This allows the model to consciously distinguish ambiguous samples, effectively alleviates the overfitting of the model, and achieves accurate extraction of keywords from the original field annotations, thereby improving the accuracy of data element mapping.

[0070] Furthermore, this application embodiment also provides a method for training a keyword recognition model, used to train the keyword recognition model used in the above-mentioned text keyword extraction method. Figure 4 This application illustrates a method for training a keyword recognition model, which can be executed by a server or a terminal device. This embodiment uses server-side execution of the training method as an example.

[0071] like Figure 4As shown, the training method for this keyword recognition model specifically includes the following steps: Step S401: Obtain training sample data.

[0072] The training sample data includes field annotation text with keyword labels.

[0073] In practice, a training dataset can be pre-acquired, and training samples can be extracted from the training dataset when training the model. The training samples in the training dataset may include field annotation text with keyword labels.

[0074] For example, the field annotation text with keyword labels in the training sample data Train_data obtained by the server may originate from a data element benchmarking server. The data element benchmarking server stores the training dataset. The training sample data Train_data in the training dataset may include field annotation text with keyword labels.

[0075] Step S402: Based on the training sample data, select a batch of training corpus; the batch of training corpus includes a portion of the field annotation text.

[0076] In one embodiment of this application, the batch training corpus is obtained by randomly selecting from the field annotation text.

[0077] For example, a batch training corpus, Train_batch, is selected based on the training sample data Train_data. The batch training corpus Train_batch includes a portion of the field annotation text.

[0078] Step S403: Input the batch training corpus into the language extraction model to be trained for training, and determine the recognition loss value of the target loss function of the language extraction model to be trained; the target loss function is the truncated cross-entropy loss function.

[0079] Wherein, the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region; the predicted probability represents the probability that the keyword of the batch training corpus is the keyword label.

[0080] In practice, batch training corpora are input into the language extraction model to be trained, and the recognition loss value of the target loss function of the language extraction model to be trained is determined; the target loss function is the truncated cross-entropy loss function.

[0081] In some embodiments of this application, the language extraction model to be trained can segment the batch training corpus into words, and the resulting text representation can be a prediction value, which characterizes whether each token in the segmented sequence is a keyword, and its loss function adopts the cross-entropy function.

[0082] The cross-entropy function is as follows: For the same discrete event X , P(X) It is a distribution predicted by the model. Q(X) If this is their true distribution, then the cross-entropy between them is: .

[0083] Cross-entropy measures the difference between two distributions and is often used as the loss in classification problems. For any sample label, it gives a probability between 0 and 1. To allow the model to focus more on ambiguous samples around 0.5, while paying less attention to more certain samples such as 0.9 or 0.1, it is more effective in avoiding overfitting and allowing the model to focus more on those difficult-to-distinguish samples, thus optimizing the loss function.

[0084] In the embodiments of this application, a truncation function is added. : , Define a function h : .

[0085] in, m To set a truncation threshold. In embodiments of this application, m The value ranges between 0.5 and 1. In embodiments of this application, the value of the first control value can be... m The second control value can be 1- m .

[0086] when q When =1, f(1-mq) =0, f(qm) =1, at this time: .

[0087] For the above formula, when the prediction probability p>m At that time, the corresponding sample is the second type of sample. h =0, at which point the gradient will be truncated and such samples will not be updated; When predicting probability p Less than 1- mWhen the sample is of type 2, its gradient will not be updated.

[0088] When the predicted probability takes the value in [1- m , m When the gradient is within the range of ], the corresponding sample belongs to the first class of samples. At this time, the gradient is not truncated, and the gradient of the sample is updated.

[0089] At this point, we can obtain the cross-entropy loss function with hard truncation: .

[0090] Will The loss function of the language extraction model to be trained is used to back-update the model's parameters.

[0091] In step S404, if the batch training corpus is determined to be a first type of sample, it is determined whether the recognition loss value has converged to the preset target value. If the determination result is yes, the training ends and the trained keyword recognition model is obtained. If the determination result is no, the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and the model is trained again. If the batch training corpus is determined to be a second type of sample, the parameters of the language extraction model to be trained are not adjusted and the model is trained again.

[0092] In one embodiment, step S404, adjusting the parameters of the language extraction model to be trained based on the determined recognition loss value and retraining it, can specifically involve: The parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value until the recognition loss value converges to the preset target value. The resulting language extraction model is then used as the trained keyword recognition model.

[0093] Figure 5 This is a flowchart illustrating another method for training a keyword recognition model provided in an embodiment of this application. For example... Figure 5 As shown, the training method for this keyword recognition model specifically includes the following steps: Step S501: Collect a text dataset in the target domain.

[0094] In practice, a large amount of text datasets in the target domain can be collected first, and some simple text processing can be performed to facilitate the training of the language model.

[0095] Optionally, the target domain is the data element domain.

[0096] Step S502: Based on the text dataset, perform unsupervised language model training on the preset language model to obtain the language extraction model.

[0097] In one embodiment, during unsupervised language model training of the preset language model in step S502 above, the following steps can be used: Step A1: Based on the text dataset, perform unsupervised language model training on the pre-defined language model to obtain a pre-trained language model; the pre-trained language model includes the Bert encoder.

[0098] During unsupervised language model training based on a text dataset, a whole-word masking strategy is used. By using this strategy, when a subword of a complete word is masked, all other subwords belonging to that complete word are also masked, allowing the language extraction model to consciously recover complete words. Additionally, the LAMB optimizer can be used. The LAMB optimizer is suitable for large-batch data computation, employing a general adaptation strategy and providing insights into convergence through theoretical analysis, thus accelerating training. Furthermore, the language model is still trained using MLM loss as the loss function. After obtaining the language extraction model from the pre-trained language model, the model files are saved for later use.

[0099] Step A2 involves reconstructing the encoder of the pre-trained language model to obtain a language extraction model; the encoder is reconstructed to connect the TextCNN module after the Bert encoder.

[0100] In specific implementation, the pre-trained language model is reconstructed using an encoder to obtain a language extraction model. Specifically, this can be achieved by combining BERT and TextCNN as the encoder. A large amount of field-annotated data is used to identify keywords, which are then used as training data. This training data is input to the encoder as the input text. A typical BERT encoder has 13 layers. Except for the first embedding layer, each layer learns a different representation of the input text, and these representations contribute differently to the final task. Therefore, this embodiment, based on the idea of ​​utilizing the representations of each layer of the BERT encoder to enrich the final text representation, adds a TextCNN after the original BERT encoder, using the output of each BERT layer as an input channel representation of the TextCNN. By using the output of each BERT layer as input to the TextCNN, the TextCNN captures different representations of the same text, ultimately obtaining the encoder's text representation. The TextCNN convolutional kernel sizes are (2, 3, 4).

[0101] Step S503: Obtain training sample data.

[0102] The training sample data includes field annotation text with keyword labels.

[0103] Step S504: Select a batch of training corpus based on the training sample data; the batch of training corpus includes a portion of the field annotation text.

[0104] In practice, batch training corpora can be obtained by randomly selecting from field annotation text.

[0105] Step S505: Input the batch training corpus into the language extraction model to be trained for training, and determine the recognition loss value of the target loss function of the language extraction model to be trained; the target loss function is the truncated cross-entropy loss function.

[0106] Wherein, the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region; the predicted probability represents the probability that the keyword of the batch training corpus is the keyword label.

[0107] Step S506: If the batch training corpus is determined to be a first type of sample, then determine whether the recognition loss value has converged to the preset target value. If the determination result is yes, then end the training and obtain the trained keyword recognition model. If the determination result is no, then adjust the parameters of the language extraction model to be trained according to the determined recognition loss value and retrain. If the batch training corpus is determined to be a second type of sample, then do not adjust the parameters of the language extraction model to be trained and retrain.

[0108] The keyword recognition model training method in this application embodiment can enable the trained keyword recognition model to consciously distinguish ambiguous samples, effectively alleviate model overfitting, achieve accurate extraction of keywords from the original field annotations, and improve the accuracy of data element matching.

[0109] and Figure 1 The text keyword extraction method shown is based on the same inventive concept. This application also provides a text keyword extraction device, which can be deployed in a server or terminal device. Since this device corresponds to the text keyword extraction method of this application, and the principle by which this device solves the problem is similar to that of the method, the implementation of this device can refer to the implementation of the above method; repeated details will not be elaborated further.

[0110] Figure 6 This paper shows a schematic diagram of the structure of a text keyword extraction device provided in an embodiment of this application, such as... Figure 6 As shown, the text keyword extraction device includes an annotation information acquisition unit 601 and a keyword generation unit 602.

[0111] in, The annotation information acquisition unit 601 is used to acquire the annotation information to be processed contained in the text to be processed; The keyword generation unit 602 is used to input the annotation information to be processed into the trained keyword recognition model to obtain the text keywords of the annotation information. The keyword recognition model is obtained by training the language extraction model with training sample data, which includes field annotation text with keyword labels. The language extraction model is used to obtain the keywords of the input annotation information, and the trained keyword recognition model is obtained when the target loss function of the language extraction model converges to the preset target condition. The target loss function is the truncated cross-entropy loss function. The truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge. The predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value. The predicted probability of the second type of sample does not fall into the probability control region.

[0112] In an optional embodiment, the text keyword extraction device, such as Figure 7 As shown, it also includes a model training unit 701, which is used to train the keyword recognition model in the following manner: Obtain training sample data, which includes field annotation text with keyword labels; Based on the training sample data, batch training corpora are selected; the batch training corpora include a portion of the field annotation text. The batch training corpus is input into the language extraction model to be trained, and the recognition loss value of the target loss function of the language extraction model to be trained is determined. The target loss function is the truncated cross-entropy loss function. The truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge. The predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value. The predicted probability of the second type of sample does not fall into the probability control region. The predicted probability represents the probability that the keyword in the batch training corpus is the keyword label. If the batch training corpus is determined to be of the second type of sample, the parameters of the language extraction model to be trained will not be adjusted and the training will be performed again. If the batch training corpus is determined to be of the first type of sample, then it is determined whether the recognition loss value has converged to the preset target value. If the result is no, then the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and the model is trained again. If the result is yes, then the training ends and the trained keyword recognition model is obtained.

[0113] In an optional embodiment, the model training unit 701 is further configured to: collect a text dataset in the target domain; Based on a text dataset, an unsupervised language model is trained on a pre-defined language model to obtain a language extraction model.

[0114] and Figure 4 The training method for the keyword recognition model shown is based on the same inventive concept. This application also provides a training device for the keyword recognition model, which can be deployed in a server or terminal device. Since this device corresponds to the training method for the keyword recognition model in this application, and the principle by which this device solves the problem is similar to that of the method, the implementation of this device can refer to the implementation of the above method; repeated details will not be elaborated further.

[0115] Figure 8 This illustration shows a schematic diagram of a keyword recognition model training device provided in an embodiment of this application. This device is used to generate the keyword recognition model used in the third aspect, such as... Figure 8 As shown, the training device for the keyword recognition model includes a training data acquisition unit 801 and a model training execution unit 802.

[0116] The training data acquisition unit 801 is used to acquire training sample data, which includes field annotation text with keyword tags; and to select batch training corpora based on the training sample data; the batch training corpora include a portion of the field annotation text. The model training execution unit 802 is used to input batch training corpora into the language extraction model to be trained for training, and to determine the recognition loss value of the target loss function of the language extraction model to be trained; the target loss function is a truncated cross-entropy loss function; the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, and makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region; the predicted probability represents the probability that the keyword in the batch training corpora is a keyword label; if the batch training corpora are determined to be first type of sample, it is judged whether the recognition loss value has converged to the preset target value. If the judgment result is yes, the training ends and the trained keyword recognition model is obtained. If the judgment result is no, the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and retrained; and if the batch training corpora are determined to be second type of sample, the parameters of the language extraction model to be trained are not adjusted and retrained.

[0117] In one alternative embodiment, such as Figure 9As shown, the device also includes a model pre-training unit 901, which is used for: Before obtaining training sample data, collect a text dataset in the target domain; Based on a text dataset, an unsupervised language model is trained on a pre-defined language model to obtain a language extraction model.

[0118] In an optional embodiment, the model pre-training unit 901 is specifically used for: Based on the text dataset, an unsupervised language model training is performed on a pre-defined language model to obtain a pre-trained language model; the pre-trained language model includes the Bert encoder. The pre-trained language model is reconstructed by an encoder to obtain a language extraction model; the encoder is reconstructed to connect a TextCNN module after the Bert encoder.

[0119] In one alternative embodiment, the target domain is a data element domain.

[0120] In an optional embodiment, the model training execution unit 802 is specifically used for: The parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value until the recognition loss value converges to the preset target value. The resulting language extraction model is then used as the trained keyword recognition model.

[0121] Based on the same inventive concept as the above-described method embodiments, this application also provides an electronic device. This electronic device can be used for text keyword extraction or for training a keyword recognition model. In one embodiment, the electronic device can be a server; in other embodiments, it can be a terminal device or other electronic device. In this embodiment, the structure of the electronic device can be as follows: Figure 10 As shown, it includes a memory 101, a communication module 103, and one or more processors 102.

[0122] The memory 101 is used to store computer programs executed by the processor 102. The memory 101 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0123] Memory 101 may be volatile memory, such as random-access memory (RAM); memory 101 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 101 may be any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 101 may be a combination of the above-described memories.

[0124] The processor 102 may include one or more central processing units (CPUs) or digital processing units, etc. The processor 102 is used to implement the aforementioned text keyword extraction method or keyword recognition model training method when calling computer programs stored in the memory 101.

[0125] The communication module 103 is used to communicate with terminal devices and other servers.

[0126] This application does not limit the specific connection medium between the memory 101, communication module 103, and processor 102 described above. This disclosure embodiment... Figure 10 The memory 101 and the processor 102 are connected via a bus 104, and the bus 104 is in Figure 10 The connections between other components are shown in thick lines only and are not intended to be limiting. Bus 104 can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 10 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0127] The memory 101 stores a computer storage medium containing computer-executable instructions. These instructions are used to implement the text keyword extraction method or keyword recognition model training method of the embodiments of this application. The processor 102 is used to execute the aforementioned text keyword extraction method or keyword recognition model training method.

[0128] In addition, this application also provides a computer-readable storage medium storing a computer program that causes a computer to perform the method described in any of the above embodiments.

[0129] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the text keyword extraction method described in the above embodiments. The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0130] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method for extracting keywords from text, characterized in that, The text keywords are used for data element benchmarking; the method includes: Obtain the annotation information contained in the text to be processed; The annotation information to be processed is input into a trained keyword recognition model to obtain the text keywords of the annotation information to be processed; the annotation information to be processed is the original field annotation of the text to be processed. The keyword recognition model is obtained by training a language extraction model using training sample data. The training sample data includes field annotation text with keyword tags. The language extraction model is used to obtain keywords from the input annotation information. The trained keyword recognition model is obtained when the target loss function of the language extraction model converges to a preset target condition. The target loss function is a truncated cross-entropy loss function. The truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge. The predicted probability of the first type of sample falls within the probability control region between the first control value and the second control value. The predicted probability of the second type of sample does not fall within the probability control region. The keyword recognition model was trained in the following manner: Obtain training sample data, which includes field annotation text with keyword tags; Based on the training sample data, a batch training corpus is selected; the batch training corpus includes a portion of the field annotation text; The batch training corpus is input into the language extraction model to be trained for training, and the recognition loss value of the target loss function of the language extraction model to be trained is determined; the prediction probability represents the probability that the keywords in the batch training corpus are the keyword tags; If the batch training corpus is determined to be the second type of sample, the parameters of the language extraction model to be trained are not adjusted and the training is performed again. If the batch training corpus is determined to be the first type of sample, then it is determined whether the recognition loss value has converged to the preset target value. If the determination result is no, then the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and retrained. If the determination result is yes, then the training ends and the trained keyword recognition model is obtained.

2. The method according to claim 1, characterized in that, Before obtaining the training sample data, the method further includes: Collect text datasets in the target domain; Based on the text dataset, an unsupervised language model is trained on a preset language model to obtain the language extraction model.

3. A training method for a keyword recognition model, characterized in that, The method is used to generate the keyword recognition model used in claim 1, wherein the keyword recognition model is used to obtain the text keywords of the annotation information to be processed based on the annotation information to be processed contained in the text to be processed; the annotation information to be processed is the original field annotation of the text to be processed; the training method includes: Obtain training sample data, which includes field annotation text with keyword tags; Based on the training sample data, a batch training corpus is selected; the batch training corpus includes a portion of the field annotation text; The batch training corpus is input into the language extraction model to be trained for training, and the recognition loss value of the target loss function of the language extraction model to be trained is determined; the target loss function is a truncated cross-entropy loss function; the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region; the predicted probability represents the probability that the keyword in the batch training corpus is the keyword label; If the batch training corpus is determined to be the first type of sample, then it is determined whether the recognition loss value has converged to the preset target value. If the determination result is yes, then the training ends and the trained keyword recognition model is obtained. If the determination result is no, then the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and retrained. And, if the batch training corpus is determined to be the second type of sample, then the parameters of the language extraction model to be trained are not adjusted and retrained.

4. The training method according to claim 3, characterized in that, Before obtaining the training sample data, the method further includes: Collect text datasets in the target domain; Based on the text dataset, an unsupervised language model is trained on a preset language model to obtain the language extraction model.

5. The training method according to claim 4, characterized in that, The step of training a pre-defined language model using the text dataset to obtain the language extraction model includes: Based on the text dataset, an unsupervised language model is trained on a preset language model to obtain a pre-trained language model; the pre-trained language model includes a Bert encoder. The pre-trained language model is reconstructed by an encoder to obtain the language extraction model; the encoder reconstruction is to connect a TextCNN module after the Bert encoder.

6. The training method according to claim 4, characterized in that, The target domain is the data element domain.

7. The training method according to claim 3, characterized in that, The step of adjusting the parameters of the language extraction model to be trained based on the determined recognition loss value and then retraining it includes: The parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value until the recognition loss value converges to the preset target value. The resulting language extraction model is then used as the trained keyword recognition model.

8. A text keyword extraction device, characterized in that, The text keywords are used for data element matching; the device includes: The annotation information acquisition unit is used to acquire the annotation information to be processed contained in the text to be processed; A keyword generation unit is used to input the annotation information to be processed into a trained keyword recognition model to obtain the text keywords of the annotation information to be processed; the annotation information to be processed is the original field annotation of the text to be processed; the keyword recognition model is obtained by training a language extraction model using training sample data, the training sample data including field annotation text with keyword labels, the language extraction model is used to obtain the keywords of the input annotation information, and the trained keyword recognition model is obtained when the target loss function of the language extraction model converges to a preset target condition; the target loss function is a truncated cross-entropy loss function; the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, but makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region. The keyword recognition model was trained in the following manner: Obtain training sample data, which includes field annotation text with keyword tags; Based on the training sample data, a batch training corpus is selected; the batch training corpus includes a portion of the field annotation text; The batch training corpus is input into the language extraction model to be trained for training, and the recognition loss value of the target loss function of the language extraction model to be trained is determined; the prediction probability represents the probability that the keywords in the batch training corpus are the keyword tags; If the batch training corpus is determined to be the second type of sample, the parameters of the language extraction model to be trained are not adjusted and the training is performed again. If the batch training corpus is determined to be the first type of sample, then it is determined whether the recognition loss value has converged to the preset target value. If the determination result is no, then the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and retrained. If the determination result is yes, then the training ends and the trained keyword recognition model is obtained.

9. A training device for a keyword recognition model, characterized in that, The training device is used to generate the keyword recognition model used in claim 8, wherein the keyword recognition model is used to obtain the text keywords of the annotation information to be processed based on the annotation information to be processed contained in the text to be processed; the annotation information to be processed is the original field annotation of the text to be processed; the training device includes: A training data acquisition unit is used to acquire training sample data, which includes field annotation text with keyword tags; and to select batch training corpora based on the training sample data; the batch training corpora include a portion of the field annotation text. The model training execution unit is used to input the batch training corpus into the language extraction model to be trained for training, and to determine the recognition loss value of the target loss function of the language extraction model to be trained; the target loss function is a truncated cross-entropy loss function; the truncated cross-entropy loss function is a cross-entropy loss function that makes the loss value corresponding to the first type of sample converge, and makes the loss value corresponding to the second type of sample not converge; the predicted probability of the first type of sample falls into the probability control region between the first control value and the second control value; the predicted probability of the second type of sample does not fall into the probability control region; the predicted probability represents the probability that the keyword of the batch training corpus is the keyword label; if the batch training corpus is determined to be the first type of sample, it is determined whether the recognition loss value has converged to the preset target value; if the determination result is yes, the training ends and the trained keyword recognition model is obtained; if the determination result is no, the parameters of the language extraction model to be trained are adjusted according to the determined recognition loss value and retrained; and if the batch training corpus is determined to be the second type of sample, the parameters of the language extraction model to be trained are not adjusted and retrained.

10. A computer-readable storage medium storing a computer program therein, characterized in that: When the computer program is executed by a processor, it implements the method of any one of claims 1 to 2 or the method of any one of claims 3 to 7.

11. An electronic device, characterized in that, The device includes a memory and a processor, wherein the memory stores a computer program that can run on the processor, and when the computer program is executed by the processor, causes the processor to implement the method of any one of claims 1 to 2 or the method of any one of claims 3 to 7.

Citation Information

Patent Citations

  • Automatic keyword extraction method and device, equipment and storage medium

    CN113869044A

  • Interface document generation method and device, equipment and storage medium

    CN115904482A