AI question answering system and AI question answering method and device based on large language model
By constructing a multi-layered retrieval structure, the problem of incomplete retrieval in existing AI question-answering systems is solved, resulting in more accurate answers.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2026-03-10
AI Technical Summary
Existing AI question-answering systems based on large language models cannot fully retrieve text content related to the question when answering questions, resulting in low accuracy of the answers.
We construct a bottom-up retrieval structure with different levels of aggregation. Through this multi-layered node retrieval structure, we ensure that complete text content related to the question can be quickly retrieved from the database and then input into a large language model to generate an answer.
This improves the accuracy of responses from large language models and ensures the completeness of retrieved text content, thereby enhancing the accuracy of responses.
Smart Images

Figure CN121636644A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence (AI), in particular to an AI question answering system, an AI question answering method and device based on a large language model. BACKGROUND
[0002] A large language model (LLM) is constructed by training on a large amount of text, which covers many different topics and fields. Therefore, the LLM usually has extensive knowledge, including general knowledge in many professional fields, but for complex knowledge-intensive tasks, the answer of the LLM may have an "illusion" problem and the accuracy is low.
[0003] In related technologies, to solve the above problem, a system based on LLM and retrieval augmented generation (RAG) is constructed. For example, the system cuts the documents of field A, and the cut text segments are stored in the database after being vectorized. When the system needs to answer the question of field A, it first retrieves the text segments related to the question from the database, and then understands, integrates and re-expresses the retrieved text segments through the LLM, and further generates a more accurate answer.
[0004] However, in the above method, the system can only retrieve the segmented text segments, which limits the overall understanding of the context of the entire document, resulting in incomplete content retrieved and affecting the accuracy of the answer. SUMMARY
[0005] The embodiments of the present application provide an AI question answering system, an AI question answering method and device based on a large language model, which can ensure that the AI question answering system retrieves complete content related to the question from the database when answering the question, and further improves the accuracy of the answer of the large language model.
[0006] In a first aspect, the present application provides an artificial intelligence (AI) question answering system, which is used for:
[0007] obtaining a question, the question being in a format of voice, text or video;
[0008] based on the question and a retrieval structure of a database, retrieving in the database to obtain a text set related to the question, the text set including a plurality of associated texts, the retrieval structure including a plurality of layers, each layer including at least one node, the node including indication information and a text, the indication information indicating whether the text in the node is associated with the text in other nodes;
[0009] Input the question and the text set into the large language model, and generate an answer to the question through the large language model.
[0010] In the above method, the AI question and answer system involves a retrieval structure including multiple layers of nodes, wherein each node includes indication information and text, and for any one node, the indication information of the node indicates whether the text in the node is associated with the text in other nodes, in other words, according to the indication information of any node, other text associated with the text in the node can be quickly located, based on this, when the AI question and answer system obtains a question, it can retrieve in the database based on the retrieval structure, and quickly retrieve all text associated with the question based on the indication information of the retrieved node, and the retrieved text is also associated. Therefore, after inputting the question and the retrieved text into the large language model, the accuracy of the answer of the large language model can be greatly improved.
[0011] In some embodiments, the multiple texts in the text set come from different documents, or the multiple texts in the text set come from different paragraphs in the same document, or the multiple texts in the text set come from different sentences in the same paragraph. It can be seen that the AI question and answer system can retrieve texts from different documents, different paragraphs or different sentences from the database according to the question, and these texts are not only associated with the question, but also associated with each other. Based on this, inputting the text set into the large language model can effectively assist the large language model to generate more accurate answers. In contrast, related technologies store the database in the granularity of segmented text segments, which causes the system to only retrieve segmented text segments, easily missing the content related to the question, and affecting the accuracy of the answer generated by the large language model.
[0012] In some embodiments, the retrieval structure includes a first node and multiple second nodes, the first node and the multiple second nodes belong to different layers, the indication information of the first node indicates that the text in the first node is associated with the text in the multiple second nodes, and the text in the first node is a summary of the text in the multiple second nodes. For example, the indication information of the first node includes the node identifier of each of the multiple second nodes. Wherein, the node identifier is also an index. Illustratively, if the text in node A is associated in content with the text in node B, node A can be referred to as an associated node of node B, or node B is referred to as an associated node of node A. For the above first node and second node, the text in the first node is a summary of the text in the multiple second nodes, that is, the text in the first node is associated in content with the text in the multiple second nodes.
[0013] In some embodiments, the system is used for:
[0014] determine an initial text set from the database based on similarity between each node in the top layer of the problem and the retrieval structure;
[0015] retrieve, from the database, texts associated with each text in the initial text set based on the indication information of the node corresponding to each text in the initial text set, and add the retrieved texts to the initial text set to obtain a text set related to the problem.
[0016] Through the above method, the retrieval structure provided by the application is a structure including multiple layers of nodes. In the retrieval structure, the texts in the nodes of any layer except the bottom layer are summaries of the texts in the nodes of the next layer. Therefore, the AI question and answer system can start retrieval from the top layer of the retrieval structure and quickly obtain a text set related to the problem.
[0017] In some embodiments, the system is configured to:
[0018] determine similarity between the problem and each node in the top layer based on the texts in the nodes in the top layer;
[0019] determine the initial text set based on the nodes ranked in the top N positions in terms of similarity in the top layer, where N is a positive integer.
[0020] In some embodiments, the system is configured to:
[0021] determine multiple candidate nodes based on the indication information of the node corresponding to each text in the initial text set, where the texts in the multiple candidate nodes are associated with the texts in the initial text set;
[0022] add the texts in the candidate nodes ranked in the top M positions in terms of similarity between the problem and each candidate node to the initial text set, where M is a positive integer.
[0023] Through the above method, it is ensured that the AI question and answer system can quickly retrieve all texts related to the problem from the database without omission or repetition.
[0024] In some embodiments, the system is further configured to:
[0025] segment a document to be stored in the database into multiple first texts;
[0026] generate a node corresponding to each first text based on the multiple first texts;
[0027] perform a loop clustering based on the nodes corresponding to the multiple first texts to construct the retrieval structure.
[0028] In some embodiments, the loop clustering based on the nodes corresponding to the multiple first texts to construct the retrieval structure includes:
[0029] In the i-th clustering process, nodes corresponding to the plurality of first texts are clustered to obtain a plurality of first clusters, and each first text in each first cluster is summarized to obtain a second text corresponding to each first cluster, and a node corresponding to each second text is generated, i being a positive integer;
[0030] In the i+1-th clustering process, nodes corresponding to the plurality of second texts are clustered, and if at least one second cluster is obtained, each second text in each second cluster is summarized to obtain a third text corresponding to each second cluster, and a node corresponding to each third text is generated, and the i+2-th clustering is performed; if no clustering result is obtained, the clustering is stopped.
[0031] Through the above method, the AI question and answer system recursively embeds, clusters and summarizes the text to construct a retrieval structure with different levels of summary from bottom to top, which provides technical support for subsequent online question and answer process.
[0032] In a second aspect, the present application provides an AI question and answer method based on a large language model, which comprises:
[0033] Obtaining a question, the question being in a voice, text or video format;
[0034] Based on the question and the retrieval structure of the database, searching in the database to obtain a text set related to the question, the text set comprising a plurality of associated texts, the retrieval structure comprising a plurality of layers, each layer comprising at least one node, the node comprising indication information and a text, the indication information indicating whether the text in the node is associated with the text in other nodes;
[0035] Inputting the question and the text set into a large language model, and generating an answer to the question through the large language model.
[0036] In some embodiments, the plurality of texts in the text set come from different documents; or the plurality of texts in the text set come from different paragraphs in the same document; or the plurality of texts in the text set come from different sentences in the same paragraph.
[0037] In some embodiments, the retrieval structure comprises a first node and a plurality of second nodes, the first node and the plurality of second nodes belong to different layers, the indication information of the first node indicates that the text in the first node is associated with the texts in the plurality of second nodes, and the text in the first node is a summary of the texts in the plurality of second nodes.
[0038] In some embodiments, the searching in the database based on the question and the retrieval structure of the database to obtain a text set related to the question comprises:
[0039] Based on the similarity between the question and each node in the top layer of the retrieval structure, an initial text set is determined from the database;
[0040] Based on the indication information of the nodes corresponding to each text in the initial text set, texts associated with each text in the initial text set are retrieved from the database, and the retrieved texts are added to the initial text set to obtain a text set related to the question.
[0041] In some embodiments, determining an initial text set from the database based on the similarity between the question and the nodes in the top layer of the retrieval structure includes:
[0042] Based on the text in each node of the top layer, determine the similarity between the question and each node of the top layer;
[0043] The initial text set is determined based on the N nodes with the highest similarity in the top layer, where N is a positive integer.
[0044] In some embodiments, retrieving text associated with each text in the initial text set from the database based on the indication information of the nodes corresponding to each text in the initial text set, and adding the retrieved text to the initial text set, includes:
[0045] Based on the indication information of the nodes corresponding to each text in the initial text set, multiple candidate nodes are determined, and the text in the multiple candidate nodes is associated with the text in the initial text set;
[0046] Based on the similarity between the question and each candidate node, the text of the candidate node with the highest similarity is added to the initial text set, where M is a positive integer.
[0047] Thirdly, this application provides an AI question-answering device based on a large language model. The device includes at least one functional module, which is used to implement the AI question-answering method based on a large language model as provided in the second aspect or any possible implementation of the second aspect.
[0048] Fourthly, this application provides a computing device including a processor and a memory, wherein the processor is configured to execute at least one piece of program code stored in the memory to enable the computing device to perform the functions of the AI question-answering system provided by the first aspect or any possible implementation thereof.
[0049] Fifthly, this application provides a computer program product that, when run on a computing device, enables the computing device to perform the functions of the AI question-answering system provided in the first aspect or any possible implementation thereof. The computer program product can be a software installation package; when the functions of the aforementioned AI question-answering system are required, the computer program product can be downloaded and executed on the computing device.
[0050] Sixthly, this application provides a computer-readable storage medium for storing at least one piece of program code, which implements the functions of the AI question-answering system provided by the first aspect or any possible implementation thereof. This storage medium includes, but is not limited to, volatile memory, such as random access memory, and non-volatile memory, such as flash memory, hard disk drive (HDD), and solid-state drive (SSD). Attached Figure Description
[0051] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application;
[0052] Figure 2 This is a schematic diagram of the architecture of an AI question-answering system provided in an embodiment of this application;
[0053] Figure 3 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application;
[0054] Figure 4 This is a functional architecture diagram of an AI question-answering system provided in an embodiment of this application;
[0055] Figure 5 This is a flowchart illustrating a processing method for an AI question-answering system provided in an embodiment of this application;
[0056] Figure 6 This is a flowchart illustrating an offline construction of a retrieval structure provided in an embodiment of this application;
[0057] Figure 7 This is a flowchart of an online question-and-answer process provided in an embodiment of this application;
[0058] Figure 8 This is a schematic diagram of the structure of an AI question-answering device based on a large language model provided in an embodiment of this application. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings. It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application are authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the issues and documents involved in this application were obtained under fully authorized circumstances.
[0060] To facilitate understanding, the key terms and concepts involved in this application will be explained below.
[0061] Artificial intelligence (AI) models are a class of mathematical algorithm models that use machine learning concepts to solve practical problems. Typically, AI models include a large number of parameters and calculation formulas (or calculation rules).
[0062] An acceleration card, also known as an acceleration device, accelerator, or acceleration chip, is a type of specialized hardware device or computer system designed to accelerate computation in AI scenarios. In the embodiments of this application, acceleration devices may include, for example, graphics processing units (GPUs), neural network processing units (XPUs), intelligent processing units (IPUs), tensor processing units (TPUs), domain-specific architecture (DSA) chips, and so on, but are not limited to these.
[0063] Large language models (LLMs) are AI language processing models trained on massive amounts of text data. LLMs are typically trained on vast amounts of text data from diverse sources, including internet web pages, books, news articles, academic papers, and social media posts. In some embodiments, LLMs are used to build AI question-answering systems that can understand user questions and generate accurate answers. By learning from vast amounts of knowledge, LLMs can answer questions across various domains, including history, science, technology, and culture. For example, in the field of intelligent customer service, AI question-answering systems can be used to automatically answer user inquiries, improving the efficiency and quality of customer service.
[0064] Retrieval augmented generation (RAG) is a method that combines retrieval techniques with generative models to improve the accuracy, relevance, and reliability of generated text. For example, in an AI question-answering system, when answering a question about a historical event, the system retrieves relevant historical records, biographies, and other text fragments from historical document databases, and then combines these text fragments with an LLM (Limited Language Model) to generate the final answer.
[0065] An embedding model is a technique and model that maps discrete symbols (such as words and characters) to a continuous vector space. It is commonly used in natural language processing (such as text classification, machine translation, and sentiment analysis) and information retrieval and recommendation systems.
[0066] The application scenarios and implementation environment of this application are described below.
[0067] This application is applied to AI question answering scenarios based on LLM and RAG. The application does not limit the type of LLM. For example, the LLM can be open source Code Llama, Llama, Llama2, StarCoder, ChatGLM2, CodeGeeX2, Qwen, etc.
[0068] In related technologies, AI question-answering systems built on LLM and RAG typically involve two stages: an offline construction stage and an online question-answering stage. The offline construction stage refers to the system building a database offline based on documents from various domains. For example, the system segments documents in different domains, vectorizes the resulting text fragments, and stores them in the database. The online question-answering stage involves the system retrieving relevant text fragments from the database when it needs to answer a user's question. Then, it integrates the question and the retrieved text fragments using a prompt template to generate LLM prompts. These prompts are then input into the LLM to generate a more accurate answer. However, in this method, the system can only retrieve segmented text fragments, limiting its overall understanding of the document context and resulting in incomplete retrieved content, thus affecting the accuracy of the answer. For example, for the question "How to install YY under the XX system environment", the complete content that the system needs to retrieve includes "1. Prepare the installation package YY; 2. Prepare the installation user; 3. Install dependencies; 4. Install and configure YY; 5. Verify the installation; and the text content corresponding to each step". However, because the relevant technologies store documents in the database at the granularity of segmented text fragments, when the system searches the database based on the question, it may consider that the content related to step 2 is not very similar to the question, and therefore miss this part of the content, resulting in incomplete retrieved content and affecting the accuracy of the LLM answer.
[0069] Based on this, this application provides an AI question-answering system that improves the indexing of the database in the AI question-answering system. By constructing a retrieval structure with different levels of aggregation from bottom to top, the AI question-answering system can retrieve complete content from the database for the user's input question, thereby improving the accuracy of LLM answers.
[0070] Please refer to the following first. Figures 1 to 3 The implementation environment of this application will be described. Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application. For example... Figure 1 As shown, the implementation environment includes an AI question-answering system 100, which includes a host 101 and an accelerator card 102, and the host 101 and the accelerator card 102 are connected in communication. In some embodiments, the accelerator card 102 is also referred to as an acceleration device, accelerator, etc., but this application is not limited thereto.
[0071] Host 101 refers to a device used to run computing applications. It is capable of accessing a wired or wireless network and can control accelerator card 102 to execute various tasks initiated by the computing application. Additionally, host 101 can access a database and retrieve relevant content from it. Illustrationly, this computing application is an AI question-and-answer application. Host 101 can retrieve content related to the user's input question from the database and control accelerator card 102 to run a Large Language Model (LLM), generating an answer to the question based on the question and the retrieved content. Furthermore, the number of hosts 101 can be one or more; this application does not limit this.
[0072] Accelerator card 102 is used to receive control from host 101 and run large language models to achieve AI question answering. For example, accelerator card 102 can be a GPU, XPU, IPU, TPU, DSA chip, etc., and this application is not limited to these. Furthermore, Figure 1 The number of accelerator cards 102 shown is for illustrative purposes only. The number of accelerator cards 102 may be more or less, and this application is not limited thereto.
[0073] In this AI question-answering system 100, each accelerator card 102 can communicate with each other via a high-speed interconnect link (or chip bus), enabling different accelerator cards 102 to quickly access each other's memory and achieve efficient data transfer between them. For example, the high-speed interconnect link can be NVIDIA Link, compute express link (CXL), universal chiplet interconnect express (UCIe), Huawei cache coherent system (HCCS), cache coherent interconnect for accelerators (CCIX), etc., and this application is not limited to these.
[0074] Schematic illustration: The AI question-answering system 100 is deployed on a server, meaning that the host 101 and the accelerator card 102 are integrated into one server. The host 101 and the accelerator card 102 communicate via a peripheral component interconnect express (PCIe) link, and interact with each other via the PCIe link. For example, the server can be a standalone physical server, a server cluster consisting of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Taking a cloud server as an example, a cloud server is also called a cloud platform (short for cloud computing platform), referring to a service based on hardware and software resources that provides computing, network, and storage capabilities. Through the network "cloud," massive amounts of data are processed and analyzed remotely before being returned to the user, featuring large scale, distributed architecture, virtualization, high availability, scalability, on-demand service, and security. Cloud platforms can enable the rapid provisioning and release of configurable computing resources with minimal management costs or low interaction complexity between users and service providers.
[0075] In some embodiments, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically a Transmission Control Protocol / Internet Protocol (TCP / IP) network or an RDMA network, such as an RDMA over Converged Ethernet (RoCE) network or an InfiniBand (IB) network, and is not limited thereto. In other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0076] Next, refer to Figure 2 The software deployment framework of the aforementioned AI question-answering system will be introduced. Figure 2 This is a schematic diagram of the architecture of an AI question-answering system provided in an embodiment of this application. Figure 2As shown, taking an AI question-answering system deployed on a server as an example, users can install firmware and drivers on the server. Firmware is typically a program written to read-only memory, which can directly control and interact with the hardware, and check for any hardware errors. Drivers are small pieces of code added to the operating system, containing information about the hardware. When a computer program requests to interact with a piece of hardware, the driver acts as a translator of instructions between the hardware and the program using it. Furthermore, when the server's hardware architecture employs a heterogeneous computing architecture (including computing architectures using computing units with different types of instruction sets), users can also install heterogeneous computing frameworks on the server. For example, the Compute Architecture for NeuroNet (CANN) framework for neural networks. CANN can support users in quickly building AI applications by providing multi-layered programming interfaces. Additionally, users can install deep learning frameworks on the server to construct large-scale computational graphs by compiling methods for implementing models, and to automatically perform gradient calculations within the computational graph. The computational graph is also called the graph compilation result. In the embodiments of this application, the processing methods based on the AI question-answering system can be installed as a software toolkit component on a server and run by the host on the server. For example, the AI question-answering method can be represented as an AI question-answering device. Additionally, users can also install scheduling components on the server, etc., which is not limited in this application. It should be noted that... Figure 2 The software deployment framework shown is for illustrative purposes only. In practical applications, at least one of the above-mentioned items can be selectively installed according to requirements, and this application does not limit this.
[0077] The hardware structure of the host 101 in the AI question-answering system 100 described above is described below. This application provides a computing device that can be configured as the host 101 described above, see reference... Figure 3 , Figure 3 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Figure 3 As shown, the computing device 300 includes a memory 301, a processor 302, a communication interface 303, and a bus 304. The memory 301, processor 302, and communication interface 303 are interconnected via the bus 304.
[0078] Memory 301 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Illustratively, memory 301 is used to store at least one piece of program code. When the program code stored in memory 301 is executed by processor 302, processor 302 performs the following method.
[0079] The processor 302 may be a network processor (NP), a central processing unit (CPU), a graphics processing unit (GPU), an application-specific integrated circuit (ASIC), or an integrated circuit used to control the execution of the program of the present application. The processor 302 may be a single-core processor or a multi-core processor. The number of processors 302 may be one or more.
[0080] The communication interface 303 uses a transceiver module, such as a transceiver, to enable communication between the computing device 300 and other devices or communication networks. For example, data can be acquired through the communication interface 303.
[0081] The memory 301 and the processor 302 can be set separately or integrated together.
[0082] Bus 304 may include a pathway for transmitting information between various components of computing device 300 (e.g., memory 301, processor 302, communication interface 303).
[0083] Based on the above introduction to the application scenarios and implementation environment of this application, the following section introduces the method for implementing AI question answering based on the AI question answering system provided by this application.
[0084] For ease of understanding, please refer to the following: Figure 4 Taking the aforementioned AI question-answering system as an example, the principle of this application will be introduced. Figure 4 This is a functional architecture diagram of an AI question-answering system provided in an embodiment of this application. Figure 4 As shown, the AI question-answering system is used to provide offline construction function 401 and online question-answering function 402.
[0085] The offline construction function 401 is used to segment the document and construct a document-related retrieval structure to store the document in a database for subsequent participation in online question answering. For example, the offline construction function 401 includes document parsing 4011, document segmentation 4012, vectorization 4013, and constructing the retrieval structure 4014, etc. This process will be described in detail in subsequent method embodiments and will not be repeated here. In some embodiments, the offline construction function 401 is implemented by the host in the AI question answering system, or by the host and the accelerator card working together. For example, after the host parses and segments the document, it controls the accelerator card to convert the segmented text into vector representations and uses the accelerator card's computing power to construct the retrieval structure.
[0086] The online question-answering function 402 is used to output an answer to a question based on user input. The question can be in voice, text, or video format, and this application does not limit this. For example, the online question-answering function 402 includes question preprocessing 4021, vectorization 4022, database retrieval 4023, fine-tuning 4024, generating prompt words 4025, and generating an answer using a large language model 4026, etc. This process will be described in detail in subsequent method embodiments and will not be repeated here. Illustratively, the online question-answering function 402 is implemented collaboratively by a host and an accelerator card. For example, after the host performs question preprocessing based on user input, it controls the accelerator card to convert the preprocessed question into a vector representation, retrieves it from the database, fine-tunes the retrieved content, generates prompt words based on the fine-tuned content, runs a large language model, and outputs the answer to the question.
[0087] Furthermore, the functional division of AI question-answering systems is not limited to... Figure 4The content shown can be further customized with additional functions based on user needs in practical applications. For example, the AI question-answering system can also provide storage functions (e.g., 403) to provide storage space for databases and large language models, but this application is not limited to this. Furthermore, the various functions provided by the AI question-answering system can be allocated to the host and / or accelerator card as needed. That is, the host can independently implement all or some of the above functions, or the host and accelerator card can collaboratively implement all or some of the above functions; this application does not limit this.
[0088] The following is for reference. Figure 5 The illustrated method embodiment introduces a method for implementing AI question answering in an AI question answering system.
[0089] Figure 5 This is a flowchart illustrating a processing method for an AI question-answering system provided in an embodiment of this application. Figure 5 As shown, this method is applied to an AI question-answering system. Schematic, the method includes the following steps 501 to 507.
[0090] 501. The AI question-answering system retrieves documents to be stored in the database.
[0091] In this embodiment, the AI question-answering system runs an AI question-answering application that provides RAG functionality, i.e., combining retrieval technology with a large language model to improve the accuracy, relevance, and reliability of the generated text. For example, when answering a question about a historical event, the AI question-answering system retrieves relevant historical records, biographies, and other text fragments from a historical document database, and then combines these text fragments with an LLM (Large Language Model) to generate the final answer. Illustratively, the AI question-answering system can access databases and retrieve relevant content from them. This application does not limit the fields involved in the AI question-answering system; for example, it could be history, literature, music, medicine, communication technology, etc. It should be noted that the aforementioned databases can be one or more. For example, a database can be a comprehensive database storing documents related to multiple fields, or it can be multiple databases from different fields, i.e., one database per field. Furthermore, the field division in this application is merely illustrative and does not constitute a limitation on this application. For example, different fields can be divided according to broad subject categories, or a subject can be further subdivided into multiple fields; this application does not limit this.
[0092] In this step, the documents obtained by the AI question-answering system can be user-uploaded documents or publicly available documents that have been authorized. This application does not limit the source of the documents. Furthermore, this application does not limit the field or number of documents. Illustratively, after obtaining the documents, the AI question-answering system performs document parsing, converting the documents into a format that facilitates further processing by the AI question-answering system. It should be understood that due to the diverse document formats (such as .txt, .csv, .doc, .docx, .xls, .xlsx, .ppt, .pptx, PDF files, web page files, etc.), each format has its unique structure and storage method, and the sources of documents are also diverse. Regardless of the format and data source, documents may contain noise, impurities, and format inconsistencies. Therefore, text cleaning and standardization are necessary. Text cleaning includes, for example, removing special characters, stop words, and redundant spaces; standardization includes, for example, converting the text to uniform capitalization, stemming, and part-of-speech tagging. In this way, documents are converted into a unified format, which facilitates further processing by the AI question-answering system and provides technical support for building the subsequent retrieval structure.
[0093] 502. The AI question-answering system divides the document into multiple first texts.
[0094] In this application embodiment, the AI question-answering system uses sentence segmentation or fixed-length segmentation to divide the acquired document into multiple first texts. This application does not limit the number of first texts. Sentence segmentation refers to dividing the document into segments based on sentences. It should be understood that a sentence is typically the smallest linguistic unit expressing a complete meaning, containing basic grammatical structures such as subject and predicate. By recognizing common segmentation characters such as periods, exclamation marks, question marks, and line breaks, the document can be accurately segmented into individual sentences. This segmentation method can better preserve the complete semantics of sentences; each sentence relatively independently expresses a specific meaning. Therefore, in subsequent retrieval and analysis, matching can be performed more accurately based on the semantics of the sentences. Fixed-length segmentation refers to dividing the document into fixed-length text segments according to the token length limit of the embedding model. For example, the document can be segmented into segments of 256 tokens or 512 tokens. In some embodiments, a certain amount of redundancy is added to the beginning and end of the segmented text segments. For example, within a few tokens before and after the segmentation point, some key information can be repeated or context-related tags can be added to help the model better understand the relationships between segments in subsequent processing. It should be noted that AI question-answering systems can also use other methods to segment documents into multiple first texts; this application does not limit this approach.
[0095] Furthermore, the above steps 501 and 502 are described using the example of the AI question-answering system obtaining a document and dividing the document into multiple first texts. In some embodiments, users may also upload multiple first texts, but this application is not limited to this.
[0096] 503. The AI question-answering system generates a node corresponding to each first text based on multiple first texts.
[0097] In this embodiment, the AI question-answering system performs vectorization on multiple first texts, converting them into vector representations. For example, the host control accelerator card of the AI question-answering system performs vectorization on the multiple first texts. It should be understood that the accelerator card is typically equipped with efficient vector computing units and optimized algorithms, capable of completing large-scale vector computing tasks in a very short time. Illustratively, after converting the multiple first texts into vector representations, for any one first text, the AI question-answering system generates a node corresponding to that first text. In this application, a node corresponding to a text refers to a node containing both an index and text; or, in other words, it constructs an index of multiple first texts in the database in a tree-like manner, with each first text corresponding to a node in the tree.
[0098] In some embodiments, for any first text, the node corresponding to the first text includes indication information and text. The indication information indicates whether the text in the node is related to the text in other nodes. In some embodiments, the node corresponding to the first text also includes the node identifier of the node. Correspondingly, the indication information is, for example, the node identifier of other nodes. The node identifier is also a kind of index used to locate the node. Schematic, if the text in node A is related to the text in node B in terms of content, then node A is called the associated node of node B, or node B is called the associated node of node A. This part will be described in detail in step 504 below, and will not be repeated here. In addition, the text in the node includes the text and the vector representation of the text. For example, taking the first text as "XXX", when the first text is not related to the text in other nodes, or in other words, when the node corresponding to the first node does not have an associated node, the node includes a node identifier (index: #8), indication information (empty), first text (XXX), and the vector representation of the first text (embedding YYY). If the text is related to the text in other nodes, or if the node corresponding to the first node has related nodes, the node includes the node identifier (index: #8), indication information (the node identifiers of other nodes such as node 2 and node 3), the first text (XXX / a summary of the text in node 2 and node 3), and the vector representation of the first text (embedding ZZZ).
[0099] 504. The AI question-answering system performs cyclic clustering based on the nodes corresponding to multiple first texts to construct the retrieval structure of the database.
[0100] In this embodiment, after obtaining the nodes corresponding to multiple first texts, the AI question-answering system uses a text clustering algorithm to perform cyclic clustering on these nodes to construct the retrieval structure of the database until certain conditions are met, at which point clustering stops and the documents are stored in the database. Indicatively, the text clustering algorithm may be, for example, the K-Means algorithm or the DBSCAN algorithm; this application does not limit the specific algorithm used.
[0101] The following describes the process of cyclic clustering performed by the AI question-answering system. For example, i=1, where i is a positive integer.
[0102] In the i-th clustering process, nodes corresponding to multiple first texts are clustered to obtain multiple first clusters. The first texts in each first cluster are summarized to obtain the second texts corresponding to each first cluster, and nodes corresponding to each second text are generated. For example, if the nodes corresponding to multiple first texts include 8 nodes, these 8 nodes (e.g., nodes 1-8) are clustered to obtain 3 first clusters. Taking first cluster A, which includes nodes 1-3, as an example, the first texts in these three nodes are summarized to obtain the second texts corresponding to first cluster A, and then nodes corresponding to the second texts are generated. For example, the nodes corresponding to the second texts include node identifiers (index: #9), indication information (node identifiers of nodes 1-3), second text (a summary of the first texts in nodes 1-3), and the vector representation of the second texts (embedding WWW). In some embodiments, since the second texts are summaries of multiple first texts, the nodes corresponding to the second nodes can be understood as the parent nodes of the nodes corresponding to the first texts, that is, the nodes corresponding to the first texts can be understood as child nodes of the nodes corresponding to the second texts. In addition, since the nodes corresponding to the multiple first texts are the nodes initially generated by the AI question-answering system, and the nodes corresponding to the second texts are generated based on the nodes corresponding to the multiple first texts, the nodes corresponding to the multiple first texts can be understood as being located at the bottom layer of the retrieval structure, while the nodes corresponding to the second texts are located at the layer above the bottom layer. For example, the nodes corresponding to the multiple first texts are located at the p-th layer, where p is a positive integer, and the nodes corresponding to the multiple second texts are located at the p-1-th layer.
[0103] Next, in the (i+1)th clustering process, cluster the nodes corresponding to multiple second texts. If at least one second cluster is obtained, the second texts in each second cluster are summarized to obtain the third text corresponding to each second cluster, and nodes corresponding to each third text are generated. The (i+2)th clustering process is then performed. If no clustering result is obtained, clustering stops. For example, after the i-th clustering process, three nodes 9-11 corresponding to the second texts are obtained. If clustering these three nodes yields a clustering result, then new nodes are generated following the same process as in the (i+1)th clustering process. If no clustering result is obtained, meaning these three nodes cannot be clustered into a new cluster, then clustering stops.
[0104] Based on the aforementioned cyclic clustering process, it can be seen that for nodes corresponding to multiple first texts, the AI question-answering system constructs a bottom-up retrieval structure with different levels of summarization by recursively embedding, clustering, and summarizing the text, providing technical support for the subsequent online question-answering process. Illustratively, this retrieval structure includes multiple layers, each layer including at least one node. For any given node, the node includes indicative information and text. The indicative information indicates whether the text in the node is related to the text in other nodes. In some embodiments, the retrieval structure includes a first node and multiple second nodes, which belong to different layers. The indicative information of the first node indicates that the text in the first node is related to the text in the multiple second nodes. The text in the first node is a summary of the text in the multiple second nodes; that is, the text in the first node is related to the text in the multiple second nodes in terms of content. For example, the indicative information of the first node includes the node identifier of each of the multiple second nodes. That is, the multiple second nodes are child nodes of the first node.
[0105] It should be noted that the above summaries of different texts can be achieved by calling a large language model, or by users summarizing and uploading them to an AI question-answering system. This application does not limit this.
[0106] Following steps 501 to 504 above, the AI question-answering system constructs a relevant retrieval structure based on the documents to be stored in the database, thus storing the documents in the database. This process is also known as the offline construction process. (Illustratively, refer to...) Figure 6 , Figure 6 This is a flowchart illustrating an offline construction of a retrieval structure provided in an embodiment of this application. For example... Figure 6As shown, after obtaining a document, the AI question-answering system parses and segments the document. Based on the segmented text, it generates nodes corresponding to each text (or leaf nodes that construct the retrieval structure). Then, it performs iterative clustering until no new clustering results can be obtained. In this process, nodes corresponding to multiple texts are clustered to obtain multiple clusters. The text in each cluster is summarized, and new nodes are generated based on the summarized text to form a new layer of the retrieval structure. This process is repeated until no new clustering results can be obtained after the current node is clustered, at which point clustering stops, and the retrieval structure is obtained.
[0107] The online question-answering process of the AI question-answering system is described below through steps 505 to 507. This process is also a kind of AI question-answering method based on a large language model.
[0108] 505. The AI question-answering system retrieves questions, which can be in voice, text, or video format.
[0109] In this embodiment of the application, after obtaining the question, the AI question answering system vectorizes the question, converting it into a vector representation so that it can participate in the subsequent retrieval process.
[0110] 506. The AI question-answering system uses a retrieval structure based on questions and databases to search the database and obtain a collection of texts related to the questions.
[0111] In this embodiment, the text set includes multiple related texts. Based on step 504, the retrieval structure provided by this application is a multi-layered node structure. In this retrieval structure, except for the bottom layer, the text in any layer's node is a summary of the text in the next layer's node. Therefore, in this step, the AI question-answering system starts searching from the top layer of the retrieval structure until it obtains a text set related to the question. In some embodiments, the multiple texts in this text set come from different documents; or, the multiple texts in the text set come from different paragraphs in the same document; or, the multiple texts in the text set come from different sentences in the same paragraph. It is evident that the AI question-answering system can retrieve texts from different documents, different paragraphs, or different sentences from the database based on the question. Furthermore, these texts are not only related to the question, but also related to each other. Based on this, after inputting the text set into a large language model, it can effectively assist the large language model in generating more accurate answers.
[0112] Indicatively, this step includes the following steps:
[0113] Step 1: Based on the similarity between the nodes in the top layer of the question and retrieval structure, determine the initial text set from the database.
[0114] The AI question-answering system determines the similarity between the question and each node in the top-level structure based on the text within each node. It then determines the initial text set based on the top N nodes with the highest similarity (N is a positive integer). Illustratively, for any node in the top-level structure, the AI question-answering system calculates the similarity between the question's vector and the vector of the text within that node, using this calculated similarity as the similarity between the question and the node. After obtaining the similarity between the question and each node in the top-level structure, the similarity scores are sorted in descending order, and the top N nodes with the highest similarity scores are selected as the initial text set. For example, if the top-level structure of the retrieval structure includes 10 nodes, the similarity between the question and each node is calculated, the similarity scores are sorted, and the top 5 nodes are selected as the initial text set.
[0115] Step 2: Based on the indication information of the nodes corresponding to each text in the initial text set, retrieve the texts associated with each text in the initial text set from the database, add the retrieved texts to the initial text set, and obtain the text set related to the question.
[0116] This step includes the following sub-steps:
[0117] Sub-step 1: Based on the indication information of the nodes corresponding to each text in the initial text set, determine multiple candidate nodes, and associate the text in the multiple candidate nodes with the text in the initial text set.
[0118] Specifically, for any text in the initial text set, the AI question-answering system determines whether the text in that node is related to other nodes based on the indication information of the node corresponding to that text. If so, the other nodes indicated by the indication information are identified as candidate nodes. For example, if the initial text set includes text A, and the indication information of the node corresponding to text A includes the node identifiers of node 2 and node 3, then node 2 and node 3 are identified as candidate nodes.
[0119] Sub-step 2: Based on the similarity between the question and each candidate node, add the text of the candidate node with the highest similarity to the first M nodes to the initial text set, where M is a positive integer.
[0120] For any candidate node, the AI question-answering system calculates the similarity between the vectors of the question and the text vectors in that candidate node, and uses this calculated similarity as the similarity between the question and the candidate node. After obtaining the similarity between the question and each candidate node, the similarity scores are sorted in descending order, and the nodes with the highest similarity scores (ranked in the top M) are selected. The text from these nodes is then added to the initial text set.
[0121] It should be understood that the AI question-answering system repeatedly executes sub-steps 1 and 2 until each text in the current text set has no associated text, or in other words, the nodes corresponding to each text have no associated nodes, thus obtaining a text set related to the question. This method ensures that the AI question-answering system can quickly retrieve all text related to the question from the database without duplication or omission.
[0122] In some embodiments, steps one and two above can also be replaced by steps A and B as follows: Step A: Determine a first text set from the database based on the similarity between the question and each node in the top layer of the retrieval structure; Step B: Determine multiple first candidate nodes based on the indication information of the nodes corresponding to each text in the first text set, and determine a second text set based on the similarity between the question and each first candidate node, for example, taking the texts in the first candidate nodes ranked in the top H in similarity as the second text set, where H is a positive integer. Then, perform the same steps as step B on the second text set to obtain a third text set, and so on, until each text in the obtained new text set has no associated nodes, thus forming a text set related to the question.
[0123] In some embodiments, the AI question-answering system can also perform fine sorting of the text in the text set. For example, it can use a deep learning model or a graph-based sorting algorithm to comprehensively consider multiple factors, such as the quality of the document, its authority, and the degree of semantic matching with the question, to sort the text in the text set more accurately. Based on the sorting results, the text in the top L positions (L is a positive integer) is selected as the final text set to be input into the large language model. This application does not limit this.
[0124] 507. The AI question-answering system inputs the question and text set into a large language model, and then generates the answer to the question through the large language model.
[0125] In this embodiment, the AI question-answering system populates the prompt word template of a large language model with the question and text set to obtain prompt words. These prompt words are then input into the large language model, which generates the answer to the question. For example, the accelerator card in the AI question-answering system generates prompt words based on the text set, the question, and the prompt word template provided by the host. These prompt words are then input into the large language model, triggering it to generate the answer. In some embodiments, the accelerator card can also perform preliminary processing and optimization on the output of the large language model, such as removing duplicate content and adjusting the language style, to improve the quality and readability of the answer. Finally, the final answer is returned to the host for final integration and presentation to the user.
[0126] Following steps 505 to 507, the AI question-answering system, based on the retrieval structure constructed through steps 501 to 504, quickly retrieves a set of texts related to the question from the database and generates an answer using a large language model. This process is the online question-answering process. (Illustratively, refer to...) Figure 7 , Figure 7 This is a flowchart illustrating an online question-and-answer process provided in an embodiment of this application. For example... Figure 7 As shown, after acquiring a question, the AI question-answering system vectorizes it. Then, starting from the top layer of the retrieval structure, it determines the similarity between the question and each node in the top layer. Based on the Top N nodes with the highest similarity, a text set S1 is formed. Further, it checks whether there are related nodes for each text in text set S1. If so, it determines the similarity between the question and the related nodes. Based on the Top M nodes with the highest similarity, a text set S2 is formed. This process is repeated until the nodes in the latest text set Si have no related nodes. All text sets S1, S2, ..., Si are then returned as the retrieval results, i.e., the text set related to the question. The text set and the question are then input into a large language model, which generates the answer to the question.
[0127] Furthermore, in steps 501 to 507 above, the example is that the AI question-answering system first performs an offline construction process and then performs an online question-answering process. In some embodiments, the offline construction process can also be run online. That is, the AI question-answering system can update the database retrieval structure in real time to improve the accuracy of online question-answering. This application does not limit this.
[0128] In summary, the flowchart of the AI question-answering system processing method provided in this application involves a retrieval structure with multiple layers of nodes. In this retrieval structure, each node includes indicator information and text. For any given node, the indicator information indicates whether the text in that node is related to the text in other nodes. In other words, based on the indicator information of any node, other texts related to the text in that node can be quickly located. Based on this, when the AI question-answering system receives a question, it can perform a search in the database based on the retrieval structure and combine the indicator information of the retrieved nodes to quickly retrieve all texts related to the question. Furthermore, the retrieved texts are also related to each other. Therefore, inputting the question and the retrieved text into a large language model can significantly improve the accuracy of the large language model's answer.
[0129] For example, for the question "How to install YY under the XX system environment", the complete content that the system needs to retrieve includes "1. Prepare the installation package YY; 2. Prepare the installation user; 3. Install dependencies; 4. Install and configure YY; 5. Verify the installation; and the text content corresponding to each step". Since this application stores the documents in the database in the form of a retrieval structure, when the system searches the database according to the question, it will first retrieve at least one summary text, such as "Under the XX system environment, after preparing the installation package YY and installing the user, install the dependencies and configure YY, and finally verify the installation". Then, based on the indication information of the node corresponding to the summary text, it determines that the current text is related to the text in other nodes. Based on this, according to the other nodes indicated by the indication information, it quickly retrieves other texts related to the summary text until the currently retrieved text is no longer related to the text in other nodes. Therefore, this retrieval method will not miss the content related to the question, thus being able to retrieve complete content and improve the accuracy of the large language model's answer. In contrast, related technologies store documents in the database at the level of segmented text fragments. When the system searches the database based on the question, it may consider that the content related to step 2 is not very similar to the question, thus missing this part of the content. This results in incomplete retrieved content and affects the accuracy of the LLM answer.
[0130] Based on the above Figure 5 The method embodiment shown in this application also provides an AI question-answering device based on a large language model. Indicatively, refer to... Figure 8 , Figure 8 This is a schematic diagram of the structure of an AI question-answering device based on a large language model, provided in an embodiment of this application. Figure 8 As shown, the device includes an acquisition module 801, a retrieval module 802, and a generation module 803.
[0131] The acquisition module 801 is used to acquire questions, which can be in audio, text, or video format.
[0132] The retrieval module 802 is used to perform a retrieval in the database based on the retrieval structure of the question and the database to obtain a set of texts related to the question. The set of texts includes multiple related texts. The retrieval structure includes multiple layers, each layer including at least one node. The node includes indicator information and text. The indicator information indicates whether the text in the node is related to the text in other nodes.
[0133] The generation module 803 is used to input the question and text set into the large language model, and generate the answer to the question through the large language model.
[0134] In some embodiments, multiple texts in a text collection come from different documents; or, multiple texts in a text collection come from different paragraphs in the same document; or, multiple texts in a text collection come from different sentences in the same paragraph.
[0135] In some embodiments, the retrieval structure includes a first node and a plurality of second nodes, the first node and the plurality of second nodes belonging to different layers, the indication information of the first node indicating that the text in the first node is associated with the text in the plurality of second nodes, and the text in the first node is a summary of the text in the plurality of second nodes.
[0136] In some embodiments, the indication information of the first node includes the node identifier of each of the plurality of second nodes.
[0137] In some embodiments, the retrieval module 802 includes:
[0138] The first retrieval unit is used to determine the initial text set from the database based on the similarity between the questions and the nodes in the top layer of the retrieval structure.
[0139] The second retrieval unit is used to retrieve texts associated with each text in the initial text set from the database based on the indication information of the nodes corresponding to each text in the initial text set, and add the retrieved texts to the initial text set to obtain a text set related to the question.
[0140] In some embodiments, the first retrieval unit is configured to:
[0141] Based on the text in each node of the top layer, determine the similarity between the question and each node of the top layer;
[0142] The initial text set is determined based on the N nodes with the highest similarity in the top layer, where N is a positive integer.
[0143] In some embodiments, the second retrieval unit is configured to:
[0144] Based on the indication information of the nodes corresponding to each text in the initial text set, multiple candidate nodes are determined, and the text in the multiple candidate nodes is associated with the text in the initial text set;
[0145] Based on the similarity between the question and each candidate node, the text of the candidate node with the highest similarity is added to the initial text set, where M is a positive integer.
[0146] The aforementioned device involves a retrieval structure comprising multiple layers of nodes. In this retrieval structure, each node includes indicator information and text. For any given node, the indicator information indicates whether the text within that node is related to the text in other nodes. In other words, based on the indicator information of any node, other texts related to the text within that node can be quickly located. Based on this, when the AI question-answering system receives a question, it can perform a search in the database based on the retrieval structure. Combining the indicator information of the retrieved nodes, it can quickly retrieve all texts related to the question. Furthermore, the retrieved texts are also related to each other. Therefore, inputting the question and the retrieved text into a large language model can significantly improve the accuracy of the large language model's answer.
[0147] Of course, the device can also include other functional units to implement other functions involved in the AI question-answering system in the above method embodiments. In practical applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device can be divided into different functional units to complete all or part of the functions described above. In addition, the device provided in the above embodiments and the above method embodiments belong to the same concept, and its specific implementation process can be found in the method embodiments, which will not be repeated here.
[0148] This application also provides a computer-readable storage medium for storing at least one piece of program code, which, when executed by a computing device, enables the computing device to perform the functions of the aforementioned AI question-answering system.
[0149] This application also provides a computer program product that, when run on a computing device, enables the computing device to perform the functions of the aforementioned AI question-answering system.
[0150] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items with substantially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor does it limit the quantity or execution order. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various elements, these elements should not be limited by the terms. These terms are merely used to distinguish one element from another. For example, without departing from the various examples described, a first node can be referred to as a second node, and similarly, a second node can be referred to as a first node. Both first and second nodes can be nodes, and in some cases, they can be separate and distinct nodes.
[0151] In this application, the term "at least one" means one or more, and the term "multiple" means two or more. For example, multiple nodes means two or more nodes.
[0152] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0153] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, in the form of program structure information. This program structure information includes one or more program instructions. When these program instructions are loaded and executed on a computing device, the processes or functions according to the embodiments of this application are generated, in whole or in part.
[0154] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0155] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. An artificial intelligence (AI) question answering system, comprising: The system is used for: acquiring a question in a voice, text or video format; based on the question and a retrieval structure of a database, retrieving in the database to obtain a text set related to the question, the retrieval structure comprising multiple layers, each layer comprising at least one node, the node comprising indication information and text, the indication information indicating whether the text in the node is associated with the text in other nodes; inputting the question and the text set into a large language model to generate an answer to the question through the large language model.
2. The system of claim 1, wherein, The multiple texts in the text set come from different documents; or the multiple texts in the text set come from different paragraphs in the same document; or the multiple texts in the text set come from different sentences in the same paragraph.
3. The system of claim 1 or 2, wherein, The retrieval structure comprises a first node and multiple second nodes, the first node and the multiple second nodes belong to different layers, the indication information of the first node indicates that the text in the first node is associated with the text in the multiple second nodes, and the text in the first node is a summary of the text in the multiple second nodes.
4. The system of any one of claims 1 to 3, wherein, The system is used for: based on the similarity between the question and each node in the top layer of the retrieval structure, determining an initial text set from the database; based on the indication information of the node corresponding to each text in the initial text set, retrieving from the database the text associated with each text in the initial text set, and adding the retrieved text to the initial text set to obtain a text set related to the question.
5. The system of claim 4, wherein, The system is used for: based on the text in each node in the top layer, determining the similarity between the question and each node in the top layer; based on the top N nodes in the top layer in terms of similarity, determining the initial text set, N being a positive integer.
6. The system of claim 4 or 5, wherein, The system is used for: based on the indication information of the node corresponding to each text in the initial text set, determining multiple candidate nodes, the text in the multiple candidate nodes being associated with the text in the initial text set; based on the similarity between the question and each candidate node, adding the text in the candidate node ranked in the top M in terms of similarity to the initial text set, M being a positive integer.
7. The system of any one of claims 1 to 6, wherein, The system is also used for: segmenting a document to be stored in the database into multiple first texts; based on the multiple first texts, generating a node corresponding to each first text; based on the nodes corresponding to the multiple first texts, performing a loop clustering to construct the retrieval structure.
8. The system of claim 7, wherein, The system is used for: in the i-th clustering process, clustering the nodes corresponding to the multiple first texts to obtain multiple first clusters, summarizing the first text in each first cluster to obtain a second text corresponding to each first cluster, generating a node corresponding to each second text, i being a positive integer; In the i+1th clustering process, nodes corresponding to the plurality of second texts are clustered, and if at least one second cluster is obtained, the second texts in each second cluster are summarized to obtain a third text corresponding to each second cluster, nodes corresponding to each third text are generated, and an i+2th clustering is performed; If no clustering result is obtained, the clustering is stopped. 9.A method for AI question answering based on a large language model, characterized in that, The method comprises: obtaining a question in a voice, text or video format; based on the question and the retrieval structure of the database, retrieving in the database to obtain a text set related to the question, the text set comprising a plurality of associated texts, the retrieval structure comprising multiple layers, each layer comprising at least one node, the node comprising indicating information and text, the indicating information indicating whether the text in the node is associated with the text in other nodes; inputting the question and the text set into a large language model to generate an answer to the question through the large language model.
10. The method of claim 9, wherein, The plurality of texts in the text set come from different documents; or the plurality of texts in the text set come from different paragraphs in the same document; or the plurality of texts in the text set come from different sentences in the same paragraph.
11. The method according to claim 9 or 10, characterized in that, The retrieval structure comprises a first node and a plurality of second nodes, the first node and the plurality of second nodes belong to different layers, the indicating information of the first node indicates that the text in the first node is associated with the text in the plurality of second nodes, and the text in the first node is a summary of the text in the plurality of second nodes.
12. The method according to any one of claims 9 to 11, characterized in that, The retrieval structure of the database based on the question and the retrieval structure of the database, retrieving in the database to obtain a text set related to the question, comprises: determining an initial text set from the database based on the similarity between the question and each node in the top layer of the retrieval structure; based on the indicating information of the node corresponding to each text in the initial text set, retrieving from the database the text associated with each text in the initial text set, and adding the retrieved text to the initial text set to obtain a text set related to the question.
13. The method of claim 12, wherein, The determination of the initial text set from the database based on the similarity between the question and each node in the top layer of the retrieval structure comprises: determining the similarity between the question and each node in the top layer based on the text in each node in the top layer; determining the initial text set based on the nodes ranked in the top N positions in terms of similarity in the top layer, N being a positive integer.
14. The method according to claim 12 or 13, characterized in that, The retrieval of the text associated with each text in the initial text set from the database based on the indicating information of the node corresponding to each text in the initial text set, and the addition of the retrieved text to the initial text set, comprises: determining a plurality of candidate nodes based on the indicating information of the node corresponding to each text in the initial text set, the text in the plurality of candidate nodes being associated with the text in the initial text set; based on the similarity between the question and each candidate node, adding the text in the candidate nodes ranked in the top M positions in terms of similarity to the initial text set, M being a positive integer. 15.A large language model-based AI question answering apparatus, characterized by comprising: The device comprises: an acquisition module configured to acquire a question in a voice, text or video format; a retrieval module configured to retrieve, based on the question and a retrieval structure of a database, the database to obtain a text set related to the question, the text set comprising a plurality of texts associated with each other, the retrieval structure comprising a plurality of layers, each layer comprising at least one node, the node comprising indication information and a text, the indication information indicating whether the text in the node is associated with the text in another node; a generation module configured to input the question and the text set into a large language model to generate an answer to the question by the large language model.
16. The apparatus of claim 15, wherein, The plurality of texts in the text set are from different documents, or from different paragraphs in the same document, or from different sentences in the same paragraph.
17. The apparatus of claim 15 or 16, wherein, The retrieval structure comprises a first node and a plurality of second nodes, the first node and the plurality of second nodes belong to different layers, the indication information of the first node indicates that the text in the first node is associated with the texts in the plurality of second nodes, and the text in the first node is a summary of the texts in the plurality of second nodes.
18. The apparatus of any one of claims 15-17, wherein, The retrieval module comprises: a first retrieval unit configured to determine an initial text set from the database based on the similarity between the question and each node in a top layer of the retrieval structure; a second retrieval unit configured to retrieve, based on the indication information of the node corresponding to each text in the initial text set, the text associated with each text in the initial text set from the database, and add the retrieved text to the initial text set to obtain the text set related to the question.
19. The apparatus of claim 18, wherein, The first retrieval unit is configured to: determine the similarity between the question and each node in the top layer based on the text in each node in the top layer; and determine the initial text set based on the nodes with the top N similarities in the top layer, N being a positive integer.
20. The apparatus of claim 18 or 19, wherein, The second retrieval unit is configured to: determine a plurality of candidate nodes based on the indication information of the node corresponding to each text in the initial text set, the text in the plurality of candidate nodes being associated with the text in the initial text set; and add the text in the candidate nodes with the top M similarities to the initial text set based on the similarity between the question and each candidate node, M being a positive integer.
21. A computing device, comprising: The computing device comprises a processor and a memory, the processor being configured to execute at least one piece of program code stored in the memory to enable the computing device to implement the functions of the AI question answering system as claimed in any one of the preceding claims 1 to 8.
22. A computer program product, characterised in that, The computer program product, when running on the computing device, enables the computing device to implement the functions of the AI question answering system as claimed in any one of the preceding claims 1 to 8.
23. A computer-readable storage medium, characterized in that, The computer-readable storage medium is configured to store at least one piece of program code for implementing the functions of the AI question answering system as claimed in any one of the preceding claims 1 to 8.