Data query method, device and equipment based on large model and medium
By analyzing and generating data analysis and generating in the internal and external information, the existing large language models cannot provide comprehensive and accurate query results in complex data analysis and information retrieval in combination with internal and external information. And comprehensive query results.
Patent Information
- Application Number
- CN202411303160.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-18
AI Technical Summary
Existing large language models often fail to provide comprehensive and accurate query results when dealing with complex data analysis and information retrieval tasks.
By conducting physical identification of query sentences, combining internal information and external information, large models are used for data analysis and data generation, and query results are obtained. Specific steps include: physical identification, internal information data analysis, external information data generation, and combine the two to obtain the final query results.
It improves the comprehensiveness and accuracy of the query results. By combining internal and external information, the strong data analysis and generating ability of large models will be used to provide more accurate and comprehensive query results.
Smart Images

Figure CN119377345A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, specifically natural language processing, deep learning, big models and other technical fields, and can be applied to dialogue systems, information retrieval and other scenarios, and in particular to a data query method, device, equipment and storage medium based on big models. Background Art
[0002] With the rapid development of large language models (LLMs) in the field of natural language processing, they have demonstrated outstanding capabilities in complex conversations, reasoning, and content generation. Summary of the invention
[0003] The present invention provides a data query method, device, equipment and storage medium based on a large model.
[0004] According to one aspect of the present disclosure, a big model-based data query method is provided, including: performing entity recognition on a query statement to obtain a target entity in the query statement; obtaining first associated content associated with the target entity in internal information, and performing data analysis on the first associated content based on LLM to obtain a data analysis result; obtaining second associated content associated with the target entity in external information, and performing data generation on the second associated content based on the LLM to obtain a data generation result; and obtaining a query result corresponding to the query statement based on the data analysis result and the data generation result.
[0005] According to another aspect of the present disclosure, a data query device based on a large model is provided, including: an identification module, used to perform entity recognition on a query statement to obtain a target entity in the query statement; an analysis module, used to obtain a first associated content associated with the target entity in internal information, and perform data analysis on the first associated content based on the LLM to obtain a data analysis result; a generation module, used to obtain a second associated content associated with the target entity in external information, and perform data generation on the second associated content based on the LLM to obtain a data generation result; an acquisition module, used to obtain a query result corresponding to the query statement based on the data analysis result and the data generation result.
[0006] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any method as described in any of the above aspects.
[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods according to any one of the above aspects.
[0008] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the methods described in any one of the above aspects.
[0009] The present disclosure can improve the comprehensiveness and accuracy of query results.
[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0012] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;
[0013] Figure 2 is a schematic diagram of an application scenario for implementing an embodiment of the present disclosure;
[0014] Figure 3 is a schematic diagram of a data analysis module provided according to an embodiment of the present disclosure;
[0015] Figure 4 is a schematic diagram of a RAG module provided according to an embodiment of the present disclosure;
[0016] Figure 5 is a schematic diagram according to a second embodiment of the present disclosure;
[0017] Figure 6 is a schematic diagram according to a third embodiment of the present disclosure;
[0018] Figure 7 It is a schematic diagram of an electronic device used to implement the big model-based data query method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0020] Although LLM performs well in some aspects, existing LLM techniques often fail to provide comprehensive and accurate answers when dealing with complex tasks involving data analysis and information retrieval.
[0021] In order to improve the accuracy of the query results, the present disclosure provides the following embodiments.
[0022] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure. This embodiment provides a data query method based on a large model, the method comprising:
[0023] 101. Perform entity recognition on the query statement to obtain a target entity in the query statement.
[0024] 102. Acquire first associated content associated with the target entity in the internal information, and perform data analysis on the first associated content based on the LLM to obtain a data analysis result.
[0025] 103. Acquire second associated content associated with the target entity from external information, and generate data for the second associated content based on the LLM to obtain a data generation result.
[0026] 104. Based on the data analysis result and the data generation result, obtain a query result corresponding to the query statement.
[0027] The query statement (query) is the content to be queried. Specifically, the user can input the query statement in natural language.
[0028] The target entity refers to the entity obtained after entity recognition on the query statement. The target entity can be one or more.
[0029] The target entity may include one or more of geographic information, time information, domain information, etc. For example, if the query statement is "Why is the GDP of city X growing in the first quarter of 2023", after entity recognition of the query statement, the following target entity may be obtained: geographic information: city X; time information: the first quarter of 2023; domain information: gross domestic product (GDP).
[0030] In order to improve the comprehensiveness and accuracy of the query results, in the embodiments of the present disclosure, the query results are obtained by combining internal information and external information.
[0031] Among them, internal information refers to the user's private information, for example, the internal information is the user's local database, which can store structured data such as data tables. Generally speaking, internal information is not open to the public and cannot be obtained through search engine retrieval.
[0032] External information refers to public information such as news and forums that is open to the public and can be obtained through search engines.
[0033] The content associated with the target entity obtained in the internal information is called the first associated content, and the content associated with the target entity obtained in the external information is called the second associated content.
[0034] After the first associated content is acquired, the LLM may be used to perform data analysis on the first associated content to obtain a data analysis result.
[0035] Data analysis refers to using LLM to understand and gain insights into data, identify data development trends, and summarize based on data development trends to obtain data analysis results.
[0036] For example, in the social economy field, based on the above query statement example, we can obtain the impact factor (IF) of the field information (such as GDP), IF such as income (such as information income, software income, etc.), and analyze the trend curves of these IFs changing over time, such as the trend curve of income growth or decrease in the above location and time (such as the first quarter of 2023 in city X). After obtaining the above trend curves, we can summarize these trend curves and obtain the summary results of the text as the data analysis results.
[0037] After acquiring the second associated content, the LLM may be used to generate data for the second associated content to obtain a data generation result.
[0038] Data generation refers to using LLM to generate data based on the retrieved data to obtain newly generated data, and using the newly generated data as the data generation result.
[0039] In this embodiment, the second associated content is obtained from external information, and LLM generates data based on the second associated content. Since the external information is referenced instead of just using the generation capability of LLM itself, the data generation in this embodiment can be called Retrieval-augmented Generation (RAG), which combines language models and information retrieval technology to improve the accuracy of data generation results.
[0040] After obtaining the data analysis results and the data generation results, the final query result can be obtained based on the two results. For example, the data analysis results and the data generation results are concatenated together as the query result.
[0041] In this embodiment, by obtaining the first related content from the internal information and the second related content from the external information, data query can be performed in combination with the internal and external information to improve comprehensiveness; by performing data analysis on the first related content and generating data for the second related content, query results are obtained based on the data analysis results and the data generation results, and query results can be obtained in a variety of ways to further improve comprehensiveness; by performing data analysis and data generation through LLM, the powerful data analysis and data generation capabilities of LLM can be utilized to improve accuracy; therefore, the comprehensiveness and accuracy of data query can be improved.
[0042] In order to better understand the embodiments of the present disclosure, application scenarios to which the embodiments of the present disclosure can be applied are described.
[0043] Figure 2 It is a schematic diagram of an application scenario for implementing the embodiment of the present disclosure.
[0044] In this scenario, the user can input a query statement (query) into the data query system through an application (Application, APP) installed on the user terminal. The query statement is, for example: "Why did the GDP of city X increase in the first quarter of 2023?".
[0045] After receiving the query statement, the data query system performs entity recognition on it to obtain the target entity in the query statement.
[0046] The data query system can use preset entity recognition rules to perform entity recognition, or the data query system can call LLM and use LLM to perform entity recognition on the query statement. Taking entity recognition based on LLM as an example, the data query system can input the query statement and prompt information (prompt) into LLM. The prompt information can be preset, such as "identify the entity therein". LLM performs entity recognition on the query statement based on the prompt information, obtains the target entity in the query statement, and feeds it back to the data query system.
[0047] Based on the above query statement example, the target entities include, for example: domain information: GDP; time information: 2023Q1; geographic information: city X.
[0048] like Figure 2 As shown, the query part of the data query system includes a data analysis module 201 and a retrieval-augmented generation (RAG) module 202 .
[0049] The data analysis module mainly obtains the first associated content associated with the target entity in the internal information, and performs data analysis on the first associated content based on the LLM to obtain a data analysis result.
[0050] The RAG module mainly obtains the second associated content associated with the target entity from the external information, and generates data for the second associated content based on the LLM to obtain a data generation result.
[0051] The internal information is, for example, a local database set by a user. The local database may store a data table, and the first associated content is obtained by querying the data table.
[0052] After obtaining the first associated content, the LLM may be used to analyze, calibrate, summarize, and other processes on the first associated content to obtain a data analysis result.
[0053] The external information, for example, is to call a search engine and retrieve the second related content from external information such as news and forums through the search engine.
[0054] After the second related content is obtained, the second related content may be filtered, generated, etc. using LLM to obtain a data generation result.
[0055] After obtaining the data analysis results and the data generation results, the two results can be spliced together to obtain the query results, that is, the query results include two parts, one part is the data analysis results, and the other part is the data generation results.
[0056] Figure 3 It is a schematic diagram of a data analysis module provided according to an embodiment of the present disclosure.
[0057] like Figure 3 As shown, the data analysis module includes: a vector retrieval and matching module, a correlation index analysis module, and a calibration and summary module.
[0058] Vector retrieval and matching module: mainly converts the target entity into an entity vector, matches it with the field vector in the database, and determines the target field.
[0059] This ensures that the entities in the user's query can be correctly mapped to the corresponding fields in the database. The system uses vector search technology to identify the database column name that is most similar to the query entity. For example, "GDP" in the user's query may be labeled as "gross domestic product" in the database, and the vector search technology can match the correct field.
[0060] Related indicator analysis module: mainly obtains IFs related to the target field based on the knowledge graph, and analyzes the changing trends of these IFs within the specified time and place, such as the time and place included in the query statement.
[0061] For example, through the knowledge graph, we can obtain IFs related to "GDP", including information income, software income, etc.; in the database, we can obtain the time trend data of these incomes at a specified time and place; then, we use LLM to analyze these incomes and obtain the analysis results. For example, LLM calculates the values of these incomes respectively, and then obtains the GDP value based on the relationship between these incomes and GDP.
[0062] Calibration and summary module: mainly calibrates the analysis results to obtain the calibration results, and summarizes the calibration results to obtain the data analysis results.
[0063] For example, the query statement entered by the user may not be accurate. For example, the query statement above indicates that GDP is increasing, but in fact the correct result may be decreasing. Therefore, during calibration, the main thing is to determine whether GDP is increasing. If an accurate GDP value can be obtained after analysis, it can be determined whether GDP is increasing based on the GDP value. If there is an error in the query statement, the query statement is calibrated. For example, the calibration result is "the GDP of city X in the first quarter of 2023 is decreasing."
[0064] After obtaining the calibration results, the calibration results and analysis results are summarized to obtain the data analysis results. For example, the data analysis result is "the GDP value of city X in the first quarter of 2023 is Y yuan, which comes from information income and software income". For another example, if the correct GDP result is a decrease, the data analysis result can be "the GDP value of city X in the first quarter of 2023 is Y yuan, which is a decrease", so that user query errors can be corrected in time and the accuracy of query results can be improved.
[0065] Figure 4 is a schematic diagram of a RAG module provided according to an embodiment of the present disclosure.
[0066] like Figure 4 As shown, the RAG module includes: a time-sensitive retrieval module, a multi-dimensional filtering module and a generation module.
[0067] Time-sensitive retrieval module: Conventional retrieval is based on the similarity between candidate documents and target entities. In this embodiment, in order to improve timeliness, the retrieval module mainly obtains candidate documents whose publishing time matches the time information in the target entity.
[0068] Specifically, the target entity is converted into an entity vector and matched with the pre-processed document fragments, and documents published within the relevant time period (such as the first quarter of 2023) are retrieved first to ensure the timeliness and relevance of the retrieval results.
[0069] Multi-dimensional filtering module: Based on LLM, the search results are filtered in multiple dimensions, including relevance to the query index, time matching, geographic matching, etc. Only those contents that meet all the criteria will be retained and enter the next step of summary generation process.
[0070] Summarization and generation module: Use LLM to summarize and generate the filtering results. In addition, when generating data, the information source corresponding to the filtering results (such as document titles, URLs, etc.) will be referenced to improve the credibility of the generated content. For example, the content of authoritative websites is given priority.
[0071] The data generation result is, for example, "Some people believe that the GDP growth of city X in the first quarter of 2023 is mainly due to..."
[0072] After obtaining the data analysis results and the data generation results, the two results can be spliced to obtain the query results. For example, the query result is "the GDP value of city X in the first quarter of 2023 is Y yuan, which comes from information income and software income; some opinions believe that the GDP growth of city X in the first quarter of 2023 is mainly due to..."
[0073] In combination with the above application scenarios, the present disclosure also provides the following embodiments.
[0074] Figure 5 is a schematic diagram according to a second embodiment of the present disclosure. This embodiment provides a data query method based on a large model, the method comprising:
[0075] 501. Perform entity recognition on the query statement using LLM to obtain a target entity in the query statement.
[0076] For example, the data query system can input the query statement and prompt information into the LLM. The prompt information can be preset, such as "identify the entities therein". LLM performs entity recognition on the query statement based on the prompt information, obtains the target entity in the query statement, and feeds back to the data query system.
[0077] In this embodiment, the target entity in the query statement is obtained based on LLM, and the excellent performance of LLM can be used to improve the accuracy of the target entity, thereby improving the accuracy of data query.
[0078] 502. Acquire first associated content associated with the target entity in the internal information, and perform data analysis on the first associated content based on the LLM to obtain a data analysis result.
[0079] For the first associated content: convert the target entity into an entity vector; obtain target content matching the entity vector in the internal information; based on a preset knowledge graph, obtain related content of the target content; and use the target content and the related content as the first associated content.
[0080] For example, if the internal information is a local database, the query statement can be converted into a query instruction, such as a Structured Query Language (SQL) instruction. Specifically, the query statement can be converted into a query instruction based on a preset rule or LLM. The query instruction includes an entity vector corresponding to the target entity. By querying the local database through the query instruction, a target field (such as gross domestic product) matching the target entity (such as GDP) can be obtained, and then the target field and its field value (such as a specific GDP value) are used as the target content.
[0081] After obtaining the target content, related content of the target content can be obtained based on the knowledge graph. For example, if the knowledge graph shows that GDP is related to information income and software income, then information income and software income will be taken as related content. Alternatively, specific values of these related contents (such as information income and software income) can be obtained in the local database, and these indicators (information income and software income) and their values can be taken as related content.
[0082] In this embodiment, the target entity is converted into an entity vector, and the target content is obtained based on the entity vector, which can solve the problem of inconsistency between the target entity in the query statement and the stored target content, and improve the comprehensiveness and accuracy of the query; obtaining relevant content through the knowledge graph, and taking the target content and the related content as the first associated content can further improve the comprehensiveness and accuracy of the query.
[0083] For data analysis: using the LLM to analyze the first associated content to obtain an analysis result; using the LLM to calibrate the query statement based on the analysis result to obtain a calibration result; using the LLM to summarize the analysis result and the calibration result to obtain the data analysis result.
[0084] For example, the time trend data of related indicators can be obtained through the values of related indicators, and the analysis results can be obtained based on these time trend data, such as the increase in information income leads to GDP growth; in addition, the GDP value obtained from the local database can determine the correct result of whether GDP has increased. If the correct result is inconsistent with the query statement, the query statement is calibrated. For example, if the query statement indicates that GDP has increased, but the correct result may be a decrease, the calibration result clearly indicates that GDP has decreased, which is conducive to error correction and improves the accuracy of data query. Afterwards, LLM can be used to summarize the analysis results and calibration results to obtain data analysis results.
[0085] In this embodiment, the data analysis results are obtained by analysis, calibration, and summary, which can improve the accuracy of the data analysis results and further improve the accuracy of data query.
[0086] 503. Acquire second associated content associated with the target entity from external information, and generate data for the second associated content based on the LLM to obtain a data generation result.
[0087] For the second associated content: based on the release time of the external information, obtain the external information that matches the query statement time; and obtain the second associated content associated with the target entity from the external information that matches the time.
[0088] For example, assuming that the query statement is to inquire about the situation in the first quarter of 2023, then in the external information, the text data with a release time within the first quarter of 2023 will be used as the time-matching external information.
[0089] For the text data published in the first quarter of 2023, the relevant text data is obtained as the second related content based on the similarity with the target entity, which can be specifically vector similarity.
[0090] In this embodiment, by acquiring the second associated content from the time-matched external information, the timeliness and relevance of the data query can be improved.
[0091] For data generation: using the LLM to filter the second associated content to obtain a filtering result; using the LLM to generate the filtering result based on an information source corresponding to the filtering result to obtain the data generation result.
[0092] The filtering may be multi-dimensional filtering, such as filtering based on time, geography, indicators, and other dimensions, removing the results that are inconsistent with the time, geography, indicators, and other dimensions in the query statement to obtain the filtered results.
[0093] The filtering result is usually text data, and the corresponding information source can be the URL, title, etc. of the text data. When generating data, LLM can generate data in combination with the URL and title of the text data to obtain the data generation result.
[0094] In this embodiment, the accuracy of the data generation result can be improved by filtering and combining information sources to generate data.
[0095] 504. Based on the data analysis result and the data generation result, obtain a query result corresponding to the query statement.
[0096] For example, the data analysis results and the data generation results are concatenated and used as the query results.
[0097] Figure 6 is a schematic diagram according to the third embodiment of the present disclosure. This embodiment provides a data query device based on a large model, such as Figure 6 As shown, the device 600 includes: an identification module 601, an analysis module 602, a generation module 603 and an acquisition module 604.
[0098] The identification module 601 is used to perform entity recognition on the query statement to obtain the target entity in the query statement; the analysis module 602 is used to obtain the first associated content associated with the target entity in the internal information, and perform data analysis on the first associated content based on the LLM to obtain the data analysis result; the generation module 603 is used to obtain the second associated content associated with the target entity in the external information, and perform data generation on the second associated content based on the LLM to obtain the data generation result; the acquisition module 604 is used to obtain the query result corresponding to the query statement based on the data analysis result and the data generation result.
[0099] In this embodiment, by obtaining the first related content from the internal information and the second related content from the external information, data query can be performed in combination with the internal and external information to improve comprehensiveness; by performing data analysis on the first related content and generating data for the second related content, query results are obtained based on the data analysis results and the data generation results, and query results can be obtained in a variety of ways to further improve comprehensiveness; by performing data analysis and data generation through LLM, the powerful data analysis and data generation capabilities of LLM can be utilized to improve accuracy; therefore, the comprehensiveness and accuracy of data query can be improved.
[0100] In some embodiments, the analysis module 602 is further configured to:
[0101] Converting the target entity into an entity vector;
[0102] Acquire target content matching the entity vector in the internal information;
[0103] Based on a preset knowledge graph, obtain relevant content of the target content;
[0104] The target content and the related content are used as the first associated content.
[0105] In this embodiment, the target entity is converted into an entity vector, and the target content is obtained based on the entity vector, which can solve the problem of inconsistency between the target entity in the query statement and the stored target content, and improve the comprehensiveness and accuracy of the query; obtaining relevant content through the knowledge graph, and taking the target content and the related content as the first associated content can further improve the comprehensiveness and accuracy of the query.
[0106] In some embodiments, the analysis module 602 is further configured to:
[0107] Analyzing the first associated content using the LLM to obtain an analysis result;
[0108] Using the LLM, calibrating the query statement based on the analysis result to obtain a calibration result;
[0109] The analysis results and the calibration results are summarized using the LLM to obtain the data analysis results.
[0110] In this embodiment, the data analysis results are obtained by analysis, calibration, and summary, which can improve the accuracy of the data analysis results and further improve the accuracy of data query.
[0111] In some embodiments, the generating module 603 is further used to:
[0112] Based on the release time of the external information, obtaining the external information matching the query statement time;
[0113] In the time-matched external information, second associated content associated with the target entity is obtained.
[0114] In this embodiment, by acquiring the second associated content from the time-matched external information, the timeliness and relevance of the data query can be improved.
[0115] In some embodiments, the generating module 603 is further used to:
[0116] filtering the second associated content using the LLM to obtain a filtering result;
[0117] The LLM is used to generate the filtering result based on the information source corresponding to the filtering result to obtain the data generation result.
[0118] In this embodiment, the accuracy of the data generation result can be improved by filtering and combining information sources to generate data.
[0119] In some embodiments, the identification module 601 is further used to:
[0120] Perform entity recognition on the query statement based on the LLM to obtain the target entity.
[0121] In this embodiment, the target entity in the query statement is obtained based on LLM, and the excellent performance of LLM can be used to improve the accuracy of the target entity, thereby improving the accuracy of data query.
[0122] It can be understood that in the embodiments of the present disclosure, the same or similar contents in different embodiments can be referenced to each other.
[0123] It can be understood that the “first”, “second”, etc. in the embodiments of the present disclosure are only used for distinction and do not indicate the degree of importance, time sequence, etc.
[0124] It is understandable that, unless otherwise specified, the sequence of steps in the process indicates that the timing relationship between these steps is not limited.
[0125] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0126] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0127] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device 700 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0128] like Figure 7As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0129] Multiple components in the electronic device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the electronic device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0130] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as a data query method based on a large model. For example, in some embodiments, the data query method based on a large model may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the data query method based on the large model described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform a data query method based on a large model in any other appropriate manner (e.g., by means of firmware).
[0131] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0132] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable query device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0133] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0134] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0135] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0136] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0137] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0138] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A data query method based on a large model, comprising: Performing entity recognition on the query statement to obtain a target entity in the query statement; Acquire first associated content associated with the target entity in the internal information, and perform data analysis on the first associated content based on a large language model (LLM) to obtain a data analysis result; Acquire second associated content associated with the target entity from external information, and generate data for the second associated content based on the LLM to obtain a data generation result; Based on the data analysis result and the data generation result, a query result corresponding to the query statement is obtained.
2. The method according to claim 1, wherein: The acquiring the first associated content associated with the target entity in the internal information includes: Converting the target entity into an entity vector; Acquire target content matching the entity vector in the internal information; Based on a preset knowledge graph, obtain relevant content of the target content; The target content and the related content are used as the first associated content.
3. The method according to claim 1, wherein: The performing data analysis on the first associated content based on the LLM to obtain a data analysis result includes: Analyzing the first associated content using the LLM to obtain an analysis result; Using the LLM, calibrating the query statement based on the analysis result to obtain a calibration result; The analysis results and the calibration results are summarized using the LLM to obtain the data analysis results.
4. The method according to claim 1, wherein: The acquiring the second associated content associated with the target entity from the external information includes: Based on the release time of the external information, obtaining the external information matching the query statement time; In the time-matched external information, second associated content associated with the target entity is obtained.
5. The method according to claim 1, wherein: The performing data generation on the second associated content based on the LLM to obtain a data generation result includes: filtering the second associated content using the LLM to obtain a filtering result; The LLM is used to generate the filtering result based on the information source corresponding to the filtering result to obtain the data generation result.
6. The method according to claim 1, wherein: The performing entity recognition on the query statement to obtain a target entity in the query statement includes: Perform entity recognition on the query statement based on the LLM to obtain the target entity.
7. A data query device based on a large model, comprising: A recognition module, used to perform entity recognition on the query statement to obtain a target entity in the query statement; An analysis module, configured to obtain first associated content associated with the target entity in the internal information, and perform data analysis on the first associated content based on a large language model (LLM) to obtain a data analysis result; A generating module, configured to obtain second associated content associated with the target entity from external information, and generate data for the second associated content based on the LLM to obtain a data generation result; An acquisition module is used to acquire the query result corresponding to the query statement based on the data analysis result and the data generation result.
8. The device according to claim 7, wherein: The analysis module is further used for: Converting the target entity into an entity vector; Acquire target content matching the entity vector in the internal information; Based on a preset knowledge graph, obtain relevant content of the target content; The target content and the related content are used as the first associated content.
9. The device according to claim 7, wherein: The analysis module is further used for: Analyzing the first associated content using the LLM to obtain an analysis result; Using the LLM, calibrating the query statement based on the analysis result to obtain a calibration result; The analysis results and the calibration results are summarized using the LLM to obtain the data analysis results.
10. The device according to claim 7, wherein: The generating module is further used for: Based on the release time of the external information, obtaining the external information matching the query statement time; In the time-matched external information, second associated content associated with the target entity is obtained.
11. The device according to claim 7, wherein: The generating module is further used for: filtering the second associated content using the LLM to obtain a filtering result; The LLM is used to generate the filtering result based on the information source corresponding to the filtering result to obtain the data generation result.
12. The device according to claim 7, wherein: The identification module is further used for: Perform entity recognition on the query statement based on the LLM to obtain the target entity.
13. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.
15. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Data processing method and related equipment
CN116910202A
Method and system for optimizing knowledge graph based on large language model
CN117271791A
Semantic understanding method, electronic device, and storage medium
US20230089268A1
Speech interaction method and apparatus, device, and computer storage medium
WO2022105188A1