Data and sample construction method and device, large model fine tuning method and device and chart analysis method and device
By constructing chart structured data and fine-tuning large language models, it solves the problem of difficulty in parsing chart data with traditional technology, achieves efficient parsing and structuring of chart data, and improves parsing accuracy and efficiency.
Patent Information
- Application Number
- CN202410867440.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-18
AI Technical Summary
Traditional document analysis technology is difficult to effectively parse the data structure and meaning in charts. Especially when parsing fine-grained charts, how to accurately extract chart content is a major challenge.
By building chart structured data, generate a variety of chart images and establish fine-grained labels, build chart parsing training samples, and fine-tune large language models to achieve chart parsing. Specific steps include: constructing chart data according to data fields and chart types, generating chart images, establishing chart structured data, building chart parsing training samples, and fine-tuning large language models to achieve chart parsing.
It achieves efficient analysis of chart data, significantly reduces labor and time costs, improves the accuracy of chart analysis, can effectively identify and analyze chart images, convert them into structured data, and supports question and answer and summary output.
Smart Images

Figure CN118799897A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to technical fields such as computer vision, deep learning and large models, and specifically to a method for constructing graph structured data, a method for constructing graph parsing training samples, a method for fine-tuning a graph parsing model, a graph parsing method and apparatus, a device, a non-transitory computer-readable storage medium and a computer program product. Background Art
[0002] In the modern information age, the visual expression of data is becoming more and more diverse. As a tool for efficient information transmission, charts (such as pie charts, bar charts or line charts, etc.) play an important role in various documents and reports.
[0003] However, traditional document analysis technologies, such as optical character recognition (OCR) systems, mainly focus on extracting text content, but are often unable to analyze the data structure and meaning in diagrams. Especially when dealing with fine-grained diagram analysis, how to accurately extract the required content from complex graphic representations has always been a major challenge in technical research and industrial applications. Summary of the invention
[0004] The present disclosure provides a method for constructing graph structured data, a method for constructing graph parsing training samples, a method for fine-tuning a graph parsing model, and a graph parsing method, apparatus, device, and storage medium.
[0005] According to one aspect of the present disclosure, a method for constructing graph structured data is provided, comprising:
[0006] Constructing a plurality of chart data according to a plurality of predetermined data fields and a plurality of chart types, wherein each of the chart data is used to draw a chart of a set chart type under a set data field;
[0007] Generating a plurality of chart images corresponding to the respective chart data, wherein different chart images differ in at least one of a drawing tool and a chart visual element;
[0008] According to the chart visual elements used by each of the chart images, fine-grained labels corresponding to each of the chart images are established, and according to the chart data used by each of the chart images and the fine-grained labels, chart structured data corresponding to each of the chart images are constructed.
[0009] According to another aspect of the present disclosure, a method for constructing a graph parsing training sample is provided, comprising:
[0010] Acquire chart structured data to be processed, wherein the chart structured data includes: a chart image, and image data corresponding to the chart image and a fine-grained label;
[0011] Constructing a template according to each fine-grained label in the graph structured data and at least one preset fine-grained graph question to construct a plurality of graph questions;
[0012] Combining each of the diagram questions with the diagram structured data, and inputting each combination result into a large language model to obtain a diagram answer;
[0013] Combine each chart question with the matching chart answer to obtain multiple fine-grained chart question-answer pairs;
[0014] A graph parsing training sample is organized based on the graph structured data and each of the fine-grained graph question-answer pairs.
[0015] According to another aspect of the present disclosure, a method for fine-tuning a graph parsing model is provided, comprising:
[0016] Acquire a plurality of chart parsing training samples; wherein the chart parsing training samples are constructed using the chart parsing training sample construction method described in any one of the embodiments of the present disclosure;
[0017] The large language model is fine-tuned using the multiple graph parsing training samples to obtain a graph parsing model for implementing graph parsing.
[0018] According to another aspect of the present disclosure, a chart parsing method is provided, comprising:
[0019] Inputting a chart image to be parsed and at least one chart problem to be processed into a chart parsing model, wherein the chart parsing model is fine-tuned by the chart parsing model fine-tuning method described in any one of the embodiments of the present disclosure;
[0020] Obtain a chart parsing answer corresponding to the chart problem to be processed, which is fed back by the chart parsing model based on the chart image to be parsed.
[0021] According to another aspect of the present disclosure, a device for constructing graph structured data is provided, comprising:
[0022] A chart data construction module, used to construct a plurality of chart data according to a plurality of predetermined data fields and a plurality of chart types, wherein each of the chart data is used to draw a chart of a set chart type under a set data field;
[0023] A chart image generation module, used for generating a plurality of chart images corresponding to each of the chart data, wherein different chart images differ in at least one of drawing tools and chart visual elements;
[0024] The chart structured data construction module is used to establish fine-grained labels corresponding to each of the chart images based on the chart visual elements used by each of the chart images, and to construct chart structured data corresponding to each of the chart images based on the chart data and chart visual elements used by each of the chart images.
[0025] According to another aspect of the present disclosure, there is provided a device for constructing a graph parsing training sample, comprising:
[0026] A structured data acquisition module, used to acquire chart structured data to be processed, wherein the chart structured data includes: a chart image, and image data corresponding to the chart image and fine-grained labels;
[0027] A chart question construction module, used to construct a plurality of chart questions according to each fine-grained label in the chart structured data and at least one preset fine-grained chart question construction template;
[0028] A chart answer generation module, used for combining each of the chart questions with the chart structured data, and inputting each combination result into a large language model to obtain a chart answer;
[0029] A fine-grained question-answer pair combination module is used to combine each chart question with the matching chart answer to obtain multiple fine-grained chart question-answer pairs;
[0030] The training sample organizing module is used to organize a graph parsing training sample according to the graph structured data and each of the fine-grained graph question-answer pairs.
[0031] According to another aspect of the present disclosure, there is provided a fine-tuning device for a chart parsing model, comprising:
[0032] A training sample acquisition module, used to acquire a plurality of chart analysis training samples; wherein the chart analysis training samples are constructed using a chart analysis training sample construction device as described in any one of the embodiments of the present disclosure;
[0033] The model fine-tuning module is used to fine-tune the large language model using the multiple graph parsing training samples to obtain a graph parsing model for implementing graph parsing.
[0034] According to another aspect of the present disclosure, there is provided a chart parsing device, comprising:
[0035] A to-be-parsed content input module, used for inputting a to-be-parsed chart image and at least one to-be-processed chart problem into a chart parsing model, wherein the chart parsing model is fine-tuned by a chart parsing model fine-tuning device as described in any one of the embodiments of the present disclosure;
[0036] The chart analysis answer acquisition module is used to obtain the chart analysis answer corresponding to the chart problem to be processed, which is fed back by the chart analysis model based on the chart image to be analyzed.
[0037] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0038] at least one processor; and
[0039] a memory communicatively connected to the at least one processor; wherein,
[0040] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for constructing graph structured data as described in any one of the embodiments of the present disclosure, or execute the method for constructing graph parsing training samples as described in any one of the embodiments of the present disclosure, or execute the method for fine-tuning the graph parsing model as described in any one of the embodiments of the present disclosure, or execute the graph parsing method as described in any one of the embodiments of the present disclosure.
[0041] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute a method for constructing graph structured data as described in any one of the embodiments of the present disclosure, or to execute a method for constructing graph parsing training samples as described in any one of the embodiments of the present disclosure, or to execute a method for fine-tuning a graph parsing model as described in any one of the embodiments of the present disclosure, or to execute a graph parsing method as described in any one of the embodiments of the present disclosure.
[0042] According to another aspect of the present disclosure, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the steps of the method for constructing graph structured data as described in any one of the embodiments of the present disclosure, or implements the steps of the method for constructing graph parsing training samples as described in any one of the embodiments of the present disclosure, or implements the steps of the method for fine-tuning a graph parsing model as described in any one of the embodiments of the present disclosure, or implements the steps of the graph parsing method as described in any one of the embodiments of the present disclosure.
[0043] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0045] Figure 1 is a schematic diagram of a method for constructing chart structured data provided according to an embodiment of the present disclosure;
[0046] Figure 2 is a schematic diagram of another method for constructing chart structured data provided according to an embodiment of the present disclosure;
[0047] Figure 3 is a schematic diagram of another method for constructing chart structured data provided according to an embodiment of the present disclosure;
[0048] Figure 4 is a schematic diagram of a method for constructing a graph parsing training sample according to an embodiment of the present disclosure;
[0049] Figure 5 is a schematic diagram of another method for constructing a graph parsing training sample provided according to an embodiment of the present disclosure;
[0050] Figure 6 It is a schematic diagram of a complete construction process of a chart parsing training sample applicable to the embodiment of the present disclosure;
[0051] Figure 7 is a schematic diagram of a fine-tuning method of a chart parsing model provided according to an embodiment of the present disclosure;
[0052] Figure 8 is a schematic diagram of another method for fine-tuning a chart parsing model provided according to an embodiment of the present disclosure;
[0053] Fig. 9 is a schematic diagram of a model structure of a chart parsing model applicable to an embodiment of the present disclosure;
[0054] Fig.10 is a schematic diagram of a chart parsing method provided according to an embodiment of the present disclosure;
[0055] Fig.11 is a structural diagram of a device for constructing chart structured data provided according to an embodiment of the present disclosure;
[0056] Fig.12 is a structural diagram of a device for constructing a graph parsing training sample according to an embodiment of the present disclosure;
[0057] Fig.13 is a structural diagram of a fine-tuning device for a chart analysis model provided according to an embodiment of the present disclosure;
[0058] Fig.14 is a structural diagram of a chart parsing device provided according to an embodiment of the present disclosure;
[0059] Fig.15 It is a block diagram of an electronic device used to implement the construction of chart structured data, the construction of chart parsing training samples, the fine-tuning of a chart parsing model or the chart parsing method of the embodiments of the present disclosure. DETAILED DESCRIPTION
[0060] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0061] Figure 1 The present invention is a schematic diagram of a method for constructing chart structured data according to an embodiment of the present disclosure. The method is applicable to the case of automatically generating chart structured data of chart images of various chart types in various data fields. The method can be executed by a chart structured data construction device, which can be implemented in software and / or hardware, and can generally be integrated in an electronic device with data processing function.
[0062] like Figure 1 As shown, the method for constructing chart structured data in this embodiment may include:
[0063] S110, constructing a plurality of chart data according to a plurality of predetermined data fields and a plurality of chart types, wherein each of the chart data is used to draw a chart of a set chart type under a set data field.
[0064] In this embodiment, the data field refers to the sub-field to which the chart data used to generate the chart image belongs, such as the fields of economy, environment, or social science. The data field can be a single-level field, such as "economy", or a multi-level field, such as "economy-macroeconomics" or "economy-macroeconomics-gross domestic product data".
[0065] The chart type refers to the type of chart image that the chart data needs to be drawn into, and the chart type can be a bar chart, a pie chart, or a line chart, etc.
[0066] The data domain can be obtained by performing data analysis in a big data scenario, or by performing question and answer with a large language model that has learned extensive knowledge. The chart type can be obtained by traversing the chart drawing types provided by a drawing tool for various types of charts, or by performing question and answer with a large language model, which is not limited in this embodiment.
[0067] In this embodiment, after obtaining multiple data fields and multiple chart types, multiple "data field-chart type" data pairs can be constructed, each data pair represents a demand for obtaining a chart data, for example, "economy-bar chart" represents the need to construct chart data in the economic field that can be drawn as a bar chart. Furthermore, through the constructed multiple data pairs, multiple pieces of chart data can be generated accordingly.
[0068] Specifically, the chart data may be generated by using the above-mentioned data pairs as parameters to call a chart data generation tool, or by conducting question and answer sessions with a large language model based on the above-mentioned data pairs, or by inputting the above-mentioned data pairs into a pre-trained chart data generation model, and the present embodiment does not limit this.
[0069] In this embodiment, the chart data is structured data, typically in JSON format. In addition to the specific data items (data) used to draw the chart, the structured data also includes descriptive information about the specific chart display format, such as the meaning of the coordinate axis (the X axis represents time, the Y axis represents gross domestic product data), the span of the coordinate axis division (by year, month, or day, etc.), and the chart title, etc.
[0070] S120, generating a plurality of chart images corresponding to the respective chart data, wherein different chart images differ in at least one of drawing tools and chart visual elements.
[0071] At present, various types of chart drawing tools on the market can draw corresponding chart images based on structured chart data, but due to different internal processing logics, even for the same chart data, the chart images drawn by different drawing tools have different visual effects. Therefore, in order to obtain more abundant and diverse chart structured data and provide data preparation for subsequent fine-grained chart analysis, in this embodiment, multiple types of drawing tools can be selected to generate chart images for the same or different chart data.
[0072] In addition, when generating a chart image, if the chart visual elements selected by the user are different, the constructed chart image will also have differences in visual effects. Among them, the chart visual elements can be understood as the display elements in the chart that can be distinguished by the human eye. For example, font style, font color, background or graphic color, etc. Furthermore, when generating a chart image for the same or different chart data, you can choose to set a variety of different chart visual elements. Among them, among the multiple chart images drawn by this embodiment, between the two chart images, there are either differences in the drawing tools, or differences in one or more chart visual elements (for example, one is displayed in red font and the other is displayed in black font), or there are differences in both the drawing tools and at least one chart visual element.
[0073] In an optional implementation of this embodiment, for each chart data, various drawing tools can be traversed to draw a chart image corresponding to each drawing tool. At the same time, when each drawing tool draws a chart image for the same chart data, different chart visual elements can be further used to draw multiple chart images corresponding to the same chart data.
[0074] Through the above settings, a large number of complex and diverse chart images can be generated in batches to significantly reduce the time and labor costs of preparing fine-grained chart analysis data.
[0075] S130, establishing fine-grained labels corresponding to each of the chart images based on the chart visual elements used by each of the chart images, and constructing chart structured data corresponding to each of the chart images based on the chart data used by each of the chart images and the fine-grained labels.
[0076] In this embodiment, it is necessary to establish corresponding chart structured data for each chart image, and the chart structured data specifically includes: the chart image, the chart data used to generate the chart image, and the fine-grained labels composed of various chart visual elements contained in the chart image. Typically, the above-mentioned chart structured data can be stored in a structured JSON file.
[0077] As mentioned above, before calling the drawing tool to draw a chart image, it is necessary to specify the various chart visual elements used in drawing the chart image. These chart visual elements accurately represent the visual features of the chart image. Combining these image visual elements with image data can accurately reproduce the chart image. Furthermore, by using these chart visual elements as fine-grained labels for the chart image (for example, font style XX; font color XX, etc.), the fine-grained parsing ability of the model can be effectively improved in the subsequent training process of the chart parsing model.
[0078] After acquiring multiple data fields and multiple chart types, the technical solution of the disclosed embodiment can automatically construct chart data covering multiple data fields and multiple chart types. After drawing complex and diverse chart images by flexibly selecting different drawing tools and chart visual elements, it can simply, conveniently and fully construct chart structured data with fine-grained labels. Based on the chart structured data, a large number of chart parsing training samples can be simply and accurately constructed. This enables full training of fine-grained chart parsing models. This achieves the technical effect of effectively improving the accuracy of chart parsing while significantly reducing manpower and time costs.
[0079] Figure 2 It is a schematic diagram of another method for constructing chart structured data provided by an embodiment of the present disclosure. This embodiment is based on the above embodiments and is refined. In this embodiment, the operation of "constructing multiple chart data according to multiple predetermined data fields and multiple chart types" is specifically specified.
[0080] Correspondingly, such as Figure 2 As shown, the method may specifically include:
[0081] S210: Conduct multiple rounds of dialogue with the large language model to obtain multiple data domains, wherein each data domain includes at least one domain level.
[0082] In this embodiment, considering that various large language models currently on the market have already prefabricated a wealth of knowledge, this knowledge can cover the above-mentioned data fields. However, since the existing general large models do not accurately adapt to clear questions such as "all data fields involved in the chart data", the inventor considers using a multi-round dialogue method to accurately obtain the required multiple data fields from the massive knowledge.
[0083] As mentioned above, each data field may include one or more field levels. Considering the need for subsequent chart data generation, each data field may optionally include multiple field levels.
[0084] In an optional implementation of this embodiment, the performing multiple rounds of dialogues with the large language model to obtain multiple data fields may include:
[0085] Inputting a first round of standard questions into the large language model to obtain a plurality of top-level domains;
[0086] Taking each top-level domain as a starting point, sub-domain demand questions are constructed step by step and input into the large language model to obtain sub-domain expansion results corresponding to each top-level domain as the multiple data domains.
[0087] In this embodiment, a first-round standard question can be pre-constructed as the first-round question in a multi-round dialogue to initialize the acquisition of the broadest data field. For example, the first-round standard question can be: "Please list all data research fields." By inputting the above first-round standard question into the large language model, the broadest data field that requires the use of data charts can be obtained. For example, the top-level field may include: economics, medicine, and sociology.
[0088] After obtaining the top-level domain, each top-level domain can be used as a starting point. Specifically, the top-level domain can be understood as the root node of the tree structure. Then, starting from each root node, one or more rounds of dialogues are continued with the large language model to expand the top-level domain step by step to obtain the sub-domain expansion results corresponding to each top-level domain, that is, enrich each tree structure step by step. Finally, each leaf node contained in each tree structure can be used as the required multiple data fields.
[0089] In an optional implementation of this embodiment, the sub-domain requirement questions of each round can be determined according to the actual rounds of multiple rounds of dialogue. That is, the sub-domain requirement questions have different types of words in different dialogue rounds, or fixed sub-domain requirement questions can be constructed for each dialogue round, etc. This embodiment does not limit this.
[0090] By constructing different questions and interacting with the big language model multiple times, the big language model can fully understand the real data domain acquisition needs. Furthermore, the most suitable multi-domain level data domain can be accurately selected from the massive amount of knowledge through a step-by-step anchoring method, providing solid data preparation for the subsequent accurate generation of chart data.
[0091] The sub-domain demand problems are constructed step by step starting from each top-level domain, and the sub-domain expansion results corresponding to each top-level domain are obtained. The multiple data domains may include:
[0092] S2101. In each of the top-level fields, obtain the current top-level field in turn, and create a set of fields to be processed corresponding to the current top-level field.
[0093] In a specific example, assuming that the top-level domains include economics, medicine, and sociology, we can first obtain economics as the current top-level domain, and create a set of domains to be processed corresponding to economics, for example, set A, and at the same time, add the current top-level domain to the set of domains to be processed, that is, construct a data format such as set A: {economics}.
[0094] S2102: Obtain a target domain to be processed from the set of domains to be processed in turn, and construct a sub-domain requirement problem according to the target domain to be processed and a preset sub-domain problem template.
[0095] It is understandable that, when the first processing is performed, the set of fields to be processed only includes the current top-level field, and thus, the current top-level field needs to be processed as the target field to be processed.
[0096] Among them, according to the current expansion round, a matching sub-field problem template can be selected to construct a sub-field demand problem. For example, when performing the first round of sub-field expansion, a sub-field problem template of "list the sub-fields included in XX" can be obtained, and by filling the target field to be processed into the "XX" position in the sub-field problem template, a form such as "list the sub-fields included in economics" is constructed, and when performing the second round of sub-field expansion, a form such as "list the researchable topics in XX" is constructed.
[0097] Alternatively, you can also use the sub-field question template of "list the sub-fields included in XX" when expanding each round of sub-fields, and use the large language model as a tool to explore the sub-fields step by step.
[0098] S2103: Input the sub-domain requirement question into the large language model to obtain a direct sub-domain corresponding to the target domain to be processed.
[0099] S2104. Determine whether the obtained direct sub-domain is empty: if not, execute S2105; if so, execute S2106.
[0100] In this embodiment, by inputting the sub-domain requirement question into the large language model, the large language model will return a response answer to the sub-domain requirement question. The answer can be divided into two cases. If the current target to be processed field has a sub-domain of the next level, one or more corresponding direct sub-domains will be listed. If the current target to be processed field does not have a sub-domain of the next level, the answer "XX does not have a direct sub-domain" will be fed back. If it is the first case, it means that the target to be processed field does not belong to the aforementioned leaf node, and it is necessary to continue to explore the lower-level direct sub-domains with the above-mentioned direct sub-domains as the current starting point. If it is the second case, it means that the target to be processed field belongs to the aforementioned leaf node, and the target to be processed field can be directly marked as a data field.
[0101] S2105 , expanding the target to-be-processed domain into sub-domains according to each of the direct sub-domains, obtaining a plurality of new to-be-processed domains, adding the domains into the to-be-processed domain set, and returning to execute S2102 .
[0102] As mentioned above, the data domain is described in a multi-level domain manner. Then, when a target domain to be processed has direct sub-domains, it is necessary to use the direct sub-domains to expand the target domain to be processed. For example, the direct sub-domains corresponding to economics are: money brokerage, statistical economics, and behavioral economics. Then economics can be expanded into: economics-money brokerage, economics-statistical economics, and economics-behavioral economics. These three new domains to be processed are added to the set of domains to be processed to continue the exploration of sub-domains.
[0103] S2106: After marking the target to-be-processed field as a data field, execute S2107.
[0104] S2107, determining whether the processing of all the to-be-processed fields in the to-be-processed field set has been completed: if so, executing S2108; otherwise, returning to executing S2102.
[0105] S2108. Determine whether the processing of all top-level fields is completed: if so, end the process; otherwise, return to execute S2101.
[0106] Through the above-mentioned level-by-level traversal method, the most detailed and granular data fields can be mined in a personalized and convenient manner from the massive amount of knowledge to effectively meet the subsequent chart data acquisition needs.
[0107] In another optional implementation of this embodiment, a large number of chart images can be further collected, and each chart image can be clustered into chart types, and multiple chart types can be obtained based on the clustering results. The chart type is any type that actually exists and has been used, for example, it can include: pie charts, bar charts, line charts, radar charts, area charts, box plots, flow charts, mind maps, etc.
[0108] S220, using a plurality of data fields and a plurality of chart types to obtain a plurality of field type pairs, and constructing chart data acquisition instructions corresponding to each of the field type pairs.
[0109] The method of using multiple data fields and multiple chart types to obtain multiple field type pairs and constructing chart data acquisition instructions corresponding to each field type pair may include:
[0110] Combining the plurality of data fields with the plurality of chart types in pairs to obtain the plurality of field type pairs;
[0111] Fill each of the field type pairs into at least one of the first type instruction template and the second type instruction template to obtain a chart data acquisition instruction corresponding to each field type pair;
[0112] Among them, the first type of instruction template does not include the requirement for obtaining the chart appendix, while the second type of instruction template includes the requirement for obtaining the chart appendix.
[0113] In this embodiment, considering that many current chart images contain appendices, the appendices are generally the data source of the chart images. In order to make the chart data finally constructed to cover all possible chart forms to the greatest extent, it is possible to consider constructing two types of chart data containing or not containing appendices. Among them, the method of using a large language model as a data source can also be selected to construct the chart data. Furthermore, the above two types of chart data acquisition instructions can be constructed, and multiple chart data can be obtained by sending chart data acquisition instructions to the large language model.
[0114] In a specific example, a data structure of the form: "Please construct chart data that can be drawn as the corresponding chart type xx in the XX data field, and does not carry chart attachments" can be used as the first type of instruction template, and a data structure of the form: "Please construct chart data that can be drawn as the corresponding chart type xx in the XX data field, and carries chart attachments" can be used as the first type of instruction template.
[0115] Through the above settings, the chart forms that can be covered by the chart data can be further enriched to meet the personalized and diversified construction needs of subsequent chart images.
[0116] S230 , inputting the chart data acquisition instructions into the large language model respectively to obtain the multiple chart data.
[0117] S240: Generate a plurality of chart images corresponding to the chart data, wherein different chart images differ in at least one of drawing tools and chart visual elements.
[0118] S250, establishing fine-grained labels corresponding to each of the chart images based on the chart visual elements used by each of the chart images, and constructing chart structured data corresponding to each of the chart images based on the chart data used by each of the chart images and the fine-grained labels.
[0119] The technical solution of the disclosed embodiment obtains multiple data fields by conducting multiple rounds of dialogues with a large language model; uses multiple data fields and multiple chart types to combine to obtain multiple field type pairs, and constructs chart data acquisition instructions corresponding to each of the field type pairs; inputs each of the chart data acquisition instructions into the large language model to obtain the implementation method of the multiple chart data. Relying on the massive knowledge mastered by the large language model and the ingeniously designed multi-round dialogue method, it is possible to traverse and obtain the most fine-grained field types, so that the subsequently generated chart data has the widest field coverage.
[0120] Figure 3 It is a schematic diagram of another method for constructing chart structured data provided by the embodiment of the present disclosure. This embodiment is refined based on the above embodiments. In this embodiment, the operations of "generating multiple chart images corresponding to each of the chart data" and "constructing chart structured data corresponding to each of the chart images according to the chart data and chart visual elements used by each of the chart images" are specifically specified.
[0121] Correspondingly, such as Figure 3 As shown, the method may specifically include:
[0122] S310, constructing a plurality of chart data according to a plurality of predetermined data fields and a plurality of chart types, wherein each of the chart data is used to draw a chart of a set chart type under a set data field.
[0123] S320 , obtaining the currently processed chart data from among the multiple chart data.
[0124] S330. Obtain the current drawing tools in the drawing tool set in sequence.
[0125] Currently, there are many chart drawing tools on the market to assist users in generating chart images. Considering that when the chart is parsed later, the chart to be parsed is generally constructed and generated by these drawing tools, therefore, each embodiment of the present application also uses the above-mentioned drawing tools to realize the drawing of the chart image.
[0126] S340: Acquire a set of chart visual elements configurable by the current drawing tool, and generate a plurality of chart visual element configuration modes corresponding to the set of chart visual elements.
[0127] The chart visual elements in the chart visual element set may include at least one of the following:
[0128] Value jitter, markers, font style, font color, background, graph color, graph style, and axis style.
[0129] In this embodiment, various types of chart parsing requirements can be traversed, for example, "Please describe the changing trend of the red line in the chart image (the corresponding chart visual element is the graphic color)", etc., to determine the various visual chart elements included in the chart visual element set. Alternatively, all configurable chart visual elements of each type of chart image can be directly traversed to construct a chart visual element set.
[0130] Considering that not all chart visual elements in a drawing tool can be directly configured by the user, it is necessary to first filter out all configurable chart visual elements of the current drawing tool as the chart visual element set of the current drawing tool.
[0131] In an optional implementation of this embodiment, the generating of multiple chart visual element configuration modes corresponding to the chart visual element set may include:
[0132] S3401. Obtain at least one optional setting value of each of the chart visual elements in the chart visual element set.
[0133] In a specific example, the graphic color, a chart visual element, may include five optional setting values: red, yellow, blue, green, and black.
[0134] S3402: Randomly obtain a target setting item corresponding to each chart visual element from each of the optional setting values, and combine the target setting items into a chart visual element configuration mode.
[0135] S3403, determine whether to generate a set number of the chart visual element configuration methods: if so, end the process; otherwise, return to execute S3402.
[0136] Through the above settings, the diversity and complexity of chart images in the real world can be effectively simulated, providing sufficient data preparation for the subsequent construction of chart parsing training samples.
[0137] S350, calling the current drawing tool, and generating a plurality of chart images corresponding to the currently processed chart data in each of the chart visual element configuration modes.
[0138] S360, determining whether all drawing tools generate chart images for the currently processed chart data: if so, executing S370; otherwise, returning to executing S330.
[0139] S370, determine whether the end construction condition of the chart data is met, if so, execute S380; otherwise, return to execute S320.
[0140] The end condition of constructing the chart data may be the completion of the traversal construction of all the chart data, or the completion of the construction of chart images of a set number of chart data, etc., which is not limited in this embodiment.
[0141] S380: Generate a plurality of fine-grained labels corresponding to each of the chart images according to the chart visual element configuration method used to generate each of the chart images.
[0142] It can be understood that since the chart visual element configuration method used for each chart image constructed is uniquely determined, corresponding fine-grained labels can be constructed based on the chart visual elements included in the chart visual element configuration method and the matching target setting items.
[0143] The number of fine-grained tags is consistent with the number of chart visual elements in the chart visual element set. The name of the chart visual element is used as the tag name of the fine-grained tag, and the target setting item of the chart visual element is used as the tag value of the fine-grained tag, for example: a fine-grained tag such as graphic color = "red" is constructed.
[0144] Furthermore, if the chart data of the currently processed chart image includes a chart appendix, a fine-grained label corresponding to the currently processed chart image is generated according to the chart appendix.
[0145] Specifically, when the chart data contains a chart appendix, the chart appendix can be extracted and a fine-grained label such as chart appendix = "www.xxx.xx" can be constructed accordingly.
[0146] Through the above settings, the fine-grained labeling form of the chart image is further enriched, and then according to the richness of the fine-grained labels, the chart parsing service of the same granularity can be provided to the users.
[0147] S390, organizing each of the chart images, the chart data used by each of the chart images, and the plurality of fine-grained labels corresponding to each of the chart images to obtain chart structured data corresponding to each of the chart images.
[0148] The technical solution of the disclosed embodiment can effectively simulate the diversity and complexity of chart images in the real world by using a variety of drawing tools to generate chart images under a variety of different chart visual element configurations, and provide rich data preparation for fine-tuning the image parsing model for subsequent generation of chart parsing training samples, which greatly reduces the time and labor costs caused by manual annotation and construction of chart structured data.
[0149] Figure 4 The present invention is a schematic diagram of a method for constructing a graph parsing training sample according to an embodiment of the present invention. The method is applicable to the case of automatically constructing complex and diverse fine-grained graph parsing training samples. The method can be executed by a graph parsing training sample construction device, which can be implemented in software and / or hardware, and can generally be integrated in an electronic device with data processing function.
[0150] Correspondingly, such as Figure 4The method may specifically include:
[0151] S410: Acquire chart structured data to be processed, wherein the chart structured data includes: a chart image, and image data corresponding to the chart image and fine-grained labels.
[0152] In this embodiment, the chart data is structured data, typically in JSON format. In addition to the specific data items (data) used to draw the chart, the structured data also includes descriptive information about the specific chart display format, such as the meaning of the coordinate axis (the X axis represents time, the Y axis represents gross domestic product data), the span of the coordinate axis division (by year, month, or day, etc.), and the chart title, etc.
[0153] The fine-grained label may be a chart visual element corresponding to the chart image, for example, font style XX; font color XX, etc.
[0154] S420: construct a template according to each fine-grained tag in the graph structured data and at least one preset fine-grained graph question to obtain a plurality of graph questions.
[0155] In this embodiment, in order to fine-tune the large language model to obtain a graph parsing model, it is necessary to construct an instruction set for model training. Then, the instruction set can be combined with graph structured data as graph parsing training samples for fine-tuning the graph parsing model.
[0156] In order to enable the chart parsing model to perform fine-grained chart parsing, the instruction set that needs to be constructed can ask and answer questions about one or more fine-grained labels in the chart image. Furthermore, one or more fine-grained chart question construction templates can be pre-constructed. For example, please ask a question about the fine-grained label name XX with a fine-grained label value of XX. By filling the above-mentioned fine-grained labels into the one or more fine-grained chart question construction templates, multiple fine-grained chart questions are obtained.
[0157] S430, combining each of the chart questions with the chart structured data, and inputting each combination result into a large language model to obtain a chart answer.
[0158] It can be understood that the graph structured data includes graph data, graph images, and fine-grained labels in the graph images. Furthermore, the large language model can accurately derive graph answers corresponding to graph questions based on the knowledge of these inputs.
[0159] S440: Combine each chart question with the matching chart answer to obtain multiple fine-grained chart question-answer pairs.
[0160] S450: Organize a chart parsing training sample based on the chart structured data and each of the fine-grained chart question-answer pairs.
[0161] By using fine-grained graph question-answer pairs as instruction sets and combining the instruction sets with graph structured data as the implementation of graph parsing training samples, large language models can be fine-tuned efficiently and accurately.
[0162] The technical solution of the disclosed embodiment obtains chart structured data to be processed, constructs a template according to the fine-grained labels in the chart structured data and at least one preset fine-grained chart question, constructs a plurality of chart questions, combines each of the chart questions with the chart structured data, and inputs each combination result into a large language model to obtain a chart answer, and finally organizes an implementation method of a chart parsing training sample according to the chart structured data and each of the fine-grained chart question and answer pairs, which can efficiently and accurately construct a large number of fine-grained instruction sets, which provides sufficient data preparation for the subsequent parsing of fine-grained chart images.
[0163] Figure 5 1 is a schematic diagram of another method for constructing a chart parsing training sample according to an embodiment of the present disclosure. This embodiment is a refinement of the above embodiments. In this embodiment, the chart parsing training sample is expanded by constructing a chart parsing question-answer pair and a chart summary question-answer pair.
[0164] Correspondingly, such as Figure 5 As shown, the method may specifically include:
[0165] S510: Acquire chart structured data to be processed, wherein the chart structured data includes: a chart image, and image data corresponding to the chart image and fine-grained labels.
[0166] S520: construct a template according to each fine-grained tag in the graph structured data and at least one preset fine-grained graph question to obtain a plurality of graph questions.
[0167] S530: Combine each of the chart questions with the chart structured data, and input each combination result into a large language model to obtain a chart answer.
[0168] S540: Combine each chart question with the matching chart answer to obtain multiple fine-grained chart question-answer pairs.
[0169] S550: Combine the preset chart analysis question with the chart data in the chart structured data to obtain a chart analysis question-answer pair.
[0170] Considering that in application scenarios where chart parsing is required, most users hope to be able to fully parse a chart image, for example, in automated document management scenarios, in order to cope with this widely used scenario, a standardized chart parsing question can be constructed, for example, please parse the chart image into JSON format, or a structured format, etc. Since the standard answer to the chart parsing question is the chart data in the chart structured data, the preset chart parsing question can be combined with the chart data in the chart structured data to obtain a chart parsing question and answer pair.
[0171] S560: Input the preset chart summary question and the chart structured data into the large language model to obtain a chart summary answer.
[0172] Furthermore, in application scenarios that require chart analysis, most users also have a need to summarize charts. In order to cope with this widely used scenario, a standard chart summary question can be constructed accordingly. For example, please summarize the central idea of the chart image or the content it expresses.
[0173] Similarly, by inputting the chart summary question and the chart structured data into the large language model, a relatively accurate chart summary answer can be obtained.
[0174] S570. Combine the chart summary question and the chart summary answer to obtain a chart summary question-answer pair.
[0175] S580. Organize a chart parsing training sample based on the chart structured data, each of the fine-grained chart question-answer pairs, the chart parsing question-answer pairs, and the chart summary question-answer pairs.
[0176] Figure 6 It is a schematic diagram of a complete construction process of a chart parsing training sample applicable to an embodiment of the present disclosure.
[0177] like Figure 6 As shown, first, by conducting multiple rounds of dialogue with the large language model, multiple data fields can be obtained, and then structured chart data suitable for drawing set types of charts can be constructed accordingly under the data fields. Figure 6 In the above, the researchable topic is used as the most fine-grained data field. In fact, this data field can also be expressed through the aforementioned multiple field-level data fields. For this structured chart data, by constructing fine-grained labels and combining multiple types of question-answer pairs, a chart parsing training sample can be obtained.
[0178] The technical solution of the disclosed embodiment further enriches the data form of the instruction set by adding instruction sets in the form of chart parsing question and answer pairs and chart summary question and answer pairs to the chart parsing training samples, thereby providing more sufficient data preparation for subsequent fine-grained chart image parsing.
[0179] Figure 7 1 is a schematic diagram of a method for fine-tuning a graph parsing model provided according to an embodiment of the present disclosure. The method is applicable to the case where a large language model is fine-tuned using the fine-grained graph parsing training samples constructed above to obtain a graph parsing model for implementing fine-grained graph parsing. The method can be executed by a graph parsing model fine-tuning device, which can be implemented in software and / or hardware, and can generally be integrated in an electronic device with data processing function.
[0180] Correspondingly, such as Figure 7 As shown, the method may include:
[0181] S710. Acquire a plurality of chart parsing training samples; wherein the chart parsing training samples are constructed using the chart parsing training sample construction method as described in any one of the embodiments of the present disclosure.
[0182] S720: Fine-tune the large language model using the multiple graph parsing training samples to obtain a graph parsing model for implementing graph parsing.
[0183] The technical solution of the disclosed embodiment can obtain a chart parsing model that can perform accurate and fine-grained parsing of charts by fine-tuning the large language model using fine-grained chart parsing training samples, so as to meet people's growing demand for personalized and convenient chart parsing.
[0184] Figure 8 Schematic diagram of another fine-tuning method of a graph parsing model provided according to an embodiment of the present disclosure. This embodiment refines the above embodiments as technologies, and in this embodiment, specifically concretizes the fine-tuning method of a large language model.
[0185] Correspondingly, such as Figure 8 As shown, the method may specifically include:
[0186] S810. Acquire a plurality of chart parsing training samples; wherein the chart parsing training samples are constructed using the chart parsing training sample construction method as described in any one of the embodiments of the present disclosure.
[0187] S820. Obtain a target chart parsing training sample currently being processed, and obtain a target chart image and at least one question-answer pair from the target chart parsing training sample, wherein the question-answer pair includes a fine-grained chart question-answer pair, a chart parsing question-answer pair, or a chart summary question-answer pair.
[0188] S830: extract visual features from the target chart image, and generate a first feature sequence from the extracted visual features.
[0189] S840: Perform word segmentation on the at least one question-answer pair, and generate a second feature sequence according to the word segmentation result.
[0190] S850: Input the first feature sequence and the second feature sequence into the large language model to fine-tune the large language model.
[0191] in, Fig. 9 Schematic diagram of a model structure of a chart parsing model applicable to the embodiment of the present disclosure. Fig. 9 As shown, the visual feature extraction module is used to realize the extraction of visual features, and the Vision Transformer architecture (or variants such as Swin Transformer) can be used. The first feature sequence generation module is used to realize the conversion from visual features to feature sequences, and a multi-layer q-former (or variants such as MLP) can be used.
[0192] The large language model can use a multi-layer stacked pre-trained large language model to receive the converted visual features and instructions (prompt), and output structured JSON parsing results or questions and answers and summaries corresponding to the instructions. Optionally, cross entropy loss can be used during model training, and autoregressive decoding can be used during prediction.
[0193] The technical solution of the disclosed embodiment can obtain a chart parsing model that can perform accurate and fine-grained parsing of charts by fine-tuning the large language model using fine-grained chart parsing training samples, so as to meet people's growing demand for personalized and convenient chart parsing.
[0194] Fig.10 1 is a schematic diagram of a chart parsing method provided according to an embodiment of the present disclosure. The method is applicable to the case where the chart parsing model trained to implement fine-grained chart parsing performs content parsing on a set chart image. The method can be executed by a chart parsing device, which can be implemented in software and / or hardware, and can generally be integrated into an electronic device with data processing function.
[0195] Correspondingly, such as Fig.10 As shown, the method may include:
[0196] S1010. Inputting a chart image to be parsed and at least one chart problem to be processed into a chart parsing model, wherein the chart parsing model is fine-tuned by the chart parsing model fine-tuning method of any one of the embodiments of the present disclosure.
[0197] S1020: Obtain a chart parsing answer corresponding to the chart problem to be processed, which is fed back by the chart parsing model based on the chart image to be parsed.
[0198] The technical solution of the disclosed embodiment can effectively identify and parse chart images in documents, convert them into structured data that can be retrieved and further analyzed, and also support a series of instruction outputs (such as questions and answers, summaries). In terms of application, this technology can not only be widely used in automated document management systems to improve the efficiency and quality of document processing, but also play an important role in business intelligence analysis, academic research, financial reporting and other fields. By converting unstructured chart data into structured data, the possibility of data processing and analysis is greatly broadened, providing strong technical support for products and projects in related fields.
[0199] As an implementation of the above-mentioned methods for constructing each of the graph structured data, the present disclosure also provides an optional embodiment of an execution device for implementing the above-mentioned methods for constructing each of the graph structured data.
[0200] Correspondingly, such as Fig.11 As shown, the chart structured data construction device includes: a chart data construction module 1110, a chart image generation module 1120 and a chart structured data construction module 1130, wherein:
[0201] The chart data construction module 1110 is used to construct a plurality of chart data according to a plurality of predetermined data fields and a plurality of chart types, wherein each of the chart data is used to draw a chart of a set chart type under a set data field;
[0202] A chart image generating module 1120, configured to generate a plurality of chart images corresponding to the respective chart data, wherein different chart images differ in at least one of a drawing tool and a chart visual element;
[0203] The chart structured data construction module 1130 is used to establish fine-grained labels corresponding to each of the chart images based on the chart visual elements used by each of the chart images, and to construct chart structured data corresponding to each of the chart images based on the chart data and fine-grained labels used by each of the chart images.
[0204] After acquiring multiple data fields and multiple chart types, the technical solution of the disclosed embodiment can automatically construct chart data covering multiple data fields and multiple chart types. After drawing complex and diverse chart images by flexibly selecting different drawing tools and chart visual elements, it can simply, conveniently and fully construct chart structured data with fine-grained labels. Based on the chart structured data, a large number of chart parsing training samples can be simply and accurately constructed. This enables full training of fine-grained chart parsing models. The accuracy of chart parsing can be effectively improved while significantly reducing manpower and time costs.
[0205] On the basis of the above embodiments, the chart data construction module includes:
[0206] A data domain acquisition unit, configured to conduct multiple rounds of dialogue with the large language model to acquire multiple data domains, wherein each data domain includes at least one domain level;
[0207] A chart data acquisition instruction construction unit, used to use a plurality of data fields and a plurality of chart types to obtain a plurality of field type pairs, and to respectively construct a chart data acquisition instruction corresponding to each of the field type pairs;
[0208] The chart data model generating unit is used to input each of the chart data acquisition instructions into the large language model to obtain the multiple chart data.
[0209] On the basis of the above embodiments, the data field acquisition unit includes:
[0210] A top-level domain acquisition subunit, used for inputting a first round of standard questions into the large language model to acquire a plurality of top-level domains;
[0211] The sub-domain expansion sub-unit is used to construct sub-domain demand questions step by step starting from each top-level domain and input them into the large language model to obtain sub-domain expansion results corresponding to each top-level domain as the multiple data domains.
[0212] On the basis of the above embodiments, the sub-field expansion sub-unit is specifically used for:
[0213] In each of the top-level fields, a current top-level field is obtained, and a set of fields to be processed corresponding to the current top-level field is created;
[0214] Obtain a target domain to be processed from the set of domains to be processed, and construct a sub-domain requirement problem according to the target domain to be processed and a preset sub-domain problem template;
[0215] Inputting the sub-domain requirement question into the large language model to obtain a direct sub-domain corresponding to the target domain to be processed;
[0216] If the obtained direct sub-fields are not empty, the target to-be-processed field is expanded into sub-fields according to each of the direct sub-fields, and a plurality of new to-be-processed fields are obtained and added to the to-be-processed field set, so as to continue to expand the sub-fields;
[0217] If the acquired direct sub-domain is empty, the target to-be-processed domain is marked as a data domain.
[0218] On the basis of the above embodiments, the chart data acquisition instruction construction unit is specifically used for:
[0219] Combining the plurality of data fields with the plurality of chart types in pairs to obtain the plurality of field type pairs;
[0220] Fill each of the field type pairs into at least one of the first type instruction template and the second type instruction template to obtain a chart data acquisition instruction corresponding to each field type pair;
[0221] Among them, the first type of instruction template does not include the requirement for obtaining the chart appendix, while the second type of instruction template includes the requirement for obtaining the chart appendix.
[0222] On the basis of the above embodiments, the chart image generation module includes:
[0223] A drawing tool traversal unit is used to obtain the current drawing tool in the drawing tool collection;
[0224] A chart visual element configuration mode generating unit, used for acquiring a chart visual element set configurable by the current drawing tool, and generating a plurality of chart visual element configuration modes corresponding to the chart visual element set;
[0225] The drawing unit is called to call the current drawing tool to generate a plurality of chart images corresponding to the currently processed chart data in each of the chart visual element configuration modes.
[0226] Based on the above embodiments, the chart visual element in the chart visual element set includes at least one of the following:
[0227] Value jitter, markers, font style, font color, background, graph color, graph style, and axis style.
[0228] On the basis of the above embodiments, the chart visual element configuration mode generating unit is specifically used for:
[0229] Obtain at least one optional setting value of each of the chart visual elements in the chart visual element set;
[0230] From the optional setting values, a target setting item corresponding to each chart visual element is randomly obtained, and the target setting items are combined into a chart visual element configuration mode.
[0231] On the basis of the above embodiments, the chart structured data construction module includes:
[0232] A fine-grained label generating unit, configured to generate a plurality of fine-grained labels corresponding to each of the chart images according to the chart visual element configuration mode used to generate each of the chart images;
[0233] The structured data organizing unit is used to organize each of the chart images, the chart data used by each of the chart images, and the multiple fine-grained labels corresponding to each of the chart images to obtain chart structured data corresponding to each of the chart images.
[0234] Based on the above embodiments, the method further includes an appendix tag generating unit, which is used to:
[0235] If the chart data of the currently processed chart image includes a chart appendix, a fine-grained label corresponding to the currently processed chart image is generated according to the chart appendix.
[0236] The above-mentioned product can execute the method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0237] As an implementation of the above-mentioned methods for constructing the graph parsing training samples, the present disclosure also provides an optional embodiment of an execution device for implementing the above-mentioned methods for constructing the graph parsing training samples.
[0238] Correspondingly, such as Fig.12 As shown, the apparatus for constructing a chart parsing training sample includes: a structured data acquisition module 1210, a chart question construction module 1220, a chart answer generation module 1230, a fine-grained question-answer pair combination module 1240, and a training sample organization module 1250, wherein:
[0239] The structured data acquisition module 1210 is used to acquire the chart structured data to be processed, wherein the chart structured data includes: a chart image, and image data corresponding to the chart image and a fine-grained label;
[0240] A chart question construction module 1220 is used to construct a plurality of chart questions according to each fine-grained label in the chart structured data and at least one preset fine-grained chart question construction template;
[0241] A chart answer generation module 1230 is used to combine each of the chart questions with the chart structured data, and input each combination result into a large language model to obtain a chart answer;
[0242] A fine-grained question-answer pair combination module 1240 is used to combine each chart question with a matching chart answer to obtain a plurality of fine-grained chart question-answer pairs;
[0243] The training sample organizing module 1250 is used to organize a graph parsing training sample according to the graph structured data and each of the fine-grained graph question-answer pairs.
[0244] The technical solution of the disclosed embodiment obtains chart structured data to be processed, constructs a template according to the fine-grained labels in the chart structured data and at least one preset fine-grained chart question, constructs a plurality of chart questions, combines each of the chart questions with the chart structured data, and inputs each combination result into a large language model to obtain a chart answer, and finally organizes an implementation method of a chart parsing training sample according to the chart structured data and each of the fine-grained chart question and answer pairs, which can efficiently and accurately construct a large number of fine-grained instruction sets, which provides sufficient data preparation for the subsequent parsing of fine-grained chart images.
[0245] On the basis of the above embodiments, it further includes a question-answer pair analysis module for:
[0246] Combining a preset chart parsing question with the chart data in the chart structured data to obtain a chart parsing question-answer pair;
[0247] The training sample organization module is specifically used for:
[0248] A graph parsing training sample is organized based on the graph structured data, each of the fine-grained graph question-answer pairs, and the graph parsing question-answer pairs.
[0249] On the basis of the above embodiments, it further includes a question-answer pair summary module for:
[0250] Inputting a preset chart summary question and the chart structured data into a large language model to obtain a chart summary answer;
[0251] combining the chart summary question with the chart summary answer to obtain a chart summary question-answer pair;
[0252] The training sample organization module is further used to:
[0253] A chart parsing training sample is organized based on the chart structured data, each of the fine-grained chart question-answer pairs, the chart parsing question-answer pairs, and the chart summary question-answer pairs.
[0254] The above-mentioned product can execute the method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0255] As an implementation of the fine-tuning methods for the above-mentioned chart parsing models, the present disclosure also provides an optional embodiment of an execution device for implementing the fine-tuning methods for the above-mentioned chart parsing models.
[0256] Correspondingly, such as Fig.13 As shown, the fine-tuning device of the chart parsing model includes: a training sample acquisition module 1310 and a model fine-tuning module 1320, wherein:
[0257] The training sample acquisition module 1310 is used to acquire a plurality of chart analysis training samples; wherein the chart analysis training samples are constructed using the fine-tuning device of the chart analysis model as described in any one of the embodiments of the present disclosure;
[0258] The model fine-tuning module 1320 is used to fine-tune the large language model using the multiple graph parsing training samples to obtain a graph parsing model for implementing graph parsing.
[0259] The technical solution of the disclosed embodiment can obtain a chart parsing model that can perform accurate and fine-grained parsing of charts by fine-tuning the large language model using fine-grained chart parsing training samples, so as to meet people's growing demand for personalized and convenient chart parsing.
[0260] On the basis of the above embodiments, the model fine-tuning module is specifically used for:
[0261] Acquire a target chart parsing training sample currently being processed, and acquire a target chart image and at least one question-answer pair in the target chart parsing training sample, wherein the question-answer pair includes a fine-grained chart question-answer pair, a chart parsing question-answer pair, or a chart summary question-answer pair;
[0262] Extracting visual features from the target chart image, and generating a first feature sequence from the extracted visual features;
[0263] After performing word segmentation processing on the at least one question-answer pair, a second feature sequence is generated according to the word segmentation result;
[0264] The first feature sequence and the second feature sequence are inputted into the large language model together to perform model fine-tuning on the large language model.
[0265] The above-mentioned product can execute the method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0266] As an implementation of the above-mentioned chart parsing methods, the present disclosure also provides an optional embodiment of an execution device for implementing the above-mentioned chart parsing methods.
[0267] Correspondingly, such as Fig.14 As shown, the chart parsing device includes: a to-be-parsed content input module 1410 and a chart parsing answer acquisition module 1420, wherein:
[0268] The to-be-analyzed content input module 1410 is used to input a to-be-analyzed chart image and at least one to-be-processed chart problem into a chart analysis model, wherein the chart analysis model is fine-tuned by the chart analysis model fine-tuning device described in any one of the embodiments of the present disclosure;
[0269] The chart analysis answer acquisition module 1420 is used to obtain the chart analysis answer corresponding to the chart problem to be processed, which is fed back by the chart analysis model based on the chart image to be analyzed.
[0270] The technical solution of the disclosed embodiment can effectively identify and parse chart images in documents, convert them into structured data that can be retrieved and further analyzed, and also support a series of instruction outputs (such as questions and answers, summaries). In terms of application, this technology can not only be widely used in automated document management systems to improve the efficiency and quality of document processing, but also play an important role in business intelligence analysis, academic research, financial reporting and other fields. By converting unstructured chart data into structured data, the possibility of data processing and analysis is greatly broadened, providing strong technical support for products and projects in related fields.
[0271] The above-mentioned product can execute the method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0272] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0273] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0274] Fig.15A schematic block diagram of an example electronic device 1500 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0275] like Fig.15 As shown, the device 1500 includes a computing unit 1501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1502 or a computer program loaded from a storage unit 1508 into a random access memory (RAM) 1503. In the RAM 1503, various programs and data required for the operation of the device 1500 can also be stored. The computing unit 1501, the ROM 1502, and the RAM 1503 are connected to each other via a bus 1504. An input / output (I / O) interface 1505 is also connected to the bus 1504.
[0276] A number of components in the device 1500 are connected to the I / O interface 1505, including: an input unit 1506, such as a keyboard, a mouse, etc.; an output unit 1507, such as various types of displays, speakers, etc.; a storage unit 1508, such as a disk, an optical disk, etc.; and a communication unit 1509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1509 allows the device 1500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0277] The computing unit 1501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1501 performs the various methods and processes described above, for example, executing the method for constructing the chart structured data described in any one of the embodiments of the present disclosure, or executing the method for constructing the chart parsing training sample as described in any one of the embodiments of the present disclosure, or executing the method for fine-tuning the chart parsing model as described in any one of the embodiments of the present disclosure, or executing the chart parsing method as described in any one of the embodiments of the present disclosure. For example, in some embodiments, the method for constructing graph structured data as described in any of the embodiments of the present disclosure, or the method for constructing graph parsing training samples as described in any of the embodiments of the present disclosure, or the method for fine-tuning the graph parsing model as described in any of the embodiments of the present disclosure, or the graph parsing method as described in any of the embodiments of the present disclosure can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 1508. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 1500 via the ROM 1502 and / or the communication unit 1509. When the computer program is loaded into the RAM 1503 and executed by the computing unit 1501, the method for constructing graph structured data as described in any of the embodiments of the present disclosure, or the method for constructing graph parsing training samples as described in any of the embodiments of the present disclosure, or the method for fine-tuning the graph parsing model as described in any of the embodiments of the present disclosure, or one or more steps of the graph parsing method as described in any of the embodiments of the present disclosure can be executed. Alternatively, in other embodiments, the computing unit 1501 may be configured in any other appropriate manner (for example, by means of firmware) to execute a method for constructing graph structured data as described in any of the embodiments of the present disclosure, or to execute a method for constructing graph parsing training samples as described in any of the embodiments of the present disclosure, or to execute a method for fine-tuning a graph parsing model as described in any of the embodiments of the present disclosure, or to execute a graph parsing method as described in any of the embodiments of the present disclosure.
[0278] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0279] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0280] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0281] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0282] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0283] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services. The server may also be a server of a distributed system, or a server combined with a blockchain.
[0284] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.
[0285] Cloud computing refers to a technology system that uses network access to elastically scalable shared physical or virtual resource pools. Resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for technical applications such as artificial intelligence and blockchain, as well as model training.
[0286] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions provided by this disclosure can be achieved, and this document does not limit this.
[0287] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for constructing graph structured data, comprising: Constructing a plurality of chart data according to a plurality of predetermined data fields and a plurality of chart types, wherein each of the chart data is used to draw a chart of a set chart type under a set data field; Generating a plurality of chart images corresponding to the respective chart data, wherein different chart images differ in at least one of a drawing tool and a chart visual element; According to the chart visual elements used by each of the chart images, fine-grained labels corresponding to each of the chart images are established, and according to the chart data used by each of the chart images and the fine-grained labels, chart structured data corresponding to each of the chart images are constructed.
2. The method according to claim 1, wherein: The multiple chart data are constructed based on the predetermined multiple data fields and multiple chart types, including: Conduct multiple rounds of dialogue with the large language model to obtain multiple data domains, where each data domain includes at least one domain level; Using multiple data fields and multiple chart types, a plurality of field type pairs are obtained by combination, and chart data acquisition instructions corresponding to each of the field type pairs are respectively constructed; Each of the chart data acquisition instructions is input into the large language model to obtain the multiple items of chart data.
3. The method according to claim 2, wherein: The method involves multiple rounds of dialogue with the large language model to obtain multiple data fields, including: Inputting a first round of standard questions into the large language model to obtain a plurality of top-level domains; Taking each top-level domain as a starting point, sub-domain demand questions are constructed step by step and input into the large language model to obtain sub-domain expansion results corresponding to each top-level domain as the multiple data domains.
4. The method according to claim 3, wherein: The sub-field demand problems are constructed step by step with each top-level field as the starting point, and the sub-field expansion results corresponding to each top-level field are obtained as the multiple data fields, including: In each of the top-level fields, a current top-level field is obtained, and a set of fields to be processed corresponding to the current top-level field is created; Obtain a target domain to be processed from the set of domains to be processed, and construct a sub-domain requirement problem according to the target domain to be processed and a preset sub-domain problem template; Inputting the sub-domain requirement question into the large language model to obtain a direct sub-domain corresponding to the target domain to be processed; If the obtained direct sub-fields are not empty, the target to-be-processed field is expanded into sub-fields according to each of the direct sub-fields, and a plurality of new to-be-processed fields are obtained and added to the to-be-processed field set, so as to continue to expand the sub-fields; If the acquired direct sub-domain is empty, the target to-be-processed domain is marked as a data domain.
5. The method according to claim 2, wherein: The method of using a plurality of data fields and a plurality of chart types to obtain a plurality of field type pairs and constructing a chart data acquisition instruction corresponding to each of the field type pairs respectively includes: Combining the plurality of data fields with the plurality of chart types in pairs to obtain the plurality of field type pairs; Fill each of the field type pairs into at least one of the first type instruction template and the second type instruction template to obtain a chart data acquisition instruction corresponding to each field type pair; Among them, the first type of instruction template does not include the requirement for obtaining the chart appendix, while the second type of instruction template includes the requirement for obtaining the chart appendix.
6. The method according to claim 1, wherein: The generating of a plurality of chart images corresponding to each of the chart data comprises: In the drawing tool collection, get the current drawing tool; Acquire a set of chart visual elements configurable by the current drawing tool, and generate a plurality of chart visual element configuration modes corresponding to the set of chart visual elements; The current drawing tool is called to generate a plurality of chart images corresponding to the currently processed chart data in each of the chart visual element configuration modes.
7. The method according to claim 6, wherein: The chart visual element in the chart visual element set includes at least one of the following: Value jitter, markers, font style, font color, background, graph color, graph style, and axis style.
8. The method according to claim 6, wherein: The generating of multiple chart visual element configuration modes corresponding to the chart visual element set includes: Obtain at least one optional setting value of each of the chart visual elements in the chart visual element set; From the optional setting values, a target setting item corresponding to each chart visual element is randomly obtained, and the target setting items are combined into a chart visual element configuration mode.
9. The method according to claim 6, wherein: The step of establishing a fine-grained label corresponding to each of the chart images according to the chart visual elements used by each of the chart images, and constructing chart structured data corresponding to each of the chart images according to the chart data and the fine-grained label used by each of the chart images, includes: Generate a plurality of fine-grained labels corresponding to each of the chart images according to the chart visual element configuration mode used to generate each of the chart images; Each of the chart images, the chart data used by each of the chart images, and the plurality of fine-grained labels corresponding to each of the chart images are organized to obtain chart structured data corresponding to each of the chart images.
10. The method according to claim 9, further comprising: If the chart data of the currently processed chart image includes a chart appendix, a fine-grained label corresponding to the currently processed chart image is generated according to the chart appendix.
11. A method for constructing a graph parsing training sample, comprising: Acquire chart structured data to be processed, wherein the chart structured data includes: a chart image, and image data corresponding to the chart image and a fine-grained label; Constructing a template according to each fine-grained label in the graph structured data and at least one preset fine-grained graph question to construct a plurality of graph questions; Combining each of the diagram questions with the diagram structured data, and inputting each combination result into a large language model to obtain a diagram answer; Combine each chart question with the matching chart answer to obtain multiple fine-grained chart question-answer pairs; A graph parsing training sample is organized based on the graph structured data and each of the fine-grained graph question-answer pairs.
12. The method according to claim 11, further comprising: Combining a preset chart parsing question with the chart data in the chart structured data to obtain a chart parsing question-answer pair; The step of obtaining a graph parsing training sample based on the graph structured data and each of the fine-grained graph question-answer pairs specifically includes: A graph parsing training sample is organized based on the graph structured data, each of the fine-grained graph question-answer pairs, and the graph parsing question-answer pairs.
13. The method according to claim 12, further comprising: Inputting a preset chart summary question and the chart structured data into a large language model to obtain a chart summary answer; combining the chart summary question with the chart summary answer to obtain a chart summary question-answer pair; The step of organizing a graph parsing training sample based on the graph structured data, each of the fine-grained graph question-answer pairs, and the graph parsing question-answer pairs further includes: A chart parsing training sample is organized based on the chart structured data, each of the fine-grained chart question-answer pairs, the chart parsing question-answer pairs, and the chart summary question-answer pairs.
14. A method for fine-tuning a graph parsing model, comprising: Acquire a plurality of chart analysis training samples; wherein the chart analysis training samples are constructed using the method described in any one of claims 11 to 13; The large language model is fine-tuned using the multiple graph parsing training samples to obtain a graph parsing model for implementing graph parsing.
15. The method according to claim 14, wherein: The method of fine-tuning the large language model using the plurality of graph parsing training samples to obtain a graph parsing model for implementing graph parsing includes: Acquire a target chart parsing training sample currently being processed, and acquire a target chart image and at least one question-answer pair in the target chart parsing training sample, wherein the question-answer pair includes a fine-grained chart question-answer pair, a chart parsing question-answer pair, or a chart summary question-answer pair; Extracting visual features from the target chart image, and generating a first feature sequence from the extracted visual features; After performing word segmentation processing on the at least one question-answer pair, a second feature sequence is generated according to the word segmentation result; The first feature sequence and the second feature sequence are inputted into the large language model together to perform model fine-tuning on the large language model.
16. A chart parsing method, comprising: Inputting a chart image to be parsed and at least one chart problem to be processed into a chart parsing model, wherein the chart parsing model is obtained by fine-tuning the method according to claim 14 or 15; Obtain a chart parsing answer corresponding to the chart problem to be processed, which is fed back by the chart parsing model based on the chart image to be parsed.
17. A device for constructing graph structured data, comprising: A chart data construction module, used to construct a plurality of chart data according to a plurality of predetermined data fields and a plurality of chart types, wherein each of the chart data is used to draw a chart of a set chart type under a set data field; A chart image generation module, used for generating a plurality of chart images corresponding to each of the chart data, wherein different chart images differ in at least one of drawing tools and chart visual elements; The chart structured data construction module is used to establish fine-grained labels corresponding to each of the chart images based on the chart visual elements used by each of the chart images, and to construct chart structured data corresponding to each of the chart images based on the chart data and chart visual elements used by each of the chart images.
18. The device according to claim 17, wherein: The chart data construction module includes: A data domain acquisition unit, configured to conduct multiple rounds of dialogue with the large language model to acquire multiple data domains, wherein each data domain includes at least one domain level; A chart data acquisition instruction construction unit, used to use a plurality of data fields and a plurality of chart types to obtain a plurality of field type pairs, and to respectively construct a chart data acquisition instruction corresponding to each of the field type pairs; The chart data model generating unit is used to input each of the chart data acquisition instructions into the large language model to obtain the multiple chart data.
19. The device according to claim 18, wherein: The data domain acquisition unit includes: A top-level domain acquisition subunit, used for inputting a first round of standard questions into the large language model to acquire a plurality of top-level domains; The sub-domain expansion sub-unit is used to construct sub-domain demand questions step by step starting from each top-level domain and input them into the large language model to obtain sub-domain expansion results corresponding to each top-level domain as the multiple data domains.
20. The device according to claim 19, wherein The sub-domain expansion sub-unit is specifically used for: In each of the top-level fields, a current top-level field is obtained, and a set of fields to be processed corresponding to the current top-level field is created; Obtain a target domain to be processed from the set of domains to be processed, and construct a sub-domain requirement problem according to the target domain to be processed and a preset sub-domain problem template; Inputting the sub-domain requirement question into the large language model to obtain a direct sub-domain corresponding to the target domain to be processed; If the obtained direct sub-fields are not empty, the target to-be-processed field is expanded into sub-fields according to each of the direct sub-fields, and a plurality of new to-be-processed fields are obtained and added to the to-be-processed field set, so as to continue to expand the sub-fields; If the acquired direct sub-domain is empty, the target to-be-processed domain is marked as a data domain.
21. The device according to claim 18, wherein The chart data acquisition instruction construction unit is specifically used for: Combining the plurality of data fields with the plurality of chart types in pairs to obtain the plurality of field type pairs; Fill each of the field type pairs into at least one of the first type instruction template and the second type instruction template to obtain a chart data acquisition instruction corresponding to each field type pair; Among them, the first type of instruction template does not include the requirement for obtaining the chart appendix, while the second type of instruction template includes the requirement for obtaining the chart appendix.
22. The device according to claim 17, wherein: The chart image generation module comprises: A drawing tool traversal unit is used to obtain the current drawing tool in the drawing tool collection; A chart visual element configuration mode generating unit, used for acquiring a chart visual element set configurable by the current drawing tool, and generating a plurality of chart visual element configuration modes corresponding to the chart visual element set; The drawing unit is called to call the current drawing tool to generate a plurality of chart images corresponding to the currently processed chart data in each of the chart visual element configuration modes.
23. The device according to claim 22, wherein: The chart visual element in the chart visual element set includes at least one of the following: Value jitter, markers, font style, font color, background, graph color, graph style, and axis style.
24. The device according to claim 22, wherein: The chart visual element configuration mode generating unit is specifically used for: Obtain at least one optional setting value of each of the chart visual elements in the chart visual element set; From the optional setting values, a target setting item corresponding to each chart visual element is randomly obtained, and the target setting items are combined into a chart visual element configuration mode.
25. The device according to claim 22, wherein: The graph structured data building module includes: A fine-grained label generating unit, configured to generate a plurality of fine-grained labels corresponding to each of the chart images according to the chart visual element configuration mode used to generate each of the chart images; The structured data organizing unit is used to organize each of the chart images, the chart data used by each of the chart images, and the multiple fine-grained labels corresponding to each of the chart images to obtain chart structured data corresponding to each of the chart images.
26. The apparatus according to claim 25, further comprising an appendix tag generating unit, configured to: If the chart data of the currently processed chart image includes a chart appendix, a fine-grained label corresponding to the currently processed chart image is generated according to the chart appendix.
27. A device for constructing a graph parsing training sample, comprising: A structured data acquisition module, used to acquire chart structured data to be processed, wherein the chart structured data includes: a chart image, and image data corresponding to the chart image and fine-grained labels; A chart question construction module, used to construct a plurality of chart questions according to each fine-grained label in the chart structured data and at least one preset fine-grained chart question construction template; A chart answer generation module, used for combining each of the chart questions with the chart structured data, and inputting each combination result into a large language model to obtain a chart answer; A fine-grained question-answer pair combination module is used to combine each chart question with the matching chart answer to obtain multiple fine-grained chart question-answer pairs; The training sample organizing module is used to organize a graph parsing training sample according to the graph structured data and each of the fine-grained graph question-answer pairs.
28. The apparatus according to claim 27, further comprising a question-answer pair analysis module, configured to: Combining a preset chart parsing question with the chart data in the chart structured data to obtain a chart parsing question-answer pair; The training sample organization module is specifically used for: A graph parsing training sample is organized based on the graph structured data, each of the fine-grained graph question-answer pairs, and the graph parsing question-answer pairs.
29. The apparatus according to claim 28, further comprising a question-answer pair summarizing module, configured to: Inputting a preset chart summary question and the chart structured data into a large language model to obtain a chart summary answer; combining the chart summary question with the chart summary answer to obtain a chart summary question-answer pair; The training sample organization module is further used to: A chart parsing training sample is organized based on the chart structured data, each of the fine-grained chart question-answer pairs, the chart parsing question-answer pairs, and the chart summary question-answer pairs.
30. A fine-tuning device for a chart analysis model, comprising: A training sample acquisition module, used to acquire a plurality of chart analysis training samples; wherein the chart analysis training samples are constructed using the device according to any one of claims 27 to 29; The model fine-tuning module is used to fine-tune the large language model using the multiple graph parsing training samples to obtain a graph parsing model for implementing graph parsing.
31. The device according to claim 30, wherein The model fine-tuning module is specifically used for: Acquire a target chart parsing training sample currently being processed, and acquire a target chart image and at least one question-answer pair in the target chart parsing training sample, wherein the question-answer pair includes a fine-grained chart question-answer pair, a chart parsing question-answer pair, or a chart summary question-answer pair; Extracting visual features from the target chart image, and generating a first feature sequence from the extracted visual features; After performing word segmentation processing on the at least one question-answer pair, a second feature sequence is generated according to the word segmentation result; The first feature sequence and the second feature sequence are inputted into the large language model together to perform model fine-tuning on the large language model.
32. A chart parsing device, comprising: A to-be-parsed content input module, used for inputting a to-be-parsed chart image and at least one to-be-processed chart problem into a chart parsing model, wherein the chart parsing model is obtained by fine-tuning the device according to claim 30 or 31; The chart analysis answer acquisition module is used to obtain the chart analysis answer corresponding to the chart problem to be processed, which is fed back by the chart analysis model based on the chart image to be analyzed.
33. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for constructing graph structured data described in any one of claims 1-10, or execute the method for constructing graph parsing training samples described in any one of claims 11-13, or execute the method for fine-tuning the graph parsing model described in claim 14 or 15, or execute the graph parsing method described in claim 16.
34. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable a computer to execute a method for constructing graph structured data according to any one of claims 1 to 10, or a method for constructing graph parsing training samples according to any one of claims 11 to 13, or a method for fine-tuning a graph parsing model according to claim 14 or 15, or a graph parsing method according to claim 16.
35. A computer program product, comprising a computer program / instructions, which, when executed by a processor, implement the steps of the method for constructing graph structured data as described in any one of claims 1 to 10, or the steps of the method for constructing graph parsing training samples as described in any one of claims 11 to 13, or the steps of the method for fine-tuning the graph parsing model as described in claim 14 or 15, or the steps of the graph parsing method as described in claim 16.
Citation Information
Cited By
Data construction method and device, electronic equipment and storage medium
CN119829603A
A data construction method and device, electronic equipment and storage medium
CN119829603B
