Data cube searching and question-answering method and system based on large language model
By sorting out the knowledge blocks of data cubes and combining search and question-and-answer techniques for large language models, the problem of inaccurate data search in the enterprise large language model question-and-answer system is solved, and the accurate search and question-and-answer of data cubes is realized, which improves the reliability of question-and-answer sex.
Patent Information
- Application Number
- CN202411299970.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-24
AI Technical Summary
The existing enterprise large language model Q&A system lacks the combination with data cubes, resulting in inaccurate data search and many interference items, and the inability to achieve accurate Q&A of enterprise data.
By sorting out the dimension members and measurement values of the data cube and storing them in the vector library, using a large language model to understand and split user problems, forming sub-tasks for vector library search, and analyzing known information in combination with the knowledge question and answer module. And search again until the final answer is obtained.
It realizes accurate search and question-and-answer of enterprise data, improves the accuracy and reliability of search results, and avoids the problem of incomplete information.
Smart Images

Figure CN119179766A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of large language model application, and in particular to a data cube search and question-answering method and system based on a large language model. Background Art
[0002] The large language model is crucial in enterprises. It can not only improve customer service efficiency, but also help internal knowledge management and decision support. The large language model combined with the enterprise knowledge base allows enterprises to obtain enterprise knowledge and data more accurately and quickly. In the enterprise database, a lot of data is organized and stored in the form of data cubes. Data cubes organize, summarize and display data according to multiple dimensions and are widely used in the field of online analytical processing (OLAP). The combination of large language models and data cubes can quickly realize enterprise data search and question-and-answer, help enterprise users query and analyze data from multiple angles and levels, and provide fast query, analysis and mining capabilities for multi-dimensional data. This can better understand the development status of the enterprise and user needs, thereby guiding enterprises to optimize products and services.
[0003] In the current enterprise big language model question-and-answer systems, unstructured data and list data are often the main data. When applying big models for knowledge search and question-and-answering, there is a lack of question-and-answer systems that combine big models with data cubes. In systems that use list data as the main data for data question-and-answering, the data is scattered, the data search is not accurate, and there are many interference items in the search. This requires relying on powerful big language model capabilities. If the big language model's data organization capabilities are weak, accurate enterprise data question-and-answering cannot be achieved. Summary of the invention
[0004] The purpose of the present invention is to provide a data cube search and question-answering method and system based on a large language model, to construct a data cube search and question-answering technology system based on a large language model and a data cube, and to achieve accurate search and question-answering of enterprise cube data.
[0005] The technical solution adopted by the present invention is: The data cube search and question answering method based on a large language model comprises the following steps: Step 1, knowledge organization: different knowledge blocks are formed for the dimension members and measure values of the cube data, and stored in the vector library respectively; Step 2: Knowledge search: Use the large language model to understand and split the user's question into one or more subtasks, and search the vector library for each subtask to obtain the knowledge list of the question; Step 3, knowledge question and answer, uses a large language model to analyze and sort out the results of knowledge search, and analyze whether the known information can be used to answer user questions; if so, output the final answer; otherwise, output the missing content and conduct a secondary search question and answer.
[0006] Furthermore, step 1 specifically includes the following steps: Step 1-1, collect and obtain data from the data cube of the enterprise's existing system; Step 1-2, process the dimension members and measure values in the data cube to form knowledge blocks, respectively constructing knowledge blocks by dimension, constructing knowledge blocks by dimension members, and constructing knowledge blocks by level; Steps 1-3: vectorize the organized knowledge and store it in a vector database.
[0007] Furthermore, in step 1-2, constructing knowledge blocks by dimension means obtaining the dimensions of all data in the data cube and organizing them into easy-to-understand sentences through natural language. For example, the observation dimensions of enterprise customer data include name, address, and phone. Then the communication knowledge block is that the enterprise customer name is name, the address is address, and the contact number is phone; Furthermore, in step 1-2, knowledge blocks are constructed according to dimension members, that is, member data of all dimensions in the data cube are obtained, and organized into easy-to-understand sentences through natural language. For example, if the time dimension members include Q1, Q2, Q3, and Q4, the constructed knowledge block is that the time dimension members include Q1, Q2, Q3, and Q4, where Q1 represents the first quarter, Q2 represents the second quarter, Q3 represents the third quarter, and Q4 represents the fourth quarter; Furthermore, in step 1-2, knowledge blocks are constructed hierarchically, that is, knowledge is constructed hierarchically by dimension, and organized into easy-to-understand sentences through natural language. For example, if the time dimension includes year, month, week, day, and hour, then the constructed knowledge block is “the time dimension hierarchy includes: year, month, week, day, and hour; Furthermore, step 2 specifically includes the following steps: Step 2-1: Use the large language model to understand and split the user's question into several subtasks; Step 2-2, format the output of the large language model to obtain the specific content of each subtask; Step 2-3, vectorize each subtask separately, and use the selected search algorithm to perform semantic similarity search through the vector library; Step 2-4: merge the search results of multiple tasks and perform deduplication processing to obtain a knowledge list of the problem.
[0008] Furthermore, the search algorithm in step 2-3 adopts a pre-similarity algorithm.
[0009] Furthermore, step 3 specifically includes the following steps: Step 3-1: Organize the results of the knowledge search into prompt words for the large language model and ask the large language model to list the known information and missing information when it cannot answer, so as to obtain the output result of the large language model. Step 3-2: parse the output of the large model; if the "question answer" does not contain "cannot answer your question", the current answer is the final answer; if the "question answer" contains "cannot answer your question", parse the "missing information" from the output of the large language model; Step 3-3: For the missing information parsed out, use the big model to convert the missing information into supplementary questions. Step 3-4, perform a secondary knowledge search on the supplementary questions to obtain the knowledge blocks corresponding to the missing content; and merge the knowledge blocks corresponding to the missing content with the knowledge obtained in the fourth step of the knowledge search to obtain a new knowledge combination as a new knowledge search result; Step 3-5, determine whether the number of secondary knowledge searches has reached the set upper limit; if so, the content of the knowledge search results obtained by the last knowledge merging is used as the final answer; otherwise, execute step 3-1; Furthermore, the upper limit of the number of times of setting step 3-5 is 5 times.
[0010] The present invention also discloses a data cube search and question-answering system based on a large language model, which comprises: Knowledge sorting module: used to form different knowledge blocks based on dimension members and measure values of cube data and store them in vector libraries respectively; Knowledge search module: used to use the large language model to understand and split the user's questions into one or more subtasks, and search the vector library for each subtask to obtain the knowledge list of the question; Knowledge Q&A module: used to use a large language model to perform Q&A analysis and sorting on the results of knowledge search, and analyze whether the known information can be used to answer user questions; if so, output the final answer; otherwise, output the missing content and conduct a secondary search Q&A.
[0011] The present invention adopts the above technical solution, which has the following technical effects: 1) By using data sorting technology on the dimensions, dimension members, and levels in the data cube, knowledge that is easy to understand by the large language model can be sorted out. At the same time, the knowledge is also convenient for extracting the semantics of knowledge and realizing accurate knowledge search; 2) Using the large language model to understand and split user questions can avoid the problem that the large model answers the wrong questions or provides incomplete information due to incomplete search information. 3) The large language model answers user questions step by step based on known information, realizing the self-reflection of the large model and the reliability of question and answer. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments; Figure 1 A schematic diagram of the flow of the data cube search and question-answering method based on a large language model of the present invention; Figure 2 Schematic diagram of the principle organized for the knowledge of the present invention; Figure 3 A schematic diagram of the principle of knowledge search of the present invention; Figure 4 It is a schematic diagram of the principle of the knowledge question and answer of the present invention;. Implementation
[0013] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0014] like Figures 1 to 4 As shown in one, the present invention discloses a data cube search and question answering method based on a large language model, which includes the following steps: Step 1, knowledge organization: different knowledge blocks are formed for the dimension members and measure values of the cube data, and stored in the vector library respectively; Step 2: Knowledge search: Use the large language model to understand and split the user's question into one or more subtasks, and search the vector library for each subtask to obtain the knowledge list of the question; Step 3, knowledge question and answer, uses a large language model to analyze and sort out the results of knowledge search, and analyze whether the known information can be used to answer user questions; if so, output the final answer; otherwise, output the missing content and conduct a secondary search question and answer.
[0015] Furthermore, if Figure 2 As shown, step 1 specifically includes the following steps: Step 1-1, collect and obtain data from the data cube of the enterprise's existing system; Step 1-2, process the dimension members and measure values in the data cube to form knowledge blocks, respectively constructing knowledge blocks by dimension, constructing knowledge blocks by dimension members, and constructing knowledge blocks by level; Steps 1-3: vectorize the organized knowledge and store it in a vector database.
[0016] Furthermore, in step 1-2, constructing knowledge blocks by dimension means obtaining the dimensions of all data in the data cube and organizing them into easy-to-understand sentences through natural language. For example, the observation dimensions of enterprise customer data include name, address, and phone. Then the communication knowledge block is that the enterprise customer name is name, the address is address, and the contact number is phone; Furthermore, in step 1-2, knowledge blocks are constructed according to dimension members, that is, member data of all dimensions in the data cube are obtained, and organized into easy-to-understand sentences through natural language. For example, if the time dimension members include Q1, Q2, Q3, and Q4, the constructed knowledge block is that the time dimension members include Q1, Q2, Q3, and Q4, where Q1 represents the first quarter, Q2 represents the second quarter, Q3 represents the third quarter, and Q4 represents the fourth quarter; Furthermore, in step 1-2, knowledge blocks are constructed hierarchically, that is, knowledge is constructed hierarchically by dimension, and organized into easy-to-understand sentences through natural language. For example, if the time dimension includes year, month, week, day, and hour, then the constructed knowledge block is “the time dimension hierarchy includes: year, month, week, day, and hour; Furthermore, if Figure 3 As shown, step 2 specifically includes the following steps: Step 2-1: Use the large language model to understand and split the user's question into several subtasks; Step 2-2, format the output of the large language model to obtain the specific content of each subtask; Step 2-3, vectorize each subtask separately, and use the selected search algorithm to perform semantic similarity search through the vector library; Step 2-4: merge the search results of multiple tasks and perform deduplication processing to obtain a knowledge list of the problem.
[0017] Furthermore, the search algorithm in step 2-3 adopts a pre-similarity algorithm.
[0018] Furthermore, if Figure 4 As shown, step 3 specifically includes the following steps: Step 3-1: Organize the results of the knowledge search into prompt words for the large language model and ask the large language model to list the known information and missing information when it cannot answer, so as to obtain the output result of the large language model. Step 3-2: parse the output of the large model; if the "question answer" does not contain "cannot answer your question", the current answer is the final answer; if the "question answer" contains "cannot answer your question", parse the "missing information" from the output of the large language model; Step 3-3: For the missing information parsed out, use the big model to convert the missing information into supplementary questions. Step 3-4, perform a secondary knowledge search on the supplementary questions to obtain the knowledge blocks corresponding to the missing content; and merge the knowledge blocks corresponding to the missing content with the knowledge obtained in the fourth step of the knowledge search to obtain a new knowledge combination as a new knowledge search result; Step 3-5, determine whether the number of secondary knowledge searches has reached the set upper limit; if so, the content of the knowledge search results obtained by the last knowledge merging is used as the final answer; otherwise, execute step 3-1; Furthermore, the upper limit of the number of times of setting step 3-5 is 5 times.
[0019] The present invention discloses a data cube search and question-answering system based on a large language model, which comprises: Knowledge sorting module: used to form different knowledge blocks based on dimension members and measure values of cube data and store them in vector libraries respectively; Knowledge search module: used to use the large language model to understand and split the user's questions into one or more subtasks, and search the vector library for each subtask to obtain the knowledge list of the question; Knowledge Q&A module: used to use a large language model to perform Q&A analysis and sorting on the results of knowledge search, and analyze whether the known information can be used to answer user questions; if so, output the final answer; otherwise, output the missing content and conduct a secondary search Q&A.
[0020] The specific principle of the present invention is described in detail below: 1. Knowledge organization: In enterprise knowledge question and answer, through knowledge organization, the large language model can have a deeper understanding of the semantics, grammar and contextual relationships in the text, thereby improving the ability to understand natural language. In addition, knowledge organization helps the model generate more accurate, coherent and logical text, improving the quality of text generation. In this solution, the main source of knowledge data involved is the data cube. The specific method of data cube knowledge organization is as follows: Step 1: Data in the data cube from the enterprise's existing system; Step 2: Process the dimension members and measure values in the data cube to form a knowledge block; the specific implementation method is as follows: 1. Construct knowledge blocks by dimension. That is, obtain the dimensions of all data in the data cube and organize them into easy-to-understand sentences through natural language. For example, the observation dimensions of enterprise customer data include name, address, and phone. Then the communication knowledge block is the enterprise customer name is name, the address is address, and the contact number is phone; 2. Construct knowledge blocks by dimension members: that is, obtain the member data of all dimensions in the data cube and organize them into easy-to-understand sentences through natural language. For example, if the time dimension members include Q1, Q2, Q3, and Q4, then the constructed knowledge block is the time dimension members including Q1, Q2, Q3, and Q4, where Q1 represents the first quarter, Q2 represents the second quarter, Q3 represents the third quarter, and Q4 represents the fourth quarter; 3. Construct knowledge blocks by level. That is, construct knowledge by dimensional level, and organize it into easy-to-understand sentences through natural language. For example, if the time dimension includes year, month, week, day, and hour, then the constructed knowledge block is "The time dimension level includes: year, month, week, day, and hour; Step 3: Vectorize (Embedding) the organized knowledge and store it in the vector database.
[0021] 2. Knowledge search: The data in the data cube has the multidimensional characteristics, resulting in a large number of knowledge blocks organized by the data cube. Through knowledge search, relevant knowledge can be found in a large amount of knowledge, which can improve the accuracy of the question-answering language model in answering questions. However, considering the multidimensional characteristics of the data cube, it is necessary to break down the user's questions in order to search for more fine-grained data. In this solution, knowledge search is carried out through the following steps: Step 1: Use the large language model to understand and split the user's questions into several subtasks. The prompt words for task decomposition are as follows: "You are an expert in natural language understanding and good at task decomposition. Please analyze the user's question. If the user's question contains multiple questions, please break it down.
[0022] After the problem is broken down, it is output one by one. The reference output format is as follows: Task 1: Description of Task 1 Task 2: Description of Task 2 Task n: Description of the task n. n can be 1, 2, 3, 4, 5, 6, ... User's question: {query}" The query is the actual question asked by the user.
[0023] Step 2: Format the output of the large language model to obtain the specific content of each task; that is, based on the first step, parse the content in "Task 1:", "Task 2:", and "Task n:".
[0024] Step 3: Vectorize each subtask separately and perform semantic similarity search through the vector library; the search algorithm uses the pre-similarity algorithm; Step 4: Merge the search results of multiple tasks and remove duplicates; 3. Knowledge Q&A: Through knowledge search, we can obtain knowledge data related to user questions. By applying the Q&A big model, we can perform knowledge understanding and Q&A. In this solution, considering that the searched content may be missing, we use the big language model to reflect on ourselves during the Q&A process, analyze the missing content of the answer, and then search and Q&A again until the final result is obtained. The specific implementation process is as follows: Step 1: Organize the results of knowledge search into the following form as the prompt word input of the large language model. That is, the input of the large model is: "You are a smart assistant. Please answer the user's question based on the following content. If the following content is not enough to answer For user questions, please reply with known information, missing information, and list them one by one. Output reference: Known information: Based on the questions raised by the user, refine the known information and list them one by one.
[0025] Missing information: Analyze missing information based on questions raised by users and refine known information.
[0026] Question answer: The answer to the question raised by the user. When there is missing information, answer 'Based on the known information, your question cannot be answered. You need xxxx information'.
[0027] Reference information is as follows: The first knowledge Article 2 Knowledge Article 3 Knowledge … The user's question is: {query} ” Here, query is the actual question asked by the user, and “xxxx” represents the description of the missing information.
[0028] Step 2: Analyze the output of the large model. If the "question answer" does not contain "cannot answer your question", the current answer is the final answer. If the "question answer" contains "cannot answer your question", analyze the "missing information".
[0029] Step 3: For the missing information parsed out, use the big model to convert the missing information into questions. The specific implementation is as follows: "You are a smart assistant. Please generate three questions with similar meanings based on the following questions.
[0030] Requirements: Similar questions generated need to be numbered and separated by line breaks.
[0031] question: {query}” The query is the description of the missing information.
[0032] Step 4: Analyze the output structure of the large model in step 3, extract similar questions, and conduct knowledge search on them respectively to find out the knowledge blocks related to the missing content. And merge them with the knowledge obtained in step 3 of the knowledge search to obtain a new knowledge combination.
[0033] Step 5: Repeat the process from step 1 to step 4 until the "answer to the question" output in step 2 contains "cannot answer your question", or there is still no result after 5 discussions. Then let the big model reply with the content in the "answer to the question" in step 2.
[0034] The present invention adopts the above technical solution, which has the following technical effects: 1) By using data sorting technology on the dimensions, dimension members, and levels in the data cube, knowledge that is easy to understand by the large language model can be sorted out. At the same time, the knowledge is also convenient for extracting the semantics of knowledge and realizing accurate knowledge search; 2) Using the large language model to understand and split user questions can avoid the problem that the large model answers the wrong questions or provides incomplete information due to incomplete search information. 3) The large language model answers user questions step by step based on known information, realizing the self-reflection of the large model and the reliability of question and answer.
[0035] Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the detailed description of the embodiments of the present application is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians of the art without making creative work are within the scope of protection of the present application.
Claims
1. A data cube search and question answering method based on a large language model, characterized by: The following steps are involved: Step 1, knowledge organization: different knowledge blocks are formed for the dimension members and measure values of the cube data, and stored in the vector library respectively; Step 2: Knowledge search: Use the large language model to understand and split the user's question into one or more subtasks, and search the vector library for each subtask to obtain the knowledge list of the question; Step 3: Knowledge question answering: Use a large language model to analyze and sort out the results of knowledge search to determine whether the known information can be used to answer user questions. If yes, output the final answer; Otherwise, output the missing content and conduct a secondary search question.
2. The data cube search and question-answering method based on a large language model according to claim 1, characterized in that: Step 1 specifically includes the following steps: Step 1-1, collect and obtain data from the data cube of the enterprise's existing system; Step 1-2, process the dimension members and measure values in the data cube to form knowledge blocks, respectively constructing knowledge blocks by dimension, constructing knowledge blocks by dimension members, and constructing knowledge blocks by level; Steps 1-3: vectorize the organized knowledge and store it in a vector database.
3. The data cube search and question-answering method based on a large language model according to claim 2, characterized in that: In step 1-2, constructing knowledge blocks by dimensions means obtaining the dimensions of all data in the data cube and organizing them into easy-to-understand sentences through natural language; constructing knowledge blocks by dimension members means obtaining the member data of all dimensions in the data cube and organizing them into easy-to-understand sentences through natural language; constructing knowledge blocks by hierarchy means constructing knowledge by dimension hierarchy and organizing them into easy-to-understand sentences through natural language.
4. The data cube search and question-answering method based on a large language model according to claim 1, characterized in that: Step 2 specifically includes the following steps: Step 2-1: Use the large language model to understand and split the user's question into several subtasks; Step 2-2, format the output of the large language model to obtain the specific content of each subtask; Step 2-3, vectorize each subtask separately, and use the selected search algorithm to perform semantic similarity search through the vector library; Step 2-4: merge the search results of multiple tasks and perform deduplication processing to obtain a knowledge list of the problem.
5. The data cube search and question-answering method based on a large language model according to claim 4, characterized in that: The search algorithm in step 2-3 adopts the pre-similarity algorithm.
6. The data cube search and question answering method based on a large language model according to claim 1, characterized in that: Step 3 specifically includes the following steps: Step 3-1: Organize the results of the knowledge search into prompt words for the large language model and ask the large language model to list the known information and missing information when it cannot answer, so as to obtain the output result of the large language model. Step 3-2: parse the output of the large model; if the "question answer" does not contain "cannot answer your question", the current answer is the final answer; if the "question answer" contains "cannot answer your question", parse the "missing information" from the output of the large language model; Step 3-3: For the missing information parsed out, use the big model to convert the missing information into supplementary questions. Step 3-4, perform a secondary knowledge search on the supplementary questions to obtain the knowledge blocks corresponding to the missing content; and merge the knowledge blocks corresponding to the missing content with the knowledge obtained in the fourth step of the knowledge search to obtain a new knowledge combination as a new knowledge search result; Step 3-5, determine whether the number of secondary knowledge searches has reached the set upper limit; if so, the content of the knowledge search results obtained by the last knowledge merging is used as the final answer; otherwise, execute step 3-1.
7. The data cube search and question-answering method based on a large language model according to claim 6, characterized in that: The upper limit of the number of times steps 3-5 can be set is 5 times.
8. A data cube search and question answering system based on a large language model, using the data cube search and question answering method based on a large language model according to any one of claims 1 to 7, characterized in that: The system includes: Knowledge sorting module: used to form different knowledge blocks based on dimension members and measure values of cube data and store them in vector libraries respectively; Knowledge search module: used to use the large language model to understand and split the user's questions into one or more subtasks, and search the vector library for each subtask to obtain the knowledge list of the question; Knowledge question-answering module: used to analyze and sort out the results of knowledge search using a large language model, and to analyze whether the known information can be used to answer user questions; If yes, output the final answer; Otherwise, output the missing content and conduct a secondary search question.
Citation Information
Cited By
Commercial real estate digital assistant system based on large model and intelligent agent
CN119918633A
