Regulation intelligent question answering method and device based on two-stage retrieval and large model

By constructing a summary and content knowledge base and adopting a two-stage retrieval method, combined with sparse vector and dense vector models, the problem of inaccurate retrieval in rules and regulations Q&A was solved, and more accurate Q&A results were achieved.

CN119807346BActive Publication Date: 2026-01-0210TH RES INST OF CETC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411778714.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2026-01-02
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

Existing intelligent question-answering technologies for regulations and systems suffer from low retrieval accuracy and are prone to providing irrelevant answers, especially when there are many and disorganized regulations and systems documents. Existing retrieval methods cannot accurately retrieve relevant documents and text blocks, resulting in incomplete answers.

Method used

A two-stage retrieval and large-scale model approach is adopted to construct a summary knowledge base and a content knowledge base. A hybrid retrieval method using sparse vector and dense vector models is used to first retrieve the most relevant files, then retrieve the most relevant text blocks within the file range, and finally generate the answer using the large-scale model.

Benefits of technology

Within a timeframe acceptable to users, the accuracy and comprehensiveness of the Q&A section on rules and regulations have been improved, resulting in more accurate answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807346B_ABST
    Figure CN119807346B_ABST
Patent Text Reader

Abstract

The application discloses a kind of rules and regulations intelligent question and answer method and device based on two-stage search and big model, belongs to the intelligent question and answer field based on rules and regulations file, including the following steps: file abstract extraction is carried out to each file based on big model question and answer form, abstract vector library is constructed;Again, all files are cut and blocked, and all text blocks are vectorized using sparse vector model and dense vector model, and content vector library is constructed;The most relevant file to the user's question is retrieved in the first stage, and the two vector libraries are retrieved using a hybrid retrieval method.The top K most relevant files are obtained by weighting calculation of the two retrievals;The most relevant text block to the user's question is retrieved in the second stage, and the top k most relevant text blocks are obtained by hybrid retrieval;When answering, the top k most relevant text blocks are used as reference text, and the big model answers based on the reference text.The application can generate more accurate answers.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of intelligent question answering based on regulatory documents, and more specifically, to a regulatory intelligent question answering method and device based on two-stage retrieval and large models. BACKGROUND

[0002] With the continuous development of enterprises and the continuous expansion of businesses, the internal regulatory document files of enterprises will continue to accumulate. Generally, enterprises will only simply store the regulatory document files in a database. When employees have business needs, new employees need to consult relevant regulations, it is often cumbersome and cannot immediately obtain an answer, and can only slowly consult relevant personnel or themselves search for files in a needle-in-a-haystack manner.

[0003] The existing regulatory intelligent question answering technology: the intelligent question answering method based on retrieval enhancement generation technology, with the development of large model technology, most of the existing regulatory question answering is realized by retrieval enhancement generation (RAG). First, a knowledge base is constructed, all files are cut into a plurality of text blocks, the text blocks are vectorized and stored in a vector database, then reference content is obtained by vector retrieval in the knowledge base according to user questions, and finally the reference content and user questions are given to a large model to let the large model answer the user's questions based on the reference content. However, in the retrieval content stage, due to the problems of multiple and disordered files in the regulatory documents, the retrieval method is not optimized for the regulatory field alone, resulting in low retrieval accuracy of the existing technology. Moreover, for the question answering of the regulatory documents, the existing retrieval scheme will lead to the retrieval of a plurality of text blocks of files, resulting in the reference text given to the large model having many irrelevant text blocks, and further resulting in the generated answer sometimes not answering the question or not being comprehensive. SUMMARY

[0004] The present application aims to overcome the shortcomings of the prior art and provide a regulatory intelligent question answering method and device based on two-stage retrieval and large models, which can generate more accurate answers.

[0005] The purpose of the present application is achieved by the following scheme:

[0006] A regulatory intelligent question answering method based on two-stage retrieval and large models, comprising:

[0007] S1, constructing a knowledge base: based on the large model question answering form, extracting a file summary from each file to construct an abstract vector library; then cutting and blocking all files, and respectively vectorizing the text blocks using a sparse vector model and a dense vector model to obtain corresponding sparse vectors and dense vectors to construct a content vector library;

[0008] S2, two-stage retrieval: during retrieval, a two-stage retrieval strategy is adopted, the first stage retrieves the most relevant files to the user's question, a mixed retrieval method of sparse vector retrieval and dense vector retrieval is adopted to retrieve the two vector libraries, and the top K most relevant files are obtained by weighted calculation of the two retrievals; the second stage retrieves the most relevant text blocks to the user's question, and the top k most relevant text blocks are obtained by mixed retrieval.

[0009] S3, when answering, the top k most relevant text blocks are used as reference texts, and the large model answers based on the reference texts.

[0010] Further, in step S1, the file summary is constructed based on the large model question and answer form for each file, and the abstract vector library is constructed; then all files are cut into blocks, and all text blocks are vectorized by sparse vector model and dense vector model to obtain corresponding sparse vector and dense vector, and the content vector library is constructed, which includes the following sub-steps:

[0011] S11: use the large model to extract the summary of each file, and input the content of each file into the large model as reference text to generate summary content based on the reference text;

[0012] S12: use the sparse vector model and the dense vector model to perform vector embedding operation on the summary content to generate vector data V s and V d ; store in the abstract_db library of Mongodb in the form of {abstract text content, file name}, and store in the abstract_db library of Milvus in the form of {V s , V d , file name}, and the abstract knowledge base is constructed;

[0013] S13: cut each file into several text blocks in turn, and divide the text content from the semantic point of view;

[0014] S14: use the sparse vector model and the dense vector model to perform vector embedding operation on each text block to generate vector data V s and V d ; store in the content_db library of Mongodb in the form of {text block content, file name}, and store in the content_db library of Milvus in the form of {V s , V d , file name}, and the content knowledge base is constructed.

[0015] Further, in step S2, the retrieval is performed in two stages. In the first stage, the most relevant files to the user's question are retrieved. A mixed retrieval method of sparse vector retrieval and dense vector retrieval is used to retrieve the two vector libraries. The top K most relevant files are obtained by weighting calculation. In the second stage, the most relevant text blocks to the user's question are retrieved. The top k most relevant text blocks are obtained by using the mixed retrieval method. The specific steps include:

[0016] S21: Perform vector embedding on the user's question content using the sparse vector model and the dense vector model to obtain a question vector set V q = {V qs ,V qd};

[0017] S22: Use a mixed retrieval method of sparse vector retrieval and dense vector retrieval to perform vector search in the summary knowledge base and the content knowledge base to obtain the top k1 relevant results and the top k2 relevant results. Define a text block retrieval result in the summary knowledge base as U abstract_i = {Sa,Aa,Fa}, where i is the index of the result, Sa is the score, Aa is the summary content, and Fa is the corresponding file name. Define a text block retrieval result in the content knowledge base as U content_i = {St,Tt,Ft}, where i is the index of the result, St is the score, Tt is the text block content, and Ft is the corresponding file name.

[0018] S23: Perform weighting processing on the search results to obtain the most relevant file set.

[0019] S24: Second stage retrieval: In the most relevant file range content, use mixed retrieval to search in the content knowledge base to obtain the most relevant text blocks. In the first stage, search the top k relevant text blocks to the user's question in the filtered file set, and eliminate the results with scores lower than the set value. After two-stage retrieval, the retrieved text blocks are spliced to form a reference text, which is transmitted to the large model. The large model gives an answer to the user's question based on the reference text.

[0020] Further, in step S23, the search results are weighted to obtain the most relevant file set, which includes the following sub-steps:

[0021] S231: In units of files, obtain the corresponding U abstract and U content for each file to obtain a result set U result = {U abstract_1 ,U abstract_2 ,…,U abstract_n1 ,U content_1 ,Ucontent_2 ,…,U content_n2};

[0022] S232: Calculate a file score for each file based on the result set of each file, and the calculation method is: W a *(U abstract_1 +U abstract_1 +…+U abstract_1 )+W t *(U content_1 +U content_2 +…+U content_n2 ) / N(U result ), wherein W a is the result weight of the summary knowledge base, W t is the result weight of the content knowledge base, and N(U result ) is the number of elements of U result ;

[0023] S233: Calculate the file score for each file, and take out after sorting according to the file score.

[0024] Further, in step S22, k1=k2=15, the range of Sa is between [0, 1], and the range of St is between [0, 1].

[0025] Further, in step S24, k is 10, and the set value is 0.3.

[0026] Further, in step S232, W a =0.4, and W t is 0.6.

[0027] Further, in step S233, the sorting according to the file score is specifically from high to low.

[0028] Further, after sorting from high to low, the taking out after sorting according to the file score is specifically taking the top 30% of files, and at least taking 1 file.

[0029] A regulation intelligent question and answer device based on two-stage retrieval and a large model, comprising a processor and a memory, the memory stores a computer program, when the computer program is loaded by the processor, the method as claimed in any one of the above is executed.

[0030] The beneficial effects of the present application include:

[0031] Compared with the existing intelligent question answering method based on retrieval enhancement generation technology, the application obtains more accurate text blocks for user questions by constructing an abstract knowledge base and a content knowledge base, adopting two-stage retrieval, and obtaining more accurate answers based on the text blocks within the time range acceptable to the user. BRIEF DESCRIPTION OF DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0033] Figure 1 The knowledge base construction step diagram of the embodiment of the present application;

[0034] Figure 2 The two-stage retrieval process of the embodiment of the present application. DETAILED DESCRIPTION

[0035] All features disclosed in all examples in the specification, or all steps in the methods or processes impliedly disclosed, can be combined and / or extended, replaced, unless mutually exclusive features and / or steps.

[0036] The specific implementation process of the present application is as follows:

[0037] In order to solve the problem that the prior art cannot accurately and comprehensively retrieve relevant files and text block content in the regulation and system question answering process, and there is also the problem that irrelevant text blocks are retrieved to interfere with the final answer result, the present application proposes a regulation and system intelligent question answering method based on two-stage retrieval and large model. In the retrieval stage, the prior art will only retrieve the first k relevant text blocks by one step, and these k relevant text blocks are the reference text passed to the large model subsequently.

[0038] The method of the present application first constructs a knowledge base, and based on the large model question answering form, it performs file abstraction on each file to construct an abstract vector library. Secondly, all files are cut into blocks, and all text blocks are vectorized using sparse vector model and dense vector model to obtain corresponding sparse vectors and dense vectors, and a content vector library is constructed. The purpose of this is to lay a foundation for the subsequent retrieval stage.

[0039] In retrieval, a two-stage retrieval strategy is adopted. The first stage aims to retrieve the most relevant files to the user's question. Hybrid retrieval (sparse vector retrieval + dense vector retrieval) is used to retrieve two vector libraries. The top K most relevant files are obtained by weighting the retrieval results. The second stage aims to retrieve the most relevant text blocks to the user's question. Since the first stage has narrowed down the file range, this stage can obtain more relevant texts without interference from other irrelevant files. This stage also uses hybrid retrieval to obtain the top k most relevant text blocks.

[0040] In answering, the top k most relevant text blocks are used as reference texts, and the large model answers based on the reference texts.

[0041] Further, the following contents are included:

[0042] 1. Constructing a knowledge base

[0043] The knowledge base is a container that carries knowledge. In the field of regulatory system Q&A, the knowledge base includes all the contents of a company's regulatory system. To answer questions about regulations more accurately, the invention uses a mongodb document database and a milvus vector database to build a knowledge base. Text blocks are stored as units. Mongodb stores text block text content, and milvus vector database stores vectorized data of text blocks. The invention builds two knowledge bases. One is an abstract knowledge base. The abstract of a file is a highly compressed version of the file's content, which helps to more accurately find relevant files to the user's question. The other is a content knowledge base that stores text block information. It helps to find relevant text blocks to the user's question, such as Figure 1 as shown, specifically including the following steps:

[0044] Step 1: Use a large model to extract an abstract from each file. Pass the content of each file to the large model as a reference text, and let the large model generate an abstract based on the reference text.

[0045] Step 2: Use sparse vector models and dense vector models to perform vector embedding operations on the abstract content to generate vector data V s and V d . Store in the abstract_db library of Mongodb in the form of {abstract text content, file name}, and in the abstract_db library of Milvus in the form of {V s , V d , file name}. The abstract knowledge base is complete.

[0046] Step 3: Cut each file into several text blocks in turn. Divide the text content from a semantic perspective.

[0047] Step4: Vector embedding operation is performed on each text block using the sparse vector model and the dense vector model to generate vector data V s and V d . The {text block content, file name} is stored in the content_db library of Mongodb, and the {V s , V d , file name} is stored in the content_db library of Milvus. The content knowledge base is completed.

[0048] 2. Two-stage retrieval

[0049] The retrieval step is the most core step in the whole regulation and system intelligent question and answer process. If the relevant content cannot be accurately retrieved, the answer result will be irrelevant. In order to be able to cope with the needs of the regulation and system retrieval scene, the present application proposes a two-stage retrieval method, the first stage is used to search the most relevant files, and the second stage is used by the user to search the most relevant text block content in the most relevant files. No matter what stage, the present application adopts a mixed retrieval method of sparse vector retrieval + dense vector retrieval to perform retrieval, the sparse vector retrieval focuses on keyword matching, and the dense vector retrieval focuses on deeper semantic matching, and the two retrieval methods can more accurately search the results related to the user's question, as shown in Figure 2 , specifically comprising the following steps:

[0050] Step 1: Vector embedding is performed on the user's question content using the sparse vector model and the dense vector model to obtain a question vector set V q ={V qs , V qd}.

[0051] Step 2: A mixed retrieval method of sparse vector retrieval + dense vector retrieval is adopted to perform vector search in the summary knowledge base and the content knowledge base respectively to obtain the most k1 relevant results and the most k2 relevant results, wherein k1=k2=15. A text block retrieval result in the summary knowledge base is defined as U abstract_i ={Sa, Aa, Fa}, wherein i is the index of the result, Sa is the score, the range is between [0, 1], Aa is the summary content, and Fa is the corresponding file name. A text block retrieval result in the content knowledge base is defined as U content_i ={St, Tt, Ft}, wherein i is the index of the result, St is the score, the range is between [0, 1], Tt is the text block content, and Ft is the corresponding file name.

[0052] Step 3: The search results are weighted to obtain the most relevant file set.

[0053] Since the goal of the first stage retrieval is to find the most relevant documents, and the number of documents in the document set must be accurate and relevant, the search results of Step2 need to be processed. The processing steps are described as follows:

[0054] Step3.1: In units of documents, get the corresponding U abstract and U content for each document, and get a result set U result corresponding to each document. abstract_1 = {U abstract_2 , U abstract_n1 , …, U content_1 , U content_2 , …, U content_n2}.

[0055] Step3.2: Based on the result set of each document, calculate a document score for each document. The calculation method is: W a *(U abstract_1 +U abstract_1 +…+U abstract_1 )+W t *(U content_1 +U content_2 +…+U content_n2 ) / N(U result ), where W a is the weight of the summary knowledge base result, W t is the weight of the content knowledge base result, here W a = 0.4, W t = 0.6, and N(U result ) is the number of elements in U result .

[0056] Step3.3: Calculate the document score for each document, sort the documents from high to low, and take the top 30% of the documents, at least one document.

[0057] Step4: This step is the second stage retrieval. In the context of the most relevant documents, hybrid retrieval is used to search in the content knowledge base to get the most relevant text blocks. The purpose of this stage is to retrieve the top k text blocks most relevant to the user's question from the document set filtered in the first stage, where k is 10, and remove results with a score less than 0.3.

[0058] After two-stage retrieval, the retrieved text blocks are spliced together as reference text and passed to the large model, and the large model gives the answer to the user's question based on the reference text.

[0059] In other embodiments, the present application provides a two-stage retrieval and large model-based regulatory system intelligent question answering method, which has three main steps:

[0060] First, build a knowledge base based on existing regulatory documents;

[0061] Second, use two-stage retrieval to search the most relevant text blocks as reference texts.

[0062] Third, let the large model give answers to user questions based on reference texts.

[0063] 1. Build a knowledge base

[0064] As shown in the following steps of a specific example: Figure 1

[0065] Step 1: Use the large model to extract summaries from each file. Pass the content of each file as a reference text to the large model to generate summary content based on the reference text. The prompt words are as follows, {ref_text} is the full text content of the file:

[0066] #text content

[0067] {ref_text}

[0068] #task

[0069] Extract the text summary according to <text content>.

[0070] Step 2: Use the sparse vector model and dense vector model to perform vector embedding operations on the summary content to generate vector data V s and V d . Store in the abstract_db library of Mongodb in the form of {summary text content, file name}, and in the abstract_db library of Milvus in the form of {V s , V d , file name}. The summary knowledge base is complete.

[0071] Step 3: Cut each file into several text blocks in turn. Divide the text content from a semantic point of view.

[0072] Step 4: Use the sparse vector model and dense vector model to perform vector embedding operations on each text block to generate vector data V s and V d . Store in the content_db library of Mongodb in the form of {text block content, file name}, and in the content_db library of Milvus in the form of {V s , V d , file name}. The content knowledge base is complete.

[0073] ​2. Two-stage retrieval, the specific steps are as shown in Figure 2

[0074] Step 1: Sparse vector model and dense vector model are used to embed the user question content into vectors to obtain a question vector set V q = {V qs , V qd}. For example, the question is "What is the division of leadership?", Vq = {[0.8, 0.2, 0.6, …}, [0.1, 0.8, 0.7, 1.0, …]}.

[0075] Step 2: A mixed retrieval method of sparse vector retrieval + dense vector retrieval is used to search vectors in the summary knowledge base and the content knowledge base respectively to obtain the top k1 relevant results and the top k2 relevant results, where k1 = k2 = 15. Define a text block retrieval result in the summary knowledge base as U abstract_i = {Sa, Aa, Fa}, where i is the index of the result, Sa is the score, ranging between [0, 1], Aa is the summary content, and Fa is the corresponding file name. Define a text block retrieval result in the content knowledge base as U content_i = {St, Tt, Ft}, where i is the index of the result, St is the score, ranging between [0, 1], Tt is the text block content, and Ft is the corresponding file name.

[0076] Step 3: The search results are processed to obtain the most relevant file set.

[0077] Since the goal of the first-stage retrieval is to obtain the most relevant files, and the number of files in the file set must be accurate and relevant, the search results of Step 2 need to be processed. The processing steps are as follows:

[0078] Step 3.1: In file units, obtain the corresponding U abstract and U content for each file to obtain a result set U result = {U abstract_1 , U abstract_2 , …, U abstract_n1 , U content_1 , U content_2 , …, U content_n2} for each file.

[0079] Step 3.2: Based on the result set of each file, calculate a file score for each file. The calculation method is: W a *(U abstract_1 + U abstract_1 + … + U abstract_1 ) + W t *(U​content_1 +U content_2 +…+U content_n2 ) / N(U result ), wherein W a is the abstract knowledge base result weight, W t is the content knowledge base result weight, and here W a = 0.4 and W t is 0.6, and N(U result ) is the number of elements of U result .

[0080] Step 3.3: Calculate the file score for each file, sort the files from high to low, and take the top 30% of the files, at least 1 file.

[0081] Step 4: This step is the second stage of retrieval. In the most relevant file range content, hybrid retrieval is used to search in the content knowledge base to get the most relevant text blocks. The purpose of this stage is to search for the top k relevant text blocks from the user's question in the file set filtered in the first stage, where k is 10, and remove the results with a score lower than 0.3. For example, there are 10 relevant text blocks, and the scores of 2 text blocks are lower than 0.3, so the final output to the large model is only 8 text blocks.

[0082] The large model generates an answer, merges the text content of the text blocks retrieved in the two stages into one reference text, and lets the large model answer the user's question based on the reference question. The prompt words are as follows, where {ref_text} is the reference text and {question} is the user's question:

[0083] #Reference text

[0084] {ref_text}

[0085] #Task

[0086] Based on the reference text, answer the following question, which is:

[0087] {question}

[0088] The units involved in the embodiments of the present application can be implemented in software or hardware, and the described units can also be set in a processor. In some cases, the names of these units do not constitute a limitation on the units themselves.

[0089] According to an aspect of an embodiment of the present application, there is provided a computer program product or computer program, comprising computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various optional implementation manners described above.

[0090] As another aspect, the embodiment of the present application further provides a computer readable medium, which can be included in the electronic device described in the above embodiments, or can exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to implement the method described in the above embodiments.

Claims

1. A two-stage retrieval and large model-based regulatory system intelligent question and answer method, characterized by, Comprise: S1, constructing a knowledge base: based on large model question and answer form, file summary extraction is performed on each file to construct an abstract vector library; all files are then cut into blocks, and all text blocks are vectorized using a sparse vector model and a dense vector model to obtain corresponding sparse vectors and dense vectors, and a content vector library is constructed; S2, two-stage retrieval: in retrieval, a two-stage retrieval strategy is adopted, the first stage retrieves the most relevant files to the user's question, and a mixed retrieval method of sparse vector retrieval and dense vector retrieval is used to retrieve the two vector libraries, and the top K most relevant files are obtained by weighted calculation; The second stage retrieves the most relevant text blocks to the user's question, and the top k most relevant text blocks are obtained by using a mixed retrieval method; In step S2, the two-stage retrieval strategy is adopted in retrieval, the first stage retrieves the most relevant files to the user's question, and a mixed retrieval method of sparse vector retrieval and dense vector retrieval is used to retrieve the two vector libraries, and the top K most relevant files are obtained by weighted calculation; The second stage retrieves the most relevant text blocks to the user's question, and the top k most relevant text blocks are obtained by using a mixed retrieval method, which specifically includes the following steps: S21: adopt the sparse vector model and the dense vector model to carry out vector embedding to the user question content, obtain a question vector set V q ={V qs ,V qd} S22: using a mixed retrieval method of sparse vector retrieval and dense vector retrieval, vector search is performed in the summary knowledge base and the content knowledge base respectively to obtain k1 most relevant results and k2 most relevant results; define a text block retrieval result in the summary knowledge base as U abstract_i ={Sa,Aa,Fa}, where i is the index of the result, Sa is the score, Aa is the summary content, and Fa is the corresponding file name; define a text block retrieval result in the content knowledge base as U content_i ={St,Tt,Ft}, where i is the index of the result, St is the score, Tt is the text block content, and Ft is the corresponding file name; S23: The search results are weighted and processed to obtain the most relevant file set; S24: The second stage retrieval: in the most relevant file range content, a mixed retrieval is performed in the content knowledge base to obtain the most relevant text blocks; the top k relevant text blocks to the user's question are retrieved from the file set screened in the first stage, and the results with scores lower than the set value are removed; after two-stage retrieval, the retrieved text blocks are spliced to form a reference text, which is transmitted to the large model to let the large model give an answer to the user's question based on the reference text; S3, in answering, the top k most relevant text blocks are used as reference text, and the large model answers based on the reference text.

2. The two-stage retrieval and large model based regulatory compliance intelligent question answering method according to claim 1, characterized in that, In step S1, the abstract vector library is constructed based on the large model question and answer form, and the content vector library is constructed by cutting and blocking all files and vectorizing all text blocks using a sparse vector model and a dense vector model, specifically including the following steps: S11: Extract the abstract from each file using a large model, and use the content of each file as a reference text to transmit to the large model to generate abstract content based on the reference text; S12: Vector embedding operation is performed on the summary content using the sparse vector model and the dense vector model to generate vector data V s and V d ; and stored in the abstract_db library of Mongodb in the form of {abstract text content, file name}, and stored in the abstract_db library of Milvus in the form of {V s , V d , file name}, and the summary knowledge base is completed; S13: Cut each file into several text blocks in sequence, and divide the text content from a semantic perspective; S14: Perform vector embedding operation on each text block using sparse vector model and dense vector model to generate vector data V s and V d ; store in the content_db library of Mongodb in the form of {text block content, file name}, and store in the content_db library of Milvus in the form of {V s , V d , file name}, and the content knowledge base is completed.

3. The two-stage retrieval and large model based regulation intelligent question answering method according to claim 1, characterized in that, In step S23, the search results are weighted and processed to obtain the most relevant file set, specifically including the following steps: S231: acquire the U corresponding to each file in units of files abstract and U content , get a result set U corresponding to each file result ={U abstract_1 , U abstract_2 ,…, U abstract_n1 , U content_1 , U content_2 ,…,U content_n2}; S232: Based on the result set of each file, a file score is calculated for each file in the following manner: W a *( U abstract_1 + U abstract_1 +…+ U abstract_1 ) / N(U t ), where W content_1 is the abstract knowledge base result weight, W content_2 is the content knowledge base result weight, and N(U content_n2 ) is the number of elements of U result . a t result result ​​​​ S233: Calculate the file score of each file, and sort the files according to the file score.

4. The two-stage retrieval and large model based regulatory compliance intelligent question answering method according to claim 1, characterized in that, In step S22, k1=k2=15, Sa is in the range of [0, 1], and St is in the range of [0, 1].

5. The two-stage retrieval and large model based regulatory compliance intelligent question answering method according to claim 1, characterized in that, In step S24, k is 10, and the set value is 0.

3.

6. The two-stage retrieval and large model based regulatory intelligent Q&A method of claim 3, wherein, In step S232, W a = 0.4, W t = 0.

6.

7. The two-stage retrieval and large model based regulation intelligent question answering method according to claim 3, characterized in that, In step S233, the file score sorting is specifically from high to low.

8. The two-stage retrieval and large model based regulatory intelligent Q&A method according to claim 7, characterized in that, After sorting from high to low, the specific top 30% of files are taken out after sorting by file score, and at least 1 file is taken.

9. A regulation intelligent question and answer device based on two-stage retrieval and large model, characterized in that, The computer program product comprises a processor and a memory, and the memory stores the computer program. When the computer program is loaded by the processor, the method in any one of claims 1-8 is executed.

Citation Information

Patent Citations

  • Large language model training method and device, computer equipment and storage medium

    CN117473065A

  • Retrieval enhanced intelligent question answering method and system based on large model

    CN118503392A