Table description text generation model training method and device, and terminal equipment

CN117763136BActive Publication Date: 2026-09-22BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211137192.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-19
Publication Date
2026-09-22
Estimated Expiration
2042-09-19

AI Technical Summary

Benefits of technology

[0072]本公开的实施例提供的技术方案至少带来以下有益效果:在获取包括多个样本表格分别对应的序列文本及每个样本表格对应的标注描述文本的训练数据集后,可以利用序列文本中至少一个第一分词,替换标注描述文本中至少一个第二分词,以生成参考文本,并将序列文本及参考文本输入初始生成模型,以获取初始生成模型输出的预测描述文本,及在参考文本的基础上输出预测描述文本中各第一描述词的第一概率值,之后,可以根据各第一描述词与标注描述文本中对应的第二描述词之间的差异及概率值,确定初始生成模型对应的损失值,并基于损失值对初始生成模型进行修正,直至获取表格描述文本生成模型。由此,通过替换标注描述文本中的部分分词,以生成更符合实际使用场景的参考文本,从而基于更符合实际使用场景的参考文本及序列文本训练生成模型,有利于提高生成模型的鲁棒性,进而提高了描述文本的准确性与流利度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117763136B_ABST
    Figure CN117763136B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method and device for training a table description text generation model, wherein the method comprises: obtaining a training data set comprising sequence texts corresponding to a plurality of sample tables respectively and annotated description texts; replacing at least one second word in the annotated description text with at least one first word in the sequence text to generate a reference text; inputting the sequence text and the reference text into an initial generation model, obtaining a predicted description text output by the initial generation model, and outputting a first probability value of each first description word in the predicted description text based on the reference text; determining a loss value corresponding to the initial generation model according to the difference between each first description word and the corresponding second description word in the annotated description text and the probability value; and correcting the initial generation model based on the loss value until a table description text generation model is obtained. Thus, the generation model is trained based on the reference text which is more consistent with the actual use scenario, and the accuracy and fluency of the description text are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a training method, apparatus, and terminal device for a table-described text generation model. Background Technology

[0002] Table description text generation technology is a technique that uses computer technology to transform structured table information into descriptive text that is easier for humans to understand. Table description text generation technology is widely used in various fields.

[0003] In related technologies, it is usually necessary to filter key information in a table and generate corresponding descriptive text based on the filtered key information. However, the descriptive text generated in this way has poor fluency. Summary of the Invention

[0004] This disclosure proposes a training method and apparatus for a table-described text generation model to improve the accuracy and fluency of the described text. The technical solution of this disclosure is as follows:

[0005] According to a first aspect of the present disclosure, the present disclosure provides a method for training a table description text generation model, including:

[0006] Obtain the training dataset, which includes the sequence text corresponding to multiple sample tables and the labeled description text corresponding to each sample table;

[0007] Use at least one first word from the sequence text to replace at least one second word from the labeled description text to generate reference text;

[0008] Input the sequence text and reference text into the initial generation model to obtain the predicted description text output by the initial generation model, and output the probability value of each first descriptive word in the predicted description text based on the reference text.

[0009] Based on the differences and probability values ​​between each first descriptor and the corresponding second descriptor in the labeled descriptive text, the loss value corresponding to the initial generation model is determined;

[0010] The initial generation model is modified based on the loss value until a table description text generation model is obtained.

[0011] In this disclosure, after obtaining a training dataset comprising sequence texts corresponding to multiple sample tables and labeled descriptive texts corresponding to each sample table, at least one first word in the sequence text can be used to replace at least one second word in the labeled descriptive text to generate reference text. The sequence text and reference text are then input into an initial generation model to obtain the predicted descriptive text output by the initial generation model, and the first probability value of each first descriptive word in the predicted descriptive text based on the reference text. Subsequently, the loss value corresponding to the initial generation model can be determined based on the difference and probability value between each first descriptive word and the corresponding second descriptive word in the labeled descriptive text. The initial generation model is then corrected based on the loss value until a table descriptive text generation model is obtained. Therefore, by replacing some words in the labeled descriptive text to generate reference text that better matches the actual usage scenario, and training the generation model based on the reference text and sequence text that better match the actual usage scenario, the robustness of the generation model is improved, thereby enhancing the accuracy and fluency of the descriptive text.

[0012] In one possible implementation of the first aspect of this disclosure, at least one second word in the labeled descriptive text is replaced with at least one first word in the sequence text to generate reference text, including:

[0013] Obtain the first word segmentation sequence with the first number of occurrences in the annotated description text;

[0014] In the sequence text, a first number of second word segments are obtained sequentially at a preset starting position. The number of words contained in each second word segment sequence is the same as the number of words contained in the corresponding first word segment sequence, and the number of words between each second word segment sequence is the same as the number of words between each corresponding first word segment sequence.

[0015] Each second word segmentation sequence is used to replace the corresponding first word segmentation sequence in the labeled descriptive text to generate reference text.

[0016] In one possible implementation of the first aspect of this disclosure, the loss value corresponding to the initial generation model is determined based on the difference and probability value between each first descriptor and the corresponding second descriptor in the labeled descriptive text, including:

[0017] The weight of each first descriptor is determined according to the preset weight allocation rules;

[0018] Based on the differences, probability values, and weights between each first descriptor and its corresponding second descriptor in the labeled descriptive text, the loss value corresponding to the initial generation model is determined.

[0019] In one possible implementation of the first aspect of this disclosure, the weight of each first descriptor is determined according to a preset weight allocation rule, including:

[0020] Each first descriptor is matched against the sequence text to determine whether each first descriptor is contained in the sequence text;

[0021] Each third word in the reference text is matched against the sequence text to determine the second number of third words contained in the sequence text;

[0022] The weight of the first descriptive word contained in the sequence text is determined to be a preset value;

[0023] The weight of the first descriptor not included in the sequence text is determined based on the ratio of the second quantity to the total number of third segment words contained in the reference text.

[0024] In one possible implementation of the first aspect of this disclosure, obtaining the training dataset includes:

[0025] Obtain the pre-training dataset, which includes multiple sample tables and sample description text corresponding to each sample table;

[0026] The sample tables are formatted to determine the corresponding structure text for each sample table;

[0027] The structural text and sample description text are segmented into words to obtain the sequence text corresponding to the structural text and the labeled description text corresponding to the sample description text.

[0028] According to a second aspect of the present disclosure, an embodiment of the present disclosure provides a method for generating table description text, including:

[0029] Get the table to be processed;

[0030] Preprocess the table to be processed to determine the sequence text corresponding to the table;

[0031] The sequence text is input into the generation model to generate the descriptive text corresponding to the table to be processed, wherein the generation model is trained according to the method of any one of claims 1-5 above.

[0032] In this disclosure, after obtaining the table to be processed, the table can be preprocessed to determine the sequence text corresponding to the table. The sequence text is then input into a generative model to generate descriptive text corresponding to the table. Thus, the generative model directly predicts the descriptive text based on the sequence text corresponding to the table, thereby improving the fluency of the descriptive text.

[0033] In one possible implementation of the second aspect of this disclosure, the table to be processed is preprocessed to determine the sequence text corresponding to the table to be processed, including:

[0034] The table to be processed is formatted to determine the corresponding structural text.

[0035] The structured text is segmented to obtain the corresponding sequence text.

[0036] According to a third aspect of the present disclosure, an embodiment of the present disclosure provides a training apparatus for a table description text generation model, comprising:

[0037] The acquisition module is used to acquire the training dataset, which includes the sequence text corresponding to multiple sample tables and the annotation description text corresponding to each sample table.

[0038] The replacement module is used to replace at least one second word in the labeled description text with at least one first word in the sequence text to generate reference text;

[0039] The generation module is used to input the sequence text and reference text into the initial generation model to obtain the predicted description text output by the initial generation model, and to output the probability value of each first descriptive word in the predicted description text based on the reference text.

[0040] The determination module is used to determine the loss value corresponding to the initial generation model based on the difference and probability value between each first descriptor and the corresponding second descriptor in the labeled descriptive text;

[0041] The correction module is used to correct the initial generation model based on the loss value until a table description text generation model is obtained.

[0042] In one possible implementation of the third aspect of this disclosure, the replacement module described above is used for:

[0043] Obtain the first word segmentation sequence with the first number of occurrences in the annotated description text;

[0044] In the sequence text, a first number of second word segments are obtained sequentially at a preset starting position. The number of words contained in each second word segment sequence is the same as the number of words contained in the corresponding first word segment sequence, and the number of words between each second word segment sequence is the same as the number of words between each corresponding first word segment sequence.

[0045] Each second word segmentation sequence is used to replace the corresponding first word segmentation sequence in the labeled descriptive text to generate reference text.

[0046] In one possible implementation of the third aspect of this disclosure, the determining module is used for:

[0047] The weight of each first descriptor is determined according to the preset weight allocation rules;

[0048] Based on the differences, probability values, and weights between each first descriptor and its corresponding second descriptor in the labeled descriptive text, the loss value corresponding to the initial generation model is determined.

[0049] In one possible implementation of the third aspect of this disclosure, the determining module is used for:

[0050] Each first descriptor is matched against the sequence text to determine whether each first descriptor is contained in the sequence text;

[0051] Each third word in the reference text is matched against the sequence text to determine the second number of third words contained in the sequence text;

[0052] The weight of the first descriptive word contained in the sequence text is determined to be a preset value;

[0053] The weight of the first descriptor not included in the sequence text is determined based on the ratio of the second quantity to the total number of third segment words contained in the reference text.

[0054] In one possible implementation of the third aspect of this disclosure, the acquisition module is used for:

[0055] Obtain the pre-training dataset, which includes multiple sample tables and sample description text corresponding to each sample table;

[0056] The above-mentioned device also includes a preprocessing module for:

[0057] The sample tables are formatted to determine the corresponding structure text for each sample table;

[0058] The structural text and sample description text are segmented into words to obtain the sequence text corresponding to the structural text and the labeled description text corresponding to the sample description text.

[0059] According to a fourth aspect of the present disclosure, an apparatus for generating table description text is provided, comprising:

[0060] The acquisition module is used to acquire the table to be processed.

[0061] The preprocessing module is used to preprocess the table to be processed in order to determine the sequence text corresponding to the table.

[0062] The generation module is used to input the sequence text into the generation model to generate the descriptive text corresponding to the table to be processed, wherein the generation model is trained according to the method of any one of claims 1-5 above.

[0063] In one possible implementation of the fourth aspect of this disclosure, the preprocessing module is used for:

[0064] The table to be processed is formatted to determine the corresponding structural text.

[0065] The structured text is segmented to obtain the corresponding sequence text.

[0066] According to a fifth aspect of the present disclosure, a terminal device is provided, comprising:

[0067] processor;

[0068] Memory used to store processor-executable instructions;

[0069] The processor is configured to execute instructions to implement the training method of the table description text generation model as described in the first aspect embodiment above; or to implement the table description text generation method as described in the second aspect embodiment above.

[0070] According to a sixth aspect of the present disclosure, a computer-readable storage medium is provided, wherein when the instructions in the computer-readable storage medium are executed by a processor of a terminal device, the terminal device is able to perform a training method for a table description text generation model as described in the first aspect above; or perform a table description text generation method as described in the second aspect above.

[0071] According to a seventh aspect of the present disclosure, a computer program product is provided, including a computer program that is executed by a processor as a training method for a table description text generation model as described in the first aspect embodiment above; or as a table description text generation method as described in the second aspect embodiment above.

[0072] The technical solution provided by the embodiments of this disclosure brings at least the following beneficial effects: After obtaining a training dataset including sequence texts corresponding to multiple sample tables and labeled descriptive texts corresponding to each sample table, at least one first word in the sequence text can be used to replace at least one second word in the labeled descriptive text to generate reference text. The sequence text and reference text are then input into an initial generation model to obtain the predicted descriptive text output by the initial generation model, and the first probability value of each first descriptive word in the predicted descriptive text is output based on the reference text. Subsequently, the loss value corresponding to the initial generation model can be determined based on the difference and probability value between each first descriptive word and the corresponding second descriptive word in the labeled descriptive text, and the initial generation model is corrected based on the loss value until a table descriptive text generation model is obtained. Thus, by replacing some words in the labeled descriptive text to generate reference text that is more in line with the actual use scenario, and training the generation model based on the reference text and sequence text that is more in line with the actual use scenario, it is beneficial to improve the robustness of the generation model, thereby improving the accuracy and fluency of the descriptive text.

[0073] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0074] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0075] Figure 1 A flowchart illustrating a training method for a table description text generation model provided in the first embodiment of this disclosure;

[0076] Figure 2 A flowchart illustrating another training method for a table-described text generation model provided in the second embodiment of this disclosure;

[0077] Figure 3 A flowchart illustrating another training method for a table-described text generation model provided in the third embodiment of this disclosure;

[0078] Figure 4 A flowchart illustrating a method for generating table description text according to the fourth embodiment of this disclosure;

[0079] Figure 5 A schematic diagram of the structure of a training device for a table description text generation model provided in the fifth embodiment of this disclosure;

[0080] Figure 6 A schematic diagram of the structure of a device for generating table description text according to the sixth embodiment of this disclosure;

[0081] Figure 7 This is a block diagram of a terminal device for training a table-described text generation model according to an exemplary embodiment. Detailed Implementation

[0082] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0083] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0084] Typically, in training a table-based descriptive text generation model, descriptive words are predicted based on the labeled descriptive text. In this model, the descriptive words in the labeled descriptive text are always correct. However, the generation model predicts the next descriptive word based on previously generated descriptive words, and the previously generated words output by the model may be incorrect. Therefore, this disclosure allows for data augmentation of the labeled descriptive text during the training process of the generation model to generate reference text that better matches the input data during the model's prediction. Training the generation model based on reference text and sequential text that better reflects real-world usage scenarios improves the robustness of the generation model, thereby enhancing the accuracy and fluency of the descriptive text.

[0085] The training method and apparatus for a table description text generation model according to embodiments of the present disclosure are described below with reference to the accompanying drawings. The training method for the table description text generation model provided in this disclosure can be executed by the training apparatus for the table description text generation model provided in this disclosure (hereinafter referred to as the processing apparatus).

[0086] Figure 1 A flowchart of a training method for a table description text generation model provided in this disclosure includes the following steps:

[0087] Step 101: Obtain the training dataset, which includes the sequence text corresponding to multiple sample tables and the labeled description text corresponding to each sample table.

[0088] In this disclosure, since structured tables cannot be directly input into the model, they need to be converted into structured text according to preset conversion rules to facilitate the generation model's processing of table information. For example, a sample table is shown in Table 1 below:

[0089] Table 1

[0090] father Rukn al-Dawla family Buyid dynasty date of birth September 24, 936 date of death March 26, 983 country of citizenship Iran noble title Emir

[0091] In Table 1, the first column represents the keys, and the second column represents the values ​​corresponding to those keys. We can then concatenate the characters in each row from front to back, and then concatenate the concatenated strings from top to bottom to generate the structured text corresponding to the sample table. Furthermore, we can place the keys within “<>” and add a comma after the ">” symbol to distinguish between the “key” and the “value”. Therefore, the structured text corresponding to Table 1 is “<Name_ID> ,'Adud al-Dawla <father>Rukn al-Dawla <family>Buyid dynasty<date of birth> September 24, 936<date of death> March 26, 983<country of citizenship> Iran<noble title> ",Emir".

[0092] In this disclosure, the structural text may contain long descriptive words, such as "al-Dawla" mentioned above. Longer descriptive words typically have a lower frequency of use. Therefore, a pre-defined word segmentation algorithm can be used to segment the structural text corresponding to the sample table, breaking down the longer descriptive words into shorter ones to generate a sequence of text. This reduces the impact of low-frequency words on the reliability of the generation model. Furthermore, the labeled descriptive text can be the text obtained by segmenting the correct table description text corresponding to the sample table.

[0093] Optionally, a pre-training dataset can be obtained, which includes multiple sample tables and corresponding sample description text for each sample table. Then, the format of each sample table can be converted to determine the structural text corresponding to each sample table. Next, word segmentation is performed on each structural text and sample description text to obtain the sequence text corresponding to the structural text and the labeled description text corresponding to the sample description text. Thus, the training dataset is determined based on the sequence text and labeled description text corresponding to the sample tables.

[0094] Step 102: Use at least one first word in the sequence text to replace at least one second word in the labeled description text to generate reference text.

[0095] Typically, during the training of a generative model, descriptive words can be predicted based on labeled descriptive text, and the descriptive words in the labeled descriptive text are always correct. However, when predicting descriptive words, the generative model predicts the next descriptive word based on previously generated descriptive words, and the previously generated words output by the generative model may be incorrect. Therefore, this disclosure allows for data augmentation of the training data (i.e., labeled descriptive text) during the training process of the generative model to generate training data that better matches the input data during the prediction process of the generative model. This allows the generative model to be trained based on reference text and sequential text that are more in line with actual use cases, which helps to improve the robustness of the generative model and thus improves the accuracy and fluency of the descriptive text.

[0096] In this disclosure, at least one first word in the sequence text can be randomly selected to replace at least one second word in the labeled descriptive text, so as to generate reference text that better matches the input data in the prediction process of the generative model.

[0097] Step 103: Input the sequence text and reference text into the initial generation model to obtain the predicted description text output by the initial generation model, and output the first probability value of each first descriptive word in the predicted description text based on the reference text.

[0098] In this disclosure, a sequence text and its corresponding reference text can be input into an initial generation model. The initial generation model can then process the sequence text and the reference text to output predicted descriptive text. Simultaneously, the initial generation model can calculate and output the probability values ​​of each first descriptive word in the generated predicted descriptive text, given the reference text as input.

[0099] Step 104: Determine the loss value corresponding to the initial generation model based on the difference and probability value between each first descriptor and the corresponding second descriptor in the labeled descriptive text.

[0100] In this disclosure, each first descriptor can be compared with its corresponding second descriptor in the annotated description text to determine the difference between each first descriptor and its corresponding second descriptor. For example, each first descriptor can be compared with its corresponding second descriptor in the annotated description text. If the first descriptor and its corresponding second descriptor are the same, the difference between the first descriptor and its corresponding second descriptor can be determined to be 0. If the first descriptor and its corresponding second descriptor are different, the difference between the first descriptor and its corresponding second descriptor can be determined to be 1. Then, the product of the difference corresponding to each first descriptor and its corresponding probability can be added to determine the loss value.

[0101] Optionally, the difference between the predicted and annotated description texts can be determined based on the differences between each first descriptor and its corresponding second descriptor in the annotated description text. For example, the sum of the differences corresponding to each first descriptor can be used as the difference between the predicted and annotated description texts. Then, the probability value corresponding to the predicted description text can be determined based on the probability value corresponding to each first descriptor. For example, the mean of the probability values ​​corresponding to each first descriptor can be used as the probability value corresponding to the predicted description text. Finally, the loss value can be determined based on the difference between the predicted and annotated description texts and the probability value corresponding to the predicted description text.

[0102] Optionally, the loss value of the initial generation model when generating the first descriptor can be determined based on the difference and probability value between a certain first descriptor and each first descriptor output before it, and the corresponding second descriptor in the labeled descriptive text.

[0103] The loss value can be determined using the following loss function.

[0104]

[0105] Wherein, P(y t |y <t Let y(x, θ) represent the probability of outputting the first descriptor given the input reference text. x represents the input sequence text. θ represents the model parameters. <t This indicates that the word segmentation sequence x is used to replace the first 0 to t-1 words of the reference text obtained from the annotation description text. t represents the current time.

[0106] Optionally, the loss value for the initial generated model can be determined based on the loss values ​​corresponding to multiple training data.

[0107] Step 105: Correct the initial generation model based on the loss value until a table description text generation model is obtained.

[0108] In this disclosure, when the loss value is greater than a preset threshold, the parameters of the initial generation model can be adjusted based on the loss value, and the adjusted initial generation model can be trained using training data until the number of training data for training the initial generation model reaches a preset number, thereby obtaining a table description text generation model.

[0109] In this disclosure, after obtaining a training dataset comprising sequence texts corresponding to multiple sample tables and labeled descriptive texts corresponding to each sample table, at least one first word in the sequence text can be used to replace at least one second word in the labeled descriptive text to generate reference text. The sequence text and reference text are then input into an initial generation model to obtain the predicted descriptive text output by the initial generation model, and the first probability value of each first descriptive word in the predicted descriptive text based on the reference text. Subsequently, the loss value corresponding to the initial generation model can be determined based on the difference and probability value between each first descriptive word and the corresponding second descriptive word in the labeled descriptive text. The initial generation model is then corrected based on the loss value until a table descriptive text generation model is obtained. Therefore, by replacing some words in the labeled descriptive text to generate reference text that better matches the actual usage scenario, and training the generation model based on the reference text and sequence text that better match the actual usage scenario, the robustness of the generation model is improved, thereby enhancing the accuracy and fluency of the descriptive text.

[0110] Figure 2 A flowchart of a training method for a table description text generation model provided in this disclosure includes the following steps:

[0111] Step 201: Obtain the training dataset, which includes the sequence text corresponding to multiple sample tables and the labeled description text corresponding to each sample table.

[0112] The specific process of step 201 in this disclosure can be found in the detailed description of any embodiment of this disclosure, and will not be repeated here.

[0113] Step 202: Obtain the first word segmentation sequence of the first number in the labeled description text.

[0114] The first word segmentation sequence may include all the words corresponding to a descriptive word.

[0115] In this disclosure, when enhancing the labeled descriptive text, the corresponding segmentation sequence in the sequence text can be selected based on the positional information of the segmentation sequence to be replaced in the labeled descriptive text, thereby replacing the segmentation sequence to be replaced in the labeled descriptive text. This allows the replaced labeled descriptive text to contain more information from the table. Consequently, during the training of the generative model based on the replaced labeled descriptive text, it can learn more information from the table, thus improving the accuracy and fluency of the descriptive text.

[0116] In this disclosure, a first number of first word segmentation sequences to be replaced can be determined according to a preset sampling rate. Then, the first number of first word segmentation sequences can be obtained from the labeled text at certain intervals. For example, assuming the labeled text contains 10 first word segmentation sequences, the number of first word segmentation sequences to be replaced is 2, and the interval between the first word segmentation sequences to be replaced is 5 first word segmentation sequences. If the first obtained first word segmentation sequence to be replaced is the 2nd first word segmentation sequence in the labeled text, then the second first word segmentation sequence to be replaced is the 8th first word segmentation sequence in the labeled text.

[0117] Step 203: Preset a starting position in the sequence text, and sequentially obtain a first number of second word segmentation sequences, wherein the number of words contained in each second word segmentation sequence is the same as the number of words contained in the corresponding first word segmentation sequence, and the number of words between each second word segmentation sequence is the same as the number of words between each corresponding first word segmentation sequence.

[0118] In this disclosure, it is assumed that the number of first word segmentation sequences is 2, the first first word segmentation sequence contains 3 words, the second first word segmentation sequence contains 2 words, and the first and second first word segmentation sequences are separated by 6 words. Then, starting from the third word in the sequence text, the 3rd to 5th words are taken to form the first second word segmentation sequence, and the 12th and 13th words are taken to form the second second word segmentation sequence. Furthermore, the first second word segmentation sequence corresponds to the first first word segmentation sequence, and the second second word segmentation sequence corresponds to the second first word segmentation sequence.

[0119] Step 204: Use each second word segmentation sequence to replace the corresponding first word segmentation sequence in the labeled descriptive text to generate reference text.

[0120] Step 205: Input the sequence text and reference text into the initial generation model to obtain the predicted description text output by the initial generation model, and output the probability value of each first descriptive word in the predicted description text based on the reference text.

[0121] Step 206: Determine the loss value corresponding to the initial generation model based on the difference and probability value between each first descriptor and the corresponding second descriptor in the labeled descriptive text.

[0122] Step 207: Correct the initial generation model based on the loss value until a table description text generation model is obtained.

[0123] The specific processes of steps 205-207 in this disclosure can be found in the detailed description of any embodiment of this disclosure, and will not be repeated here.

[0124] In this disclosure, after obtaining a training dataset comprising sequence texts corresponding to multiple sample tables and labeled descriptive texts corresponding to each sample table, a first number of first word segments can be obtained from the labeled descriptive texts. Then, a first number of second word segments are sequentially obtained at a preset starting position in the sequence texts. Each second word segment is then used to replace the corresponding first word segments in the labeled descriptive texts to generate reference text. The sequence texts and reference texts are then input into an initial generation model to obtain the predicted descriptive text output by the initial generation model, and the first probability value of each first descriptive word in the predicted descriptive text is output based on the reference text. Then, based on the difference and probability value between each first descriptive word and the corresponding second descriptive word in the labeled descriptive text, the loss value corresponding to the initial generation model is determined, and the initial generation model is corrected based on the loss value until a table descriptive text generation model is obtained. Thus, by replacing some words in the labeled descriptive text with some words in the sequence text, the generated training data contains more information from the tables, enabling the generation model to learn more information from the tables during training, thereby improving the accuracy and fluency of the descriptive text.

[0125] Figure 3 A flowchart of a training method for a table description text generation model provided in this disclosure includes the following steps:

[0126] Step 301: Obtain the training dataset, which includes the sequence text corresponding to multiple sample tables and the labeled description text corresponding to each sample table.

[0127] Step 302: Use at least one first word in the sequence text to replace at least one second word in the labeled description text to generate reference text.

[0128] Step 303: Input the sequence text and reference text into the initial generation model to obtain the predicted description text output by the initial generation model, and output the probability value of each first descriptive word in the predicted description text based on the reference text.

[0129] The specific processes of steps 301-303 in this disclosure can be found in the detailed description of any embodiment of this disclosure, and will not be repeated here.

[0130] Step 304: Determine the weight of each first descriptor according to the preset weight allocation rules.

[0131] In this disclosure, to improve the accuracy of the descriptive text predicted by the generative model, each first descriptor is compared with the sequence text to determine whether the first descriptor is included in the sequence text. If the first descriptor is in the sequence text, it is assigned a larger preset first weight; if the first descriptor is not in the sequence text, it is assigned a smaller preset second weight. This allows the initial generative model training process to learn more information from the table, thereby making the descriptive text predicted by the generative model more accurate.

[0132] Optionally, the weight of the first descriptor not included in the sequence text can be determined based on the word overlap rate between the reference text and the sequence text. That is, each third word in the reference text can be matched against the sequence text to determine the second number of third words contained in the sequence text, and the weight of the first descriptor not included in the sequence text can be determined based on the ratio of the second number to the total number of third words contained in the reference text. For example, the ratio of the second number to the total number of third words contained in the reference text can be used to determine the weight of the first descriptor not included in the sequence text.

[0133] Step 305: Determine the loss value corresponding to the initial generation model based on the difference, probability value, and weight between each first descriptor and the corresponding second descriptor in the labeled descriptive text.

[0134] In this disclosure, the loss value can be determined by summing the products of the differences, weights, and probabilities corresponding to each first descriptor.

[0135] For a detailed description of the differences between each first descriptor and the corresponding second descriptor in the labeled description text, please refer to the detailed description of any embodiment of this disclosure, and will not be repeated here.

[0136] The loss value can be determined using the following loss function.

[0137] L = L etd W

[0138] Wherein, W represents the weight corresponding to the first descriptor. For a detailed explanation of other parameters, please refer to the detailed description of any embodiment of this disclosure, which will not be repeated here.

[0139] Step 306: Correct the initial generation model based on the loss value until a table description text generation model is obtained.

[0140] The specific process of step 306 in this disclosure can be found in the detailed description of any embodiment of this disclosure, and will not be repeated here.

[0141] In this disclosure, after obtaining a training dataset comprising sequence texts corresponding to multiple sample tables and labeled descriptive texts corresponding to each sample table, at least one first word in the sequence text can be used to replace at least one second word in the labeled descriptive text to generate reference text. The sequence text and reference text are then input into an initial generation model to obtain the predicted descriptive text output by the initial generation model, and the first probability value of each first descriptive word in the predicted descriptive text is output based on the reference text. Subsequently, the weight of each first descriptive word can be determined according to a preset weight allocation rule, and the loss value corresponding to the initial generation model is determined based on the difference, probability value, and weight between each first descriptive word and its corresponding second descriptive word in the labeled descriptive text. Then, the initial generation model can be corrected based on the loss value until a table descriptive text generation model is obtained. Thus, by assigning different weights to the first descriptive words, the generation model training process can learn more information from the tables, thereby improving the accuracy and fluency of the descriptive text.

[0142] Figure 4 A flowchart of a method for generating table description text provided in this disclosure includes the following steps:

[0143] Step 401: Obtain the table to be processed.

[0144] In this disclosure, the received user-uploaded form can be identified as the form to be processed.

[0145] Step 402: Preprocess the table to be processed to determine the sequence text corresponding to the table to be processed.

[0146] In this disclosure, since structured tables cannot be directly input into the model, it is necessary to convert the tables into structured text according to preset conversion rules so that the generation model can process the table information.

[0147] In this disclosure, the structural text can be directly used as the sequence text. Alternatively, a preset word segmentation algorithm can be used to segment the structural text corresponding to the sample table, breaking down longer descriptive words in the structural text into multiple shorter descriptive words to generate the sequence text. This reduces the impact of low-frequency words on the reliability of the generation model.

[0148] Step 403: Input the sequence text into the generation model to generate the descriptive text corresponding to the table to be processed.

[0149] The generative model is obtained by training through any of the above embodiments.

[0150] In this disclosure, sequential text can be input into a generation model, which can then process the sequential text to output descriptive text corresponding to a table. Thus, by predicting descriptive text based on sequential text containing all information of the table to be processed, omissions of table information are avoided, thereby improving the fluency of the descriptive text.

[0151] In this disclosure, after obtaining the table to be processed, the table can be preprocessed to determine the corresponding sequence text. The sequence text is then input into a generative model to generate descriptive text corresponding to the table. Thus, the generative model directly predicts the descriptive text based on the sequence text containing all information about the table to be processed, avoiding omissions of information and improving the fluency of the descriptive text.

[0152] Figure 5 This is a block diagram illustrating a training apparatus for a table-described text generation model according to an exemplary embodiment. (Refer to...) Figure 5 The device includes an acquisition module 510, a replacement module 520, a generation module 530, a determination module 540, and a correction module 550.

[0153] The acquisition module 510 is used to acquire the training dataset, which includes the sequence text corresponding to multiple sample tables and the annotation description text corresponding to each sample table.

[0154] Replacement module 520 is used to replace at least one second word in the labeled description text with at least one first word in the sequence text to generate reference text;

[0155] The generation module 530 is used to input the sequence text and reference text into the initial generation model to obtain the predicted description text output by the initial generation model, and to output the probability value of each first descriptive word in the predicted description text based on the reference text.

[0156] The determination module 540 is used to determine the loss value corresponding to the initial generation model based on the difference and probability value between each first descriptor and the corresponding second descriptor in the labeled descriptive text;

[0157] The correction module 550 is used to correct the initial generation model based on the loss value until the table description text generation model is obtained.

[0158] In one possible implementation of this disclosure, the replacement module 520 is used for:

[0159] Obtain the first word segmentation sequence with the first number of occurrences in the annotated description text;

[0160] In the sequence text, a first number of second word segments are obtained sequentially at a preset starting position. The number of words contained in each second word segment sequence is the same as the number of words contained in the corresponding first word segment sequence, and the number of words between each second word segment sequence is the same as the number of words between each corresponding first word segment sequence.

[0161] Each second word segmentation sequence is used to replace the corresponding first word segmentation sequence in the labeled descriptive text to generate reference text.

[0162] In one possible implementation of this disclosure, the determining module 540 is used to:

[0163] The weight of each first descriptor is determined according to the preset weight allocation rules;

[0164] Based on the differences, probability values, and weights between each first descriptor and its corresponding second descriptor in the labeled descriptive text, the loss value corresponding to the initial generation model is determined.

[0165] In one possible implementation of this disclosure, the determining module 540 is used to:

[0166] Each first descriptor is matched against the sequence text to determine whether each first descriptor is contained in the sequence text;

[0167] Each third word in the reference text is matched against the sequence text to determine the second number of third words contained in the sequence text;

[0168] The weight of the first descriptive word contained in the sequence text is determined to be a preset value;

[0169] The weight of the first descriptor not included in the sequence text is determined based on the ratio of the second quantity to the total number of third segment words contained in the reference text.

[0170] In one possible implementation of this disclosure, the acquisition module 510 is used for:

[0171] Obtain the pre-training dataset, which includes multiple sample tables and sample description text corresponding to each sample table;

[0172] The above-mentioned device also includes a preprocessing module for:

[0173] The sample tables are formatted to determine the corresponding structure text for each sample table;

[0174] The structural text and sample description text are segmented into words to obtain the sequence text corresponding to the structural text and the labeled description text corresponding to the sample description text.

[0175] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0176] In this disclosure, after obtaining a training dataset comprising sequence texts corresponding to multiple sample tables and labeled descriptive texts corresponding to each sample table, at least one first word in the sequence text can be used to replace at least one second word in the labeled descriptive text to generate reference text. The sequence text and reference text are then input into an initial generation model to obtain the predicted descriptive text output by the initial generation model, and the first probability value of each first descriptive word in the predicted descriptive text based on the reference text. Subsequently, the loss value corresponding to the initial generation model can be determined based on the difference and probability value between each first descriptive word and the corresponding second descriptive word in the labeled descriptive text. The initial generation model is then corrected based on the loss value until a table descriptive text generation model is obtained. Therefore, by replacing some words in the labeled descriptive text to generate reference text that better matches the actual usage scenario, and training the generation model based on the reference text and sequence text that better match the actual usage scenario, the robustness of the generation model is improved, thereby enhancing the accuracy and fluency of the descriptive text.

[0177] Figure 6 This is a block diagram illustrating an apparatus for generating table-described text according to an exemplary embodiment. (Refer to...) Figure 6 The device includes an acquisition module 610, a preprocessing module 620, and a generation module 630.

[0178] Module 610 is used to obtain the table to be processed;

[0179] Preprocessing module 620 is used to preprocess the table to be processed in order to determine the sequence text corresponding to the table to be processed;

[0180] The generation module 630 is used to input the sequence text into the generation model to generate the descriptive text corresponding to the table to be processed, wherein the generation model is trained according to the method of any one of claims 1-5 above.

[0181] In one possible implementation of this disclosure, the preprocessing module 620 is used for:

[0182] The table to be processed is formatted to determine the corresponding structural text.

[0183] The structured text is segmented to obtain the corresponding sequence text.

[0184] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0185] In this disclosure, after obtaining the table to be processed, the table can be preprocessed to determine the sequence text corresponding to the table. The sequence text is then input into a generative model to generate descriptive text corresponding to the table. Thus, the generative model directly predicts the descriptive text based on the sequence text corresponding to the table, thereby improving the fluency of the descriptive text.

[0186] Figure 7 This is a block diagram of a terminal device for training a table-described text generation model according to an exemplary embodiment.

[0187] like Figure 7 As shown, the terminal device 700 includes:

[0188] The memory 710 and processor 720 are connected by a bus 730, which connects different components (including the memory 710 and the processor 720). The memory 710 stores a computer program, and when the processor 720 executes the program, it implements the training method of the table description text generation model described in the embodiments of this disclosure.

[0189] Bus 730 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0190] Terminal device 700 typically includes various electronically readable media. These media can be any available media that can be accessed by terminal device 700, including volatile and non-volatile media, removable and non-removable media.

[0191] The memory 710 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 740 and / or cache memory 750. The terminal device 700 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 760 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 7 Not shown; usually referred to as "hard drive"). Although Figure 7 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 730 via one or more data media interfaces. Memory 710 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this disclosure.

[0192] A program / utility 780 having a set (at least one) of program modules 770 may be stored in, for example, memory 710. Such program modules 770 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 770 typically perform the functions and / or methods described in the embodiments of this disclosure.

[0193] Terminal device 700 can also communicate with one or more external devices 790 (e.g., keyboard, pointing device, display 791, etc.), one or more devices that enable a user to interact with terminal device 700, and / or any device that enables terminal device 700 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 792. Furthermore, terminal device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 793. As shown, network adapter 793 communicates with other modules of terminal device 700 via bus 730. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with terminal device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0194] The processor 720 executes various functional applications and data processing by running programs stored in the memory 710.

[0195] It should be noted that the implementation process and technical principles of the terminal device in this embodiment are explained in the foregoing description of the training method of the table description text generation model in this disclosure embodiment, and will not be repeated here.

[0196] In addition, the aforementioned terminal device can also implement the table description text generation method as described above. The implementation process and technical principles of the terminal device in this embodiment are explained in the foregoing description of the table description text generation method of this disclosure embodiment, and will not be repeated here.

[0197] In this disclosure, after obtaining a training dataset comprising sequence texts corresponding to multiple sample tables and labeled descriptive texts corresponding to each sample table, at least one first word in the sequence text can be used to replace at least one second word in the labeled descriptive text to generate reference text. The sequence text and reference text are then input into an initial generation model to obtain the predicted descriptive text output by the initial generation model, and the first probability value of each first descriptive word in the predicted descriptive text based on the reference text. Subsequently, the loss value corresponding to the initial generation model can be determined based on the difference and probability value between each first descriptive word and the corresponding second descriptive word in the labeled descriptive text. The initial generation model is then corrected based on the loss value until a table descriptive text generation model is obtained. Therefore, by replacing some words in the labeled descriptive text to generate reference text that better matches the actual usage scenario, and training the generation model based on the reference text and sequence text that better match the actual usage scenario, the robustness of the generation model is improved, thereby enhancing the accuracy and fluency of the descriptive text.

[0198] In an exemplary embodiment, this disclosure also provides a computer-readable storage medium including instructions, such as a memory including instructions, which can be executed by a processor of a terminal device to perform the above-described method. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0199] To implement the above embodiments, this disclosure also provides a computer program product that, when executed by the processor of a terminal device, enables the terminal device to execute the training method of the table description text generation model as described above, or to execute the table description text generation method as described above.

[0200] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0201] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.< / family> < / father>

Claims

1. A training method for a table-described text generation model, characterized in that, include: Obtain a training dataset, wherein the training dataset includes sequence text corresponding to multiple sample tables and labeled descriptive text corresponding to each sample table; Use at least one first word in the sequence text to replace at least one second word in the labeled description text to generate reference text; The sequence text and the reference text are input into the initial generation model to obtain the predicted description text output by the initial generation model, and the probability value of each first descriptive word in the predicted description text is output based on the reference text. Based on the differences between each of the first descriptive words and the corresponding second descriptive words in the labeled descriptive text, and the probability values, the loss value corresponding to the initial generation model is determined; The initial generation model is corrected based on the loss value until a table description text generation model is obtained.

2. The method as described in claim 1, characterized in that, The step of replacing at least one second word in the labeled description text with at least one first word in the sequence text to generate reference text includes: Obtain the first number of first word segments in the labeled description text; In the sequence text, a first number of second word segments are obtained sequentially at a preset starting position. The number of words contained in each second word segmentation sequence is the same as the number of words contained in the corresponding first word segmentation sequence, and the number of words between each second word segmentation sequence is the same as the number of words between each corresponding first word segmentation sequence. The reference text is generated by replacing the corresponding first word segments in the labeled description text with each of the second word segments.

3. The method as described in claim 1, characterized in that, The step of determining the loss value corresponding to the initial generation model based on the difference between each of the first descriptive words and the corresponding second descriptive words in the labeled descriptive text and the probability value includes: The weight of each of the first descriptors is determined according to the preset weight allocation rules; The loss value corresponding to the initial generation model is determined based on the difference between each of the first descriptive words and the corresponding second descriptive words in the labeled descriptive text, the probability value, and the weight.

4. The method as described in claim 3, characterized in that, The step of determining the weight of each of the first descriptive terms according to a preset weight allocation rule includes: Each of the first descriptors is matched against the sequence text to determine whether each of the first descriptors is contained in the sequence text; Each third word in the reference text is matched with the sequence text to determine the second number of third words contained in the sequence text; The weight of the first descriptive word contained in the sequence text is determined to be a preset value; The ratio of the second quantity to the total number of third words contained in the reference text is determined as the weight of the first descriptive word not included in the sequence text.

5. The method according to any one of claims 1-4, characterized in that, The acquisition of the training dataset includes: Obtain a pre-training dataset, wherein the pre-training dataset includes multiple sample tables and sample description text corresponding to each sample table; The sample tables are formatted to determine the structural text corresponding to each sample table. The structural text and the sample description text are segmented into words to obtain the sequence text corresponding to the structural text and the labeled description text corresponding to the sample description text.

6. A method for generating tabular descriptive text, characterized in that, include: Get the table to be processed; The table to be processed is preprocessed to determine the sequence text corresponding to the table to be processed; The sequence text is input into the generation model to generate descriptive text corresponding to the table to be processed, wherein the generation model is trained according to the method described in any one of claims 1-5.

7. The method as described in claim 6, characterized in that, The preprocessing of the table to be processed to determine the sequence text corresponding to the table to be processed includes: The table to be processed is formatted to determine the corresponding structural text of the table; The structured text is segmented to obtain the corresponding sequence text.

8. A training apparatus for a table-described text generation model, characterized in that, include: The acquisition module is used to acquire a training dataset, wherein the training dataset includes sequence text corresponding to multiple sample tables and labeled description text corresponding to each sample table; The replacement module is used to replace at least one second word in the labeled description text with at least one first word in the sequence text to generate reference text; The generation module is used to input the sequence text and the reference text into the initial generation model to obtain the predicted description text output by the initial generation model, and to output the first probability value of each first descriptive word in the predicted description text based on the reference text; The determination module is used to determine the loss value corresponding to the initial generation model based on the difference between each of the first descriptive words and the corresponding second descriptive words in the labeled descriptive text and the first probability value; The modification module is used to modify the initial generation model based on the loss value until a table description text generation model is obtained.

9. A device for generating tabular descriptive text, characterized in that, include: The acquisition module is used to acquire the table to be processed. The preprocessing module is used to preprocess the table to be processed in order to determine the sequence text corresponding to the table to be processed; A generation module is used to input the sequence text into a generation model to generate descriptive text corresponding to the table, wherein the generation model is trained according to the method described in any one of claims 1-5.

10. A terminal device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the training method of the table description text generation model as described in any one of claims 1-5, or to implement the table description text generation method as described in any one of claims 6-7.

11. A computer-readable storage medium, wherein when instructions in the computer-readable storage medium are executed by a processor of a terminal device, the terminal device is enabled to perform a training method for a table description text generation model as described in any one of claims 1-5, or to implement a table description text generation method as described in any one of claims 6-7.

12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the training method of the table description text generation model according to any one of claims 1-5, or implements the table description text generation method according to any one of claims 6-7.

Citation Information

Patent Citations

  • Picture processing method, text processing method, related equipment and storage medium

    CN113627567A

  • Data-to-text generation model training method and device

    CN115017178A