Text description generation method and system for tabular data

CN116484837BActive Publication Date: 2026-11-03SHANGHAI JIAOTONG UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310444562.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-23
Publication Date
2026-11-03
Estimated Expiration
2043-04-23

AI Technical Summary

Technical Problem

Existing methods for generating table text need to be improved in terms of efficiency and accuracy when there is a lack of manually labeled training sample data.

Method used

By using an adaptive fusion prompt template method, a text generation model is constructed by using a BERT pre-trained model for text sentence vector generation and similarity calculation, combining the SCI-pacy model for text segmentation, using the BART-base model for text generation, and inserting a knowledge adaptor into the model to learn background knowledge information.

Benefits of technology

In the absence of training sample data, high-quality table-related descriptions are generated, which improves the efficiency of information collection and the accuracy and fluency of text generation, and reduces the need for a large amount of manual data collection and annotation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116484837B_ABST
    Figure CN116484837B_ABST
Patent Text Reader

Abstract

The application provides a kind of text description generation method and system of tabular data, comprising: obtaining training sample data and pre-processing;Text generation model is constructed, and the pre-processed training sample data is used as the input of text generation model to pre-train;Original tabular data in training sample data is detected, and the detected entity is masked, to obtain corresponding mask prompt template data;According to mask prompt template data and model parameters of text generation model pre-training, training is carried out, and background knowledge information related to table and model fine-tuning are reconstructed to obtain the final text generation model;The pre-processed training sample data is input into the final text generation model, and then the text description of tabular data is generated.The application can be used to generate the corresponding description of the related table content by collecting relevant background knowledge without a large amount of artificial labeling under the condition of a small amount of samples.Fast understanding of article information improves research efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, specifically to a method and system for generating text descriptions of tabular data. More particularly, it relates to a method and system for generating text descriptions of tabular data using adaptive fusion prompt templates. Background Technology

[0002] Sentence vector generation is a computational technique in natural language processing used to process and encode sentence text. First, word embedding is performed on each word in the sentence, embedding a high-dimensional space containing the number of words into a much lower-dimensional continuous vector space. Then, the sentence vector is calculated based on the word vector representations of the entire sentence, yielding the vector representation of the whole sentence. After encoding the entire sentence into sentence vectors, it can be used to calculate semantic similarity between sentences and improve the training speed of language models.

[0003] Natural Language Generation (NLG) is a part of Natural Language Processing that generates natural language from knowledge bases or logical forms and their representations.

[0004] SCI-pacy is a Python toolkit for natural language processing in the biomedical field, released by the Allen Institute for Artificial Intelligence in 2019. It provides various functions including word segmentation, sentence segmentation, proper noun tagging, and named entity recognition, as well as multiple corresponding models based on biomedical corpora such as CRAFT, JNLPBA, BC5CDR, and BIONLP13CG. Its models include lightweight, medium, and heavyweight models that implement the complete natural language processing pipeline of paCy, as well as corpus-based named entity recognition models. It is one of the latest and most effective tools for natural language processing in the specific academic field of biomedicine.

[0005] Patent document CN111581929A discloses a table-based text generation method and related apparatus. The method includes: obtaining triples in the table, each triple including a row name, a column name, and numerical information corresponding to the row and column names; extracting features from the triples to obtain feature representations of the triples, the feature representations including at least contextual information of the triples and the magnitude relationship between the numerical information of the triples and the numerical information of other triples; constructing a feature representation set from the feature representations of multiple triples in the table, and filtering the feature representation set to obtain a target information sequence in the table; and constructing a text representation of the table based on the target information sequence.

[0006] However, in the case of existing methods for generating table text in the absence of manually labeled training sample data, there is still room for improvement in the efficiency of data collection and the accuracy and fluency of text generation. Summary of the Invention

[0007] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method and system for generating text descriptions of tabular data.

[0008] A method for generating text descriptions of tabular data according to the present invention includes:

[0009] Step 1: Obtain training sample data;

[0010] Step 2: Preprocess the training sample data;

[0011] Step 3: Construct a text generation model by using the preprocessed training sample data as input to the text generation model for pre-training.

[0012] Step 4: Perform entity detection on the original table data in the training sample data, and perform masking on the detected entities to obtain the corresponding mask prompt template data;

[0013] Step 5: Train the text generation model based on the mask prompt template data and the pre-trained model parameters, reconstruct the background knowledge information related to the table and fine-tune the model to obtain the final text generation model;

[0014] Step 6: Input the preprocessed training sample data into the final text generation model to generate text descriptions corresponding to the table data.

[0015] Preferably, the training sample data includes tabular data, reference descriptions corresponding to the tables, and background knowledge information related to the tables;

[0016] Step 2 includes the following sub-steps:

[0017] Step 2.1: Serialize the table data to convert it into a continuous string;

[0018] Step 2.2: Train a text extractor based on the serialized table data, the corresponding reference description of the table, and the relevant background knowledge information. Calculate the text similarity based on the training results and obtain at least three relevant background knowledge statements corresponding to each input table data.

[0019] Step 2.3: By inserting characters to concatenate the table data and the extracted relevant background knowledge statements, the concatenated data text is obtained.

[0020] Preferably, step 2.2 includes:

[0021] Step 2.2.1: Process the background information related to the table, use the SCI-pacy model to process the text data, and perform sentence segmentation on the background information;

[0022] Step 2.2.2: Using preset templates, sequentially concatenate the table and its corresponding reference description, and the table and its corresponding background information; the preset templates are as follows:

[0023] [Table Data: Table Reference Description]

[0024] [Table Data: Relevant Background Information]

[0025] Step 2.2.3: Input the sentence-segmented data into the BERT model for training and calculate the similarity of the entire sentence vector projection;

[0026] Step 2.2.4: Sort the results of the vector projection similarity and select the three sentences with high similarity as reference background knowledge.

[0027] Preferably, the text generation model is optimized based on the Bart-large pre-trained model, and the optimization includes:

[0028] A knowledge adaptor is inserted at the end of each layer of the encoder and decoder of the Bart-large pre-trained model.

[0029] Preferably, the process of reconstructing the background knowledge information related to the table includes loading the model parameters saved by the pre-training of the text generation model, freezing all model parameters except for the knowledge adapter, inputting the mask prompt template data into the text generation model to train the reconstruction of the background knowledge information related to the table, and then the knowledge adapter learns the expression of the background knowledge information related to the table, while saving the learned knowledge adapter parameters.

[0030] Model fine-tuning includes loading the model parameters saved during training with background knowledge information related to the reconstructed table, freezing the learned knowledge adaptor parameters and activating all model parameters except the knowledge adaptor, inputting the preprocessed training sample data into the text generation model for training, and obtaining the final text generation model.

[0031] A text description generation system for tabular data according to the present invention includes:

[0032] Module M1: Acquire training sample data;

[0033] Module M2: Preprocesses the training sample data;

[0034] Module M3: Constructs a text generation model, using preprocessed training sample data as input to the text generation model for pre-training;

[0035] Module M4: Performs entity detection on the original table data in the training sample data, and performs masking on the detected entities to obtain the corresponding mask prompt template data;

[0036] Module M5: Trains the model based on the mask prompt template data and the pre-trained model parameters of the text generation model, reconstructs the background knowledge information related to the table and fine-tunes the model to obtain the final text generation model;

[0037] Module M6: Input the preprocessed training sample data into the final text generation model to generate text descriptions corresponding to the tabular data.

[0038] Preferably, the training sample data includes tabular data, reference descriptions corresponding to the tables, and background knowledge information related to the tables;

[0039] The module M2 includes the following sub-modules:

[0040] Module M2.1: Performs serialization processing on the table data, converting the table data into a continuous string;

[0041] Module M2.2: Train a text extractor based on the serialized table data, the corresponding reference description of the table, and relevant background knowledge information. Calculate text similarity based on the training results and obtain at least three relevant background knowledge statements corresponding to each input table data.

[0042] Module M2.3: By inserting characters to concatenate table data and extracting relevant background knowledge statements, the concatenated data text is obtained.

[0043] Preferably, module M2.2 includes:

[0044] Module M2.2.1: Processes background information related to tables, uses the SCI-pacy model to process text data, and performs sentence segmentation on the background information;

[0045] Module M2.2.2: Concatenates tables and their corresponding reference descriptions, and tables and their corresponding background information, using preset templates respectively; the preset templates are as follows:

[0046] [Table Data: Table Reference Description]

[0047] [Table Data: Relevant Background Information]

[0048] Module M2.2.3: Input the data after sentence segmentation into the BERT model for training and calculate the similarity of the entire sentence vector projection;

[0049] Module M2.2.4: Sort the results of the vector projection similarity and select the three sentences with high similarity as reference background knowledge.

[0050] Preferably, the text generation model is optimized based on the Bart-large pre-trained model, and the optimization includes:

[0051] A knowledge adaptor is inserted at the end of each layer of the encoder and decoder of the Bart-large pre-trained model.

[0052] Preferably, the process of reconstructing the background knowledge information related to the table includes loading the model parameters saved by the pre-training of the text generation model, freezing all model parameters except for the knowledge adapter, inputting the mask prompt template data into the text generation model to train the reconstruction of the background knowledge information related to the table, and then the knowledge adapter learns the expression of the background knowledge information related to the table, while saving the learned knowledge adapter parameters.

[0053] Model fine-tuning includes loading the model parameters saved during training with background knowledge information related to the reconstructed table, freezing the learned knowledge adaptor parameters and activating all model parameters except the knowledge adaptor, inputting the preprocessed training sample data into the text generation model for training, and obtaining the final text generation model.

[0054] Compared with the prior art, the present invention has the following beneficial effects:

[0055] 1. This invention utilizes a BERT pre-trained model for text sentence vector generation and text similarity calculation, an SCI-pacy model for text segmentation, a BART-bae model for text generation, and a reconstructed BART model to add a knowledge adaptor to learn relevant background knowledge. This enables the generation of high-quality, relevant descriptions from table content even in the absence of training sample data. In this scenario, for specific domains, it achieves relatively superior table data text generation performance without requiring extensive manual data collection and annotation, improving information collection efficiency and allowing readers to quickly understand the table content.

[0056] 2. This invention improves the accuracy and fluency of generating table-related text descriptions by optimizing the large-scale language model BART-large and proposing targeted training methods for the optimized model. Attached Figure Description

[0057] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0058] Figure 1 This is a schematic diagram of the method flow of the present invention.

[0059] Figure 2 This is a schematic diagram of the text generation method for table data in an embodiment of the present invention.

[0060] Figure 3 This is a sample of table data in this invention, and a schematic diagram of the table serialization effect.

[0061] Figure 4 This invention provides a template for generating entity detection and masking processing prompts related to table-based background knowledge.

[0062] Figure 5 This is a training framework diagram for the overall model training in this invention. Detailed Implementation

[0063] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0064] According to the present invention, a method for generating text descriptions of tabular data is provided, such as... Figure 1 As shown, it includes:

[0065] Step 1: Obtain training sample data. The training sample data includes tabular data, corresponding reference descriptions for the tables, and background information related to the tables.

[0066] Step 2: Preprocess the training sample data. Step 2 includes the following sub-steps:

[0067] Step 2.1: Serialize the table data to convert it into a continuous string.

[0068] Step 2.2: Train a text extractor based on the serialized table data, the corresponding reference descriptions, and relevant background knowledge information. Calculate text similarity based on the training results and obtain at least three relevant background knowledge statements for each input table data. Step 2.2 includes:

[0069] Step 2.2.1: Process the background information related to the table. Use the SCI-pacy model to process the text data and segment the background information into sentences. Step 2.2.2: Using preset templates, sequentially concatenate the table and its corresponding reference description, and the table and its corresponding background information. The preset templates are as follows:

[0070] [Table Data: Table Reference Description]

[0071] [Table Data: Relevant Background Information]

[0072] Step 2.2.3: Input the sentence-segmented data into the BERT model for training and calculate the vector projection similarity of the entire sentence. Step 2.2.4: Sort the sentences according to the vector projection similarity results and select the three sentences with the highest similarity as reference background knowledge.

[0073] Step 2.3: By inserting characters to concatenate the table data and the extracted relevant background knowledge statements, the concatenated data text is obtained. The characters include, for example... <bkg>Special characters. For example, if the table data is "Name is Trump" and the extracted background information statement is "rump is one of the presidents of the USA", then... <bkg>The special character concatenation is Name is Trump <bkg>Trump is one of the presidents of USA.

[0074] Step 3: Construct a text generation model. Use the preprocessed training sample data as input to pre-train the text generation model. The text generation model is optimized based on the Bart-large pre-trained model. The optimization includes inserting a knowledge adaptor at the end of each layer of the encoder and decoder of the Bart-large pre-trained model.

[0075] Step 4: Perform entity detection on the original table data in the training sample data, and mask the detected entities to obtain corresponding masked prompt template data. Specifically, entity detection includes performing entity detection based on the table content, matching the background knowledge related to each table with the table content, and indicating that a table-related entity has been detected when the matching degree reaches a threshold, such as 70% or 80%. The masking process includes replacing the detected entities with characters, for example... <mask>character.

[0076] Step 5: Train the text generation model based on the mask prompt template data and the pre-trained model parameters. Reconstruct the table-related background knowledge information and fine-tune the model to obtain the final text generation model. Reconstructing the table-related background knowledge information includes loading the model parameters saved during pre-training, freezing all model parameters except for the knowledge adaptor, inputting the mask prompt template data into the text generation model for training to reconstruct the table-related background knowledge information, thereby allowing the knowledge adaptor to learn how to express the table-related background knowledge information, and saving the learned knowledge adaptor parameters. Model fine-tuning includes loading the model parameters saved during the training of reconstructing the table-related background knowledge information, freezing the learned knowledge adaptor parameters and activating all model parameters except for the knowledge adaptor, inputting the pre-processed training sample data into the text generation model for training, and obtaining the final text generation model.

[0077] Step 6: Input the preprocessed training sample data into the final text generation model to generate text descriptions corresponding to the table data.

[0078] This invention aims to address the challenge of compensating for missing information in the absence of manually generated table sample data by collecting relevant background knowledge about the table content, thereby improving the fluency and accuracy of generated table-related descriptions. The method includes using a BERT pre-trained model for text sentence vector generation and text similarity calculation, an SCI-Spacy model for text segmentation, a BART-base model for text generation, and reconstructing the BART model to add a knowledge adaptor to learn relevant background knowledge.

[0079] Furthermore, the tables are a combination of English references and appendices. Figures 2 to 5 The method of the present invention is described in detail below:

[0080] Step S1: Serialize the table data used for training few-sample table text generation using a template, converting the structured table data into a readable continuous string, such as... Figure 3 As shown. Specifically, a dataset of few-shot table data text generation is obtained. The dataset used in this embodiment is few-shot table text generation data based on Wikipedia, and the data includes three different domains: people, books, and songs. For the training dataset, unlabeled background knowledge data related to the tables is obtained, with at least 10 sentences of background data description for each table. The above dataset is divided into training samples, validation samples, and test samples. Four different few-shot data training sets are set, for example, 50, 100, 200, and 500 samples; the validation sample set is set to 1000 samples for each set; the test sample sets are 13587 test samples from the people dataset, 11879 test samples from the song dataset, and 5252 test samples from the book dataset. The tables are serialized. In this embodiment, the data used is in English, so the serialization template is "table attribute is table content", for example, "Name isTrump".

[0081] Step S2: Train the text extractor using the table data, corresponding reference descriptions, and related background knowledge. By training the sentence vector model, calculate text similarity based on the training results, and obtain the three most relevant sentences of background knowledge corresponding to each input table data. Specifically, use the SCI-Spacy model to process the table-related background knowledge, segment the background knowledge into sentences, and store the segmented sentences in a list data structure. Use the [Table Data: Table Reference Description] template to concatenate the table and its corresponding reference description, and use the [Table Data: Related Background Knowledge] template to sequentially concatenate the table with each sentence of background knowledge. Store the concatenated data in a list data structure. Input the segmented data into the BERT model for training and calculate the entire sentence vector projection to determine similarity. The vector projection similarity calculation formula is:

[0082]

[0083] Among them, proj b () represents the projection of a onto b, |a| and |b| represent the magnitudes of vectors a and b, respectively, and a·b represents the dot product of vectors a and b. The similarity results calculated according to the vector projection formula are sorted, and three sentences with high similarity are selected from the summary as reference background knowledge.

[0084] Step S3: By inserting special characters to concatenate the table data and the extracted relevant background knowledge, the concatenated data text is obtained. This data text is used to pre-train the text generation model. For the extracted table-related background sentences, special characters are inserted... <bkg>"Concatenate with table content, for example, "Name is Trump" <bkg>Trump is one of the president of USA.”

[0085] Step S4: Based on the open-source large model Bart-large, insert knowledge adaptors into each layer of the encoder and decoder. Specifically, modify the model based on Bart-large from the Huggingface open-source model library. Insert knowledge adaptors based on the AdapterHub open-source adaptor model at the end of each layer of the Bart-large encoder and decoder.

[0086] Step S5: Input the data text processed in Step S3 into the model constructed in Step S4 for tabular data text generation and training. Specifically, determine the input and output of the model training for tabular data text generation, where the tabular data incorporating background knowledge is the model input, and the reference description of the table is the model output. The purpose is to train the model to generate descriptions for tables. Set the hyperparameters of the training model. In this embodiment, the learning rate is set to 0.00003, the Adam optimizer is used, and training is performed on an NVIDIA GeoForce RTX 3090 GPU. The training test results are shown in Table 1 below:

[0087] Table 1

[0088]

[0089] In this context, TS stands for Train-Size, representing the amount of training data. ROUGE4 and BLEU-4 are evaluation metrics for measuring the quality of generated text. ROUGE (Recall-Oriented Understudy for Gisting Evaluation) is an automatic method for evaluating text summarization and machine translation. It's a recall-oriented evaluation method that measures the similarity between the output of an automatic summary or machine translation and a human-generated reference summary or translation. The ROUGE metric ranges from 0 to 1, with higher values ​​indicating greater similarity. BLEU (Bilingual Evaluation Understudy) is a method for automatically evaluating the quality of machine translation. It assesses translation quality by comparing the similarity between computer-generated and human-generated translations. BLEU primarily calculates similarity by comparing the n-gram overlap between the machine translation and the reference translation, where n can range from 1 to 4. Specifically, BLEU first divides the machine translation result into different n-grams, then calculates the frequency of each n-gram in the machine translation result within the reference translation result, then calculates the exact match rate of the n-grams, and finally calculates the BLEU score using the geometric mean. BLEU values ​​range from 0 to 1, with higher values ​​indicating a higher similarity between the machine translation result and the reference translation result. Generally, a BLEU value greater than 0.4 indicates good machine translation quality, and a BLEU value greater than 0.6 indicates very good machine translation quality.

[0090] In summary, as shown in Table 1, the performance of the pre-trained text generation model gradually improves with an increase in the number of training samples, even with a small number of training samples. However, the overall generation performance is still slightly insufficient, especially with 50 and 100 training samples.

[0091] Step S6: Process the collected and organized background information related to the tables, and perform entity detection based on the table content. A heuristic algorithm is used to match each piece of background information related to the table with the table content. If the substring matching rate exceeds 70%, it indicates that a table-related entity has been detected.

[0092] Step S7: Mask the table-related entities detected in Step S6 using the special character "". <mask>"Covering up entities, that is, by using" <mask>"Character substitution detected entities, such as..." Figure 4 As shown.

[0093] Step S8: Based on the model trained in Step S5, freeze all parameters except for the knowledge adaptor, and input the mask data processed in Step S7 into the model to reconstruct the background knowledge. Based on the reconstruction process, learn the textual expressions and background knowledge related to the table. Specifically, such as... Figure 5 As shown, the model parameters saved in step S5 are loaded, all model parameters except for the knowledge adaptor are frozen, and then the data processed in step S7 is input into the model for training to reconstruct table-related background knowledge. The data input is the table background knowledge template with a mask processed in step S7, and the data output is the unprocessed table-related background knowledge. Through this step, the knowledge adaptor will learn the expression of table-related background knowledge, and at the same time save the learned parameters of the knowledge adaptor.

[0094] Step S9: Freeze all knowledge adaptor parameters learned in Step S8 and activate other model parameters. Input the training samples processed in Step S3 into the final text generation model for tabular data text generation training. Specifically, as follows... Figure 5 As shown, the model parameters saved in step S8 are loaded, the knowledge adaptor parameters learned in step S8 are frozen, and the remaining model parameters are activated. The table data processed in step S3 is input for model training of table data text generation. The model input is table data concatenated with three sentences of background knowledge, and the model output is a reference description of the table. The purpose of this is to enable the model to learn text generation for table data. The training and testing results of the final text generation model after the knowledge adaptation period, based on the pre-trained text generation model, are shown in Table 2 below:

[0095] Table 2

[0096]

[0097] As can be seen from Table 2, the final text generation model after knowledge adaptor tuning shows a significant improvement over the first pre-trained text generation model. The training results of the first pre-trained text output model are shown in Table 1.

[0098] The present invention also provides a text description generation system for tabular data. Those skilled in the art can implement the text description generation system for tabular data by executing the steps of the text description generation method for tabular data. That is, the text description generation method for tabular data can be understood as a preferred embodiment of the text description generation system for tabular data.

[0099] A text description generation system for tabular data according to the present invention includes:

[0100] Module M1: Acquire training sample data. The training sample data includes tabular data, corresponding reference descriptions for the tables, and background information related to the tables.

[0101] Module M2: Preprocesses the training sample data. Module M2 includes the following sub-modules:

[0102] Module M2.1: Serializes tabular data, converting it into a continuous string.

[0103] Module M2.2: Trains a text extractor based on the serialized tabular data, the corresponding reference descriptions, and relevant background knowledge. It calculates text similarity based on the training results and obtains at least three relevant background knowledge statements for each input tabular data. Module M2.2 includes:

[0104] Module M2.2.1: Processes background information related to tables, using the SCI-pacy model to process text data and segment the background information into sentences. Module M2.2.2: Concatenates tables and their corresponding reference descriptions, and tables and their corresponding background information, using preset templates. The preset templates are as follows:

[0105] [Table Data: Table Reference Description]

[0106] [Table Data: Relevant Background Information]

[0107] Module M2.2.3: Inputs the sentence-segmented data into the BERT model for training and calculates the vector projection similarity of the entire sentence. Module M2.2.4: Sorts the sentences according to the vector projection similarity results and selects the three sentences with the highest similarity as reference background knowledge.

[0108] Module M2.3: By inserting characters to concatenate table data and extracting relevant background knowledge statements, the concatenated data text is obtained.

[0109] Module M3: Constructs a text generation model by using preprocessed training sample data as input for pre-training. The text generation model is optimized based on the Bart-large pre-trained model, with optimizations including inserting a knowledge adaptor at the end of each layer of the encoder and decoder in the Bart-large pre-trained model.

[0110] Module M4: Performs entity detection on the original table data in the training sample data, and performs masking on the detected entities to obtain the corresponding mask prompt template data.

[0111] Module M5: Trains the text generation model based on the masked prompt template data and pre-trained model parameters, reconstructs table-related background knowledge, and fine-tunes the model to obtain the final text generation model. Reconstructing table-related background knowledge includes loading the model parameters saved during pre-training, freezing all model parameters except for the knowledge adaptor, inputting the masked prompt template data into the text generation model for training to reconstruct table-related background knowledge, allowing the knowledge adaptor to learn how to express table-related background knowledge, and saving the learned knowledge adaptor parameters. Model fine-tuning includes loading the model parameters saved during the reconstructed table-related background knowledge training, freezing the learned knowledge adaptor parameters and activating all model parameters except for the knowledge adaptor, inputting pre-processed training sample data into the text generation model for training, and obtaining the final text generation model.

[0112] Module M6: Input the preprocessed training sample data into the final text generation model to generate text descriptions corresponding to the tabular data.

[0113] This invention analyzes, trains, and deploys a BERT-based text extractor for the task of extracting the most relevant background knowledge. For the task of generating table text, it analyzes, trains, and deploys a text generator for the Bart-large model. For cases with limited training samples, it analyzes and modifies the Bart-large model by adding a knowledge adaptor module, and analyzes the pre-training process for the knowledge adaptor. While freezing other parameters, it trains the knowledge adaptor to reconstruct table-related background knowledge, learning the table content expression method through the background knowledge reconstruction process to compensate for the lack of training samples. Finally, it analyzes the overall pre-training process, training the model to learn and utilize the table-related background knowledge learned by the knowledge adaptor while retaining the parameters learned by the knowledge adaptor, thereby improving the fluency and accuracy of table text generation.

[0114] Those skilled in the art will understand that, in addition to implementing the system, apparatus, and their modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system, apparatus, and their modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; alternatively, modules for implementing various functions can be considered both software programs implementing the method and structures within the hardware component.

[0115] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.< / mask> < / mask> < / bkg> < / bkg> < / mask> < / bkg> < / bkg> < / bkg>

Claims

1. A method for generating text descriptions of tabular data, characterized in that, include: Step 1: Obtain training sample data; Step 2: Preprocess the training sample data; Step 3: Construct a text generation model by using the preprocessed training sample data as input to the text generation model for pre-training. Step 4: Perform entity detection on the original table data in the training sample data, and perform masking on the detected entities to obtain the corresponding mask prompt template data; Step 5: Train the text generation model based on the mask prompt template data and the pre-trained model parameters, reconstruct the background knowledge information related to the table and fine-tune the model to obtain the final text generation model; Step 6: Input the preprocessed training sample data into the final text generation model to generate text descriptions corresponding to the table data; The text generation model is optimized based on the Bart-large pre-trained model, and the optimization includes: A knowledge adaptor is inserted at the end of each layer of the encoder and decoder of the Bart-large pre-trained model; The background knowledge information related to the reconstruction of the table includes loading the model parameters saved by the pre-training of the text generation model, freezing all model parameters except for the knowledge adapter, inputting the mask prompt template data into the text generation model to train the background knowledge information related to the reconstruction of the table, and then the knowledge adapter learns the expression of the background knowledge information related to the table, while saving the learned knowledge adapter parameters. Model fine-tuning includes loading the model parameters saved during training with background knowledge information related to the reconstructed table, freezing the learned knowledge adaptor parameters and activating all model parameters except the knowledge adaptor, inputting the preprocessed training sample data into the text generation model for training, and obtaining the final text generation model.

2. The method for generating text descriptions of tabular data according to claim 1, characterized in that, The training sample data includes tabular data, corresponding reference descriptions for the tables, and background information related to the tables. Step 2 includes the following sub-steps: Step 2.1: Serialize the table data to convert it into a continuous string; Step 2.2: Train a text extractor based on the serialized table data, the corresponding reference descriptions of the tables, and the relevant background knowledge information. Calculate the text similarity based on the training results and obtain at least three relevant background knowledge statements corresponding to each input table data. Step 2.3: By inserting characters to concatenate the table data and the extracted relevant background knowledge statements, the concatenated data text is obtained.

3. The method for generating text descriptions of tabular data according to claim 2, characterized in that, Step 2.2 includes: Step 2.2.1: Process the background information related to the table, use the SCI-pacy model to process the text data, and perform sentence segmentation on the background information; Step 2.2.2: Using preset templates, sequentially concatenate the table and its corresponding reference description, and the table and its corresponding background information; the preset templates are as follows: [Table Data: Table Reference Description] [Table Data: Relevant Background Information] Step 2.2.3: Input the sentence-segmented data into the BERT model for training and calculate the similarity of the entire sentence vector projection; Step 2.2.4: Sort the results of the vector projection similarity and select the three sentences with high similarity as reference background knowledge.

4. A system for generating text descriptions of tabular data, characterized in that, include: Module M1: Acquire training sample data; Module M2: Preprocesses the training sample data; Module M3: Constructs a text generation model, using preprocessed training sample data as input to the text generation model for pre-training; Module M4: Performs entity detection on the original table data in the training sample data, and performs masking on the detected entities to obtain the corresponding mask prompt template data; Module M5: Trains the model based on the mask prompt template data and the pre-trained model parameters of the text generation model, reconstructs the background knowledge information related to the table and fine-tunes the model to obtain the final text generation model; Module M6: Input the preprocessed training sample data into the final text generation model to generate text descriptions corresponding to the tabular data; The text generation model is optimized based on the Bart-large pre-trained model, and the optimization includes: A knowledge adaptor is inserted at the end of each layer of the encoder and decoder of the Bart-large pre-trained model; The background knowledge information related to the reconstruction of the table includes loading the model parameters saved by the pre-training of the text generation model, freezing all model parameters except for the knowledge adapter, inputting the mask prompt template data into the text generation model to train the background knowledge information related to the reconstruction of the table, and then the knowledge adapter learns the expression of the background knowledge information related to the table, while saving the learned knowledge adapter parameters. Model fine-tuning includes loading the model parameters saved during training with background knowledge information related to the reconstructed table, freezing the learned knowledge adaptor parameters and activating all model parameters except the knowledge adaptor, inputting the preprocessed training sample data into the text generation model for training, and obtaining the final text generation model.

5. The text description generation system for tabular data according to claim 4, characterized in that, The training sample data includes tabular data, corresponding reference descriptions for the tables, and background information related to the tables. The module M2 includes the following sub-modules: Module M2.1: Performs serialization processing on the table data, converting the table data into a continuous string; Module M2.2: Train a text extractor based on the serialized table data, the corresponding reference description of the table, and relevant background knowledge information. Calculate text similarity based on the training results and obtain at least three relevant background knowledge statements corresponding to each input table data. Module M2.3: By inserting characters to concatenate table data and extracting relevant background knowledge statements, the concatenated data text is obtained.

6. The text description generation system for tabular data according to claim 5, characterized in that, The module M2.2 includes: Module M2.2.1: Processes background information related to tables, uses the SCI-pacy model to process text data, and performs sentence segmentation on the background information; Module M2.2.2: Concatenates tables and their corresponding reference descriptions, and tables and their corresponding background information, using preset templates respectively; the preset templates are as follows: [Table Data: Table Reference Description] [Table Data: Relevant Background Information] Module M2.2.3: Input the data after sentence segmentation into the BERT model for training and calculate the similarity of the entire sentence vector projection; Module M2.2.4: Sort the results of the vector projection similarity and select the three sentences with high similarity as reference background knowledge.

Citation Information

Patent Citations

  • Table-based text generation method and related device

    CN111581929A

  • Table description processing method and device, equipment and storage medium

    CN110377910A

  • Model training method and device, electronic equipment and storage medium

    CN112883180A