Information processing device, information processing method, and computer program
By introducing a processing unit into the information processing device, the corresponding database can be selected according to the input questions and generated promotional content, which solves the problem that the answer accuracy of existing LLM systems is difficult to guarantee when dealing with complex or fuzzy questions, and achieves more accurate and relevant answer generation.
Patent Information
- Application Number
- JP2023151708
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2043-09-19
AI Technical Summary
The existing natural language question-and-answer system using large language language model (LLM) for natural language question-and-answer systems is difficult to guarantee the accuracy of the answers.
By introducing a processing unit into the information processing device, the unit can select the corresponding database according to the input question, generate promotional content for the database and the question, and input the promotional content into the language model to generate answers.
By breaking down user questions into more specific sub-questions and using specific databases and promotional content in language model processing, the accuracy and relevance of answers is significantly improved.
Smart Images

Figure 2025044032000001_ABST
Abstract
Description
[Technical field]
[0001] The present embodiment relates to an information processing device, an information processing method, and a computer program. [Background technology]
[0002] Systems that use large-scale language models (LLMs) to answer questions in natural language are becoming more widely used. In systems that use LLMs, a sentence (question) written in natural language is input into the LLM, which outputs an answer. The document input into the LLM is called a prompt. By using an LLM, users can reduce the burden of looking up answers themselves or easily acquire unknown knowledge. When a user uses the output of an LLM to make a decision, the accuracy of the LLM's output can be an issue. In particular, when a user's question is complex or vague, the answer often lacks accuracy. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] International Publication No. 2016 / 098805 [Patent Document 2] JP 2000-259722 A [Patent Document 3] JP 2002-373017 A [Patent Document 4] JP 2023-76413 A Summary of the Invention [Problem to be solved by the invention]
[0004] The present embodiment provides an information processing device, an information processing method, and a computer program that enable answers to questions to be answered with improved accuracy. [Means for solving the problem]
[0005] The information processing device of this embodiment includes a processing unit that selects a database corresponding to an input question from among a plurality of databases each storing different types of data based on the content of the question, generates a prompt to be input into a language model based on the selected database and the question, and generates an answer based on the prompt and the language model. [Brief description of the drawings]
[0006] [Figure 1] FIG. 1 is a block diagram of an example of an information processing apparatus according to an embodiment of the present invention. [Diagram 2] FIG. 1 illustrates an example of a user's question and a number of subquestions generated from the user's question. [Diagram 3] FIG. 13 is a diagram showing an example of a DB switching rule. [Figure 4] FIG. 11 is a diagram showing an example of a sentence template. [Diagram 5] FIG. 5 shows an example of a prompt created based on the sentence template of FIG. 4. [Figure 6] FIG. 11 is a diagram showing an example of a graph displayed by an output unit. [Figure 7] 10 is a flowchart showing an example of processing according to the embodiment. [Figure 8] FIG. 1 is a diagram showing a hardware configuration of an information processing apparatus according to an embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0007] Hereinafter, the present embodiment will be described with reference to the drawings.
[0008] FIG. 1 is a block diagram of an example of an information processing device 10 according to the present embodiment. The information processing device 10 in Figure 1 includes a question input unit 100, a question decomposition unit 110, a question execution control unit 120, a prompt processing unit 130, a DB switching rule memory unit 140, a DB memory unit 150, a large-scale language model (LLM) execution unit 160, an output checking unit 170, a prompt correction unit 180, a code execution unit 190, a sensor time series DB 200, and an output unit 210.
[0009] The processing unit according to this embodiment has at least one or any multiple functions of a question decomposition unit 110, a question execution control unit 120, a prompt processing unit 130, an LLM execution unit 160, an output check unit 170, a prompt correction unit 180, and a code execution unit 190. Although this embodiment uses an LLM as a language model, a language model other than the LLM may be used as long as it can handle and understand natural language.
[0010] The DB storage unit 150 includes an energy saving measure DB 151 , a building equipment DB 152 , and a sensor contact DB 153 .
[0011] The prompt processing unit 130 includes a prompt generating unit 131 and a DB selecting unit 132 .
[0012] The question input unit 100 accepts input of a question from a user. A screen of an application (hereinafter, an app) according to this embodiment is displayed to the user, and the user can input a question from a question input field of the app. The question is input in a natural language. The language may be any language, such as Japanese, English, Chinese, Hangul, or French. The user can input a question using, for example, a keyboard, a voice input device, or a mouse. The question input unit 100 sends data of the question input by the user to the question decomposition unit 110. The data sent to the question decomposition unit 110 may be text data, encrypted data, or other format.
[0013] The top diagram in Figure 2 shows an example of a question entered by a user. "Q:" means that the content written after "Q:" is the question entered by the user. The question entered by the user is "I would like to know if room RM101 was cooled properly yesterday, and would like to see it in a graph." Here, the user is a manager of a facility such as a building, and wants to know whether a certain room in the facility (a room named RM101) is being properly cooled. We assume a situation in which the user expects the device to provide the user with knowledge of proper cooling methods, on the assumption that the device has this knowledge in a database or that this knowledge is available on a server accessible from the device.
[0014] The question decomposition unit 110 decomposes the user's question into a plurality of partial questions so that an appropriate answer to the user's question can be obtained. That is, the user's question is converted into a sequence of a plurality of partial questions using a method such as search, and a list (a partial question list) including a plurality of partial questions and the order of the plurality of partial questions is obtained. The question decomposition unit 110 sends the partial question list to the question execution control unit 120. Each partial question has a more specific content than the user's question, and an answer to an earlier partial question can be used to find an answer to the next or subsequent partial question. By decomposing the user's question into a plurality of specific partial questions in this way, even if the user's question is complex or vague, the user can accurately arrive at the answer he or she is looking for. As a specific method, for example, an existing technique such as planning can be used. Planning is, for example, a technique for planning in what order and what kind of partial questions should be asked to correctly answer the user's question. As such a technique, a natural language understanding artificial intelligence (AI) program called SHRDLU may be used. Note that if the user's question does not need to be decomposed, it may not be decomposed. A known reference for SHRDLU is "Procedures as a Representation for Data in a Computer Program for Understanding Natural Language", Terry Winograd, MIT AI Technical Report 235, February 1971.
[0015] The lower diagram of FIG. 2 shows a list of sub-questions generated from the question in the upper diagram of FIG. 2. Four sub-questions Q1 to Q4 are shown, with the sub-questions Q1 to Q4 being ranked in descending order. As shown in the figure, The first part of the question Q1 is "obtain specific energy conservation measures for Q"; The second part of the question, Q2, is "Get a list of sensors for a given expression", The third part, Q3, is "Generate code to obtain and graph data on the cooling of room RM101 yesterday." The fourth part, question Q4, is "Running and visualizing the generated python code." Note that the "Q" in the partial question Q1 refers to the user's question Q.
[0016] The question execution control unit 120 controls the execution of a plurality of partial questions in the partial question list in order. The question execution control unit 120 first extracts the first partial question in the partial question list, and sends it to the prompt processing unit 130 if it is a question that should be processed by the LLM execution unit 160. When the processing of the first partial question is completed in the processing after the prompt processing unit 130 (when the answer to the first partial question is obtained), the question execution control unit 120 extracts the next partial question from the partial question list and sends it to the prompt processing unit 130. Thereafter, the same processing is repeated until the last partial question in the partial question list is processed. If the extracted partial question is a question that requests the code execution unit 190 to execute code, an instruction based on the partial question is sent to the code execution unit 190. In this embodiment, it is assumed that the last partial question is a question that requests the code execution unit 190 to execute code.
[0017] When the prompt processor 130 receives a partial question from the question execution controller 120, it generates a prompt to be input to the LLM execution unit 160. The prompt processor 130 includes a prompt generator 131 and a DB selector 132.
[0018] The DB selection unit 132 selects a database (DB) to be used for generating a prompt based on a switching rule (DB switching rule) stored in the DB switching rule storage unit 140. The candidates for DB to be used for generating a prompt are DBs stored in the DB storage unit 150, specifically, energy saving measure DB 151, building equipment DB 152, sensor contact DB 153, python code generation DB 154, sensor data dictionary DB 155, etc. DBs other than the DBs shown in the figure may also be stored in the DB storage unit 150. The DB switching rules and these DBs 151 to 155, etc. will be described below.
[0019] 3 shows an example of DB switching rules stored in the DB switching rule storage unit 140. The DB switching rules are a table having columns of "Question type", "Question example", "DB", and "Prompt text". However, the DB switching rules may be in a format other than a table, such as a list format.
[0020] The "Question type" column stores information indicating the type of question. In the example shown in the figure, the question type is written in a natural language that is easy for humans to understand, but information such as an ID or number may be stored as long as the question type can be identified.
[0021] The column "Question example" stores examples of questions (partial questions). In the example shown in the figure, only one question example is stored for each question type, but many or a plurality of question examples may be stored for each question type.
[0022] The "DB" column stores information for identifying the DB to be used among various DBs stored in DB storage unit 150. "Office energy saving case studies" corresponds to energy saving measure DB151, "equipment DB+sensor DB" corresponds to building equipment DB152 and sensor contact DB153, and "python code generation DB+sensor data dictionary" corresponds to python code generation DB154 and sensor data dictionary DB155.
[0023] The "prompt body" column stores the prompt body (natural language) to be embedded in the sentence template for creating a prompt (see Figure 4 below). This prompt body may be embedded in the sentence template as is, or it may be partially edited and then embedded in the sentence template.
[0024] For example, "For Q, I would like to know the formula to check the operation of the air conditioner" is stored as the prompt text corresponding to the value of "Question example" "Get specific energy saving measures for question Q." Note that "Q" is the question entered by the user as described above (see Figure 2). Note that the value of "prompt text" may be stored corresponding to the value of "question type."
[0025] The energy saving measure DB151 is a DB that stores many examples of energy saving in a facility. The targets of energy saving are various, such as air conditioners, elevators, lighting equipment, and AO (Office Automation) equipment. For air conditioners, for example, many examples are described, such as what formula is used to evaluate the efficiency of an air conditioner, what data (sensors) are needed to calculate this formula, and what the output of this formula should be to be appropriate. Classifications may be set according to the attributes of the building, the attributes of the room, the attributes of the air conditioner, and the like, and these examples may be stored for each classification. The examples may be collected as examples that have actually been carried out by the country, local governments, and various companies and have been effective. These many examples may be described in natural language. The energy saving measure DB151 may be a collection of various energy saving examples that are publicly available on the Internet from various organizations and companies and downloaded. The energy saving measure DB151 is an example of a database regarding the types of conditions monitored by sensors installed in the facility, and if the user wants to monitor something other than energy saving, a database regarding the types of conditions to be monitored may be provided.
[0026] The building equipment DB 152 stores data on equipment in facilities such as buildings. For example, attribute information such as the name and location of the building, the location of each room and elevator in the building, and attribute information such as the installation location (e.g., in which room it is located) and function of air conditioning equipment, lighting equipment, AO equipment, etc. in the building are stored. The building equipment DB 152 may be in a table format, or may be a document in which data on these facilities and equipment is written in natural language. The building equipment DB 152 is an example of a database on equipment provided in a facility.
[0027] The sensor contact DB 153 stores information about a plurality of sensors, such as the facility in which the sensor is installed and the installation location within the facility (room, etc.), the type of sensor, the device that controls the sensor, and the device that uses the output of the sensor, in association with the sensor's identification information (sensor name or ID). Examples of sensor types include temperature sensors, humidity sensors, proximity sensors, displacement sensors, and pressure sensors. The sensor contact DB 153 is an example of a database related to sensors installed in a facility.
[0028] The python code generation DB154 stores python commands, grammars, etc. Code templates of typical processes may also be stored. These data can be used to automatically generate python programs.
[0029] The sensor data dictionary DB155 stores information on the type of sensor data (e.g., whether it is waveform data or discrete values) and the definition of variables representing sensors (data type, number of digits) so that the sensor data (values) can be used as variables in a program such as Python. It may also store information on how to process the sensor data (e.g., how to obtain the sensor value when the data is waveform (e.g., using the maximum value within a certain period). This information may be written by sensor type, or by sensor identification information (sensor name or ID) used in the sensor contact DB153. The sensor data dictionary DB155 is an example of a database related to sensors installed in a facility.
[0030] The DB selection unit 132 obtains from the DB switching rules the "DB" value and the "prompt body" value that match the partial question received from the question execution control unit 120. More specifically, it compares the partial question with the "example question" column in the DB switching rules to identify the most similar "example question" value, and obtains the "DB" value and the "prompt body" value in the row that includes the identified value. The DB selection unit 132 selects from the DB storage unit 150 a DB identified by the obtained "DB" value.
[0031] For example, if the partial question is "Get specific energy saving measures for Q", then "Office energy saving case studies" is acquired as the value of "DB", which is the closest match (similar) to "Get specific energy saving measures for question Q", and "I would like to know the formula for checking the operation of the air conditioner for Q" is acquired as the value of "prompt body". Therefore, the DB selection unit 132 selects the energy saving measure DB 151 corresponding to "Office energy saving case studies". Note that hereinafter, the value of the "prompt body" acquired by the DB selection unit 132 will be referred to as the prompt body, with the "" removed.
[0032] Vector matching may be used to identify the value of the "example question" that best matches the partial question. In this case, the partial question is vectorized, the value of the "example question" is also vectorized, the similarity between the two vectors (e.g., Euclidean distance) is calculated, and the value of the "example question" with the highest similarity is selected. As a method of vectorization, the partial question may be subjected to morphological analysis to be converted into a numerical vector. The value of the "example question" may be similarly converted into a numerical vector, and the similarity (distance) between the vectors may be calculated. Vectorization may be performed by a method other than morphological analysis, such as utilizing embedded processing using a neural network.
[0033] The prompt generating unit 131 generates a prompt to be provided to the LLM executing unit 160 based on the DB selected by the DB selecting unit 132 (referred to as the selected DB) and the prompt text acquired by the DB selecting unit 132. The prompt generating unit 131 holds a sentence template, and generates a prompt by embedding the acquired prompt text in the sentence template and also embedding data of the selected DB as context information. At this time, data related to the partial question is extracted from the selected DB as data of the selected DB to be embedded, and the extracted data is embedded in the sentence template. This makes it possible to narrow down the range of data to be processed to an appropriate range when the LLM executing unit 160 processes the prompt, thereby increasing the possibility of obtaining a highly accurate answer. As a modified example, a link to the selected DB may be embedded in the sentence template. If the size of the DB is not too large, a configuration in which the entire content of the DB is embedded in the sentence template is also possible.
[0034] For example, if the partial question is "Q1: Obtain specific energy saving measures regarding Q" and the selected DB is the energy saving measures DB151, since the user's question Q is about air conditioning, only the data related to the efficiency of air conditioning is extracted from the energy saving measures DB151.
[0035] 4 shows an example of a sentence template. A field 310 marked with "#Questions" is a field that stores the prompt body. A field 320 marked with "#DB session" is a field that stores the relevant data extracted from the selected DB.
[0036] FIG. 5 shows an example of a prompt created by storing the prompt text obtained when the subquestion is “Q1: Obtain specific energy saving measures for Q” in field 310 in the sentence template, and storing related data extracted from the selection DB (energy saving measures DB151) in field 320.
[0037] The prompt generating unit 131 sends the generated prompt to the LLM executing unit 160. In the figure, the generated prompt is represented as Prompt(DB). The notation Prompt(DB) typically means that the prompt has data from the selected DB embedded as context information.
[0038] The LLM execution unit 160 is a circuit or processing unit equipped with the functionality of an LLM. An LLM is an AI model trained using a large amount of data set (text data), and generates and outputs answers to input questions. The answer may be in a variety of formats, such as a sentence containing natural language, or may contain code (program code) such as python that can be executed by an engine. Well-known examples of LLMs include Chat GPT, Bing, Bard, and NotionAI.
[0039] The LLM execution unit 160 performs processing (LLM processing) to obtain an answer to the prompt text (question stored in field 310) included in the prompt received from the prompt generation unit 131. At this time, it uses related data from the selection DB embedded as context information in field 320. The LLM execution unit 160 sends the generated answer to the output check unit 170.
[0040] The output checking unit 170 checks whether the answer received from the LLM executing unit 160 is consistent or inconsistent with the partial question (or the main prompt text) that is the basis of the answer. For example, if the answer is not about cooling but is an energy saving measure related to air conditioning in general (including heating), the answer is determined to be inconsistent with the original partial question, and the current answer is sent to the prompt correcting unit 180. When determining the consistency of the answer, the next partial question may be taken into consideration. In this case, the output checking unit 170 may confirm the content of the next partial question with the question executing control unit 120.
[0041] The prompt correction unit 180 generates a correction instruction based on the answer received from the output check unit 170 and sends it to the prompt generation unit 131. For example, if the content of the answer is not limited to cooling, the prompt correction unit 180 instructs the prompt generation unit 131 to add a statement to the prompt body indicating that the answer is limited to cooling. Alternatively, if the next subquestion requires a formula for energy saving evaluation but the answer does not include the formula, the prompt correction unit 131 instructs the prompt body to correct the prompt body to indicate that the formula is included in the answer. The prompt correction unit 180 may display at least one of the content of the answer and the inconsistent part in the answer to the user via the output unit 210 or another display device. In this case, the prompt correction unit 180 may accept a correction instruction from the user and send the correction instruction to the prompt generation unit 131.
[0042] When the prompt generation unit 131 receives a correction instruction from the prompt correction unit 180, it corrects the prompt in accordance with the correction instruction (for example, correcting the prompt text, or correcting related data to be extracted from the selected DB, or correcting both) and sends the corrected prompt to the LLM execution unit 160. The LLM execution unit 160 generates an answer based on the corrected prompt, and the output check unit 170 checks whether there is a problem with the answer. If there is a problem, the same process as described above is repeated.
[0043] If there is no problem with the answer from the LLM execution unit 160, the output checking unit 170 instructs the prompt processing unit 130 to move on to the next partial question. At this time, the output checking unit 170 feeds back the current answer to the prompt processing unit 130 or the prompt generating unit 131. Having received the instruction, the prompt processing unit 130 instructs the question execution control unit 120 to send the next partial question, and obtains the next partial question.
[0044] When the prompt processor 130 receives the second partial question, it generates a prompt using the DB selector 132 and the prompt generator 131 in the same manner as for the first partial question, and sends the generated prompt to the LLM execution unit 160. At this time, the prompt generator 131 generates a prompt that reflects feedback of the previous LLM output result (answer). The LLM execution unit 160 generates an answer to the prompt text included in the prompt based on related data in the selected DB, etc., and sends it to the output check unit 170. The output check unit 170 checks whether there is a problem with the answer (LLM answer). If there is a problem, it has the prompt generator 131 generate a prompt again via the prompt correction unit 180, as in the case of the first partial question. If there is no problem, it sends an instruction to the prompt processor 130 to move on to the next partial question. The prompt processor 130 instructs the question execution control unit 120 to send the next partial question, if there is one.
[0045] The last partial question is not a question that requests the LLM execution unit 160 to provide an answer, but a question that requests the code execution unit 190 to execute code and visualize the execution result. For this reason, the question execution control unit 120 sends to the code execution unit 190 an instruction to execute the code (the code obtained as the answer to the third partial question) and an instruction to visualize the output result of the code execution. Note that if the last partial question does not include a request to execute code and is a request only to visualize the immediately preceding partial question (the third partial question in this example), the question execution control unit 120 only needs to send an instruction to the code execution unit 190 or the output unit 210 to visualize the immediately preceding partial question.
[0046] The code execution unit 190 executes the code instructed by the question execution control unit 120 (in this example, the code obtained as an answer to the third partial question). The code execution unit 190 includes an engine for executing the code. In executing the code, when the code includes an instruction to perform processing using the time series data of the sensor (for example, an instruction to create a graph using the time series data of the sensor), the code execution unit 190 identifies the identification information (ID) of the corresponding sensor from within the code, and reads the time series data of the corresponding sensor from the sensor time series DB 200 based on the ID. The sensor time series DB 200 stores the time series data of a plurality of sensors in association with the identification information of the sensor. The code execution unit 190 performs processing using the read sensor time series data, and sends the processing result to the output unit 210. The output unit 210 displays the processing result received from the code execution unit 190 on a screen so that the user can visually confirm it. The output unit 210 is, for example, a display device such as a liquid crystal display device or an organic EL display device. The output unit 210 may include a wired or wireless communication unit. In this case, the output unit 210 may transmit the results of the processing to a terminal device operated by the user, and cause the terminal device to output the results of the processing.
[0047] A specific example of the operation of this device will be described below based on the case where sub-questions Q1 to Q4 are obtained from the user's question Q shown in Fig. 2 above. An example will be shown in which an answer to the user's question Q is generated by executing the sub-questions Q1 to Q4 in order.
[0048] [1] DB selection unit 132 and prompt generation unit 131 Since the first partial question, "Q1: Obtain specific energy saving measures for Q", matches "Obtain specific energy saving measures for question Q" in the DB switching rule, the energy saving measure DB 151 corresponding to "Office energy saving case studies" is selected by the DB selection unit 132, and the prompt body, "Regarding Q, I would like to know the formula for checking the operation of the air conditioner", is acquired. The prompt generation unit 131 generates a prompt by inserting the prompt body into field 310 of the sentence template, and further adding related data extracted from the energy saving measure DB 151 as being related to the partial question to field 320 of the sentence template as context information.
[0049] [2] LLM Executive Division 160 The LLM execution unit 160 executes the prompt generated by the prompt generation unit 131, and obtains the answer to the first partial question, "A1: Equation 1 = (RM101 room temperature T1-set temperature T1set) is inversely proportional to (air conditioning outlet temperature T2-room temperature T1)?". Note that "A1" is identification information that identifies the answer.
[0050] [3] Output check section 170 The output checker 170 checks the answer A1 and, since there is no problem with it, sends an instruction to the prompt processor 130 to move on to the next partial question. At this time, the output checker 170 feeds back the answer A1 to the prompt generator 131.
[0051] [4] Question execution control unit 120 The next sub-question (second sub-question), “Q2: Obtain a list of sensors for a given formula”, is sent to the prompt processing unit 130 .
[0052] [5] DB selection unit 132 and prompt generation unit 131 The second partial question, "Q2: Get a list of sensors for a given formula", matches "Get a list of sensors for a given formula $eq" in the DB switching rule, so the building equipment DB 152 and the sensor contact DB 153 corresponding to "equipment DB + sensor DB" are selected, and the prompt body "I want to know the list of sensor contacts for formula eq" is obtained. The sensor contact list corresponds to a list of identification information of sensors represented by one or more variables included in the formula.
[0053] [6] Prompt generation unit 131 Based on the prompt body "I would like to know a list of sensor contacts related to formula eq" selected by the DB selection unit 132 and the answer A1 that is the most recent output of the LLM execution unit 160, "formula eq" in the prompt body is replaced with "formula 1" to update it to "I would like to know a list of sensor contacts related to formula 1". eq is an example of a variable included in the prompt body. For example, a value included in the answer to the previous or previous partial question is assigned to the variable. This makes it possible to generate a prompt that reflects the answer to the previous partial question (generation of the prompt body for the next partial question). Note that the method of reflecting the answer to the previous partial question is not limited to the method via a variable. For example, the answer to the previous partial question may be added directly to the prompt body selected for the next partial question.
[0054] The prompt generation unit 131 generates a prompt by inserting the updated prompt body into field 310 of the sentence template, and further adding relevant data extracted from the building equipment DB 152 and the sensor contact DB 153 as being related to the updated prompt body (or the second partial question) to field 320 as context information.
[0055] In addition, the content of Equation 1, "Is (RM101 room temperature T1-set temperature T1set) inversely proportional to (air conditioning outlet temperature T2-room temperature T1)?", can be directly embedded into "Formula 1" in the updated prompt body, and a prompt body stating "I would like to know a list of sensor contacts related to "Is (RM101 room temperature T1-set temperature T1set) inversely proportional to (air conditioning outlet temperature T2-room temperature T1)?" can be generated.
[0056] [7] LLM Executive Division 160 The LLM execution unit 160 executes the prompt generated by the prompt generation unit 131, and obtains "A2: T1=T001, T1set=27, T2=T004" as the answer to the second partial question. Note that "A2" is identification information that identifies the answer. This answer means that, for example, to obtain sensor data for room temperature T1, T001 can be used as the sensor identification information (sensor contact).
[0057] [8] Output check section 170 The output checker 170 checks the answer A2 and finds that there is no problem, so sends an instruction to the prompt processor 130 to move on to the next partial question. At this time, the output checker 170 feeds back the answer A2 to the prompt generator 131.
[0058] [9] Question execution control unit 120 The next sub-question (third sub-question), “Q3: Generate code to acquire and graph data relating to cooling in room RM101 yesterday”, is sent to the prompt processing unit 130 .
[0059]
[10] DB selection unit 132 and prompt generation unit 131 "Q3: Generate code to obtain and graph data related to cooling in room RM101 yesterday" matches "Generate code to obtain and graph data related to cooling in room $RM on a certain day $Day" in the DB switching rule. Therefore, the python code generation DB154 and the sensor data dictionary DB155 corresponding to "python code generation DB + sensor data dictionary" are selected, and the prompt text "Graph the relationship of the equation eq on a certain day Day for one day" is obtained.
[0060]
[11] Prompt generation unit 131 The prompt body is generated as "Graph the relationship between (T001-27) and (T004-T001) yesterday for one day" by reflecting the answers A1 and A2, which are the output immediately before and before the LLM, in "Graph the relationship between the equation eq on a certain day, Day, for one day." The prompt generation unit 131 generates a prompt by inserting the generated prompt body into the field 310 of the sentence template, and further adding related data extracted from the python code generation DB 154 and the sensor data dictionary DB 155 as related to the generated prompt body (or the third partial question) as context information to the field 320. Day and eq are examples of variables included in the prompt body. The variables are assigned values included in the answer to the previous or previous partial question, for example.
[0061]
[12] LLM Executive Division 160 The LLM execution unit 160 executes the prompt generated by the prompt generation unit 131, and obtains "A3: Python code for acquiring data and drawing a graph" as an answer to the third partial question. Although the "python code" is simplified here, it is actually a program code string in a format executable by the code execution unit 190. Note that "A3" is identification information for identifying the answer.
[0062]
[13] Output check section 170 Because answer A3 includes program code, output checking unit 170 passes answer A3 to code executing unit 190. Alternatively, output checking unit 170 may receive an instruction to output answer A3 from question execution control unit 120, and output answer A3 to code executing unit 190 in accordance with the output instruction.
[0063]
[14] Code execution unit 190 The question execution control unit 120 executes the last partial question, "Q4: Execute and visualize the generated Python code", and sends an instruction to execute and visualize the Python code to the code execution unit 190. The code execution unit 190 executes the Python code (program code) included in the answer A3 received from the output check unit 170 according to the instruction, thereby drawing a graph. At this time, the sensor time series data required for drawing the graph is obtained from the sensor time series DB 200 based on the sensor identification information included in the program code. The code execution unit 190 passes the graph resulting from the drawing to the output unit 210. The output unit 210 displays the graph so that it can be viewed by the user.
[0064] FIG. 6 is an example of a graph displayed by the output unit 210. In this example, graphs of the air conditioning outlet temperature T2, room temperature T2, and set temperature T1set (=27° C.) are shown. By referring to these graphs, the user can determine whether the air conditioner is operating properly. This graph output format is one example, and the graphs may be output in other formats. For example, a graph of (T001-27) and a graph of (T004-T001) may be calculated and displayed separately.
[0065] FIG. 7 is a flowchart showing an example of processing according to this embodiment.
[0066] The question input unit 100 accepts a question from a user (S101).
[0067] The question decomposing unit 110 generates a plurality of sub-questions from the user's question, and sets an order for these sub-questions (S102).
[0068] The question execution control unit 120 controls the execution of the partial questions in order from the first partial question (S103).
[0069] The DB selection unit 132 of the prompt processing unit 130 obtains the target partial question (the partial question to be processed next) from the question execution control unit 120, and based on the obtained partial question, selects a corresponding DB from the DB switching rules in the DB switching rule storage unit 140, and also selects a corresponding prompt body (S104).
[0070] The prompt generator 131 extracts data related to the prompt text or the partial question from the selection DB, and generates a prompt for the LLM by reflecting the extracted data and the selected prompt text in the sentence template (at S104). At this time, the selected prompt text may be edited based on answers to the partial questions (or the prompts) up to the previous time.
[0071] The LLM execution unit 160 executes the LLM process using the generated prompt as an input, and generates an answer (S105).
[0072] The output checking unit 170 checks whether there is a problem with the content of the answer (S106), and if there is a problem, the prompt correcting unit 180 sends a correction instruction based on the content of the answer to the prompt processing unit 130 or the prompt generating unit 131 to correct the prompt (S107). If there is no problem with the content of the answer and it is not an answer to the last partial question (S108), processing moves to the next partial question (S103).
[0073] When the question execution control unit 120 has processed the last partial question, the output unit 210 visibly displays the answer corresponding to the last partial question to the user as the answer to the user's question (S109).
[0074] As described above, according to this embodiment, a plurality of sub-questions with increased specificity are generated from a user's question, and the plurality of sub-questions are processed in order, thereby making it possible to provide an answer with increased accuracy.
[0075] Furthermore, according to this embodiment, by selecting a DB related to the partial question and including data of the selected DB in the LLM prompt as context information, the LLM execution unit 160 can obtain a more accurate answer in the LLM processing.
[0076] According to the present embodiment, a more accurate answer to a partial question can be obtained by selecting a prompt body related to the partial question and adding the selected prompt body (or the prompt body edited based on the answers up to the previous time) to the prompt of the LLM for the partial question. In other words, even if the partial question itself is not described accurately enough to derive an accurate answer from the LLM, a question with an expression that is expected to give an accurate answer can be prepared as the prompt body in advance, and the corresponding prompt body can be used instead of the partial question itself, thereby making it possible to obtain a more accurate answer to the partial question. In addition, the previous answer can be easily reflected in the next partial question by including a variable that reflects a value included in the answer to the previous partial question in the prompt body. However, the method of reflecting the answer to the previous partial question in the next partial question is not limited to the method of including a variable. For example, the answer to the previous partial question may be added directly to the prompt body selected for the next partial question.
[0077] Some of the components of the information processing device 10 according to this embodiment may be configured as an external server. For example, a server having the function of the LLM execution unit 160 may be placed on a network such as the Internet. The information processing device 10 may transmit a prompt to the server via the network and receive a response from the server. In this case, a communication unit that communicates with the server is provided in the information processing device 10. Similarly, a server having the function of the code execution unit 190 may be prepared, a python code to be executed may be transmitted to the server, and the execution result of the code may be obtained from the server.
[0078] (Hardware configuration) 19 shows a hardware configuration of an information processing device according to each embodiment. The information processing device is configured by a computer device 900. The computer device 900 includes a CPU 901, an input interface 902, a display device 903, a communication device 904, a main storage device 905, and an external storage device 906, which are interconnected by a bus 907.
[0079] A CPU (Central Processing Unit) 901 executes an information processing program, which is a computer program, on a main memory device 905. The information processing program is a program that realizes each of the above-mentioned functional configurations of the information processing device. The information processing program may be realized not as a single program, but as a combination of multiple programs and scripts. Each functional configuration is realized by the CPU 901 executing the information processing program.
[0080] The input interface 902 is a circuit for inputting operation signals from input devices such as a keyboard, a mouse, a touch panel, etc., to the information processing device. The input interface 902 corresponds to the input unit of the information processing device according to each embodiment.
[0081] The display device 903 displays data output from the information processing device. The display device 903 is, for example, but not limited to, an LCD (liquid crystal display), an organic electroluminescence display, a CRT (cathode ray tube), or a PDP (plasma display). Data output from the computer device 900 can be displayed on this display device 903. The display device 903 corresponds to the output unit of the information processing device according to each embodiment.
[0082] The communication device 904 is a circuit for the information processing device to communicate with an external device wirelessly or via wire. Data can be input from the external device via the communication device 904. The data input from the external device can be stored in the main memory device 905 or the external memory device 906.
[0083] The main memory device 905 stores an information processing program, data required for executing the information processing program, data generated by executing the information processing program, etc. The information processing program is expanded and executed on the main memory device 905. The main memory device 905 is, for example, a RAM, a DRAM, or an SRAM, but is not limited to these. Each storage unit or database of the information processing device according to each embodiment may be constructed on the main memory device 905.
[0084] The external storage device 906 stores an information processing program, data required for executing the information processing program, data generated by executing the information processing program, etc. These information processing programs and data are read into the main storage device 905 when the information processing program is executed. The external storage device 906 is, for example, a hard disk, an optical disk, a flash memory, or a magnetic tape, but is not limited to these. Each storage unit or database of the information processing device may be constructed on the external storage device 906.
[0085] The information processing program may be pre-installed in the computer device 900, or may be stored in a storage medium such as a CD-ROM. The information processing program may also be uploaded onto the Internet.
[0086] Furthermore, the information processing device may be configured as a single computer device 900, or may be configured as a system made up of a plurality of computer devices 900 connected to each other.
[0087] The present invention is not limited to the above-described embodiments as they are, and the components can be modified and embodied in the implementation stage without departing from the gist of the invention. Various inventions can be formed by appropriately combining multiple components disclosed in the above-described embodiments. For example, a configuration in which some components are deleted from all the components shown in each embodiment can also be considered. Furthermore, the components described in different embodiments can be appropriately combined.
[0088] This embodiment can also be configured as follows. [Item 1] selecting a database corresponding to the input question from among a plurality of databases each storing different types of data, based on the content of the question; a processor that generates a prompt for input to a language model based on a selected database and the question, and generates an answer based on the prompt and the language model. An information processing device comprising: [Item 2] The processing unit identifies a question that matches the input question based on a switching rule that associates the plurality of databases with a plurality of questions, and selects a database that corresponds to the identified question. Item 1. An information processing device according to item 1. [Item 3] the processing unit generates a plurality of sub-questions based on the question and determines an order of the plurality of sub-questions; selecting a first partial question from the plurality of partial questions in accordance with the order, and selecting a first database based on a content of the first partial question; generating a first prompt for input to the language model based on the first database and the first sub-question; and generating an answer to the first sub-question based on the first prompt and the language model; selecting a second sub-question from the plurality of sub-questions in accordance with the order, selecting a second database based on a content of the second sub-question, and generating a second prompt for input to the language model based on the second database, the second sub-question, and the answer to the first sub-question. Item 3. An information processing device according to item 2. [Item 4] the switching rule corresponds to a plurality of prompt bodies for generating questions to be included in the prompt, the processing unit selects a first prompt body from the switching rule based on a content of the first partial question, and generates the first prompt based on the first database and the first prompt body; The processing unit selects a second prompt body based on the content of the second partial question from the switching rule, and generates the second prompt based on the second database, the second prompt body, and the answer to the first partial question. Item 3. An information processing device according to item 3. [Item 5] updating the second prompt body by assigning a value included in the answer to the first partial question to the variable, the second prompt body including the variable, and generating the second prompt based on the updated second prompt body and the second database; Item 5. An information processing device according to item 4. [Item 6] The processing unit determines whether the generated answer is consistent with the prompt or the question from which the answer was generated, and if the answer is inconsistent, modifies the prompt based on the inconsistent portion of the answer, and regenerates the answer based on the modified prompt and the language model. 6. The information processing device according to any one of items 1 to 5. [Item 7] The processing unit determines whether the generated answer is consistent with the prompt or the question on which the answer is based, and if the answer is inconsistent, presents the inconsistent part of the answer and the answer to a user, receives an instruction from the user to correct the prompt, corrects the prompt based on the correction instruction, and regenerates the answer based on the corrected prompt and the language model. 7. The information processing device according to any one of items 1 to 6. [Item 8] The processing unit extracts data related to the question from data stored in the selected database, and generates the prompt based on the extracted data and the question. 8. The information processing device according to any one of items 1 to 7. [Item 9] Using a sentence template for generating a prompt, the sentence template including a first field for storing the question and a second field for storing data of the database, the prompt is generated by storing the question in the first field and the extracted data in the second field. Item 9. An information processing device according to item 8. [Item 10] a code execution unit that executes the program code included in the response if the response includes the program code; 10. The information processing device according to any one of items 1 to 9, further comprising: [Item 11] When the program code includes a variable representing a sensor and an instruction to execute a process based on a value of the variable, the code execution unit reads the sensor data from a time-series database storing the time-series data of the sensor, assigns the read data to the variable, executes the instruction, and outputs a result of the process. Item 11. An information processing device according to item 10. [Item 12] the instructions are for generating a graph based on data for the variables; The code execution unit outputs a graph as a result of the processing. Item 12. An information processing device according to item 11. [Item 13] the input question is a question input by a user, An output section for visually displaying the results of the processing to a user. 13. The information processing device according to item 11 or 12, further comprising: [Item 14] a language model execution unit that executes the language model, The processing unit inputs the prompt to the language model execution unit to obtain the answer from the language model execution unit. 14. The information processing device according to any one of items 1 to 13. [Item 15] The language model is a large-scale language model. Item 15. An information processing device according to item 14. [Item 16] the question is a question about a state of a facility in which a plurality of sensors are disposed and whose state is monitored by the sensors; The plurality of databases includes at least a database relating to the type of condition to be monitored, a database relating to equipment provided in the facility, and a database relating to the sensors. 16. The information processing device according to any one of items 1 to 15. [Item 17] The processing unit generates the plurality of partial questions and determines the order of the plurality of partial questions by applying a planning algorithm to the question, the planning algorithm planning what partial questions and in what order should be asked to obtain a correct answer to the question. 6. The information processing device according to any one of items 3 to 5. [Item 18] a question input unit that receives input of the question from a user via a screen of an application, The processing unit generates the plurality of partial questions based on the question inputted by the question input unit and determines an order of the plurality of partial questions. Item 18. An information processing device according to item 17. [Item 19] selecting a database corresponding to the input question from among a plurality of databases each storing different types of data, based on the content of the question; generating a prompt for input to a language model based on a selected database and the question, and generating an answer based on the prompt and the language model; Information processing methods. [Item 20] selecting a database corresponding to an input question from among a plurality of databases each storing different types of data, based on the content of the input question; generating a prompt for input to a language model based on a selected database and the question, and generating an answer based on the prompt and the language model; A computer program for causing a computer to execute the above. [Explanation of symbols]
[0089] 10. Information processing device 100 Question input section 110 Query Analysis Unit 120 Question execution control section 130 Prompt Processing Unit 131 Prompt Generation Unit 132 DB Selection Section 140 DB switching rule memory section 150 DB storage section 160 LLM Executive Division 170 Output Check Section 180 Prompt Correction Section 190 Code Execution Unit 210 Output section 310 Field 320 Field 900 Computer Equipment 902 Input Interface 903 Display device 904 Communication equipment 905 Main storage 906 External storage device 907 Bus 151 Energy conservation measures DB 153 Sensor Contact DB 154 Python Code Generation DB 155 Sensor Data Dictionary DB 200 Sensor time series DB Q Question Q1 Partial question Q2 Partial question Q3 Partial Question Q4 Partial question
Claims
1. selecting a database corresponding to the input question from among a plurality of databases each storing different types of data, based on the content of the question; a processor that generates a prompt for input to a language model based on a selected database and the question, and generates an answer based on the prompt and the language model. An information processing device comprising:
2. The processing unit identifies a question that matches the input question based on a switching rule that associates the plurality of databases with a plurality of questions, and selects a database that corresponds to the identified question. The information processing device according to claim 1 .
3. the processing unit generates a plurality of sub-questions based on the question and determines an order of the plurality of sub-questions; selecting a first partial question from the plurality of partial questions in accordance with the order, and selecting a first database based on a content of the first partial question; generating a first prompt for input to the language model based on the first database and the first sub-question; and generating an answer to the first sub-question based on the first prompt and the language model; selecting a second sub-question from the plurality of sub-questions in accordance with the order, selecting a second database based on a content of the second sub-question, and generating a second prompt for input to the language model based on the second database, the second sub-question, and the answer to the first sub-question. The information processing device according to claim 2 .
4. The switching rule associates a plurality of prompt bodies with the plurality of questions to generate questions to be included in the prompt; the processing unit selects a first prompt body from the switching rule based on a content of the first partial question, and generates the first prompt based on the first database and the first prompt body; The processing unit selects a second prompt body based on the content of the second partial question from the switching rule, and generates the second prompt based on the second database, the second prompt body, and the answer to the first partial question. The information processing device according to claim 3 .
5. updating the second prompt body by assigning a value included in the answer to the first partial question to the variable, the second prompt body including a variable; and generating the second prompt based on the updated second prompt body and the second database. The information processing device according to claim 4.
6. The processing unit determines whether the generated answer is consistent with the prompt or the question from which the answer was generated, and if the answer is inconsistent, modifies the prompt based on the inconsistent portion of the answer, and regenerates the answer based on the modified prompt and the language model. The information processing device according to claim 1 .
7. The processing unit determines whether the generated answer is consistent with the prompt or the question on which the answer is based, and if the answer is inconsistent, presents the inconsistent part of the answer and the answer to a user, receives an instruction from the user to correct the prompt, corrects the prompt based on the correction instruction, and regenerates the answer based on the corrected prompt and the language model. The information processing device according to claim 1 .
8. The processing unit extracts data related to the question from data stored in the selected database, and generates the prompt based on the extracted data and the question. The information processing device according to claim 1 .
9. Using a sentence template for generating a prompt, the sentence template including a first field for storing the question and a second field for storing data of the database, the prompt is generated by storing the question in the first field and the extracted data in the second field. The information processing device according to claim 8.
10. a code execution unit that executes the program code included in the response if the response includes the program code; The information processing device according to claim 1 , further comprising:
11. When the program code includes a variable representing a sensor and an instruction to execute a process based on a value of the variable, the code execution unit reads the sensor data from a time-series database storing the time-series data of the sensor, assigns the read data to the variable, executes the instruction, and outputs a result of the process. The information processing device according to claim 10.
12. the instructions are for generating a graph based on data for the variables; The code execution unit outputs a graph as a result of the processing. The information processing device according to claim 11.
13. the input question is a question input by a user, An output section for visually displaying the results of the processing to a user. The information processing device according to claim 11 , further comprising:
14. a language model execution unit that executes the language model, The processing unit inputs the prompt to the language model execution unit to obtain the answer from the language model execution unit. The information processing device according to claim 1 .
15. The language model is a large-scale language model. The information processing device according to claim 14.
16. the question is a question about a state of a facility in which a plurality of sensors are disposed and whose state is monitored by the sensors; The plurality of databases includes at least a database regarding the type of condition to be monitored, a database regarding equipment provided in the facility, and a database regarding the sensor. The information processing device according to claim 1 .
17. The processing unit generates the plurality of partial questions and determines the order of the plurality of partial questions by applying a planning algorithm to the question, the planning algorithm planning what partial questions and in what order should be asked to obtain a correct answer to the question. The information processing device according to claim 3 .
18. a question input unit that receives input of the question from a user via a screen of an application, The processing unit generates the plurality of partial questions based on the question inputted by the question input unit and determines an order of the plurality of partial questions. The information processing device according to claim 17.
19. selecting a database corresponding to the input question from among a plurality of databases each storing different types of data, based on the content of the question; generating a prompt for input to a language model based on a selected database and the question, and generating an answer based on the prompt and the language model. Information processing methods.
20. selecting a database corresponding to an input question from among a plurality of databases each storing different types of data, based on the content of the input question; generating a prompt for input to a language model based on a selected database and the question, and generating an answer based on the prompt and the language model; A computer program for causing a computer to execute the above.
Citation Information
Patent Citations
Implementation method for automatically generating complex graph database query statement service
CN116340584A
Question and answer method and device, terminal equipment and readable storage medium
CN116483962A
Method, computer device, and computer program for providing dialogue dedicated to domain by using language model
JP2023076413A
Text generation device and text generation method
JP7313757B1
Text generation device and text generation method
JP7325152B1
Cited By
Program, device and method for inferring answers from questions in consideration of the inference process of a language model
JP7764656B1