Data analysis device
The data analysis device addresses the challenge of inaccurate responses to natural language instructions by generating context-specific system prompts for the pre-learning language model, significantly improving response accuracy and user convenience.
Patent Information
- Application Number
- JP2023177164
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2025-04-24
AI Technical Summary
Existing data analysis devices struggle to accurately respond to natural language instructions in data analysis due to the lack of specialized background information and appropriate system prompts for large-scale language models (LLM).
A data analysis device that generates a system prompt by assigning analysis background information, including relation information between data tables, to a pre-existing prompt template. This system prompt is then used to improve the accuracy of responses from a pre-learning language model by providing context-specific instructions.
The proposed solution enhances the accuracy of responses to natural language instructions in data analysis by providing context-specific prompts to the pre-learning language model, thereby improving user convenience and data analysis efficiency.
Smart Images

Figure 2025067282000001_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a data analysis device capable of analyzing various types of data. [Background technology]
[0002] For example, as disclosed in Patent Document 1, a data analysis device that analyzes data to be analyzed is known that, when data to be analyzed is input, determines attributes of the aggregation targets and attributes of the aggregation units, and automatically generates new candidate objective variables by aggregating attribute values of the attributes of the aggregation targets for each attribute value of the aggregation units based on an aggregation function. In the data analysis device of Patent Document 1, new candidate objective variables can be displayed on a monitor so that the user can grasp them, and when the user selects a target variable, new feature quantities are automatically generated. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2020-135054 A Summary of the Invention [Problem to be solved by the invention]
[0004] In recent years, the performance of large-scale language models (hereinafter simply referred to as LLM), which is one type of generative AI technology, has improved significantly, and many chat services that behave naturally like humans have appeared. LLM technology is not only used as a chat service, but is also used in a wide range of applications, such as searching manuals and responding to users' questions in a natural format through chat, or interpreting users' natural language instructions as support for GUI operations and performing operations on the service instead.
[0005] Therefore, it is thought that incorporating LLMs into Web services or software that provide data analysis functions can improve user convenience. However, since LLMs are general-purpose models that are not specialized for a specific field, in order to make them behave in a specialized manner for a specific purpose, it is necessary to appropriately add additional command text (system prompts) to control the behavior of the LLM in addition to the user's input text. In particular, when installing an LLM for the purpose of assisting data analysis, the LLM will not be able to respond appropriately unless the content related to the data that the user is analyzing is included in the analysis background information.
[0006] The present disclosure has been made in consideration of the above points, and has as its object to improve the accuracy of responses to instructions in natural language format by a user in data analysis. [Means for solving the problem]
[0007] In order to achieve the above object, the present embodiment can be premised on a data analysis device that analyzes data using relation information that defines a relationship between attributes included in a plurality of data tables. The data analysis device includes a data input unit that accepts input of a data table having a plurality of attributes, a reception unit that accepts input information in a natural language format by a user, a background information acquisition unit that acquires table information indicating a plurality of data tables to be subjected to data analysis from among the data tables input by the data input unit as analysis background information, a prompt generation unit that acquires a prompt template used for data analysis from a storage unit and generates a system prompt by assigning the input information accepted by the reception unit and the analysis background information acquired by the background information acquisition unit to the acquired prompt template, an input / output control unit that generates text information including the input information accepted by the reception unit and the system prompt generated by the prompt generation unit, transmits the generated text information to a pre-trained language model capable of interpreting natural language, and receives a response output from the pre-trained language model by the transmission, and a display control unit that generates display data based on the response received by the input / output control unit.
[0008] According to this configuration, when input information in natural language format by a user is accepted, a system prompt is generated by assigning the input information in natural language format by the user and table information indicating a plurality of data tables to be subjected to data analysis to a prompt template. At this time, since a pre-stored prompt template is used for data analysis, a system prompt suitable for data analysis is generated. Since this system prompt suitable for data analysis and the input information in natural language format by the user are transmitted to a pre-trained language model, a response output from the pre-trained language model becomes a highly accurate response to an instruction in natural language format by the user in data analysis. Then, display data is generated based on this highly accurate response and provided to the user.
[0009] In the data analysis device according to this aspect, it is possible to set relation information that defines the relationship between attributes included in the multiple data tables inputted by the data input unit. In this case, the background information acquisition unit can acquire, as analysis background information, the relation information that defines the relationship between attributes included in the multiple data tables that are the subject of data analysis among the data tables inputted by the data input unit, and therefore it is possible to reflect the relation information when generating a system prompt.
[0010] In the data analysis device of this embodiment, it is possible to check whether the authority to send text information to the pre-trained language model is valid, and if the authority is determined to be valid, a system prompt is generated, while if the authority is determined to be invalid, no system prompt is generated.
[0011] In other words, in this embodiment, since it is possible to accept input information in a natural language format from a user, it is possible to provide an interface that allows a user to freely input text. When such an interface is provided, there is a possibility that confidential information may be included in the input information from the user.
[0012] In addition, when using LLM as a pre-trained language model, a large amount of computational resources are required, so external LLM services provided in the form of APIs may be used. When a data analysis device is equipped with an LLM function, the user's analysis data is sent to the external LLM service, but the analysis data often contains confidential or personal information, and the user often does not want to send it to a third party.
[0013] In particular, when using LLM, the context information to be added is dynamically determined depending on the user's input and operation, so it is not known in advance what information will be sent to the outside. Furthermore, LLM service providers may use the received data for monitoring or as learning data for LLM, and it is possible that the transmitted information may be leaked to a third party via the learned LLM.
[0014] In response to this, by allowing the generation of a system prompt only when the authority to send text information to the pre-trained language model is determined to be valid, it is possible to avoid sending data directly to an external LLM or extracting the system prompt and sending it to an external LLM via another service.
[0015] When the authority to transmit text information to the pre-trained language model is determined to be invalid, the display control unit can generate display data in which the reception unit is disabled. This can prevent data from being transmitted to the outside. When the reception unit is configured as a user interface, for example, the reception unit can be disabled by not displaying it or by graying it out.
[0016] In addition, when the authority to send text information to the pre-trained language model is determined to be invalid, data can be prevented from being sent externally by not sending text information including input information in natural language format by the user and system prompts to the pre-trained language model.
[0017] In addition, a log can be generated by associating a timestamp indicating the date and time when text information was sent to the pre-trained language model with analysis background information and the input information accepted by the accepting unit, and the log can be accumulated sequentially. For example, it is possible to accumulate only data required as a log, rather than the system prompt itself.
[0018] The log can also be generated by further associating the response output from the pre-trained language model with the timestamp. In this case, the log can be stored sequentially at the timing when the response output from the pre-trained language model is received by the input / output control unit. This allows the response content to be stored in association with the timestamp, so that, for example, the presence or absence of a communication error and conversation exchanges (conversation history) can also be recorded.
[0019] A setting as to whether or not to permit data to be transmitted to the pre-trained language model can also be accepted. In this case, the background information acquisition unit can acquire, as analysis background information, data excluding data in columns set as not permitted to be transmitted to the pre-trained language model. This can prevent, for example, confidential information from leaking to the outside, thereby achieving a balanced response between the efficiency of data analysis work and confidentiality management.
[0020] The input / output control unit can determine whether the system prompt includes data of a column set to be not permitted to be transmitted to the pre-trained language model, and when it is determined that the system prompt includes data of a column set to be not permitted to be transmitted to the pre-trained language model, can not transmit the prompt to the pre-trained language model. In other words, if confidential information is not transmitted to the outside, external services such as LLM can be used, so that a balanced response between business efficiency and confidentiality management can be achieved. In addition, since it can be set so that confidential information is not transmitted to the outside, external services can be used with peace of mind.
[0021] The background information acquisition unit determines whether data included in a data table input by the data input unit is permitted to be transmitted to the pre-trained language model, and if it is determined that the transmission of the data is permitted, acquires multiple data tables to be subjected to data analysis, extracts output values having a number of data less than the number of data included in each data table based on the data included in the acquired multiple data tables, and outputs the extracted output values to the prompt generation unit as analysis background information. This makes it possible to reduce the number of data items to be output to an external service, and to avoid an increase in the amount of transmitted data.
[0022] The input / output control unit can determine whether the response output from the pre-trained language model complies with the rule, and when it is determined that the response output from the pre-trained language model does not complies with the rule, instruct the prompt generation unit to generate a retry prompt. In this case, the prompt generation unit acquires a template of a retry prompt from a storage unit, and generates a retry prompt by embedding the response output from the pre-trained language model and an error message indicating that the rule is not complied with in the acquired template of the retry prompt. In this way, by generating a retry prompt including an error content, it is possible to prevent the pre-trained language model from outputting a similar response again.
[0023] The input / output control unit can transmit the system prompt generated by the prompt generation unit to a server, and transmit the system prompt transmitted to the server to the pre-trained language model. This can improve the security of access to the external service, since the user does not need to possess a "key" for accessing the external service. In addition, when the external service cannot be used due to a system failure or the like, it is possible to use another external service or to connect to a simple LLM prepared by a provider of an analysis service using a data analysis device instead. Effect of the Invention
[0024] As described above, a system prompt is generated by assigning natural language input information by the user and table information indicating multiple data tables to be the subject of data analysis to a prompt template used in data analysis, and text information including this system prompt and the natural language input information by the user is sent to the pre-trained language model, thereby improving the accuracy of responses to natural language instructions by the user in data analysis. [Brief description of the drawings]
[0025] [Figure 1]FIG. 1 is a diagram showing a schematic configuration of a data analysis device according to an embodiment of the present invention. [Diagram 2] FIG. 2 is a block diagram of the data analysis device. [Diagram 3] FIG. 3 is a conceptual diagram showing a case where data is selected and a project is created. [Figure 4] FIG. 4 is a diagram showing a user interface for setting a relationship. [Diagram 5] FIG. 5 is a diagram illustrating an example of a relationship between data. [Figure 6] FIG. 6 is a diagram for explaining three types of multiplicity. [Figure 7] FIG. 7 is a diagram showing an example of a project list screen. [Figure 8] FIG. 8 is a diagram showing an example of a project screen. [Figure 9] FIG. 9 is a diagram showing an example of a chat screen when searching for documents related to an analysis service. [Figure 10] FIG. 10 is a diagram showing an example of a chat screen when searching for content within the analysis service. [Figure 11] FIG. 11 is a diagram showing an example of a chat screen when values are being tallied. [Figure 12] FIG. 12 is a diagram showing an example of a chat screen when data is visualized. [Figure 13] FIG. 13 is a diagram showing an example of an initial message screen. [Figure 14] FIG. 14 is a diagram showing an example of a chat setting screen for an administrator. [Figure 15] FIG. 15 is a flowchart showing an example of the entire process executed by the data analysis apparatus. [Figure 16] FIG. 16 is a flowchart showing an example of the authority / permission status confirmation process. [Figure 17] FIG. 17 is a diagram for explaining the types, contents and examples of analytical background information. [Figure 18] FIG. 18 is a diagram showing an example of data stored in the conversation history storage area. [Figure 19] FIG. 19 is a diagram showing an example of a prompt template. [Figure 20] FIG. 20 is a diagram showing an example of text to be embedded in a prompt template. [Figure 21] FIG. 21 is a diagram showing the difference between a case where all information is transmitted to a pre-trained language model and a case where transmission of some information is disabled. [Figure 22] FIG. 22 is a flowchart showing an example of a process when a large amount of text is input to a pre-trained language model. [Diagram 23] FIG. 23 is a flowchart illustrating an example of a process executed by the input / output control unit. [Figure 24] FIG. 24 is a diagram showing an example of a response of a pre-trained language model. [Diagram 25] FIG. 25 is a diagram showing an example of a retry prompt. [Figure 26] FIG. 26 is a flowchart showing an example of a task execution process at the time of a search task. [Figure 27] FIG. 27 is a diagram showing an example of a QA prompt. [Figure 28] FIG. 28 is a sequence diagram from text transmission to task completion in the case of visualization. [Figure 29] FIG. 29 is a sequence diagram showing the process from text transmission to task completion in the case of document search. [Diagram 30] FIG. 30 is a diagram illustrating an example of log acquisition. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0026] Hereinafter, the embodiments of the present invention will be described in detail with reference to the drawings. Note that the following description of the preferred embodiments is merely illustrative in nature and is not intended to limit the present invention, its applications, or its uses.
[0027] FIG. 1 is a diagram showing a schematic configuration of a data analysis apparatus 1 according to an embodiment of the present invention, and FIG. 2 is a block diagram of the data analysis apparatus 1. The data analysis apparatus 1 is an apparatus for analyzing data to be analyzed, and a data analysis method can be executed by using the data analysis apparatus 1. The data analysis apparatus 1 is configured to be capable of executing software that can import data from various data sources such as databases and CSVs, and perform data analysis of the imported data. In the description of this embodiment, a case where the present invention is applied to an on-premise product constructed on a computer network of a user company is shown, but the present invention is not limited to on-premise products and can also be applied to web services executed on a cloud, as described later.
[0028] (Overall configuration of data analysis device 1) 1 and 2, the data analysis device 1 is a device that analyzes data using relation information that defines the relationships between attributes included in multiple data tables, and can be configured to include, for example, a device main body 2, a monitor 3, a keyboard 4, and a mouse 5. The monitor 3, the keyboard 4, and the mouse 5 are connected to the device main body 2.
[0029] For example, a general-purpose personal computer can be made into the data analysis apparatus 1 by installing a program (data analysis software) capable of executing the control contents and processing contents described below, or the data analysis apparatus 1 can be configured with dedicated hardware on which the program is installed. For example, the program may be directly installed on a user's personal computer to use the personal computer as the data analysis apparatus 1, the program may be installed on a server to construct the data analysis apparatus 1, and each user may access and use the data analysis apparatus 1 from the browser of their own personal computer via a network, or it may be a service provided on the cloud, and each user may access the data analysis apparatus 1 on the cloud from the browser of their own personal computer.
[0030] Furthermore, the device body 2 and the monitor 3 may be integrated, or part of the device body 2 or part of the functions executed by the device body 2 may be built into the monitor 3.
[0031] The data analysis device 1 has a built-in communication module (not shown) and is configured to be capable of communicating with the outside world. This makes it possible to download data from an external server or transmit data to an external server via, for example, an Internet line.
[0032] The keyboard 4 and the mouse 5 are operating devices for operating the data analysis device 1, as well as input devices for inputting various information and selection devices for performing selection operations. In addition to the keyboard 4 and the mouse 5, or instead of the keyboard 4 and the mouse 5, a touch panel type input device, a voice input device, a pen type input device, or the like can be used.
[0033] (Monitor 3 configuration) The monitor 3 shown in FIG. 1 is, for example, an organic EL display or a liquid crystal display, and can be referred to as a display unit by itself, or the monitor 3 and the display control unit 3a shown in FIG. 2 can be referred to as a display unit together. The display control unit 3a may be built in the monitor 3 or in the device body 2. The display control unit 3a is composed of a display DSP that displays an image on the monitor 3. The display control unit 3a may include a video memory such as a VRAM that temporarily stores image data when displaying an image. The display control unit 3a transmits a control signal for displaying a predetermined image on the monitor 3 based on a display command (display command) sent from the CPU 11a of the main control unit 11 described later. For example, the display control unit 3a transmits a control signal for displaying on the monitor 3 various user interfaces as described later, as well as icons, and user operations and selections using the keyboard 4 and mouse 5. A pointer that can be operated using the mouse 5 can also be displayed on the monitor 3.
[0034] By configuring the monitor 3 as a touch panel type monitor, it is possible to provide the monitor 3 with a function for inputting various types of information, a function for operating the data analysis device 1, and a function for making selections.
[0035] (Overall configuration of device main body 2) The device main body 2 shown in Fig. 1 includes a control unit 10 and a storage device (storage section) 30. The storage device 30 is configured, for example, by a hard disk drive, a solid state drive (SSD), or the like, and has a plurality of storage areas as described below. Each storage area may be configured by a different storage device. The storage device 30 is connected to the control unit 10 and is controlled by the control unit 10, and is capable of storing various data and the like, as well as being capable of reading out the stored data and the like.
[0036] (Control unit 10) Although not specifically shown, the control unit 10 can be configured with an MPU, a system LSI, a DSP, dedicated hardware, etc. The control unit 10 is equipped with various functions as described below, which may be realized by a logic circuit or by executing software.
[0037] As shown in FIG. 2, the control unit 10 includes a main control unit 11, a data input unit 12, a reception unit 13, a setting unit 14, a background information acquisition unit 15, a prompt generation unit 16, and an input / output control unit 17. The control unit 10 further includes an authority confirmation unit 20, an authority information management unit 21, a log generation unit 22, and a project management unit 23. Although the individual parts of the control unit 10 are described separately as described above, the same parts may be configured to execute multiple types of processing, or may be further divided into multiple parts and configured to execute one processing in cooperation with each other. In addition, the individual parts 12 to 23 may not be separated, but may be integrated into one control unit 10 as hardware, in which case the control unit 10 executes the operations of the individual parts 12 to 23. The above hardware parts are connected via an electrical communication path (wiring) such as a bus B so as to be capable of two-way or one-way communication as necessary.
[0038] The main control unit 11 performs numerical calculations, arithmetic processing, and various information processing based on various programs, and also controls each part of the hardware. The main control unit 11 includes a CPU 11a that functions as a central processing unit, a work memory 11b such as a RAM that functions as a work area when the main control unit 11 executes various programs, and a program memory 11c such as a ROM, flash ROM, or EEPROM that stores a startup program, an initialization program, and the like.
[0039] First, an overview of each of the units 12-23 will be described, and the details of each of the units 11-23 will be described later. The data input unit 12 is a unit that accepts input of a data table having multiple attributes, and this data input unit 12 makes it possible to execute a data input step. Here, it is assumed that the data to be analyzed that is input is one or more tabular data (tables). The data to be analyzed input by the data input unit 12, setting information related to each analysis project, information related to the data, etc. are stored in the conversation history storage area 30b of the storage device 30.
[0040] The reception unit 13 is a part that receives input information in a natural language format by a user, and specifically, is configured as a text input unit that can input text. When a user inputs text into the reception unit 13, the user performs an input operation using the keyboard 4 or the mouse 5. This input operation by the user is received by the reception unit 13 as input information. The reception unit 13 makes it possible to execute a step of receiving input information in a natural language format.
[0041] The setting unit 14 is a part that sets, for example, relation information that defines the relation between attributes included in a plurality of data tables inputted by the data input unit 12. As will be described later, the information that can be set by the setting unit 14 is not limited to relation information. The setting unit 14 is capable of executing a relation information setting step.
[0042] The background information acquisition unit 15 acquires, as analysis background information, table information indicating multiple data tables that are to be subjected to data analysis among the data tables input by the data input unit 12. The background information acquisition unit 15 can also acquire, in addition to the table information, relation information that defines the relation between attributes included in the multiple data tables that are to be subjected to data analysis among the data tables input by the data input unit 12. The background information acquisition unit 15 is capable of executing the step of acquiring analysis background information.
[0043] The prompt generation unit 16 is a part that acquires a prompt template used for data analysis from the template storage area 30a of the storage device 30, and generates a system prompt by assigning the input information accepted by the acceptance unit 13 and the analysis background information acquired by the background information acquisition unit 15 to the acquired prompt template. The prompt generation unit 16 makes it possible to execute a system prompt generation step.
[0044] The input / output control unit 17 is a part that generates text information including the input information accepted by the accepting unit 13 and the system prompt generated by the prompt generating unit 16, transmits the generated text information to a pre-trained language model (shown as "LLM" in the figure) 6 capable of interpreting natural language, and receives a response output from the pre-trained language model 6 as a result of the transmission. The input / output control unit 17 makes it possible to execute a step of transmitting text information and a step of receiving a response.
[0045] The authority confirmation unit 20 generates authority confirmation information to confirm whether the authority to send text information to the pre-trained language model 6 is valid or not, and determines whether the authority is valid or not based on the response obtained by sending the authority confirmation information to the authority information management unit 21.
[0046] The log generating unit 22 acquires a timestamp indicating the date and time when the text information generated by the input / output control unit 17 was transmitted to the pre-trained language model 6. Then, the log generating unit 22 generates a log by associating the acquired timestamp with the analysis background information acquired by the background information acquiring unit 15, which is included in the text information, and the input information accepted by the accepting unit 13, and accumulates the log sequentially. The log is stored in a log storage area (first storage area) 30c of the storage device 30.
[0047] The project management unit 23 is a part that receives designation of multiple data tables to be analyzed among the data tables input by the data input unit 12, and designation of multiple columns to be analyzed among the multiple columns included in each data table. The project management unit 23 creates a first management table that associates table information indicating the specified multiple data tables with project information that identifies the analysis project, and a second management table that associates column information indicating the specified multiple columns with project information that identifies the analysis project.
[0048] The reception unit 13 is associated with an analysis project as shown in Fig. 7. When the reception unit 13 receives input information, the background information acquisition unit 15 identifies the analysis project associated with the reception unit 13. Based on the project information identifying the analysis project, the background information acquisition unit 15 can acquire table information indicating a plurality of data tables to be the subject of data analysis from, for example, a first management table, and can acquire column information indicating a plurality of columns to be the subject of data analysis from a second management table different from the first management table. The acquired column information can be used as analysis background information.
[0049] First, an overview of the process executed by the data analysis device 1 in this embodiment will be described. As shown in Fig. 3, this data analysis software allows the user to select one or more data from the data imported and create one or more projects.
[0050] The data to be analyzed is data that contains multiple attributes. An attribute is an item that consists of a pair of a name and a type included in the data to be analyzed; typical examples include user ID, age, and gender. The type of an attribute is a classification that defines what values the attribute can take; the classification method differs depending on the system, but in a typical relational database, for example, each attribute is assigned one of the following data types: INT type (integers), REAL type (real numbers), DATE type (dates), and VARCHAR type (character strings). In actual databases, a wide variety of other types are used in addition to these. Examples of INT types include age and purchase amount, examples of REAL types include interest rates, an example of DATE types includes date of birth, and examples of VARCHAR types include user name and email address.
[0051] After the data to be analyzed is imported, the data to be analyzed may be removed from the data to be analyzed and may be filled in as necessary. This may be performed by the user, or the data analysis device 1 may perform the part that can be executed by the data analysis device 1. For example, removal of any missing value, missing value removal and filling processing for adding missing items, replacement processing for replacing existing values with other values, deletion processing for deleting any column, addition processing for adding any column, formula input processing for inputting any formula into a cell, information addition processing for adding predetermined information to any column, etc. can be performed. By such processing, the data to be analyzed can be processed. Therefore, the data analysis device 1 can perform ETL processing, and by performing ETL processing, the data to be analyzed can be transformed into a form more suitable for analysis. This can further improve the accuracy of the analysis results.
[0052] Within a project, multiple analyses can be created using the imported data. For example, by dividing projects according to the type of analysis, department, or data to be referenced, each project can refer to only the necessary data and perform analysis efficiently. In the example shown in Figure 3, Data 1 and Data 2 are selected to create Project 1, and Analysis 1 and Analysis 2 are performed within Project 1. Data 1 and Data 3 are selected to create Project 2, and Analysis 3 and Analysis 4 are performed within Project 2.
[0053] Each project may hold a copy of the data received by the data input unit 12 within the project, or may refer to the original data. In a project that uses two or more data, a cross-data analysis can be performed by setting a relation that indicates the correspondence between the multiple data. Even between projects that use the same data, the relation settings may be different.
[0054] The setting of the relations between data can be performed by the setting unit 14 shown in Fig. 2. When the setting unit 14 detects that the input of the data to be analyzed is completed, it generates a user interface 51 for setting a relation shown in Fig. 4 and displays it on the monitor 3, and also accepts operations performed by the user on the user interface 51 for setting a relation.
[0055] The user interface for setting a relation 51 is provided with a first table name display area 51a and a second table name display area 51b for displaying the names of two data pairs. The user interface for setting a relation 51 is further provided with a first attribute selection area 51c for selecting and displaying one of a plurality of attributes included in the table displayed in the first table name display area 51a, and a second attribute selection area 51d for selecting and displaying one of a plurality of attributes included in the table displayed in the second table name display area 51b. The first attribute selection area 51c and the second attribute selection area 51d can be configured in the form of a pull-down menu, for example, and by clicking each of them, a list of the names of a plurality of attributes included in each table is displayed, and it is possible to select a desired attribute from among them. The selected attribute is an attribute designated by the user, and only the name of the designated attribute is displayed in the first attribute selection area 51c and the second attribute selection area 51d, and the names of attributes not designated are not displayed.
[0056] Relations between data are set by specifying the name of an attribute for each pair of tables (customer table and order table), as shown in an example in the relation setting user interface 51. As shown in FIG. 5, rows with matching values for the specified attributes are considered to correspond to each other. In the example shown in FIG. 5, the relation lines L show that "user001" in the "customer table" corresponds to "user001" in the "order table," "user002" in the "customer table" corresponds to "user002" in the "order table," and "user004" in the "customer table" corresponds to "user004" in the "order table."
[0057] In the case of a relational database, the correspondence between table attributes may already be defined on the database side. This correspondence defined on the database side is called a foreign key constraint. If there is a foreign key constraint, the setting unit 14 may read the already set correspondence and automatically set the relationship between the data.
[0058] When the relations between data are defined, the data analysis device 1 can automatically determine the degree of multiplicity for each corresponding relationship. The automatic determination of the degree of multiplicity is performed by the control unit 10. As shown in FIG. 6, there are three types of multiplicity: 1:1 type, 1:N type, and N:N type, which can be determined by referring to the contents of the tables. The 1:1 type is a relationship in which one row in one table corresponds to one row in the other table. The 1:N type is a relationship in which one row in one table corresponds to multiple rows in the other table. The N:N type is a relationship in which one row in one table corresponds to multiple rows in the other table, and one row in the other table corresponds to multiple rows in the one table.
[0059] Furthermore, each project can define its own aggregation formula (metrics) to be used in the analysis. Metrics are aggregation formulas that the user sets when performing analysis such as visualization in the aggregation analysis, and include information such as the columns to be aggregated, the aggregation function (total, average, etc.), and the metric name. Once a metric is defined within a project, it is stored in the storage device 30 or the like, and can be used in common for multiple analyses. This eliminates the need to define the aggregation method for each analysis.
[0060] For example, if you have imported data called "Sales History" into a project and you want to calculate unit price by aggregating the average value for the "Amount" column, you can define it as Unit Price = AVERAGE(Sales History:Amount), and then in each analysis you can call up the aggregation formula definition with the name "Unit Price".
[0061] FIG. 7 is a diagram showing a project list screen 60. The project list screen 60 is generated by the display control unit 3a and displayed on the monitor 3. The project list screen 60 includes project display icons 61, 62, and 63 indicating projects that have already been created, and also includes a new creation icon 64 for creating a new project. When the user selects an icon corresponding to a project that the user wishes to access from among the project display icons 61, 62, and 63, the control unit 10 accepts access to the project corresponding to the selected icon, and the user is able to access the project. On the other hand, when the user selects the new creation icon 64, the user is able to create a new project. When any one of the project display icons 61, 62, and 63 or the new creation icon 64 is selected, the display control unit 3a generates a project screen 70 shown in FIG. 8 and displays it on the monitor 3.
[0062] The project screen 70 is provided with a menu display area 71 and a main display area 72. The menu display area 71 displays menus such as "Chat," "Analysis," "Data to be analyzed," "Relationships," and "Metrics," and is capable of accepting selections by the user. From the menus displayed in the menu display area 71, it is possible to create analyses and to refer to and edit data, relations, and metrics associated with a project. Various information is displayed in the main display area 72 depending on the menu selected.
[0063] The data analysis device 1 is equipped with a chat function. In this embodiment, the chat function is provided that allows a plurality of tasks, including document search related to the analysis service, content search within the analysis service, value aggregation, and data visualization, to be used from one screen within a project. A chat screen exists independently for each project, and each user can use chat by accessing the chat screen within the project. For the text entered by the user through the reception unit 13, the data analysis device 1 automatically determines which of the above-mentioned plurality of tasks is required, executes the determined task, and displays the result on the chat screen.
[0064] FIG. 9 shows an example of a first chat screen 73 displayed in the main display area 72 of the project screen 70 when searching for documents related to an analysis service. The first chat screen 73 includes a chat input area 84 for receiving input information in a natural language format by the reception unit 13, a send button 83 for transmitting the contents input in the chat input area 84, a display area 73a for displaying the contents of the chat transmitted by operating the send button 83, a category display area 73b for displaying the category in which the data analysis device 1 interpreted the question input in the chat input area 84 and transmitted, an answer display area 73e for displaying the answer generated by the data analysis device 1 to the contents of the transmitted chat, a category selection area 73c, and a link display area 73d for displaying a link to an external content. A question can be input in a natural language format in the chat input area 84. The data analysis device 1 automatically determines the category of the question input in the chat input area 84, but it is possible that the determination result by the data analysis device 1 does not match the user's intention. In that case, the user can operate the category selection area 73c to forcibly select the intended category. For example, when "content search" is selected in the category selection area 73c and then text is transmitted, the result of the content search is always returned from the data analysis device 1. It is optional whether the category display area 73b, the category selection area 73c, and the link display area 73d are provided.
[0065] 10 shows an example of a second chat screen 74 displayed in the main display area 72 of the project screen 70 during a content search within the analysis service. Like the first chat screen 73, the second chat screen 74 also has a chat input area 84, a send button 83 for sending the content entered in the chat input area 84, a display area 74a for displaying the chat content sent by operating the send button 83, a category display area 74b, a response display area 74e for displaying a response generated by the data analysis device 1 to the sent chat content, a category selection area 74c, and a link display area 74d.
[0066] 11 shows an example of a third chat screen 75 displayed in the main display area 72 of the project screen 70 when values are tallied. The third chat screen 75 also has a display area 75a, a category display area 75b, a category selection area 75c, and an answer display area 75d, similar to the first chat screen 73. The third chat screen 75 also has an additional operation button 75e for detailed analysis. When it is detected that this additional operation button 75e has been operated, the data analysis device 1 analyzes the data in more detail.
[0067] 12 shows an example of a fourth chat screen 76 displayed in the main display area 72 of the project screen 70 when visualizing data. The fourth chat screen 76 is provided with a display area 76a, a category display area 76b, a category selection area 76c, and a reply display area 76d, similar to the first chat screen 73. The fourth chat screen 76 is provided with a result display area 76e in which the visualization results are displayed. In the result display area 76e, for example, a graph or the like can be displayed.
[0068] In this way, in addition to text, various contents such as links to external content, additional operation buttons 75e for detailed analysis, visualization results, etc. are displayed on the chat screens 73 to 76 as necessary. Note that it is not necessary to display all of these at once.
[0069] In this embodiment, an example is described in which four tasks are automatically determined: document search related to the analysis service, content search within the analysis service, value aggregation, and data visualization. However, it is also possible to add other tasks and automatically determine them, or to automatically determine any number of tasks up to three.
[0070] Examples of tasks include data processing, generation of explanatory text for data contents and columns, generation of explanatory text (insights) for analysis results, learning of machine learning models, acting as a proxy for GUI (Graphical User Interface) operations such as copying and sharing of analysis, and generating analysis ideas from data owned by the user, and the data analysis device 1 can automatically determine any one or more of these tasks. In addition, the user can specify any task.
[0071] As described above, when various functions are provided in one main display area 72, it is considered that the user does not know what kind of question to ask and has difficulty in asking a question. In response to this, when chat is selected in the menu display area 71 shown in FIG. 8, the display control unit 3a generates an initial message screen 80 including a question sample as shown in FIG. 13, displays it on the monitor 3, and presents it to the user. The initial message screen 80 is provided with a question sample display area 81. In the question sample display area 81, what kind of question is expected is displayed for each task. The question sample is an example of input information in a natural language format, and may be text, or may be in a form that allows the user to input the question sample as it is by clicking (an example of a selection operation) with the mouse 5 or the like, for example, without being merely text. The question sample may be dynamically generated by the control unit 10 by applying information such as the column name of the data input by the user through the data input unit 12 to a template, or may be a predetermined sentence that is displayed.
[0072] The initial message screen 80 is provided with a message display area 82 that displays a message requesting the user to confirm and agree to the usage permission at the time of first use. The message display area 82 is provided with a confirmation button 82a. Until the permission is agreed to, the display control unit 3a generates display data in which the chat send button 83 is disabled and displays the display data on the monitor 3. The send button 83 is a button for sending input information (e.g., text) in a natural language format inputted in the chat input area 84 to the pre-trained language model 6, and the input information in a natural language format inputted in the chat input area 84 is not sent to the pre-trained language model 6 unless the send button 83 is operated. The chat input area 84 and the send button 83 are also displayed on the first to fourth chat screens 73 to 76 shown in FIG. 9 to FIG. 12.
[0073] The display data in which the send button 83 is disabled is, for example, display data in which the send button 83 is displayed lighter (grayed out) than when it is enabled, data in which the send button 83 is erased, etc. On the other hand, when it is detected that the confirmation button 82a has been pressed by the user, the display control unit 3a generates display data in which the send button 83 is enabled and displays it on the monitor 3.
[0074] Disabling the send button 83 means that the send button 83 cannot be operated, and even if the send button 83 is operated, the operation is not accepted by the data analysis device 1. Moreover, enabling the send button 83 means that the send button 83 can be operated by the user, and the operation is accepted by the data analysis device 1. In this way, the chat function becomes available after consent to use is given.
[0075] Whether or not to permit chatting, who is permitted to chat if permitted, the type of information that permitted individuals can transmit when chatting, and so on are managed by an administrator of the data analysis device 1. This can be called a management function, and in this embodiment, the data analysis device 1 is provided with a management function. Providing the management function makes it possible to prevent confidential information and personal information from leaking out. The administrator can also be included in the users.
[0076] 14 shows a chat setting screen 90 for an administrator. When authentication of the administrator has been properly performed, the setting unit 14 causes the display control unit 3a to generate the chat setting screen 90 and display it on the monitor 3. Authentication of the administrator is performed, for example, by inputting a password or the like, biometric authentication, or the like.
[0077] In the chat setting screen 90, the target for which the chat function is enabled in the user company can be set. In the chat setting screen 90, for example, a target user setting area 91, an information type selection area 92, a table selection area 93, and a log output button 94 are provided. In the target user setting area 91, a first button 91a for allowing all users to chat, a second button 91b for not allowing all users to chat, and a third button 91c for allowing only a specified user or group to chat are provided. The setting unit 14 detects which of the first button 91a, the second button 91b, and the third button 91c has been operated by the administrator, and acquires the detection result. When the first button 91a is operated, all users who can use the data analysis device 1 can use chat on the data analysis device 1. When the second button 91b is operated, a so-called opt-out occurs, and all users cannot use chat on the data analysis device 1 until the administrator performs the permission operation again. This opt-out setting prevents all users from using chat screens 73 to 76 (shown in Figures 9 to 12), so that prompt generation unit 16 does not generate system prompts, allowing the administrator to avoid the risk of information being transmitted to the outside.
[0078] This example shows a case where the third button 91c is operated, in which case only a designated user or only a designated group (for example, a department or a section) can use chat on the data analysis device 1. In addition to the method of setting the targets for which the chat function is to be enabled using a GUI in this way, other methods can also be applied, such as a method of setting using a CUI (character user interface) when an administrator installs data analysis software on a server.
[0079] In the information type selection area 92, the administrator can set the type of information to be transmitted to the pre-trained language model 6. The information type selection area 92 is provided with a plurality of check buttons 92a for setting whether or not to transmit each of the table name, column name, data content, relation setting, and metrics definition. The setting unit 14 detects which check button 92a the administrator has checked and acquires the detection result. Only information for which the check button 92a has been checked is transmitted to the pre-trained language model 6, and other information is not transmitted to the pre-trained language model 6.
[0080] In the table selection area 93, it is possible to select a table and a column of the table to be transmitted to the pre-trained language model 6. In the example shown in FIG. 14, the customer master table and the sales history table are the tables to be transmitted, and the personnel evaluation table is set as a table not to be transmitted. Then, the customer master table is set to transmit columns other than the customer name column, and the sales history table is set to transmit all columns. The setting of the table and the column to be transmitted to the pre-trained language model 6 is accepted by the setting unit 14. That is, the setting unit 14 can accept a setting of whether or not to permit data included in the data table inputted by the data input unit 12 to be transmitted to the pre-trained language model 6, and at this time, it accepts a setting of whether or not to permit data included in each column to be transmitted to the pre-trained language model 6 for each column of the data table.
[0081] Of the information selected for transmission in the information type selection area 92, which information is actually acquired as analytical background information by the background information acquisition unit 15 is determined on a case-by-case basis by the data analysis device 1. However, information types, tables, and columns that are disabled here are controlled so that they are not acquired as analytical background information by the background information acquisition unit 15.
[0082] The log output button 94 is a button for outputting a log of data transmitted to the pre-trained language model 6. The log generating unit 22 executes log accumulation processing as described above, and outputs the logs accumulated up to that point when it detects that the log output button 94 has been operated by a user. Details of the log format will be described later, but for example, by acquiring a transmission log in which a timestamp is associated with a user name, an administrator can check when and which user used the chat function, and whether information that should not be transmitted has been transmitted by mistake.
[0083] As shown in FIG. 2, when transmitting information to the pre-trained language model 6, the API (Application Programming Interface) of the pre-trained language model 6 is not directly used from the user's network environment, but is routed through an intermediate server 7 of an analysis service provider that provides analysis services using the data analysis device 1. This is to perform user authentication for use of the API so that only users who have a license for data analysis software can use the API. This intermediate server 7 is capable of storing the contents of transmission and reception. The intermediate server 7 is also capable of analyzing the stored contents of transmission and reception. By analyzing the contents of transmission and reception, the data analysis service provider can use the results to improve the functions of the data analysis device 1.
[0084] The response output from the pre-trained language model 6 is received by the input / output control unit 17 via the intermediate server 7. The conversation history storage area (second storage area) 30b stores, as a conversation history, the analyzed background information acquired by the background information acquisition unit 15, the input information accepted by the acceptance unit 13, and the response output from the pre-trained language model 6. The conversation history storage area 30b can also be referred to as a short-term history storage area that temporarily saves the history.
[0085] The conversation history stored in the conversation history storage area 30b can be deleted, for example, by operating a delete button 95 shown in Fig. 14. Even when deleting the conversation history, the log stored in the log storage area 30c is not deleted. In other words, while the conversation history can be deleted at will by the user, the log cannot be deleted at will by the user and is accumulated in the data analysis device 1. This log storage area 30c can also be called a long-term history storage area, since the history is stored in a form in which it cannot be deleted.
[0086] By going through the intermediate server 7, the user does not need to possess a "key" for accessing the pre-trained language model 6. This can improve the security of access to the pre-trained language model 6. Furthermore, if the pre-trained language model 6 cannot be used due to a system failure or the like, it can be substituted by using another external service or connecting to a simple LLM or the like prepared by a provider of an analysis service using the data analysis device 1.
[0087] Next, the overall processing executed by the data analysis device 1 will be described with reference to the flowchart shown in Fig. 15. This flowchart starts after the administrator has completed settings using the chat setting screen 90 shown in Fig. 14, input of data tables, and the like, and the user has logged in to the data analysis device 1. In step SA1, the authority confirmation unit 20 confirms whether permission to use the chat function and consent to the above-mentioned usage permission have been granted.
[0088] Details of step SA1 will be described with reference to the flowchart shown in Fig. 16. In step SB1 after the start, the authority confirmation unit 20 confirms whether all users have disabled the chat function (opted out) based on the setting information acquired by the setting unit 14. If they have opted out, the flow does not proceed to the subsequent steps and ends. If they have not opted out, the flow proceeds to step SB2 and confirms whether the currently logged-in user is a user authorized to use the chat function.
[0089] That is, the authority confirmation unit 20 transmits identification information such as a user ID to the authority information management unit 21 as authority confirmation information for confirming whether the authority to transmit information to the pre-trained language model 6 is valid (whether the transmission of information is permitted). The authority information management unit 21 determines whether the currently logged-in user is a user permitted to transmit information to the pre-trained language model 6 based on the authority confirmation information and the setting information by the administrator using the chat setting screen 90 shown in FIG. 14. If the result of the determination is that the user is permitted to transmit information to the pre-trained language model 6, the authority confirmation unit 20 transmits information that the user is permitted to transmit information to the pre-trained language model 6, whereas if the user is not permitted to transmit information to the pre-trained language model 6, the authority confirmation unit 20 transmits information that the user is not permitted to transmit information to the pre-trained language model 6. The authority confirmation unit 20 can determine whether the authority to transmit information to the pre-trained language model 6 is valid based on the response from the authority information management unit 21.
[0090] If the current user has the authority to send information to the pre-trained language model 6, the process proceeds to step SB3, and the initial message screen 80 shown in Fig. 13 is displayed on the monitor 3. If the current user does not have the authority to send information to the pre-trained language model 6, the initial message screen 80 is not displayed on the monitor 3, and the user is prevented from accessing the chat function. Note that even if a person who does not have the authority to send information to the pre-trained language model 6 attempts to directly access the URL of the chat function, they are redirected to an inaccessible screen other than the initial message screen 80, and therefore cannot access the chat function.
[0091] When the user cannot use the chat function, information cannot be sent to the pre-trained language model 6, and therefore the prompt generation unit 16 does not generate a system prompt. That is, the prompt generation unit 16 is configured to generate a system prompt when the authority confirmation unit 20 determines that the authority is valid, and not to generate a system prompt when the authority confirmation unit 20 determines that the authority is invalid.
[0092] Furthermore, the input / output control unit 17 is configured to transmit the text information to the pre-trained language model 6 when the authority confirmation unit 20 determines that the authority is valid, and not transmit the text information to the pre-trained language model 6 when the authority confirmation unit 20 determines that the authority is invalid. In other words, the prompt generation unit 16 may generate a system prompt regardless of whether the authority is valid or invalid, but if the authority is invalid, the text information is not transmitted to the pre-trained language model 6, thereby preventing an unauthorized person from transmitting information to the pre-trained language model 6 without permission.
[0093] When the user is not allowed to access the chat function, the send button 83 is disabled. In this manner, when the authority verification unit 20 determines that the authority is invalid, the prompt generation unit 16 is configured not to generate a system prompt by causing the display control unit 3a to generate display data in which the send button 83 is disabled as display data in which the reception unit 13 is disabled.
[0094] In step SB4, it is determined whether the current user has agreed to the above-mentioned license. Whether the current user has agreed to the above-mentioned license is confirmed based on whether the confirmation button 82a on the initial message screen 80 shown in FIG. 13 has been operated. If the user has not agreed, the process proceeds to step SB5, and the message display area 82 in FIG. 13 is left displayed. After that, in step SB6, it is determined whether the current user has agreed to the above-mentioned license. If the user has not agreed, this flow ends.
[0095] If the user agrees to the license, the process proceeds to step SB7, where information indicating that the user has agreed to the license, i.e., consent information, is recorded in the storage device 30 or the like. If the user agrees to the license, the consent information is recorded, and then the process proceeds to step SB8, where the chat send button 83 is enabled, and the user becomes able to use the chat function. The consent information is recorded in association with the user ID. Therefore, the next time the same user accesses the site, the user is treated as having agreed, and the message display area 82 is not displayed. Steps SB4 to SB7 may be performed as necessary, and may be omitted if the user has obtained written consent in advance, for example. The above is the details of the process executed in step SA1 of FIG. 15.
[0096] In step SA2, the receiving unit 13 receives an input from the user. For example, when the user selects a question sample in the question sample display area 81 on the initial message screen 80 shown in Fig. 13, the selected question sample is received by the receiving unit 13 as input information in a natural language format and displayed in the chat input area 84. The user can freely input text in the chat input area 84, and the input text is received by the receiving unit 13 as input information in a natural language format and displayed in the chat input area 84. Note that, in this embodiment, only input in a text format is accepted, but the present invention is not limited to this. The receiving unit 13 may also receive information other than text by, for example, uploading a file to be analyzed.
[0097] The user input received by the receiving unit 13 is linked to two pieces of information, the user ID and the project ID (an ID identifying which project's chat screen the text was sent from), and transmitted to the prompt generating unit 16.
[0098] In step SA3, in response to an instruction from the prompt generating unit 16 that has received the user input information accepted by the accepting unit 13, the background information acquiring unit 15 extracts and acquires necessary information as analytical background information from the information stored in the conversation history storage area 30b. FIG. 17 illustrates the types of analytical background information, the contents of the analytical background information, and examples of the analytical background information. Types of analytical background information include, for example, table names, column names, and data types. The contents of the table names are indicated by the names of the tables selected as the analysis targets, and the contents of the column names are indicated by a list of the column names included in each table.
[0099] The background information acquisition unit 15 acquires a project ID and uses this project ID to query the conversation history memory area 30b, thereby obtaining metadata such as data, relations, metrics, etc. referenced by the project currently being analyzed.
[0100] For example, the conversation history storage area 30b stores the table name, column name, and data type (data_type) of data used in each project, as shown in Fig. 18. The background information acquisition unit 15 can add only information about the project currently being accessed by the user as analysis background information related to the data to be analyzed by inquiring about information on a row that matches the project ID from the conversation history storage area 30b. Similarly, for relation definitions and metrics definitions, only information about the project currently being accessed by the user can be added as analysis background information related to the data to be analyzed.
[0101] Since the pre-training language model 6 generally has a limit on the number of characters that can be input, the data content is extracted only with representative values, rather than extracting information from all rows in the table. Methods for extracting representative values include a method of randomly extracting some rows from the table and extracting values contained in each column, a method of calculating the frequency of occurrence of values for each column, and a method of pre-storing a list of values with the highest frequency of occurrence in the conversation history storage area 30b, and the like, but any method may be used.
[0102] In step SA4, the prompt generator 16 generates a system prompt based on the information acquired in steps SA2 and SA3. In this embodiment, a plurality of types of prompt templates are prepared and stored in the template storage area 30a, and the prompt generator 16 selects an arbitrary prompt template from these prompt templates and assigns the analysis background information acquired in step SA3 to the selected prompt template to generate a prompt.
[0103] An example of a prompt template is shown in Figure 19. Analysis background information is assigned to {now}, {version}, {dataset-info}, and {metrics-info} in the prompt template.
[0104] The {task-info} in the prompt template contains the definition of the currently available tasks. If all four tasks, Search documents related to analysis services, Search contents in analysis services, Aggregate values, and Visualize data, are available, the four texts shown in Figure 20 are embedded in {task-info}.
[0105] When the user specifies or selects a specific task, only the specified or selected task is assigned to {task-info}. Alternatively, some tasks may not be available depending on the contents set by the user and the usage status of the analysis service. For example, if the user refuses to send all analytical background information on the data, no information for visualizing the data or aggregating values can be sent to the pre-trained language model 6, so in that case only two tasks, document search and content search, are assigned to {task-info}. In this way, the prompt generation unit 16 generates a prompt by reflecting the user's setting operation and selection operation.
[0106] The table name, column name, data type, data content, and relation definition from among the analysis background information can be assigned to {dataset-info} in the prompt template. Depending on the enabled / disabled state of the transmission information set by the user, the prompt generation unit 16 switches the text actually assigned to {dataset-info} and controls the transmission of information so that information whose transmission has been disabled by the user is not included in the system prompt. Specifically, if the transmission of table names and column names is disabled by the user, the prompt generation unit 16 replaces the names of the table and column with dummy names such as "Table1". If the transmission of data types, data contents, and relations is disabled by the user, the prompt generation unit 16 does not add this information to {dataset-info}.
[0107] Fig. 21 shows the difference in {dataset-info} when all information is sent to the pre-trained language model 6 and when the sending of some information is disabled. The left side of Fig. 21 shows the case when all information is sent to the pre-trained language model 6, and the right side of Fig. 21 shows the case when the sending of some information is disabled. In the example shown on the right side of Fig. 21, data contents, table names, and relations are excluded from the information types, and the name column of the customer master is excluded from the items to be sent.
[0108] Generally, the more information included in the system prompt, the more likely it is that the pre-trained language model 6 will return a response that matches the user's intention. However, due to confidentiality management considerations, it is not always acceptable to send all information. Therefore, by making appropriate settings, an administrator can control the information embedded in the system prompt and use the functions of the pre-trained language model 6 to the extent that it does not violate the user company's data handling rules.
[0109] Incidentally, since a general pre-trained language model 6 has an upper limit on the amount of text that can be input, if information about all tables and columns stored in the conversation history storage area 30b is included in the analytical background information, the size may exceed the size that can be handled by the pre-trained language model 6. Therefore, in this embodiment, an information exclusion process shown in the flowchart of FIG.
[0110] In step SC1, the prompt generator 16 counts the total number of columns stored in the conversation history storage area 30b to obtain the amount of information, and compares the obtained amount of information with a threshold. If the number of columns is less than the threshold, the process proceeds to step SC2, where the prompt generator 16 assigns information about all tables and columns to a prompt template. This threshold is a value that is set according to the amount of text that can be input to the pre-trained language model 6.
[0111] If step SC1 is judged as YES and the number of columns is equal to or greater than the threshold, the process proceeds to step SC3, where the prompt generation unit 16 performs scoring to determine whether or not to include the columns in the analysis background information, and the process proceeds to step SC4. In step SC4, the prompt generation unit 16 excludes lower-level information, that is, does not include columns with low scores in the analysis background information. The process of step SC4 merely removes a portion of the information to be sent to the pre-trained language model 6, and does not delete the data stored in the conversation history storage area 30b. When the number of columns becomes less than the threshold as a result of the process of step SC4, the process proceeds to step SC2. In other words, when the prompt generation unit 16 narrows down the number of columns by scoring to less than the preset threshold, the information of the remaining columns is assigned to a prompt template to generate a system prompt.
[0112] There are various indices that the prompt generation unit 16 may use when performing scoring in step SC3, and any indices may be used. Examples of indices that may be used in scoring include adding points to columns that are frequently referenced by the user in analysis, evaluating the similarity between the user's input sentence and the column name or values contained in the column using natural language methods such as edit distance and vector (word2vec, etc.) similarity, adding points to columns that the user references in metrics, and adding points to columns that the user uses in relation settings. These methods may be combined, or scoring may be performed using a machine learning model that uses the results of each method as features.
[0113] Next, the processing of step SA5 shown in Fig. 15 will be described. In step SA5, various processes including transmission of information to the pre-trained language model 6 are executed by the input / output control unit 17. Details of the processing of step SA5 are shown in the flowchart of Fig. 23. In step SD1, a text to be sent to the pre-trained language model 6 is constructed by adding role information (role) to and combining the user input accepted by the acceptance unit 13 in step SA2 shown in Fig. 15, the system prompt generated by the prompt generation unit 16 in step SA4, and past conversation history information.
[0114] In step SD2, a step is executed in which it is evaluated whether or not the transmission text constructed in step SD1 can be transmitted to the pre-trained language model 6. This step SD2 may be omitted, but by adding checks from the following viewpoints and refusing transmission to the pre-trained language model 6 in the event of a problem or displaying a dialog box requesting the user to reconfirm, a more reliable chat function can be provided. The above viewpoints include, for example, detecting whether the user is attempting prompt injection, detecting that the user is using a word that falls under the disallowed word list built into the data analysis device 1, such as abusive words, and detecting the possibility that the user is unintentionally attempting to transmit information such as personal information.
[0115] For example, if a specific column in a table is set not to be sent, and an attempt is made to send a column with the same name in another table, it can be determined that the transmission is unintended. Alternatively, it can be determined whether the column name matches a specific keyword related to personal information, such as "name" or "My Number," and based on the results of this determination, it can be determined whether or not there is a possibility that personal information is being sent unintendedly.
[0116] Of the data included in the multiple data tables that are the subject of data analysis, the setting unit 14 can set the data that is not permitted to be transmitted to the pre-trained language model 6. In this case, the background information acquisition unit 15 acquires, as analysis background information, data included in the multiple data tables that are the subject of data analysis, excluding data in columns that are set by the setting unit 14 as not permitted to be transmitted to the pre-trained language model 6. This makes it possible to prevent data in columns that are set as not permitted to be transmitted to the pre-trained language model 6 from being transmitted to the pre-trained language model 6. When transmission to the pre-trained language model 6 is not permitted, instead of simply not outputting the data, dummy data may be generated, for example, by the LLM.
[0117] The background information acquisition unit 15 determines whether or not data included in the data table input by the data input unit 12 is permitted to be transmitted to the pre-trained language model 6. When it is determined that transmission of data to the pre-trained language model 6 is permitted, the background information acquisition unit 15 acquires multiple data tables to be subjected to data analysis, extracts output values having a smaller number of data items than the number of data items included in each data table based on the data included in the acquired multiple data tables, and outputs the extracted output values to the prompt generation unit 16 as analysis background information.
[0118] Furthermore, the input / output control unit 17 determines whether or not the system prompt generated by the prompt generation unit 16 includes data of a column set by the setting unit 14 as not permitted to be transmitted to the pre-trained language model 6. When it is determined that the system prompt generated by the prompt generation unit 16 includes data of a column set by the setting unit 14 as not permitted to be transmitted to the pre-trained language model 6, the input / output control unit 17 does not transmit a prompt to the pre-trained language model 6. This also makes it possible to prevent data of a column set as not permitted to be transmitted to the pre-trained language model 6 from being transmitted to the pre-trained language model 6.
[0119] Furthermore, the input / output control unit 17 determines whether the system prompt generated by the prompt generation unit 16 includes data of another column that holds the same data as the column that has been set by the setting unit 14 as not permitted to be transmitted to the pre-trained language model 6. When it is determined as a result of the determination that the system prompt includes other data that holds the same data as the column that has been set by the setting unit 14 as not permitted to be transmitted to the pre-trained language model 6, the input / output control unit 17 does not execute transmission of the prompt to the pre-trained language model 6.
[0120] If it is determined in step SD3 that the transmission text constructed in step SD1 cannot be transmitted, the process proceeds to step SD4, where the input / output control unit 17 outputs an error response and ends the process. If it is determined that the transmission text can be transmitted, the text is transmitted to the pre-trained language model 6 via the intermediate server 7 of the analysis service provider in the following step SD5.
[0121] When the input / output control unit 17 receives a response from the pre-trained language model 6 in step SD6, the log generation unit 22 generates a log in which the contents of the transmission and reception are associated with a timestamp and user information, records the log in the log storage area 30c, and sequentially accumulates the logs. Specifically, the log generation unit 22 receives the response output from the pre-trained language model 6 and also receives a timestamp indicating the date and time when the text information generated by the input / output control unit 17 was transmitted to the pre-trained language model 6. The log generation unit 22 then generates a log by further associating the response output from the pre-trained language model with the timestamp, and sequentially accumulates the generated logs in the log storage area 30c at the timing when the response output from the pre-trained language model 6 is received by the input / output control unit 17.
[0122] Once the log recording is complete, the process proceeds to steps SD7 and SD8, where the control unit 10 interprets the response contents from the pre-trained language model 6. If the pre-trained language model 6 determines in accordance with the received system prompt that a task will be used (if YES is determined in step SD7), it operates to respond with a command to execute the task, and if it determines that the task will not be used (if NO is determined in step SD7), it operates to respond with a response text.
[0123] Fig. 24 shows examples of responses from the pre-trained language model 6 corresponding to each task and to a case where no task is used. When any task is executed, the task execution itself cannot be performed by the pre-trained language model 6, so the pre-trained language model 6 determines which task to execute and with what parameters, and responds with the result in the form of text as shown in the example in Fig. 24.
[0124] The parameters are the query (search text) used for the search in the case of a search task, and the visualization setting information in the case of data visualization. The analysis background information embedded in the system prompt in step SA3 shown in Figure 15 is used to select the task and generate the parameters.
[0125] In the example shown in Figure 24, information on "Sales History", "Customer Master" (table name), "Era", "Amount", "Gender", "Date" (column name), and "Sales Amount" (metrics) are used directly as parameters. In addition, by embedding today's date as analysis background information, it is possible to generate an appropriate date range filter even in response to a user instruction such as "Last week's sales amount."
[0126] 15 instructs the pre-trained language model 6 to output in json (JavaScript Object Notation) format when executing a task, so by checking whether the response string starts in json format, it is possible to determine whether the pre-trained language model 6 intends to execute a task. If the pre-trained language model 6 generates normal text instead of a task, the text is adopted as the chat response sentence and control ends.
[0127] The system prompt generated by the prompt generator 16 includes rules for responses output from the pre-trained language model 6. For example, when a task is specified, it is desired to execute the task with specified parameters, but even if generation rules are specified in the system prompt, there is no guarantee that the pre-trained language model 6 will generate parameters according to the rules, and it may often return a response that does not match the specified format.
[0128] Therefore, in the next step SD8, the format of the response is checked, and if the response format does not follow the rules, an error message and the response content of the pre-trained language model 6 are embedded in a retry prompt template as shown in Figure 25, and a prompt (retry prompt) is sent to the pre-trained language model 6 itself to correct the content.
[0129] That is, the input / output control unit 17 receives the response output from the pre-trained language model 6. The input / output control unit 17 determines whether the response output from the pre-trained language model 6 complies with the rules included in the prompt template, and instructs the prompt generation unit 16 to generate a retry prompt when it is determined that the response output from the pre-trained language model 6 does not complies with the rules included in the prompt template. The prompt generation unit 16 acquires a retry prompt template from the template storage area 30a, and generates a retry prompt by embedding the response output from the pre-trained language model 6 and an error message indicating that the response does not comply with the rules included in the prompt template into the acquired retry prompt template.
[0130] In this embodiment, if the determination in step SD8 is NO, the error count is incremented by 1 in step SD9. If the error is still not corrected after a certain number of retries in step SD10, the process proceeds to step SD4, where the input / output control unit 17 outputs an error response and ends the process.
[0131] If the result of the determination in step SD8 is YES and a task execution instruction in the correct format is obtained, the data analysis device 1 executes the actual task based on the parameters in the following step SD12. For example, in the case of a data visualization task, a graph is calculated and drawn based on the specified graph setting information (for example, information on columns used for the X-axis, Y-axis, and legend, functions used for aggregation, and filter conditions). That is, for example, the input / output control unit 17 receives text information including the type of graph, the attribute of the aggregation unit, the attribute of the aggregation target, and the aggregation method as a response from the pre-trained language model 6. In this case, the display control unit 3a creates a graph template based on the type of graph included in the text data received by the input / output control unit 17, and generates graph data by aggregating the attributes of the aggregation target for each attribute of the aggregation unit based on the aggregation method included in the text data received by the input / output control unit 17 and the data table input by the data input unit 12. At this time, the display control unit 3a can also generate graph data by identifying another data table using relation information that defines the relationship between attributes included in multiple data tables, and aggregating the data included in the other data table as the attribute of the aggregation target.
[0132] In the case of a value aggregation task, the aggregated value is calculated based on the value aggregation information (for example, the column to be aggregated, the function used for aggregation, and the filter condition). If these are already provided as existing analysis functions within the analysis service, those functions may be used.
[0133] For example, as shown in FIG. 26, for a search task, a search query is sent in step SE1. In the case of a search task, a search is made for information within the analysis service or an external document is searched for. The search results are obtained in step SE2. In step SE3, it is determined whether the search results obtained in step SE2 are one or more. If the search results are zero, the process proceeds to step SE4, and a response is output indicating that no search results were found. This response can be a standard phrase.
[0134] If there is one or more search results in step SE3, the process proceeds to steps SE5 and SE6 in that order. That is, in order to enable responses to be made in a natural chat format rather than in a format used by a search engine on the Web, the prompt generator 16 generates a QA prompt for generating a response text from the search results rather than displaying the search results as is, and transmits the generated QA prompt to the pre-trained language model 6. As a result, the text obtained from the pre-trained language model 6 is generated as the final response. FIG. 27 shows an example of a QA prompt. Note that a method called Retrieval Augmented Generation (RAG) can be used as a method for causing the pre-trained language model 6 to generate a response based on a prompt with the search results embedded therein.
[0135] 28 is a sequence diagram from text transmission to task completion in the case of visualization. When the input / output control unit 17 transmits text to the pre-trained language model 6, the pre-trained language model 6 executes inference processing and responds to the input / output control unit 17. After that, the input / output control unit 17 executes task discrimination processing and causes the display control unit 3a to execute graph calculation processing. The graph calculation result is transmitted to the input / output control unit 17, and the input / output control unit 17 generates a response.
[0136] 29 is a sequence diagram from text transmission to task completion in the case of document search. When the input / output control unit 17 transmits text to the pre-trained language model 6, the pre-trained language model 6 executes inference processing and responds to the input / output control unit 17. The input / output control unit 17 then executes task discrimination processing and causes the display control unit 3a to execute search processing. Search results are transmitted to the input / output control unit 17. When the input / output control unit 17 transmits a QA prompt to the pre-trained language model 6, the pre-trained language model 6 executes inference processing and transmits text suitable for a response to the input / output control unit 17. The input / output control unit 17 generates a response based on the received text.
[0137] The display control unit 3a generates display data based on the response received by the input / output control unit 17. Specifically, when the display control unit 3a receives a response from the input / output control unit 17, the display control unit 3a generates display data in which the received response is formatted and displayed on a user interface, and outputs and displays the display data on the monitor 3 (step SA6 shown in FIG. 15). Depending on the response result, the display control unit 3a generates display data in which components that can be operated by the user, such as links, operation buttons, and widgets for performing graph operations, are incorporated into the user interface. This allows the user to obtain the response result through the monitor 3.
[0138] After step SA6 is completed, the administrator can check the log information recorded in the log storage area 30c by operating the log output button 94 on the chat setting screen 90 shown in Fig. 14. This log information is not the system prompt actually sent to the pre-trained language model 6, but can be acquired as a CSV file consisting of fields such as those shown in Fig. 30.
[0139] Since administrators want to know what information was sent as a prompt and what text users sent externally, among other information about their company's data, the logs are provided to the administrator in a form that includes all of this information.
[0140] On the other hand, from the perspective of the analysis service provider, outputting logs in the format shown in Figure 30 keeps the contents of the prompt template confidential, reducing the risk of prompts being misused by external parties or prompt injection.
[0141] As described above, the administrator can provide users with improved convenience by using the pre-trained language model 6 while checking and controlling the information that the data analysis service sends to the pre-trained language model 6. In addition, data analysis service providers can provide functions that users, including the administrator, require without disclosing their own know-how to the users.
[0142] The above-described embodiment is merely illustrative in all respects and should not be construed as limiting. Furthermore, all modifications and variations within the scope of the claims are within the scope of the present invention. [Industrial Applicability]
[0143] As described above, a data analysis apparatus according to the present disclosure can be used to execute, for example, a search task, a value aggregation task, a data visualization task, and the like. [Explanation of symbols]
[0144] 1 Data analysis equipment 3a Display control unit 6 Pre-trained Language Models (LLM) 12 Data Entry Section 13 Reception 14 Setting section 15 Background information acquisition section 16 Prompt Generation 17 Input / Output Control Unit 20 Authority Verification Department 21. Permission Information Management Department 22 Log Generation Unit 23 Project Management Department 30 Storage device (storage unit) 30b Conversation history storage area (second storage area) 30c Log storage area (first storage area)
Claims
1. A data analysis device that analyzes data using relation information that defines a relationship between attributes included in a plurality of data tables, comprising: a data input unit for receiving an input of a data table having a plurality of attributes; A reception unit that receives input information in a natural language format from a user; a background information acquiring unit that acquires, as analysis background information, table information indicating a plurality of data tables to be subjected to data analysis among the data tables inputted by the data input unit; a prompt generation unit that acquires a prompt template used for data analysis from a storage unit, and generates a system prompt by assigning the input information accepted by the acceptance unit and the analysis background information acquired by the background information acquisition unit to the acquired prompt template; an input / output control unit that generates text information including the input information received by the reception unit and the system prompt generated by the prompt generation unit, transmits the generated text information to a pre-trained language model capable of interpreting natural language, and receives a response output from the pre-trained language model in response to the transmission; a display control unit that generates display data based on the response received by the input / output control unit; A data analysis device comprising:
2. 2. The data analysis apparatus according to claim 1, a setting unit that sets relation information that defines a relation between attributes included in the plurality of data tables input by the data input unit, The background information acquisition unit acquires, as analysis background information, relation information that defines the relationship between attributes contained in multiple data tables that are the subject of data analysis, from among the data tables input by the data input unit.
3. 2. The data analysis apparatus according to claim 1, An authority confirmation unit that generates authority confirmation information for confirming whether an authority to transmit text information to the pre-trained language model is valid or not, and determines whether the authority is valid or not based on a response obtained by transmitting the authority confirmation information to an authority information management unit, The prompt generation unit is configured to generate a system prompt when the authority confirmation unit determines that the authority is valid, and to not generate a system prompt when the authority confirmation unit determines that the authority is invalid.
4. 4. The data analysis apparatus according to claim 3, The prompt generation unit is configured to, when the authority confirmation unit determines that the authority is invalid, not to generate a system prompt by causing the display control unit to generate display data that disables the reception unit.
5. 2. The data analysis apparatus according to claim 1, An authority confirmation unit that generates authority confirmation information for confirming whether an authority to transmit text information to the pre-trained language model is valid or not, and determines whether the authority is valid or not based on a response obtained by transmitting the authority confirmation information to an authority information management unit, The input / output control unit is configured to transmit text information to the pre-trained language model when the authority confirmation unit determines that the authority is valid, and to not transmit text information to the pre-trained language model when the authority confirmation unit determines that the authority is invalid.
6. 2. The data analysis apparatus according to claim 1, the input / output control unit generates a timestamp indicating the date and time when the text information generated by the input / output control unit was sent to the pre-trained language model, and the timestamp corresponds to analysis background information acquired by the background information acquisition unit and the input information accepted by the acceptance unit, the analysis background information being included in the text information, and the input information being accepted by the acceptance unit, and the log is generated by the timestamp indicating the date and time when the text information generated by the input / output control unit was sent to the pre-trained language model, and the log is sequentially accumulated.
7. 7. The data analysis apparatus according to claim 6, the memory unit has a first memory area that stores the log, and a second memory area that stores, as a conversation history, analysis background information acquired by the background information acquisition unit, the input information accepted by the acceptance unit, and responses output from the pre-trained language model.
8. 7. The data analysis apparatus according to claim 6, The log generation unit generates the log by further associating the response output from the pre-trained language model with the timestamp, and accumulates the log sequentially at the timing when the response output from the pre-trained language model is received by the input / output control unit.
9. 2. The data analysis apparatus according to claim 1, a setting unit configured to receive a setting as to whether or not data included in each column of the data table input by the data input unit is permitted to be transmitted to the pre-trained language model, The background information acquisition unit further acquires, as analysis background information, data contained in multiple data tables to be subjected to data analysis, excluding data in columns that have been set by the setting unit as not permitted to be transmitted to the pre-trained language model.
10. 2. The data analysis apparatus according to claim 1, a setting unit configured to receive a setting as to whether or not data included in each column of the data table input by the data input unit is permitted to be transmitted to the pre-trained language model, The input / output control unit determines whether the system prompt generated by the prompt generation unit includes data of a column that has been set by the setting unit as not permitted for transmission to the pre-trained language model, and if it is determined that the system prompt generated by the prompt generation unit includes data of a column that has been set by the setting unit as not permitted for transmission to the pre-trained language model, does not execute sending of the prompt to the pre-trained language model.
11. The data analysis apparatus according to claim 10, The input / output control unit determines whether the system prompt generated by the prompt generation unit includes data of another column that holds the same data as a column that has been set by the setting unit as not permitted for transmission to the pre-trained language model, and if it is determined that the system prompt includes other data that holds the same data as a column that has been set by the setting unit as not permitted for transmission to the pre-trained language model, the input / output control unit does not execute sending of the prompt to the pre-trained language model.
12. 2. The data analysis apparatus according to claim 1, a setting unit configured to receive a setting as to whether or not to permit data included in the data table input by the data input unit to be transmitted to the pre-trained language model, The background information acquisition unit determines whether or not data included in the data table input by the data input unit is permitted to be sent to the pre-trained language model, and if it is determined that the data transmission is permitted, acquires multiple data tables to be the subject of data analysis, extracts output values with a number of data that is less than the number of data included in each data table based on the data included in the acquired multiple data tables, and outputs the extracted output values to the prompt generation unit as analysis background information.
13. 2. The data analysis apparatus according to claim 1, the system prompts generated by the prompt generation unit include rules for responses output from the pre-trained language model; the input / output control unit determines whether or not the response output from the pre-trained language model complies with the rule, and when it is determined that the response output from the pre-trained language model does not complies with the rule, instructs the prompt generation unit to generate a retry prompt; The prompt generation unit retrieves a retry prompt template from a memory unit, and generates a retry prompt by embedding the response output from the pre-trained language model and an error message indicating that the rule is not followed into the retrieved retry prompt template.
14. 2. The data analysis apparatus according to claim 1, the input / output control unit receives text information including a graph type, an attribute of a counting unit, an attribute of a counting target, and a counting method as the response; The display control unit creates a graph template based on the type of graph included in the text data received by the input / output control unit, and generates graph data by aggregating attributes of the aggregation targets for each attribute of the aggregation unit based on the aggregation method included in the text data received by the input / output control unit and the data table input by the data input unit.
15. 15. The data analysis apparatus according to claim 14, The display control unit identifies another data table using the relation information, and generates graph data by aggregating data included in the another data table as an attribute of the aggregation target.
16. 2. The data analysis apparatus according to claim 1, a project management unit that receives designation of a plurality of data tables to be analyzed among the data tables inputted by the data input unit, and designation of a plurality of columns to be analyzed among a plurality of columns included in each data table, and creates a first management table in which table information indicating the designated plurality of data tables is associated with project information specifying an analysis project, and a second management table in which column information indicating the designated plurality of columns is associated with project information specifying an analysis project, The reception unit is associated with the analysis project, When the receiving unit receives the input information, the background information acquisition unit identifies an analysis project associated with the receiving unit, and based on project information identifying the analysis project, acquires table information indicating a plurality of data tables to be the subject of data analysis from the first management table, and acquires column information indicating a plurality of columns to be the subject of data analysis from the second management table.
17. 2. The data analysis apparatus according to claim 1, The input / output control unit transmits the system prompt generated by the prompt generation unit to a server, and transmits the system prompt transmitted to the server to the pre-trained language model.
18. 2. The data analysis apparatus according to claim 1, The input / output control unit transmits a response output from the pre-trained language model to a server, and transmits the response transmitted to the server to the display control unit.
Citation Information
Patent Citations
Data analyzer and data analysis method
JP2020135054A
Cited By
Information processing device, control method for information processing device, and program
JP2026130015A
Information processing systems and programs
JP7835419B1
Information processing device, control method for information processing device, and program
JP7867737B1