Data processing method and device, electronic equipment and storage medium
Through the intelligent agent processing method, charts and analytical information are generated, which solves the problem in the existing technology that chart generation relies on programming skills, and improves the universality and ease of use of data visualization.
Patent Information
- Application Number
- CN202410830573.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-12-27
- Filing Date
- 2024-06-25
- Publication Date
- 2024-09-27
AI Technical Summary
Existing data visualization methods require users to have programming knowledge and understanding of drawing databases, resulting in chart generation relying on engineers' programming skills and mastery of drawing tools, lacking universality and ease of use.
Using an agent-based data processing method, it preprocesses by obtaining the user's tabulation instructions, generates application interface calling instructions, and calls external applications to generate charts and analyze information, reducing reliance on user programming skills.
It realizes that chart generation no longer relies on the user's programming skills and drawing tool usage skills, improves charting efficiency and ease of use, and enables users without chart development experience to generate target charts.
Smart Images

Figure CN118709668A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a data processing method, device, electronic device and storage medium based on an intelligent agent. Background Art
[0002] In the modern digital age, massive amounts of data are emerging in front of people, and there are more and more ways to process data visualization. The most common way is to create charts through programming languages (for example: Python) and related databases (for example: Matplotlib, Seaborn, etc.). However, this method requires users to have corresponding programming knowledge and have an in-depth understanding of the corresponding database. In other words, users must have relevant knowledge of at least one programming language and related drawing databases. Moreover, as people's requirements for data visualization become higher and higher, the predefined graph types and styles in the drawing databases mastered by users often cannot meet the needs. Even experienced developers need to spend a lot of time debugging the code to optimize the generated graphics, which makes the chart generation method too dependent on engineers' programming skills and mastery of drawing tools, lacking universality and ease of use. Summary of the invention
[0003] To this end, the present invention provides a data processing method, device, electronic device and storage medium, in an effort to solve or at least alleviate at least one of the above problems.
[0004] According to one aspect of the present invention, a data processing method is provided. The data processing method is implemented based on an agent (also called an intelligent agent), comprising:
[0005] Acquire a tabulation instruction of a user, wherein the tabulation instruction includes tabulation data and tabulation requirements;
[0006] performing a first preprocessing on the tabulated data;
[0007] Generate an application program interface calling instruction according to the first preprocessed tabulation data and the tabulation requirement, and call an application according to the application program interface calling instruction to generate a target output chart;
[0008] generating target analysis information according to the tabulated data and / or the target output chart after the first preprocessing;
[0009] The target output chart and the target analysis information are output to a user.
[0010] Optionally, in the data processing method according to the present invention, the first preprocessing of the tabulated data includes at least one of the following operations:
[0011] removing noise from the tabulated data;
[0012] Correcting typos in the tabulated data;
[0013] Repairing missing data in the tabulated data;
[0014] Deduplication of data in the tabulated data is performed.
[0015] Optionally, generating target parsing information according to the first preprocessed tabulated data includes:
[0016] Extracting key information from the first preprocessed tabulated data, the key information including attribute information and data information;
[0017] Generate target parsing information according to the key information.
[0018] Optionally, the agent is implemented based on a large language model.
[0019] Optionally, the process of implementing the agent based on the large language model includes:
[0020] Build an initial large language model;
[0021] Acquire a first training sample data set, wherein the training samples in the first training sample data set are text data, and train the initial large language model using the first training sample data set to obtain a pre-trained large language model;
[0022] Acquire a second training sample data set, where the second training sample data set includes sample data and labeled data, and fine-tune the pre-trained large language model using the second training sample data set to obtain a target large language model;
[0023] The agent is generated according to the target large language model.
[0024] Optionally, the first training sample data set is a very large-scale data set, and the training of the initial large language model by using the first training sample data set to obtain a pre-trained large language model includes:
[0025] Acquire a large amount of text data to form a first training sample data set;
[0026] Performing a second preprocessing on the data in the first training sample data set;
[0027] The initial large language model is trained using the first training sample data set after the second preprocessing until the initial large language model converges to obtain the pre-trained large language model.
[0028] Optionally, the obtaining a second training sample data set and fine-tuning the pre-trained large language model using the second training sample data set includes:
[0029] Acquire a second training sample data set, wherein the sample data in the second training sample data set includes a tabulated data sample and a tabulated requirement sample, and the annotated data in the second training sample data set includes first annotated data, second annotated data, and third annotated data, wherein the first annotated data is a standard data table corresponding to the tabulated data sample, the second annotated data is an application program interface corresponding to the sample data, and the third annotated data is an analysis result of the sample data;
[0030] Processing the training samples in the second training sample data set by the pre-trained large language model to obtain output labels;
[0031] The pre-trained large language model is fine-tuned according to a loss function between the output label and the annotated data until the pre-trained large language model converges to obtain a target large language model.
[0032] According to another aspect of the present invention, there is provided a data processing device, the data processing device being implemented based on an agent, the device comprising:
[0033] An instruction acquisition module, used for acquiring a user's tabulation instruction, wherein the tabulation instruction includes tabulation data and tabulation requirements;
[0034] A first processing module, used for performing a first preprocessing on the tabulated data;
[0035] A second processing module, used to generate an application program interface calling instruction according to the first pre-processed tabulation data and tabulation requirements, and generate a target output chart;
[0036] A third processing module, configured to generate target parsing information according to the tabulated data and / or the target output table after the first preprocessing;
[0037] The target data output module is used to output the target output chart and the target analysis information to the user.
[0038] According to another aspect of the present invention, there is provided an electronic device, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be suitable for execution by the at least one processor, and the program instructions include instructions for executing any of the methods described above.
[0039] According to another aspect of the present invention, a readable storage medium storing program instructions is provided. When the program instructions are read and executed by a computing device, the computing device executes any one of the methods described above.
[0040] According to the data processing method of the present invention, an intelligent agent generates charts according to data, generates application program interface calling instructions according to the user's tabulation instructions, and uses the tool integration function of the intelligent agent, that is, by generating application program interface calling instructions to call external applications to complete data processing tasks, not only can charts be generated (that is, target output charts), but also chart analysis information (that is, target analysis information) can be obtained, so that the task of generating charts according to data no longer depends on the user's programming skills and drawing tool usage skills, so that users who do not have any chart development experience can also obtain target charts through tabulation requirement prompts, saving users time in debugging codes when generating images, improving tabulation efficiency, and making tabulation tasks more universal and easy to use. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments recorded in the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings. The drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the drawings, the same reference numerals generally represent the same components or steps.
[0042] Figure 1 is a schematic block diagram of an electronic device 100 according to an embodiment of the present invention;
[0043] Figure 2 is a schematic flow chart of a data processing method 200 according to an embodiment of the present invention;
[0044] Figure 3 is a schematic flow chart of a target parsing information generation process 300 according to an embodiment of the present invention;
[0045] Figure 4 is a schematic flow chart of a method 400 for constructing an intelligent agent according to an embodiment of the present invention;
[0046] Figure 5 is a schematic diagram of a large language model training process 500 according to an embodiment of the present invention;
[0047] Figure 6 is a schematic diagram of a fine-tuning process 600 of a pre-trained large language model according to an embodiment of the present invention;
[0048] Figure 7 is a schematic block diagram of a data processing device 700 according to an embodiment of the present invention;
[0049] Figure 8 8 is a target output chart 800 generated by a data processing method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0051] The embodiments of the present application provide a data processing method, device, electronic device and storage medium, which can be applied to the field of chart generation technology. According to the technical solution of the embodiments of the present invention, based on the intelligent agent to generate charts according to data, an application program interface call instruction is generated according to the user's tabulation instruction, and with the help of the tool integration function of the intelligent agent, an external application is called by generating an application program interface call instruction to complete the data processing task, and a chart (i.e., a target output chart) and chart analysis information (i.e., target analysis information) are generated accordingly, so that the task of generating a chart according to the data no longer depends on the user's programming skills and drawing tool usage skills, so that users who do not have any chart development experience can also obtain the target chart through the tabulation requirement prompt, saving the user's time in debugging the code when generating the image, improving the tabulation efficiency, and making the tabulation task more universal and easy to use.
[0052] The data processing method provided in the embodiments of the present application can be applied to electronic devices with computing and processing capabilities, and the electronic devices can be mobile phones, tablet computers, desktop computers, laptop computers, servers, vehicle-mounted devices, netbooks, and augmented reality (AR) devices, virtual reality (VR) devices, smart speakers, artificial intelligence robots, etc. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic devices.
[0053] Figure 1 FIG. 1 is a schematic diagram showing the structure of an electronic device 100 according to an embodiment of the present invention. The electronic device can be used to implement the methods of various embodiments of the present invention. Figure 1 As shown, in a basic configuration 102, the electronic device 100 typically includes a memory 106 and one or more processors 104. A memory bus 108 may be used for communication between the processor 104 and the memory 106.
[0054] Depending on the desired configuration, the processor 104 may be any type of processor, including but not limited to: a microprocessor, a microcontroller, a digital signal processor (DSP), or any combination thereof. The processor 104 may include one or more levels of cache, such as a primary cache 110 and a secondary cache 112, a processor core 114, and registers 116. An example processor core 114 may include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core, or any combination thereof. In some implementations, the memory controller 118 may be a separate component used with the processor 104; in some other implementations, the memory controller 118 may be an internal component of the processor 104.
[0055] Depending on the desired configuration, the memory 106 can be any type of memory, including but not limited to: volatile memory (such as RAM, etc.), non-volatile memory (such as ROM, flash memory, etc.) or any combination thereof. The physical memory in the electronic device generally refers to the volatile memory RAM, and the data in the disk needs to be loaded into the physical memory before it can be read by the processor 104. The memory 106 can store an operating system 120 and one or more applications 122. In some embodiments, the application 122 can be arranged to execute instructions on the operating system by one or more processors 104. The operating system 120 can be, for example, Linux, Windows, Android, Hongmeng, Apple iOS, etc., which includes program instructions for processing basic system services and performing hardware-dependent tasks. The application 122 includes program instructions for implementing various user-desired functions. The application 122 can be, for example, a browser, game software, business software, office software, instant messaging software, software development tools (such as integrated development environment IDE, compiler, etc.), etc., but is not limited thereto. When the application 122 is installed in the electronic device 100, a driver module can be added to the operating system 120 if necessary.
[0056] When the electronic device 100 starts running, the processor 104 reads and executes the program instructions of the operating system 120 from the memory 106. The application 122 runs on the operating system 120 and uses the interface provided by the operating system 120 and the underlying hardware to implement various functions desired by the user. When the user starts the application 122, the processor 104 reads and executes the program instructions of the application 122 from the memory 106.
[0057] The electronic device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to the basic configuration 102 via the bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They can be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, voice input devices, touch input devices, handwriting input devices, etc.) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 158. Example communication devices 146 may include a network controller 160, which may be configured to facilitate communication with one or more other electronic devices via a network communication link via one or more communication ports 164.
[0058] A network communication link can be an example of a communication medium. Communication media can generally be embodied as computer-readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. As a non-limiting example, communication media can include wired media such as a wired network or a dedicated line network, and various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer-readable medium used herein can include both storage media and communication media.
[0059] In the electronic device 100 according to the present invention, the application 122 includes instructions for executing the data processing method of the present invention, and the instructions can instruct the processor 104 to execute the data processing method of the present invention.
[0060] It is to be understood that the structure shown in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include: Figure 1 More or fewer components are shown, or some components are combined, or some components are separated, or there are different component arrangements. The components shown can be implemented in hardware, software, firmware, or any combination of the three.
[0061] Below, based on the above-mentioned hardware involved in the embodiments of the present application, other embodiments of the present application will be described in detail in conjunction with the accompanying drawings.
[0062] Figure 2A schematic flow chart of a data processing method 200 according to an embodiment of the present invention is shown. The data processing method is implemented based on an agent. The agent is an artificial intelligence system that uses a large language model as its core computing engine to exhibit functions beyond text generation, including but not limited to conducting conversations, completing tasks, and reasoning. It can exhibit a certain degree of autonomous behavior, use the language capabilities of the large language model to understand instructions, contexts, and goals, can operate autonomously and semi-autonomously based on human prompts, can use a tool kit (calculator, API, search engine) to collect information and take actions to complete assigned tasks, can do logical reasoning type tasks, etc.
[0063] like Figure 2 As shown, the method may include the following steps:
[0064] Step S210, obtaining the user's tabulation instruction, wherein the tabulation instruction includes tabulation data and tabulation requirements. Tabulation data is the data that the user wants to use for drawing, which can be simple data information or an original table with data; the tabulation requirement describes the type and content of the chart that the user wants to make.
[0065] In a specific example, the user wants to analyze and visualize the given financial table data. The tabulation instruction (denoted as Q1) is: Please calculate the average trading volume of A shares. The data is as follows:
[0066]
[0067] For the convenience of describing the embodiment later, the above data is recorded as data D1.
[0068] In Q1, the tabulation requirement is "Please calculate the average trading volume of A shares", and the tabulation data is data D1.
[0069] Step S220: performing a first preprocessing on the tabulated data.
[0070] According to one embodiment of the present invention, the first preprocessing operation on the tabulated data includes but is not limited to: removing noise in the tabulated data, correcting typos in the tabulated data, repairing missing data in the tabulated data, deduplicating data in the tabulated data, and the like.
[0071] As shown in the data D1 in the above example, it can be seen that the data D1 is not a standard neat table data. For example, the text "Stock Trading Status" is useless data, that is, noise data, which will be deleted in this step. For another example, there is repeated data "A shares, 15:00, 115, 25000" in the D1 data. The first preprocessing process will deduplicate the repeated data.
[0072] The first preprocessing operations such as denoising, deduplication and repair are performed on the tabulated data to obtain clean and tidy tabular data, so as to make the mapping results more accurate.
[0073] In some specific implementations, step S220 may be omitted.
[0074] Step S230, generating an application program interface calling instruction according to the first preprocessed tabulation data and the tabulation requirement, and calling the application program according to the application program interface calling instruction to generate a target output chart.
[0075] In this embodiment, the called application is various feasible tabulation application, such as database application, etc. In addition, the application can also be various application programs that can perform mathematical operations and processing written by any external programmer.
[0076] A data processing method according to an embodiment of the present invention is implemented based on an agent. One of the most important functions of the agent is tool integration, that is, the assigned tasks can be completed by calling external tools. Continuing with the above-mentioned tabulation instruction Q1 as an example, a data processing method according to an embodiment of the present invention will generate a tabulation application program interface call (Application Programming Interface, API) instruction based on the tabulation requirements and the first pre-processed tabulation data, namely draw_bar(average_volume(stocks)), where stocks is the field name of the first column in the data. This interface call implements the task of calculating the average trading volume of each stock in each time period based on the first field and drawing a bar chart. The data analysis and tabulation tasks are completed through external database tools, and the generated charts will be returned through the interface, such as the bar chart generated in this example (see Figure 8 ), where STOCK_A is stock A, STOCK_B is stock B, and STOCK_C is stock C. The average trading volume of stock A is marked in the figure according to the tabulation requirements.
[0077] Obviously, the data processing method of this embodiment only describes the tabulation requirements through language, generates tabulation prompts, and achieves the tabulation goals. It mainly relies on the tool integration function of the intelligent body, generates API calls by parsing natural language instructions, and completes data analysis and mapping functions through external database tools, so that users can generate charts more conveniently, efficiently, accurately, and intelligently. It has universal applicability for users and no longer requires users to be able to write programs and use mapping tools proficiently.
[0078] Step S240, generating target analysis information according to the first preprocessed tabulated data and / or the target output chart.
[0079] In a specific example, target parsing information is generated according to the first preprocessed tabulated data, and step S240 may include: extracting attribute information and data information from the first preprocessed tabulated data; and generating target parsing information according to the attribute information and the data information.
[0080] Figure 3 A schematic flow chart of a target parsing information generation process 300 according to an embodiment of the present invention is shown. The process comprises the following steps:
[0081] Step S241, extracting key information from the first pre-processed tabulated data, the key information including but not limited to attribute information and data information.
[0082] Taking the above-mentioned indicator instruction Q1 as an example, according to the tabulated data after the first preprocessing, key information is obtained, including attribute information, that is, each field, "stock", "time", "stock price" and "trading volume", and data information in the data table, that is, data information of each stock in each row of data records,
[0083] Step S242, generating target analysis information based on key information. This includes discovering data patterns, predicting possible trends, etc. based on the key information obtained, and generating target analysis information so that users can gain an in-depth understanding of the original data while viewing the chart. Continuing with the above Q1, the target analysis information generated based on the key information obtained from D1 after the first preprocessing is as follows:
[0084] The table you provided shows the stock prices and trading volumes of three stocks (A, B, and C) at specific points in time. Here is a brief analysis of the data:
[0085] A shares:
[0086] The stock price rose from 100 at 12:00 to 120 at 16:00, an increase of 20%.
[0087] The trading volume was 10,000 at 12:00 and increased to 30,000 at 16:00, almost doubling. This may indicate that the market's interest or activity in A-shares is increasing.
[0088] B shares:
[0089] The stock price rose from 200 at 12:00 to 225 at 16:00, an increase of 12.5%.
[0090] The trading volume was 5,000 at 12:00 and increased to 9,000 at 16:00, an increase of nearly 100%. This may indicate that the market's interest or activity in B shares is also increasing.
[0091] C shares:
[0092] The stock price was 300 at 12:00, but dropped to 256 at 14:37, a drop of 15.3%.
[0093] The trading volume was 3000 at 12:00, and then increased to 6000 at 14:37. This may indicate that some investors chose to buy the bottom during the decline of C shares.
[0094] In this embodiment, step S230 and step S240 are executed in series. According to another embodiment of the present invention, step S230 and step S240 may be executed in parallel.
[0095] Step S250: Output the target output chart and target analysis information to the user.
[0096] In the Q1 example, the target output chart ( Figure 8 ) and the target resolution information presented above are output to the user.
[0097] A data processing method according to an embodiment of the present invention is implemented based on an agent. Figure 4 A schematic flow chart of a method 400 for constructing an intelligent agent according to an embodiment of the present invention is shown. The method comprises the following steps:
[0098] Step S410: construct an initial large language model.
[0099] In the field of artificial intelligence technology, a large model refers to a deep neural network model with a large number of parameters (for example, hundreds of millions of parameters). Among them, a large language model is a deep learning model that is trained with a large amount of text data and can process natural language (for example, generate natural language text or understand the meaning of language text, etc.). The large language model can process text, images, sounds and other data. The training text data used in the training of the large language model usually corresponds to at least one natural language task. Therefore, the trained large language model has good natural language processing capabilities and can realize functions such as generating natural language text or understanding language text. The large language model has a wide range of application scenarios, including but not limited to chatbots, language translation, content creation, etc.
[0100] Different types of models can be used to build large language models, such as recurrent neural networks (RNN), long short-term memory networks (LSTM), Transformers, etc. The choice and configuration of the model affect the performance and effect of the model. Different model architectures and parameters will lead to different computational complexities and generalization capabilities. Different model training methods will lead to different data utilization and task adaptability. In a specific example, a large language model is built using the Transformer network architecture. The Transformer model is mainly composed of an encoder and a decoder, where the encoder converts the input text sequence into a set of vectors, and the decoder converts the encoder output vector into a target text sequence. The entire process is implemented through a multi-head self-attention mechanism, which enables the model to capture long-term dependencies and contextual information in the input text.
[0101] Specifically, the Transformer model uses a multi-head self-attention mechanism to encode and decode the input text. The core idea is to establish dependencies between sequences through the self-attention mechanism, which can solve long-term dependencies in text sequences and generate flow and coherent text. In the encoder, each input word will specify its position information through position encoding, and then the attention weight of each word to other words is calculated through the multi-head self-attention mechanism, and finally the representation vector of each word is obtained. In the decoder, the model uses the vector output by the encoder to predict the next word, and also uses the multi-head self-attention mechanism to capture contextual information. In addition to the multi-head self-attention mechanism, the Transformer model also uses residual connections and layer normalization techniques to enhance the performance and stability of the model.
[0102] Step S420: Obtain a first training sample data set, and train an initial large language model using the first training sample data set to obtain a pre-trained large language model.
[0103] Figure 5 A schematic diagram of a training process 500 of a large language model according to an embodiment of the present invention is shown. It includes:
[0104] Step S421, obtaining a large amount of text data to form a first training sample data set.
[0105] The first training sample data set is text data, which is a very large data set. The first training sample data set can be obtained by crawling news, social media data, or professional academic papers on the Internet, or by purchasing data, sharing data, etc.
[0106] Step S422: performing second preprocessing on the data in the first training sample data set.
[0107] Exemplarily, the second preprocessing operations include, but are not limited to, cleaning, denoising, deduplication, processing missing data, removing special characters, and the like.
[0108] Among them, step S422 can also be omitted.
[0109] Step S423, training the initial large language model using the first training sample data set after the second preprocessing until the initial large language model converges to obtain a pre-trained large language model.
[0110] In a specific example, the training of a large language model is carried out through masked language modeling, which is a very effective self-supervised training method. The core idea of masked language modeling is to randomly select a certain proportion of tokens in the input sequence and replace them with special masked tokens. During the model training process, the model needs to predict the actual content of the masked tokens based on the previous tokens. This method allows the model to learn the global representation of the sentence during training, thereby improving the performance of the model.
[0111] When the large language model converges, the pre-trained large language model will learn rich language knowledge and semantic representations, be able to generate coherent and meaningful text, and understand various complex contexts and concepts.
[0112] Step S430: Obtain a second training sample data set, and fine-tune the pre-trained large language model using the second training sample data set to obtain a target large language model.
[0113] In a specific example, the second training sample data set includes sample data and labeled data.
[0114] By fine-tuning the model to adapt it to the needs of a specific task, the basic principle is to perform secondary supervised training on a large language model using a small amount of task-specific data.
[0115] Figure 6 A schematic diagram of a fine-tuning process 600 of a pre-trained large language model according to an embodiment of the present invention is shown. In this embodiment, a multi-task joint training method is used for fine-tuning, and the process includes the following steps:
[0116] Step S431, obtain a second training sample data set, the second training sample data set includes sample data and annotation data, wherein the sample data includes a tabulation data sample and a tabulation requirement sample, and the annotation data includes first annotation data, second annotation data and third annotation data, wherein the first annotation data is a standard data table corresponding to the tabulation data sample, the second annotation data is an application program interface corresponding to the sample data, and the third annotation data is an analysis result of the sample data.
[0117] The first labeled data is the data after denoising, correction, repair, deduplication, etc. of the data in the tabulated data sample. In a specific example, as shown in Sample 1 in Table 1, it can be seen that the data of 50 years old contains two, and the corresponding first labeled data has the duplicate data removed, the second labeled data is the interface that needs to be called to process the data, and the third labeled data is the analysis result based on the first labeled data.
[0118] Table 1
[0119]
[0120]
[0121] Step S432: Process the training samples in the second training sample data set by the pre-trained large language model to obtain output labels. The output labels include a standard data table corresponding to the tabulated data sample, a corresponding application program interface, and an analysis result of the sample data.
[0122] Step S433, fine-tuning the pre-trained large language model according to the loss function between the output label and the labeled data until the pre-trained large language model converges to obtain a target large language model. The loss function may be a cross entropy loss function or a mean loss function, which is not limited in the present invention.
[0123] According to another embodiment of the present invention, step S430 fine-tunes the pre-trained large language model through the second training sample data set to obtain the target large language model. The process can be performed by multi-task separate training. Different tasks are trained through different training subsets. Each training subset has a labeled data. For example, the first training subset includes sample data and first labeled data, which are used for the data preprocessing capability of the training model; the second training subset includes sample data and second labeled data, which are used for the training model to generate application program interface call instructions; the third training subset includes sample data (the first labeled data can be used as the sample data in this training set) and third labeled data, which are used for the training model to analyze sample data. The pre-trained large language model is trained according to the three training subsets to obtain the target large language model.
[0124] Step S440, constructing an intelligent agent based on the target large language model.
[0125] During the specific implementation, the required intelligent agents and large language models are imported through code.
[0126] An intelligent agent is an artificial intelligence system that uses a large language model as its core computing engine. In addition to the text generation function, it can also have a certain degree of autonomous behavior, including dialogue, reasoning, task completion, etc. The composition of an intelligent agent based on a large language model includes a large language model, a task planning module, a memory module, and an external tool call module.
[0127] The task planning module mainly relies on the powerful task processing capabilities of the large language model to decompose complex tasks into multiple simple subtasks, and then solve each subtask one by one. At the same time, a series of feedback is introduced in the task planning-execution process to improve the goals of each task. This module gives the agent the ability to solve complex tasks through the large language model.
[0128] The memory module is usually responsible for storing historical information and additional external knowledge during the operation of the agent, providing assistance for the task planning of the large language model and improving the accuracy of the operation of the entire agent environment. According to the type, it can be generally divided into short-term memory and long-term memory. Short-term memory can be achieved by prompt injection or calling temporary historical information. Long-term memory usually requires the use of an external vector database for storage and rapid retrieval. Therefore, through the engineering implementation of memory reading and storage, it is possible to use short-term or long-term memory to improve the relevant capabilities of large language models and agents.
[0129] The external tool calling module completes the planned tasks by using external tools. As the hands and feet of the agent, it directly interacts with the real world and provides important execution feedback information for the large language model. By encapsulating the available tools as application interface calls, the agent can have the ability to access and use various models, databases, web applications and other external tools.
[0130] Figure 7 A schematic block diagram of a data processing device 700 according to an embodiment of the present invention is shown, which includes an instruction acquisition module 710 , a first processing module 720 , a second processing module 730 , a third processing module 740 , and a target data output module 750 .
[0131] The instruction acquisition module 710 is used to acquire the user's tabulation instruction, and the tabulation instruction includes tabulation data and tabulation requirements.
[0132] The first processing module 720 is used to perform a first preprocessing on the tabulated data.
[0133] The second processing module 730 is used to generate an application program interface calling instruction according to the first pre-processed tabulation data and tabulation requirements, and call an application according to the application program interface calling instruction to generate a target output chart.
[0134] The third processing module 740 is used to generate target parsing information according to the tabulated data after the first preprocessing and the target output chart.
[0135] The target data output module 750 is used to output the target output chart and target analysis information to the user.
[0136] In one example, the user tabulation instruction obtained by the instruction acquisition module has a tabulation requirement of "I want to see a line graph showing the change of the global average temperature between 2000 and 2020", and the tabulation data is provided, which is the global average temperature between 2000 and 2020. First, the tabulation data is pre-processed by the first processing module to organize the tabulation data into standard table data, and then the second processing module generates an application program interface call instruction according to the tabulation data after the first pre-processing and the tabulation requirement, draw_line_chart(data='gl oba l_temperature', start_year=2000, end_year=2020 to draw a chart to generate a target output chart, and complete the task of drawing a line chart by calling an external tool. At the same time, the third module generates target parsing information according to the tabulation requirements and the first preprocessed tabulation data, and finally, the target data output module is used to output the target output chart and the target parsing information to the user. Among them, the second processing module and the third processing module can perform data processing simultaneously or sequentially in the processing program. The former is adopted in this embodiment, that is, the second processing module and the third processing module are performed simultaneously in the processing program to save data processing time. It is also within the protection scope of the present invention that the second processing module and the third processing module perform data processing sequentially.
[0137] In another example, the user gives a data table and a custom table requirement "Please draw a pie chart of the age distribution of China's population in the past ten years". The intelligent agent parses the relevant data and generates an interface call instruction draw_pi e_chart (data = 'cn_population_age_d istribution', years = 10) according to the user's requirements.
[0138] In another embodiment, the user provides financial data of stock price trends and makes a request, "Please draw a line graph showing the stock price trends of Apple Inc. over the past ten years." The intelligent agent parses the data and instructions to generate the corresponding API call, p lt.pl ot(app l e_stock_pr ices), and then the API call is executed to generate the required chart.
[0139] The data processing device 700 of the embodiment of the present invention can be composed of Figure 1The electronic device 100 shown runs program instructions to implement and execute various steps in the data processing method according to the embodiment of the present invention.
[0140] According to an exemplary embodiment of the present invention, an electronic device is provided. The electronic device may include at least one processor and at least one memory. The memory stores program codes for implementing the corresponding steps in the data processing method according to the embodiment of the present invention. The processor is used to run the program codes stored in the memory to execute the corresponding steps of the data processing method according to the embodiment of the present invention, and to implement the various modules in the data processing device according to the embodiment of the present invention. The electronic device may adopt the aforementioned Figure 1 The electronic devices in the illustrated embodiments and any other suitable electronic devices.
[0141] In one embodiment, when the program code is executed by a processor, the following steps are performed:
[0142] Acquire a tabulation instruction of a user, wherein the tabulation instruction includes tabulation data and tabulation requirements;
[0143] performing a first preprocessing on the tabulated data;
[0144] Generate an application program interface calling instruction according to the first preprocessed tabulation data and the tabulation requirement, and call an application according to the application program interface calling instruction to generate a target output chart;
[0145] generating target analysis information according to the tabulated data after the first preprocessing and the target output chart;
[0146] The target output chart and the target analysis information are output to a user.
[0147] In addition, when the program code is executed by the processor, other steps of the data processing method are also executed.
[0148] In addition, according to another embodiment of the present invention, a computer-readable storage medium is also provided, on which program instructions are stored, and when the program instructions are run by a computer or a processor, they are used to perform the corresponding steps of the data processing method of the embodiment of the present invention, and are used to implement the corresponding modules in the data processing device according to the embodiment of the present invention. The storage medium may include, for example, a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disk read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. The computer-readable storage medium may be any combination of one or more computer-readable storage media.
[0149] In one embodiment, the computer program instructions can implement various functional modules of the data processing device according to the embodiment of the present invention when executed by a computer, and / or can execute the data processing method according to the embodiment of the present invention.
[0150] In one embodiment, the computer program instructions, when executed by a computer, perform the following steps: obtaining a user's tabulation instruction, wherein the tabulation instruction includes tabulation data and tabulation requirements;
[0151] Acquire a tabulation instruction of a user, wherein the tabulation instruction includes tabulation data and tabulation requirements;
[0152] performing a first preprocessing on the tabulated data;
[0153] Generate an application program interface calling instruction according to the first preprocessed tabulation data and the tabulation requirement, and call an application according to the application program interface calling instruction to generate a target output chart;
[0154] generating target analysis information according to the tabulated data after the first preprocessing and the target output chart;
[0155] The target output chart and the target analysis information are output to a user.
[0156] In addition, the computer program instructions also execute other steps of the data processing method when executed by the computer.
[0157] Each module of the data processing device according to an embodiment of the present invention can be implemented by a processor of an electronic device according to an embodiment of the present invention running computer program instructions stored in a memory, or can be implemented when computer instructions stored in a computer-readable storage medium according to an embodiment of the present invention are executed by a computer.
[0158] According to the data processing method and device, electronic device and storage medium of the embodiments of the present invention, by generating charts according to data based on an intelligent agent, generating application interface calling instructions according to the user's tabulation instructions, and using the tool integration function of the intelligent agent, that is, calling external applications by generating application interface calling instructions to complete data processing tasks, not only can charts (i.e., target output charts) be generated, but also chart parsing information (i.e., target parsing information) can be obtained, so that the task of generating charts according to data no longer depends on the user's programming skills and drawing tool usage skills, so that users who do not have any chart development experience can also obtain the target chart through tabulation requirement prompts, saving the user's time in debugging code when generating images, improving tabulation efficiency, and making tabulation tasks more universal and easy to use.
[0159] Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above example embodiments are merely exemplary and are not intended to limit the scope of the present invention thereto. Various changes and modifications may be made therein by one of ordinary skill in the art without departing from the scope and spirit of the present invention. All such changes and modifications are intended to be included within the scope of the present invention as required by the appended claims.
[0160] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0161] The various techniques described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method, apparatus, and device of the present invention, or some aspects or portions of the method, apparatus, and device of the present invention may be in the form of program codes (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.
[0162] In the case where the program code is executed on a programmable computer, the electronic device generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store the program code; the processor is configured to execute the remote assistance method of the present invention according to the instructions in the program code stored in the memory.
[0163] By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program modules or other data. Communication media generally embody computer-readable instructions, data structures, program modules or other data in modulated data signals such as carrier waves or other transmission mechanisms, and include any information transmission medium. Any combination of the above is also included in the scope of readable media. In the specification of the present application, algorithms and displays are not inherently related to any specific computer, virtual system or other device. Various general systems can also be used with the examples of the present invention. According to the above description, it is obvious to construct the structure required for such systems. In addition, the present invention is not directed to any specific programming language. It should be understood that various programming languages can be used to implement the software and algorithm-related content of the present invention described herein, and the description of the specific language above is only to disclose some specific embodiments of the present invention, but not to limit the use of the specific language.
[0164] In the specification of the application, a lot of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this specification.
[0165] In the several embodiments provided in this application, it should be understood that the disclosed devices, equipment and methods can be implemented in other ways. For example, the above-described device and equipment embodiments are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
[0166] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0167] Similarly, it should be understood that in order to streamline the present invention and help understand one or more of the various inventive aspects, in the description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, the method of the present invention should not be interpreted as reflecting the following intention: the claimed invention requires more features than the features explicitly stated in each claim. More specifically, as reflected in the corresponding claims, the inventive point is that the corresponding technical problem can be solved with less than all the features of a single disclosed embodiment. Therefore, the claims following the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present invention.
[0168] It will be understood by those skilled in the art that, except for mutually exclusive features, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this specification may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature that provides the same, equivalent or similar purpose.
[0169] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.
[0170] The components in the various embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that computers, servers, microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some modules in the equipment and devices according to embodiments of the present invention. The present invention can also be implemented as a device program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0171] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. Nouns such as "comprise", "include", "have" do not exclude the presence of elements or steps not listed in the claims. The quantifier "one" or "a" preceding an element does not exclude the presence of multiple such elements. The present invention can be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order, and these words may be interpreted as names.
[0172] In addition, in the embodiments of the present application, the expression "and / or" includes any and all combinations of the associated listed words. For example, the expression "A and / or B" may include A, may include B, or may include both A and B. Words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more.
[0173] In the description of the embodiments of the present application, when a component is referred to as being "connected" or "accessed" to other components, it should be understood that: the component is not only directly connected to or accessed to other components, but also another component may exist between the component and the other components. On the other hand, when a component is referred to as being "directly connected" or "directly accessed" to other components, it should be understood that there is no component between them. When a component is referred to as being "movably connected" to other components, it means that the positional relationship between the component and the other components is changeable, such as the relationship between a slide rail and a slider, the slider can slide on the slide rail, and the slide rail and the track are movably connected. When a component is referred to as being "fixedly connected" to other components, it means that the positional relationship between the component and the other components after being assembled together is relatively fixed.
[0174] The above is only a specific embodiment of the present invention or an explanation of a specific embodiment. The protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Although the present application is described according to a limited number of embodiments, it is understood by the technicians in the technical field that other embodiments can be envisioned within the scope of the present application described thereby, thanks to the above description. In addition, it should be noted that the language used in this specification is mainly selected for the purpose of readability and teaching, rather than for explaining or limiting the subject matter of the present application. Therefore, without departing from the scope and spirit of the attached claims, many modifications and changes are obvious to ordinary technicians in the technical field. For the scope of the present application, the disclosure made in the present application is illustrative, not restrictive, and the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A data processing method, characterized in that: The data processing method is implemented based on an intelligent agent, and the method comprises: Acquire a tabulation instruction of a user, wherein the tabulation instruction includes tabulation data and tabulation requirements; performing a first preprocessing on the tabulated data; Generate an application program interface calling instruction according to the first preprocessed tabulation data and the tabulation requirement, and call an application according to the application program interface calling instruction to generate a target output chart; generating target analysis information according to the tabulated data and / or the target output chart after the first preprocessing; The target output chart and the target analysis information are output to a user.
2. The method according to claim 1, characterized in that The first preprocessing of the tabulated data includes at least one of the following operations: removing noise from the tabulated data; Correcting typos in the tabulated data; Repairing missing data in the tabulated data; Deduplication of data in the tabulated data is performed.
3. The method according to claim 1, characterized in that The generating target parsing information according to the first preprocessed tabulated data includes: Extracting key information from the first preprocessed tabulated data, the key information including attribute information and data information; Generate target parsing information according to the key information.
4. The method according to any one of claims 1 to 3, characterized in that The agent is implemented based on a large language model.
5. The method according to claim 4, characterized in that The process of implementing the agent based on the large language model includes: Build an initial large language model; Acquire a first training sample data set, wherein the training samples in the first training sample data set are text data, and train the initial large language model using the first training sample data set to obtain a pre-trained large language model; Acquire a second training sample data set, where the second training sample data set includes sample data and labeled data, and fine-tune the pre-trained large language model using the second training sample data set to obtain a target large language model; Based on the target large language model, the intelligent agent is constructed.
6. The method according to claim 5, characterized in that The first training sample data set is an ultra-large-scale data set, and the initial large language model is trained by using the first training sample data set to obtain a pre-trained large language model, including: Acquire a large amount of text data to form a first training sample data set; Performing a second preprocessing on the data in the first training sample data set; The initial large language model is trained using the first training sample data set after the second preprocessing until the initial large language model converges to obtain the pre-trained large language model.
7. The method according to claim 5, characterized in that The step of obtaining a second training sample data set and fine-tuning the pre-trained large language model using the second training sample data set includes: Acquire a second training sample data set, wherein the sample data in the second training sample data set includes a tabulated data sample and a tabulated requirement sample, and the annotated data in the second training sample data set includes first annotated data, second annotated data, and third annotated data, wherein the first annotated data is a standard data table corresponding to the tabulated data sample, the second annotated data is an application program interface corresponding to the sample data, and the third annotated data is an analysis result of the sample data; Processing the training samples in the second training sample data set by the pre-trained large language model to obtain output labels; The pre-trained large language model is fine-tuned according to a loss function between the output label and the annotated data until the pre-trained large language model converges to obtain a target large language model.
8. A data processing device, characterized in that: The data processing device is implemented based on an agent, and the device comprises: An instruction acquisition module, used for acquiring a user's tabulation instruction, wherein the tabulation instruction includes tabulation data and tabulation requirements; A first processing module, used for performing a first preprocessing on the tabulated data; A second processing module, configured to generate an application program interface calling instruction according to the first preprocessed tabulation data and the tabulation requirement, and to call an application according to the application program interface calling instruction to generate a target output chart; A third processing module, configured to generate target parsing information according to the tabulated data after the first preprocessing and / or the target output chart; The target data output module is used to output the target output chart and the target analysis information to the user.
9. An electronic device, comprising: at least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the method according to any one of claims 1 to 7.
10. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, the computing device executes the method according to any one of claims 1 to 7.
