NLP-based Statistical Analysis Chart Generation Method, System, and Storage Medium
Through the chart construction and effect evaluation module of the chart generation network, the semantic understanding and style control problems of chart generation in the existing technology are solved, and high-quality and stable statistical analysis chart generation is achieved.
Patent Information
- Application Number
- CN202510222239.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-02-27
AI Technical Summary
When generating statistical analysis charts, the prior art has inaccurate semantic understanding, insufficient control of chart style and effect, and lack of effective evaluation and optimization mechanisms, resulting in unstable chart quality.
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 optimizes the graph generation through the effect evaluation network to ensure the semantic accuracy, style matching and visual effects of the graph.
It improves the accuracy of semantic understanding and style matching of chart generation, ensures the stability and controllability of chart quality, and meets the needs of different application scenarios.
Smart Images

Figure CN119722852B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly to a method, a system and a storage medium for generating statistical analysis charts based on NLP. Background Art
[0002] In the current era of information explosion, data is growing exponentially, and the need for effective data analysis and visualization in various industries is becoming increasingly urgent. As an intuitive and efficient data visualization tool, statistical analysis charts play a significant role in many fields such as finance, healthcare, education, and scientific research. The development of natural language processing (NLP) technology has brought new ways for generating statistical analysis charts. Traditional generation of statistical analysis charts 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, and the efficiency is low. It is easy to make mistakes when dealing with a large amount of data and frequent updates. The rule-based chart generation method selects chart types and styles according to predefined rules and templates, and automatically generates charts based on input data and text descriptions. However, the rules are fixed, making it difficult to adapt to complex and changing text and data characteristics, and it has insufficient processing capabilities for text with ambiguous semantics or special meanings. Although early attempts at NLP-based chart generation combined NLP with chart generation, and extracted key information and data through semantic analysis to generate charts, the accuracy and processing capabilities of NLP technology were limited. It did not deeply understand complex text structures and semantics, was prone to information extraction errors or omissions, and the chart generation lacked effective control over styles and effects, resulting in poor visual effects. The 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 styles and effects, ignoring color matching, line styles, and layout coordination, and being unable to flexibly respond to the needs of different application scenarios; lack of effective evaluation and optimization mechanisms, unable to timely 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 a statistical analysis chart based on NLP, and the technical solution is implemented as follows: It is executed by a chart generation network, and 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. Among them, the text-chart binary training data is correspondingly matched with a chart style label, and the matching identification features are used to indicate the corresponding relationship between each chart data and text description data in the text-chart binary training data; loading the text-chart binary training data into a style call determination network. If the determination result output by the style call determination network indicates that the style label of the statistical description training text needs to be used, then obtain the chart style training label corresponding to the statistical description training text, and obtain the matching identification features corresponding to the chart style training label. Among them, the matching identification features corresponding to the chart style training label are used to identify the statistical description training text, and the style call determination network is obtained by debugging according to the chart style label; loading the text-chart binary training data, the matching identification features corresponding to the text-chart binary training data, the chart style training label, and the matching identification features corresponding to the chart style training label into the chart construction network, and using the chart construction network to output A candidate training generated charts corresponding to the text-chart binary training data, where A≥1, and each candidate training generated chart corresponds to a prior effect index information; loading the A candidate training generated charts into the chart construction effect evaluation network, and using the chart construction effect evaluation network to output the confidence distribution of different effect indexes corresponding to each training generated chart, and determining the training loss function of the chart construction effect evaluation network according to the confidence distribution of the different effect indexes; calculating the training loss according to the training loss function, the prior effect index information corresponding to each candidate training generated chart, and the confidence distribution of the different effect indexes, and repeatedly iterating the network parameters of the chart construction network according to the training loss until the chart construction network converges.
[0004] On the other hand, the present invention also provides a computer system, including a memory and a processor. The memory stores a computer program that can run on the processor, and when the processor executes the program, it implements the steps in the above method.
[0005] On another aspect, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps in the above method.
[0006] The present invention uses the method of obtaining text-chart binary training data and matching identification features that can indicate the data correspondence of each training data unit in the text-chart binary training data. When it is determined by the style call that the determination result of the network output indicates that the style label of the statistical description training text needs to be used, the chart style training label and the matching identification features used to indicate the statistical description training text can be obtained. Then, the text-chart binary training data, the matching identification features corresponding to the text-chart binary training data, the chart style training label, and the matching identification features corresponding to the chart style training label are loaded into the chart construction network, so as to use the chart construction network to output A candidate training-generated charts corresponding to the text-chart binary training data. Furthermore, the A candidate training-generated charts are loaded into the chart construction effect evaluation network, and the confidence distribution of different effect indicators corresponding to each training-generated chart is output by the chart construction effect evaluation network. And based on the confidence distribution of different effect indicators, the training loss function of the chart construction effect evaluation network is determined. Then, the training loss is calculated based on the training loss function, the prior effect indicator information corresponding to each candidate training-generated chart, and the confidence distribution of different effect indicators. And the network parameters of the chart construction network are iteratively updated according to the training loss. By using the embodiment of the present invention, it can be first determined by the style call determination network whether the information in the text-chart binary training data is related to the style label of the statistical description training text. If it is determined that the style label is required, 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, the corresponding chart style training label is added to increase the generation effect of the chart construction network learning the data style of the statistical description training text. Then, by introducing the chart construction effect evaluation network, combined with reinforcement learning, the generation effect of the chart construction effect evaluation network learning the data style of the statistical description training text is enhanced, making its expressiveness stronger.
[0007] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the technical solution of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 It is a schematic diagram of the debugging process of the chart generation network in a statistical analysis chart generation method based on NLP provided by an embodiment of the present invention;
[0009] Figure 2 It is a schematic diagram of the hardware entity of a computer system provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0010] An embodiment of the present invention provides a method for generating a statistical analysis chart based on NLP, which can be executed by a processor of a computer system. Among them, the computer system may refer to devices with data processing capabilities such as servers, laptop computers, tablet computers, desktop computers, etc. The method for generating a statistical analysis chart 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: Obtain text-chart binary training data, and obtain the matching identification features corresponding to the text-chart binary training data. Among them, the text-chart binary training data is correspondingly matched with a chart style mark, 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.
[0011] The text-chart binary training data is a set composed of a large amount of text information and charts corresponding to these text information one by one. In actual application scenarios, this kind of data exists widely. 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", and the corresponding chart may be a bar chart, with the abscissa being different quarters and the ordinate being the operating income and net profit, and the height of the bars intuitively shows the revenue and profit data of each quarter. 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 this disease is 5%; in the age group of 30-40 years old, the incidence is 8%", and the corresponding chart may be a line chart, with the abscissa being the age group and the ordinate being the incidence, and the data points of the incidence of each age group are connected by a line. In the education field, the text information may be the average score 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", and the corresponding chart may be a pie chart, each sector represents a class, and the size of the sector is related to the proportion of the average score of the class in the total average score.
[0012] In order to obtain this text-chart binary training data, the computer system can collect it from multiple channels. For public data resources, the computer system can use web crawler technology to crawl relevant data from professional data websites, government statistical department websites, academic databases and other platforms. For example, by writing a crawler program, setting the website URL to be accessed, data screening rules, etc., the program can automatically locate and extract the required text information and chart data in the web page. For the data within the enterprise, the computer system can directly read the relevant data from the enterprise's database. During the reading process, it is necessary to ensure the accuracy and integrity of the data, and through data cleaning and preprocessing steps, duplicate data can be removed, incorrect data can be corrected, etc.
[0013] Next, the role of the matching identification feature is to clarify the corresponding relationship between each chart data and 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 the combination of a company code and a quarter number. For the financial report data of a certain company, the company code is "ABC123" and the quarter number is "Q3-2024", and this combination can be used as the matching identification feature to associate the text description of the company's financial condition in the third quarter with the corresponding bar chart. In the medical field, the matching identification feature can be the combination of a disease code and an age range, such as "Disease-001, 20-30 years old", to determine the corresponding relationship between the incidence statistics text and the corresponding line chart. In the education field, the matching identification feature can be the combination of a class number and an exam name, such as "Class-01, Final-Exam-2024", to link the class average score text with the corresponding pie chart.
[0014] There are various ways for a computer system to obtain the matching identification feature. If the data already has corresponding relationship marks during the collection process, the computer system can directly extract these marks as the matching identification feature. For example, on some professional data platforms, data providers will add associated tags to each text and chart, and the computer system can obtain the matching identification feature by parsing these tags. If the data itself does not have clear corresponding relationship marks, 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, extract key information, and at the same time perform image recognition and feature extraction on the chart, and then establish the corresponding relationship between them by comparing the features of the text and the chart, and generate the corresponding matching identification feature.
[0015] In addition, the text-chart binary training data corresponds to a chart style mark. The chart style mark is used to describe the specific style attributes of the chart, such as color, shape, line style, etc. In the above example of the bar chart in the financial field, the chart style mark can be "blue bars, white background, black line border", and such a mark can help the computer system identify and distinguish charts of different styles. In the line chart in the medical field, the chart style mark can be "red line, gray grid background". In the pie chart in the education field, the chart style mark can be "colored sectors, no background grid".
[0016] The way for a computer system to obtain chart style tags can be a combination of manual annotation and automatic recognition. For some cases with a small amount of data, professional personnel can perform style tagging on each chart. In the case of a large amount of data, the computer system can automatically identify the style features of the chart using image recognition and machine learning algorithms and generate corresponding tags. For example, a convolutional neural network (CNN) can be used to train the chart images, enabling the model to learn the feature patterns of different styles, and then classify and tag the styles of new charts.
[0017] Step S200: Load the text-chart binary tuple 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, 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, where 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.
[0018] The style call determination network plays a key decision-making role in the whole process and can judge whether the style tag of the statistical description training text needs to be used. This network is trained through debugging, and its debugging process is based on the chart style tag. Specifically, the computer system loads each text-chart binary tuple training data into the style call determination network, and this network outputs the style tag determination confidence corresponding to each text-chart binary tuple training data. Then, based on 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 parameters of the style call determination network are iterated based on this error until the network reaches a stable and accurate judgment effect. In practical applications, taking the financial field as an example, assume that the text-chart binary tuple training data includes the text description of the financial data of a certain company in different quarters and the corresponding bar chart. The style call determination network will analyze these data, such as analyzing the description style of the data growth trend in the text and the matching style of colors and shapes in the chart. 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.
[0019] The chart style training tags corresponding to the statistical description training text are 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, it may detail the changing trend of the incidence rate of a certain disease in different age groups. The corresponding chart style training tags may include that the line color of the line chart is blue, the line style is dashed, and the background color is light gray, etc. These tags can help the computer system accurately grasp the style characteristics of the statistical description training text and apply them to subsequent chart generation.
[0020] The matching identification features corresponding to the chart style training tags are used to identify the statistical description training text. Its role is to ensure the accurate correspondence between the chart style training tags and the statistical description training text. In the field of education, the statistical description training text may be a detailed description of the grade distribution of different classes in a certain exam. The corresponding chart style training tags may be that the colors of the bars in the bar chart are color-graduated and the font of the chart title is bold, etc. And the matching identification features can be a combination of the exam name and class number, such as "Final-Exam-2024, Class-01". Through this identification feature, the computer system can accurately associate the chart style training tags with the corresponding statistical description training text.
[0021] When the computer system executes step S200, it loads the previously obtained text-chart binary tuple training data into the style call determination network. This 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 comprehensively analyze the semantic information of the text, the visual features of the chart, etc., and calculate the confidence level of the style tag determination. For example, the following formula can be used to calculate the confidence level: , where w i is the weight of each feature, f i is the score of each feature, and n is the number of features.
[0022] If the determination result output by the style call determination network indicates that the style tags of the statistical description training text need 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 by extracting and analyzing the features of the statistical description training text and combining with the existing style tag library for matching and screening. For the matching identification features corresponding to the chart style training tags, the computer system can, according to the corresponding relationship established in step S100 before, search for the corresponding identifiers from the matching identification feature database.
[0023] After obtaining the chart style training labels and matching identification features, the computer system will verify and integrate this data to ensure its 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 labels conform to 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 the smooth progress of subsequent steps.
[0024] Step S300: Load the text-chart binary tuple training data, the matching identification features corresponding to the text-chart binary tuple training data, the chart style training labels, and the matching identification features corresponding to the chart style training labels into the chart construction network, and use the chart construction network to output A candidate training generated charts corresponding to the text-chart binary tuple training data, where A ≥ 1, and each candidate training generated chart corresponds to a prior effect index information.
[0025] The chart construction network is responsible for generating candidate training generated charts based on the input data. The text-chart binary tuple training data contains a large amount of text information and the corresponding chart data, which provide rich learning materials for the chart construction network. The matching identification features clarify the corresponding relationship between the text and the chart, enabling the chart construction network to accurately understand what kind of chart form should be presented for the content described in the text. The chart style training labels and their corresponding matching identification features endow the generated charts with specific style attributes, making the generated charts conform to the style requirements of the statistical description training text.
[0026] In an actual application scenario, taking the business field as an example, the text-chart binary tuple training data may include the text description of the sales data of an e-commerce company in different time periods and the corresponding sales trend charts. The matching identification features can be the time range and product category, such as "January - March 2024, electronic products", which associates the sales data text with the corresponding sales trend chart. The chart style training labels may stipulate that the color of the chart is blue-based, the lines are solid lines, etc., and the matching identification features ensure that these style labels correspond to specific sales data text and charts.
[0027] After the computer system loads this data into the chart construction network, the chart construction network will process it using its internal algorithms and models. The chart construction network can usually adopt 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 generated charts based on the input data, and the discriminator is responsible for judging whether the generated charts are real and reasonable. Through continuous adversarial training, the generator can generate more and more realistic charts.
[0028] During the process of generating candidate training generated charts, the chart construction network will perform multi-dimensional analysis and processing on the input data. For text information, natural language processing techniques will be used for semantic understanding to extract key information such as the type of data, trends, comparison relationships, etc. For chart style training markers, they will be converted into parameters for chart generation, such as color coding, line styles, graphic shapes, etc. By comprehensively considering these factors, the chart construction network generates A candidate training generated charts.
[0029] Each candidate training generated chart corresponds to a prior effect metric information, which is used to describe the expected performance of the chart in certain aspects. The prior effect metric information can include the clarity of the chart, the accuracy of information conveyance, the matching degree with style markers, etc. For example, in a pie chart about market share, the prior effect metric information may include whether the proportions of each sector accurately reflect the market share, whether the color combination is clear and easy to read, and whether it meets the preset style requirements. The computer system can measure these effects through some quantitative metrics. For example, the mean squared error (MSE) is used to measure the accuracy of the data in the chart, and the formula is , where is the true value, is the predicted value, and n is the number of data points.
[0030] When generating candidate training generated charts, the computer system can adopt a method that combines random sampling and optimization search. First, the chart construction network will randomly generate a batch of candidate charts according to the input data and internal parameters. Then, these candidate charts will be evaluated and screened based on the prior effect metric information, and the charts with better effects will be retained. Next, further optimization will be performed on these retained charts by adjusting the parameters of the network to make the generated charts perform better in each effect metric. This process can be iterated multiple times until a certain stopping condition is met, such as reaching the preset number of iterations or the generated charts reaching a certain threshold in the effect metric.
[0031] During the generation process, the computer system also needs to consider the diversity and robustness of the data. To generate candidate training generated 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, to improve the robustness of the generated charts, the computer system can perform enhancement processing on the input data, such as synonym replacement for text information and minor adjustments to chart style markers, so that the chart construction network can generate high-quality charts under different data conditions.
[0032] Step S400: Load A candidate training generated charts into the chart construction effect evaluation network, and use the chart construction effect evaluation network to output the confidence distribution of different effect metrics corresponding to each training generated chart, and determine the training loss function of the chart construction effect evaluation network based on the confidence distribution of different effect metrics.
[0033] The main task of the chart construction effect evaluation network is to evaluate the quality of the candidate training generated charts generated by the chart construction network. After the computer system inputs A candidate training generated charts into the chart construction effect evaluation network, the network will analyze and judge each chart from multiple dimensions to output the confidence distribution of different effect metrics.
[0034] Different effect metrics are used to measure the performance of candidate training generated charts in various aspects. For example, in terms of information accuracy, the effect metric can be the error rate of the data in the chart, that is, the deviation degree between the data shown in the chart and the actual data; in terms of visual clarity, the effect metrics can be the contrast of the chart, the rationality of color matching, etc.; in terms of style matching degree, the effect metric can be the degree of conformity between the style of the chart and the pre-set chart style training mark.
[0035] Taking the financial field as an example, assume that the chart construction network generates A line charts showing the stock price trend of a certain company as candidate training generated charts. The chart construction effect evaluation network will evaluate these line charts. For the information accuracy metric, the network will compare the price data on the line chart with the price data in the actual stock trading records and calculate the error between the two. If the closing price of a certain stock on a trading day is 100 yuan, and the line chart shows 102 yuan, then the error on that trading day is 2 yuan. For the visual clarity metric, the network will analyze factors such as the line thickness and color contrast of the line chart. If the line is too thin or the color is too close to the background color, it will be difficult to distinguish visually, then the performance of the line chart in terms of visual clarity metric will be poor. For the style matching degree metric, if the pre-set chart style training mark requires the line of the line chart to be blue and the background to be white, and the generated line chart has a red line and a gray background, then the score of the line chart in terms of style matching degree metric will be low.
[0036] The confidence distributions of different effectiveness metrics represent the likelihoods of each effectiveness metric at different values. For example, the confidence distribution of the information accuracy metric might show that the likelihood of the metric having a value with an error rate of 0 - 5% is 80%, the likelihood of an error rate of 5% - 10% is 15%, and the likelihood of an error rate greater than 10% is 5%. The computer system can calculate these confidence distributions through methods of statistical learning and machine learning. For example, a Bayesian network can be used to infer the value probabilities of each effectiveness metric based on historical data and prior knowledge. Suppose historical data shows that in similar chart generation tasks, the error rate of the information accuracy metric usually lies between 0 - 5%. Then, in a new evaluation, the confidence level for this interval will be relatively high.
[0037] The computer system determines the training loss function of the chart construction effect evaluation network based on the confidence distributions of different effectiveness metrics. The training loss function is used to measure the difference between the prediction 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, and its 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 can represent the actual expected value of each effectiveness metric, and p i can represent the probability value in the confidence distribution predicted by the chart construction effect evaluation network.
[0038] To calculate the training loss function, the computer system determines the actual expected value of each effectiveness metric. This can be achieved through manual annotation or by referring to authoritative standards. For example, for the information accuracy metric, the actual expected value can be an error rate of 0, that is, the data shown in the chart is exactly the same as the actual data. Then, the computer system compares the actual expected value of each effectiveness metric with the confidence distribution output by the chart construction effect evaluation network and substitutes it into the training loss function formula to calculate the loss value.
[0039] When calculating the training loss, the computer system can also consider the weights of different effectiveness metrics. Different effectiveness metrics may have different importance in the overall evaluation, so a weight can be assigned to each effectiveness metric. For example, in some scenarios, the information accuracy metric may be more important than the visual clarity metric, so a higher weight can be assigned to the information accuracy metric. Suppose the weight of the information accuracy metric is 0.6, the weight of the visual clarity metric is 0.3, and the weight of the style matching metric is 0.1. Then the total training loss function can be expressed as , where , and They are the training losses of the information accuracy, visual clarity, and style matching degree metrics respectively.
[0040] The computer system continuously adjusts the parameters of the chart construction effect evaluation network so that the value of the training loss function gradually decreases, thereby improving the evaluation accuracy of the network. During training, optimization algorithms such as Stochastic Gradient Descent (SGD) can be used to update the network parameters. The Stochastic Gradient Descent algorithm updates the network parameters in the direction of decreasing the loss function according to the gradient information of the training loss function, and uses a small batch of sample data for each update, which can improve the efficiency and stability of training.
[0041] Step S500: Calculate the training loss based on the training loss function, the prior effect index information corresponding to each candidate training-generated chart, and the confidence distribution of different effect metrics, and repeatedly iterate the network variables of the chart construction network based on the training loss until the chart construction network converges.
[0042] The training loss function has been determined in step S400, which measures the difference between the prediction result of the chart construction effect evaluation network and the actual expected result. The prior effect index information corresponding to each candidate training-generated chart is the expected performance index preset for each generated chart in step S300, and these metrics can include aspects such as information accuracy, visual clarity, and style matching degree. The confidence distribution of different effect metrics is also output by the chart construction effect evaluation network in step S400, which represents the possibility of each effect metric at different values.
[0043] The computer system calculates the training loss based on this information. A feasible calculation method is to combine the Proximal Policy Optimization (PPO) reinforcement learning framework. In the PPO framework, the chart construction network is used as the policy model in reinforcement learning, responsible for generating candidate training-generated charts; the chart construction effect evaluation network is used as the training loss model in reinforcement learning to evaluate the quality of the generated charts. When specifically calculating the training loss, the entropy reward term can be calculated using the calculation method of the prior effect index information corresponding to each candidate training-generated chart and the confidence distribution of different effect metrics based on the standard entropy. The formula for the standard entropy is , where p i is the probability of the effect metric value, and n is the number of values. The role of the entropy reward term is to encourage the chart construction network to explore more different generation strategies and increase the diversity of the generated charts.
[0044] At the same time, calculate the gradient loss based on the training loss function, such as using the Mean Squared Error (MSE) loss. The formula for the MSE loss is , where y iis the actual label value (which can be prior effect index information), is the predicted value (which can be obtained according to the confidence distribution of different effect indexes), and n is the number of samples. The training loss function term is calculated through the MSE loss.
[0045] Then, the total loss, that is, the training loss, is calculated based on the entropy reward term and the training loss function term. It can be expressed by the formula where is the entropy reward term, is the MSE loss term, and are weight coefficients used to balance the influences of the entropy reward term and the MSE loss term.
[0046] Taking the medical field as an example, assume that the chart construction network generates A line charts showing the incidence of a certain disease changing over time as candidate training generated charts. The prior effect index information may stipulate that the data error on the line chart should be controlled within 5%, the line color should meet specific style requirements, and the visual clarity of the chart should reach a certain standard. The confidence distribution of different effect indexes will show the probabilities of each index at different values. For example, the probability that the error rate of the information accuracy index is between 0 - 5% is 70%, the probability that it is between 5% - 10% is 20%, and the probability that it is greater than 10% is 10%. According to 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.
[0047] After obtaining the training loss, the computer system repeatedly iterates the network parameters of the chart construction network based on this loss. The iteration process adopts an optimization algorithm, 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: ; ; ; ; ; where, m t and v t are the first - order moment estimate and the second - order moment estimate of the gradient respectively, and are the decay rates, is the gradient of the training loss with respect to the network parameter , is the learning rate, is a very small constant used to prevent the denominator from being zero.
[0048] 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 significantly decreases within a certain number of iterations, or the change amplitude of 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, it is considered that the graph construction network has converged.
[0049] During the iteration process, the computer system can also adopt an early stopping strategy to avoid overfitting. The early stopping strategy means stopping the training in advance when the performance on the validation set no longer improves. The specific approach is to divide the dataset into a training set, a validation set, and a test set, and regularly evaluate the performance of the graph construction network on the validation set during the training process. If the loss function value on the validation set does not decrease for several consecutive iterations, stop the training and select the network parameters at this time as the final model parameters.
[0050] Step S500 enables the graph construction network to continuously learn and optimize by calculating the training loss and iterating the network parameters of the graph construction network, and finally generates a graph that better conforms to the prior effect index information and style requirements. When the computer system executes this step, it needs to comprehensively apply 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.
[0051] As an implementation, in step S200, if the determination result of the network output determined according to the style call indicates that the style mark for statistically describing the training text needs to be used, then obtain the graph style training mark corresponding to the statistically described training text, including:
[0052] Step S210: If the determination result of the network output determined according to the style call indicates that the style mark for statistically describing the training text needs to be used, then obtain B candidate generated style marks corresponding to the statistically described training text, where B≥1;
[0053] Step S220: Load the text-graph binary tuple training data and the matching identification features corresponding to the text-graph binary tuple training data into the style mark determination network, and use the style mark determination network to output the training data features corresponding to the text-graph binary tuple training data;
[0054] Step S230: Load the B candidate generated style marks into the style mark determination network, and use the style mark determination network to output the style mark features corresponding to each candidate generated style mark;
[0055] Step S240: Obtain the similarity between the training data features and each style mark feature respectively, and based on the similarity, obtain the graph style training mark among the B candidate generated style marks.
[0056] When the computer system determines the output of the network according to the style call and judges that it is necessary to use the style tags of the statistical description training text, it first executes step S210, that is, to obtain B candidate generated style tags corresponding to the statistical description training text, where B≥1. The candidate generated 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 morphologies like bar charts, line charts, pie charts, etc.; they may also include candidate color style tags, such as specific color combinations, color shades, etc. Taking the financial field as an example, for the statistical description training text describing the stock price trend, the candidate generated style tags may include the style of a line chart with a red line, the style of a bar chart with blue bars, etc. The way for the computer system to obtain these candidate generated style tags can be to screen from a pre-established style tag library, which can be formed by manually annotating a large number of chart styles and organizing them, or can be automatically learned and accumulated during previous training processes. The system can select the potentially matching style tags from the library as candidates according to some key features of the statistical description training text, such as data type, described theme, etc.
[0057] Next, in step S220, the computer system loads the text-chart binary tuple training data and the corresponding matching identification features into the style tag determination network, and uses the network to output the training data features corresponding to the text-chart binary tuple training data. The style tag determination network is a trained neural network model, and its role is to extract and analyze the features of the input data. The training data features are an abstract representation of the text-chart binary tuple training data, which contains semantic information, structural information, etc. in the data. For example, for the text-chart binary tuple training data containing sales data text and sales trend charts, the training data features may reflect information such as the growth trend of sales data and the sales proportion of different product categories. 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 more proficient in processing sequential 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 the long-term dependencies in sequential data. After the computer system inputs the text-chart binary tuple training data and the matching identification features into the style tag determination network, the network will perform multi-layer non-linear transformations on the data and finally output the training data features.
[0058] In step S230, the computer system loads B candidate generated style tags into the style tag determination network, and uses the network to output the style tag features corresponding to each candidate generated style tag. The style tag features are a quantitative representation of the candidate generated style tags, which reflect the unique attributes of each style tag. For example, for a candidate generated style tag with a line chart form and red lines, the style tag features may include the slope of the line, the thickness of the line, the RGB values of the red color, etc. The process of the style tag determination network processing the candidate generated style tags is similar to that of processing the text-chart tuple training data. It will also perform feature extraction and transformation on the input style tags through a multi-layer neural network structure to obtain the style tag features corresponding to each candidate generated style tag. These features can help the computer system better understand and compare the differences between different style tags.
[0059] 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 respectively, and based on these similarities, obtain the chart style training tags among the B candidate generated style tags. Similarity is an index to measure the similarity degree between two feature vectors. 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 feature and the style tag feature vector respectively, is the dot product of the vectors, and ||A|| and ||B|| are the norms of vectors A and B respectively. The computer system will calculate the cosine similarity between the training data features and the style tag features corresponding to each candidate generated style tag to obtain B similarity values. Then, based on these similarity values, it will be screened, and the candidate generated style tag with the highest similarity will be selected as the chart style training tag. For example, in the financial field, if for the training text of statistical descriptions of stock price fluctuations, it is calculated that the cosine similarity between the style tag features of the line chart form with red lines and the training data features is the highest, then this style tag will be selected as the chart style training tag.
[0060] Steps S210 - S240 enable the computer system to select the style marker that best matches the statistical description of the training text from multiple candidate styles by obtaining candidate generated style markers, extracting training data features and style marker features, and calculating the similarity between them. This provides more accurate style guidance for the subsequent chart construction network and helps generate statistical analysis charts that better meet user needs and data characteristics. In addition, the computer system also needs to preprocess and postprocess the data during the whole process. Before inputting the text - chart binary training data and candidate generated style markers into the style marker determination network, the data needs to be normalized so that different data features have the same scale, avoiding some features having too much impact on network training due to overly large numerical ranges. After obtaining the similarity values, the results can also be smoothed, for example, using methods such as Gaussian smoothing, to reduce the impact of noise and outliers on the final selection. During the training process of the style marker determination network, some optimization strategies can also be adopted to improve the performance of the network. For example, using the Batch Normalization technique can accelerate the convergence speed of the network and reduce problems such as gradient vanishing and gradient explosion. At the same time, regularization methods such as L1 and L2 regularization can be adopted to prevent network overfitting and improve the generalization ability of the model. For the application of the 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 this threshold, it indicates that there may be no suitable style marker. 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.
[0061] In summary, steps S210 - S240 are important steps for the computer system to determine the chart style training markers in the NLP - based statistical analysis chart generation method. Through a series of data processing, feature extraction, similarity calculation and other operations, combined with various technical means and optimization strategies, the computer system can select the style marker that best suits the statistical description of the training text from multiple candidate generated style markers, laying a foundation for generating high - quality statistical analysis charts. At the same time, through continuous optimization and improvement, as well as the introduction of user feedback mechanisms, the accuracy and efficiency of the whole process can be further improved to meet the diverse needs of different fields and users.
[0062] As an implementation, the style marker determination network is debugged as follows:
[0063] Step S11: Among the B candidate generated style markers, select the generated style marker corresponding to the chart style marker as the positive style marker, where the positive style marker is correspondingly matched with a positive style marker label;
[0064] Step S12: Among the B candidate generated style tags, establish negative style tags based on the remaining generated style tags except the positive style tags, where the negative style tags are correspondingly matched with negative style tag labels;
[0065] Step S13: Load the positive style tags and negative style tags into the style tag determination network, and use the style tag determination network to output the positive style tag features corresponding to each positive style tag and the negative style tag features corresponding to each negative style tag;
[0066] Step S14: Calculate the similarity error based on the training data features, positive style tag features, positive style tag labels, negative style tag features, and negative style tag labels, and iterate the network parameters of the style tag determination network according to the similarity error.
[0067] Step S11 requires the computer system to select the generated style tag corresponding to the chart style tag as the positive style tag among the B candidate generated style tags, where the positive style tag is correspondingly matched with the positive style tag label. The candidate generated style tags are a series of style options that may be applicable to statistically describe the training text, and the chart style tag is the style determined to be the most matched with the current statistically described training text after screening. The positive style tag is the style selected from the candidate generated style tags and consistent with the chart style tag, which represents the correct style pattern that the network is expected to learn and recognize. The positive style tag label is an identification of this style tag, used to clarify its category during the training process. For example, in the financial field, for the statistically described training text describing the stock price trend, the chart style tag may be "line chart, red line, gray background", then among the candidate generated style tags, the style tag that meets this description will be selected as the positive style tag, and its corresponding positive style tag label can be "stock trend - line red line - gray background". The computer system can select the positive style tag through manual annotation or rule-based screening methods, that is, according to the pre-set style matching rules, find the tag that is exactly the same or closest to the chart style tag from the candidate generated style tags.
[0068] In step S12, the computer system establishes negative style markers among the B candidate generated style markers based on the remaining generated style markers except for the positive style markers, where the negative style markers are correspondingly matched with negative style marker labels. The negative style marker is a concept opposite to the positive style marker, and it 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 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 bars, white background" and "pie chart, green sectors, yellow background" will be combined or individually used as negative style markers, and their corresponding negative style marker labels can be "non-stock trend - non-line red line - non-gray background". The computer system can establish negative style markers by using a random combination or a combination based on specific rules to ensure that the network can learn the differences between different styles.
[0069] Next, step S13 requires the computer system to load the positive style markers and negative style markers into the style marker determination network, and use this 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, and its role is to extract and transform the features of the input style markers. The positive style marker features and 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 chart, red line, gray background", the positive style marker features may include the slope of the line, the RGB values of the red line, and the brightness of the gray background; for the negative style marker "bar chart, blue bars, white background", the negative style marker features may include the height of the bars, the RGB values of the blue bars, and the contrast of the white background. After the computer system inputs the positive style markers and negative style markers into the style marker determination network, the network will process the input through a series of neural network structures such as convolutional layers and fully connected layers, and finally output the corresponding feature vectors.
[0070] After obtaining the positive style marker features, negative style marker features, and the training data features obtained previously, step S14 requires the computer system to calculate the similarity error based on these features and the corresponding labels, and iterate the network parameters of the style marker determination network according to this similarity error. The similarity error is used to measure the difference in the matching degree between the training data features and the positive style marker features and negative style marker features. Feasible similarity calculation methods include cosine similarity and Euclidean distance, etc. Then, calculate the similarity error according to these similarity values. A feasible error calculation method is to use a contrastive loss function, and its formula is: ; where N is the number of samples, y is the label (y is 1 for positive style markers and y is 0 for negative style markers), d is the Euclidean distance between the training data features and the style marker features, and margin is a preset boundary value. Based on the calculated similarity error, the computer system will adopt optimization algorithms such as Stochastic Gradient Descent (SGD) or its variants Adagrad, Adadelta, Adam, etc. to iteratively determine the network parameters of the style marker determination network.
[0071] In summary, steps S11 - S14 are important processes for the computer system to debug the style marker determination network. By selecting positive style markers, establishing negative style markers, extracting corresponding features, calculating similarity errors, and iteratively determining network parameters, and combining various technical means and optimization strategies, the computer system can enable the style marker determination network to learn the differences between different style markers, so as to accurately select appropriate chart style markers for statistical description training texts. At the same time, through continuous optimization and improvement, as well as introducing 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.
[0072] As an implementation, the B candidate generated style markers include one or more candidate morphological style markers or candidate color style markers; in step S11, among the B candidate generated style markers, selecting the generated style marker corresponding to the chart style marker as the positive style marker includes:
[0073] Step S111: Among one or more candidate morphological style markers or candidate color style markers, selecting the candidate morphological style marker or candidate color style marker corresponding to the chart style marker as the positive style marker;
[0074] Step S112: Obtaining the style type feature corresponding to the positive style marker, where the style type feature characterizes the style marker type of the positive style marker.
[0075] In step S12, among the B candidate generated style markers, establishing negative style markers based on the remaining generated style markers except the positive style marker includes:
[0076] Step S121: Among one or more candidate morphological style markers or candidate color style markers, randomly extracting the remaining markers except the positive style marker to obtain negative style markers;
[0077] Step S122: Obtaining the style type feature corresponding to the negative style marker, where the style type feature characterizes the style marker type of the negative style marker.
[0078] Step S13: Load the positive style markers and negative style markers into the style marker determination network, and use 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, including: Step S131: Load the positive style markers, the style type features corresponding to the positive style markers, the negative style markers, and the style type features corresponding to the negative style markers into the style marker determination network, and use 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.
[0079] Sub-step S111 requires the computer system to select, from one or more candidate morphological style markers or candidate color style markers, the candidate morphological style marker or candidate color style marker corresponding to the chart style marker as the positive style marker. The candidate morphological style markers cover various different chart morphologies, such as bar charts, line charts, pie charts, etc.; the candidate color style markers include style elements such as different color combinations and color shades. The chart style marker 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 fluctuations of a company's stock price over a period of time, the chart style marker may be "line chart, red line, gray background". Among the candidate morphological style markers, the marker "line chart" matches the morphological part of the chart style marker; among the candidate color style markers, the combination of "red line, gray background" also meets the requirements. The computer system will select these matching markers as the positive style markers. To implement this selection process, the computer system can adopt a rule-based matching method, that is, preset the matching rules between the chart style marker and the candidate style markers in advance, and then check all candidate style markers one by one to find the markers that meet the rules. It can also use a machine learning model, such as a support vector machine (SVM), to convert the chart style marker and the candidate style markers into feature vectors, and classify them through SVM to determine the positive style markers.
[0080] Sub-step S112 requires the computer system to obtain the style type features corresponding to the positive style markers, where the style type features characterize the style marker types of the positive style markers. The style type features are an abstract description of the positive style markers, which can help the computer system better understand and distinguish different types of styles. For the above example in the financial field, the style type features corresponding to the positive style marker "line chart, red line, gray background" may include "chart form - line chart", "line color - red", "background color - gray", etc. The computer system can obtain these style type features by parsing and feature extraction of the positive style markers. For example, regular expressions can be used to match the text description of the positive style markers to extract key style element information. Additionally, a style feature dictionary can also be constructed to associate feasible style elements with corresponding feature categories, and the style type features can be obtained by querying the dictionary.
[0081] Sub-step S121 requires the computer system to randomly select from one or more candidate form style markers or candidate color style markers the remaining markers other than the positive style markers to obtain negative style markers. The negative style markers 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 marker is "line chart, red line, gray background", then "bar chart", "pie chart" in the candidate form style markers, and "blue line, yellow background" in the candidate color style markers, etc., after excluding the positive style markers, can all be the objects of selection. The computer system can adopt a random selection method to randomly select a certain number of markers from the remaining markers as negative style markers; it can also be selected according to some preset rules, for example, preferentially selecting markers with a large difference from the positive style markers.
[0082] Sub-step S122 requires the computer system to obtain the style type features corresponding to the negative style markers, where the style type features characterize the style marker types of the negative style markers. Similar to obtaining the style type features of the positive style markers, the computer system needs to analyze and process the negative style markers to extract key style element information. For the negative style marker "bar chart, blue line, yellow background", its style type features may include "chart form - bar chart", "line color - blue", "background color - yellow", etc. The computer system can use the same methods as obtaining the style type features of the positive style markers, such as regular expression matching or querying the style feature dictionary, to obtain the style type features of the negative style markers.
[0083] Sub-step S131 requires the computer system to load the positive style markers, the style category features corresponding to the positive style markers, the negative style markers, and the style category features corresponding to the negative style markers into the style marker determination network, and use this 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, whose function is to extract and transform the input style markers and the corresponding style category features. 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. In the example of the financial field, for the positive style marker "line chart, red line, gray background" and its style category features "chart form - 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 form - bar chart", "line color - blue", "background color - yellow", the computer system inputs this information into the style marker determination network. The network will perform multi-layer non-linear transformations on the input, such as extracting local features through convolutional layers and integrating and transforming the local features through fully connected layers, and finally output the positive style marker features and the 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 intensity of the line chart, the feature intensity of the red line, and the feature intensity of the gray background respectively; the negative style marker feature vector may be represented as [0.2, 0.3, 0.1], corresponding to the feature intensity of the bar chart, the blue line, and the yellow background. In actual operation, the computer system needs to consider multiple aspects when executing 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 the style category features, it is necessary to ensure the accuracy and efficiency of the extraction method to avoid missing important style information. When loading the data into the style marker determination network, it is necessary to preprocess the data, 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 explosion. In addition, regularization methods, such as L1 and L2 regularization, can also be used to prevent the network from overfitting and improve the generalization ability of the model.
[0084] In different application scenarios, the execution of these sub-steps may vary. For example, in the medical field, for statistical description training texts that describe the change of disease incidence over time, the chart style markers may focus more on simplicity and accuracy, and the positive style marker may be "line chart, black line, white background". In this case, when the computer system selects positive style markers and establishes negative style markers, it will be adjusted according to the characteristics of the medical field. At the same time, the extraction of style type features will also pay more attention to elements related to medical data display, such as the thickness of the line may represent the importance of the data, etc.
[0085] The computer system can also evaluate the performance of the style marker determination network by introducing a validation set and a test set. During the training process, regularly evaluate the accuracy of the positive style marker features and negative style marker features output by the network on the validation set. If the error on the validation set no longer decreases or starts to increase, it indicates 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, conduct a final evaluation of the trained network on the test set to ensure that the network can also perform well on unseen data.
[0086] As an implementation method, the style call determination network is debugged based on the following steps:
[0087] Step S21: Load each text-chart binary tuple training data into the style call determination network, and use the style call determination network to output the style marker determination confidence corresponding to each text-chart binary tuple training data;
[0088] Step S22: Determine the style marker error based on the style marker determination confidence corresponding to each training data feature and the chart style marker, and iterate the parameters of the style call determination network based on the style marker error.
[0089] In sub-step S21, the computer system processes text-chart binary tuple 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, whose purpose is to analyze the input text-chart binary tuple training data to output the style marker determination confidence. The style marker determination confidence indicates the likelihood that the network believes that the text-chart binary tuple training data needs to use the statistical description training text style marker. The value range is usually between 0 and 1. The closer to 1, the more it needs to use the style marker, and the closer to 0, the less it needs to use the style marker.
[0090] 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.
[0091] 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.
[0092] 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.
[0093] 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.
[0094] In summary, in sub-steps S21 - S22, the network for determining the style call analyzes the training data of the text-chart binary group, outputs the confidence of the style label determination, then calculates the style label error based on this confidence and the chart style label, and iterates the network's parameters, enabling the network to continuously learn and optimize, so as to accurately determine whether it is necessary to use statistical descriptions to train the style label of the text. When the computer system executes these steps, it needs to comprehensively apply various technical means and optimization strategies to improve the performance and reliability of the network and meet the requirements of different application scenarios.
[0095] As an implementation manner, after step S100, obtaining the training data of the text-chart binary group and obtaining the matching identification features corresponding to the training data of the text-chart binary group, the method further includes: step S110: pre-debugging the initialized chart construction network according to the training data of the text-chart binary group and the matching identification features corresponding to the training data of the text-chart binary group to obtain the chart construction network.
[0096] Sub-step S110 in the derivative implementation manner of step S100 requires the computer system to pre-debug the initialized chart construction network according to the training data of the text-chart binary group and the matching identification features corresponding to this data to obtain the chart construction network. Pre-debugging is also the process of pre-training. This process is to enable the initialized chart construction network to initially learn the features and corresponding relationships of the training data of the text-chart binary group, laying a foundation for subsequent deeper training and chart generation.
[0097] The training data of the text-chart binary group contains a large amount of text information and the corresponding charts, which are important materials for the initialized chart construction network to learn. The matching identification features clarify the corresponding relationship between the text and the chart, enabling the network to accurately understand what form of chart should be presented for the content described in the text. The initialized chart construction network is a neural network model that has not been fully trained. It has a certain structure and parameters, but it cannot well complete the chart generation task. Through pre-debugging, the computer system can adjust the network's parameters to make it better adapt to the input data.
[0098] Taking the business field as an example, assume that the training data of the text-chart binary group contains the text description of the sales data of an e-commerce company in different time periods and the corresponding sales trend charts. The matching identification features can be the time range and product category, such as "January - March 2024, electronic products", which associates the sales data text with the corresponding sales trend chart. The computer system uses these data for the pre-debugging of the initialized chart construction network.
[0099] During the pre - debugging process, the technical means adopted by the computer system are mainly based on deep - learning methods. The initialization chart construction network usually adopts an encoder - decoder architecture. The encoder is responsible for encoding the input data and extracting its feature representation; the decoder then tries to restore the original chart according to the feature representation output by the encoder. By continuously adjusting the parameters of the encoder and decoder, the chart output by the decoder is made as close as possible to the original chart, thus completing the pre - debugging of the network.
[0100] To measure the difference between the chart output by the decoder and the original chart, the computer system uses a loss function, such as the mean - squared error (MSE) loss function, whose formula is , where y i is the pixel value or feature value of the original chart, is the pixel value or feature value of the chart output by the decoder, and n is the number of data points. The computer system adjusts the parameters of the initialization chart construction network according to the value of the loss function.
[0101] When adjusting the parameters, the computer system adopts optimization algorithms, such as stochastic gradient descent (SGD) or its variants Adagrad, Adadelta, Adam, etc. During the pre - debugging process, the computer system also adopts batch training, dividing the text - chart binary - tuple training data into multiple small batches and sequentially inputting them into the initialization chart construction network for training. This can improve the training efficiency and reduce memory usage. At the same time, to prevent the network from overfitting, the computer system can adopt 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, and the formula is ; L2 regularization adds the sum of the squares of the parameters, and the formula is , where is the regularization coefficient, are the parameters 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 chart construction network has completed the pre - debugging. At this time, the obtained network is the chart construction network. This chart construction network has initially learned the features and corresponding relationships of the text - chart binary - tuple training data and can generate relevant charts to a certain extent according to the input text and matching identification features, providing a good foundation for subsequent training and applications.
[0102] As an implementation manner, step S110, pre - debugging the initialization chart construction network according to the text - chart binary - tuple training data and the matching identification features corresponding to the text - chart binary - tuple training data to obtain the chart construction network, includes:
[0103] Step S111: Divide each text-chart binary tuple training data into multiple data units, where one or more data units are derived from statistical description training texts, and one or more data units are derived from training-generated charts;
[0104] Step S112: Load multiple data units and the matching identification features corresponding to the text-chart binary tuple training data into the initialized chart construction network, and use the embedding mapping component of the initialized chart construction network to perform embedding mapping on the matching relationships corresponding to the multiple data units and the text-chart binary tuple training data respectively to obtain the training embedding features corresponding to the text-chart binary tuple training data;
[0105] Step S113: Use the reduction mapping component of the initialized chart construction network to perform reduction mapping on the training embedding features to obtain the confidence distribution of the training-generated charts;
[0106] Step S114: Determine the generation error based on the confidence distribution of the training-generated charts, and iteratively update the network parameters of the initialized chart construction network according to the generation error to obtain the chart construction network.
[0107] Sub-step S111 requires the computer system to divide each text-chart binary tuple training data into multiple data units, where one or more data units are derived from statistical description training texts, and one or more data units are derived from training-generated charts. The text-chart binary tuple training data contains rich information. Dividing it into data units helps the computer system process and analyze this data more meticulously. For example, in the financial field, for the text-chart binary tuple training data describing a company's quarterly financial situation, the text part may contain information such as the company's operating income, net profit, assets and liabilities, etc. 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 the revenue and profit of each quarter, the computer system can divide it according to the elements of the chart, such as the bars, axes, legends of different quarters as a data unit respectively. This division method enables the computer system to more clearly identify and process each information segment in the text and the chart, providing more accurate data input for the subsequent embedding mapping operation.
[0108] Sub-step S112 requires the computer system to load multiple data units and the matching identification features corresponding to the text-chart binary tuple training data into the initialized chart construction network. The embedding mapping component of this network is used to perform embedding mapping on the matching relationships corresponding to the multiple data units and the text-chart binary tuple training data respectively, to obtain the training embedding features corresponding to the text-chart binary tuple training data. The embedding mapping component is usually the encoder part in the initialized chart construction network, and its role is to convert the input data into a low-dimensional vector representation, that is, the training embedding features. For data units, the encoder processes the text data units and chart data units separately. For text data units, the encoder can adopt word embedding technology to convert each word in the text into a vector, and then combine and transform these vectors through neural network layers to obtain the embedding features of the text data units. 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 chart data units, the encoder can use a convolutional neural network (CNN) to extract and transform the image features of the chart, and convert the chart data units into vector representations. For the matching identification features, the encoder also converts them into vector forms to represent the corresponding relationship between the text and the chart. Finally, the encoder integrates the embedding features of all data units and the embedding features of the matching identification features to obtain the training embedding features corresponding to the text-chart binary tuple training data.
[0109] Sub-step S113 requires the computer system to perform reduction mapping on the training embedding features using the reduction mapping component of the initialized chart construction network to obtain the confidence distribution of the training-generated chart. The reduction mapping component is usually the decoder part in the initialized chart construction network, and its role is to try to restore the original training-generated chart based on the training embedding features. The decoder performs a series of transformation and reconstruction operations on the training embedding features, and gradually generates each element of the chart. For example, for a bar chart, the decoder generates information such as the height, color, and position of the bars according to the training embedding features. Since there is a certain degree of uncertainty in the generation process, what the decoder outputs is the confidence distribution of the training-generated chart, rather than a definite chart. The confidence distribution represents the probability of each possible value of the chart element. For example, for the height of a bar, 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, etc.
[0110] Sub-step S114 requires the computer system to determine the generation error based on the confidence distribution of the training-generated chart, and iteratively initialize the network parameters of the chart construction network based on the generation error to obtain the chart construction network. The generation error is used to measure the difference between the confidence distribution of the training-generated chart output by the decoder and the original training-generated chart. A feasible method for calculating the generation error is the cross-entropy loss function, and its 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 corresponding to the value in the confidence distribution of the training-generated chart, 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 chart 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.
[0111] In summary, sub-steps S111 - S114 are the key steps for the computer system to pre-debug the initialized chart construction network. Through the division, embedding mapping, restoration mapping, error calculation, and parameter iteration of the text-chart binary training data, combined with various optimization strategies and evaluation mechanisms, the computer system can enable the initialized chart construction network to learn the corresponding relationship between text and chart, generate accurate training-generated charts, and finally obtain a chart construction network that can play a role in actual applications.
[0112] As an implementation, in step S400, based on the confidence distribution of different effect indicators, determine the training loss function of the chart construction effect evaluation network, including: step S410: Based on the confidence distribution of different effect indicators, obtain the confidence superposition value of the maximum effect indicator, and use the confidence superposition value of the maximum effect indicator as the training loss function of the chart construction effect evaluation network.
[0113] Sub-step S410 in the implementation of step S400 requires the computer system to obtain the confidence superposition value of the maximum effect indicator based on the confidence distribution of different effect indicators, and use the confidence superposition value of the maximum effect indicator as the training loss function of the chart construction effect evaluation network. This step is a key operation for the computer system to further determine the training loss function of the chart construction effect evaluation network after evaluating the candidate training-generated charts, and is crucial for optimizing the network to accurately evaluate the chart construction effect.
[0114] 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 the candidate training generated chart in various aspects, such as information accuracy, visual clarity, style matching degree, etc. The confidence distribution represents the possibility of each effect indicator at different values. Taking the financial field as an example, for a candidate training generated line chart describing the stock price trend of a certain company, the confidence distribution of the information accuracy indicator may show that the possibility of the error rate of this indicator being within 0 - 5% is 80%, the possibility of the error rate being within 5% - 10% is 15%, and the possibility of the error rate being greater than 10% is 5%; the confidence distribution of the visual clarity indicator may show that the possibility of this indicator being clear is 70%, relatively clear is 20%, and unclear is 10%; the confidence distribution of the style matching degree indicator may show that the possibility of this indicator being completely matched is 60%, partially matched is 30%, and unmatched is 10%.
[0115] First, based on the confidence distributions of these different effect indicators, the computer system obtains the confidence superposition value of the maximum effect indicator. The maximum effect indicator refers to the indicator that can best reflect the chart construction quality among all 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 attractiveness may be the maximum effect indicator. The computer system will pre - determine the maximum effect indicator according to the specific application scenario. After determining the maximum effect indicator, the computer system performs superposition calculation on the confidence distribution of this indicator. Suppose information accuracy is the maximum effect indicator, and its confidence distribution is that the probability p1 of the error rate being within 0 - 5% is 0.8, the probability p2 of the error rate being within 5% - 10% is 0.15, and the probability p3 of the error rate being greater than 10% is 0.05. To calculate the confidence superposition value, the computer system can assign different weights according to different error rate intervals. Suppose the weight w1 of the error rate within 0 - 5% is 1, the weight w2 of the error rate within 5% - 10% is 0.5, and the weight w3 of the error rate greater than 10% is 0. Then the confidence superposition value S = p1×w1 + p2×w2 + p3×w3 = 0.8×1 + 0.15×0.5 + 0.05×0 = 0.875.
[0116] The computer system uses the confidence superposition value of the maximum effect index as the training loss function of the chart construction effect evaluation network. The training loss function is used to measure the difference between the prediction result of the chart construction effect evaluation network and the actual expected result. 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 index as the training loss function means that the training goal of the network is to make the confidence superposition value of the maximum effect index as close as possible to the ideal state. For example, for the information accuracy index, the ideal state is that the error rate is 0, that is, the confidence superposition value is 1. 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 chart construction effect evaluation network according to this training loss function.
[0117] As an implementation, the method provided by the embodiments of the present invention may further include:
[0118] Step S1000: Obtain the matching identification features corresponding to the binary tuple data of the text chart to be processed, and load the binary tuple data of the text chart to be processed into the style call determination network, and use the style call determination network to output the style label determination confidence corresponding to the binary tuple data of the text chart to be processed, where the binary tuple data of the text chart to be processed is composed of chart data and text description data;
[0119] Step S2000: If the style label determination confidence is not less than the preset determination value, obtain the target generation style label corresponding to the chart data, and obtain the matching identification features corresponding to the target generation style label;
[0120] Step S3000: Load the binary tuple data of the text chart to be processed, the matching identification features corresponding to the binary tuple data of the text chart to be processed, the target generation style label, and the matching identification features corresponding to the target generation style label into the chart construction network, and use the chart construction network to output S description text matching generated charts corresponding to the binary tuple data of the text chart to be processed, where S≥1;
[0121] Step S4000: Load the S description text matching generated charts into the chart construction effect evaluation network, and use the chart construction effect evaluation network to output the confidence distribution of different effect indicators corresponding to each description text matching generated chart;
[0122] Step S5000: According to the confidence distribution of different effect indicators corresponding to each description text matching generated chart, use the description text matching generated chart with the maximum confidence in the maximum effect indicator as the matching generated chart.
[0123] Step S1000 requires the computer system to obtain the matching identification features corresponding to the text-chart binary tuple data to be processed, and load the text-chart binary tuple data to be processed into the style call determination network, and use this network to output the style label determination confidence corresponding to the text-chart binary tuple data to be processed, where the text-chart binary tuple data to be processed is composed of chart data and text description data. The text-chart binary tuple data to be processed is new data that requires the computer system to analyze and process 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 tuple data to be processed may be the text description of the sales situation of a certain product in different regions and the corresponding sales data chart, and the matching identification features may be the combination of the product name and the region name, such as "smartphone, North China region". The style call determination network is a neural network model that has been debugged and trained. It will analyze the input text-chart binary tuple data to be processed, and comprehensively consider factors such as the semantics of the text and the visual features of the chart, and output a style label determination confidence. This confidence indicates the likelihood that this data needs to use the statistical description to train the text style label, and the value range is usually between 0 and 1. For example, if the text to be processed describes in detail the growth trend of the sales data and the chart also presents a standard style, the style call determination network may output a relatively high confidence, such as 0.8, indicating that it is very likely that a style label needs to be used; on the contrary, if the text description is simple and the chart is casual, the confidence may be low, such as 0.2. To implement 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 weight and bias parameters of the network to enable it to accurately judge the need for style labels.
[0124] Step S2000 stipulates that if the confidence level of the style mark determination is not less than the preset determination value, the computer system will obtain the target generated style mark corresponding to the chart data, and obtain the matching identification features corresponding to the target generated style mark. The preset determination value is a threshold set in advance, which is used to determine whether to use the style mark. When the confidence level of the style mark determination is not less than this threshold, it indicates that the current text-chart binary data to be processed is likely to follow a specific style. The target generated style mark is a specific style setting that matches this data, and it can include features such as the form, color, and line style of the chart. Continuing with the example in the commercial sales field, if the preset determination value is 0.7 and the confidence level output by the style call determination network is 0.8, the computer system will search in the pre-established style mark library for the target generated style mark that matches this data, such as "bar chart, blue bars, white background". The matching identification features corresponding to the target generated style mark are used to ensure the accurate correspondence between the style mark and 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 generated style mark and its matching identification features through rule-based matching or machine learning algorithms.
[0125] 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 generated style mark, and the matching identification features corresponding to the target generated style mark into the chart construction network, and use this network to output S descriptive text-matching generated 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 will generate possible charts based on the input data. The text-chart binary data to be processed provides the basic information of the text and the chart for the network, the matching identification features ensure the correspondence between the data, and the target generated style mark and its matching identification features endow the generated charts with a specific style. In the example in the commercial sales field, the chart construction network will combine information such as the text description of the sales situation of smartphones in the North China region, the sales data chart, and the style mark of "bar chart, blue bars, white background" to generate S different bar charts. These bar charts may vary in terms of the height and proportion of the bars, but all follow the requirements of the target generated style mark. The chart construction network usually adopts an encoder-decoder architecture. The encoder encodes the input data and extracts its feature representation, and the decoder generates the chart based on these feature representations. To generate multiple different charts, the computer system can introduce a certain degree of randomness in the generation process of the decoder, such as randomly initializing some parameters or performing random sampling during the generation process.
[0126] Step S4000 requires the computer system to load the S charts generated by matching descriptive texts into the chart construction effect evaluation network, and use this network to output the confidence distribution of different effect indicators corresponding to each chart generated by matching descriptive texts. 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 degree, etc. The confidence distribution represents the possibility of each effect indicator at different values. For example, for a generated bar chart, the confidence distribution of the information accuracy indicator may show that the possibility of the error rate of this indicator being between 0-5% is 70%, the possibility of the error rate being between 5%-10% is 20%, and the possibility of the error rate being greater than 10% is 10%; the confidence distribution of the visual clarity indicator may show that the possibility of this indicator being clear is 80%, relatively clear is 15%, and unclear is 5%; the confidence distribution of the style matching degree indicator may show that the possibility of this indicator being completely matched is 90%, partially matched is 8%, and unmatched is 2%. The chart construction effect evaluation network can adopt a convolutional neural network (CNN) or other deep learning architectures to extract and analyze the image features of the chart and output the confidence distribution of different effect indicators.
[0127] Step S5000 requires the computer system to use the confidence distribution of different effect indicators corresponding to each chart generated by matching descriptive texts, and take the chart generated by matching the descriptive text corresponding to the maximum confidence in the maximum effect indicator as the generated chart. The maximum effect indicator is the indicator that can best reflect the quality of the chart among all effect indicators, and the maximum effect indicator may be different in different application scenarios. For example, in the field of scientific research, information accuracy may be the maximum effect indicator; in the field of advertising design, visual attractiveness may be the maximum effect indicator. The computer system will pre-determine the maximum effect indicator according to the specific application scenario. Then, in the confidence distribution of different effect indicators corresponding to each chart generated by matching descriptive texts, find the confidence corresponding to the maximum effect indicator, and select the chart generated by matching the descriptive text with the maximum confidence as the final generated chart. In the example in the field of commercial sales, if information accuracy is the maximum effect indicator, the computer system will compare the confidence levels of the S generated bar charts in terms of the information accuracy indicator and select the bar chart with the maximum confidence as the final generated chart. This can ensure that the generated chart performs optimally in the most important aspects.
[0128] In summary, steps S1000 - S5000 provide a complete solution for the computer system to process new text - chart binary data using the trained chart generation network. By comprehensively applying the style - call determination network, the chart construction network, and the chart construction effect evaluation network, and combining various optimization strategies and evaluation mechanisms, the computer system can generate high - quality matching generated charts that meet the requirements according to different application scenarios.
[0129] As an implementation, in step S1000, after loading the text - chart binary data into the style - call determination network and using the style - call determination network to output the confidence degree of the style label corresponding to the text - chart binary data, the method further includes:
[0130] Step S1100: If the confidence degree of the style label determination is less than the preset determination value, obtain the matching identification features corresponding to the text - chart binary data;
[0131] Step S1200: 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 chart construction network to output S description - text - matching generated charts corresponding to the text - chart binary data, where S≥1;
[0132] Step S1300: Load the S description - text - matching generated charts into the chart construction effect evaluation network, and use the chart construction effect evaluation network to output the confidence distribution of different effect indicators corresponding to each description - text - matching generated chart;
[0133] Step S1400: According to the confidence distribution of different effect indicators corresponding to each description - text - matching generated chart, use the description - text - matching generated chart with the maximum confidence degree in the maximum effect indicator as the matching generated chart.
[0134] Sub-step S1100 requires the computer system to obtain the matching identification features corresponding to the text-chart binary data when the confidence level of style mark determination is less than the preset determination value. The confidence level of style mark determination is the result of the possibility judgment by the style call determination network on whether the text-chart binary data needs to use the statistical description to train the text style mark. The preset determination value is a threshold set in advance, which is used to distinguish whether to adopt the style mark. When the confidence level is less than this 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 corresponding relationship 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 the text description of the purchase intention of consumers of a certain brand in different age groups and the corresponding statistical chart. The matching identification features can be a combination of the brand name and the 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.
[0135] 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 this network to output S description texts corresponding to the text-chart binary data to match and generate charts, where S ≥ 1. The chart construction network is a trained neural network model, and its role is to generate possible charts according to the input data. The text-chart binary data provides the basic information required for the network to generate charts, including the data description in the text and the existing chart styles (if any), and the matching identification features help the network accurately understand the corresponding relationship between the text and the chart. In the market research example, the chart construction network will combine the text description of the purchase intention of consumers of Brand A in the 20 - 30 age group, the relevant statistical data, and the matching identification feature "Brand A, 20 - 30 years old" to try to generate S different description texts to match and generate charts. These charts may be in different forms such as bar charts, line charts, or pie charts, which are used to display the purchase intention distribution of consumers in different age groups. The chart construction network usually adopts an encoder-decoder architecture. The encoder encodes the input data to extract its feature representation, and the decoder generates charts according to these feature representations. In order to generate multiple different charts, the computer system can introduce a certain degree of randomness in the generation process of the decoder, such as randomly initializing some parameters or performing random sampling during the generation process.
[0136] Sub-step S1300 requires the computer system to load the S charts generated by matching descriptive texts into the chart construction effect evaluation network, and use this network to output the confidence distribution of different effect indicators corresponding to each chart generated by matching descriptive texts. 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 each effect indicator at different values. For example, for a generated bar chart, the confidence distribution of the information accuracy indicator may show that the possibility of the indicator value with an error rate of 0-5% is 70%, the possibility with an error rate of 5%-10% is 20%, and the possibility with an error rate greater than 10% is 10%; the confidence distribution of the visual clarity indicator may show that the possibility of the indicator value being clear is 80%, relatively clear is 15%, and not clear is 5%; the confidence distribution of the data readability indicator may show that the possibility of the indicator value being easy to understand is 90%, relatively difficult to understand is 8%, and difficult to understand is 2%. The chart construction effect evaluation network can use a convolutional neural network (CNN) or other deep learning architectures to extract and analyze the image features of the chart and output the confidence distribution of different effect indicators.
[0137] Sub-step S1400 requires the computer system to use the confidence distribution of different effect indicators corresponding to each chart generated by matching descriptive texts, and take the chart generated by matching the descriptive text corresponding to the maximum confidence in the maximum effect indicator as the matched generated chart. The maximum effect indicator is the indicator that can best reflect the quality of the chart among all effect indicators, and the maximum effect indicator may be different in different application scenarios. For example, in the field of scientific research, information accuracy may be the maximum effect indicator; in the field of commercial display, visual attractiveness may be the maximum effect indicator. The computer system will pre-determine the maximum effect indicator according to the specific application scenario. Then, in the confidence distribution of different effect indicators corresponding to each chart generated by matching descriptive texts, find the confidence corresponding to the maximum effect indicator, and select the chart generated by matching the descriptive text with the maximum confidence as the final matched generated chart. In the example of market research, if information accuracy is the maximum effect indicator, the computer system will compare the confidence levels of the S generated charts in terms of the information accuracy indicator and select the chart with the maximum confidence as the final matched generated chart. This can ensure that the generated chart performs optimally in the most important aspects.
[0138] As an implementation manner, in step S3000, load the text-chart binary tuple data, the matching identification features corresponding to the text-chart binary tuple data, 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 chart construction network to output S description text matching generated charts corresponding to the text-chart binary tuple data, including:
[0139] Step S3100: Divide each text-chart binary tuple data into multiple data units, where one or more data units are derived from chart data, and one or more data units are derived from text description data;
[0140] Step S3200: Load the multiple data units and the matching identification features corresponding to the text-chart binary tuple data into the chart construction network, and use the embedding mapping component of the chart construction network to perform embedding mapping on the matching relationships of the multiple data units and the text-chart binary tuple data respectively to obtain the data embedding features corresponding to the text-chart binary tuple data;
[0141] Step S3300: Use the reduction mapping component of the chart construction network to perform reduction mapping on the data embedding features to obtain the confidence distribution of the matching generated chart, and obtain S description text matching generated charts according to the confidence distribution of the matching generated chart.
[0142] Sub-step S3100 requires the computer system to divide each text-chart binary tuple data into multiple data units, where one or more data units are derived from chart data, and one or more data units are derived from text description data. The text-chart binary tuple data contains rich information. Dividing it into data units helps the computer system to process and analyze this information more meticulously. In different application scenarios, the division method will vary according to the characteristics of the data. For example, in the financial field, for the text-chart binary tuple data describing a company's quarterly financial situation, the text part may contain information such as the company's operating income, net profit, assets and liabilities, etc. The computer system can split this information into different data units, such as "Operating income: 50 million yuan" "Net profit: 10 million yuan", etc. For the corresponding chart data, such as a bar chart showing the quarterly revenue and profit, the computer system can divide it according to the elements of the chart, such as the bars, axes, legends, etc. of different quarters as a data unit respectively. This division method enables the computer system to more clearly identify and process each information segment in the text and the chart, providing more accurate data input for the subsequent embedding mapping operation.
[0143] In actual operation, a computer system can adopt a rule-based method or natural language processing technology to divide data units. For text data, the rule-based method can perform segmentation according to specific grammar rules or keywords, such as taking commas, periods, or specific delimiter words as boundaries. Natural language processing technologies, such as part-of-speech tagging and syntactic analysis, can understand the structure and semantics of the text more deeply, thereby dividing data units more accurately. For chart data, the computer system can utilize image processing technologies, such as edge detection and feature extraction, to identify different elements in the chart and divide them into data units.
[0144] Sub-step S3200 requires the computer system to load multiple data units and the matching identification features corresponding to the text-chart binary data into the chart construction network, and use the embedding mapping component of this network to perform embedding mapping on 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. Its function is to convert the input data into a low-dimensional vector representation, that is, the data embedding features. This vector representation can retain the key information of the data and is convenient for the network to process and learn.
[0145] For multiple data units, the embedding mapping component will process the text data units and chart data units respectively. For text data units, the encoder can adopt word embedding technology to convert each word in the text into a vector, and then combine and transform these vectors through neural network layers to obtain the embedding features of the text data units. 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 chart data units, the encoder can adopt a convolutional neural network (CNN) to extract and transform the image features of the chart, and convert the chart data units into a vector representation. CNN has strong feature extraction capabilities and can capture the spatial structure and visual information in the chart.
[0146] The matching identification features are used to clarify the corresponding relationship between the text and the chart, and the embedding mapping component will also convert it into a vector form to represent this corresponding relationship. For example, in the example in the financial field, the matching identification features may be a combination of a company name and a quarter, such as "ABC Company, the first quarter of 2024". The encoder will convert this matching identification feature into a vector and process it together with the embedding features of the text data units and chart data units.
[0147] Finally, the embedding mapping component integrates the embedding features of all data units and the embedding features of the matching identification features to obtain the data embedding features corresponding to the text-chart binary data. This data embedding feature is a comprehensive vector representation that contains the key information of the text, chart, and their corresponding relationships, providing a basis for the reduction mapping component of the subsequent chart construction network to generate a chart by describing text matching.
[0148] When performing sub-step S3200, the computer system needs to pay attention to multiple aspects. First, when selecting the technology and model of the embedding mapping, it is necessary to make a reasonable choice according to 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 needed. For chart data, parameters such as the number of layers of the CNN and the size of the convolutional kernel also affect the effect of feature extraction. Second, it is necessary to ensure the accurate embedding of the matching identification features because it is crucial for the network to understand the corresponding relationship between the text and the chart. Special encoding methods or preprocessing of the matching identification features can be used to improve the accuracy of the embedding. In addition, to improve the efficiency and performance of the embedding mapping, the computer system can adopt a batch processing method, inputting multiple text-chart binary data into the embedding mapping component for processing together.
[0149] To evaluate the effect of the embedding mapping, the computer system can use some metrics, such as similarity calculation. By calculating the similarity between different data embedding features, it can be judged whether the embedding mapping can retain the semantic and structural relationships between the data. Feasible similarity calculation methods include cosine similarity and Euclidean distance, etc.
[0150] In different application scenarios, the execution of sub-steps S3100 - S3200 may vary. For example, in the medical field, the text-chart binary data may contain disease diagnosis information and corresponding medical image charts. In this case, the division of data units needs to consider the characteristics of medical terms and image features, and the embedding mapping component needs to be able to handle the complex features of medical expertise and image data. In the education field, the text-chart binary data may be the text description of student performance statistics and the corresponding performance distribution chart, and the division and embedding mapping of data units need to focus on the characteristics of educational data, such as the grades of achievements and subject classifications.
[0151] In summary, sub-steps S3100 - S3200 are important steps in the process of a computer system generating a descriptive text - matching generated chart. 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 a vector representation that is easy to process, providing strong support for accurately generating a chart that meets the requirements. At the same time, during the execution process, multiple aspects such as data characteristics, technology selection, and evaluation metrics need to be comprehensively considered to ensure the effectiveness and accuracy of the entire process. In different application scenarios, the steps also need to be appropriately adjusted and optimized according to specific requirements to meet diverse chart generation needs.
[0152] Sub - step S3300 in the implementation manner of step S3000 requires the computer system to use the reduction mapping component of the chart construction network to perform reduction mapping on the data embedding features, obtain the confidence distribution of the matching generated chart, and based on the confidence distribution of the matching generated chart, obtain S descriptive text - matching generated charts, where S≥1. This step is a key operation after sub - step S3100 divides the text - chart binary data into multiple data units and sub - step S3200 obtains the data embedding features using the embedding mapping component, aiming to generate a chart that meets the requirements according to the data embedding features.
[0153] The reduction mapping component of the chart construction network is usually the decoder part, and its main function is to restore the data embedding features to a specific chart. The data embedding features are the low - dimensional vector representations obtained after being processed by the embedding mapping component, containing the key information of the text, chart, and their corresponding relationships. The reduction mapping component will perform a series of transformation and reconstruction operations on these features to gradually generate the various elements of the chart.
[0154] Taking the financial field as an example, assume that the data embedding features are obtained by embedding mapping of a text description about a company's quarterly financial situation (such as "The operating income increased by 20% this quarter, and the net profit reached 50 million yuan") and the corresponding financial data bar chart. The reduction mapping component will try to generate a bar chart that can accurately reflect the text description and data based on this feature information. During the generation process, due to certain uncertainties, the reduction mapping component outputs the confidence distribution of the matching generated chart. The confidence distribution represents the probability of each possible value of the chart element. For example, for the height of the bar representing the operating income in the bar chart, the confidence distribution may show that the probability of the height being 100 pixels is 0.3, the probability of the height being 110 pixels is 0.5, and the probability of the height being 120 pixels is 0.2, etc.
[0155] To achieve inverse mapping, a computer system can adopt various technical means. It is feasible to use a 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 low-dimensional feature vectors to restore high-resolution images and can be used to generate pixel-level representations of charts in chart generation. The Variational Autoencoder is a generative model that can not only encode and decode data but also learn the distribution of data and generate diverse samples by sampling in the latent space, which is suitable for generating charts with a certain degree of uncertainty.
[0156] Based on the confidence distribution of the generated chart for the matching, the computer system obtains S descriptive texts for the generated chart. This process can be achieved through sampling methods. For example, according to the probability values of the confidence distribution, random sampling can be performed on the values of each chart element. For the example of the bar height in the above bar chart, according to the confidence distribution, there is a 50% probability of sampling a bar with a height of 110 pixels. By sampling each element of the chart multiple times, S different descriptive texts for the generated chart can be obtained. These charts may vary in details but all match the input text description and data embedding features.
[0157] When obtaining the descriptive text for the generated chart, the computer system can also incorporate some constraint conditions and optimization strategies. For example, the generated chart can be screened and adjusted according to the target generation style label to ensure that the generated chart meets specific style requirements. If the target generation style label stipulates that the color of the chart is blue-based, then after the computer system generates the chart, the color can be adjusted to meet the blue-based requirements. In addition, post-processing techniques such as smoothing and noise reduction can be adopted to improve the quality and visual effect of the generated chart.
[0158] To evaluate the quality of the generated descriptive text for the generated chart, the computer system can use some metrics. For example, the similarity between the generated chart and the expected chart can be calculated, and feasible similarity calculation methods include cosine similarity and the Structural Similarity Index (SSIM).
[0159] In summary, in sub-step S3300, the reduction mapping component of the graph construction network is used to perform reduction mapping on the data embedding features to obtain the confidence distribution of the matching generated graph, and S description texts for the matching generated graph are obtained based on this distribution. This process comprehensively 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 metrics to meet the needs of different application scenarios.
[0160] An embodiment of the present invention provides a computer system, including a memory and a processor. The memory stores a computer program that can run on the processor, and when the processor executes the program, it implements some or all of the steps in the above method.
[0161] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements some or all of the steps in the above method. The computer-readable storage medium can be transient or non-transient.
[0162] Figure 2 The following is a schematic diagram of the hardware entity of a computer system provided by an embodiment of the present invention, as Figure 2 shown. The hardware entity of the computer system 1000 includes: a processor 1001 and a memory 1002. Among them, the memory 1002 stores a computer program that can run on the processor 1001, and when the processor 1001 executes the program, it implements the steps in the method of any of the above embodiments.
[0163] As described above, the above are only the embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all 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 using a chart generation network, wherein 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 feature is 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 a statistical description of the style tag of the training text is required , then obtain the chart style training mark corresponding to the statistical description training text, and obtain the matching identification feature corresponding to the chart style training mark; load the text chart binary training data, the matching identification feature corresponding to the text chart binary training data, the chart style training mark and the matching identification feature corresponding to the chart style training mark 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; load A candidate training generation charts into the chart construction effect evaluation network, and use the The graph construction effect evaluation network outputs the confidence distribution of different effect indicators corresponding to each of the training generated graphs, and determines the training loss function of the graph construction effect evaluation network based on the confidence distribution of the different effect indicators; calculates the training loss based on the training loss function, the prior effect indicator information corresponding to each of the candidate training generated graphs, and the confidence distribution of the different effect indicators, and repeatedly iterates the network parameters of the graph construction network based on the training loss until the graph construction network converges; wherein, if the determination result of the network output based on the style call indicates that the style tag of the statistical description training text needs to be used, then obtains the style tag corresponding to the statistical description training text A chart style training tag, comprising: 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, wherein B≥1; the text chart binary training data and the matching identification features corresponding to the text chart binary training data are loaded into a 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; B candidate generation 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 candidate generation style tag;The similarity between the training data feature and each of the style mark features is obtained respectively, and the chart style training mark is obtained from the B candidate generated style marks according to the similarity; 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 is matched with a 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 is matched with a 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 of the positive style marks and the negative style mark feature corresponding to each of the negative style marks; 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. ; 2. The method according to claim 1, 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.
3. 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.
4. 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.
5. The method according to claim 4, 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.
6. 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.
7. 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.
8. The method according to claim 7, 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.
9. 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 8 are implemented.
10. 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 8 are implemented.