Data visualization method and device based on large model, electronic equipment and medium
By extracting structured data from text data and using a large language model to automatically determine chart configuration parameters, the problem of low data visualization efficiency in the existing technology is solved, efficient and automated chart generation is achieved, and user operation complexity is reduced.
Patent Information
- Application Number
- CN202410804765.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-09-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing data visualization tools require a lot of manual input and configuration when generating charts, making them inefficient, time-consuming, and error-prone.
By extracting structured data from the text data to be visualized, the large language model is used to automatically determine the configuration parameters of the chart, thereby generating charts and improving the efficiency and automation of data visualization.
Users only need to specify the text data to be visualized to complete data visualization, which greatly reduces the complexity of user operations, avoids errors caused by improper manual settings, and improves the efficiency and automation of data visualization.
Smart Images

Figure CN118643091A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to technical fields such as AIGC (artificial intelligence generated content), large language models, and deep learning, and specifically to a data visualization method and device based on a large model, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] 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, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0003] A large language model (LLM, also known as a large language model or large model) is a deep learning model trained using a large amount of text data, which can realize the understanding and generation of natural language text.
[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention
[0005] The present disclosure provides a data visualization method and device based on a large model, an electronic device, a computer-readable storage medium, and a computer program product.
[0006] According to one aspect of the present disclosure, a data visualization method based on a large model is provided, including: extracting structured data from text data to be visualized; based on the structured data, determining first configuration parameters of a first chart for displaying the text data; and generating the first chart based on the first configuration parameters.
[0007] According to one aspect of the present disclosure, a data visualization device based on a large model is provided, including: an extraction module, configured to extract structured data from text data to be visualized; a first determination module, configured to determine first configuration parameters of a first chart for displaying the text data based on the structured data; and a first generation module, configured to generate the first chart based on the first configuration parameters.
[0008] According to one aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and 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 performs the above method.
[0009] According to one 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 the above method.
[0010] According to one aspect of the present disclosure, a computer program product is provided, comprising computer program instructions, which implement the above method when executed by a processor.
[0011] According to one or more embodiments of the present disclosure, the efficiency of data visualization can be improved.
[0012] 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
[0013] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0014] Figure 1 A schematic diagram showing an exemplary system in which various methods described herein may be implemented according to an embodiment of the present disclosure;
[0015] Figure 2 A flowchart of a data visualization method based on a large model according to an embodiment of the present disclosure is shown;
[0016] Figure 3 A schematic diagram showing a data visualization process based on a large model according to an embodiment of the present disclosure;
[0017] Figure 4 A structural block diagram of a data visualization device based on a large model according to an embodiment of the present disclosure is shown; and
[0018] Figure 5 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0019] 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 of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0020] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.
[0021] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations. "Multiple" refers to two or more.
[0022] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are all subject to the provisions of relevant laws and regulations and do not violate public order and good morals.
[0023] A chart is a graphic structure that can intuitively display the attributes of statistical information (time, quantity, etc.), and plays a key role in knowledge mining and intuitive and vivid perception of information. A chart is a means of data visualization that can display data intuitively and vividly. Common chart types include scatter plots, line graphs, bar graphs, pie charts, heat maps, etc.
[0024] In the related art, data visualization tools (such as spreadsheet editing tools, presentation editing tools, etc.) are usually used to visualize data into charts. In existing data visualization tools, the chart generation process requires users to perform a lot of manual input and configuration, such as manually setting the chart type, title, scale, legend, etc., which results in low efficiency, time-consuming, and error-prone data visualization.
[0025] In view of the above problems, an embodiment of the present disclosure provides a data visualization method. The method extracts structured data from text data, determines the configuration parameters of a chart based on the structured data, and then generates a chart, thereby improving the efficiency and automation of data visualization. According to an embodiment of the present disclosure, a user only needs to specify the text data to be visualized to complete data visualization, which greatly reduces the complexity of user operations and avoids errors caused by improper user settings.
[0026] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0027] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
[0028] In an embodiment of the present disclosure, the client devices 101 , 102 , 103 , 104 , 105 , and 106 and the server 120 may run one or more services or software applications that enable the data visualization method to be performed.
[0029] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.
[0030] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
[0031] Client devices 101, 102, 103, 104, 105, and / or 106 may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.
[0032] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, vehicle-mounted devices, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems; or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.
[0033] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, Wi-Fi), and / or any combination of these and / or other networks.
[0034] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0035] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0036] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.
[0037] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.
[0038] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.
[0039] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.
[0040] Figure 1 The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.
[0041] According to some embodiments, the user may specify the text data to be visualized through the client devices 101-106. The client devices 101-106 or the server 120 may visualize the text data specified by the user into a chart by executing the data visualization method of the embodiment of the present disclosure.
[0042] Figure 2 2 shows a flow chart of a data visualization method 200 based on a large model according to an embodiment of the present disclosure. The execution subject of the method 200 may be a server, for example Figure 1 The server 120 shown in FIG. 1 may also be a client device, such as Figure 1 Client devices 101-106 are shown in FIG.
[0043] like Figure 2 As shown, method 200 includes steps S210 - S230 .
[0044] In step S210 , structured data is extracted from text data to be visualized.
[0045] In step S220 , first configuration parameters of a first chart for displaying text data are determined based on the structured data.
[0046] In step S230 , a first chart is generated based on the first configuration parameters.
[0047] According to the embodiments of the present disclosure, structured data is extracted from text data, and the configuration parameters of the chart are determined based on the structured data, thereby generating a chart, thereby improving the efficiency and automation of data visualization. In the embodiments of the present disclosure, the user only needs to specify the text data to be visualized to complete the data visualization, which greatly reduces the complexity of the user's operation and avoids errors caused by improper manual settings by the user.
[0048] The following is a detailed description of each step of method 200.
[0049] According to some embodiments, the text data to be visualized in step S210 is specified by the user. There are many ways for the user to specify the text data. For example, the user can input or upload the text data through an interactive interface (such as a text box, a button, etc.), or the user can select a text segment from the currently displayed text (such as a web page text, a local document, etc.) as the text data.
[0050] Structured data refers to data that follows certain data format rules. Structured data can be represented by a two-dimensional table structure, for example. Each row of the two-dimensional table can represent a data record; each column can represent a field that describes an attribute of the data. Structured data can also be represented as key-value pairs. Each key-value pair represents a field that describes an attribute of the data, where the key is the field name and the value is the field value.
[0051] In contrast to structured data, unstructured data refers to irregular data. Unstructured data has no predefined data model and is not convenient to represent using regular structures such as two-dimensional tables and key-value pairs.
[0052] It should be noted that the text data to be visualized can be structured data, such as table text; or it can be unstructured data, such as natural language text.
[0053] In step S210, structured data is extracted from the text data to be visualized, so that no matter whether the text data is originally structured data or unstructured data, it is represented as structured data.
[0054] In step S210 , a large language model may be used to extract structured data from text data to be visualized.
[0055] According to some embodiments, step S210 may include steps S211 - S213 .
[0056] In step S211 , a first prompt template for extracting structured data is obtained.
[0057] In step S212, first prompt information is generated based on the text data and the first prompt template.
[0058] In step S213, the first prompt information is input into the large language model to obtain structured data output by the large language model.
[0059] According to the above embodiment, the language understanding and generation capabilities of a large language model are used to automatically extract structured data, thereby improving the efficiency and accuracy of data extraction.
[0060] The large language model can be obtained by pre-training using a large amount of unlabeled natural language corpus through autoregressive unsupervised training. The number of model parameters of the large language model can reach tens of billions, hundreds of billions or even higher. According to some embodiments, the large language model can adopt a decoder structure (Decoder-Only). The large language model of the decoder structure only includes a decoder (Decoder) in a transformer (Transformer) structure, but does not include an encoder (Encoder). The large language model of the decoder structure usually has good performance in text generation tasks. According to other embodiments, the large language model can also adopt a transformer structure including an encoder and a decoder.
[0061] In step S211, the first prompt template may be preset, which is used to guide the large language model to extract structured data. The first prompt template may include, for example, task description information and slots to be filled. The task description information is used to describe the text processing task of extracting structured data, thereby guiding the large language model to extract structured data. The slots to be filled are used to fill the text objects of the structured data to be extracted, that is, the above-mentioned text data to be visualized.
[0062] For example, the first prompt template may be "You are a data extraction expert. Please extract key information from "_" to form table data. The table data includes the field name and field value of the data field." In the first prompt template, "_" is the slot to be filled, and the other characters are task description information.
[0063] In step S212, the text data is filled into the slot of the first prompt template to obtain the first prompt information.
[0064] In step S213, the first prompt information is input into the large language model to obtain structured data output by the large language model.
[0065] For example, if the text data is "Company A's turnover in 2001, 2002, and 2003 was a1, a2, and a3, respectively, all exceeding Company B's turnover in the same period b1, b2, and b3". The extracted structured data can be the following two-dimensional table:
[0066] Company Name Sales in 2001 Sales in 2002 Turnover in 2003 A a1 a2 a3 B b1 b2 b3
[0067] In step S220 , first configuration parameters of a first chart for displaying text data are determined based on the structured data.
[0068] According to some embodiments, the first configuration parameters include the type and drawing parameters of the first chart. Accordingly, step S220 may include steps S221-S223.
[0069] In step S221 , the type of the first chart is determined based on the structured data.
[0070] In step S222, at least one drawing parameter to be configured for the chart of this type is obtained.
[0071] In step S223 , a value of at least one rendering parameter is determined based on the structured data.
[0072] According to the above embodiment, the most suitable chart type for displaying text data can be automatically determined, and the values of the drawing parameters required for the chart type can be determined, thereby improving the efficiency of chart configuration.
[0073] According to some embodiments, in step S220 , a large language model may be used to determine first configuration parameters of a first graph for presenting text data based on structured data.
[0074] According to some embodiments, the structured data includes a field name and a field value of at least one field. Accordingly, in step S221, the type of the first graph may be determined using a large language model based at least on the field name of the at least one field.
[0075] Specifically, a second prompt template for determining the chart type can be obtained. The second prompt template can be, for example, "You are a chart drawing expert. Please determine which of the following chart types is most suitable for displaying "_": scatter plot, line chart, bar chart, heat map...". In the first prompt template, "_" is the slot to be filled, which is used to fill in the field name or all structured data in the structured data, and the other characters are task description information. Fill the field name or all structured data in the structured data into the slot of the second prompt template to obtain the second prompt information. Input the second prompt information into the large language model to obtain the type of the first chart output by the large language model.
[0076] In step S223 , the value of at least one drawing parameter may be determined using a large language model based on at least one of the field name of at least one field and the field value of at least one field.
[0077] Drawing parameters refer to the parameters used to draw a chart. It is understood that different types of charts have different drawing parameters. For example, for a line chart, the drawing parameters include the title of the chart, the field, size, and unit corresponding to the x-axis, the field, size, and unit corresponding to the y-axis, the color and line type of each line, etc. For a pie chart, the drawing parameters include the title of the chart, the displayed field, the color of the pie area corresponding to different values under the field, etc.
[0078] According to some embodiments, a third prompt template for determining drawing parameters may be obtained. It should be noted that different drawing parameters may adopt different third prompt templates. The same third prompt template may be used to determine one drawing parameter, or may be used to determine multiple third drawing parameters. For example, the third prompt template may be "You are a line chart drawing expert, please determine the parameter information of the x-axis and y-axis of the line chart from the following data: "_"". Among them, "_" is the slot to be filled, which is used to fill in the field name, field value or all structured data in the structured data, and the other characters are task description information. The third prompt information is obtained by filling the field name and / or field value into the slot of the third prompt template. The third prompt information is input into the large language model to obtain the value of the drawing parameter of the first chart output by the large language model.
[0079] According to the above embodiment, the semantic content of each field is fully understood by using a large language model and the parameters of the chart are configured, so that the efficiency and accuracy of the chart parameter configuration can be improved.
[0080] In step S230 , a first chart is generated based on the first configuration parameters.
[0081] According to some embodiments, step S230 may include steps S231 and S232.
[0082] In step S231 , a chart generation model is called based on a first configuration parameter, wherein the first configuration parameter is an input of the chart generation model.
[0083] In step S232, a first graph generated by the graph generation model is obtained.
[0084] According to the above embodiment, by calling the graph generation model to generate a graph, the graph generation capability of the external model can be reused, thereby achieving dynamic and flexible capability expansion of the large language model.
[0085] According to some embodiments, the chart generation model may be implemented as an interface, wherein the first configuration parameter is a call parameter of the interface. The chart generation model may be, for example, ECharts, Kibana, etc.
[0086] According to some embodiments, the method 200 further includes step S240: outputting the first chart via a graphical interface. The graphical interface may be, for example, a pop-up window.
[0087] According to the above embodiment, displaying the generated first chart through an additional graphical interface (such as a pop-up window) can improve the clarity of data expression and avoid the first chart from adversely affecting the content displayed on the current screen (such as a web page, office document, etc.).
[0088] According to some embodiments, the visual style information of the graphical interface may be automatically generated in step S220 as the first configuration parameter of the first chart, thereby improving the visual appeal of the first chart.
[0089] The visual style information of the graphical interface includes, for example, the display size of the graphical interface, the display position on the screen, the foreground color, the background color, etc.
[0090] According to some embodiments, in step S220, the visual style information of the graphical interface may be determined using the large language model. Specifically, a fourth prompt template for determining the visual style information of the graphical interface may be obtained. Part or all of the structured data is filled into the slot of the fourth prompt template to obtain fourth prompt information. The fourth prompt information is input into the large language model to obtain the visual style information of the graphical interface output by the large language model.
[0091] According to some embodiments, method 200 further includes: in response to a user's selection operation on a text fragment in the currently displayed text, the text fragment is used as text data to be visualized. Accordingly, in step S220, the visual style information of the graphical interface can be determined based on the above-mentioned structured data and the context of the above-mentioned text fragment. It can be understood that the context of the text fragment refers to a certain number of characters in the currently displayed text that are located before and / or after the text fragment. For example, the currently displayed text includes 5 sentences, and the user selects the 3rd sentence as the text data to be visualized. The 2nd and 4th sentences can be used as the context of the text data.
[0092] The currently displayed text may be, for example, text in a web page. The user may select a text segment in the web page text through an interactive operation, and the text segment selected by the user is used as text data to be visualized.
[0093] For example, a user can select a text segment (i.e., a text segment) in a webpage text by dragging the mouse. By clicking the right button of the mouse, an action menu for the text is displayed. The action menu includes a series of executable actions for the text, including copying, saving as, printing, grammar checking, generating charts, etc. By clicking "Generate Chart" in the action menu, a data visualization request is initiated, and the text selected by the user is used as the text data to be visualized.
[0094] Corresponding to the text data being a text segment selected by the user, in step S220 , visual style information of the graphical interface may be determined based on the structured data and the context of the text segment.
[0095] According to the above embodiment, the user can select a text segment from the text currently browsed for visualization. The visual style information of the graphical interface used to display the visualization result (i.e., the first chart) is determined according to the context of the text segment, thereby enabling the display effect of the first chart to match the display effect of the current text, thereby improving the visual appeal of the first chart and the clarity of data expression.
[0096] According to some embodiments, a fifth prompt template for determining visual style information of a graphical interface may be obtained. Part or all of the structured data and the context of the text segment are filled into the slot of the fifth prompt template to obtain fifth prompt information. The fifth prompt information is input into the large language model to obtain visual style information of the graphical interface output by the large language model.
[0097] According to some embodiments, method 200 may further include steps S250 - S270 .
[0098] In step S250, a user's editing instruction for the first chart is obtained.
[0099] In step S260 , second configuration parameters of the edited second chart are determined based on the structured data and the editing instruction.
[0100] In step S270 , a second graph is generated based on the second configuration parameters.
[0101] According to the above embodiment, the user can edit the generated chart in real time and dynamically through interactive operations, thereby improving the efficiency and flexibility of chart editing.
[0102] According to some embodiments, the generated second chart may be output to the graphical interface where the first chart is located, covering the originally generated first chart. That is, the second chart and the first chart are displayed through the same graphical interface.
[0103] According to some other embodiments, the generated second chart may be output to a graphical interface different from the graphical interface where the first chart is located, that is, the second chart and the first chart are displayed through different graphical interfaces.
[0104] According to some embodiments, step S250 may include steps S251 and S252.
[0105] In step S251, in response to the user's target operation on the graphical interface (such as long pressing or double clicking on the area where the first chart is located or the background area of the graphical interface), a dialogue interface is output in the graphical interface. The dialogue interface may be, for example, a text input box, a voice recording button, or the like.
[0106] In step S252, the editing instruction input by the user in the dialogue interface is obtained. The editing instruction may be a natural language instruction expressing the chart editing requirement input by the user through text input or voice input, such as "add comparison line", "change color theme", etc.
[0107] According to the above embodiment, the user can express the editing demand through dialogue, which simplifies the user's operation and improves the efficiency and flexibility of demand expression.
[0108] According to some embodiments, in step S60, the large language model may be used to generate the second configuration parameters of the second chart. Specifically, a sixth prompt template for editing the chart may be obtained. Part or all of the structured data and the user's editing instructions are filled into the slots of the sixth prompt template to generate sixth prompt information. The sixth prompt information is input into the large language model to obtain the second configuration parameters of the edited second chart output by the large language model.
[0109] In step S270, based on the second configuration parameters, a second chart is generated. The second chart is the editing result of the first chart. The specific implementation of step S270 is similar to the above-mentioned step S230, which will not be repeated here.
[0110] According to some embodiments, method 200 further includes steps S280 and S290.
[0111] In step S280, the user's analysis instruction for the first chart is obtained.
[0112] In step S290 , an analysis result of the first graph is generated based on the structured data and the analysis instruction.
[0113] According to the above embodiment, on the basis of generating the first chart, the first chart may be further analyzed to obtain analysis results, thereby improving the comprehensibility and practicality of the data and providing support for the user's decision-making.
[0114] According to some embodiments, in step S280, in response to the user's interactive operation on the graphical interface (such as long pressing, double clicking, etc. on the area where the first chart is located or on the background area of the graphical interface), a chart analysis control is output in the graphical interface. The chart analysis control can be, for example, a dialogue interface such as a text input box and a voice recording button, or a button for triggering chart analysis. In the case where the chart analysis control is a dialogue interface, the user can input a natural language instruction expressing the chart analysis requirement (for example, "Please help me analyze the data trend") through the dialogue interface as an analysis instruction for the first chart. In the case where the chart analysis control is a button for triggering chart analysis, when the user clicks the button, it is considered that the user has issued an analysis instruction for the first chart.
[0115] According to some embodiments, in step S290, the analysis result of the first chart can be generated using the large language model. Specifically, a seventh prompt template for performing chart analysis can be obtained. Part or all of the structured data and the analysis instructions are filled into the slots of the seventh prompt template to generate seventh prompt information. The seventh prompt information is input into the large language model to obtain the analysis result of the first chart output by the large language model. Further, the analysis result of the first chart can be output to a graphical interface.
[0116] The analysis results of the first chart may include, for example, data trends and patterns in the first chart, key data points, recommended action plans, etc. For example, the first chart may be a line chart of the turnover of Company A in different years, and the analysis results of the first chart may include the upward and downward trends of the turnover of Company A, as well as the future business strategies recommended for Company A, etc.
[0117] It should be noted that the above-mentioned embodiments of chart editing (steps S250-S270) and chart analysis (steps S280-S290) can be combined. For example, the user can first edit the first chart to obtain the edited second chart; then analyze the second chart to obtain the analysis results of the second chart. Alternatively, the user can first analyze the first chart to obtain the analysis results of the first chart; then edit the first chart to obtain the edited second chart. Alternatively, the user can input natural language instructions that express both chart editing requirements and chart analysis requirements into the dialogue interface (for example, "Please change the color theme and analyze the data trend"), thereby obtaining the edited second chart and the analysis results of the second chart at the same time.
[0118] Figure 3 FIG. 3 is a schematic diagram showing a data visualization process 300 according to an embodiment of the present disclosure. Figure 3 As shown, process 300 includes steps S310-S360.
[0119] In step S310, the large language model 302 is used to extract structured data from the text data 301, determine the most suitable chart type for displaying the text data 301, and determine the color scheme of the display window of the chart (ie, the graphical interface above).
[0120] In step S320 , the large language model 330 is used to map each field of the structured data to each drawing parameter of the chart type, thereby determining the value of each drawing parameter of the chart.
[0121] Step S320 can automatically complete complex field mapping tasks and map each field to the most suitable chart drawing parameters, thereby reducing errors and optimizing the information transmission efficiency of data display, ensuring that each part of the data can be effectively expressed in the chart, and improving the information value and readability of the chart.
[0122] In step S340 , the determined chart type, color scheme and drawing parameters are used as configuration parameters of the chart, and the chart generation model 303 is called to complete the generation of a visualization chart (ie, the first chart mentioned above).
[0123] In step S350, the large language model 302 is used to perform interactive chart editing to determine the configuration parameters of the edited chart. Based on the configuration parameters, step S340 is executed to call the chart generation model 303 to update the original chart to obtain an updated chart (corresponding to the second chart above).
[0124] In step S360, the large language model 302 is used to perform data insight and chart analysis on the chart to generate a data analysis result of the chart. Based on the data analysis result, step S340 is executed to call the chart generation model 303 to update the display window where the original chart is located, so as to display the chart and the data analysis result of the chart in the display window.
[0125] According to the embodiments of the present disclosure, a comprehensive and easy-to-operate data visualization tool based on a large language model is provided, which significantly improves the automation level of chart generation and the flexibility of user interaction. The embodiments of the present disclosure are particularly suitable for business and office scenarios that require fast and accurate display of complex data insights.
[0126] According to an embodiment of the present disclosure, a data visualization device based on a large model is also provided. Figure 4 FIG. 4 shows a structural block diagram of a data visualization device 400 according to an embodiment of the present disclosure. Figure 4 As shown, the apparatus 400 includes an extraction module 410 , a first determination module 420 and a first generation module 430 .
[0127] The extraction module 410 is configured to extract structured data from text data to be visualized.
[0128] The first determination module 420 is configured to determine, based on the structured data, a first configuration parameter of a first chart for displaying the text data.
[0129] The first generating module 430 is configured to generate the first chart based on the first configuration parameters.
[0130] According to the embodiments of the present disclosure, structured data is extracted from text data, and the configuration parameters of the chart are determined based on the structured data, thereby generating a chart, thereby improving the efficiency and automation of data visualization. In the embodiments of the present disclosure, the user only needs to specify the text data to be visualized to complete the data visualization, which greatly reduces the complexity of the user's operation and avoids errors caused by improper manual settings by the user.
[0131] According to some embodiments, the extraction module includes: a first acquisition unit, configured to acquire a first prompt template for extracting the structured data; a generation unit, configured to generate first prompt information based on the text data and the first prompt template; and an input unit, configured to input the first prompt information into a large language model to obtain the structured data output by the large language model.
[0132] According to some embodiments, the first configuration parameters include the type and drawing parameters of the first chart, and wherein the first determination module includes: a first determination unit, configured to determine the type of the first chart based on the structured data; a second acquisition unit, configured to acquire at least one drawing parameter to be configured for the type of chart; and a second determination unit, configured to determine the respective value of the at least one drawing parameter based on the structured data.
[0133] According to some embodiments, the structured data includes a field name and a field value of at least one field, and the first determination unit is further configured to: determine the type of the first chart using a large language model based at least on the field name of the at least one field; the second determination unit is further configured to: determine the value of the at least one drawing parameter using a large language model based on at least one of the field name of the at least one field and the field value of the at least one field.
[0134] According to some embodiments, the first generation module includes: a calling unit configured to call a chart generation model based on the first configuration parameter, wherein the first configuration parameter is an input to the chart generation model; and a third acquisition unit configured to acquire the first chart generated by the chart generation model.
[0135] According to some embodiments, the apparatus 400 further includes: an output module configured to output the first chart via a graphical interface, wherein the first configuration parameter includes visual style information of the graphical interface.
[0136] According to some embodiments, the device 400 also includes: a second determination module, configured to respond to a user's selection operation on a text fragment in the currently displayed text, and use the text fragment as the text data to be visualized, wherein the first configuration module is further configured to: determine the visual style information of the graphical interface based on the structured data and the context of the text fragment.
[0137] According to some embodiments, the device 400 also includes: a first acquisition module, configured to acquire the user's editing instructions for the first chart; a third determination module, configured to determine the second configuration parameters of the edited second chart based on the structured data and the editing instructions; and a second generation module, configured to generate the second chart based on the second configuration parameters.
[0138] According to some embodiments, the first chart is output through a graphical interface, and wherein the first acquisition module includes: an output unit configured to output a dialogue interface in the graphical interface in response to a user's target operation on the graphical interface; and a fourth acquisition unit configured to acquire the editing instruction input by the user in the dialogue interface.
[0139] According to some embodiments, the apparatus 400 further includes: a second acquisition module configured to acquire a user's analysis instruction for the first chart; and a third generation module configured to generate an analysis result of the first chart based on the structured data and the analysis instruction.
[0140] It should be understood that Figure 4 The various modules and units of the apparatus 400 shown in FIG. 4 can be compared with those of the reference Figure 2 The steps in the method 200 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 200 are also applicable to the device 400 and the modules and units included therein. For the sake of brevity, some operations, features and advantages are not repeated here.
[0141] Although specific functionality is discussed above with reference to specific modules, it should be noted that the functionality of the various modules discussed herein may be separated into multiple modules, and / or at least some functionality of multiple modules may be combined into a single module.
[0142] It should also be understood that various techniques may be described herein in the general context of software hardware elements or program modules. Figure 4The various units described can be implemented in hardware or in hardware in combination with software and / or firmware. For example, these units can be implemented as computer program codes / instructions, which are configured to be executed in one or more processors and stored in a computer-readable storage medium. Alternatively, these units can be implemented as hardware logic / circuits. For example, in some embodiments, one or more of modules 410-430 can be implemented together in a system on chip (System on Chip, SoC). SoC can include an integrated circuit chip (which includes a processor (e.g., a central processing unit (CPU), a microcontroller, a microprocessor, a digital signal processor (DSP), etc.), a memory, one or more communication interfaces, and / or one or more components in other circuits), and can optionally execute the received program code and / or include embedded firmware to perform functions.
[0143] According to an embodiment of the present disclosure, there is also provided an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor so that the at least one processor executes the data visualization method of the embodiment of the present disclosure.
[0144] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided. The computer instructions are used to enable a computer to execute the data visualization method of the embodiment of the present disclosure.
[0145] According to an embodiment of the present disclosure, a computer program product is also provided, including computer program instructions, which implement the data visualization method of the embodiment of the present disclosure when executed by a processor.
[0146] refer to Figure 5 , a block diagram of an electronic device 500 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, 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 assistants, 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.
[0147] like Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0148] Multiple components in the electronic device 500 are connected to the I / O interface 505, including: an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. The input unit 506 can be any type of device that can input information to the electronic device 500. The input unit 506 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 507 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 508 can include but is not limited to a disk, an optical disk. The communication unit 509 allows the electronic device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, an 802.11 device, a Wi-Fi device, a WiMAX device, a cellular communication device, and / or the like.
[0149] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 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 501 performs the various methods and processes described above, such as method 200. For example, in some embodiments, the method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the method 200 in any other appropriate manner (e.g., by means of firmware).
[0150] 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.
[0151] 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.
[0152] 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.
[0153] 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).
[0154] The systems and techniques described herein can be implemented in a computing system that includes backend 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 frontend 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 backend components, middleware components, or frontend components. The components of the system can 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), the Internet, and a blockchain network.
[0155] 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 of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0156] 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 described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0157] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present disclosure is not limited by these embodiments or examples, but is only limited by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples may be omitted or replaced by their equivalent elements. In addition, each step may be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples may be combined in various ways. It is important that with the evolution of technology, many of the elements described herein may be replaced by equivalent elements that appear after the present disclosure.
Claims
1. A data visualization method based on a large model, comprising: Extract structured data from text data to be visualized; Based on the structured data, determining first configuration parameters of a first chart for displaying the text data; as well as Based on the first configuration parameters, the first graph is generated.
2. The method according to claim 1, wherein: The step of extracting structured data from text data to be visualized includes: Obtaining a first prompt template for extracting the structured data; generating first prompt information based on the text data and the first prompt template; and The first prompt information is input into a large language model to obtain the structured data output by the large language model.
3. The method according to claim 1 or 2, wherein: The first configuration parameters include the type and drawing parameters of the first chart, and wherein determining the first configuration parameters of the first chart for displaying the text data based on the structured data includes: Based on the structured data, determining a type of the first chart; Obtaining at least one drawing parameter to be configured for a chart of the type; and Based on the structured data, a value of each of the at least one rendering parameter is determined.
4. The method according to claim 3, wherein: The structured data includes a field name and a field value of at least one field. The determining the type of the first chart based on the structured data includes: determining the type of the first chart using a large language model based at least on a field name of each of the at least one field; Determining the respective values of the at least one drawing parameter based on the structured data includes: determining the respective values of the at least one drawing parameter using a large language model based on at least one of the respective field name of the at least one field and the respective field value of the at least one field.
5. The method according to any one of claims 1 to 4, wherein: The generating the first chart based on the first configuration parameter comprises: Based on the first configuration parameter, calling a chart generation model, wherein the first configuration parameter is an input to the chart generation model; and The first chart generated by the chart generation model is obtained.
6. The method according to any one of claims 1 to 5, further comprising: The first chart is outputted through a graphical interface, wherein the first configuration parameter includes visual style information of the graphical interface.
7. The method according to claim 6, further comprising: In response to a user's selection operation on a text segment in the currently displayed text, the text segment is used as the text data to be visualized, Wherein, determining the first configuration parameter of the first chart for displaying the text data based on the structured data includes: determining the visual style information of the graphical interface based on the context of the structured data and the text segment.
8. The method according to any one of claims 1 to 7, further comprising: Obtaining a user's editing instruction for the first chart; Determining second configuration parameters of the edited second chart based on the structured data and the editing instruction; as well as Based on the second configuration parameters, the second graph is generated.
9. The method according to claim 8, wherein: The first chart is output through a graphical interface, and wherein obtaining a user's editing instruction for the first chart includes: In response to a target operation of the graphical interface by a user, outputting a dialog interface in the graphical interface; and The editing instruction input by the user in the dialogue interface is obtained.
10. The method according to any one of claims 1 to 9, further comprising: Obtaining a user's analysis instruction for the first chart; as well as An analysis result of the first chart is generated based on the structured data and the analysis instruction.
11. A data visualization device based on a large model, comprising: an extraction module configured to extract structured data from text data to be visualized; A first determination module is configured to determine, based on the structured data, a first configuration parameter of a first chart for displaying the text data; as well as The first generating module is configured to generate the first chart based on the first configuration parameters.
12. The device according to claim 11, wherein The extraction module comprises: A first acquisition unit is configured to acquire a first prompt template for extracting the structured data; a generating unit configured to generate first prompt information based on the text data and the first prompt template; and The input unit is configured to input the first prompt information into a large language model to obtain the structured data output by the large language model.
13. The device according to claim 11 or 12, wherein: The first configuration parameters include the type and drawing parameters of the first chart, and wherein the first determination module includes: A first determining unit, configured to determine a type of the first chart based on the structured data; A second acquisition unit is configured to acquire at least one drawing parameter to be configured for the type of chart; and The second determining unit is configured to determine a value of each of the at least one rendering parameters based on the structured data.
14. The device according to claim 13, wherein: The structured data includes a field name and a field value of at least one field. The first determining unit is further configured to: determine the type of the first graph using a large language model based at least on the field name of each of the at least one field; The second determining unit is further configured to determine the value of the at least one drawing parameter using a large language model based on at least one of a field name of the at least one field and a field value of the at least one field.
15. The device according to any one of claims 11 to 14, wherein: The first generation module comprises: a calling unit configured to call a chart generation model based on the first configuration parameter, wherein the first configuration parameter is an input of the chart generation model; and A third acquisition unit is configured to acquire the first chart generated by the chart generation model.
16. The apparatus according to any one of claims 11 to 15, further comprising: The output module is configured to output the first chart through a graphical interface, wherein the first configuration parameter includes visual style information of the graphical interface.
17. The apparatus according to claim 16, further comprising: The second determining module is configured to respond to a user's selection operation on a text segment in the currently displayed text and use the text segment as the text data to be visualized. The first configuration module is further configured to determine visual style information of the graphical interface based on the context of the structured data and the text segment.
18. The apparatus according to any one of claims 11 to 17, further comprising: A first acquisition module is configured to acquire a user's editing instruction for the first chart; A third determining module is configured to determine a second configuration parameter of the edited second chart based on the structured data and the editing instruction; as well as The second generating module is configured to generate the second chart based on the second configuration parameters.
19. The device according to claim 18, wherein The first chart is output through a graphical interface, and wherein the first acquisition module comprises: an output unit configured to output a dialog interface in the graphic interface in response to a target operation of the user on the graphic interface; and The fourth acquisition unit is configured to acquire the editing instruction input by the user in the dialogue interface.
20. The apparatus according to any one of claims 11 to 19, further comprising: A second acquisition module is configured to acquire a user's analysis instruction for the first chart; as well as The third generating module is configured to generate an analysis result of the first chart based on the structured data and the analysis instruction.
21. An electronic device, comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.
22. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-10.
23. A computer program product comprising computer program instructions, wherein: The computer program instructions implement the method of any one of claims 1-10 when executed by a processor.
Citation Information
Cited By
Data visualization method and device, medium and equipment
CN119226385A
Object generation method and device based on large model, intelligent agent, equipment and medium
CN119228946A
Answer content processing method and device, equipment, medium and program product
CN119849466A
Economic statistical data visualization method based on large model
CN120596564A
Table editing processing method and device, electronic equipment and storage medium
CN120805873A
