A method for generating associated knowledge, an auxiliary annotation system and its application
Through the improved AMBERT model, combined with the Additional MASK token and self-attention mechanism, the problem of low manual annotation efficiency in language model training in intelligent consulting services is solved, and the recommendation performance and natural language generation capabilities of the language model are improved, especially suitable for Tax question and answer system.
Patent Information
- Application Number
- CN202210476772.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-30
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-04-30
AI Technical Summary
In the existing technology, the question and answer system of intelligent consulting services requires a large amount of manually annotated data in language model training, and cannot effectively screen and improve model recommendation performance, resulting in low efficiency. Especially in natural language generation tasks, the application of the BERT model is limited. .
An improved AMBERT model is proposed. By adding the Additional MASK token to the traditional BERT model and combining it with the self-attention mechanism, it performs multi-task training, generates question predictions and annotations, realizes the screening and annotation of related knowledge, and improves the recommendation of language models. performance and manual annotation efficiency.
It effectively reduces the manual annotation workload and improves the recommendation performance of the language model. It is especially suitable for natural language generation tasks and tax question and answer systems, and improves the application efficiency and accuracy of the model.
Smart Images

Figure CN114818699B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a method for generating associated knowledge, an auxiliary annotation system and applications. Background Art
[0002] With the continuous development of science and technology, the demand for intelligent information consulting services is growing in all walks of life, and it is becoming more and more common to realize intelligent consulting services through deep learning and natural language processing related technologies. Under this premise, the core point of the service is that the intelligent consulting service can accurately recommend answers to users' consulting questions, which puts forward higher requirements on the performance of the question-answering system in the consulting service.
[0003] In fact, language model recommendation services alone cannot achieve excellent performance in intelligent consulting services. However, constructing a data association structure that is easy for language models to understand can effectively improve the effectiveness of consulting services in providing answers. Moreover, in question-answering systems combined with deep learning, language model training often requires a large amount of correct, regular, and labeled data. Manual labeling to obtain this type of data will consume a lot of time and be inefficient. When the amount of data is large, manual labeling methods cannot determine whether the current data has already had similar annotations, or whether the language model used for recommendation needs to add this annotation to help improve the model recommendation performance.
[0004] For example, a Chinese patent with publication number CN111191442A discloses a similar question generation method, which obtains interactive corpus text data, annotates part of the interactive corpus text data, forms question text corpus data, uses the preprocessed question text corpus data to train the original machine learning model, generates a question recognition model, uses the question recognition model to perform question recognition on the unannotated interactive corpus text data, forms question corpus, calculates the similarity of the question corpus through a text similarity algorithm, generates similar question corpus of each category, and outputs similar question corpus of each category. For this, in fact, it is only a generation process, and does not involve the pre-screening of questions, that is, the workload of manual annotation is still very large and inefficient.
[0005] At the same time, since its launch in 2017, Transformers has been attracting much attention in the field of natural language processing. The Transformers model can provide better parallelization solutions and better long-distance dependency modeling performance. The most famous Transformers-based model that emerged later is BERT, which has achieved state-of-the-art results in benchmarks in many NLP tasks. To this day, BERT is still a must-have benchmark.
[0006] However, although BERT works very well, it is not clear why it works so well from the perspective of the model mechanism, which limits researchers' further assumptions and architecture improvements. Unlike CNN or other traditional model architectures, Transformers have no cognitive motivation, and the size of these models limits the ability to experiment with pre-training and the ability to conduct ablation studies. In the past year, a large number of studies have tried to understand why BERT has excellent performance but have not been realized. While BERT greatly improves the performance of various natural language understanding tasks, its bidirectional characteristics make it difficult to apply to natural language generation tasks, which limits BERT's continued performance superiority in the field of NLG. Summary of the invention
[0007] The present invention solves the problems existing in the prior art, provides an optimized method for generating associated knowledge, an auxiliary annotation system and application, and proposes an AMBERT model for natural language generation. This model improves the MASK method and training method in the traditional BERT model, and adds an Additional MASK token. The training task target of the model adds a seq2seq prediction task using the Additional MASK tag on the basis of the traditional cloze-style MASKed prediction target, and realizes the unified input of multi-task training targets by regulating the self-attention of the AMBERT model.
[0008] The technical solution adopted by the present invention is a method for generating associated knowledge. For any standard question, the AMBERT model generates N generated questions as the associated knowledge of the standard question, and screens and annotates them to complete the generation of associated knowledge of the current standard question; repeats until the generation of associated knowledge of all standard questions is completed; N≥0;
[0009] The AMBERT model sets the MASK token in the BERT model to the improved hybrid MASK token, performs generation question prediction, and obtains the N generation questions.
[0010] Preferably, the AMBERT model includes an input layer and an output layer, the input layer is used to input a standard question and obtain a corresponding original token sequence, and the output layer is used to output N generated questions;
[0011] In the model, for the original token sequence, a preset proportion p1 of tokens is taken for mixed MASK token operation during the model training phase, and other tokens of a preset proportion p2 are randomly replaced during model training; p1>p2>0;
[0012] Generate predictions and label tasks to obtain the loss function of the training target;
[0013] The model is adjusted using the value of the loss function until the model meets the preset requirements.
[0014] Preferably, the hybrid MASK token is, for any MASK token, setting the Additional MASK token to correspond one-to-one with the position of the MASK token, and making the original token sequence correspond to the hybrid MASK token through position encoding.
[0015] Preferably, for the token of the preset ratio p1, the mixed MASK token is a single-word MASK and / or a continuous MASK, wherein the single-word MASK is a MASK operation performed on a single character, and the continuous MASK is a MASK operation performed on a phrase consisting of continuous characters.
[0016] Preferably, in the generation, prediction and labeling task,
[0017] For each position’s corresponding MASK token, use the original token except for the position encoding to make predictions.
[0018] Set the prediction order for the Additional MASK token corresponding to each position, where the prediction order of each token of the continuous MASK is consistent; for any Additional MASK token, use the Additional MASK token corresponding to its own position encoding, all MASK tokens, the original token that has not been MASKed, and the original token corresponding to the Additional MASK token that has been predicted in the previous order to make a prediction;
[0019] After each completion, obtain the loss function loss of the training target all ,
[0020] loss all =loss [M] +loss [aM]
[0021] Among them, loss [aM] =-∑ x∈D E M logΠ m∈M p(x M |x |M ),
[0022] loss [M] =-∑x∈D logП m∈M p(x m |x |M ),
[0023] x ∣M Represents all other MASK tokens except the target MASK, ∏ m∈M p(x m |x / M represents the sum of all the token probabilities after being masked in the sentence, EM represents the expectation of random sampling factorization of the input text, D is the set of all training corpora, and M is the set of MASK tokens in a single training corpus;
[0024] Based on the loss function loss all Adjust the model until it meets the preset requirements.
[0025] Preferably, after N generating questions are generated, the N generating questions are preprocessed, and based on the preprocessing results, the generating questions are screened by a search and matching algorithm to obtain M final generating questions, where N≥M≥0.
[0026] Preferably, the preprocessing is to segment each generated question and then process and concatenate the segmented generated questions based on preset synonyms and stop words.
[0027] Preferably, based on the search and matching algorithm, the processed and spliced generated questions are input. If the search and matching algorithm can output the corresponding standard question and / or similar questions of any generated question, the current generated question will not be used as a candidate for the relevant knowledge annotation of this standard question. Otherwise, the generated question will be used as the associated knowledge of the current standard question.
[0028] An associated knowledge auxiliary annotation system, the system comprising a front-end operation unit and a back-end generation unit;
[0029] The front-end operation unit includes an output interface and an input interface, wherein the output interface is used to output the associated knowledge of the standard question generated by the back-end generation unit, and the input interface is used to input the annotation content;
[0030] The back-end generation unit is an application of the associated knowledge generation method.
[0031] An application of the associated knowledge auxiliary annotation system is applied to a tax question and answer system, wherein the tax question and answer system generates associated knowledge of standard questions in the tax industry using an associated knowledge generation method.
[0032] The present invention relates to an optimized associated knowledge generation method, an auxiliary annotation system and an application. For any standard question, an AMBERT model is used to generate N generated questions as the associated knowledge of the standard question, which are screened and annotated to complete the generation of associated knowledge of the current standard question; this is repeated until the generation of associated knowledge of all standard questions is completed; N≥0; and an AMBERT model is proposed, and the MASK token in the BERT model is set to an improved hybrid MASK token to predict the generated questions and obtain the N generated questions; this method is applied to a back-end generation unit of an associated knowledge auxiliary annotation system, and the associated knowledge of the standard question generated by the back-end generation unit is output through the output interface of a front-end operation unit, and the annotation content is manually input through an input interface, and the annotation workload is much less than the generated questions directly generated from the standard question; this associated knowledge auxiliary annotation system can be applied to a tax question-answering system.
[0033] While constructing the easy-to-understand corpus required for the language model of the question-answering system, the present invention also solves the difficulty of manual labeling. By screening out the data that needs to be labeled by the model, the recommendation performance of the language model is improved and the efficiency of manual labeling is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is a flow chart of the method of the present invention;
[0035] Figure 2 A mixed MASK set for the original token in an embodiment of the present invention;
[0036] Figure 3 is the focus range when predicting the MASK token at position p2 in an embodiment of the present invention;
[0037] Figure 4 is the focus range of Additional MASK token when predicting in sequence in the embodiment of the present invention;
[0038] Figure 5 This is a schematic diagram of the search recommendation model judgment process in the present invention;
[0039] Figure 6 It is the generated result for the corresponding question sentence after processing part of the given corpus in the present invention. DETAILED DESCRIPTION
[0040] The present invention is further described in detail below in conjunction with embodiments, but the protection scope of the present invention is not limited thereto.
[0041] The present invention relates to a method for generating associated knowledge based on an AMBERT model, wherein, for a user question, a search algorithm in the prior art will match a number of similar questions, and select a similar question with the highest confidence, the similar question corresponds to a standard question and a corresponding answer, and then the question-answering system will recommend the answer to the user as an answer to the user question. In this process, all similar questions are called relevant knowledge of the standard question, that is, associated knowledge;
[0042] In the workflow of the search algorithm, the design of similar questions is an important link. Once similar questions are designed under standard questions with different semantics, the question-answering system will push wrong answers to users. Therefore, when generating related knowledge for standard questions, it is necessary to ensure the semantic consistency between the standard questions and the related knowledge, and remove sentences that do not need to be added as related knowledge for the standard questions in the generated sentences. The screened sentences are output to the front end, and after manual selection by the knowledge processing specialist, the generated questions that can be used as related knowledge for the standard questions are selected and finally marked as the final similar questions of the standard questions.
[0043] like Figure 1 As shown, in the method, for any standard question, the AMBERT model is used to generate N generated questions as the associated knowledge of the standard question, which are screened and labeled to complete the generation of associated knowledge of the current standard question; this is repeated until the generation of associated knowledge of all standard questions is completed; N≥0;
[0044] The AMBERT model sets the MASK token in the BERT model to the improved hybrid MASK token, performs generation question prediction, and obtains the N generation questions.
[0045] In the present invention, NLG tasks are performed based on the AMBERT model, so that the model can perform generative predictions while performing traditional BERT training, and combine search fields, such as FAQ models and rule processing in the tax field, to assist manual labeling, improve manual labeling efficiency, and avoid repeated labeling and useless labeling.
[0046] In the present invention, the model adjusts the MASK method and the ratio of characters in the random mask sentence, and while retaining the MASK token in the original BERT pre-training, denoted as [M], a mixed MASK token is proposed, that is, on the basis of the MASK token, an Additional MASK token is added, denoted as [aM], and the position of [aM] corresponds one-to-one to [M]. The overall training task objectives of the model are divided into traditional cloze-style MASK prediction objectives and seq2seq prediction tasks using Additional MASK tags, and unified input of multi-task training objectives is achieved through regulation.
[0047] In the present invention, the N generated questions generated by the AMBERT model are associated knowledge that has not been further screened. They need to be screened and labeled to complete the generation of the final associated knowledge of the current standard question.
[0048] The AMBERT model includes an input layer and an output layer, the input layer is used to input standard questions and obtain the corresponding original token sequence, and the output layer is used to output N generated questions;
[0049] In the model, for the original token sequence, a preset proportion p1 of tokens is taken for mixed MASK token operation during the model training phase, and other tokens of a preset proportion p2 are randomly replaced during model training; p1>p2>0;
[0050] Generate predictions and label tasks to obtain the loss function of the training target;
[0051] The model is adjusted using the value of the loss function until the model meets the preset requirements.
[0052] The hybrid MASK token is, for any MASK token, setting the Additional MASK token to correspond to the position of the MASK token one by one, and making the original token sequence correspond to the hybrid MASK token through position encoding.
[0053] For the token of the preset ratio p1, the mixed MASK token is a single-word MASK and / or a continuous MASK, wherein the single-word MASK is a MASK operation performed on a single character, and the continuous MASK is a MASK operation performed on a phrase consisting of continuous characters.
[0054] In the generation, prediction and labeling tasks,
[0055] For each position’s corresponding MASK token, use the original token except for the position encoding to make predictions.
[0056] Set the prediction order for the Additional MASK token corresponding to each position, where the prediction order of each token of the continuous MASK is consistent; for any Additional MASK token, use the Additional MASK token corresponding to its own position encoding, all MASK tokens, the original token that has not been MASKed, and the original token corresponding to the Additional MASK token that has been predicted in the previous order to make a prediction;
[0057] After each completion, obtain the loss function loss of the training target all ,
[0058] loss all ==loss [M] +loss [aM]
[0059] Among them, loss [aM] =-∑ x∈D E M logΠ m∈M p(x M |x |M ),
[0060] loss [M] =-∑ x∈D logΠ m∈M p(x m |x |M ),
[0061] x |M Represents all other MASK tokens except the target MASK, ∏ m∈M p(x m |x |M ) represents the sum of all the token probabilities after being masked in the sentence, E M represents the expectation of random sampling factorization of the input text, D is the set of all training corpora, and M is the set of MASK tokens in a single training corpus;
[0062] Based on the loss function loss all Adjust the model until it meets the preset requirements.
[0063] In the present invention, different from the traditional BERT masking strategy, p1 is randomly selected in the original token sequence for MASK operation. For example, p1 is 30%; among the 30% MASK tokens, they are divided into single-word MASK and continuous MASK. Generally speaking, single-word MASK and continuous MASK can account for 60% and 40% of the total number of MASK tokens. It should be noted that continuous MASK is performed on professional vocabulary in a certain field, rather than traditional random operations, and the fields include taxation. In addition to the 30% MASK operation, the model can also randomly replace random tokens of p2 proportion during training. For example, p2 is 10%;
[0064] Based on the above, for example, assuming the input text is "What is the tax rate of personal income tax?", a possible situation after the MASK operation is, "What is the tax rate of [MASK][MASK][MASK][MASK]?" or, "What is the [MASK] rate of individual [MASK][MASK][MASK]?".
[0065] In the present invention, the traditional MASK prediction target is retained as a cloze-type prediction task, that is, other tokens except the masked target token are used to predict the target mask token, and different tokens are predicted independently of each other.
[0066] In the present invention, a Seq2Seq prediction target is added to the original BERT training target, in order to achieve simultaneous optimization of two task targets while also achieving Seq2Seq training, so that the model has the ability to generate natural language;
[0067] Specifically, in the mask stage of the training corpus, an Additional MASK token is introduced, here [aM], to achieve unified input of the model, thereby realizing multi-task training; when performing the MASK operation, two tokens are inserted at the same time when the character is masked, [M] and [aM], corresponding to the MASK token and the Additional MASK token respectively, and the position encoding used by these two tokens is the same as the position encoding of the masked character. In the feature extraction of the Transformer structure, the relative position of the input characters does not affect the model's judgment of the character order. This is because the Transformer structure obtains the position information of the token from the input position encoding. Therefore, taking "What is the personal income tax rate?" as an example, Figure 2 As shown in the figure, after attaching MASK token and Additional MASKtoken, the input sequence of the final model is x 个 x 人 x 所 x 得 x 税 [M][aM][M][aM][M][aM]x 的 x 税 [M][aM]x 率 x ? , and the corresponding position encoding is p1p2p3p4p5p3p3p4p4p5p5p6p7p7p7p8p9. The position encoding is used to correspond the masked original token with its [M] and [aM].
[0068] In the present invention, during training, Figure 2 In the input sequence, other text input tokens other than the original input on the position encoding can be used when predicting the MASK token ([M]token), such as Figure 3 As shown in the figure, when predicting the [M] token at position p3, the original tokens of p1, p2, p4, p5, p6, p7, p8, and p9 are obtained, as shown by the solid arrows.
[0069] In the present invention, when predicting Additional MASK token ([aM]token), it is first necessary to clarify that there is a prediction order; the single-word MASK is processed normally, and for continuous MASK, even if there is a sequence in the display of this embodiment, the processing methods are essentially the same, and there is no sequence between them. This type of tax professional vocabulary that is continuously MASKed can be called span mask token, and the same token is used for prediction;
[0070] It uses its own [aM]token and all [M]tokens, the original tokens that have not been MASKed, and the original tokens corresponding to the Additional MASK tokens that have been predicted in the previous order to make predictions. This prediction method achieves the Seq2Seq training effect.
[0071] In order to achieve this prediction method, the self-attention range of the [aM] tokens that predict different orders is controlled. The specific implementation method is as follows: Figure 4 As shown, the prediction order is first p7 and then the [aM]token of p3, p4, and p5; for the [aM]token corresponding to p7, the [aM]token of p7, all the [M]tokens, and the original token that is not MASKed are taken for prediction, as shown by the solid arrows; for the [aM]token corresponding to p3, p4, and p5, the [aM]token of p3, p4, and p5, all the [M]tokens, the original token that is not MASKed, and the original token corresponding to p7 are taken for prediction, as shown by the dotted arrows.
[0072] In the present invention, a series of values are obtained by calculating the loss function, and the minimum loss function is taken as the optimization goal, and the corresponding results are output as the result of a round of screening; on the basis of setting the loss function for training the model, the minimum loss function value is taken as the optimization goal, and the AdamW optimizer, 5e-5 learning rate, 50epochs, and 1 million user questions in the tax field and standard questions are trained on the corpus to iterate the model.
[0073] After N generating questions are generated, the N generating questions are preprocessed, and based on the preprocessing results, the generating questions are screened by a search and matching algorithm to obtain M final generating questions, where N≥M≥0.
[0074] The preprocessing is to segment each generated question, and then process and splice the segmented generated questions based on preset synonyms and stop words.
[0075] Based on the search and matching algorithm, the processed and spliced generated questions are input. If the search and matching algorithm can output the corresponding standard question and / or similar questions of any generated question, the current generated question will not be used as a candidate for the relevant knowledge annotation of this standard question. Otherwise, this generated question will be used as the associated knowledge of the current standard question.
[0076] In the present invention, for a certain standard question, the same semantic sentence generation model is used to generate a specified number N of generated questions, which are then processed through synonyms and stop words and screened by a search and matching algorithm. The generated questions finally obtained are displayed as the relevant knowledge front end of the target standard question to knowledge specialists for screening and annotation.
[0077] In the present invention, in the stop word and synonym processing stage, it is first necessary to perform word segmentation on the target sentence, such as using the jieba word segmentation library, and replace the sentence with stop words and synonyms obtained through actual cases consulted by industry users; for example, for the question "Hello, how do I declare personal income tax?", the result after word segmentation is "Hello / , / personal income tax / how / to / declare / ?", and after synonym replacement and stop word processing, the result is "personal income tax / how / to / declare", and the final splicing result is "how to declare personal income tax"; after synonym replacement and stop word processing, the same sentences are removed.
[0078] In the present invention, Figure 5 As shown, after synonym and stop word replacement and deduplication processing, each generated sentence is used as the input of the search and matching algorithm model in the question-answering system. If the search and matching model can search out the corresponding standard question of its input sentence (such as the generated question 8 corresponding to the solid arrow corresponds to the similar question 1), it means that this sentence no longer needs to be labeled to correspond to the standard question and realize normal question answering. In this case, the generated question will not be used as a candidate for the relevant knowledge annotation of the standard question, that is, it will not be used as related knowledge that needs to be a candidate. The generated questions that cannot be recommended by this model (such as generated question 3, with an × indicating that it cannot correspond to the corresponding standard question and / or similar question of any generated question) are retained as front-end display items.
[0079] In the present invention, an embodiment is given. After a part of the given corpus has been subjected to the above process, the generated result for the corresponding question is as follows: Figure 6As shown, the first column is the input question, that is, the sentence that needs to be labeled with relevant knowledge, the second column is the output result of the AMBERT model after fine-tuning with a large amount of tax corpus, the third column is the corresponding similarity, and the last column is the generated sentence displayed on the filtered front end, which is used to provide labeled candidates for knowledge specialists.
[0080] In order to achieve the above content, the present invention also relates to a computer-readable storage medium, on which an associated knowledge generation program based on the AMBERT model is stored. When the program is executed by a processor, the associated knowledge generation method based on the AMBERT model is implemented, thereby constructing an easy-to-understand corpus required for the language model of the question-answering system, while solving the difficulties of manual labeling. By screening out the data that needs to be labeled by the model, the recommendation performance of the language model is improved and the efficiency of manual labeling is improved, which is particularly suitable for the field of tax consulting.
[0081] In order to achieve the above content, the present invention also proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the above-mentioned method for generating associated knowledge based on the AMBERT model is implemented, which is particularly suitable for the field of tax consulting.
[0082] The present invention also relates to an associated knowledge auxiliary annotation system, the system comprising a front-end operation unit and a back-end generation unit;
[0083] The front-end operation unit includes an output interface and an input interface, wherein the output interface is used to output the associated knowledge of the standard question generated by the back-end generation unit, and the input interface is used to input the annotation content;
[0084] The back-end generation unit is an application of the associated knowledge generation method.
[0085] In the present invention, the front-end operation unit of the system generally includes a display screen and an input device. The corpus to be trained is input into the system through the back-end generation unit. After executing the associated knowledge generation method, the content to be annotated is pushed to the front-end operation unit, and the annotation and / or selection are completed manually to realize the auxiliary annotation of the associated knowledge.
[0086] The present invention also relates to an application of the associated knowledge auxiliary annotation system, which is applied to a tax question and answer system, wherein the tax question and answer system generates associated knowledge of standard questions in the tax industry using an associated knowledge generation method.
[0087] The present invention is particularly suitable for question-answering systems with many details and elements, including but not limited to tax question-answering systems. However, after experiments, the present invention was applied in the tax question-answering system to obtain better auxiliary labeling effect.
[0088] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0089] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0090] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0091] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0092] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0093] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for generating associated knowledge, Features: For any standard question, use the improved BERT model to generate N generated questions as the associated knowledge of the standard question, and perform screening and labeling to complete the generation of associated knowledge of the current standard question; Repeat until the associated knowledge generation of all standard questions is completed; N ≥ 0; The improved BERT model sets the MASK token in the BERT model to the improved hybrid MASK token, performs generation question prediction, and obtains the N generation questions; The improved BERT model includes an input layer and an output layer, the input layer is used to input a standard question and obtain a corresponding original token sequence, and the output layer is used to output N generated questions; In the model, for the original token sequence, tokens with a preset ratio p1 are taken for mixed MASK token operation during the training phase of the model, and other tokens with a preset ratio p2 are randomly replaced during model training; p1>p2>0; the mixed MASK token is, for any MASK token, the position of the Additional MASK token is set to correspond to the position of the MASK token one by one, the position codes used by the two tokens are the same as the position codes of the masked characters, and the original token sequence is corresponded to the mixed MASK token through the position code; Generate predictions and label tasks to obtain the loss function of the training target; The model is adjusted according to the value of the loss function until the model meets the preset requirement of minimizing the loss function.
2. A method for generating associated knowledge according to claim 1, Features: For the token of the preset ratio p1, the mixed MASK token is a single-word MASK and / or a continuous MASK, wherein the single-word MASK is a MASK operation performed on a single character, and the continuous MASK is a MASK operation performed on a phrase consisting of continuous characters.
3. A method for generating associated knowledge according to claim 2, Features: In the generation, prediction and labeling tasks, For each position’s corresponding MASK token, use the original token except for the position encoding to make predictions. Set the prediction order for the prediction of the Additional MASK token corresponding to each position, where the prediction order of each token of the continuous MASK is consistent; for any Additional MASK token, use the Additional MASK token corresponding to its own position encoding, all MASK tokens, the original token that has not been MASKed, and the original token corresponding to the Additional MASK token that has been predicted in the previous order to make a prediction; After each completion, obtain the loss function loss of the training target all , loss all =loss [M] +loss [aM] Among them, loss [aM] =-∑ x∈D E M log∏ m∈M p(x M |x |M ), loss [M] =-∑ x∈D log∏ m∈M p(x m |x |M ), x |M Represents all other MASK tokens except the target MASK, ∏ m∈M p(x m |x |M ) represents the sum of all the token probabilities after being masked in the sentence, E M represents the expectation of random sampling factorization of the input text, D is the set of all training corpora, and M is the set of MASK tokens in a single training corpus; based on the loss function loss all Adjust the model until it meets the preset requirement of minimizing the loss function.
4. A method for generating associated knowledge according to claim 1, Features: After generating N generated questions, preprocessing is performed on the N generated questions, wherein the preprocessing is to segment each generated question, and then process and splice the segmented generated questions based on preset synonyms and stop words; Based on the preprocessing results, the generated questions are screened by the search and matching algorithm, and the processed and spliced generated questions are input. If the search and matching algorithm can output the corresponding standard question and / or similar questions of any generated question, the current generated question will not be used as a candidate for the relevant knowledge annotation of this standard question. Otherwise, the generated question will be used as the associated knowledge of the current standard question to obtain M final generated questions, N≥M≥0.
5. A related knowledge assisted annotation system, Features: The system comprises a front-end operation unit and a back-end generation unit; The front-end operation unit includes an output interface and an input interface, wherein the output interface is used to output the associated knowledge of the standard question generated by the back-end generation unit, and the input interface is used to input the annotation content; The back-end generation unit is an application of the associated knowledge generation method according to any one of claims 1 to 4.
6. An application of the associated knowledge auxiliary annotation system according to claim 5, Features: Applied to a tax question-answering system, the tax question-answering system generates associated knowledge of standard questions in the tax industry using an associated knowledge generation method.
Citation Information
Patent Citations
Similar problem generation method and device, equipment and medium
CN111191442A
Natural language problem generation method in civil construction information field based on Transformer
CN112559702A
Government affair problem generation method and device
CN113569033A
Unified pre-training method for generating Chinese questions based on word lattices and relative position embedding
CN113743095A
Similar statement generation method and device based on pre-training language model
CN113807074A
