Multi-course question answering method and device based on modular retrieval enhancement generation

By constructing a multi-match angle course index database and search query statements that adapt to different courses, the existing RAG methods are solved for the problem that it is difficult for different course Q&A types to deal with, and more efficient multi-course Q&A effects and knowledge updates are achieved.

CN120104725APending Publication Date: 2025-06-06TSINGHUA UNIVERSITY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411973206.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The existing search enhancement generation RAG methods are limited to optimizing specific vertical domain problems with the same distribution, and it is difficult to uniformly deal with the different needs of search enhancement for different courses/Q&A types.

Method used

By constructing a multi-match angle course index database separated by knowledge and index, the search range of the target question is obtained, and the search query statements that enhance the generation reasoning process are determined based on the search range, and rewrite and search to adapt to the matching angles of different courses and questions.

Benefits of technology

It improves the effectiveness of retrieval enhancement in the field of multi-course Q&A, reduces the difficulty of updating knowledge and indexes, and can better serve interdisciplinary Q&A and knowledge updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104725A_ABST
    Figure CN120104725A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of natural language processing, in particular to a multi-course question answering method and device based on modular retrieval enhancement generation, and the method comprises the steps: constructing a multi-matching-angle course index database with knowledge and index separated according to a target data range; obtaining a retrieval range of the target question, and determining a retrieval query statement of a retrieval enhancement generation reasoning process according to the retrieval range; rewriting the target question to obtain a rewritten question; retrieving in a multi-matching-angle course index database according to the rewritten questions and retrieval query statements so as to query target domain knowledge; and splicing the domain knowledge with the target question to obtain an answer result. Therefore, the problem that an existing method for generating the RAG through retrieval enhancement is limited to optimization of the specific vertical field with the same distribution, namely, the problem that the same workflow is used for processing the same field is solved, and the problems that different requirements of different courses / question answering types for retrieval enhancement are difficult to process in a unified mode are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a multi-course question-answering method and device based on modular retrieval enhanced generation. Background Art

[0002] The success of large-scale pre-trained language models in fluently generating natural language has greatly inspired the innovative application of artificial intelligence in the field of higher education, bringing new solutions to the equality of educational resources. However, large models have extremely high requirements for training technology, training resources, and training data in learning new knowledge, which greatly hinders the application of these models in more refined vertical fields.

[0003] Recent work has proposed a retrieval-augmented generation (RAG) method to improve the knowledge reserve of large models in vertical fields. Its purpose is to use the vertical field knowledge related to the search engine and user questions to feed into the large model, thereby enhancing the performance of the large model in unknown field knowledge. This technology includes a series of processes such as data segmentation, question rewriting, vector retrieval, and reranking. However, this technology is limited to optimizing specific vertical field problems with the same distribution, and using the same workflow to handle problems in the same field. In the course Q&A of university disciplines, different courses may have different retrieval requirements for different types of Q&A, which may occur between liberal arts and science and engineering, or between different types of questions in the same subject.

[0004] For example, consider an online question-answering system in a university that needs to handle student questions from two very different disciplines: biology and literature. In the field of biology, students may ask specific questions about the structure of complex biological systems, such as "explain the photosynthesis pathway in the human body." For such questions, the system may need to accurately retrieve relevant knowledge points. In the field of literature, a common question may be "analyze the main conflict in Romeo and Juliet." This type of question requires fuzzy retrieval of relevant information from literary reviews and historical background materials. In addition, different disciplines and materials may also require different retrieval models for optimization, which are difficult to be uniformly covered by the existing single RAG workflow. Summary of the invention

[0005] The present invention provides a multi-course question-answering method and device based on modular retrieval enhancement generation, so as to solve the problem that the existing retrieval enhancement generation RAG method is limited to optimizing specific vertical field problems with the same distribution, that is, using the same workflow to process problems in the same field, and it is difficult to uniformly handle the different requirements of different courses / question-answering types for retrieval enhancement.

[0006] The first aspect of the present invention provides a multi-course question-answering method based on modular retrieval enhanced generation, comprising the following steps: constructing a multi-matching angle course index database with knowledge and index separated according to the target material scope; obtaining the retrieval scope of the target question, and determining the retrieval query statement of the retrieval enhanced generation reasoning process according to the retrieval scope; rewriting the target question to obtain the rewritten question; searching in the multi-matching angle course index database according to the rewritten question and the retrieval query statement to query the target domain knowledge; splicing the domain knowledge with the target question to obtain an answer result.

[0007] Optionally, the step of constructing a multi-matching angle course index database with knowledge and index separated according to the target material scope includes:

[0008] Acquire multiple course data sets according to the target data range;

[0009] Configuring corresponding index information for the plurality of course data sets to obtain a multi-angle matching index, wherein the index information includes an index field, an index mode, and an embedding method;

[0010] The plurality of course data sets are modularly indexed and constructed through the multi-angle matching index to generate a multi-matching angle course index database in which knowledge and index are separated.

[0011] Optionally, the step of acquiring the search scope of the target question and determining the search query statement of the search enhancement generation reasoning process according to the search scope includes:

[0012] Obtaining the search scope of the target question;

[0013] Selecting a corresponding matching method according to the search scope and the indexing method;

[0014] Based on the matching method, the search scope is converted into a search query statement of the search enhancement generation reasoning process.

[0015] Optionally, the matching method adopts at least one of a multi-label matching method, a keyword matching method, and a semantic vector matching method, wherein the semantic vector matching method is divided into course major optimized embedding, knowledge point optimized embedding, and question type optimized embedding according to the description angle of the text representation.

[0016] The second aspect of the present invention provides a multi-course question-answering device based on modular retrieval enhancement generation, including: a construction module, which is used to construct a multi-matching angle course index database with knowledge and index separated according to the target material scope; a determination module, which is used to obtain the retrieval scope of the target question, and determine the retrieval query statement of the retrieval enhancement generation reasoning process according to the retrieval scope; a rewriting module, which is used to rewrite the target question to obtain the rewritten question; a retrieval module, which is used to search in the multi-matching angle course index database according to the rewritten question and the retrieval query statement to query the target domain knowledge; a splicing module, which is used to splice the domain knowledge with the target question to obtain an answer result.

[0017] Optionally, the building blocks include:

[0018] A first acquisition unit, used for acquiring a plurality of course data sets according to the target data range;

[0019] A configuration unit, configured to configure corresponding index information for the plurality of course data sets to obtain a multi-angle matching index, wherein the index information includes an index field, an index mode and an embedding method;

[0020] A construction unit is used to perform modular index construction on the multiple course data sets through the multi-angle matching index to generate a multi-matching angle course index database in which knowledge and index are separated.

[0021] Optionally, the determining module includes:

[0022] A second acquisition unit, used to acquire the search scope of the target question;

[0023] A selection unit, used for selecting a corresponding matching method according to the search scope and the indexing method;

[0024] A conversion unit is used to convert the search scope into a search query statement of the search enhancement generation reasoning process based on the matching method.

[0025] Optionally, the matching method adopts at least one of a multi-label matching method, a keyword matching method, and a semantic vector matching method, wherein the semantic vector matching method is divided into course major optimized embedding, knowledge point optimized embedding, and question type optimized embedding according to the description angle of the text representation.

[0026] The third aspect of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the multi-course question-answering method based on modular retrieval enhanced generation as described in the above embodiment.

[0027] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the multi-course question-answering method based on modular retrieval enhanced generation as described above.

[0028] The multi-course question-answering method and device based on modular retrieval enhancement generation proposed in the embodiment of the present invention, through modular processing of indexing methods and matching methods, from precise matching to fuzzy matching, adapts to the matching angles of different courses, materials and questions, and uniformly handles the different needs of different courses / question-answering types for retrieval enhancement, thereby improving the effect of retrieval enhancement generation in the field of multi-course question-answering, and at the same time separates knowledge from indexes, greatly reducing the difficulty of updating knowledge and indexes in multiple courses. Unified processing can better serve interdisciplinary question-answering and knowledge updating.

[0029] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0031] Figure 1 A flowchart of a multi-course question-answering method based on modular retrieval enhanced generation provided by an embodiment of the present invention;

[0032] Figure 2 An overall framework diagram of a multi-course question-answering method based on modular retrieval enhanced generation provided by an embodiment of the present invention;

[0033] Figure 3 An execution effect diagram of a multi-course question-answering method based on modular retrieval enhanced generation provided by an embodiment of the present invention;

[0034] Figure 4 A block diagram of a multi-course question-answering device based on modular retrieval enhanced generation provided by an embodiment of the present invention;

[0035] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0037] The following describes a multi-course question-answering method and device based on modular retrieval enhanced generation according to an embodiment of the present invention with reference to the accompanying drawings.

[0038] Figure 1 A flowchart of a multi-course question-answering method based on modular retrieval enhanced generation provided in an embodiment of the present invention.

[0039] like Figure 1 As shown, the multi-course question answering method based on modular retrieval enhanced generation includes the following steps:

[0040] In step S101, a multi-matching angle course index database with knowledge and index separated is constructed according to the target material scope.

[0041] In some embodiments, a multi-matching angle course index database with knowledge and index separated is constructed according to the target material scope, including:

[0042] Acquire multiple course data sets according to target data range;

[0043] Configuring corresponding index information for multiple course data sets to obtain multi-angle matching indexes, wherein the index information includes index fields, index modes, and embedding methods;

[0044] Through multi-angle matching indexing, modular indexing is constructed for multiple course data sets to generate a multi-matching angle course index database in which knowledge and index are separated.

[0045] In the actual implementation process, Figure 2 As shown, within the target data range, a data set D of multiple courses is obtained = {C 1 ,C 2 ,...,C C}, where C i ={c 1 ,c 2 ,...,c Ci} represents all the document data of the i-th course. Each document c j It is described by a json line format data, where each line is a fragment or knowledge point of the document and is described in json. For example, the fragment or knowledge point of the kth line is described as p k ={field 1 :v 1 ,field 2 :v 2 ,...}, where field is p k The attributes of a website, such as title, subtitle, content, source link, tag, etc. v is the value corresponding to the attribute, which is used for subsequent knowledge and index construction.

[0046] Furthermore, an index information description of each document in a data set of multiple courses is received from a user, wherein the index information is divided into three aspects including index field, index mode, and embedding method.

[0047] The index field defines which attributes should be indexed and which fields are used as knowledge. For example, the attribute field can be defined by the field definition method I f The description is If(field) = {isi:true / false, isk:true / false}, where isi indicates whether the attribute is an indexed attribute, and isk indicates whether the attribute is knowledge, which is determined by true or false.

[0048] The indexing method includes three modules: multi-label matching, keyword matching, and semantic vector matching, which are used to meet the needs from exact matching to fuzzy matching. For example, the attribute field can be defined by the indexing method I m Described as I m (field) = {isl:true / false,isw:true / false,iss:true / false}, where isl indicates whether the attribute uses multi-label matching, isw indicates whether the attribute uses keyword matching, and iss indicates whether the attribute uses semantic vector matching.

[0049] The embedding method is used to match the semantic vector. Different data use different embedding methods according to the requirements. The same data can be matched from different angles or suitable for different formats according to the requirements. The embedding itself also needs to be dynamically updated. All embedding methods are organized into a unified form of API, which inputs text / image and returns the vector of the text / image. For attribute field, you can define method I through embedding method e Described as I e (field)=[e 1 ,e 2 ,...], where e 1 Represents the first embedded method API organized into a unified API.

[0050] Furthermore, based on the data sets and index information of multiple courses, each document c j First, we will define the method I through the field f The knowledge and index fields are separated, and all knowledge key-value pairs are first saved in the knowledge database for use. The index field is further defined by the index method I mDefine the index module and build the corresponding index for the index content v. For multi-label matching, v is encoded as a sequence of multiple labels; for keyword matching, v will first perform word segmentation and stop word filtering, and build an inverted index; for semantic vector matching, the embedding method will first be used to define method I e Get the embedding method API, and then save the returned vector to the index database by inputting v. After the three index information are matched, multiple course index databases are generated.

[0051] In step S102, the search scope of the target question is obtained, and the search query statement of the search enhancement generation reasoning process is determined according to the search scope.

[0052] In some embodiments, obtaining the search scope of the target question and determining the search query statement of the search enhancement generation reasoning process according to the search scope includes:

[0053] Get the search scope of the target question;

[0054] Select the corresponding matching method according to the search scope and indexing method;

[0055] Based on the matching method, the search scope is converted into a search query statement for the search enhancement generation reasoning process.

[0056] Among them, the matching method adopts at least one of the multi-label matching method, the keyword matching method, and the semantic vector matching method. Among them, the semantic vector matching method is divided into course major optimized embedding, knowledge point optimized embedding, and question type optimized embedding according to the description angle of text representation.

[0057] In the actual implementation process, Figure 2 and 3 As shown, the search scope of the target question currently raised by the user is divided, wherein the search scope is divided into two types: material scope and attribute scope. First, the embodiment of the present invention clarifies the material scope of the documents to be searched for different types of courses to which the questions belong, and also allows cross-disciplinary document materials belonging to multiple disciplines, as well as document search scopes manually set by users. Then, the attribute search scope set by the user for specific courses and materials is obtained, and the corresponding matching method and index information of the material configuration are selected for joint verification to determine the correctness of the attribute scope. Finally, the defined search scope is converted into a search query statement.

[0058] Among them, the types of matching methods correspond to the indexing methods one by one, including multi-label (exact matching), keyword (BM25), and semantic vector (dot product similarity) matching. These matching methods exist in the form of modular interfaces. First, select the corresponding matching method based on the search scope. The optional matching method is a subset of the indexing method previously defined on the field. The method is checked to ensure that an undefined indexing method is not selected. Then, if the semantic vector matching is selected, the embedding method API to be used will continue to be selected. The system also records whether the version of the embedding method API used during indexing is consistent with the current API version. If it is inconsistent, the background will be notified to update the relevant index to ensure the consistency of data embedding and question embedding. Finally, the determined matching method is converted into a search query statement.

[0059] In step S103, the target question is rewritten to obtain a rewritten question.

[0060] In the actual execution process, the embodiment of the present invention will pre-process the target question currently raised by the user, rewrite it into a text form suitable for retrieval through a large model, eliminate pronouns that depend on the context, etc., and obtain the rewritten question.

[0061] In step S104, a search is performed in the multi-matching angle course index database according to the rewritten question and search query statement to search for target domain knowledge.

[0062] In step S105, the domain knowledge is combined with the target question to obtain an answer result.

[0063] In the actual implementation process, the rewritten questions and search query statements are searched in the multi-matching angle course index database, and the method that requires semantic vectors will embed the questions with the corresponding embedding method. Different matching methods are combined by taking the topn to obtain the p k The set is then matched with the knowledge database to obtain the corresponding domain knowledge. Finally, the user's question and domain knowledge are spliced ​​into a prompt input model to obtain the answer result and return it to the user.

[0064] In summary, the multi-course question-answering method based on modular retrieval enhancement generation proposed in an embodiment of the present invention, through modular processing of indexing methods and matching methods, from precise matching to fuzzy matching, is adapted to the matching angles of different courses, materials and questions, and uniformly handles the different needs of different courses / question-answering types for retrieval enhancement, thereby improving the effect of retrieval enhancement generation in the field of multi-course question-answering, and at the same time separating knowledge from indexes, greatly reducing the difficulty of updating knowledge and indexes in multiple courses. Unified processing can better serve interdisciplinary question-answering and knowledge updating.

[0065] Next, the multi-course question-answering device based on modular retrieval enhanced generation proposed in an embodiment of the present invention is described with reference to the accompanying drawings.

[0066] Figure 4 It is a block diagram of a multi-course question-answering device based on modular retrieval enhanced generation according to an embodiment of the present invention.

[0067] like Figure 4 As shown, the multi-course question-answering device 40 based on modular retrieval enhanced generation includes: a construction module 401, a determination module 402, a rewriting module 403, a retrieval module 404 and a splicing module 405.

[0068] Among them, the construction module 401 is used to construct a multi-matching angle course index database with knowledge and index separated according to the target data scope. The determination module 402 is used to obtain the search scope of the target question, and determine the search query statement of the search enhancement generation reasoning process according to the search scope. The rewriting module 403 is used to rewrite the target question to obtain the rewritten question. The retrieval module 404 is used to search in the multi-matching angle course index database according to the rewritten question and the retrieval query statement to query the target domain knowledge. The splicing module 405 is used to splice the domain knowledge with the target question to obtain the answer result.

[0069] In some embodiments, the building block 401 includes:

[0070] A first acquisition unit, used for acquiring a plurality of course data sets according to a target data range;

[0071] A configuration unit, configured to configure corresponding index information for multiple course data sets to obtain a multi-angle matching index, wherein the index information includes an index field, an index mode, and an embedding method;

[0072] The construction unit is used to perform modular index construction on multiple course data sets through multi-angle matching indexes to generate a multi-matching angle course index database in which knowledge and index are separated.

[0073] In some embodiments, the determination module 402 includes:

[0074] A second acquisition unit is used to acquire the search scope of the target question;

[0075] A selection unit, used to select a corresponding matching method according to a search scope and an indexing method;

[0076] The conversion unit is used to convert the search scope into a search query statement for the search enhancement generation reasoning process based on the matching method.

[0077] In some embodiments, the matching method adopts at least one of a multi-label matching method, a keyword matching method, and a semantic vector matching method, wherein the semantic vector matching method is divided into course major optimized embedding, knowledge point optimized embedding, and question type optimized embedding according to the description angle of the text representation.

[0078] It should be noted that the aforementioned explanation of the embodiment of the multi-course question-answering method based on modular retrieval enhancement generation is also applicable to the multi-course question-answering device based on modular retrieval enhancement generation in this embodiment, and will not be repeated here.

[0079] According to the multi-course question-answering device based on modular retrieval enhancement generation proposed in the embodiment of the present invention, through modular processing of indexing methods and matching methods, from precise matching to fuzzy matching, it is adapted to the matching angles of different courses, materials and questions, and uniformly handles the different needs of different courses / question-answering types for retrieval enhancement, thereby improving the effect of retrieval enhancement generation in the field of multi-course question-answering, and at the same time separating knowledge from indexes, greatly reducing the difficulty of updating knowledge and indexes in multiple courses. Unified processing can better serve interdisciplinary question-answering and knowledge updating.

[0080] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device may include:

[0081] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .

[0082] When the processor 502 executes the program, the multi-course question-answering method based on modular retrieval enhanced generation provided in the above embodiment is implemented.

[0083] Furthermore, the electronic device further comprises:

[0084] The communication interface 503 is used for communication between the memory 501 and the processor 502 .

[0085] The memory 501 is used to store computer programs that can be executed on the processor 502 .

[0086] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0087] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0088] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.

[0089] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.

[0090] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-course question-answering method based on modular retrieval enhanced generation as described above.

[0091] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0092] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "N" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0093] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.

[0094] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways as necessary and then storing it in a computer memory.

[0095] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0096] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0097] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0098] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A multi-course question answering method based on modular retrieval enhanced generation, characterized in that: The following steps are involved: Construct a multi-matching angle course index database with knowledge and index separated according to the target material scope; Obtaining a search scope of the target question, and determining a search query statement for a search enhancement generation reasoning process according to the search scope; Rewriting the target question to obtain a rewritten question; Searching the multi-matching angle course index database according to the rewritten question and the search query statement to query target domain knowledge; The domain knowledge is combined with the target question to obtain an answer result.

2. The multi-course question answering method based on modular retrieval enhanced generation according to claim 1 is characterized in that: The multi-matching angle course index database with knowledge and index separation constructed according to the target data range includes: Acquire multiple course data sets according to the target data range; Configuring corresponding index information for the plurality of course data sets to obtain a multi-angle matching index, wherein the index information includes an index field, an index mode, and an embedding method; The plurality of course data sets are modularly indexed and constructed through the multi-angle matching index to generate a multi-matching angle course index database in which knowledge and index are separated.

3. The multi-course question answering method based on modular retrieval enhanced generation according to claim 2 is characterized in that: The step of obtaining the search scope of the target question and determining the search query statement of the search enhancement generation reasoning process according to the search scope includes: Obtaining the search scope of the target question; Selecting a corresponding matching method according to the search scope and the indexing method; Based on the matching method, the search scope is converted into a search query statement of the search enhancement generation reasoning process.

4. The multi-course question answering method based on modular retrieval enhanced generation according to claim 3 is characterized in that: The matching method adopts at least one of a multi-label matching method, a keyword matching method, and a semantic vector matching method, wherein the semantic vector matching method is divided into course major optimized embedding, knowledge point optimized embedding, and question type optimized embedding according to the description angle of text representation.

5. A multi-course question-answering device based on modular retrieval enhanced generation, characterized in that: include: A construction module is used to construct a multi-matching angle course index database with knowledge and index separated according to the target material scope; A determination module, used to obtain the search scope of the target question and determine the search query statement of the search enhancement generation reasoning process according to the search scope; A rewriting module, used for rewriting the target question to obtain a rewritten question; A retrieval module, used for searching the multi-matching angle course index database according to the rewritten question and the retrieval query statement to query the target domain knowledge; The splicing module is used to splice the domain knowledge with the target question to obtain an answer result.

6. The multi-course question answering device based on modular retrieval enhanced generation according to claim 5 is characterized in that: The building blocks include: A first acquisition unit, used for acquiring a plurality of course data sets according to the target data range; A configuration unit, configured to configure corresponding index information for the plurality of course data sets to obtain a multi-angle matching index, wherein the index information includes an index field, an index mode and an embedding method; A construction unit is used to perform modular index construction on the multiple course data sets through the multi-angle matching index to generate a multi-matching angle course index database in which knowledge and index are separated.

7. The multi-course question answering device based on modular retrieval enhanced generation according to claim 6 is characterized in that: The determination module comprises: A second acquisition unit, used to acquire the search scope of the target question; A selection unit, used for selecting a corresponding matching method according to the search scope and the indexing method; A conversion unit is used to convert the search scope into a search query statement of the search enhancement generation reasoning process based on the matching method.

8. The multi-course question answering device based on modular retrieval enhanced generation according to claim 7 is characterized in that: The matching method adopts at least one of a multi-label matching method, a keyword matching method, and a semantic vector matching method, wherein the semantic vector matching method is divided into course major optimized embedding, knowledge point optimized embedding, and question type optimized embedding according to the description angle of text representation.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the multi-course question-answering method based on modular retrieval enhanced generation as described in any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the multi-course question-answering method based on modular retrieval enhanced generation as described in any one of claims 1-4.

Citation Information

Cited By

  • Voice interaction method, server and computer readable storage medium

    CN120853560A

  • RAG-based curriculum personalized learning assistant system

    CN122412479A