A method for generating building knowledge question and answer based on secondary search enhancement
By utilizing a combination of Euclidean distance and LTR distance in a knowledge-based question-answering system for the architectural field, the problems of information retrieval accuracy and generation technology in existing technologies are solved. By introducing self-supervised learning and few-sample training, the accuracy and interpretability of knowledge-based question answering are improved.
Patent Information
- Application Number
- CN202311212132.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-09-19
AI Technical Summary
In existing knowledge-based question-answering systems in the construction field, vector retrieval is not accurate enough and the generated answers are not precise enough, which is limited by the information extraction capabilities of LLM and the accuracy of vector retrieval.
A generative architectural knowledge question answering method based on secondary retrieval enhancement is adopted. The RetroMAE model is used for vector encoding, and secondary retrieval enhancement is performed by combining LTR distance and Euclidean distance. The semantic recall accuracy and knowledge retrieval accuracy are improved through self-supervised learning and few-shot training.
In the field of architecture, it improved the accuracy of knowledge retrieval, increased the accuracy of semantic recall and knowledge retrieval by more than 10%, improved the overall question answering accuracy by more than 20%, and reduced the illusion rate of large language models.
Smart Images

Figure CN117290477B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this disclosure relate to the field of computer technology, and more specifically to a generative architectural knowledge question-answering method, apparatus, electronic device, and computer-readable medium based on secondary retrieval enhancement. Background Technology
[0002] Over the past few years, Natural Language Processing (NLP) and Information Retrieval (IR) have experienced rapid development. In NLP, customized frameworks are designed for specific tasks, and various powerful general-purpose models, unsupervised pre-trained on massive corpora, can handle diverse NLP tasks with fine-tuning. These models are full of potential, but suffer from drawbacks such as the inability to easily extend or correct model memory, poor interpretability of prediction results, and occasional illusions. In Information Retrieval (IR), vector databases, with their efficient and fast indexing computation, are naturally suitable for storing and retrieving massive amounts of knowledge information. Vectorized knowledge bases enhance the comprehensiveness of in-context learning, providing users with more contextual information, helping large language models better understand contextual relationships, and improving their expressive and reasoning abilities. Based on this background, the Retrieval Augmentation Generation (RAG) architecture is proposed.
[0003] For knowledge-based question answering in the architectural field, existing solutions mainly suffer from two problems: First, the accuracy of vector retrieval is not high enough, with answers to many questions appearing late in the search sequence; second, the generated answers are not precise enough, partly due to limitations in the information extraction capabilities of LLM (Limited Language Management) and partly due to constraints imposed by the accuracy of vector retrieval. In short, the accuracy of vector retrieval has a significant impact on domain-specific RAG (Research and Answer Group) systems. Summary of the Invention
[0004] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0005] Some embodiments of this disclosure propose a generative architectural knowledge question-answering method, apparatus, electronic device, and computer-readable medium based on secondary retrieval enhancement to address the technical problems mentioned in the background section above.
[0006] In a first aspect, some embodiments of this disclosure provide a generative architectural knowledge question answering method based on secondary retrieval enhancement. The method includes: obtaining target question information; converting the target question information into a corresponding text vector; using the text vector to perform a retrieval in a target vector library to obtain a target result set; determining at least one relevant result from the target result set based on the target question information; and generating response information for the target question information based on the target question information and the at least one relevant result.
[0007] Secondly, some embodiments of this disclosure provide a generative architectural knowledge question-answering device based on secondary retrieval enhancement. The device includes: an acquisition unit configured to acquire target question information; a conversion unit configured to convert the target question information into a corresponding text vector; a retrieval unit configured to use the text vector to perform a retrieval in a target vector library to obtain a target result set; a determination unit configured to determine at least one relevant result from the target result set based on the target question information; and a generation unit configured to generate response information for the target question information based on the target question information and the at least one relevant result.
[0008] Thirdly, embodiments of this application provide an electronic device, the network device comprising: one or more processors; a storage device for storing one or more programs; and, when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the method described in any implementation of the first aspect.
[0009] Fourthly, embodiments of this application provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any of the implementations of the first aspect.
[0010] One embodiment of the above-described embodiments of this disclosure has the following beneficial effects: It provides a generative architectural knowledge question answering method based on secondary retrieval enhancement for architectural industry-related knowledge question answering. Compared with traditional solutions, it achieves a significant improvement in question answering accuracy. By introducing a secondary retrieval enhancement process into the traditional rag process, a small-sample supervision process can be effectively introduced into the traditional rag process, thereby effectively enhancing the accuracy of the knowledge retrieval process, providing a more accurate prompt, reducing the illusion rate of large language models, and improving the overall effect of architectural domain knowledge question answering.
[0011] This disclosure selects the PLM model of RetroMAE, a vectorized pre-training method specifically for document retrieval, as the vector encoder, and performs small-sample training and fine-tuning for architectural domain knowledge. In the vector encoding stage, self-supervised learning is introduced, which improves the semantic recall accuracy in the architectural domain by more than 10% compared with traditional methods.
[0012] This disclosure introduces LTR distance on top of Euclidean distance for secondary retrieval enhancement. The LTR distance is obtained through a learn2rank model trained on a small number of high-quality samples, introducing supervision during the knowledge ranking stage. By combining LTR distance with Euclidean distance, the accuracy of knowledge retrieval in the architectural domain is improved by more than 10%.
[0013] This disclosure combines LTR distance and vector encoder, resulting in an improvement of more than 10% in semantic recall accuracy and knowledge retrieval accuracy. The combination of the two can improve the accuracy of knowledge question answering in the field of architecture by more than 20%. Attached Figure Description
[0014] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0015] Figure 1 This is a schematic diagram of an application scenario of a generative architectural knowledge question answering method based on secondary retrieval enhancement according to some embodiments of this disclosure;
[0016] Figure 2 This is a flowchart of some embodiments of the generative architectural knowledge question answering method based on secondary retrieval enhancement according to the present disclosure;
[0017] Figure 3 These are schematic diagrams illustrating some embodiments of the generative architectural knowledge question answering method based on secondary retrieval enhancement according to this disclosure;
[0018] Figure 4 This is a structural schematic diagram of some embodiments of the generative architectural knowledge question-answering device based on secondary retrieval enhancement according to the present disclosure;
[0019] Figure 5 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation
[0020] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0021] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0022] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0023] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0024] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0025] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0026] Figure 1 This is a schematic diagram of an application scenario of a generative architectural knowledge question answering method based on secondary retrieval enhancement according to some embodiments of this disclosure.
[0027] like Figure 1 As shown, server 101 can obtain target question information 102, then convert the target question information 102 into a corresponding text vector 103, and then use the text vector 103 to search in the target vector library 104 to obtain a target result set 105. Next, based on the target question information 103, at least one relevant result 106 is determined from the target result set 105. Finally, based on the target question information 103 and the at least one relevant result 106, the response information 107 of the target question information 102 is generated.
[0028] It is understood that the generative architectural knowledge question-answering method based on secondary retrieval enhancement can be executed by a terminal device or by server 101. The executing entity of the above method can also include a device formed by integrating the terminal device and server 101 through a network, or it can be executed by various software programs. The terminal device can be various electronic devices with information processing capabilities, including but not limited to smartphones, tablets, e-book readers, laptops, and desktop computers. The executing entity can also be server 101, software, etc. When the executing entity is software, it can be installed on the electronic devices listed above. It can be implemented as, for example, multiple software programs or software modules used to provide distributed services, or as a single software program or software module. No specific limitations are made here.
[0029] It should be understood that Figure 1 The number of servers shown is merely illustrative. Depending on implementation needs, any number of servers can be used.
[0030] Continue to refer to Figure 2 The diagram illustrates a flow 200 of some embodiments of a generative architectural knowledge question-answering method based on secondary retrieval enhancement according to this disclosure. This generative architectural knowledge question-answering method based on secondary retrieval enhancement includes the following steps:
[0031] Step 201: Obtain information about the target problem.
[0032] In some embodiments, the implementer of the generative architectural knowledge question answering method based on secondary retrieval enhancement (e.g., Figure 1 The server shown can obtain target problem information from the user's web browsing terminal via wired or wireless connection. It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G connections, WiFi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra-wideband) connections, and other currently known or future-developed wireless connection methods. Here, the aforementioned target problem information typically refers to problem information in the construction field.
[0033] Step 202: Convert the above target question information into corresponding text vectors.
[0034] In some embodiments, based on the target problem information obtained in step 201, the aforementioned execution entity (e.g., Figure 1 The server shown can convert the above target problem information into a corresponding text vector.
[0035] In some alternative implementations of certain embodiments, the execution entity may use a pre-trained vector encoder to convert the target question information into the text vector, wherein the vector encoder is obtained by performing few-sample training and self-supervised learning on the PLM model using the RetroMAE vectorization pre-training method.
[0036] In some alternative implementations of some embodiments, the target vector library is obtained by vectorizing data in the target database using a vector encoder as described in one of the embodiments above.
[0037] This disclosure selects the PLM model of RetroMAE, a vectorized pre-training method specifically for document retrieval, as the vector encoder, and performs small-sample training and fine-tuning for architectural domain knowledge. In the vector encoding stage, self-supervised learning is introduced, which improves the semantic recall accuracy in the architectural domain by more than 10% compared with traditional methods.
[0038] Step 203: Use the above text vectors to search in the target vector library to obtain the target result set.
[0039] In some embodiments, the executing entity can use the text vectors to search in a target vector library to obtain a target result set. Here, the target vector library typically refers to a pre-established database of architectural domain knowledge, which is converted into vectors after data cleaning.
[0040] In some optional implementations of certain embodiments, the aforementioned execution entity may determine the Euclidean distance between the text vector and the target vector in the target vector library, and determine the target result set from the target vector library based on the Euclidean distance.
[0041] Step 204: Based on the above target question information, determine at least one relevant result from the above target result set.
[0042] In some embodiments, the executing entity may determine at least one relevant result from the target result set that is highly relevant to the target question information, based on the target question information. Specifically, the relevant result typically refers to a vector that is highly relevant to the question in the target question information.
[0043] In some optional implementations of some embodiments, for each target result in the target result set, the execution entity may determine the LTR distance between the target result and the target question information; multiply the LTR distance between the target result and the target question information by the Euclidean distance to obtain the enhanced distance; and determine at least one relevant result from the target result set based on the enhanced distance.
[0044] Specifically, the LTR distance (question-answer pair matching distance) mentioned above can be obtained by a learn2rank model trained on a small number of high-quality samples, where the learn2rank model introduces supervision in the knowledge ranking stage.
[0045] We introduced LTR distance on top of Euclidean distance for secondary retrieval enhancement. LTR distance is calculated using a learn2rank model trained on a small number of high-quality samples, introducing supervision during the knowledge ranking stage. By combining LTR distance with Euclidean distance, we improved knowledge retrieval accuracy in the architectural field by more than 10%.
[0046] Step 205: Based on the target question information and at least one relevant result mentioned above, generate the response information for the target question.
[0047] In some embodiments, the executing entity may generate response information for the target question based on the target question information and at least one related result.
[0048] In some optional implementations of certain embodiments, the execution entity may construct a prompt based on the target question information and at least one relevant result; input the prompt into a pre-trained large language model to obtain the response information corresponding to the target question information.
[0049] Specifically, the aforementioned execution entity can combine the most relevant knowledge (at least one relevant result) with the user's question (text vector) to construct a prompt, request the LLM (Large Language Model), and the LLM extracts and constructs the question answer (response information) from the relevant knowledge.
[0050] like Figure 3 As shown, Figure 3 These are schematic diagrams of some embodiments of the generative architectural knowledge question answering method based on secondary retrieval enhancement according to this disclosure.
[0051] Step 1: First, vectorize the knowledge using the RetroMAE encoder and put it into the target vector library; then, vectorize the user's questions and select the top k knowledge from the target vector library by the Euclidean distance between the question vector and the knowledge vector.
[0052] Step 2: Take the problem, the top k knowledge and the corresponding Euclidean distance of the knowledge as input, and feed them into the learn2rank model to calculate the LTR distance;
[0053] Step 3: Combine LTR distance and Euclidean distance to calculate the augmented distance, and use the augmented distance to filter out the top m knowledge items.
[0054] Step 4: Combine the question with the top m knowledge items to construct the propmt, send the request to the large language model, extract the answer, and return the answer.
[0055] Specifically, Figure 3 The learn2rank model can be trained using a small number of high-quality building samples for few-shot learning, and then used to calculate the LTR distance. Similarly, the vector encoder can be trained by constructing a small number of high-quality samples and fine-tuning the model, resulting in a Retromae-based vector encoder used for the vectorized encoding of knowledge and questions.
[0056] One embodiment of the above-described embodiments of this disclosure has the following beneficial effects: It provides a generative architectural knowledge question answering method based on secondary retrieval enhancement for architectural industry-related knowledge question answering. Compared with traditional solutions, it achieves a significant improvement in question answering accuracy. By introducing a secondary retrieval enhancement process into the traditional rag process, a small-sample supervision process can be effectively introduced into the traditional rag process, thereby effectively enhancing the accuracy of the knowledge retrieval process, providing more accurate prompt information, reducing the illusion rate of large language models, and improving the overall effect of architectural domain knowledge question answering.
[0057] This disclosure selects the PLM model of RetroMAE, a vectorized pre-training method specifically for document retrieval, as the vector encoder, and performs small-sample training and fine-tuning for architectural domain knowledge. In the vector encoding stage, self-supervised learning is introduced, which improves the semantic recall accuracy in the architectural domain by more than 10% compared with traditional methods.
[0058] This disclosure introduces LTR distance on top of Euclidean distance for secondary retrieval enhancement. The LTR distance is obtained through a learn2rank model trained on a small number of high-quality samples, introducing supervision during the knowledge ranking stage. By combining LTR distance with Euclidean distance, the accuracy of knowledge retrieval in the architectural domain is improved by more than 10%.
[0059] This disclosure combines LTR distance and vector encoder, resulting in an improvement of more than 10% in semantic recall accuracy and knowledge retrieval accuracy. The combination of the two can improve the accuracy of knowledge question answering in the field of architecture by more than 20%.
[0060] Further reference Figure 4 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of a generative architectural knowledge question-answering device based on secondary retrieval enhancement. These device embodiments are similar to... Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.
[0061] like Figure 4 As shown, a generative architectural knowledge question-answering device 400 based on secondary retrieval enhancement in some embodiments includes: an acquisition unit 401, a conversion unit 402, a retrieval unit 403, a determination unit 404, and a generation unit 405. The acquisition unit 401 is configured to acquire target question information; the conversion unit 402 is configured to convert the target question information into a corresponding text vector; the retrieval unit 403 is configured to use the text vector to perform a retrieval in a target vector library to obtain a target result set; the determination unit 404 is configured to determine at least one relevant result from the target result set based on the target question information; and the generation unit 405 is configured to generate response information for the target question information based on the target question information and the at least one relevant result.
[0062] In some optional implementations of embodiments, the conversion unit is further configured to: convert the target question information into the text vector using a pre-trained vector encoder, wherein the vector encoder is obtained by performing few-sample training and self-supervised learning on the PLM model using the RetroMAE vectorization pre-training method.
[0063] In some alternative implementations of the embodiments, the target vector library is obtained by vectorizing the data in the target database using the vector encoder described in one of the above embodiments.
[0064] In some optional implementations of embodiments, the retrieval unit is further configured to: determine the Euclidean distance between the text vector and the target vector in the target vector library, and determine the target result set from the target vector library based on the Euclidean distance.
[0065] In some optional implementations of the embodiments, the determining unit is further configured to: for each target result in the target result set, determine the LTR distance between the target result and the target question information; multiply the LTR distance between the target result and the target question information by a Euclidean distance to obtain an enhanced distance; and determine at least one relevant result from the target result set based on the enhanced distance.
[0066] In some optional implementations of the embodiments, the generation unit is further configured to: construct a prompt based on the target question information and at least one relevant result; input the prompt into a pre-trained large language model to obtain the response information corresponding to the target question information.
[0067] It is understandable that the units described in the device 400 are related to the reference. Figure 2The steps in the described method correspond accordingly. Therefore, the operations, features, and beneficial effects described above for the method also apply to device 400 and the units contained therein, and will not be repeated here.
[0068] One embodiment of the above-described embodiments of this disclosure has the following beneficial effects: It provides a generative architectural knowledge question answering method based on secondary retrieval enhancement for architectural industry-related knowledge question answering. Compared with traditional solutions, it achieves a significant improvement in question answering accuracy. By introducing a secondary retrieval enhancement process into the traditional rag process, a small-sample supervision process can be effectively introduced into the traditional rag process, thereby effectively enhancing the accuracy of the knowledge retrieval process, providing more accurate prompt information, reducing the illusion rate of large language models, and improving the overall effect of architectural domain knowledge question answering.
[0069] This disclosure selects the PLM model of RetroMAE, a vectorized pre-training method specifically for document retrieval, as the vector encoder, and performs small-sample training and fine-tuning for architectural domain knowledge. In the vector encoding stage, self-supervised learning is introduced, which improves the semantic recall accuracy in the architectural domain by more than 10% compared with traditional methods.
[0070] This disclosure introduces LTR distance on top of Euclidean distance for secondary retrieval enhancement. The LTR distance is obtained through a learn2rank model trained on a small number of high-quality samples, introducing supervision during the knowledge ranking stage. By combining LTR distance with Euclidean distance, the accuracy of knowledge retrieval in the architectural domain is improved by more than 10%.
[0071] This disclosure combines LTR distance and vector encoder, resulting in an improvement of more than 10% in semantic recall accuracy and knowledge retrieval accuracy. The combination of the two can improve the accuracy of knowledge question answering in the field of architecture by more than 20%.
[0072] The following is for reference. Figure 5 It illustrates electronic devices suitable for implementing some embodiments of this disclosure (e.g., Figure 1 The structural diagram of the server (500) in the middle. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0073] like Figure 5As shown, electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from storage device 508 into random access memory (RAM) 503. RAM 503 also stores various programs and data required for the operation of electronic device 500. Processing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.
[0074] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 5 Each box shown can represent a device or multiple devices as needed.
[0075] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from storage device 408, or installed from ROM 402. When the computer program is executed by processing device 401, it performs the functions defined above in the methods of some embodiments of this disclosure.
[0076] It should be noted that, in some embodiments of this disclosure, the computer-readable medium described above may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0077] In some embodiments of this disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0078] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0079] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire target question information; convert the target question information into a corresponding text vector; use the text vector to search in a target vector library to obtain a target result set; determine at least one relevant result from the target result set based on the target question information; and generate response information for the target question information based on the target question information and the at least one relevant result.
[0080] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0081] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0082] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including an acquisition unit, a conversion unit, a retrieval unit, a determination unit, and a generation unit. The names of these units do not necessarily limit the unit itself; for example, an acquisition unit may also be described as a "unit for acquiring target problem information."
[0083] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0084] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A generative architectural knowledge question answering method based on secondary retrieval enhancement, comprising: Obtain information about the target problem; Convert the target question information into a corresponding text vector; The text vector is used to search the target vector library to obtain the target result set; Based on the target question information, determine at least one relevant result from the target result set; Based on the target question information and the at least one relevant result, generate response information for the target question information; The step of using the text vector to search in the target vector library to obtain the target result set includes: Determine the Euclidean distance between the text vector and the target vector in the target vector library, and determine the target result set from the target vector library based on the Euclidean distance; The step of determining at least one relevant result from the target result set based on the target question information includes: For each target result in the target result set, determine the LTR distance between the target result and the target question information; The enhanced distance is obtained by multiplying the LTR distance between the target result and the target problem information by the Euclidean distance; At least one relevant result is determined from the target result set based on the enhanced distance.
2. The method according to claim 1, wherein, The step of converting the target question information into a corresponding text vector includes: The target question information is converted into the text vector using a pre-trained vector encoder, wherein the vector encoder is obtained by performing few-sample training and self-supervised learning on the PLM model using the RetroMAE vectorization pre-training method.
3. The method according to claim 2, wherein, The target vector library is obtained by vectorizing the data in the target database using the vector encoder as described in claim 2.
4. The method according to claim 1, wherein, The step of generating response information for the target question based on the target question information and the at least one relevant result includes: Construct a prompt based on the target question information and the at least one relevant result; The prompt is input into a pre-trained large language model to obtain the response information corresponding to the target question information.
5. A generative architectural knowledge question-answering device based on secondary retrieval enhancement, comprising: The acquisition unit is configured to acquire target problem information; The conversion unit is configured to convert the target question information into a corresponding text vector; The retrieval unit is configured to perform a retrieval in a target vector library using the text vector to obtain a target result set; The determining unit is configured to determine at least one relevant result from the target result set based on the target problem information; The generation unit is configured to generate response information for the target question based on the target question information and the at least one relevant result; The retrieval unit is specifically used to determine the Euclidean distance between the text vector and the target vector in the target vector library, and to determine the target result set from the target vector library based on the Euclidean distance; The determining unit is specifically used to determine the LTR distance between each target result in the target result set and the target question information; The enhanced distance is obtained by multiplying the LTR distance between the target result and the target problem information by the Euclidean distance; At least one relevant result is determined from the target result set based on the enhanced distance.
6. The apparatus of claim 5, wherein the conversion unit is further configured to: The target question information is converted into the text vector using a pre-trained vector encoder, wherein, The vector encoder is obtained by using the RetroMAE vectorization pre-training method to perform few-sample training and self-supervised learning on the PLM model.
7. An electronic device, comprising: One or more processors; Storage device, on which one or more programs are stored, When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-4.
8. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the method as described in any one of claims 1-4.
Citation Information
Patent Citations
Information retrieval method and device, storage medium and electronic equipment
CN115114418A