Data analysis method and device, computer equipment and storage medium
Through multiple rounds of conversations and intention recognition technology, the language model is used to generate task parameters suitable for the data analysis platform, solving the problem of low analysis accuracy caused by scattered information in the intelligent assistant, and achieving efficient and accurate data analysis.
Patent Information
- Application Number
- CN202410170143.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-05
- Publication Date
- 2025-08-08
AI Technical Summary
During the data analysis process, existing intelligent assistants have low accuracy in the analysis results due to scattered and incomplete information.
By calling the first language model to conduct multiple rounds of conversations with the target object, identifying the intent and generating preset format task parameters, and transmitting them to the data analysis platform for analysis.
An automated data analysis process is realized, which improves the efficiency and accuracy of analysis and ensures the full expression and integrity of analysis requirements.
Smart Images

Figure CN120448478A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of artificial intelligence and data analysis, and in particular to a data analysis method, apparatus, computer equipment, storage medium, and computer program product. Background Art
[0002] The advent of the big data era has brought with it the accumulation and distributed storage of large-scale, complex, and diverse data, making data analysis extremely important. Simultaneously, with the rapid development of artificial intelligence and machine learning technologies, various intelligent assistants (such as chatbots and voice assistants) have gradually entered people's lives and work. Users can communicate their needs to intelligent assistants through natural language, and intelligent assistants use natural language processing (NLP) technology to provide users with services such as information query, task execution, question answering, and data analysis.
[0003] In related technologies, when interacting with intelligent assistants, they typically communicate with users through pre-designed dialogue to obtain information about their needs. This approach requires users to have a certain level of knowledge in the field they are consulting. Otherwise, the communication process often results in fragmented and incomplete information. Data analysis based on fragmented and incomplete information can lead to low accuracy due to incorrect intent identification. Summary of the Invention
[0004] Based on this, it is necessary to provide a data analysis method, device, computer equipment, computer-readable storage medium and computer program product that can improve analysis accuracy in response to the above technical problems.
[0005] In one aspect, the present application provides a data analysis method. The method comprises:
[0006] Call the first language model to conduct multiple rounds of conversations with the target object around the analysis task;
[0007] performing intent recognition based on the multiple rounds of conversations to obtain task description content according to the multiple rounds of conversations;
[0008] Calling the second language model to rewrite the task description content to obtain task parameters in a preset format;
[0009] The task parameters are transmitted to the data analysis platform to instruct the data analysis platform to perform the analysis task based on the task parameters to obtain data analysis results.
[0010] On the other hand, the present application also provides a data analysis device. The device includes:
[0011] A conversation module is used to call a first language model to conduct multiple rounds of conversations with the target object around the analysis task; the first language model is obtained by training a large language model using corpus within a preset business domain;
[0012] an identification module, configured to perform intent recognition based on the multiple rounds of conversations to obtain task description content according to the multiple rounds of conversations;
[0013] A rewriting module is configured to call a second language model to rewrite the task description content to obtain task parameters in a preset format; the second language model is obtained by training a large language model with task description samples within a preset business domain;
[0014] The analysis module is used to transmit the task parameters to the data analysis platform to instruct the data analysis platform to perform the analysis task based on the task parameters to obtain data analysis results.
[0015] In another aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0016] Calling the first language model to conduct multiple rounds of conversations with the target object around the analysis task; the first language model is obtained by training the large language model using corpus within a preset business domain;
[0017] performing intent recognition based on the multiple rounds of conversations to obtain task description content according to the multiple rounds of conversations;
[0018] Calling a second language model to rewrite the task description content to obtain task parameters in a preset format; the second language model is obtained by training a large language model with task description samples in a preset business domain;
[0019] The task parameters are transmitted to the data analysis platform to instruct the data analysis platform to perform the analysis task based on the task parameters to obtain data analysis results.
[0020] On the other hand, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0021] Calling the first language model to conduct multiple rounds of conversations with the target object around the analysis task; the first language model is obtained by training the large language model using corpus within a preset business domain;
[0022] performing intent recognition based on the multiple rounds of conversations to obtain task description content according to the multiple rounds of conversations;
[0023] Calling a second language model to rewrite the task description content to obtain task parameters in a preset format; the second language model is obtained by training a large language model with task description samples in a preset business domain;
[0024] The task parameters are transmitted to the data analysis platform to instruct the data analysis platform to perform the analysis task based on the task parameters to obtain data analysis results.
[0025] On the other hand, the present application also provides a computer program product. The computer program product includes a computer program, which, when executed by a processor, implements the following steps:
[0026] Calling the first language model to conduct multiple rounds of conversations with the target object around the analysis task; the first language model is obtained by training the large language model using corpus within a preset business domain;
[0027] performing intent recognition based on the multiple rounds of conversations to obtain task description content according to the multiple rounds of conversations;
[0028] Calling a second language model to rewrite the task description content to obtain task parameters in a preset format; the second language model is obtained by training a large language model with task description samples in a preset business domain;
[0029] The task parameters are transmitted to the data analysis platform to instruct the data analysis platform to perform the analysis task based on the task parameters to obtain data analysis results.
[0030] The above-mentioned data analysis method, apparatus, computer equipment, storage medium and computer program product call the first language model to conduct a conversation with the target object, and can use the knowledge learned by the first language model in the preset business field to guide the target object to fully express the analysis requirements. Then, based on multiple rounds of conversations around the analysis task, the information associated with the analysis intention is automatically completed, so that the complete task description content can be automatically obtained. Then, through the second language model with rewriting ability, the task description content is automatically rewritten to obtain task parameters suitable for the data analysis platform, so as to automatically perform data analysis through the data analysis platform and obtain analysis results. The entire process realizes the automated processing of analysis needs through multiple rounds of conversation guidance, information completion, automatic generation and rewriting of task descriptions, and automated data analysis, thereby improving the efficiency and accuracy of data analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 A diagram of an application environment of a data analysis method in one embodiment;
[0032] Figure 21 is a flow chart of a data analysis method according to an embodiment;
[0033] Figure 3A This is an example diagram of the description content of a multi-round conversation conversion task in one embodiment;
[0034] Figure 3B This is an example diagram of the description content of a multi-round conversation conversion task in another embodiment;
[0035] Figure 4A This is an example diagram of rewriting task description content into task parameters in one embodiment;
[0036] Figure 4B An example diagram of rewriting task description content into task parameters in another embodiment
[0037] Figure 5 1. A schematic flow chart of a method for guiding a multi-round conversation in one embodiment;
[0038] Figure 6 A flowchart of a method for obtaining task description content based on multiple rounds of conversations in one embodiment;
[0039] Figure 7 A flowchart of a method for outputting task parameters in a preset format in one embodiment;
[0040] Figure 8 is an example diagram of a task parameter group in one embodiment;
[0041] Figure 9 A schematic diagram of the structure of a large language model for a preset business domain in one embodiment;
[0042] Figure 10 1 is a flow chart of a method for training a first language model in one embodiment;
[0043] Figure 11 1 is a flow chart of a method for obtaining a first training corpus in one embodiment;
[0044] Figure 12 1 is a flow chart of a method for training a first language model in one embodiment;
[0045] Figure 13A A flowchart of a data analysis method in the risk control field in one embodiment;
[0046] Figure 13B This is a flow chart of a data analysis method in the risk control field in another embodiment;
[0047] Figure 13C Schematic diagram of a data analysis method based on LLM1 and LLM2 in one embodiment;
[0048] Figure 14 is a structural block diagram of a data analysis device in one embodiment;
[0049] Figure 15 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0051] This application relates to artificial intelligence (AI) technology. AI refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI is the study of the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0052] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, pre-trained models, operating / interaction systems, and mechatronics. Pre-trained models, also known as large models or basic models, can be fine-tuned and widely applied to downstream tasks across various AI disciplines. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0053] This application mainly involves machine learning (ML) and natural language processing (NLP). Machine learning is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning. Pre-trained models and large language models are the latest developments in deep learning, integrating the above technologies.
[0054] Natural language processing (NLP) is a key area of research in computer science and artificial intelligence. It studies the theories and methods that enable effective communication between humans and computers using natural language. Natural language processing (NLP) integrates linguistics, computer science, and mathematics. Research in this field involves natural language—the language we use in everyday life—and is closely related to linguistics, yet also differs significantly. Natural language processing (NLP) is not simply the study of natural language in general, but rather the development of computer systems, particularly software systems, that can effectively implement natural language communication. As such, it is a component of computer science, with applications primarily in machine translation, automatic summarization, opinion extraction, text classification, question answering, text semantic comparison, and speech recognition.
[0055] Large language models (LLMs) are deep learning models trained using large amounts of text data. They can generate natural language text or understand the meaning of text. Large language models can handle a variety of natural language tasks, such as text classification, question-answering, and conversational conversation, and are a key path to artificial intelligence. They are designed to understand and generate human language. Trained on large amounts of text data, they can perform a wide range of tasks, including text summarization, translation, and sentiment analysis. Large language models are characterized by their massive size, containing billions of parameters, which help them learn complex patterns in language data. These models are often based on deep learning architectures, such as transformers, which contribute to their impressive performance on various natural language processing tasks. Pre-trained models, a key technology for model training in the field of artificial intelligence, are derived from large language models in the field of natural language processing. After fine-tuning, large language models can be widely applied to downstream tasks.
[0056] The data analysis method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. The data storage system can store data that server 104 needs to process. The data storage system can be integrated on server 104, or placed on a cloud or other network server. The data analysis method provided in this application can be executed collaboratively by the terminal and server, or by the terminal or server alone.
[0057] In some embodiments, the data analysis method provided by the embodiments of the present application can be performed by Figure 1 The server execution shown, for example: the terminal sends a data analysis request for the analysis task to the server, the data analysis request carries at least part of the information for the analysis task, the server calls the first language model to conduct multiple rounds of conversations with the target object around the analysis task; performs intent recognition based on the multiple rounds of conversations to obtain task description content based on the multiple rounds of conversations; calls the second language model to rewrite the task description content to obtain task parameters in a preset format; transmits the task parameters to the data analysis platform to instruct the data analysis platform to execute the analysis task based on the task parameters to obtain data analysis results.
[0058] In some embodiments, the data analysis method provided in the embodiments of the present application can also be performed by Figure 1 The terminal shown executes, and the terminal is deployed with a first language model and a second language model. In response to the user's trigger instruction for the analysis task, the first language model is called to conduct multiple rounds of conversations with the target object around the analysis task; intention recognition is performed based on the multiple rounds of conversations to obtain task description content based on the multiple rounds of conversations; the second language model is called to rewrite the task description content to obtain task parameters in a preset format; the task parameters are transmitted to the data analysis platform to instruct the data analysis platform to execute the analysis task based on the task parameters, obtain data analysis results, and display the data analysis results.
[0059] In some embodiments, the terminal may be, but is not limited to, one or more of various desktop computers, laptops, smartphones, tablets, IoT devices, portable wearable devices, or immersive image display devices. IoT devices may be one or more of smart speakers, smart TVs, smart air conditioners, or smart in-vehicle devices. Portable wearable devices may be one or more of smart watches, smart bracelets, or head-mounted devices. Immersive image display devices include, but are not limited to, augmented reality (AR) devices and virtual reality (VR) devices. For example, the terminal may be an all-in-one VR (virtual reality) device. A VR all-in-one device is a virtual reality head-mounted display device with an independent processor. A VR all-in-one device has independent computing, input, and output capabilities, and does not require connection to an additional device such as a PC (personal computer) to provide computing power.
[0060] In some embodiments, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0061] In some embodiments, the embodiments of the present application can be implemented with the help of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or local area network to realize data calculation, storage, processing, and sharing.
[0062] Cloud technology is a general term for network, information, integration, management platform, and application technologies used in the cloud computing business model. It can form a resource pool that can be used flexibly and conveniently on demand. Cloud computing technology will become a key support. The backend services of technical network systems require a large amount of computing and storage resources.
[0063] In some embodiments, as Figure 2 As shown, a data analysis method is provided, which is applied to a computer device (the computer device can be specifically Figure 1 The terminal or server in FIG) is taken as an example to illustrate, including the following steps 202 to 210. Among them:
[0064] Step 202 : Calling a first language model to conduct multiple rounds of conversations with the target object around the analysis task. The first language model is obtained by training a large language model using corpus in a preset business domain.
[0065] The first language model is a large language model capable of multi-round conversations. It is an artificial intelligence model generated by fine-tuning the large language model using a computer device based on domain knowledge corpus within a pre-set business domain, using a pre-set parameter tuning method. The analysis task is the task of analyzing data from a pre-set business domain by the target subject. The pre-set business domain is the business domain to which the analysis task belongs, and can include at least healthcare, laws and regulations, education, finance, insurance, and risk control.
[0066] In some embodiments, for a preset business domain, a computer device acquires a first language model applicable to the preset business domain, receives an analysis task (generally a data analysis task) from a target subject for the preset business domain, and then invokes the first language model to engage in a conversation with the target subject. During the conversation, the computer device leverages the knowledge learned by the first language model within the preset business domain to guide the target subject through multiple rounds of conversation around the current analysis task, thereby helping the target subject fully express their analysis needs. These multiple rounds of conversation are conducted between the first language model (which can be referred to as an AI robot) and the target subject (generally a user) around the analysis task. These multiple rounds of conversation include descriptive text for all the preset elements required for the analysis task, as well as the key data required for the analysis task corresponding to the preset elements.
[0067] In some embodiments, the computer device constructs prompt information for input into the first language model based on the natural language input information of the target object, thereby instructing the first language model to output corresponding response information according to the prompt information. If the first language model has not obtained the description text of all the preset elements required for the analysis task, the computer device continues to the next round of conversation until the computer device obtains the description text of all the preset elements required for the analysis task.
[0068] For example, taking the preset business field as the risk control field, the analysis task T is "analyze the refund risk of game A deployed in the IOS system in May 2023, and display the refund amount", the computer device guides the target object to conduct the following with the first language model: Figure 3A In the multi-round conversation shown, the role of the first language model is assistant and the role of the target object is user.
[0069] In some embodiments, the quality of the results output by the large language model is not only related to the model settings, but also to the content of the instructions conveyed by the user. The content conveyed by the user to the model is the prompt information, and the prompt information can include at least one of the following: instruction, context, input data, and output indicator. Among them, the instruction is a specific task that the model needs to perform. Context is external information that provides task background and guides the model to generate better responses. Input data refers to the input or questions that the user is interested in, which is used for task execution needs. Output indicator refers to the type or format of the output. By using more accurate prompt information, the model can be guided to give a response that better meets the needs. By using different prompt information, the model can perform different functions.
[0070] In some embodiments, the prompt information, which serves as at least part of the input to the first language model, can be provided in a variety of ways, including limited-sample prompts, few-sample prompts, zero-sample questions, directional stimulation prompts, multi-step generation prompts, and Chain of Thoughts (CoT) prompts. Limited-sample prompts require providing the model with a certain number of examples, limiting the number of available samples to improve generation quality. Few-sample prompts are similar to exam questions: for each question, a sample is provided and the respondent is asked to answer based on this sample. Zero-sample questioning refers to the fact that large language models have been trained and optimized with extensive data and can provide reasonable responses to some questions without providing examples. Directional stimulation prompts provide the model with clear instructions or guiding information to help it more effectively generate the user's expected answer, which is more effective when handling ambiguous or complex questions. Multi-step generation prompts refer to the fact that when the model is large enough, reasoning capabilities emerge. Multi-step generation prompts typically guide the model through a series of logical steps, which may involve multiple prompting methods, such as text, images, and sound. Unlike few-shot prompts, chained thinking (CoT) prompts don't just provide a single output template; they provide a series of templates for reference and reasoning. The model then uses these templates to reason independently and produce responses that align with human intent. In practical applications, these prompting methods can be combined.
[0071] In some embodiments, while guiding the target subject in a turn-based conversation, the computer device can achieve different results by adjusting the properties of two hyperparameters: the output probability distribution Temperature and the example sampling probability Top_P. The Top_p parameter refers to the cumulative probabilities of selecting the top P (P is a positive integer) words with the highest probability in tasks such as text generation. This parameter is used to control the diversity of generated responses. Temperature controls the randomness of the generated text. Randomness can be understood as diversity in responses across multiple inquiries, more creative responses, and a greater likelihood of unfounded responses. Lower randomness can be understood as a greater likelihood of repeated responses across multiple inquiries and answers that are closer to the facts. Using a "low Temperature + low Top_p" setting, the large language model tends to select the words with the highest probability, generating text that is more consistent with linguistic patterns and logic. The generated text is often concise and less likely to contain lengthy or ambiguous responses.
[0072] Step 204 : performing intent recognition based on the multiple rounds of conversations to obtain task description content according to the multiple rounds of conversations.
[0073] Among them, intent recognition is to analyze the text input by the target object (such as spoken, written or query statements) to determine the specific purpose or demand intention that the user wants to achieve.
[0074] In some embodiments, the first language model may also have intent recognition capabilities, and the computer device may use the first language model to determine one or more required intentions of the target object's input information from multiple rounds of conversations that include preset elements required for the analysis task.
[0075] For example, Figure 3A As shown, the computer device performs intent recognition based on the input information of the target object in multiple rounds of conversations, such as "Analyze the refund risk of Game A in May 2023", "IOS", and "Currency a". It can be determined that the analysis type of analysis task T is a single analysis, and the demand intention for the preset element - time of analysis task T is: to analyze the refund risk occurring in "May 2023". The demand intention for the preset element - channel of analysis task T is determined to be: to analyze the refund risk supported by "IOS". The demand intention for the preset element - currency is determined to be: to display the amount information using "Currency a". The demand intention for the preset element - business is determined to be: for the refund risk of "Game A". Finally, the demand intention for the analysis type of this analysis task T is: one-way analysis, that is, it is only necessary to analyze "the refund risk of Game A deployed in the iOS system in May 2023, and display the refund amount using currency a".
[0076] In some embodiments, the computer device may perform intent recognition on multiple conversation rounds by performing intent recognition on information from each conversation round to determine at least a portion of the target subject's intent related to the analysis task in the current conversation round. After the multiple conversation rounds surrounding the analysis task meet a stop condition, the computer device may integrate the resulting partial intents to obtain a complete intent associated with the analysis task. The integration operation may include deduplication, concatenation, and other operations.
[0077] For example, Figure 3A As shown, in the first round of conversation, the computer device invokes the first language model to perform intent recognition, obtaining at least a partial intent for the analysis task: the time is May 2023, the business is Game A, and the dimension is the refund amount. In the second round of conversation, at least a partial intent is obtained: a refund is performed through the "IOS" channel. In the third round of conversation, at least a partial intent is obtained: the refund amount is represented in currency a. Finally, the computer device integrates all partial intents using the first language model to obtain the complete intent: analyzing the refund risk for Game A through the IOS channel between May 1 and 10, 2023, and displaying the refund amount in currency a. May 10, 2023, is the date that triggers the analysis in this example.
[0078] In some embodiments, the computer device may also perform intent recognition on multiple conversations by extracting all pre-set elements associated with the analysis task and key data corresponding to the pre-set elements from the complete multi-conversation after the multi-conversation meeting the conversation stop condition. The first language model uses the complete pre-set elements and key data corresponding to the pre-set elements, combined with contextual semantics, to perform intent recognition and determine the target subject's complete intent with respect to the analysis task.
[0079] For example, Figure 3A As shown, for multiple rounds of conversation, the computer device invokes the first language model to extract text related to predefined elements. The extracted data includes all predefined elements and their associated data: the time period is May 1-10, 2023, the activity is Game A, the channel is "iOS," the currency is "Currency A," and the dimension is "Refund Amount." Ultimately, the computer device uses the first language model, combined with the contextual semantics, to derive the complete intent: analyzing the risk of refunds for Game A via the iOS channel between May 1-10, 2023, and displaying the refund amount in Currency A.
[0080] In some embodiments, the computer device can also determine the required intent for the entire analysis task through intent recognition, which includes the analysis type of the analysis task. Analysis types can include at least single analysis and comparative analysis. Single analysis refers to the analysis of a single target data item, while comparative analysis refers to the analysis of the target data item and at least one comparative data item. For comparative analysis tasks, the computer device can obtain the target data item and at least one comparative data item through intent recognition, with the target data item being the data to be analyzed.
[0081] For example, Figure 3B As shown, the computer device performs intent recognition based on the target subject's input information in multiple rounds of conversations, such as "Please compare the refund risk of Game A during the same period this month and last month," "iOS," and "Currency A." It can determine that the analysis type for analysis task T is comparative analysis, and the target data for comparative analysis is the data to be analyzed, numbered 1 in the figure, i.e., "Analyze the refund risk of Game A through the iOS channel from May 1 to 10, 2023." The comparative data is numbered 2 in the figure, i.e., "Analyze the refund risk of Game A through the Android channel from April 1 to 10, 2023."
[0082] In some embodiments, because intent recognition is essentially a classification operation used to determine the specific intent of the target subject's input information in each conversation turn, the computer device can also determine the intent of each conversation turn through an independent functional interface with intent recognition capabilities. This independent functional interface can be a multi-classification model.
[0083] In some embodiments, the computer device can obtain a task description for the analysis task by invoking the first language model to identify intent across multiple rounds of conversation. The task description is a structured representation of the analysis task. The task description includes all predefined elements of the analysis task and the key data corresponding to each predefined element.
[0084] For example, Figure 3A As shown, after identifying intent across multiple rounds of conversations, key data corresponding to each preset element of the analysis task is obtained. For example, the key data for the preset element - time is "May 1-10, 2023," the key data for the preset element - channel is "IOS," the key data for the preset element - business is "Game A," the key data for the preset element - currency is "Currency A," and the key data for the preset element - dimension is "Refund Amount." The computer device structures the above data according to a preset format. For example, if it is output in JSON format, the following JSON-formatted task description is obtained:
[0085] "Data to be analyzed"
[0086] "Time": "May 1-10, 2023"
[0087] Channel: IOS
[0088] "Business": "Game A"
[0089] "Currency": "Currency A"
[0090] Dimension: Refund Amount
[0091] }.
[0092] It should be noted that for comparative analysis tasks, the target data and at least one comparative data share the preset elements of the analysis task. For each preset element, the target data and the comparative data have their own key data.
[0093] For example, Figure 3B As shown in the comparative analysis task shown in the figure, the target data (number 1, "Data to be analyzed") and the comparative data (number 2, "Comparative data") share the preset elements of the analysis task: {time, channel, business, currency, dimension}. For each preset element, each has its own corresponding key data. For example, for the preset element "time," the key data corresponding to the target data is "May 1-10, 2023," and the key data corresponding to the comparative data is "April 1-10, 2023."
[0094] Step 206 , calling a second language model to rewrite the task description content to obtain task parameters in a preset format. The second language model is obtained by training a large language model with task description samples in a preset business domain.
[0095] Among them, the second language model is obtained by training the large language model with task description samples in the preset business field. The rewriting operation performed based on the second language model is essentially to map the task description content to task parameters in a preset format through operators. The operator actually indicates the mapping relationship that can map data in one format to data in another format. The operator can be a text translation or a function conversion. The second language model is a large language model suitable for the preset business field, with entity extraction capabilities and text rewriting capabilities. The preset format is a parameter format that can be recognized by the data analysis platform that performs analysis tasks. Task parameters are the parameters required to be passed in by the application program interface provided by the data analysis platform for processing analysis tasks, that is, task parameters are the information finally passed into the data analysis platform.
[0096] In some embodiments, the computer device can rewrite the task description content output by the first language model using the second language model to obtain task parameters that conform to a preset format. The rewriting operation may include an entity extraction operation and a parameter generation operation. The entity extraction operation refers to extracting the entity corresponding to the task description content, and the parameter generation operation refers to combining operators to implement mapping of attribute data for the entity to obtain task parameters in a preset format.
[0097] It can be understood that, for an analysis task, the computer device first calls the first language model applicable to the business field to which the analysis task belongs, guides the target object and the first language model to conduct multiple rounds of conversations around the analysis task that can include the preset elements required for the analysis task, and calls the first language model again to identify the intention of the multiple rounds of conversations so that the first language model can output structured task description content; after the computer device obtains the task description content output by the first language model, it calls the second language model, extracts entities from the task description content to obtain entities that can be recognized by the second language model, and then uses the parameter generation operation and the operator to map the entities to task parameters in a preset format. At this point, the computer device obtains data that can be input into the data analysis platform for analysis of the analysis task.
[0098] For example, Figure 4A As shown, after Figure 3A The first language model outputs Figure 4A The task description shown in number 1 is input into the second language model for rewriting, and the result is Figure 4A The task parameters shown in number 2.
[0099] Another example Figure 4B As shown, for comparative analysis tasks, Figure 3B Multi-round conversation for Figure 3B The target data shown in number 1 and the comparison data shown in number 2 are respectively output by the first language model Figure 4B The task description shown in number 1, and Figure 4B The task description content shown in number 2 is then rewritten by calling the second language model to obtain Figure 4B The task parameters shown in numbers 3 and 4.
[0100] Step 208: Transmit the task parameters to the data analysis platform to instruct the data analysis platform to perform the analysis task based on the task parameters to obtain data analysis results.
[0101] The data analysis platform refers to a digital platform used to complete analysis tasks. It provides at least one application programming interface (API). Task parameters are set as input parameters that conform to the API, in the required format for the analysis task. In other words, the second language model rewrites the task description text based on the API's required input parameters.
[0102] In some embodiments, the data analysis platform can subscribe to and use software-as-a-service (SaaS) services from the internet that match the data analysis capabilities of a predefined business domain, such as risk control SaaS. Because SaaS is a cloud-based application, it requires no local installation, updates, or maintenance. After receiving the task parameters, the data analysis platform constructs a corresponding query statement based on the task parameters. Using the query statement, it retrieves the queried data from the database associated with the analysis task and then performs data analysis on the queried data. Task parameters are typically used to construct the query conditions that comprise the query statement. Specifically, the task parameters can be used to determine the scope of the data to be queried. As shown in Figure 4, the task parameter "statis_date" is "[20230501,20230510]," which specifies that the query scope is data with refunds occurring between 20230501 and 20230510. The task parameter "offerid" is "14500022260," which specifies that the query scope is refunds occurring for services with offerid="14500022260."
[0103] In this embodiment, the computer device calls the first language model to conduct a conversation with the target object, and can use the knowledge learned by the first language model in the preset business field to guide the target object to fully express the analysis needs. Based on multiple rounds of conversations around the analysis task, the information associated with the analysis intention is automatically completed, so that the complete task description content can be automatically obtained. Then, through the second language model with rewriting ability, the task description content is automatically rewritten to obtain task parameters suitable for the data analysis platform, so as to automatically perform data analysis through the data analysis platform and obtain analysis results. The entire process realizes the automated processing of analysis needs through multiple rounds of conversation guidance, information completion, automatic generation and rewriting of task descriptions, and automated data analysis, thereby improving the efficiency and accuracy of data analysis.
[0104] In some embodiments, as Figure 5 As shown, the first language model is called to conduct multiple rounds of conversations with the target object around the target analysis task, including:
[0105] Step 502: Determine historical conversations generated during the interaction between the first language model and the target object.
[0106] In some embodiments, for each round of conversation surrounding an analysis task, the computer device first determines historical conversations prior to the start of the current round of conversation. Historical conversations are question-and-answer pairs that have already been completed between the target subject and the large language model. Historical conversations include at least some of the preset elements of the analysis task, as well as key data for the preset elements. It should be noted that historical conversations refer to conversations that are not the first round. If the conversation is the first round, the historical conversation will be empty.
[0107] Step 504 : Determine first prompt information of the current round based on the historical conversations, input the first prompt information of the current round into the first language model, and output the first conversation of the current round through the first language model.
[0108] The first prompt information refers to natural language text input to the first language model, instructing it to complete a task. It can be a question, such as "Explain refund risk," or a command, such as "Generate results in JSON format." The first prompt information is generated based on historical conversations, and the computer device can use the first prompt information as at least part of the input to the first language model. During a conversation, for the current round of conversation, the computer device inputs the input information, including the first prompt information, to the first language model, which then outputs the first conversation of the current round, which is associated with the first prompt information.
[0109] In some embodiments, for the current round of conversation, if there is a historical conversation, the computer device can also splice the adapted instruction with the historical conversation and use the splicing result as the first prompt information. Figure 3A As shown, to guide the first language model to output the first conversation shown in number 1, the corresponding first prompt information may include a generation instruction, a historical conversation, and a result output format. The generation instruction is used to inform the first language model to generate the result, and the output format is used to instruct the model to output relevant information in JSON format.
[0110] It should be noted that if the historical conversation is empty, the first prompt information can be directly the user's question information. After the computer device receives the user's question information, it directly inputs it into the first language model as the first prompt information.
[0111] Step 506: Obtain the second conversation of the current round of feedback from the target object.
[0112] The second session includes data of the target subject's feedback on the first session output by the large language model. In some embodiments, the second session may include key data associated with the analysis task that the target subject needs to input in the first session.
[0113] Step 508 : Update the historical session based on the first session and the second session, and return to the step of determining prompt information for the current round based on the historical session and continue executing until a session stopping condition is met.
[0114] In actual implementation, after the second round of conversations is completed, the first and second conversations generated thereby become part of the historical conversation. Then, for the next round of conversations, steps 502-506 are re-executed to obtain the historical conversations of the new round of conversations, thereby achieving multiple rounds of conversations until the conversation stop condition is met.
[0115] It should be noted that the triggering condition for each conversation round is when the computer device determines that the historical conversation lacks the preset elements required for the analysis task. That is, when the preset elements are missing in the historical conversation, the interaction between the first language model and the target object cannot be stopped, which means that the current conversation fails to meet the conversation stop condition. In addition, the computer device pre-sets a stop keyword to trigger the conversation stop condition. When the first language model captures the presence of the stop keyword in the second conversation of the target object, the current multi-round conversation is terminated. For example, the stop keyword is "end," "goodbye," or "stop." It should be noted that if the conversation stop condition is triggered by the stop keyword, the computer device needs to verify whether the completed multi-round conversation contains all the preset elements required for the analysis task. If all are included, the verification is passed. If there are missing elements, the computer device can instruct the first language model to output a notification message to inform the target object that the analysis task cannot be successfully completed, so that the user can make appropriate decisions based on the notification message.
[0116] In this embodiment, historical conversations enable a better understanding of the conversation context, which is crucial for maintaining conversation continuity and a personalized experience. Based on historical conversations, appropriate prompt information can be generated to guide the conversation in the direction desired by the user while maintaining relevance to previous interactions. The first language model is used to output the first conversation. Since the first conversation is based on the aforementioned prompt information, highly relevant and fluent responses can be generated, improving the user experience.
[0117] In some embodiments, the computer device determines that the session stop condition is met by: determining multiple preset elements related to the analysis task; during each round of the session, determining the preset elements that have appeared in the historical session, and if all the preset elements related to the analysis task appear in the historical session, it is determined that the session stop condition is met.
[0118] In actual implementation, for a specific analysis task, the computer device first determines all preset elements associated with the analysis task. Furthermore, during each conversation round, the computer device determines the preset elements that appeared in the historical conversations. When all the preset elements of the analysis task appear in the historical conversations, the computer device may input the first prompt information used to instruct the user to stop the conversation into the first language model. Based on the first prompt information, the first language model stops the multiple conversation rounds and outputs the corresponding results.
[0119] For example, Figure 3A In the analysis task T, when the last round of conversation for "analyzing the refund risk of game A deployed in the iOS system in May 2024 and displaying the refund amount in currency a" begins, the computer device has obtained all the preset elements of the analysis task {time, channel, business, currency, dimension} through the previous rounds of conversations. The computer device splices the historical conversation with the first prompt information "output the result in JSON format and prompt the user to verify whether the result is correct", and uses the spliced result as the input information of the first language model. The first language model outputs Figure 3A The content corresponding to "assitant" in number 1 is the output in JSON format, and the user is asked based on the output in JSON format.
[0120] In this embodiment, during each round of conversation, by checking for pre-set elements that have appeared in previous conversations, the continuity of the conversation is maintained, ensuring that no relevant elements are missed. Once all pre-set elements relevant to the analysis task have appeared, the session termination condition is determined to be satisfied. This ensures that all necessary information is covered across multiple rounds of conversation, effectively guaranteeing information integrity.
[0121] In some embodiments, as Figure 6 As shown, intent recognition is performed based on multiple rounds of conversations to obtain task description content based on multiple rounds of conversations, including:
[0122] Step 602: perform intent recognition based on multiple rounds of conversations to obtain at least one demand intent.
[0123] Intent refers to the specific input information required by the target subject for each conversation turn when interacting with the first language model. Intent can also refer to the type of analysis task the target subject needs to perform at the end of the conversation turn. Analysis types can include at least single-item analysis and comparative analysis.
[0124] In some embodiments, each round of input from the target user may correspond to a demand intent. The computer device uses the first language model to accurately identify one or more demand intents from the target user across multiple rounds of conversation. This helps improve the accuracy of the input information used to generate the first language model.
[0125] For example, Figure 3A As shown, the computer device can obtain a demand intention after performing intention recognition based on the input information of the target object "Analyze the refund risk of Game A in May 23". Figure 1 , that is, the user needs to analyze the refund risk of Game A in the time range of May 2023. According to the input information "IOS" of the target object, after combining the historical conversation to perform intent recognition, a demand intent can be obtained. Figure 2 , is to analyze the refund risk of Game A running on IOS in May 2023. In combination with historical sessions, the demand Figure 2 Relative to demand Figure 1 More complete. After the multi-round conversation is complete, the first language model can also obtain the requirement intention that the analysis task is a single analysis task, that is, only a single analysis is required, and no comparative analysis is required.
[0126] Step 604: Determine key data corresponding to each preset element from multiple rounds of conversations.
[0127] Among them, the analysis task includes multiple preset elements, and the multiple rounds of conversations between the target object and the first language model around the target task are actually to guide the target object to input the key data corresponding to each preset element, so that at the end of the conversation, the first language model can output a structured task description content. That is, the key data corresponding to the preset elements are the relevant data that the computer device guides the target object to input by calling the first language model. When the multi-round conversation meets the conversation stop condition, the computer device determines the key data corresponding to each preset element of the analysis task from the multi-round conversation. If the analysis task includes N (N is an integer greater than 1) preset elements, the computer device guides the target object to interact with the large language model for multiple rounds until the multi-round conversation includes the key data corresponding to these N preset elements, and the multi-round conversation can be stopped.
[0128] For example, Figure 3A As shown, the preset elements required for the pre-set analysis task T include time, channel, business, currency, and dimension. By inputting "Analyze the refund risk of Game A in May 2024" into the target object, the computer device can obtain the key data for the preset element - time as "May 1-10, 2024" and the key data for the preset element - business as "Game A." By inputting "IOS" into the target object, the key data for the preset element - channel is "IOS." By inputting "Currency A" into the target object, the key data for the preset element - currency is "Currency A," and so on.
[0129] In some embodiments, when the computer device identifies the analysis task's intent as a comparative analysis through intent recognition, at least two corresponding key data items exist for the preset elements of the analysis task: one item serves as the data being compared (i.e., the target data), and the other item serves as the comparison data. In other words, for the compared data and the comparison data, while the preset elements are the same for the analysis task, the key data corresponding to the preset elements are different. The difference in key data essentially means that the actual values of the key data are different, but the key data types are the same.
[0130] For example, Figure 4B The target object and the first language model engage in multiple rounds of conversations regarding analysis task S. The computer device determines that the analysis type for the analysis task is comparative analysis. Specifically, the refund risk of Game A purchased through the iOS channel from May 1, 2023, to May 10, 2023, is compared with the refund risk of Game A purchased through the Android channel from April 1, 2023, to April 10, 2023. The computer device uses the first language model to perform intent recognition and obtain the task description for analysis task S. The preset elements of analysis task S include time, channel, business, currency, and dimension. As shown by numbers 1 and 2 in the figure, it can be determined that two actual values are stored for the same preset element. For example, the preset element "time" can include "May 1-10, 23" and "April 1-10, 23," and the preset element "channel" can include "IOS" and "Android."
[0131] Step 606: Generate structured task description content related to the analysis task based on the demand intention and key data.
[0132] In some embodiments, the computer device normalizes the natural language description text of the unstructured analysis task according to preset format requirements based on at least one demand intention obtained from multiple rounds of conversations and key data corresponding to preset elements input by the target object, to obtain structured task description content related to the analysis task.
[0133] For example, Figure 3A As shown, for the analysis task T, the computer device extracts the demand intention from the multiple rounds of conversations between the target object and the first language model around the analysis task T, including: demand intention Figure 1 "The time frame is the refund risk for Game A in May 2023", demand meaning Figure 2 "For the refund risk of game A running on IOS in May 2023", demand intention 3 "For the refund risk of game A running on IOS in May 2023, and use currency a to display the refund amount", etc., combining various demand intentions and the prompt information related to the output format "output in JSON format", the first language model output is as follows Figure 3A The output result shown in number 1 is the structured task description content. Figure 4A As shown, for the analysis task of comparative analysis, the data to be analyzed as shown by number 1 in the figure and the comparative data as shown by number 2 can be obtained, which correspond to two structured task description contents respectively.
[0134] In this embodiment, structured task description content is generated based on the identified demand intent and extracted key data, which helps to clearly and systematically define the analysis task and provides standardized input for subsequent processing and execution; the structured task description can simplify the subsequent analysis and processing flow. In the automated analysis system, the structured task description can usually be directly input into the automated system, reducing the need for manual interpretation and conversion and improving processing efficiency.
[0135] In some embodiments, calling a second language model to rewrite the rewriting task description content to obtain task parameters in a preset format includes: obtaining a rewriting instruction, generating a second prompt message based on the rewriting instruction and the task description content; inputting the second prompt message into the second language model, and outputting the task parameters in a preset format through the second language model; the preset format is a format compatible with the data analysis platform.
[0136] The rewrite instruction instructs the second language model to perform a rewrite operation. The second prompt information indicates the specific method by which the second language model should rewrite the task description. Rewriting operations typically require the use of operators. Operators are used to rewrite data from one format to another. There are various types of operators, which are determined based on the mapping relationship between the data to be rewritten and the rewritten data.
[0137] In actual implementation, after receiving the rewrite instruction, the computer device encapsulates the second prompt information according to the rewrite instruction. The second prompt information includes operators corresponding to the key data of each preset element and the operators corresponding to each preset element. The operators corresponding to the preset elements can convert the names of the preset elements described in natural language into new names of the preset elements in the target format required by the data analysis platform. The computer device uses the second prompt information as input to the second language model and calls the second language model to rewrite the task description content to obtain task parameters in the preset format.
[0138] For example, for Figure 4A The task description content shown in number 1 encapsulates the rewrite instruction "rewrite the content as follows", and the computer device generates the second prompt information as follows:
[0139] "Time" is converted to "statis_date" and rewritten using operator 1; "Channel" is converted to "channel" and rewritten using operator 2; "Business" is converted to "offerid" and rewritten using operator 3; "Currency" is converted to "currency_type" and rewritten using operator 4; "Dimension" is converted to "target_feature" and rewritten using operator 5.
[0140] The computer device will use the above second prompt information to Figure 4A The task description shown in number 1 is rewritten as Figure 4A The task parameters in the preset format are shown in number 2.
[0141] In this embodiment, the second prompt information enables rewriting of the task description content, increasing the flexibility and adaptability of task processing. Furthermore, the second prompt information is input into the second language model, which can output task parameters that conform to a preset format. This enables automatic generation of task parameters, reduces the need for manual parameter writing, and improves efficiency. Furthermore, the preset format of the output task parameters is compatible with the data analysis platform. The task parameters output by the second language model can be directly used for subsequent data processing and analysis on the data analysis platform without the need for additional conversion steps.
[0142] In some embodiments, as Figure 7 As shown, the second language model outputs the task parameters in a preset format, including:
[0143] Step 702: extract key data from the second prompt information using a second language model.
[0144] Among them, the second prompt information is the input information of the second language prompt model. The second prompt information includes all the preset elements required for the analysis task and the key data of each preset element. It can also include operators for converting the preset elements and operators for converting the key data of the preset elements.
[0145] For example, for Figure 3A When rewriting the structured task description content of the analysis task T shown in , the second prompt information may be "Please rewrite the following content:
[0146] Data to be analyzed
[0147] "Time": "May 1-10, 2023"
[0148] Channel: IOS
[0149] "Business": "Game A"
[0150] "Currency": "Currency A"
[0151] "dimension": "RefundAmount"}
[0152] The rewriting method of the preset elements and the key data corresponding to the preset elements is as follows:
[0153] {
[0154] "Time" is converted to "statis_date", and "May 1-10, 2023" is rewritten using operator 1;
[0155] "Channel" is converted to "channel" and "IOS" is rewritten using operator 2.
[0156] "Business" is converted to "offerid" and "Game A" is rewritten using operator 3.
[0157] "Currency" is converted to "currency_type", and "Currency a" is rewritten using operator 4;
[0158] "Dimension" is converted to "target_feature" and "Refund Amount" is rewritten using operator 5.
[0159] In response to the second prompt message, the computer device first extracts key data through the second language model, including "May 1-10, 2023", "IOS", "Game A", "Currency A", and "Refund Amount".
[0160] Step 704: Determine operators that match each key data according to the preset elements corresponding to each key data.
[0161] In some embodiments, the matching relationship between the preset elements and the operators can be pre-stored in a configuration file associated with the analysis task, or in a database associated with the analysis task. The computer device reads the matching relationship between the preset elements and the operators, and determines the operator matched by each preset element. The computer device splices the operator matched by each preset element into the input information of the second language model, and inputs it into the second language model. The second language model first determines the operator matched by each preset element from the input information, and uses the operator matched by the preset element as the operator required to be used for the key data corresponding to the preset element. Key data of different data types can correspond to different types of operators. For example, data of date type can be converted into a date in the target format by a date conversion operator. The specific form of the operator can be customized according to actual needs. The operator in this embodiment is mainly used to map the natural language input text to the target parameter form required by the data analysis platform.
[0162] Illustratively, the second prompt information in step 702 may determine the operator required for each key data.
[0163] Step 706: Construct task parameters in a preset format based on the key data and the operators that match the key data.
[0164] The preset format refers to the format of the task parameters required by the data analysis platform. It can be JSON or any other custom format. The main purpose is to be able to pass all the parameters required for the analysis task to the data analysis platform for direct use.
[0165] For example, Figure 4A As shown in Figure 2, the output format is a task parameter in JSON format. The key data "May 1-10, 2023" for the preset element "Time" is rewritten using the date operator to obtain the task parameter "statis_date" as [20230501, 20230510]. The key data "IOS" for the preset element "Channel" is rewritten using the literal translation operator to obtain the task parameter "channel" as "IOS." Similarly, the key data "Game a" for the preset element "Business" is rewritten using the text-to-character operator to obtain the task parameter "offerid" as "14500022260." The key data "Currency a" for the preset element "Currency" is rewritten using the currency conversion operator to obtain the task parameter "currency_type" as "CNY," and so on.
[0166] In some embodiments, the structured task description content can be used as a parameter group to be rewritten, and through multiple shared operators, the parameter group to be rewritten is rewritten into a target parameter group that conforms to the data analysis platform, that is, the task parameters required by the data analysis platform exist in the form of a parameter group. If the analysis type is a single analysis, the parameter group to be rewritten is a group. If the analysis type is a comparative analysis, the parameter group to be rewritten is a plurality of groups. From the plurality of operators, the target operator of the key data corresponding to each preset element in the parameter group to be rewritten is determined. For the same analysis task, the preset elements in the parameter group to be rewritten are the same, the operators used when rewriting the key data of the preset elements are the same, and at least part of the key data in the parameter group to be rewritten is different. The computer device calls the second language model to determine the operator associated with each preset element in the parameter group to be rewritten, and then converts the key data corresponding to the preset element through the operator to obtain the target parameter group.
[0167] For example, Figure 8As shown, the analysis task is a comparison task. There are two parameter groups to be rewritten, target data and comparison data. The target data undergoes the conversion operation of the shared operators {operator 1, operator 2, operator 3, operator 4, operator 5} to obtain two target parameter groups target_data and benchmark_data.
[0168] In some embodiments, the task parameters are transmitted to the data analysis platform to instruct the data analysis platform to perform the analysis task based on the task parameters to obtain data analysis results, including: constructing a query statement according to the task parameters; sending the query statement to the data analysis platform to instruct the data analysis platform to perform data query according to the query statement, performing data analysis based on the queried data, and obtaining data analysis results.
[0169] A query statement refers to data filtering criteria written in the Structured Query Language (SQL), a database language with multiple functions, including data manipulation and definition. SQL query statements include WHERE conditions. The computer device combines task parameters into WHERE conditions tailored to the analysis task, constructs the query statement, and instructs the data analysis platform to perform a data query based on the query statement. The platform then analyzes the retrieved data according to the specific analysis requirements specified in the analysis task, ultimately generating the final analysis results.
[0170] For example, taking the field of risk control as an example, there are Figure 4A In the multi-round conversation shown, the second language model rewrites the task description of analysis task T to obtain task parameters: "statis_date" is [20230501, 20230510], "channel" is "ios", "offerid" is "14500022260", "currency_type" is "CNY", and "target_feature" is "refund_amt". The computer device uses SQL to construct the following query statement: "select target_feature from table1 where offerid='14500022260' and statis_channel='IOS' and currency_type='CNY' and statis_date between '20230501' and '20230510'". Based on this query statement, the computer device retrieves appropriate data from table1 in the database for subsequent data analysis tasks.
[0171] In this embodiment, query statements are automatically constructed based on task parameters, reducing the workload of manually writing queries and improving efficiency. Because query statements precisely indicate the data the data analysis platform needs to retrieve, the accuracy and relevance of data queries are ensured. Through query statements, the data analysis platform can directly locate the required data, avoiding processing irrelevant data and improving data utilization efficiency. The automated process of query construction and data query execution enables the system to quickly respond to data analysis needs and accelerate decision support.
[0172] Before explaining the training process for the first language model, we will first explain how to fine-tune a large language model. In practical applications, due to the large number of parameters in a large language model, fully adjusting the model parameters consumes a lot of computer storage resources, and the training process is difficult to converge and takes a very long time. Therefore, direct fine-tuning of the large model is generally not used for model training. Instead, parameter-efficient fine-tuning (PEFT) methods are used for parameter adjustment. PEFT methods include low-rank adaptation (LoRA), prompt tuning, prefix tuning, and adapters.
[0173] In some embodiments, the computer device may select the LoRA method to fine-tune the large language model to obtain a large language model for a preset business domain with professional conversation capabilities.
[0174] Among them, the core idea of the LoRA method is to perform an implicit low-rank transformation on the weight matrix that needs to be updated of the large language model. The premise for being able to perform low-rank transformation is the intrinsic low-rank characteristics of the large language model, that is, the large language model has a lower "intrinsic dimension". In the process of adapting to downstream tasks, even if it is randomly projected to a smaller subspace, it can still be effectively learned. The specific implementation process based on the LoRA method can be that when training the large language model through the training corpus of the preset business field, the original model parameters of the large language model (the model parameters represented by a matrix of size d×d) are frozen. During training, according to the loss, two low-rank matrices are used to update the weight update matrix. Such as Figure 9The structural diagram shown is as follows for the parameter fine-tuning process of the large model: First, add a bypass branch beside the large language model. Based on the intrinsic low-rank property of the large language model, this bypass branch consists of a dimensionality reduction matrix A (a matrix of size d×r) and a dimensionality increase matrix B (a matrix of size r×d), where d is a very large positive integer and r is a positive integer much smaller than d, that is, r << d. Through this bypass branch, perform dimensionality reduction through the dimensionality reduction matrix A and then dimensionality increase through the dimensionality increase matrix B to simulate the intrinsic rank. Second, during the training process, freeze the original model parameters of the large language model and only train the dimensionality reduction matrix A and the dimensionality increase matrix B. Among them, the dimensions of the input and output of the large language model remain unchanged. When outputting, add the result of multiplying BA (a matrix of size d×d) to the original model parameters of the large language model. Finally, use the superimposed result to replace the original model parameters to obtain a large language model that conforms to the preset business domain. Among them, at the beginning of training, in order to ensure starting from the original model parameters, the bypass branch should be a matrix of all zeros. Therefore, the computer device initializes the dimensionality reduction matrix A with a random Gaussian distribution and initializes the dimensionality increase matrix B with all zeros. During the training process, through the training corpus and the loss function of the large language model, determine the loss of each round of training. Through the backpropagation of the loss, adjust B and A until the loss is minimized, or the loss is lower than or equal to the preset threshold, to obtain the adjusted B and A. Then, perform a linear transformation (such as summation, weighted summation, etc.) on the original model parameters with the result of multiplying B and A (a matrix of size d×d) as the model parameters of the large language model applicable to the preset business domain.
[0175] Based on the above principle description, in some embodiments, such as Figure 10 shown, the training process of the first language model includes:
[0176] Step 1002, obtain the first training corpus within the preset business domain, and perform perturbation processing on the business keywords in the first training corpus to obtain the second training corpus.
[0177] Among them, the preset business domain is the downstream business applicable to the large language model, such as the insurance field, legal field, medical field, risk control field, etc.
[0178] In actual implementation, in order to obtain a large language model applicable to the preset business domain, the computer device needs to train the large language model through the first training corpus within the preset business domain, generally referring to fine-tuning the large language model with a small amount of the first training corpus within the preset business domain to obtain a large language model applicable to the preset business domain. In addition, for the same training corpus, in order to verify the influence degree of key data on the prediction result, perturbation processing can also be performed on the business keywords in the training corpus to obtain the perturbed second training corpus. The perturbation processing can at least include operations such as masking, replacement, or deletion.
[0179] Step 1004: construct a first model to be trained based on the original model parameters of the large language model and the matrix parameters of the first bypass branch.
[0180] Among them, the large language model is trained based on the corpus of the preset business field, and has original model parameters represented in matrix form. The original model parameters can be a matrix of size d×d. The matrix parameters of the first bypass branch are the model parameters that need to be updated when adjusting the large language model to the large language model of the preset business field. They are also matrices of size d×d. Based on the inherent low-rank characteristics of the large language model, they are represented by two low-rank matrices. During the training phase, the computer device, on the basis of freezing the original model parameters, continuously adjusts the matrix parameters of the first bypass branch through the loss function of the large language model and the loss of each training round to achieve model training. Therefore, the computer device can construct a first model to be trained suitable for the preset business field by adding the first bypass branch and combining the original model parameters of the large language model.
[0181] In some embodiments, the trained large language model Model = WX, where W is the original model parameter of the large language model, which is a matrix of size d×d, and X is the feature information. The computer device adds the matrix parameter △W of the first bypass branch as the parameter (matrix representation) that needs to be updated during the training process, performs a linear transformation on the original model parameters, and implements fine-tuning training for the large language model. Based on this, the computer device constructs the first model to be trained Model1 = WX+△WX. When △W is a zero matrix, the first model to be trained is the large language model. During the training process of the first model to be trained, W remains unchanged, that is, W is frozen, and △W is updated in anticipation of training. In practical applications, △W is divided into two low-rank matrices to simulate low-rank properties, that is, △W=BA. Matrix A is used to perform dimensionality increase operations, and matrix B is used to perform dimensionality reduction operations. Initially, B is initialized with a random Gaussian distribution, and A is initialized to an all-0 matrix.
[0182] Step 1006: Process the first training corpus through the first to-be-trained model to obtain a first prediction output; and process the second training corpus through the first to-be-trained model to obtain a second prediction output.
[0183] In actual implementation, the computer device inputs the first training corpus and the second training corpus into the first to-be-trained model respectively to obtain a first prediction output of the first training corpus and a second prediction output of the second training corpus.
[0184] Step 1008 : According to the difference between the first prediction output and the second prediction output, the matrix parameters of the first bypass branch are adjusted to train the first model to be trained, and a first language model is obtained when the training is completed.
[0185] In actual implementation, since the second training corpus is data that has been perturbed, there are differences between the prediction results obtained by calling the first model to be trained. Based on the differences and the loss function used by the large language model, the loss of the corresponding training round is determined. Based on the loss, backpropagation is performed to update the matrix parameters of the first bypass branch until the loss is minimized or the loss is less than or equal to the preset threshold. The training of the first model to be trained is completed, and the trained first language model is obtained.
[0186] In this embodiment, through keyword perturbation, the first bypass branch structure, dual prediction and difference-driven parameter adjustment, the performance of the first model to be trained in the preset business field is improved, enabling it to more accurately understand and generate relevant texts, thereby meeting business needs.
[0187] In some embodiments, as Figure 11 As shown, obtaining the first training corpus in the preset business domain includes:
[0188] Step 1102: Acquire knowledge corpus and scenario dialogues within a preset business domain.
[0189] The knowledge corpus within a predefined business domain typically refers to unstructured data related to the predefined business domain, including chat logs of daily communication conversations, report text information, business documentation, and other text data. Scenario conversations typically refer to conversations between experts in the predefined business domain.
[0190] Step 1104 , normalize the knowledge corpus according to its corpus type to obtain a plurality of first question-answer text pairs.
[0191] Question-answer text pairs refer to data that is formatted and appears in pairs. These pairs consist of both the question and the answer. Corpus types refer to the different sources of knowledge corpora. Corpus types include chat logs and text articles. Different corpus types are processed using appropriate normalization methods, which are pre-defined based on the specific scenario.
[0192] In some embodiments, for knowledge corpora such as chat records, the computer device uses the output content of the domain expert to whom the chat record belongs as the response information of the question-answer text pair, and uses the content of other people except the domain expert as the question information. For knowledge corpora such as text articles, the title or introduction is used as the question information, and the detailed content of the article is used as the response information. At the same time, for some commonly used factual knowledge in business fields that are manually created, such as common risks, proprietary computing terms, etc., the summary description of this part of the content is used as the question information, and the specific content is used as the response information. In the training stage of the large language model using the first response text pair, the question information in the response text pair is used as the input of the model, and the response information in the response text pair is used as the output of the model.
[0193] For example, the specific form of a normalized question-answer text pair is as follows:
[0194] {“input”: “title introduction of the conversation content or article”,
[0195] "output": "Details of the conversation between domain experts or articles"}
[0196] Step 1106: Generate multiple second question-answer text pairs using the scene dialogue as an example.
[0197] In practice, scenario conversations are produced by experts in a predefined business domain during conversations. This content is small in quantity but high in quality. To expand this type of data, a computer device can automatically generate a larger number of second question-answer text pairs using scenario conversations as examples through automated generation. This automated generation method involves providing initial samples with defined objectives and inputting them into an automatically generated model (a type of artificial intelligence model) to generate training samples. The automatically generated model can be a large GPT-like model. For example, the computer device uses the obtained high-quality scenario conversations as examples and inputs them into the chatGPT model. Simulation operations are performed, replicating the conversations in large quantities to generate a predetermined number of second question-answer text pairs.
[0198] Step 1108: Determine a first training corpus based on the first question-answer text pair and the second question-answer text pair.
[0199] In actual implementation, the computer device will randomly combine the first question-answer text pair and the second question-answer text pair and divide them into training, testing, and validation datasets for the large language model. For example, if a random sampling method is used, 40% will be used as the training dataset, 30% as the testing dataset, and 30% as the validation dataset.
[0200] In this embodiment, by normalizing the knowledge corpus, the consistency and accuracy of the knowledge in the preset business field can be ensured, which is convenient for subsequent processing and application. By converting the knowledge into structured question-answer text pairs, it is convenient for the model to understand and process, and it also provides users with a clear question-answer query method. Using the conversations of business domain experts as examples, more question-answer pairs are generated through artificial intelligence models, which can effectively expand and enrich the content of the knowledge base. The generated question-answer text pairs are used as training data to enhance the training effect of the large language model, so that it can better understand and process the professional knowledge of the preset business field. The large language model obtained by training the question-answer text pairs is specially optimized for the preset business field and can more accurately understand and predict information related to the business field.
[0201] In some embodiments, adjusting the matrix parameters of the first bypass branch to train the first model to be trained based on the difference between the first predicted output and the second predicted output includes: comparing the first predicted output with the second predicted output and determining, based on the comparison result, the degree of influence of each word in the first training corpus on the predicted output. Freezing the original model parameters of the large language model and adjusting the matrix parameters of the first bypass branch based on the degree of influence corresponding to the perturbed business keyword to train the first model to be trained.
[0202] In actual implementation, by comparing the first prediction result and the second prediction result, the influence of each word in the first training corpus on the predicted output is determined. According to the loss function used by the large language model, the loss corresponding to the influence of the disturbed business keyword is determined, and according to the loss, the matrix parameters of the first bypass branch are adjusted to achieve training for the first model to be trained. Among them, the adjustment direction of the matrix parameters of the first bypass branch is to gradually minimize the loss, or the loss is less than or equal to the preset threshold.
[0203] In some embodiments, the loss function used by the large language model can be a cross-entropy loss function (Cross-Entropy Loss). In the first model to be trained, Model1 = WX + △WX, the original model parameters W of the large language model are first frozen. For each word in the first prediction result, the computer device determines the cross-entropy between the influence of the word in the first prediction result and the influence of the word at the same position in the second prediction result. The cross-entropy of all words is summed to obtain the loss of the current training round. The gradient of the loss is propagated back to the first model to be trained through the backpropagation algorithm, and the matrix parameters △W of the first bypass branch are updated.
[0204] In this embodiment, by comparing the first prediction output and the second prediction output, the specific influence of each word in the first training corpus on the prediction output can be analyzed, so that the model can understand the role of words in the prediction process more carefully, which can effectively improve the model's fine-grained understanding ability, generalization ability and robustness in specific fields, while optimizing model parameters and improving training efficiency.
[0205] In some embodiments, as Figure 12 As shown, the training process of the second language model is described. The training process of the second language model includes:
[0206] Step 1202 : Obtain task description samples within a preset business domain, perform perturbation processing on key data in the task description samples, and obtain perturbed task description samples.
[0207] The second language model is obtained by training the second to-be-trained model with task description samples from a preset business domain. The second to-be-trained model is obtained by linearly transforming the original model parameters of the large language model involved in fine-tuning through the second bypass branch.
[0208] In some embodiments, the method for obtaining task description samples within a preset business field can be manual acquisition, or a computer device can obtain the first training corpus within the preset field, and after the intent is recognized by the first language model completed by the aforementioned training, the output result is used as the task description sample of the second model to be trained. And by perturbing the key data in the task description sample, a perturbed task description sample is obtained, and the second model to be trained associated with the second language model is trained based on the task description sample and the perturbed task description sample to obtain a second language model. The style of the task description sample within the preset business field is as follows: Figure 3A As shown in number 1.
[0209] Step 1204: construct a second model to be trained based on the original model parameters of the large language model and the matrix parameters of the second bypass branch.
[0210] In some embodiments, the large language model Model trained by the computer device , =W0X, W0 is the large language model Model ,The original model parameters are a d×d matrix, where X represents the feature information. The computer device adds the matrix parameters △W1 of the second bypass branch as parameters (matrix representation) that need to be updated during training. △W1 is used to linearly transform the original model parameters W0 to construct the second model to be trained. The second model to be trained, Model2, equals W0X + △W1X. When △W1 is a zero matrix, the second model to be trained is the large language model. During the training of the second model to be trained, W0 remains unchanged, i.e., frozen. △W1 is updated using task description samples from the preset business domain and the perturbed task description samples.
[0211] Step 1206: Process the task description sample using the second model to be trained to obtain a third prediction output, and process the perturbed task description sample using the second model to be trained to obtain a fourth prediction output.
[0212] In some embodiments, the task description sample is processed by the second model to be trained to obtain a third prediction output, and the perturbed task description sample is processed by the second model to be trained to obtain a fourth prediction output.
[0213] Step 1208 : According to the difference between the third prediction output and the fourth prediction output, the matrix parameters of the second bypass branch are adjusted to train the second model to be trained, and a second language model is obtained when the training is completed.
[0214] In some embodiments, the computer device determines the difference between the third predicted output and the fourth predicted output, and applies a loss function associated with the language model to determine the loss for the corresponding training round. Backpropagation is then performed based on the loss to update the matrix parameters of the second bypass branch until the loss is minimized or less than or equal to a preset threshold, completing the training of the second model to be trained and obtaining a trained second language model.
[0215] In some embodiments, adjusting the matrix parameters of the second bypass branch based on the difference between the third predicted output and the fourth predicted output to train the second model to be trained includes: comparing the third predicted output with the fourth predicted output and determining, based on the comparison result, the degree of influence of each word in the second training corpus on the predicted output. Freezing the original model parameters of the large language model and adjusting the matrix parameters of the second bypass branch based on the degree of influence corresponding to the perturbed key data to train the second model to be trained.
[0216] In actual implementation, by comparing the third prediction result and the fourth prediction result, the influence of each word segmentation in the second training corpus on the predicted output is determined. According to the loss function used by the large language model, the loss corresponding to the influence of the disturbed key data is determined, and according to the loss, the matrix parameters of the second bypass branch are adjusted to achieve training for the second model to be trained. Among them, the adjustment direction of the matrix parameters of the second bypass branch is to gradually minimize the loss, or the loss is less than or equal to the preset threshold.
[0217] In some embodiments, the loss function used by the large language model can be a cross-entropy loss function. In the second to-be-trained model Model2 = W0X + ΔW1X, for each word in the third prediction result, the computer device determines the cross-entropy between the influence of the word in the third prediction result and the influence of the word at the same position in the fourth prediction result. All cross-entropies are summed to obtain the loss for the current training round. The model parameter W0 of the large language model is frozen, and the gradient of the loss is propagated back to the second to-be-trained model through the backpropagation algorithm to update the matrix parameter ΔW1 of the second bypass branch.
[0218] In this embodiment, by obtaining task description samples within a preset business domain, the model can be better adapted to tasks in a specific domain and the generalization ability of the model can be improved; by perturbation processing of key data in the task description samples, the model can be more robust to noise and changes in the data when processing actual tasks; by constructing a second model to be trained based on the original model parameters of the large language model and the matrix parameters of the second bypass branch, the accuracy of the model can be improved by utilizing the existing model parameters and information in a specific domain; by comparing the processing results of the second model to be trained on the task description samples and the perturbed task description samples, the matrix parameters of the second bypass branch can be automatically adjusted to achieve the purpose of optimizing the model parameters; this method can effectively improve the training efficiency of the model by preprocessing the task description samples, constructing the second model to be trained, and training the model.
[0219] To explain the data analysis method of the present application in detail, an embodiment is used below for illustration. In this embodiment, the preset business field is the conversational billing risk control field, the large language model is ChatGLM-6B, and the fine-tuning of the large language model is performed using the LoRA method as an example to illustrate the data analysis method in this embodiment.
[0220] In this embodiment, the core capabilities of a large-scale language model for conversational billing risk control include multi-turn conversation and text generation. After comprehensively comparing the capabilities and licensing status of various open source models, ChatGLM-6B was selected as the large language model. Then, combined with training data from the conversational billing risk control field and the corresponding prompt engineering (i.e., the prompt information mentioned above), ChatGLM-6B was fine-tuned using the LoRA approach to obtain a language model suitable for billing risk control. The reason for selecting ChatGLM-6B is that it is a bilingual Chinese-English language model with 6.2 billion parameters. By using the same technology as ChatGLM, ChatGLM-6B has initial Chinese question-answering and conversational capabilities. Specifically, ChatGLM-6B has the following features: 1) Extensive bilingual pre-training in both Chinese and English; 2) Optimized model architecture and size; 3) Low deployment requirements, allowing deployment on consumer-grade graphics cards; and 4) Longer sequence lengths, enabling support for longer conversations and applications. 5) Human Intent Alignment Training: Using supervised fine-tuning, feedback bootstrap, and reinforcement learning from human feedback, the model initially develops the ability to understand the intent of human commands. The output format is Markdown for easy presentation. The open-source model can be fully modified based on performance and needs without affecting other processes.
[0221] The following describes how to obtain training corpus in the field of billing risk control. The training corpus in the field of conversational billing risk control can include two parts: risk control business knowledge corpus data and risk control data analysis scenario conversation data.
[0222] In actual implementation, the risk control business knowledge corpus data is acquired as follows: chat logs from daily communication conversations for billing risk control data analysis, text information in reports, business documentation, and other unstructured text data. Further data preprocessing can be performed based on the corpus type. Specifically, for chat log data, the output of the chat log owner (i.e., the risk control data analyst) is used as the output, and the content of other individuals is used as the input. For text article information, the title or introduction is used as the input, and the detailed content of the article is used as the output. At the same time, some commonly used billing risk control business factual knowledge is manually created, such as common risks, common illegal activities and phenomena, frequently observed indicators, indicator calculation calibers, and proprietary calculation terms. A summary of this content is used as the input, and the detailed content is used as the output.
[0223] In actual implementation, the second part involved acquiring conversational data for risk control data analysis scenarios. Several risk control data analysts were invited to review risk data analysis ideas and transform them into question-and-answer format, accumulating over a hundred complete sets of question-and-answer data. The ChatGPT model was then used to simulate and replicate numerous conversations, accumulating approximately 10,000 conversational data items.
[0224] Finally, the two parts of the corpus obtained above are normalized, and the normalized data are combined in a random order and divided into training data sets, test data sets, validation data sets, etc. For example, the two parts of the corpus can be normalized using the following JSON structure to obtain the real training corpus in the field of billing risk control:
[0225] {“input”: “title introduction of the conversation content or article”,
[0226] "output": "Details of the conversation or article with the risk control data analyst"}
[0227] In this embodiment, if Figure 13A As shown, a language model suitable for risk control is derived based on ChatGLM-6B. This language model possesses at least multi-round conversation capabilities, intent recognition, and parameter generation (text translation). The language model takes natural language text related to the user's analysis task as input, processes the data, and obtains task parameters that meet the requirements of the data analysis platform. These task parameters are then input into the data analysis platform to complete the data analysis task.
[0228] In actual implementation, Figure 13B As shown, the language model used to perform data analysis can include two sub-language models: a first sub-language model (LLM1) capable of multi-round conversation and intent recognition (referred to as the first language model above) and a second sub-language model (LLM2) capable of parameter generation (referred to as the second language model above). The computer device receives natural language input from the user and, with the assistance of corresponding prompts, guides the user through a multi-round conversation with LLM1 around the analysis task, completing all elements required for the task. When the conversation reaches a stop condition, the computer device performs intent recognition on the multi-round conversation, determines the user's specific intent for the analysis task, and obtains a JSON-formatted task description. LLM2 is then called to rewrite the task description and generate task parameters that can be recognized by the subsequent data analysis platform. The task parameters can be stored in the form of a structured parameter group. Finally, the data analysis platform is called, using the task parameters as input to construct a query statement related to the analysis task. The query statement then queries the target data, executes the analysis task based on the target data, and obtains the analysis results.
[0229] like Figure 13C As shown, number 1 shows the multi-round conversation between LLM1 and the user around the analysis task "" with the assistance of prompt information. Number 2 is the task description text in JSON format obtained by intent recognition for the multi-round conversation, including all the preset elements of the analysis task (time, channel, business, currency and dimension). Then, by calling LLM2, the task description text shown in number 2 is rewritten to obtain the task parameters shown in number 3. The task parameters are displayed in the form of parameter groups, such as target_data representing the name of the parameter group. The parameter group includes preset elements and key data of the preset elements obtained by mapping through operators. Finally, number 3 is used as the input parameter of the subsequent risk control field data analysis platform to construct a query statement for the target data, obtain the target data according to the query statement, complete the data analysis for the analysis task, and obtain the analysis results.
[0230] The application of the embodiments of the present application has the following beneficial effects:
[0231] 1) Flexible, autonomous, and analytically focused
[0232] Based on the user's natural language input, the system can focus on outputting the data conclusions that the user is interested in. This avoids the problem of modeled data analysis results being too general and too focused, and also avoids the problem of users having to have a considerable understanding of the data in order to generate data analysis using traditional point-and-click interfaces.
[0233] 2) Lowering the technical threshold and learning costs for the product, as well as reducing the coding and data structure requirements for domain analysts. The model integrates specialized domain knowledge in billing and risk control, assisting users in generating data analysis requirements and producing results through dialogue. This significantly reduces user expertise requirements and the learning costs of the product.
[0234] 3) The trained data analysis products are for external users and need to be user-friendly, practical, and highly productized.
[0235] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0236] Based on the same inventive concept, the present application also provides a data analysis device for implementing the aforementioned data analysis method. The solution to the problem provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more data analysis device embodiments provided below can be found in the above-mentioned limitations of the data analysis method and will not be repeated here.
[0237] In one embodiment, Figure 14 As shown, a data analysis device is provided, including: a conversation module 1410, an identification module 1420, a rewriting module 1430 and an analysis module 1440, wherein:
[0238] The conversation module 1410 is used to call the first language model to conduct multiple rounds of conversations with the target object around the analysis task; the first language model is obtained by training the large language model with corpus in a preset business field.
[0239] The identification module 1420 is configured to perform intent identification based on the multiple rounds of conversations to obtain task description content according to the multiple rounds of conversations.
[0240] The rewriting module 1430 is used to call a second language model to rewrite the task description content to obtain task parameters in a preset format; the second language model is obtained by training a large language model with task description samples in a preset business field.
[0241] The analysis module 1440 is used to transmit the task parameters to the data analysis platform to instruct the data analysis platform to perform the analysis task based on the task parameters to obtain data analysis results.
[0242] In some embodiments, the conversation module is further used to determine historical conversations generated during the interaction between the large language model and the target object; determine first prompt information for the current round based on the historical conversations, input the first prompt information for the current round into the first language model, and output the first conversation for the current round through the first language model; obtain the second conversation for the current round fed back by the target object; update the historical conversation based on the first conversation and the second conversation, and return to the step of determining prompt information for the current round based on the historical conversation until a conversation stop condition is met.
[0243] In some embodiments, the conversation module is also used to determine multiple preset elements related to the analysis task; during each round of conversation, the preset elements that have appeared in the historical conversation are determined. If all the preset elements related to the analysis task appear in the historical conversation, it is determined that the conversation stop condition is met.
[0244] In some embodiments, the identification module is also used to perform intent recognition based on multiple rounds of conversations to obtain at least one demand intention; determine key data corresponding to each preset element from the multiple rounds of conversations; and generate structured task description content related to the analysis task based on the demand intention and the key data.
[0245] In some embodiments, the rewriting module is also used to obtain rewriting instructions, generate second prompt information based on the rewriting instructions and the task description content; input the second prompt information into the second language model, and output task parameters in a preset format through the second language model; the preset format is a format compatible with the data analysis platform.
[0246] In some embodiments, the rewriting module is also used to extract key data in the second prompt information through a second language model, and determine the operators that match each key data according to the preset elements corresponding to each key data, and construct task parameters in a preset format based on each key data and the operators that match each key data.
[0247] In some embodiments, the analysis module is also used to construct a query statement based on the task parameters; send the query statement to the data analysis platform to instruct the data analysis platform to perform data query based on the query statement, perform data analysis based on the queried data, and obtain data analysis results.
[0248] In some embodiments, the conversation module is also used to obtain a first training corpus within a preset business field, perform perturbation processing on the business keywords in the first training corpus to obtain a second training corpus; construct a first model to be trained based on the original model parameters of the large language model and the matrix parameters of the first bypass branch; process the first training corpus through the first model to be trained to obtain a first prediction output; process the second training corpus through the first model to be trained to obtain a second prediction output; adjust the matrix parameters of the first bypass branch according to the difference between the first prediction output and the second prediction output to train the first model to be trained, and obtain a first language model when the training is completed.
[0249] In some embodiments, the conversation module is also used to obtain knowledge corpus and scenario dialogues within a preset business field; normalize the knowledge corpus according to the corpus type of the knowledge corpus to obtain multiple first question-answer text pairs; generate multiple second question-answer text pairs using the scenario dialogues as examples; and determine the first training corpus based on the first question-answer text pairs and the second question-answer text pairs.
[0250] In some embodiments, the conversation module is further used to compare the first prediction output and the second prediction output, and determine the degree of influence of each word in the first training corpus on the prediction output based on the comparison results; freeze the original model parameters of the large language model, and adjust the matrix parameters of the first bypass branch according to the degree of influence corresponding to the disturbed business keywords to train the first model to be trained.
[0251] In some embodiments, the rewriting module is also used to obtain task description samples within a preset business field, perturb the business keywords in the task description samples to obtain perturbed task description samples; construct a second model to be trained based on the original model parameters of the large language model and the matrix parameters of the second bypass branch; process the task description samples through the second model to be trained to obtain a third prediction output; process the perturbed task description samples through the second model to be trained to obtain a fourth prediction output; adjust the matrix parameters of the second bypass branch according to the difference between the third prediction output and the fourth prediction output to train the second model to be trained, and obtain a second language model when the training is completed.
[0252] Each module in the above-mentioned data analysis device can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor of the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.
[0253] In some embodiments, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 15 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data analysis method is implemented.
[0254] Those skilled in the art will understand that Figure 15The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0255] In some embodiments, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0256] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0257] In some embodiments, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0258] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0259] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-mentioned embodiments. In particular, any reference to memory or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. For purposes of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The processors involved in the various embodiments provided herein may be processors, central processing units (CPUs), graphics processors (GPUs), digital signal processors (DSPs), programmable logic units (PLMs), data processing logic units based on quantum computing, and the like, without limitation.
[0260] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0261] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A data analysis method, characterized in that: The method comprises: Calling the first language model to conduct multiple rounds of conversations with the target object around the analysis task; the first language model is obtained by training the large language model using corpus within a preset business domain; performing intent recognition based on the multiple rounds of conversations to obtain task description content according to the multiple rounds of conversations; Calling a second language model to rewrite the task description content to obtain task parameters in a preset format; the second language model is obtained by training a large language model with task description samples in a preset business domain; The task parameters are transmitted to the data analysis platform to instruct the data analysis platform to perform the analysis task based on the task parameters to obtain data analysis results.
2. The method according to claim 1, characterized in that The calling of the first language model to conduct multiple rounds of conversations with the target object around the target analysis task includes: Determine historical conversations generated during the interaction between the first language model and the target object; Determining first prompt information of a current round based on the historical conversation, inputting the first prompt information of the current round into a first language model, and outputting a first conversation of the current round through the first language model; Obtaining feedback from the target object in the second session of the current round; The steps of updating the historical session based on the first session and the second session and returning to determine the prompt information of the current round based on the historical session are continued until a session stopping condition is met.
3. The method according to claim 2, characterized in that The method further comprises: Identify multiple pre-set elements related to the analysis task; During each round of conversation, the preset elements that appeared in the historical conversation are determined. If all the preset elements related to the analysis task appear in the historical conversation, it is determined that the conversation stop condition is met.
4. The method according to claim 1, wherein The performing intent recognition based on the multiple rounds of conversations to obtain task description content according to the multiple rounds of conversations includes: Performing intent recognition based on the multiple rounds of conversations to obtain at least one demand intent; Determining key data corresponding to each preset element from the multiple rounds of conversations; Based on the demand intention and the key data, a structured task description content related to the analysis task is generated.
5. The method according to claim 1, characterized in that The calling of the second language model to rewrite the task description content to obtain task parameters in a preset format includes: Obtaining a rewriting instruction, and generating second prompt information based on the rewriting instruction and the task description content; The second prompt information is input into a second language model, and the task parameters in a preset format are output through the second language model; the preset format is a format compatible with the data analysis platform.
6. The method according to claim 5, characterized in that Outputting the task parameters in a preset format through the second language model includes: The key data in the second prompt information is extracted through the second language model, and the operators that match each key data are determined according to the preset elements corresponding to each key data. Based on each key data and the operators that match each key data, task parameters in a preset format are constructed.
7. The method according to claim 1, characterized in that The transmitting the task parameters to the data analysis platform to instruct the data analysis platform to perform the analysis task based on the task parameters to obtain the data analysis results includes: Constructing a query statement according to the task parameters; The query statement is sent to the data analysis platform to instruct the data analysis platform to perform data query according to the query statement, perform data analysis based on the queried data, and obtain data analysis results.
8. The method according to any one of claims 1 to 7, characterized in that The training steps of the first language model include: Obtaining a first training corpus within a preset business domain, and performing perturbation processing on business keywords in the first training corpus to obtain a second training corpus; Constructing a first to-be-trained model based on original model parameters of the large language model and matrix parameters of the first bypass branch; Processing the first training corpus using a first to-be-trained model to obtain a first prediction output; Processing the second training corpus using the first to-be-trained model to obtain a second prediction output; According to the difference between the first prediction output and the second prediction output, the matrix parameters of the first bypass branch are adjusted to train the first model to be trained, and a first language model is obtained when the training is completed.
9. The method according to claim 8, characterized in that The obtaining of the first training corpus in the preset business domain includes: Acquire knowledge corpus and scenario dialogues within the preset business domain; Normalizing the knowledge corpus according to the corpus type of the knowledge corpus to obtain a plurality of first question-answer text pairs; Generating a plurality of second question-answer text pairs using the scene dialogue as an example; A first training corpus is determined based on the first question-answer text pair and the second question-answer text pair.
10. The method according to claim 8, characterized in that The adjusting the matrix parameters of the first bypass branch according to the difference between the first prediction output and the second prediction output to train the first to-be-trained model includes: Comparing the first predicted output with the second predicted output, and determining, based on the comparison result, the degree of influence of each word in the first training corpus on the predicted output; The original model parameters of the large language model are frozen, and the matrix parameters of the first bypass branch are adjusted according to the impact degree corresponding to the disturbed business keywords, so as to train the first model to be trained.
11. The method according to any one of claims 1 to 7, characterized in that The training steps of the second language model include: Obtaining a task description sample within a preset business domain, performing perturbation processing on key data in the task description sample, and obtaining a perturbed task description sample; Constructing a second to-be-trained model based on the original model parameters of the large language model and the matrix parameters of the second bypass branch; Processing the task description sample using a second to-be-trained model to obtain a third prediction output; Processing the perturbed task description sample using a second to-be-trained model to obtain a fourth prediction output; According to the difference between the third prediction output and the fourth prediction output, the matrix parameters of the second bypass branch are adjusted to train the second model to be trained, and a second language model is obtained when the training is completed.
12. A data analysis device, characterized in that: The device comprises: A conversation module is used to call a first language model to conduct multiple rounds of conversations with the target object around the analysis task; the first language model is obtained by training a large language model using corpus within a preset business domain; an identification module, configured to perform intent recognition based on the multiple rounds of conversations to obtain task description content according to the multiple rounds of conversations; A rewriting module is configured to call a second language model to rewrite the task description content to obtain task parameters in a preset format; the second language model is obtained by training a large language model with task description samples within a preset business domain; The analysis module is used to transmit the task parameters to the data analysis platform to instruct the data analysis platform to perform the analysis task based on the task parameters to obtain data analysis results.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.