Statistical analysis chart generation method and system based on NLP and storage medium
Through the graph generation network, the problems of inaccurate semantic understanding and insufficient style control of graph generation in the prior art are solved, and higher quality and more stable statistical analysis graph generation are achieved.
Patent Information
- Application Number
- CN202510222239.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2045-02-27
AI Technical Summary
The prior art has problems such as inaccurate semantic understanding, insufficient control of chart style and effect, lack of domain knowledge fusion, and unstable chart quality when generating statistical analysis charts.
The graph generation network is used, including the graph construction network and the graph construction effect evaluation network, the training network generates candidate charts, and the effect evaluation network is optimized for the graph generation effect.
It improves the semantic understanding accuracy and style control ability of chart generation, enhances the evaluation and optimization of chart quality, and ensures the visual effect and data accuracy of the chart.
Smart Images

Figure CN119722852A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, system and storage medium for generating statistical analysis charts based on NLP. Background Art
[0002] In today's era of information explosion, data is growing exponentially, and the demand for effective data analysis and visualization in various industries is becoming more and more urgent. Statistical analysis charts, as intuitive and efficient data visualization tools, play an important role in many fields such as finance, medical care, education, and scientific research. The development of natural language processing (NLP) technology has brought new ways to generate statistical analysis charts. Traditional statistical analysis chart generation mainly relies on professional chart making software such as Excel and Tableau. Users need to manually input data, select chart types, set styles, etc. The operation is cumbersome, the learning cost is high, the efficiency is low, and it is easy to make mistakes when facing large amounts of data and frequent updates. The rule-based chart generation method automatically generates charts by pre-defining rules and templates, selecting chart types and styles based on input data and text descriptions, but the rules are fixed and it is difficult to adapt to complex and changeable text and data features. It is not capable of processing semantically ambiguous or special meaning texts. Early attempts at NLP-based chart generation combined NLP with chart generation, extracting key information and data through semantic analysis to generate charts, but the accuracy and processing capabilities of NLP technology are limited, and the understanding of complex text structures and semantics is not in-depth, which makes it easy to make information extraction errors or omissions. In addition, chart generation lacks effective control over style and effects, resulting in poor visual effects. Existing technologies have problems such as inaccurate semantic understanding, insufficient grasp of deep meanings and intentions, and lack of domain knowledge integration; insufficient control over chart style and effects, ignoring color matching, line style, and layout coordination, and being unable to flexibly respond to the needs of different application scenarios; lack of effective evaluation and optimization mechanisms, and inability to promptly discover and solve problems in generated charts, resulting in unstable chart quality. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a method for generating statistical analysis charts based on NLP, and the technical solution is implemented as follows: a chart generation network is used for execution, and the chart generation network includes a chart construction network and a chart construction effect evaluation network, and the chart generation network is trained by the following steps: obtaining text-chart binary training data, and obtaining matching identification features corresponding to the text-chart binary training data, wherein the text-chart binary training data corresponds to a matching chart style tag, and the matching identification features are used to indicate the corresponding relationship between each chart data and the text description data in the text-chart binary training data; loading the text-chart binary training data into a style call determination network, and if the determination result output by the style call determination network indicates that the style tag of the statistical description training text needs to be used, then obtaining the chart style training tag corresponding to the statistical description training text, and obtaining the matching identification features corresponding to the chart style training tag, wherein the matching identification features corresponding to the chart style training tag are used to identify the statistical description training text, and the style call determination network It is obtained by debugging based on chart style tags; the text chart binary training data, the matching identification features corresponding to the text chart binary training data, the chart style training tags and the matching identification features corresponding to the chart style training tags are loaded into the chart construction network, and the chart construction network is used to output A candidate training generation charts corresponding to the text chart binary training data, wherein A≥1, and each candidate training generation chart corresponds to a priori effect indicator information; A candidate training generation charts are loaded into the chart construction effect evaluation network, and the chart construction effect evaluation network is used to output the confidence distribution of different effect indicators corresponding to each training generation chart, and the training loss function of the chart construction effect evaluation network is determined based on the confidence distribution of the different effect indicators; the training loss is calculated based on the training loss function, the priori effect indicator information corresponding to each candidate training generation chart and the confidence distribution of the different effect indicators, and the network parameters of the chart construction network are repeatedly iterated based on the training loss until the chart construction network converges.
[0004] On the other hand, the present invention further provides a computer system, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the steps in the above method when executing the program.
[0005] In yet another aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor.
[0006] The present invention adopts the method of obtaining text-chart binary training data and matching identification features that can indicate the data correspondence relationship corresponding to each training data unit in the text-chart binary training data. If the determination result of the determination network output by using style call indicates that the style tag of the statistical description training text needs to be used, the chart style training tag and the matching identification features for indicating the statistical description training text can be obtained, and then the text-chart binary training data, the matching identification features corresponding to the text-chart binary training data, the chart style training tags and the matching identification features corresponding to the chart style training tags are loaded into the chart construction network, so as to adopt the chart construction network to output A candidate training generation charts corresponding to the text-chart binary training data, and then, the A candidate training generation charts are loaded into the chart construction effect evaluation network, and the chart construction effect evaluation network is adopted to output the confidence distribution of different effect indicators corresponding to each training generation chart, and the training loss function of the chart construction effect evaluation network is determined according to the confidence distribution of different effect indicators, and then the training loss is calculated according to the training loss function, the prior effect indicator information corresponding to each candidate training generation chart and the confidence distribution of different effect indicators, and the network parameter variables of the chart construction network are repeatedly iterated according to the training loss. By adopting the embodiment of the present invention, a style call determination network can be first used to determine whether the information in the text-chart binary training data is related to the style tag of the statistical description training text. If it is determined that style tagging is required, the corresponding chart style training tag can be added to increase the generation effect of the chart construction network learning the data style of the statistical description training text on the premise of the text-chart binary training data and the matching identification features that can indicate the data corresponding to each training data unit in the text-chart binary training data. Then, a chart construction effect evaluation network is introduced, and reinforcement learning is combined to enhance the chart generation effect of the chart construction effect evaluation network learning the statistical description training text data style, making it more expressive.
[0007] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 A schematic diagram of the debugging process of a chart generation network in a statistical analysis chart generation method based on NLP provided in an embodiment of the present invention; Figure 2 A hardware entity diagram of a computer system provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0009] The embodiment of the present invention provides a method for generating statistical analysis charts based on NLP, which can be executed by a processor of a computer system. The computer system can refer to a device with data processing capabilities such as a server, a laptop, a tablet computer, and a desktop computer. The method for generating statistical analysis charts based on NLP provided by the embodiment of the present invention is executed by a chart generation network, and the chart generation network includes a chart construction network and a chart construction effect evaluation network. Please refer to Figure 1 The chart generation network is trained by the following steps: Step S100: obtaining text-chart binary training data, and obtaining matching identification features corresponding to the text-chart binary training data, wherein the text-chart binary training data is matched with a chart style tag, and the matching identification features are used to indicate the corresponding relationship between each chart data and the text description data in the text-chart binary training data.
[0010] The training data of text-chart pairs is a collection of a large amount of text information and charts corresponding to these text information. In actual application scenarios, this kind of data is widely available. For example, in the financial field, the text information may be a description of a company's quarterly financial report, such as "the company's operating income increased by 20% year-on-year this quarter, and the net profit reached 50 million yuan." The corresponding chart may be a bar chart with different quarters on the horizontal axis and operating income and net profit on the vertical axis. The revenue and profit data of each quarter are intuitively displayed through the height of the column. In the medical field, the text information can be a statistical description of the incidence of a certain disease in different age groups, such as "in the age group of 20-30 years old, the incidence of the disease is 5%; in the age group of 30-40 years old, the incidence is 8%." The corresponding chart may be a line chart with age group on the horizontal axis and incidence rate on the vertical axis, and the incidence data points of each age group are connected by a line. In the field of education, the text information may be the average scores of different classes in a certain exam, such as "the average score of Class 1 is 85 points, and the average score of Class 2 is 90 points." The corresponding chart may be a pie chart, where each sector represents a class, and the size of the sector is related to the proportion of the class's average score to the total average score.
[0011] In order to obtain these text-chart binary training data, the computer system can collect them from multiple channels. For public data resources, the computer system can use web crawler technology to capture relevant data from professional data websites, government statistics department websites, academic databases and other platforms. For example, by writing a crawler program, setting the URL of the website to be visited, data screening rules, etc., the program can automatically locate and extract the required text information and chart data from the web page. For internal enterprise data, the computer system can read relevant data directly from the enterprise's database. During the reading process, it is necessary to ensure the accuracy and completeness of the data. Data cleaning and preprocessing steps can be used to remove duplicate data and correct erroneous data.
[0012] Next, the role of the matching identification feature is to clarify the correspondence between each chart data and the text description data in the text-chart binary training data. For example, in the above example in the financial field, the matching identification feature can be a unique identifier, such as a combination of a company code and a quarter number. For a company's financial report data, the company code is "ABC123" and the quarter number is "Q3-2024". This combination can be used as a matching identification feature to associate the text description of the company's third quarter financial status with the corresponding bar chart. In the medical field, the matching identification feature can be a combination of a disease code and an age range, such as "Disease-001, 20-30 years old", to determine the correspondence between the incidence statistics text and the corresponding line chart. In the education field, the matching identification feature can be a combination of a class number and an exam name, such as "Class-01, Final-Exam-2024", to associate the class average score text with the corresponding pie chart.
[0013] There are many ways for a computer system to obtain matching identification features. If the data is already marked with corresponding relationships during the collection process, the computer system can directly extract these marks as matching identification features. For example, on some professional data platforms, the data provider will add associated tags to each text and chart, and the computer system can obtain matching identification features by parsing these tags. If the data itself does not have clear corresponding relationship tags, the computer system can use data mining and machine learning methods to establish the corresponding relationship. For example, natural language processing technology can be used to perform semantic analysis on text information and extract key information, while image recognition and feature extraction can be performed on charts. Then, by comparing the features of the text and chart, the correspondence between them can be established and the corresponding matching identification features can be generated.
[0014] In addition, the text-chart binary training data is matched with chart style tags. Chart style tags are used to describe specific style attributes of charts, such as color, shape, line style, etc. In the above-mentioned bar chart example in the financial field, the chart style tag can be "blue bar, white background, black line border". Such tags can help computer systems recognize and distinguish charts of different styles. In the line chart in the medical field, the chart style tag can be "red line, gray grid background". In the pie chart in the education field, the chart style tag can be "colorful sector, no background grid".
[0015] The computer system can obtain chart style tags by combining manual annotation and automatic recognition. For some cases with small data volumes, professionals can perform style tags on each chart. In the case of large data volumes, the computer system can use image recognition and machine learning algorithms to automatically identify the style features of the chart and generate corresponding tags. For example, a convolutional neural network (CNN) can be used to train chart images, allowing the model to learn the characteristic patterns of different styles, and then style classify and tag new charts.
[0016] Step S200: Load the text-chart binary training data into the style call determination network. If the determination result output by the style call determination network indicates that the style tag of the statistical description training text needs to be used, then obtain the chart style training tag corresponding to the statistical description training text, and obtain the matching identification feature corresponding to the chart style training tag, wherein the matching identification feature corresponding to the chart style training tag is used to identify the statistical description training text, and the style call determination network is obtained by debugging based on the chart style tag.
[0017] The style call determination network plays a key decision-making role in the whole process, and can determine whether it is necessary to use the style tag of the statistical description training text. The network is debugged and trained, and its debugging process is based on the chart style tag. Specifically, the computer system will load each text chart binary training data into the style call determination network, and the network will output the style tag determination confidence corresponding to each text chart binary training data. Then, according to the style tag determination confidence corresponding to each training data feature and the chart style tag, the style tag error is determined, and then the parameter variables of the style call determination network are iterated according to this error until the network achieves a stable and accurate judgment effect. In practical applications, taking the financial field as an example, it is assumed that the text chart binary training data contains text descriptions of different quarterly financial data of a company and the corresponding bar charts. The style call determination network will analyze these data, such as analyzing the description style of the data growth trend in the text, the matching style of colors and shapes in the chart, etc. If the determination result output by the network indicates that the style tag of the statistical description training text needs to be used, it means that in the subsequent chart generation process, the specific style of the statistical description training text needs to be considered.
[0018] The chart style training mark corresponding to the statistical description training text is a quantitative representation of the style characteristics of the statistical description training text. For example, in the statistical description training text in the medical field, the incidence trend of a certain disease in different age groups may be described in detail. The corresponding chart style training mark may include the line color of the line chart as blue, the line style as dotted line, the background color as light gray, etc. These marks can help the computer system accurately grasp the style characteristics of the statistical description training text and apply it to the subsequent chart generation.
[0019] The matching identification feature corresponding to the chart style training mark is used to identify the statistical description training text. Its function is to ensure the accurate correspondence between the chart style training mark and the statistical description training text. In the field of education, the statistical description training text may be a detailed description of the distribution of scores of different classes in a certain exam. The corresponding chart style training mark may be a color gradient for the column of the bar chart, a bold font for the chart title, etc. The matching identification feature can be a combination of the exam name and the class number, such as "Final-Exam-2024, Class-01". Through this identification feature, the computer system can accurately associate the chart style training mark with the corresponding statistical description training text.
[0020] When the computer system executes step S200, the text-chart binary training data previously obtained is loaded into the style call determination network. The network will use its internal algorithms and models to analyze and judge the data. The specific technical means can be a neural network model based on deep learning, such as a multi-layer perceptron (MLP). The network will conduct a comprehensive analysis of the semantic information of the text, the visual features of the chart, etc., and calculate the confidence of the style tag determination. For example, the following formula can be used to calculate the confidence: , where w i is the weight of each feature, f i is the score of each feature and n is the number of features.
[0021] If the determination result output by the style call determination network indicates that the style tag of the statistical description training text needs to be used, the computer system will then obtain the chart style training tags corresponding to the statistical description training text. The way to obtain these tags can be to query from a pre-annotated database, or to extract and analyze the features of the statistical description training text, and match and filter in combination with the existing style tag library. For the matching identification features corresponding to the chart style training tags, the computer system can search for the corresponding identification from the matching identification feature database according to the corresponding relationship established in step S100.
[0022] After obtaining the chart style training marks and matching identification features, the computer system will verify and integrate these data to ensure their accuracy and consistency. For example, it will check whether the matching identification features can accurately identify the statistical description training text, and whether the chart style training marks are consistent with the style characteristics of the statistical description training text. If errors or inconsistencies are found in the data, the computer system will make corrections and adjustments to ensure that the subsequent steps can proceed smoothly.
[0023] Step S300: Load the text-chart binary training data, the matching identification features corresponding to the text-chart binary training data, the chart style training tags, and the matching identification features corresponding to the chart style training tags into the chart construction network, and use the chart construction network to output A candidate training generation charts corresponding to the text-chart binary training data, where A≥1, and each candidate training generation chart corresponds to a priori effect indicator information.
[0024] The chart construction network is responsible for generating candidate training charts based on the input data. The text-chart binary training data contains a large amount of text information and the corresponding chart data, which provides rich learning materials for the chart construction network. The matching identification features clarify the correspondence between text and charts, so that the chart construction network can accurately understand the content described in the text in what form of chart. The chart style training tags and their corresponding matching identification features give specific style attributes to the generated charts, so that the generated charts can meet the style requirements of the statistical description training text.
[0025] In actual application scenarios, taking the business field as an example, the text-chart binary training data may contain a text description of the sales data of an e-commerce company in different time periods and the corresponding sales trend chart. The matching identification features can be time ranges and product categories, such as "Jan-March 2024, electronic products", which associates the sales data text with the corresponding sales trend chart. The chart style training tags may specify that the color of the chart is blue, the lines are solid, etc., and the matching identification features ensure that these style tags correspond to specific sales data text and charts.
[0026] After the computer system loads this data into the graph construction network, the graph construction network will use its internal algorithms and models to process it. Graph construction networks can usually use neural network models in deep learning, such as generative adversarial networks (GANs) or variational autoencoders (VAEs). Taking GAN as an example, it consists of a generator and a discriminator. The generator is responsible for generating candidate training graphs based on the input data, and the discriminator is responsible for judging whether the generated graph is real and reasonable. Through continuous adversarial training, the generator can generate more and more realistic graphs.
[0027] In the process of generating candidate training graphs, the graph construction network will perform multi-dimensional analysis and processing on the input data. For text information, natural language processing technology will be used to understand the semantics and extract key information, such as the type, trend, and comparison relationship of the data. For chart style training tags, they will be converted into parameters for chart generation, such as color coding, line style, and graphic shape. By comprehensively considering these factors, the graph construction network generates A candidate training graphs.
[0028] Each candidate training generated chart corresponds to a priori performance indicator information, which is used to describe the expected performance of the chart in certain aspects. Prior performance indicator information may include the clarity of the chart, the accuracy of information conveyed, the matching degree with style markers, etc. For example, in a pie chart about market share, the prior performance indicator information may include whether the proportion of each sector area accurately reflects the market share, whether the color matching is clear and easy to read, whether it meets the preset style requirements, etc. The computer system can measure these effects through some quantitative indicators, such as using the mean square error (MSE) to measure the accuracy of the data in the chart. The formula is ,in is the true value, is the predicted value and n is the number of data points.
[0029] When generating candidate training graphs, the computer system can use a combination of random sampling and optimization search. First, the graph construction network will randomly generate a batch of candidate graphs based on the input data and internal parameters. Then, these candidate graphs are evaluated and screened based on the prior effect indicator information, and the graphs with better effects are retained. Next, these retained graphs are further optimized by adjusting the parameters of the network so that the generated graphs perform better in various effect indicators. This process can be iterated multiple times until certain stopping conditions are met, such as reaching a preset number of iterations or the generated graph reaches a certain threshold in the effect indicator.
[0030] During the generation process, the computer system also needs to consider the diversity and robustness of the data. In order to generate candidate training charts with diversity, the computer system can introduce a certain amount of noise or random perturbations into the input data, so that the chart construction network can learn different data representations and styles. At the same time, in order to improve the robustness of the generated charts, the computer system can enhance the input data, such as replacing synonyms for text information, making minor adjustments to chart style tags, etc., so that the chart construction network can generate high-quality charts under different data conditions.
[0031] Step S400: Load A candidate training generated graphs into the graph construction effect evaluation network, use the graph construction effect evaluation network to output the confidence distribution of different effect indicators corresponding to each training generated graph, and determine the training loss function of the graph construction effect evaluation network based on the confidence distribution of different effect indicators.
[0032] The main task of the graph construction effect evaluation network is to evaluate the quality of the candidate training generated graphs generated by the graph construction network. After the computer system inputs A candidate training generated graphs into the graph construction effect evaluation network, the network will analyze and judge each graph from multiple dimensions to output the confidence distribution of different effect indicators.
[0033] Different performance indicators are used to measure the performance of candidate training generated charts in various aspects. For example, in terms of information accuracy, the performance indicator can be the error rate of the data in the chart, that is, the degree of deviation between the data displayed in the chart and the actual data; in terms of visual clarity, the performance indicator can be the contrast of the chart, the rationality of color matching, etc.; in terms of style matching, the performance indicator can be the degree of conformity between the style of the chart and the pre-set chart style training mark.
[0034] Taking the financial field as an example, suppose that the chart construction network generates A line graphs about the stock price trend of a company as candidate training generated graphs. The chart construction effect evaluation network will evaluate these line graphs. For the information accuracy index, the network will compare the price data on the line graph with the price data in the actual stock trading record and calculate the error between the two. If the closing price of the actual stock on a certain trading day is 100 yuan, and the line graph shows 102 yuan, then the error on that trading day is 2 yuan. For the visual clarity index, the network will analyze factors such as the line thickness and color contrast of the line graph. If the line is too thin or the color is too close to the background color, it will be visually difficult to distinguish, and the line graph will perform poorly on the visual clarity index. For the style matching index, if the pre-set chart style training mark requires the line of the line graph to be blue and the background to be white, and the generated line graph has red lines and a gray background, then the line graph will score low on the style matching index.
[0035] The confidence distribution of different effect indicators indicates the probability of each effect indicator taking different values. For example, the confidence distribution of the information accuracy indicator may show that the probability of the indicator taking a value between 0-5% is 80%, the probability of taking a value between 5%-10% is 15%, and the probability of taking a value greater than 10% is 5%. Computer systems can calculate these confidence distributions through statistical learning and machine learning methods. For example, a Bayesian network can be used to infer the probability of the value of each effect indicator based on historical data and prior knowledge. Assuming that historical data shows that in similar chart generation tasks, the error rate of the information accuracy indicator is usually between 0-5%, then in the new evaluation, the confidence in this interval will be relatively high.
[0036] The computer system determines the training loss function of the chart construction effect evaluation network based on the confidence distribution of different effect indicators. The training loss function is used to measure the difference between the predicted results of the chart construction effect evaluation network and the actual expected results. By minimizing the training loss function, the performance of the chart construction effect evaluation network can be continuously optimized. A feasible training loss function can be the cross entropy loss function, whose formula is , where y i is the actual label value, p i is the predicted probability value, and n is the number of samples. In this scenario, y i It can represent the actual expected value of each effect indicator, p i It can represent the probability value in the confidence distribution predicted by the graph construction effect evaluation network.
[0037] In order to calculate the training loss function, the computer system determines the actual expected value of each effect indicator. This can be achieved by manual annotation or by referring to authoritative standards. For example, for the information accuracy indicator, the actual expected value can be an error rate of 0, that is, the data displayed in the chart is exactly the same as the actual data. Then, the computer system compares the actual expected value of each effect indicator with the confidence distribution output of the effect evaluation network constructed by the chart, and substitutes it into the training loss function formula to calculate the loss value.
[0038] When calculating the training loss, the computer system can also consider the weights of different performance indicators. Different performance indicators may have different importance in the overall evaluation, so a weight can be assigned to each performance indicator. For example, in some scenarios, the information accuracy indicator may be more important than the visual clarity indicator, so a higher weight can be assigned to the information accuracy indicator. Assuming that the weight of the information accuracy indicator is 0.6, the weight of the visual clarity indicator is 0.3, and the weight of the style matching indicator is 0.1, the total training loss function can be expressed as ,in , and They are the training losses for information accuracy, visual clarity, and style matching metrics, respectively.
[0039] The computer system continuously adjusts the parameters of the graph construction effect evaluation network so that the value of the training loss function gradually decreases, thereby improving the evaluation accuracy of the network. During the training process, optimization algorithms such as stochastic gradient descent (SGD) can be used to update the parameters of the network. The stochastic gradient descent algorithm will update the parameters of the network in the direction of reducing the loss function based on the gradient information of the training loss function, and use a small batch of sample data for each update, which can improve the efficiency and stability of training.
[0040] Step S500: Calculate the training loss based on the training loss function, the prior effect indicator information corresponding to each candidate training generation chart, and the confidence distribution of different effect indicators, and repeatedly iterate the network parameters of the chart construction network based on the training loss until the chart construction network converges.
[0041] The training loss function has been determined in step S400, which measures the difference between the predicted results of the chart construction effect evaluation network and the actual expected results. The prior effect indicator information corresponding to each candidate training generated chart is the expected performance indicator pre-set for each generated chart in step S300. These indicators may include information accuracy, visual clarity, style matching, etc. The confidence distribution of different effect indicators is also output by the chart construction effect evaluation network in step S400, which represents the possibility of each effect indicator at different values.
[0042] The computer system calculates the training loss based on this information. One feasible calculation method is to combine the proximal policy optimization (PPO) reinforcement learning framework. In the PPO framework, the graph construction network is used as the policy model in reinforcement learning, responsible for generating candidate training generation graphs; the graph construction effect evaluation network is used as the training loss model in reinforcement learning, which is used to evaluate the quality of the generated graph. When calculating the training loss, the prior effect indicator information corresponding to each candidate training generation graph and the confidence distribution of different effect indicators can be used according to the standard entropy calculation method to calculate the entropy reward item. The calculation formula of standard entropy is , where p i is the probability of the effect indicator taking a value, and n is the number of values. The role of the entropy reward term is to encourage the graph construction network to explore more different generation strategies and increase the diversity of generated graphs.
[0043] At the same time, the gradient loss is calculated based on the training loss function, such as the mean square error (MSE) loss. The formula for MSE loss is: , where y iis the actual label value (which can be the prior effect indicator information), is the predicted value (which can be obtained based on the confidence distribution of different effect indicators), and n is the number of samples. The training loss function term is calculated by MSE loss.
[0044] Then, the total loss, i.e., the training loss, is calculated based on the entropy reward term and the training loss function term. This can be done using the formula To indicate that is the entropy bonus term, is the MSE loss term, and is a weight coefficient used to balance the impact of the entropy reward term and the MSE loss term.
[0045] Taking the medical field as an example, suppose that the chart construction network generates A line graphs about the incidence of a certain disease over time as candidate training generated graphs. Prior effect indicator information may stipulate that the data error on the line graph must be controlled within 5%, the line color must meet specific style requirements, and the visual clarity of the chart must meet certain standards. The confidence distribution of different effect indicators will show the probability of each indicator at different values. For example, the probability of the information accuracy indicator error rate being 0-5% is 70%, the probability of being 5%-10% is 20%, and the probability of being greater than 10% is 10%. Based on this information, the computer system calculates the entropy reward term and the MSE loss term according to the above method, and then obtains the training loss.
[0046] After obtaining the training loss, the computer system repeatedly iterates the graph based on the loss to construct the network parameters of the network. The iterative process uses optimization algorithms such as stochastic gradient descent (SGD) or its variants Adagrad, Adadelta, Adam, etc. Taking the Adam algorithm as an example, it combines the advantages of Adagrad and RMSProp and can adaptively adjust the learning rate of each parameter. The update formula of the Adam algorithm is: ; ; ; ; ; Among them, m t and v t are the first-order moment estimate and the second-order moment estimate of the gradient, and is the decay rate, is the training loss with respect to the network parameters The gradient of is the learning rate, is a small constant used to prevent the denominator from being zero.
[0047] The computer system continuously repeats the above process of calculating the training loss and updating the network parameters until the graph construction network converges. The convergence criterion can be that the value of the training loss function no longer decreases significantly within a certain number of iterations, or the change in the network parameters is less than a preset threshold. For example, if the change in the training loss function is less than 0.001 in 100 consecutive iterations, the graph construction network is considered to have converged.
[0048] During the iteration process, the computer system can also use an early stopping strategy to avoid overfitting. The early stopping strategy means stopping training early when the performance on the validation set no longer improves. The specific approach is to divide the data set into a training set, a validation set, and a test set. During the training process, the performance of the graph construction network is regularly evaluated on the validation set. If the loss function value on the validation set does not decrease for multiple consecutive iterations, the training is stopped and the network parameters at this time are selected as the final model parameters.
[0049] Step S500 calculates the training loss and iterates the network parameters of the graph construction network, so that the graph construction network can continuously learn and optimize, and finally generates a graph that better meets the prior effect indicator information and style requirements. When the computer system executes this step, it is necessary to comprehensively use technical means such as reinforcement learning, optimization algorithms and early stopping strategies to ensure the effectiveness and stability of the training process, thereby improving the performance of the entire graph generation network.
[0050] As an implementation manner, in step S200, if the determination result outputted by the style call determination network indicates that the style mark of the statistical description training text needs to be used, obtaining the chart style training mark corresponding to the statistical description training text includes: Step S210: if the determination result outputted by the style call determination network indicates that the style tag of the statistical description training text needs to be used, then B candidate generation style tags corresponding to the statistical description training text are obtained, where B≥1; Step S220: loading the text-chart binary training data and the matching identification features corresponding to the text-chart binary training data into the style tag determination network, and using the style tag determination network to output the training data features corresponding to the text-chart binary training data; Step S230: loading B candidate generated style tags into a style tag determination network, and using the style tag determination network to output a style tag feature corresponding to each candidate generated style tag; Step S240: respectively obtaining the similarity between the training data feature and each style mark feature, and obtaining the chart style training mark from the B candidate generated style marks according to the similarity.
[0051] When the computer system determines the output of the network based on the style call and determines that the style tag of the statistical description training text needs to be used, step S210 is first performed, that is, B candidate generation style tags corresponding to the statistical description training text are obtained, where B≥1. The candidate generation style tags are a series of style options that may be applicable to the current statistical description training text. These tags can cover various aspects of style features. For example, in the presentation of charts, they may include candidate morphological style tags, such as different chart forms such as bar charts, line charts, and pie charts; they may also include candidate color style tags, such as specific color combinations, color depths, etc. Taking the financial field as an example, for the statistical description training text describing the stock price trend, the candidate generation style tags may have a line chart form with red lines, a bar chart form with blue columns, etc. The computer system can obtain these candidate generation style tags by screening from a pre-established style tag library, which can be manually annotated and sorted by a large number of chart styles, or automatically learned and accumulated in the previous training process. The system can select possible matching style tags as candidates from the library based on some key features of the statistical description training text, such as data type, described topic, etc.
[0052] Next, in step S220, the computer system loads the text-chart binary training data and the matching identification features corresponding to the data into the style tag determination network, and uses the network to output the training data features corresponding to the text-chart binary training data. The style tag determination network is a trained neural network model, which is used to extract and analyze the input data. The training data features are an abstract representation of the text-chart binary training data, which contains semantic information, structural information, etc. in the data. For example, for the text-chart binary training data containing sales data text and sales trend charts, the training data features may reflect the growth trend of sales data, the sales share of different product categories, and other information. In order to obtain these features, the style tag determination network can adopt architectures such as convolutional neural networks (CNNs) or recurrent neural networks (RNNs). CNNs are suitable for processing data with spatial structures, such as charts in the form of pictures; RNNs are better at processing sequence data, such as text information. In practical applications, more complex models can also be used, such as long short-term memory networks (LSTMs) or gated recurrent units (GRUs), which can better capture long-term dependencies in sequence data. After the computer system inputs the text-graph binary training data and matching identification features into the style tag determination network, the network will perform multiple layers of nonlinear transformation on the data and finally output the training data features.
[0053] In step S230, the computer system loads B candidate generated style markers into the style marker determination network, and uses the network to output the style marker features corresponding to each candidate generated style marker. The style marker feature is a quantitative representation of the candidate generated style marker, which reflects the unique attributes of each style marker. For example, for a candidate generated style marker in the form of a line graph with red lines, the style marker features may include the slope of the line, the thickness of the line, the RGB value of red, etc. The process of the style marker determination network processing the candidate generated style marker is similar to processing the text chart binary training data. It also extracts and transforms the input style marker through a multi-layer neural network structure to obtain the style marker features corresponding to each candidate generated style marker. These features can help the computer system better understand and compare the differences between different style markers.
[0054] After obtaining the training data features and the style tag features corresponding to each candidate generated style tag, step S240 requires the computer system to obtain the similarity between the training data features and each style tag feature, and obtain the chart style training tag from the B candidate generated style tags based on these similarities. Similarity is an indicator to measure the similarity between two feature vectors. The feasible calculation methods include cosine similarity, Euclidean distance, etc. Taking cosine similarity as an example, its calculation formula is: , where A and B represent the training data features and style tag feature vectors respectively, is the dot product of the vectors, and ||A|| and ||B|| are the moduli of vectors A and B, respectively. The computer system calculates the cosine similarity between the training data features and the style tag features corresponding to each candidate generated style tag, and obtains B similarity values. Then, based on these similarity values, screening is performed to select the candidate generated style tag with the highest similarity as the chart style training tag. For example, in the financial field, if for the statistical description training text describing stock price fluctuations, the style tag feature with a line chart shape and red lines is calculated to have the highest cosine similarity with the training data feature, then this style tag is selected as the chart style training tag.
[0055] Steps S210-S240 obtain candidate generated style tags, extract training data features and style tag features, and calculate the similarity between them. The computer system can select the style tag that best matches the statistical description training text from multiple candidate styles, thereby providing more accurate style guidance for the subsequent chart construction network, and helping to generate statistical analysis charts that better meet user needs and data characteristics. In addition, the computer system also needs to pre-process and post-process the data throughout the process. Before inputting the text chart binary training data and the candidate generated style tags into the style tag determination network, the data needs to be normalized so that different data features have the same scale to avoid some features from having too much impact on network training due to too large a numerical range. After obtaining the similarity value, the result can also be smoothed, such as using methods such as Gaussian smoothing, to reduce the impact of noise and outliers on the final selection. In the training process of the style tag determination network, some optimization strategies can also be used to improve the performance of the network. For example, using batch normalization technology can accelerate the convergence speed of the network and reduce the problems of gradient disappearance and gradient explosion. At the same time, regularization methods, such as L1 and L2 regularization, can be used to prevent network overfitting and improve the generalization ability of the model. For the application of similarity calculation results, in addition to directly selecting the candidate generated style marker with the highest similarity, a similarity threshold can also be set. If the similarity between all candidate generated style markers and the training data features is lower than the threshold, it means that there may be no suitable style markers. At this time, the computer system can adopt other strategies, such as expanding the range of candidate generated style markers or readjusting the style marker library.
[0056] In summary, steps S210-S240 are important steps for the computer system to determine the chart style training mark in the NLP-based statistical analysis chart generation method. Through a series of data processing, feature extraction, similarity calculation and other operations, combined with a variety of technical means and optimization strategies, the computer system can select the style mark that best suits the statistical description training text from multiple candidate generation style marks, laying the foundation for the subsequent generation of high-quality statistical analysis charts. At the same time, through continuous optimization and improvement, as well as the introduction of a user feedback mechanism, the accuracy and efficiency of the entire process can be further improved to meet the diverse needs of different fields and users.
[0057] As an implementation method, the style tag determination network is debugged using the following steps: Step S11: Selecting the generated style mark corresponding to the chart style mark as the active style mark from among the B candidate generated style marks, wherein the active style mark corresponds to a matched active style mark label; Step S12: among the B candidate generated style markers, a negative style marker is established according to the remaining generated style markers except the positive style marker, wherein the negative style marker corresponds to a matched negative style marker label; Step S13: loading the positive style markers and the negative style markers into the style marker determination network, and using the style marker determination network to output the positive style marker features corresponding to each positive style marker and the negative style marker features corresponding to each negative style marker; Step S14: Calculate the similarity error based on the training data features, the positive style marker features, the positive style marker labels, the negative style marker features and the negative style marker labels, and iterate the style markers based on the similarity error to determine the network parameters of the network.
[0058] Step S11 requires the computer system to select the generated style tag corresponding to the chart style tag from B candidate generated style tags as the active style tag, where the active style tag is matched with the active style tag label. The candidate generated style tags are a series of style options that may be applicable to the statistical description training text, and the chart style tag is the style that is determined to be the most matching with the current statistical description training text after screening. The active style tag is a style selected from the candidate generated style tags that is consistent with the chart style tag, which represents the correct style pattern that the network is expected to learn and recognize. The active style tag label is an identifier of the style tag, which is used to clarify its category during the training process. For example, in the financial field, for the statistical description training text describing the stock price trend, the chart style tag may be "line chart, red line, gray background", then in the candidate generated style tags, the style tag that meets this description will be selected as the active style tag, and its corresponding active style tag label may be "stock trend-broken red line-gray background". The computer system can select positive style tags through manual annotation or rule-based screening methods, that is, according to pre-set style matching rules, find the tags that are completely consistent with or closest to the chart style tags from the candidate generated style tags.
[0059] In step S12, the computer system establishes a negative style marker based on the remaining generated style markers except the positive style marker among B candidate generated style markers, wherein the negative style marker corresponds to a negative style marker label. The negative style marker is a concept relative to the positive style marker, which represents a style pattern that is not suitable for the current statistical description training text. The negative style marker label is used to identify these unmatched style categories. For example, in the above-mentioned example in the financial field, if the positive style marker is "line chart, red line, gray background", then other candidate generated style markers such as "bar chart, blue bar, white background" and "pie chart, green sector, yellow background" will be combined or used alone as negative style markers, and the corresponding negative style marker label can be "non-stock trend-non-broken red line-non-gray background". The computer system can use random combination or combination based on specific rules to establish negative style markers to ensure that the network can learn the differences between different styles.
[0060] Next, step S13 requires the computer system to load the positive style marker and the negative style marker into the style marker determination network, and use the network to output the positive style marker features corresponding to each positive style marker and the negative style marker features corresponding to each negative style marker. The style marker determination network is a designed neural network model, which is used to extract and transform the input style marker. The positive style marker features and the negative style marker features are quantitative representations of the corresponding style markers, and they contain the key attributes and feature information of the style markers. For example, for the positive style marker "line graph, red line, gray background", the positive style marker features may include the slope of the line, the RGB value of the red line, the brightness of the gray background, etc.; for the negative style marker "bar graph, blue bar, white background", the negative style marker features may include the height of the bar, the RGB value of the blue bar, the contrast of the white background, etc. After the computer system inputs the positive style marker and the negative style marker into the style marker determination network, the network will process the input through a series of convolutional layers, fully connected layers and other neural network structures, and finally output the corresponding feature vector.
[0061] After obtaining the positive style marker features, negative style marker features and previously obtained training data features, step S14 requires the computer system to calculate the similarity error based on these features and the corresponding labels, and iterate the style markers based on the similarity error to determine the network parameters of the network. The similarity error is used to measure the difference in the degree of matching between the training data features and the positive style marker features and the negative style marker features. Feasible similarity calculation methods include cosine similarity and Euclidean distance. Then, the similarity error is calculated based on these similarity values. A feasible error calculation method is to use a contrast loss function, whose formula is: ; where N is the number of samples, y is the label (y is 1 for positive style markers and 0 for negative style markers), d is the Euclidean distance between the training data feature and the style marker feature, and margin is a preset boundary value. Based on the calculated similarity error, the computer system will use an optimization algorithm, such as stochastic gradient descent (SGD) or its variants Adagrad, Adadelta, Adam, etc., to iterate the network parameters of the style marker-determined network.
[0062] In summary, steps S11-S14 are important processes for debugging the style marker determination network by the computer system. By selecting positive style markers and establishing negative style markers, extracting corresponding features, calculating similarity errors and iterating network parameters, and combining a variety of technical means and optimization strategies, the computer system can enable the style marker determination network to learn the differences between different style markers, thereby accurately selecting appropriate chart style markers for statistical description training texts. At the same time, through continuous optimization and improvement, as well as the introduction of validation sets and test sets for evaluation, the performance and generalization ability of the network can be further improved to meet the diverse needs of different fields and users.
[0063] As an implementation mode, the B candidate generated style tags include one or more candidate morphological style tags or candidate color style tags; step S11, among the B candidate generated style tags, selecting the generated style tag corresponding to the chart style tag as the active style tag, includes: Step S111: selecting a candidate morphological style marker or a candidate color style marker corresponding to the chart style marker from one or more candidate morphological style markers or candidate color style markers as a positive style marker; Step S112: obtaining a style category feature corresponding to the active style marker, wherein the style category feature represents the style marker category of the active style marker.
[0064] Step S12, among the B candidate generated style markers, a negative style marker is established based on the remaining generated style markers except the positive style marker, including: Step S121: randomly extracting the remaining tags except the positive style tags from one or more candidate morphological style tags or candidate color style tags to obtain negative style tags; Step S122: obtaining a style category feature corresponding to the negative style marker, wherein the style category feature represents the style marker category of the negative style marker.
[0065] Step S13, loading the positive style marker and the negative style marker into the style marker determination network, using the style marker determination network to output the positive style marker feature corresponding to each positive style marker and the negative style marker feature corresponding to each negative style marker, including: Step S131: loading the positive style marker, the style category feature corresponding to the positive style marker, the negative style marker and the style category feature corresponding to the negative style marker into the style marker determination network, using the style marker determination network to output the positive style marker feature corresponding to each positive style marker and the negative style marker feature corresponding to each negative style marker.
[0066] Sub-step S111 requires the computer system to select the candidate morphological style tag or candidate color style tag corresponding to the chart style tag from one or more candidate morphological style tags or candidate color style tags as the active style tag. The candidate morphological style tags cover various different chart forms, such as bar charts, line charts, pie charts, etc.; the candidate color style tags include different color combinations, color depths and other style elements. The chart style tag is the style setting that best matches the current statistical description training text. Taking the financial field as an example, for a statistical description training text describing the fluctuation of a company's stock price over a period of time, the chart style tag may be "line chart, red line, gray background". In the candidate morphological style tags, the tag "line chart" matches the morphological part in the chart style tag; in the candidate color style tags, the combination of "red line, gray background" also meets the requirements. The computer system will select these matching tags as active style tags. In order to achieve this selection process, the computer system can adopt a rule-based matching method, that is, pre-set the matching rules between the chart style tag and the candidate style tags, and then check all candidate style tags one by one to find the tags that meet the rules. It is also possible to use a machine learning model, such as a support vector machine (SVM), to convert the chart style markers and candidate style markers into feature vectors, and classify them through the SVM to determine the positive style markers.
[0067] Sub-step S112 requires the computer system to obtain the style category features corresponding to the positive style marker, wherein the style category features characterize the style marker category of the positive style marker. The style category feature is an abstract description of the positive style marker, which can help the computer system to more clearly understand and distinguish different types of styles. For the above-mentioned example in the financial field, the style category features corresponding to the positive style marker "line graph, red line, gray background" may include "chart shape - line graph", "line color - red", "background color - gray", etc. The computer system can obtain these style category features by parsing and extracting features from the positive style marker. For example, regular expressions can be used to match the text description of the positive style marker to extract key style element information. In addition, a style feature dictionary can also be constructed to associate feasible style elements with corresponding feature categories, and the style category features can be obtained by querying the dictionary.
[0068] Sub-step S121 requires the computer system to arbitrarily extract the remaining tags except the positive style tags from one or more candidate morphological style tags or candidate color style tags to obtain negative style tags. Negative style tags represent style patterns that are not suitable for the current statistical description training text. Continuing with the example of describing stock price fluctuations in the financial field, if the positive style tag is "line chart, red line, gray background", then the "bar chart" and "pie chart" in the candidate morphological style tags, and the "blue line, yellow background" in the candidate color style tags can all be used as extraction objects after excluding the positive style tags. The computer system can use a random extraction method to randomly select a certain number of tags from the remaining tags as negative style tags; it can also extract according to some preset rules, such as giving priority to extracting tags that are significantly different from the positive style tags.
[0069] Sub-step S122 requires the computer system to obtain the style category feature corresponding to the negative style marker, wherein the style category feature characterizes the style marker category of the negative style marker. Similar to obtaining the style category feature of the positive style marker, the computer system needs to analyze and process the negative style marker to extract key style element information. For the negative style marker "bar graph, blue line, yellow background", its style category feature may include "chart shape - bar graph", "line color - blue", "background color - yellow", etc. The computer system may use the same method as that for obtaining the style category feature of the positive style marker, such as regular expression matching or querying the style feature dictionary, to obtain the style category feature of the negative style marker.
[0070] Sub-step S131 requires the computer system to load the positive style marker, the style category feature corresponding to the positive style marker, the negative style marker and the style category feature corresponding to the negative style marker into the style marker determination network, and use the network to output the positive style marker feature corresponding to each positive style marker and the negative style marker feature corresponding to each negative style marker. The style marker determination network is a designed neural network model, which is used to extract and convert the input style marker and the corresponding style category feature. The positive style marker feature and the negative style marker feature are quantitative representations of the corresponding style marker, which contain the key attributes and feature information of the style marker. In the example of the financial field, for the positive style marker "line chart, red line, gray background" and its style category features "chart shape-line chart", "line color-red", "background color-gray", and the negative style marker "bar chart, blue line, yellow background" and its style category features "chart shape-bar chart", "line color-blue", "background color-yellow", the computer system inputs this information into the style marker determination network. The network performs multiple layers of nonlinear transformations on the input, such as extracting local features through convolutional layers, integrating and transforming local features through fully connected layers, and finally outputting positive style marker features and negative style marker features. These features can be represented in the form of vectors, and each dimension of the vector corresponds to a specific style feature. For example, the positive style marker feature vector may be represented as [0.8, 0.6, 0.7], corresponding to the feature strength of the line graph, the feature strength of the red line, and the feature strength of the gray background; the negative style marker feature vector may be represented as [0.2, 0.3, 0.1], corresponding to the feature strength of the bar graph, the blue line, and the yellow background. In actual operation, the computer system needs to consider multiple aspects when performing these sub-steps. When selecting positive style markers and extracting negative style markers, it is necessary to ensure the representativeness and diversity of the markers so that the style marker determination network can learn the differences between different styles. For obtaining style category features, it is necessary to ensure the accuracy and efficiency of the extraction method to avoid missing important style information. When loading data into the style tagging network, the data needs to be preprocessed, such as encoding the style category features and converting them into a format suitable for network input. At the same time, in order to improve the performance of the network, some optimization strategies can also be adopted, such as batch normalization, which can accelerate the convergence speed of the network and reduce the problems of gradient vanishing and gradient exploding. In addition, regularization methods, such as L1 and L2 regularization, can also be used to prevent network overfitting and improve the generalization ability of the model.
[0071] In different application scenarios, the execution of these sub-steps may vary. For example, in the medical field, for statistical descriptive training texts that describe the changes in disease incidence over time, chart style tags may focus more on conciseness and accuracy, and positive style tags may be "line chart, black lines, white background". In this case, the computer system will make adjustments based on the characteristics of the medical field when selecting positive style tags and establishing negative style tags. At the same time, the extraction of style category features will also pay more attention to elements related to the display of medical data, such as the thickness of the line may represent the importance of the data, etc.
[0072] The computer system can also evaluate the performance of the style tagging network by introducing validation sets and test sets. During the training process, the accuracy of the positive style tag features and negative style tag features output by the network is regularly evaluated on the validation set. If the error on the validation set no longer decreases or starts to increase, it means that the network may be overfitting. At this time, the training can be stopped in advance or the parameters of the network can be adjusted. Finally, the trained network is finally evaluated on the test set to ensure that the network can perform well on unseen data.
[0073] As an implementation method, the style call determination network is debugged based on the following steps: Step S21: loading each text-chart binary training data into the style call determination network, and using the style call determination network to output the style tag determination confidence corresponding to each text-chart binary training data; Step S22: determining the confidence and the chart style tag according to the style tag corresponding to each training data feature, determining the style tag error, and iterating the style call to determine the parameters of the network according to the style tag error.
[0074] In sub-step S21, the computer system processes the text-chart binary training data. These data contain a large amount of text information and the corresponding charts, which are the basis for the style call determination network to learn and judge. The style call determination network is a designed neural network model, the purpose of which is to analyze the input text-chart binary training data to output the style tag determination confidence. The style tag determination confidence indicates the probability that the network believes that the text-chart binary training data needs to use statistical description training text style tags, and the value range is usually between 0 and 1. The closer to 1, the more style tags are needed, and the closer to 0, the less they are needed.
[0075] Taking the financial field as an example, suppose there is a text-chart binary training data, where the text description is "the company's operating income and net profit both show a steady growth trend this quarter", and the corresponding chart is a bar chart showing the revenue and profit of each quarter. The computer system loads this data into the style call determination network, and the network will conduct a comprehensive analysis of the semantics of the text and the visual features of the chart. The network may analyze the description of the data trend in the text, the color and shape matching of the chart, and other information. For example, if the text description is more detailed and emphasizes the trend of data changes, and the color and shape matching of the chart is more standardized and formal, the network may think that this data needs to use statistical descriptions to train the text style tags, thereby outputting a higher confidence level for the style tag determination, such as 0.8. On the contrary, if the text description is relatively simple and the presentation of the chart is relatively casual, the network may output a lower confidence level, such as 0.2.
[0076] In order to realize the analysis and output functions of the style call determination network, the computer system can adopt a variety of technical means. A feasible neural network architecture in deep learning, such as a multi-layer perceptron (MLP). MLP consists of an input layer, a hidden layer, and an output layer. The input layer receives the feature representation of the text chart binary training data, the hidden layer performs nonlinear transformation and feature extraction on these features, and the output layer outputs the confidence of the style tag determination. During the training process, MLP will continuously adjust its internal weights and bias parameters based on a large amount of training data to improve the accuracy of the output.
[0077] In sub-step S22, the computer system determines the confidence and the chart style tag corresponding to each training data feature, and determines the style tag error. The chart style tag is a style identifier pre-set for the text-chart binary training data, which represents the style pattern that the data should follow. The style tag error is used to measure the difference between the confidence of the style call determination network output and the actual chart style tag.
[0078] Continuing with the example of the financial field, if the style tag of the chart indicates that the data needs to strictly follow a certain style specification, and the confidence of the style tag output by the style call determination network is low, it means that there is a deviation between the network's judgment and the actual situation, and a large style tag error will be generated. In order to calculate the style tag error, the computer system can use the cross entropy loss function. After obtaining the style tag error, the computer system iterates the style call to determine the parameters of the network based on the error. The purpose of the iteration is to gradually reduce the style tag error by continuously adjusting the weights and bias parameters of the network, thereby improving the judgment accuracy of the network. The computer system can use optimization algorithms such as stochastic gradient descent (SGD) or its variants Adagrad, Adadelta, Adam, etc.
[0079] In summary, sub-steps S21-S22 analyze the text-chart binary training data by calling the style determination network, output the confidence of the style tag determination, and then calculate the style tag error based on the confidence and the chart style tag, and iterate the network parameters, so that the network can continuously learn and optimize, so as to accurately determine whether it is necessary to use statistical descriptions of the style tags of the training text. When executing these steps, the computer system needs to comprehensively use a variety of technical means and optimization strategies to improve the performance and reliability of the network and meet the needs of different application scenarios.
[0080] As an implementation mode, after step S100, obtaining text-graph binary training data, and obtaining matching identification features corresponding to the text-graph binary training data, the method further includes: step S110: pre-debugging the initialized graph construction network based on the text-graph binary training data and the matching identification features corresponding to the text-graph binary training data to obtain the graph construction network.
[0081] Sub-step S110 in the derivative implementation of step S100 requires the computer system to pre-debug the initialized graph construction network based on the text-graph binary training data and the matching identification features corresponding to the data to obtain the graph construction network. Pre-debugging is also the pre-training process. This process is to enable the initialized graph construction network to preliminarily learn the features and corresponding relationships of the text-graph binary training data, laying the foundation for subsequent more in-depth training and graph generation.
[0082] The text-chart binary training data contains a large amount of text information and the corresponding charts, which are important materials for the initialization chart construction network learning. The matching identification features clarify the correspondence between text and chart, so that the network can accurately understand what kind of chart the content described by the text should be presented in. The initialization chart construction network is a neural network model that has not been fully trained. It has certain structures and parameters, but it cannot complete the chart generation task well. Through pre-debugging, the computer system can adjust the parameters of the network so that it can better adapt to the input data.
[0083] Taking the business field as an example, assume that the text-graph binary training data contains the text description of sales data of an e-commerce company in different time periods and the corresponding sales trend chart. The matching identification features can be the time range and product category, such as "Jan-March 2024, electronic products", which associates the sales data text with the corresponding sales trend chart. The computer system uses this data to initialize the pre-debugging of the graph construction network.
[0084] In the pre-debugging process, the technical means used by the computer system are mainly based on deep learning methods. The encoder-decoder architecture is usually used to initialize the graph to build the network. The encoder is responsible for encoding the input data and extracting its feature representation; the decoder tries to restore the original graph based on the feature representation output by the encoder. By constantly adjusting the parameters of the encoder and decoder, the graph output by the decoder is made as close to the original graph as possible, thus completing the pre-debugging of the network.
[0085] To measure the difference between the decoder output graph and the original graph, the computer system uses a loss function, such as the mean square error (MSE) loss function, which is given by , where y i is the pixel value or feature value of the original graph, is the pixel value or feature value of the graph output by the decoder, and n is the number of data points. The computer system will adjust the parameters of the network for initializing the graph construction based on the value of the loss function.
[0086] When adjusting parameters, the computer system will use optimization algorithms such as stochastic gradient descent (SGD) or its variants Adagrad, Adadelta, Adam, etc. During the pre-debugging process, the computer system will also use batch training to divide the text chart binary training data into multiple small batches, and input them into the initialized chart construction network for training in turn. This can improve the efficiency of training and reduce memory usage. At the same time, in order to prevent the network from overfitting, the computer system can use regularization methods such as L1 and L2 regularization. L1 regularization constrains the size of the parameters by adding the sum of the absolute values of the parameters to the loss function. The formula is ; L2 regularization adds the sum of squares of parameters, the formula is ,in is the regularization coefficient, is the parameter of the network. After multiple iterations of pre-debugging, when the value of the loss function no longer decreases significantly or reaches the preset number of iterations, the computer system considers that the initialization graph construction network has completed pre-debugging, and the network obtained at this time is the graph construction network. This graph construction network has preliminarily learned the characteristics and correspondence of the text-graph binary training data, and can generate relevant graphs based on the input text and matching identification features to a certain extent, providing a good foundation for subsequent training and application.
[0087] As an implementation mode, step S110, pre-debugging the initialized graph construction network according to the text-graph binary training data and the matching identification features corresponding to the text-graph binary training data to obtain the graph construction network, includes: Step S111: Divide each text-graph binary training data into a plurality of data units, wherein one or more data units are derived from statistical description training texts, and one or more data units are derived from training generated graphs; Step S112: loading the matching identification features corresponding to the plurality of data units and the text-chart binary training data into the initialization chart construction network, and using the embedding mapping component of the initialization chart construction network to respectively embed and map the matching relationships corresponding to the plurality of data units and the text-chart binary training data, to obtain the training embedding features corresponding to the text-chart binary training data; Step S113: using the restoration mapping component of the initialization graph construction network to restore the training embedding features to obtain the confidence distribution of the training generated graph; Step S114: determining a generation error based on the confidence distribution of the training generated graph, and iteratively initializing network parameters of the graph construction network based on the generation error to obtain the graph construction network.
[0088] Sub-step S111 requires the computer system to divide each text-chart binary training data into multiple data units, wherein one or more data units are derived from the statistical description training text, and one or more data units are derived from the training generated chart. The text-chart binary training data contains rich information, and dividing it into data units helps the computer system to process and analyze the data more carefully. For example, in the financial field, for the text-chart binary training data describing the quarterly financial status of a company, the text part may contain the company's operating income, net profit, assets and liabilities and other information, and the computer system can split this information into different data units, such as "operating income: 50 million yuan" and "net profit: 10 million yuan". For the corresponding training generated chart, such as a bar chart showing quarterly revenue and profit, the computer system can divide it according to the elements of the chart, such as the columns, coordinate axes, legends, etc. of different quarters as a data unit. This division method enables the computer system to more clearly identify and process each information fragment in the text and chart, and provide more accurate data input for subsequent embedding mapping operations.
[0089] Sub-step S112 requires the computer system to load the matching identification features corresponding to the multiple data units and the text-chart binary training data into the initialization chart construction network, and use the embedding mapping component of the network to embed and map the matching relationships corresponding to the multiple data units and the text-chart binary training data, respectively, to obtain the training embedding features corresponding to the text-chart binary training data. The embedding mapping component is usually the encoder part in the initialization chart construction network, and its function is to convert the input data into a low-dimensional vector representation, that is, to train the embedding features. For the data unit, the encoder will process the text data unit and the chart data unit separately. For the text data unit, the encoder can use word embedding technology to convert each word in the text into a vector, and then combine and transform these vectors through the neural network layer to obtain the embedding features of the text data unit. For example, a pre-trained word vector model (such as Word2Vec or GloVe) is used to convert words into vectors, and then these vectors are further processed by a multi-layer perceptron (MLP). For the chart data unit, the encoder can use a convolutional neural network (CNN) to extract and convert the image features of the chart and convert the chart data unit into a vector representation. For the matching identification features, the encoder will also convert them into vector form to represent the corresponding relationship between text and chart. Finally, the encoder integrates the embedding features of all data units and the embedding features of matching identification features to obtain the training embedding features corresponding to the text-chart binary training data.
[0090] Sub-step S113 requires the computer system to restore the training embedded features using the restoration mapping component of the initialization chart construction network to obtain the confidence distribution of the training generated chart. The restoration mapping component is usually the decoder part of the initialization chart construction network, and its function is to try to restore the original training generated chart based on the training embedded features. The decoder will perform a series of transformation and reconstruction operations on the training embedded features to gradually generate various elements of the chart. For example, for a bar chart, the decoder will generate information such as the height, color, and position of the column based on the training embedded features. Due to certain uncertainties in the generation process, the decoder outputs the confidence distribution of the training generated chart, rather than a definite chart. The confidence distribution represents the probability of each possible chart element value. For example, for the height of the column, the confidence distribution may indicate that the probability of a height of 100 pixels is 0.3, the probability of a height of 110 pixels is 0.5, the probability of a height of 120 pixels is 0.2, and so on.
[0091] Sub-step S114 requires the computer system to determine the generation error based on the confidence distribution of the training generated graph, and iteratively initialize the network parameters of the graph construction network based on the generation error to obtain the graph construction network. The generation error is used to measure the difference between the confidence distribution of the training generated graph output by the decoder and the original training generated graph. A feasible generation error calculation method is the cross entropy loss function, whose formula is , where y i is the true label of the original training generated chart (which can be the actual value of the chart element), p i is the probability of the corresponding value in the confidence distribution of the training generated graph, and n is the number of samples. The computer system obtains the generation error by calculating the value of the cross entropy loss function. After obtaining the generation error, the computer system will use an optimization algorithm (such as stochastic gradient descent SGD or its variants Adagrad, Adadelta, Adam, etc.) to iteratively initialize the network parameters of the graph construction network. Taking the Adam algorithm as an example, it combines the advantages of Adagrad and RMSProp and can adaptively adjust the learning rate of each parameter.
[0092] In summary, sub-steps S111-S114 are key steps for the computer system to pre-debug the initialization graph construction network. By dividing, embedding, mapping, restoring, calculating errors, and iterating parameters of the text-graph binary training data, combined with a variety of optimization strategies and evaluation mechanisms, the computer system can enable the initialization graph construction network to learn the correspondence between text and graph, generate accurate training generation graphs, and finally obtain a graph construction network that can play a role in practical applications.
[0093] As an implementation mode, in step S400, the training loss function of the effect evaluation network constructed by the graph is determined based on the confidence distribution of different effect indicators, including: step S410: based on the confidence distribution of different effect indicators, the confidence superposition value of the maximum effect indicator is obtained, and the confidence superposition value of the maximum effect indicator is used as the training loss function of the effect evaluation network constructed by the graph.
[0094] Sub-step S410 in the implementation of step S400 requires the computer system to obtain the confidence superposition value of the maximum effect index based on the confidence distribution of different effect indicators, and use the confidence superposition value of the maximum effect index as the training loss function of the graph construction effect evaluation network. This step is a key operation for the computer system to further determine the training loss function of the graph construction effect evaluation network after evaluating the candidate training generated graph, which is crucial for optimizing the network to accurately evaluate the graph construction effect.
[0095] After being processed by the chart construction effect evaluation network, the computer system obtains the confidence distribution of different effect indicators corresponding to each candidate training generated chart. Different effect indicators are used to measure the performance of candidate training generated charts in various aspects, such as information accuracy, visual clarity, style matching, etc. The confidence distribution represents the possibility of each effect indicator at different values. Taking the financial field as an example, for a line chart candidate training generated chart describing the stock price trend of a company, the confidence distribution of the information accuracy indicator may show that the probability of the indicator value being 0-5% is 80%, the probability of the error rate being 5%-10% is 15%, and the probability of the error rate being greater than 10% is 5%; the confidence distribution of the visual clarity indicator may show that the probability of the indicator value being clear is 70%, the probability of being relatively clear is 20%, and the probability of being unclear is 10%; the confidence distribution of the style matching indicator may show that the probability of the indicator value being completely matched is 60%, the probability of being partially matched is 30%, and the probability of being unmatched is 10%.
[0096] The computer system first obtains the confidence superposition value of the maximum effect indicator based on the confidence distribution of these different effect indicators. The maximum effect indicator refers to the indicator that best reflects the quality of chart construction among all the effect indicators. In different application scenarios, the maximum effect indicator may be different. For example, in the field of scientific research, information accuracy may be the maximum effect indicator; in the field of advertising design, visual appeal may be the maximum effect indicator. The computer system will predetermine the maximum effect indicator according to the specific application scenario. After determining the maximum effect indicator, the computer system will perform a superposition calculation on the confidence distribution of the indicator. Assuming that information accuracy is the maximum effect indicator, its confidence distribution is p1=0.8 for an error rate of 0-5%, p2=0.15 for an error rate of 5%-10%, and p3=0.05 for an error rate greater than 10%. In order to calculate the confidence superposition value, the computer system can assign different weights according to different error rate intervals, assuming that the weight w1=1 for an error rate of 0-5%, the weight w2=0.5 for an error rate of 5%-10%, and the weight w3=0 for an error rate greater than 10%. Then the confidence superposition value S=p1×w1+p2×w2+p3×w3=0.8×1+0.15×0.5+0.05×0=0.875.
[0097] The computer system uses the confidence superposition value of the maximum effect indicator as the training loss function of the chart construction effect evaluation network. The training loss function is used to measure the difference between the predicted results of the chart construction effect evaluation network and the actual expected results. By minimizing the training loss function, the performance of the chart construction effect evaluation network can be continuously optimized. In this step, using the confidence superposition value of the maximum effect indicator as the training loss function means that the training goal of the network is to make the confidence superposition value of the maximum effect indicator as close to the ideal state as possible. For example, for the information accuracy indicator, the ideal state is that the error rate is 0, that is, the confidence superposition value is 1. According to this training loss function, the computer system uses an optimization algorithm (such as stochastic gradient descent SGD or its variants Adagrad, Adadelta, Adam, etc.) to iterate the network parameters of the chart construction effect evaluation network.
[0098] As an implementation manner, the method provided in the embodiment of the present invention may further include: Step S1000: obtaining matching identification features corresponding to the text-chart binary data to be processed, and loading the text-chart binary data to be processed into a style call determination network, and using the style call determination network to output the style tag determination confidence corresponding to the text-chart binary data to be processed, wherein the text-chart binary data to be processed is composed of chart data and text description data; Step S2000: if the style mark determination confidence is not less than a preset determination value, then obtaining the target generation style mark corresponding to the chart data, and obtaining the matching identification feature corresponding to the target generation style mark; Step S3000: loading the to-be-processed text-graph binary data, the matching identification features corresponding to the to-be-processed text-graph binary data, the target generation style tag, and the matching identification features corresponding to the target generation style tag into a graph construction network, and using the graph construction network to output S description text matching generation graphs corresponding to the to-be-processed text-graph binary data, where S≥1; Step S4000: Loading S description text matching generation charts into the chart construction effect evaluation network, and using the chart construction effect evaluation network to output the confidence distribution of different effect indicators corresponding to each description text matching generation chart; Step S5000: Based on the confidence distribution of different effect indicators corresponding to each description text matching generation chart, the description text matching generation chart corresponding to the maximum confidence in the maximum effect indicator is used as the matching generation chart.
[0099] Step S1000 requires the computer system to obtain the matching identification features corresponding to the text-chart binary data to be processed, and to load the text-chart binary data to be processed into the style call determination network, and use the network to output the style tag determination confidence corresponding to the text-chart binary data to be processed, wherein the text-chart binary data to be processed is composed of chart data and text description data. The text-chart binary data to be processed is new data that needs to be analyzed and processed by the computer system to generate a suitable chart. The matching identification features are used to clarify the corresponding relationship between the chart data and the text description data. For example, in the field of commercial sales, the text-chart binary data to be processed may be a text description of the sales of a product in different regions and the corresponding sales data chart, and the matching identification features may be a combination of the product name and the region name, such as "smartphone, North China". The style call determination network is a neural network model that has been debugged and trained. It will analyze the input text-chart binary data to be processed, comprehensively consider factors such as the semantics of the text and the visual features of the chart, and output a style tag determination confidence. This confidence level indicates the likelihood that the data needs to be trained with text style tags using statistical descriptions, and the value range is usually between 0 and 1. For example, if the text to be processed describes the growth trend of sales data in detail, and the chart also presents a standardized style, the style call determination network may output a higher confidence level, such as 0.8, indicating that style tags are likely to be needed; conversely, if the text description is simple and the chart is random, the confidence level may be lower, such as 0.2. In order to realize the analysis and output functions of the style call determination network, the computer system can adopt the multi-layer perceptron (MLP) architecture in deep learning, and continuously adjust the network's weights and bias parameters to enable it to accurately determine the need for style tags.
[0100] Step S2000 stipulates that if the style tag determination confidence is not less than the preset determination value, the computer system obtains the target generation style tag corresponding to the chart data, and obtains the matching identification feature corresponding to the target generation style tag. The preset determination value is a preset threshold value used to determine whether the style tag needs to be used. When the style tag determination confidence is not less than the threshold value, it means that the current text chart binary data to be processed is likely to follow a specific style. The target generation style tag is a specific style setting that matches the data, which can include features such as the shape, color, and line style of the chart. Continuing to take the commercial sales field as an example, if the preset determination value is 0.7, and the confidence of the style call determination network output is 0.8, the computer system will search for the target generation style tag that matches the data from the pre-established style tag library, such as "bar chart, blue bar, white background". The matching identification feature corresponding to the target generation style tag is used to ensure that the style tag accurately corresponds to the text chart binary data to be processed, and can also be a combination of product name and region name. The computer system can obtain the target generation style tag and its matching identification feature through rule-based matching or machine learning algorithms.
[0101] Step S3000 requires the computer system to load the text-chart binary data to be processed, the matching identification features corresponding to the text-chart binary data to be processed, the target generation style tag, and the matching identification features corresponding to the target generation style tag into the chart construction network, and use the network to output S description text matching generation charts corresponding to the text-chart binary data to be processed, where S≥1. The chart construction network is a trained neural network model that generates possible charts based on the input data. The text-chart binary data to be processed provides the network with basic information about text and charts, the matching identification features ensure the correspondence between the data, and the target generation style tag and its matching identification features give the generated chart a specific style. In the example of the commercial sales field, the chart construction network will combine the text description of the sales of smartphones in North China, the sales data chart, the style tag of "bar chart, blue bar, white background", and other information to generate S different bar charts, which may be different in terms of the height and proportion of the bar, but all follow the requirements of the target generation style tag. Graph construction networks usually use an encoder-decoder architecture, where the encoder encodes the input data and extracts its feature representation, and the decoder generates a graph based on these feature representations. In order to generate multiple different graphs, the computer system can introduce a certain amount of randomness in the generation process of the decoder, such as randomly initializing some parameters or performing random sampling during the generation process.
[0102] Step S4000 requires the computer system to load S description text matching generated charts into the chart construction effect evaluation network, and use the network to output the confidence distribution of different effect indicators corresponding to each description text matching generated chart. The chart construction effect evaluation network is a neural network model used to evaluate the quality of generated charts. It analyzes and judges each chart from multiple dimensions and outputs the confidence distribution of different effect indicators. Different effect indicators are used to measure the performance of charts in various aspects, such as information accuracy, visual clarity, style matching, etc. The confidence distribution represents the possibility of different values for each effect indicator. For example, for a generated bar chart, the confidence distribution of the information accuracy index may show that the probability of the index value being 0-5% is 70%, the probability of the error rate being 5%-10% is 20%, and the probability of the error rate being greater than 10% is 10%; the confidence distribution of the visual clarity index may show that the probability of the index value being clear is 80%, the probability of being relatively clear is 15%, and the probability of being unclear is 5%; the confidence distribution of the style matching index may show that the probability of the index value being completely matched is 90%, the probability of being partially matched is 8%, and the probability of being unmatched is 2%. The chart construction effect evaluation network can use a convolutional neural network (CNN) or other deep learning architecture to extract and analyze the image features of the chart and output the confidence distribution of different effect indicators.
[0103] Step S5000 requires the computer system to use the description text matching generated chart corresponding to the maximum confidence in the maximum effect index as the matching generated chart according to the confidence distribution of different effect indicators corresponding to each description text matching generated chart. The maximum effect index is the index that best reflects the quality of the chart among all effect indicators, and the maximum effect index may be different in different application scenarios. For example, in the field of scientific research, information accuracy may be the maximum effect index; in the field of advertising design, visual appeal may be the maximum effect index. The computer system will predetermine the maximum effect index according to the specific application scenario. Then, in the confidence distribution of different effect indicators corresponding to each description text matching generated chart, find the confidence corresponding to the maximum effect index, and select the description text matching generated chart with the largest confidence as the final matching generated chart. In the example of the commercial sales field, if information accuracy is the maximum effect indicator, the computer system will compare the confidence of S generated bar charts on the information accuracy index, and select the bar chart with the largest confidence as the final matching generated chart. This ensures that the generated chart performs optimally in the most important aspects.
[0104] In summary, steps S1000-S5000 provide a complete solution for the computer system to process new text-graph binary data to be processed using the trained graph generation network. By comprehensively using the style call determination network, the graph construction network and the graph construction effect evaluation network, combined with a variety of optimization strategies and evaluation mechanisms, the computer system can generate high-quality, matching generation graphs that meet the requirements according to different application scenarios.
[0105] As an implementation mode, in step S1000, after loading the text-chart binary data into the style call determination network and determining the confidence of the style tag corresponding to the text-chart binary data output by the style call determination network, the method further includes: Step S1100: if the style mark determination confidence is less than a preset determination value, then obtaining a matching identification feature corresponding to the text-chart binary data; Step S1200: loading the text-graph binary data and the matching identification features corresponding to the text-graph binary data into a graph construction network, and using the graph construction network to output S description text matching generation graphs corresponding to the text-graph binary data, where S≥1; Step S1300: loading S description text matching generation charts into the chart construction effect evaluation network, and using the chart construction effect evaluation network to output the confidence distribution of different effect indicators corresponding to each description text matching generation chart; Step S1400: according to the confidence distribution of different effect indicators corresponding to each description text matching generation chart, the description text matching generation chart corresponding to the maximum confidence in the maximum effect indicator is used as the matching generation chart.
[0106] Sub-step S1100 requires the computer system to obtain the matching identification features corresponding to the text-chart binary data when the confidence of the style tag determination is less than the preset determination value. The style tag determination confidence is the possibility judgment result of the style call to determine whether the network needs to use statistical description training text style tags for the text-chart binary data. The preset determination value is a pre-set threshold used to distinguish whether the style tag is used. When the confidence is less than the threshold, it means that the current data may not need to follow a specific style pattern. The matching identification features are used to clarify the correspondence between the chart data and the text description data in the text-chart binary data. For example, in the field of market research, the text-chart binary data may be a text description and a corresponding statistical chart about the purchase intention of consumers of different age groups of a certain brand. The matching identification features can be a combination of brand name and age range, such as "Brand A, 20-30 years old". The computer system can extract these matching identification features from the pre-stored data structure to ensure that the text and chart information can be accurately associated in subsequent processing.
[0107] Sub-step S1200 requires the computer system to load the text-chart binary data and the matching identification features corresponding to the text-chart binary data into the chart construction network, and use the network to output S description text matching generation charts corresponding to the text-chart binary data, where S≥1. The chart construction network is a trained neural network model, and its function is to generate possible charts based on the input data. The text-chart binary data provides the network with the basic information required to generate charts, including the data description in the text and the existing chart style (if any), and the matching identification features help the network to accurately understand the correspondence between the text and the chart. In the example of market research, the chart construction network will combine the text description of the purchase intention of consumers aged 20-30 years old about brand A, relevant statistical data, and the matching identification feature "Brand A, 20-30 years old", and try to generate S different description text matching generation charts. These charts may be in different forms such as bar charts, line charts or pie charts, which are used to show the purchase intention distribution of consumers of different age groups. The chart construction network usually adopts an encoder-decoder architecture, where the encoder encodes the input data and extracts its feature representation, and the decoder generates charts based on these feature representations. In order to generate multiple different graphs, the computer system may introduce a certain amount of randomness in the generation process of the decoder, such as randomly initializing some parameters or performing random sampling during the generation process.
[0108] Sub-step S1300 requires the computer system to load S description text matching generated charts into the chart construction effect evaluation network, and use the network to output the confidence distribution of different effect indicators corresponding to each description text matching generated chart. The chart construction effect evaluation network is a neural network model used to evaluate the quality of generated charts. It analyzes and judges each chart from multiple dimensions and outputs the confidence distribution of different effect indicators. Different effect indicators are used to measure the performance of charts in various aspects, such as information accuracy, visual clarity, data readability, etc. The confidence distribution represents the possibility of different values for each effect indicator. For example, for a generated bar chart, the confidence distribution of the information accuracy index may show that the probability of the index value being 0-5% is 70%, the probability of the error rate being 5%-10% is 20%, and the probability of the error rate being greater than 10% is 10%; the confidence distribution of the visual clarity index may show that the probability of the index value being clear is 80%, the probability of being relatively clear is 15%, and the probability of being unclear is 5%; the confidence distribution of the data readability index may show that the probability of the index value being easy to understand is 90%, the probability of being difficult to understand is 8%, and the probability of being difficult to understand is 2%. The chart construction effect evaluation network can use a convolutional neural network (CNN) or other deep learning architecture to extract and analyze the image features of the chart and output the confidence distribution of different effect indicators.
[0109] Sub-step S1400 requires the computer system to use the description text matching generated chart corresponding to the maximum confidence in the maximum effect index as the matching generated chart based on the confidence distribution of different effect indicators corresponding to each description text matching generated chart. The maximum effect index is the index that best reflects the quality of the chart among all effect indicators, and the maximum effect index may be different in different application scenarios. For example, in the field of scientific research, information accuracy may be the maximum effect index; in the field of commercial display, visual appeal may be the maximum effect index. The computer system will predetermine the maximum effect index according to the specific application scenario. Then, in the confidence distribution of different effect indicators corresponding to each description text matching generated chart, find the confidence corresponding to the maximum effect index, and select the description text matching generated chart with the largest confidence as the final matching generated chart. In the example of market research, if information accuracy is the maximum effect indicator, the computer system will compare the confidence of S generated charts on the information accuracy index, and select the chart with the largest confidence as the final matching generated chart. This ensures that the generated chart performs optimally in the most important aspects.
[0110] As an implementation mode, step S3000, loading text-graph binary data, matching identification features corresponding to the text-graph binary data, target generation style tags, and matching identification features corresponding to the target generation style tags into a graph construction network, and using the graph construction network to output S description text matching generation graphs corresponding to the text-graph binary data, includes: Step S3100: Divide each text-chart 2-tuple data into a plurality of data units, wherein one or more data units are derived from the chart data, and one or more data units are derived from the text description data; Step S3200: Load the matching identification features corresponding to the plurality of data units and the text-chart binary data into the chart construction network, and use the embedding mapping component of the chart construction network to respectively embed and map the matching relationships corresponding to the plurality of data units and the text-chart binary data to obtain data embedding features corresponding to the text-chart binary data; Step S3300: Use the restoration mapping component of the graph construction network to restore and map the data embedding features to obtain the confidence distribution of the matching generation graph, and obtain S description text matching generation graphs based on the confidence distribution of the matching generation graph.
[0111] Sub-step S3100 requires the computer system to divide each text-chart binary data into multiple data units, wherein one or more data units are derived from the chart data, and one or more data units are derived from the text description data. The text-chart binary data contains rich information, and dividing it into data units helps the computer system to process and analyze this information more carefully. In different application scenarios, the division method will be different according to the characteristics of the data. For example, in the financial field, for the text-chart binary data describing the quarterly financial status of a company, the text part may contain the company's operating income, net profit, assets and liabilities and other information, and the computer system can split this information into different data units, such as "operating income: 50 million yuan" and "net profit: 10 million yuan". For the corresponding chart data, such as a bar chart showing quarterly revenue and profit, the computer system can divide it according to the elements of the chart, such as the columns, coordinate axes, legends, etc. of different quarters as a data unit. This division method enables the computer system to more clearly identify and process each information fragment in the text and chart, and provide more accurate data input for subsequent embedding and mapping operations.
[0112] In actual operation, the computer system can use rule-based methods or natural language processing technology to divide data units. For text data, rule-based methods can be used to segment according to specific grammatical rules or keywords, such as commas, periods, or specific delimiters. Natural language processing technologies, such as part-of-speech tagging and syntactic analysis, can provide a deeper understanding of the structure and semantics of the text, thereby dividing data units more accurately. For chart data, the computer system can use image processing technologies, such as edge detection and feature extraction, to identify different elements in the chart and divide them into data units.
[0113] Sub-step S3200 requires the computer system to load the matching identification features corresponding to the multiple data units and the text-chart binary data into the chart construction network, and use the embedding mapping component of the network to embed and map the matching relationships corresponding to the multiple data units and the text-chart binary data, respectively, to obtain the data embedding features corresponding to the text-chart binary data. The chart construction network is a trained neural network model, and its embedding mapping component is usually the encoder part, which converts the input data into a low-dimensional vector representation, that is, the data embedding feature. This vector representation can retain the key information of the data, while facilitating the network to process and learn.
[0114] For multiple data units, the embedding mapping component processes the text data unit and the chart data unit separately. For the text data unit, the encoder can use word embedding technology to convert each word in the text into a vector, and then combine and transform these vectors through the neural network layer to obtain the embedding features of the text data unit. For example, use a pre-trained word vector model (such as Word2Vec or GloVe) to convert words into vectors, and then further process these vectors through a multi-layer perceptron (MLP). For the chart data unit, the encoder can use a convolutional neural network (CNN) to extract and transform the image features of the chart and convert the chart data unit into a vector representation. CNN has a powerful feature extraction capability and can capture the spatial structure and visual information in the chart.
[0115] The matching identification feature is used to clarify the correspondence between text and charts, and the embedding mapping component will also convert it into a vector form to represent this correspondence. For example, in the financial field, the matching identification feature may be a combination of company name and quarter, such as "ABC Company, Q1 2024". The encoder converts this matching identification feature into a vector and processes it together with the embedding features of the text data unit and the chart data unit.
[0116] Finally, the embedding mapping component integrates the embedding features of all data units and the embedding features of matching identification features to obtain the data embedding features corresponding to the text-graph binary data. This data embedding feature is a comprehensive vector representation that contains key information about text, graph, and the corresponding relationship between them, providing a basis for the subsequent reduction mapping component of the graph construction network to generate a graph describing the text matching generation.
[0117] When executing sub-step S3200, the computer system needs to pay attention to multiple aspects. First, when selecting the technology and model of embedding mapping, it is necessary to make a reasonable choice based on the characteristics of the data and the structure of the network. For text data, different word embedding models and neural network architectures may produce different effects, and experiments and comparisons are required. For chart data, parameters such as the number of CNN layers and convolution kernel size will also affect the effect of feature extraction. Secondly, it is necessary to ensure the accurate embedding of matching identification features, because it is crucial for the network to understand the correspondence between text and charts. Special encoding methods can be used or matching identification features can be pre-processed to improve the accuracy of embedding. In addition, in order to improve the efficiency and performance of embedding mapping, the computer system can use batch processing to input multiple text chart binary data together into the embedding mapping component for processing.
[0118] In order to evaluate the effect of embedding mapping, the computer system can use some indicators, such as similarity calculation. By calculating the similarity between different data embedding features, it can be judged whether the embedding mapping can preserve the semantic and structural relationship between the data. Viable similarity calculation methods include cosine similarity and Euclidean distance.
[0119] In different application scenarios, the execution of sub-steps S3100-S3200 may vary. For example, in the medical field, text-chart tuple data may contain disease diagnosis information and corresponding medical imaging charts. In this case, the division of data units needs to consider the characteristics of medical terminology and imaging features, and the embedding mapping component needs to be able to handle the complex characteristics of medical expertise and imaging data. In the education field, text-chart tuple data may be a text description of student performance statistics and a corresponding performance distribution chart. The division of data units and embedding mapping need to pay attention to the characteristics of educational data, such as the grade of performance, subject classification, etc.
[0120] In summary, sub-steps S3100-S3200 are important links in the process of generating description text matching and generating charts by the computer system. By reasonably dividing the text chart binary data into data units, and using the embedding mapping component of the chart construction network for feature extraction and embedding mapping, the computer system can convert complex data into vector representations that are easy to process, providing strong support for the subsequent accurate generation of charts that meet the requirements. At the same time, during the execution process, it is necessary to comprehensively consider multiple aspects such as data characteristics, technical selection and evaluation indicators to ensure the effectiveness and accuracy of the entire process. In different application scenarios, it is also necessary to appropriately adjust and optimize the steps according to specific needs to meet the diverse chart generation needs.
[0121] Sub-step S3300 in the implementation of step S3000 requires the computer system to use the reduction mapping component of the graph construction network to restore the data embedding features, obtain the confidence distribution of the matching generated graph, and obtain S description text matching generated graphs based on the confidence distribution of the matching generated graph, where S≥1. This step is a key operation after sub-step S3100 divides the text graph binary data into multiple data units, and sub-step S3200 uses the embedding mapping component to obtain the data embedding features, and aims to generate a graph that meets the requirements based on the data embedding features.
[0122] The reduction mapping component of the graph construction network is usually the decoder part, and its main function is to restore the data embedding features to a specific graph. The data embedding features are low-dimensional vector representations obtained after processing by the embedding mapping component, which contain key information about text, graphs, and the corresponding relationship between them. The reduction mapping component will perform a series of transformation and reconstruction operations on these features to gradually generate the various elements of the graph.
[0123] Taking the financial field as an example, suppose that the data embedding feature is obtained by embedding and mapping a text description of a company's quarterly financial status (such as "this quarter's operating income increased by 20%, and the net profit reached 50 million yuan") and the corresponding financial data bar chart. The restoration mapping component will try to generate a bar chart that accurately reflects the text description and data based on these feature information. During the generation process, due to certain uncertainties, the restoration mapping component outputs the confidence distribution that matches the generated chart. The confidence distribution represents the probability of each possible chart element value. For example, for the height of the column representing operating income in the bar chart, the confidence distribution may show that the probability of a height of 100 pixels is 0.3, the probability of a height of 110 pixels is 0.5, the probability of a height of 120 pixels is 0.2, and so on.
[0124] In order to achieve the restoration mapping, the computer system can adopt a variety of technical means. It is feasible to use a deconvolutional neural network (Deconvolutional Neural Network, DeCNN) or a variational autoencoder (VAE). The deconvolutional neural network is the inverse process of the convolutional neural network. It can gradually upsample the low-dimensional feature vector to restore the high-resolution image. In chart generation, it can be used to generate pixel-level representations of charts. The variational autoencoder is a generative model that can not only encode and decode data, but also learn the distribution of data. It generates diverse samples by sampling in the latent space, which is suitable for generating charts with certain uncertainties.
[0125] The computer system obtains S description text matching generation charts based on the confidence distribution of the matching generation chart. This process can be achieved through sampling methods. For example, the value of each chart element can be randomly sampled according to the probability value of the confidence distribution. For the example of the column height in the above bar chart, according to the confidence distribution, there is a 50% probability of sampling a column with a height of 110 pixels. By sampling each element of the chart multiple times, S different description text matching generation charts can be obtained. These charts may differ in details, but they all match the input text description and data embedding features.
[0126] When obtaining description text matching to generate charts, the computer system can also combine some constraints and optimization strategies. For example, the generated chart can be screened and adjusted according to the target generation style tag to ensure that the generated chart meets specific style requirements. If the target generation style tag stipulates that the color of the chart is blue, then the computer system can adjust the color after generating the chart to make it meet the requirements of the blue series. In addition, post-processing techniques such as smoothing and noise reduction can be used to improve the quality and visual effects of the generated chart.
[0127] In order to evaluate the quality of the generated description text matching the generated graph, the computer system can use some indicators. For example, the similarity between the generated graph and the expected graph can be calculated. The feasible similarity calculation methods include cosine similarity and structural similarity index (SSIM).
[0128] In summary, sub-step S3300 restores and maps the data embedding features through the restoration mapping component of the graph construction network, obtains the confidence distribution of the matching generated graph, and obtains S description text matching generated graphs based on the distribution. This process uses a variety of technical means and optimization strategies to generate high-quality graphs that meet the text description and style requirements. At the same time, the quality of the generated graphs can be monitored and improved through evaluation indicators to meet the needs of different application scenarios.
[0129] An embodiment of the present invention provides a computer system, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements part or all of the steps in the above method when executing the program.
[0130] The embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium may be transient or non-transient.
[0131] Figure 2 A hardware entity diagram of a computer system provided by an embodiment of the present invention is as follows Figure 2 As shown, the hardware entity of the computer system 1000 includes: a processor 1001 and a memory 1002, wherein the memory 1002 stores a computer program that can be run on the processor 1001, and the processor 1001 implements the steps in the method of any of the above embodiments when executing the program.
[0132] The above description is only an implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A statistical analysis chart generation method based on NLP, characterized in that: The method is executed by a chart generation network, wherein the chart generation network includes a chart construction network and a chart construction effect evaluation network. The chart generation network is trained by the following steps: obtaining text-chart binary training data, and obtaining matching identification features corresponding to the text-chart binary training data, wherein the text-chart binary training data corresponds to a matching chart style tag, and the matching identification features are used to indicate the corresponding relationship between each chart data and the text description data in the text-chart binary training data; loading the text-chart binary training data into a style call determination network, and if the determination result output by the style call determination network indicates that the style tag of the statistical description training text needs to be used, obtaining the chart style training tag corresponding to the statistical description training text, and obtaining the matching identification features corresponding to the chart style training tag; the text-chart binary training data and the matching identification features corresponding to the text-chart binary training data are loaded into a style call determination network. , the chart style training mark and the matching identification feature corresponding to the chart style training mark are loaded into the chart construction network, and the chart construction network is used to output A candidate training generation charts corresponding to the text chart binary training data, wherein A≥1, and each candidate training generation chart corresponds to a priori effect indicator information; the A candidate training generation charts are loaded into the chart construction effect evaluation network, and the chart construction effect evaluation network is used to output the confidence distribution of different effect indicators corresponding to each training generation chart, and the training loss function of the chart construction effect evaluation network is determined based on the confidence distribution of the different effect indicators; the training loss is calculated based on the training loss function, the priori effect indicator information corresponding to each candidate training generation chart, and the confidence distribution of the different effect indicators, and the network parameters of the chart construction network are repeatedly iterated based on the training loss until the chart construction network converges.
2. The method according to claim 1, characterized in that If the determination result outputted by the style call determining network indicates that the style tag of the statistical description training text needs to be used, then the chart style training tag corresponding to the statistical description training text is obtained, including: if the determination result outputted by the style call determining network indicates that the style tag of the statistical description training text needs to be used, then B candidate generated style tags corresponding to the statistical description training text are obtained, where B≥1; the text-chart binary training data and the matching identification features corresponding to the text-chart binary training data are loaded into the style tag determination network, and the style tag determination network is used to output the training data features corresponding to the text-chart binary training data; the B candidate generated style tags are loaded into the style tag determination network, and the style tag determination network is used to output the style tag features corresponding to each of the candidate generated style tags; the similarity between the training data features and each of the style tag features is obtained respectively, and based on the similarity, the chart style tags are obtained from the B candidate generated style tags. grid training mark; wherein the style mark determination network is debugged by the following steps: among the B candidate generated style marks, the generated style mark corresponding to the chart style mark is selected as the positive style mark, wherein the positive style mark corresponds to the positive style mark label; among the B candidate generated style marks, a negative style mark is established according to the remaining generated style marks except the positive style mark, wherein the negative style mark corresponds to the negative style mark label; the positive style mark and the negative style mark are loaded into the style mark determination network, and the style mark determination network is used to output the positive style mark feature corresponding to each positive style mark and the negative style mark feature corresponding to each negative style mark; according to the training data feature, the positive style mark feature, the positive style mark label, the negative style mark feature and the negative style mark label, the similarity error is calculated, and the network parameter of the style mark determination network is iterated according to the similarity error.
3. The method according to claim 2, characterized in that The B candidate generated style tags include one or more candidate morphological style tags or candidate color style tags; The step of selecting the generated style tag corresponding to the chart style tag as the positive style tag from among the B candidate generated style tags includes: selecting the candidate morphological style tag or the candidate color style tag corresponding to the chart style tag as the positive style tag from among one or more candidate morphological style tags or candidate color style tags; obtaining the style type feature corresponding to the positive style tag, wherein the style type feature represents the style tag type of the positive style tag; the step of establishing a negative style tag based on the remaining generated style tags except the positive style tag from among the B candidate generated style tags includes: arbitrarily extracting the remaining tags except the positive style tag from among one or more candidate morphological style tags or candidate color style tags to obtain the negative style tag. Style marker; obtaining a style category feature corresponding to the negative style marker, wherein the style category feature represents the style marker category of the negative style marker; the loading of the positive style marker and the negative style marker into the style marker determination network, and using the style marker determination network to output a positive style marker feature corresponding to each positive style marker and a negative style marker feature corresponding to each negative style marker, comprises: loading the positive style marker, the style category feature corresponding to the positive style marker, the negative style marker, and the style category feature corresponding to the negative style marker into the style marker determination network, and using the style marker determination network to output a positive style marker feature corresponding to each positive style marker and a negative style marker feature corresponding to each negative style marker.
4. The method according to claim 1, characterized in that The style call determination network is debugged based on the following steps: loading each of the text-chart binary training data into the style call determination network, using the style call determination network to output the style tag determination confidence corresponding to each of the text-chart binary training data; determining the style tag error based on the style tag determination confidence corresponding to each training data feature and the chart style tag, and iterating the parameter variables of the style call determination network based on the style tag error.
5. The method according to claim 1, characterized in that After obtaining the text-graph binary training data and the matching identification features corresponding to the text-graph binary training data, the method further includes: pre-debugging an initialized graph construction network based on the text-graph binary training data and the matching identification features corresponding to the text-graph binary training data to obtain the graph construction network.
6. The method according to claim 5, characterized in that The method of pre-debugging the initialized graph construction network based on the text-graph binary training data and the matching identification features corresponding to the text-graph binary training data to obtain the graph construction network includes: dividing each of the text-graph binary training data into a plurality of data units, wherein one or more data units are derived from the statistical description training text, and one or more data units are derived from the training generated graph; loading the plurality of data units and the matching identification features corresponding to the text-graph binary training data into the initialized graph construction network, using the embedding mapping component of the initialized graph construction network to respectively embed and map the matching relationships corresponding to the plurality of data units and the text-graph binary training data to obtain the training embedding features corresponding to the text-graph binary training data; using the restoration mapping component of the initialized graph construction network to restore and map the training embedding features to obtain the confidence distribution of the training generated graph; determining the generation error based on the confidence distribution of the training generated graph, and iterating the network parameters of the initialized graph construction network based on the generation error to obtain the graph construction network.
7. The method according to claim 1, characterized in that The method of determining the training loss function of the graph construction effect evaluation network based on the confidence distribution of the different effect indicators includes: obtaining the confidence superposition value of the maximum effect indicator based on the confidence distribution of the different effect indicators, and using the confidence superposition value of the maximum effect indicator as the training loss function of the graph construction effect evaluation network.
8. The method according to claim 1, characterized in that The method further includes: obtaining matching identification features corresponding to the text-chart binary data to be processed, and loading the text-chart binary data to be processed into a style call determination network, using the style call determination network to output the style tag determination confidence corresponding to the text-chart binary data to be processed, wherein the text-chart binary data to be processed is composed of chart data and text description data; if the style tag determination confidence is not less than a preset determination value, obtaining the target generation style tag corresponding to the chart data, and obtaining the matching identification features corresponding to the target generation style tag; loading the text-chart binary data to be processed and the matching identification features corresponding to the text-chart binary data to be processed into a style call determination network, and outputting the style tag determination confidence corresponding to the text-chart binary data to be processed; The features, the target generation style mark and the matching identification features corresponding to the target generation style mark are loaded into the graph construction network, and the graph construction network is used to output S description text matching generation graphs corresponding to the to-be-processed text graph binary data, wherein S≥1; the S description text matching generation graphs are loaded into the graph construction effect evaluation network, and the graph construction effect evaluation network is used to output the confidence distribution of different effect indicators corresponding to each of the description text matching generation graphs; based on the confidence distribution of different effect indicators corresponding to each of the description text matching generation graphs, the description text matching generation graph corresponding to the maximum confidence in the maximum effect indicator is used as the matching generation graph.
9. The method according to claim 8, characterized in that After the text chart binary data to be processed is loaded into the style call determination network, and the style call determination network is used to output the style tag determination confidence corresponding to the text chart binary data to be processed, the method further includes: if the style tag determination confidence is less than the preset determination value, obtaining the matching identification feature corresponding to the text chart binary data; loading the text chart binary data and the matching identification feature corresponding to the text chart binary data into the chart construction network, and using the chart construction network to output S description text matching generation charts corresponding to the text chart binary data, where S≥1; loading the S description text matching generation charts into the chart construction effect evaluation network, and using the chart construction effect evaluation network to output the confidence distribution of different effect indicators corresponding to each description text matching generation chart; based on the confidence distribution of different effect indicators corresponding to each description text matching generation chart, the description text matching generation chart corresponding to the maximum confidence in the maximum effect indicator is used as the matching generation chart; the text chart binary data, the matching identification feature corresponding to ... The matching identification features corresponding to the text-graph binary data, the target generation style tag and the matching identification features corresponding to the target generation style tag are loaded into the graph construction network, and the graph construction network is used to output S description text matching generation graphs corresponding to the text-graph binary data, including: dividing each of the text-graph binary data into multiple data units, wherein one or more data units are derived from the graph data, and one or more data units are derived from the text description data; loading multiple data units and the matching identification features corresponding to the text-graph binary data into the graph construction network, and using the embedding mapping component of the graph construction network to embed and map the matching relationships corresponding to the multiple data units and the text-graph binary data, respectively, to obtain the data embedding features corresponding to the text-graph binary data; using the restoration mapping component of the graph construction network to restore and map the data embedding features, to obtain the confidence distribution of the matching generation graph, and based on the confidence distribution of the matching generation graph, obtaining S description text matching generation graphs.
10. A computer system comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the steps in the method according to any one of claims 1 to 9 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Chart generation method
CN117520533A
Chart generation method and device, equipment and storage medium
CN117574868A
Method and system for automatically generating legend for visual chart
CN117788632A
Chart generation method and device, storage medium and electronic equipment
CN119152072A
Chart page generation method, system and equipment and computer readable storage medium
CN119227653A