Method and device for recalling document knowledge with fixed format
By performing chapter/section/section analysis and vectorization of documents with fixed formats, combining RAG structure and LLM model, the problem of low knowledge recall efficiency in the existing technology is solved, and efficient and intelligent knowledge recall and answers are achieved. generate.
Patent Information
- Application Number
- CN202411056163.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-15
AI Technical Summary
The existing knowledge recall methods are inefficient and single in form, making it difficult to effectively extract useful information from massive data.
The document knowledge recall method with a fixed format is adopted, and the document is parsed and vectorized at chapter/section level, combined with the RAG structure and LLM model, efficient knowledge retrieval and recall are achieved.
It improves the efficiency and accuracy of knowledge recall, provides more accurate and intelligent answers, supports semantic-related data storage and retrieval, and enhances the system's semantic understanding and answer generation capabilities.
Smart Images

Figure CN118964691A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present invention relate to network communication technology, and more particularly, to a method and device for recalling document knowledge in a fixed format. Background Art
[0002] With the continuous development of human society, the generation of data is growing exponentially. In such an era of big data, people hope to extract more useful information from massive data through AI big model technology to solve various complex problems. The core of AI big model knowledge retrieval technology is to use artificial intelligence technology to search the knowledge base, and by allowing the machine to understand and analyze a large amount of text information, it can quickly and accurately find the knowledge required by users.
[0003] At present, various data in the data source are usually stored as knowledge in a database. Later, when the user needs to retrieve a piece of data or a piece of knowledge, he can search from the various types of knowledge pre-stored in the database, find the answer the user needs, and provide it to the user, thereby realizing knowledge recall.
[0004] However, the current knowledge recall methods have problems such as low efficiency and single form. Summary of the invention
[0005] One or more embodiments of the present invention describe a method and device for recalling document knowledge in a fixed format, which can provide answers to users more efficiently and intelligently.
[0006] According to a first aspect, a method for recalling document knowledge in a fixed format is provided, which obtains a document in a fixed format, parses text knowledge in the document, segments the parsed text content according to the fixed format of the document, vectorizes each segmented text unit and stores it in a vector database, and stores each segmented text unit in a corresponding JSON file; the method also includes:
[0007] Receive user input questions;
[0008] Vectorize the received problem;
[0009] Based on the vectorized questions, similarity matching is performed in the vector database;
[0010] If a match is found, the vector information matched in the vector database is converted into text data through a JSON file corresponding to the vector information;
[0011] Input the converted text data into the large language model LLM;
[0012] After LLM analyzes and summarizes the received text data, it outputs the answer to the question to the user.
[0013] The document with a fixed format includes at least one of the following: a legal document with chapters / sections / articles, a regulatory document with chapters / sections / articles, a policy document with chapters / sections / articles, and a system document with chapters / sections / articles;
[0014] The segmenting of the parsed text content according to the fixed format of the document includes:
[0015] The document is divided into chapters / sections / articles, and the text content of each chapter / section / article is regarded as a text unit;
[0016] Finding the name list testimony of the document in each segmented text unit; and
[0017] Replace the name table testimony of the found document with the complete name of the document in a fixed format.
[0018] The name list testimony of the document includes at least one of the following: this law, this regulation, this law, this system, this provision, and this article.
[0019] After replacing the name table testimony of the found document with the complete name of the document having a fixed format, the method further includes: parsing each text unit into a CSV file, wherein the CSV file has two column fields, one is the article position index, and the other is the specific article content;
[0020] The vectorization processing of the segmented text units and the storage in the vector database includes:
[0021] The CSV file is vectorized and stored in the vector database.
[0022] The vector database includes: a faiss vector library.
[0023] The method further includes: associating the vector data corresponding to each text unit in the vector database with the JSON file corresponding to the text unit through the position index;
[0024] After matching a vector information for the problem, the JSON file corresponding to the matched vector information in the vector database is determined through the position index of the vector information.
[0025] The step of inputting the converted text data into the LLM comprises:
[0026] The transformed text data is used as reference to generate interaction templates;
[0027] The interaction template is input into the LLM, the LLM is guided to analyze and summarize according to the interaction module, and the answer is output in the form of a specific type of question and answer response.
[0028] The system further includes: providing an interface interaction function, so that users can like, dislike and evaluate the answers provided by the system, so that administrators can view feedback through the data display interface and improve the knowledge base;
[0029] and / or,
[0030] When the answer to the question is output to the user, a reference source is added at the end of the sentence, and clicking on a specific reference source will output the original text of the document with a fixed format.
[0031] According to a second aspect, a device for recalling document knowledge having a fixed format is provided, the device comprising:
[0032] An interface interaction module, configured to provide an interaction interface to the user and receive questions input by the user on the interaction interface;
[0033] The knowledge base generation module is configured to parse the text knowledge in the obtained document with a fixed format, segment the parsed text content according to the fixed format of the document, vectorize each segmented text unit and store it in a vector database, and store each segmented text unit in a corresponding JSON file;
[0034] The knowledge base retrieval module is configured to vectorize the questions received by the interface interaction module; perform similarity matching in the vector database according to the vectorized questions; if a match can be found, for the vector information matched in the vector database, convert the vector information into text data through a JSON file corresponding to the vector information; and input the converted text data into the large language model LLM;
[0035] The LLM interactive module is configured to trigger the LLM to analyze and summarize the received text data, and then output the answer to the question to the user on the interactive interface.
[0036] According to a third aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in any embodiment of the present invention is implemented.
[0037] The recall method and device for document knowledge with a fixed format provided by the embodiment of the present invention combine the RAG structure with the LLM model to solve the storage, retrieval and recall of document knowledge with a fixed format, making the entire recall process efficient and intelligent.
[0038] In an embodiment of the present invention, a document with a fixed format may include at least one of the following: a legal document with chapters / sections / articles, a regulatory document with chapters / sections / articles, a policy document with chapters / sections / articles, and an institutional document with chapters / sections / articles. Because these documents have clear divisions of chapters / sections / articles (i.e., clauses), more accurate semantically strongly related text units can be obtained during word segmentation. After vectorization of such text units, they are stored in a vector database. In terms of knowledge storage, semantically strongly related data can be corresponded to a vector, thereby providing users with more accurate answers during subsequent retrieval and answer provision. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 It is a flowchart of a method for recalling document knowledge with a fixed format in one embodiment of the present invention.
[0041] Figure 2 Schematic diagram of a method for recalling document knowledge having a fixed format in one embodiment of the present invention.
[0042] Figure 3 It is a structural diagram of a recall device for document knowledge with a fixed format in one embodiment of the present invention. DETAILED DESCRIPTION
[0043] With the rapid development and rapid popularization of big models, artificial intelligence technology has reached new heights. Using big models to build more efficient and intelligent information systems has become the current mainstream architectural design solution. The present invention considers embedding big models into intelligent question-answering assistants, which will greatly enhance the system's semantic understanding, knowledge reasoning and answer generation capabilities. RAG (Retrieval Augmented Generation) is a technology that combines information retrieval and natural language generation. It aims to improve the efficiency and quality of information retrieval and generation in natural language processing tasks. It is the current mainstream big model embedding mode.
[0044] Therefore, the present invention considers that for documents with fixed formats, such as policies, laws, regulations, etc., an intelligent question-answering assistant system can be built based on the RAG architecture with the help of a large language model (LLM), and artificial intelligence technology can be used to give it natural language understanding capabilities. It can realize humanized acquisition of relevant information in the document library during question-answering interactions, making information query more efficient and intelligent.
[0045] First of all, it should be noted that the terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise.
[0046] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0047] Figure 1 FIG. 1 is a flowchart of a method for recalling document knowledge having a fixed format in one embodiment of the present invention. Figure 1 , the method comprising:
[0048] Step S1: Obtain a document with a fixed format and parse the text knowledge in the document.
[0049] Step S3: segment the parsed text content according to the fixed format of the document.
[0050] Step S5: vectorize each segmented text unit and store it in a vector database.
[0051] Step S7: Store each segmented text unit into a corresponding JSON (JavaScript Object Notation) file.
[0052] The above steps S1, S3, S5 and S7 are preprocessing processes, through which knowledge storage is performed on documents with a fixed format.
[0053] Step 101: Receive a question input by a user.
[0054] Step 103: vectorize the received question.
[0055] Step 105: Perform similarity matching in the vector database based on the vectorized question.
[0056] Step 107: If a match is found, the vector information matched in the vector database is converted into text data through a JSON file corresponding to the vector information.
[0057] Step 109: Input the converted text data into the large language model LLM.
[0058] Step 111: After LLM analyzes and summarizes the received text data, it outputs the answer to the question to the user.
[0059] according to Figure 1 From the method of the embodiment of the present invention shown, it can be seen that the embodiment of the present invention combines the RAG structure with the LLM model to solve the storage, retrieval and recall of document knowledge with a fixed format, making the entire recall process efficient and intelligent.
[0060] In an embodiment of the present invention, a document with a fixed format may include at least one of the following: a legal document with chapters / sections / articles, a regulatory document with chapters / sections / articles, a policy document with chapters / sections / articles, and an institutional document with chapters / sections / articles. Because these documents have clear divisions of chapters / sections / articles (i.e., clauses), more accurate semantically strongly related text units can be obtained during word segmentation. After vectorization of such text units, they are stored in a vector database. In terms of knowledge storage, semantically strongly related data can be corresponded to a vector, thereby providing users with more accurate answers during subsequent retrieval and answer provision.
[0061] Combine the following Figure 2 ,right Figure 1 Each of the steps shown is explained separately.
[0062] First, in step S1: a document with a fixed format is obtained, and text knowledge in the document is parsed.
[0063] Here, the document with a fixed format may include at least one of the following: a legal document with chapters / sections / articles, a regulatory document with chapters / sections / articles, a policy document with chapters / sections / articles, and an institutional document with chapters / sections / articles.
[0064] For example, in step S1, a document of Regulation 1 is obtained, triggering the parsing of text knowledge in the document. For example, the name of Regulation 1 is "Regulations on the Management of Indoor Smoking in Province A".
[0065] Step S3: segment the parsed text content according to the fixed format of the document.
[0066] An implementation process of step S3 includes:
[0067] Step S31: segment the document according to its chapters / sections / articles, with the text content of each chapter / section / article being regarded as a text unit;
[0068] Step S33: searching for the name table testimony of the document in each segmented text unit; and
[0069] Step S35: Replace the name table testimony of the found document with the complete name of the document with a fixed format.
[0070] In a legal document with chapters / sections / articles, a regulatory document with chapters / sections / articles, a policy document with chapters / sections / articles, and a system document with chapters / sections / articles, it is very likely that a name list testimony of a document such as this law, this regulation, this regulation, this system, this provision, this article, etc. will appear in the content of a clause, so that the current document can be referred to by the name list testimony of the document. In order to ensure the accuracy of subsequent searches and output answers, in the above step S35, the name list testimony of the found document is replaced with the full name of the document with a fixed format. For example, if "this regulation" appears in Article 3 of Regulation 1, then for the segmented text unit corresponding to Article 3, "this regulation" is replaced with the full name of Regulation 1 "Province A's Regulations on the Management of Indoor Smoking".
[0071] Next, in step S5, each segmented text unit is vectorized and stored in a vector database.
[0072] In the above step S35, after replacing the name table testimony of the found document with the complete name of the document with a fixed format, the method further includes: parsing each text unit into a CSV file, which has two column fields, one is the article position index, and the other is the specific article content.
[0073] Then, in this step S5, each segmented text unit is vectorized and stored in a vector database, including: the CSV file is vectorized and stored in a vector database.
[0074] In an embodiment of the present invention, the vector database may be a faiss vector database.
[0075] Next, in step S7: each segmented text unit is stored in a corresponding JSON (JavaScript Object Notation) file.
[0076] For example, in one embodiment of the present invention, the parsing logic of the preprocessing process of the above steps S1 to S7 is: first obtain the text content in the document, then split it by "Article xx", and replace "this law", "this regulation", etc. with the specific names of laws and regulations, and finally generate a corresponding CSV file, which has two column fields, one is the article index, and the other is the specific article content. The next step is to vectorize the parsed CSV file content and store it in the faiss vector library, that is, save the vector information in the index file of the faiss vector library, and maintain the corresponding JSON file at the same time, so that the vector data of each article is associated with the text data through the position index.
[0077] Next, step 101 is to receive a question input by a user.
[0078] For example, if a user needs to know the relevant regulations on indoor smoking in Province A, he can enter "Province A, smoking".
[0079] Next, for steps 103 to 105: the received question is vectorized, and similarity matching is performed in the vector database based on the vectorized question.
[0080] When performing similarity matching, we can pay attention to the value of two parameters: one is the similarity threshold, and the other is the expected number of data. The higher the similarity threshold and the less data is taken, the higher the accuracy requirement for matching, but the scalability of question answering will decrease. The understanding of scalability here can be linked to the LLM interaction stage.
[0081] Next, for step 107: for the vector information matched in the vector database, the vector information is converted into text data through the JSON file corresponding to the vector information.
[0082] In an embodiment of the present invention, the vector data corresponding to each text unit in the vector database can be associated with the JSON file corresponding to the text unit through a position index; thus, in this step 107, after a vector information is matched for the problem, the JSON file corresponding to the vector information matched in the vector database can be determined through the position index of the vector information.
[0083] Next, for step 109: input the converted text data into the LLM.
[0084] An implementation process of this step 109 includes: using the converted text data as reference material to generate an interaction template; inputting the interaction template into the LLM, guiding the LLM to analyze and summarize according to the interaction module, and outputting the answer in the form of a specific type of question and answer response.
[0085] It can be seen that in one embodiment of the present invention, the content retrieved from the knowledge base will not be directly returned as an answer to the question, but will be used as reference material when the large model generates the answer, that is, to construct a Prompt. In the large model interaction, Prompt is a key interaction method used to guide the model to generate a specific type of response. The Prompt template used by this system is: Please learn the following knowledge {………}, now, please have a deep understanding and answer the following questions, ensure that the answers are accurate and fluent, do not quote any background information, the question is {…………}. Among them, the content in the first {………} can be the text answer retrieved from the knowledge base, that is, the text data obtained in step 107, and the content in the second {………} can be the question entered by the user. Through this kind of Prompt template, LLM can perform more reasonable analysis and induction.
[0086] Next, in step 111 , the LLM analyzes and summarizes the received text data and outputs the answer to the question to the user.
[0087] In one embodiment of the present invention, when outputting the answer to the question to the user, a reference source is added at the end of the sentence, and clicking on a specific reference source will output the original text of the document in a fixed format. For example, when LLM answers, a reference source is attached at the end of the paragraph, such as "Article 11 of the Labor Contract Law of the People's Republic of China". Clicking on the reference source field can view the original text, and the user can also enter "Search for Article 11 of the Labor Contract Law of the People's Republic of China" to view the original text.
[0088] In one embodiment of the present invention, it may further include: providing an interface interaction function, so that users can like, dislike and evaluate the answers provided by the system, so that administrators can view feedback through the data display interface and improve the knowledge base.
[0089] It can be seen that the methods of various embodiments of the present invention have the following characteristics and advantages:
[0090] 1. Provide users with search data in the form of questions and answers;
[0091] Support direct original text retrieval;
[0092] The system will format and parse the documents uploaded by users;
[0093] The knowledge base is maintainable;
[0094] The knowledge base consists of vector data and JSON data, and has a certain semantic understanding ability when retrieving data;
[0095] With the introduction of the big model, the system answers are more concise and accurate, with smooth semantics and the ability to understand the context;
[0096] Users can like or dislike the system answers and make comments. Administrators can view feedback through the data display interface and improve the knowledge base.
[0097] 2. There is no limit to the format of the questions asked by users, and users can ask any questions they want;
[0098] The search data obtained by users is understood and summarized by the big model, with smoother semantics, more concise answers and less redundant content;
[0099] Users can ask follow-up questions during the question-and-answer process, and multiple rounds of conversations are supported.
[0100] 3. For user questions, if relevant data is retrieved in the knowledge base, a reference source will be added at the end of the sentence after output. Clicking on a specific reference source will output the original text of the article;
[0101] Users can enter fixed-format search commands to obtain the original text of the article, such as "search for Article 12 of the Bidding Law of the People's Republic of China."
[0102] 4. The knowledge base supports adding or deleting a single piece of data, and can also add or delete all data corresponding to the entire file;
[0103] You can set the search output threshold of the knowledge base.
[0104] 5. Have a certain level of semantic understanding when retrieving data, including:
[0105] The similarity matching in the retrieval step is not a single character comparison. This system uses the BGE vectorization model to store document data in the form of vectors in the vector database. User questions are also vectorized, similarity matched, and the cosine similarity of the corresponding vectors is calculated. The characteristics of the BGE model enable the similarity matching process to support general semantic similarity matching.
[0106] 6. With the introduction of a large model, the system answers are more concise and accurate, with smooth semantics and the ability to understand context, including:
[0107] The data retrieved from the knowledge base and the questions asked by the user are constructed into prompts of corresponding formats and input into the large model to obtain refined system answers;
[0108] Based on the multi-round dialogue capability natively supported by the big model, the system's answers will also refer to historical dialogue records, enabling the question-and-answer assistant to have contextual understanding capabilities.
[0109] An embodiment of the present invention provides a recall device for document knowledge having a fixed format, see Figure 2 , the device comprises:
[0110] The interface interaction module 301 is configured to provide an interaction interface to the user and receive questions input by the user on the interaction interface;
[0111] The knowledge base generation module 302 is configured to parse the text knowledge in the obtained document with a fixed format, segment the parsed text content according to the fixed format of the document, vectorize each segmented text unit and store it in a vector database, and store each segmented text unit in a corresponding JSON file;
[0112] The knowledge base retrieval module 303 is configured to vectorize the questions received by the interface interaction module; perform similarity matching in the vector database according to the vectorized questions; if a match can be found, then for the vector information matched in the vector database, convert the vector information into text data through a JSON file corresponding to the vector information; and input the converted text data into the large language model LLM;
[0113] The LLM interaction module 304 is configured to trigger the LLM to analyze and summarize the received text data, and then output the answer to the question to the user on the interaction interface.
[0114] In one embodiment of the apparatus of the present invention, the document with a fixed format includes at least one of the following: a legal document with chapters / sections / articles, a regulatory document with chapters / sections / articles, a policy document with chapters / sections / articles, and a system document with chapters / sections / articles;
[0115] The knowledge base generation module 302 is configured to perform: when segmenting the parsed text content according to the fixed format of the document, segmenting the document according to the chapters / sections / articles, with the text content of each chapter / section / article as a text unit; searching for the name table testimony of the document in each segmented text unit; and replacing the name table testimony of the found document with the complete name of the document with the fixed format.
[0116] In one embodiment of the apparatus of the present invention, the name list testimony of the document includes at least one of the following: this law, this regulation, this law, this system, this provision, and this article.
[0117] In one embodiment of the device of the present invention, the knowledge base generation module 302 is configured to execute: after replacing the name table testimony of the found document with the complete name of the document with a fixed format, parsing each text unit into a CSV file, wherein the CSV file has two column fields, one is the article position index, and the other is the specific article content; the CSV file is vectorized and stored in a vector database.
[0118] In one embodiment of the device of the present invention, the vector database includes: a faiss vector library.
[0119] In one embodiment of the apparatus of the present invention, the knowledge base generation module 302 is configured to perform: associating the vector data corresponding to each text unit in the vector database with the JSON file corresponding to the text unit through the position index;
[0120] The knowledge base retrieval module 303 is configured to execute: after matching a vector information to a question, determine the JSON file corresponding to the matched vector information in the vector database through the position index of the vector information.
[0121] The knowledge base retrieval module 303 is configured to perform:
[0122] The transformed text data is used as reference to generate interaction templates;
[0123] The interaction template is input into the LLM, the LLM is guided to analyze and summarize according to the interaction module, and the answer is output in the form of a specific type of question and answer response.
[0124] The LLM interaction module 304 is configured to perform: providing an interface interaction function, allowing users to like, dislike and evaluate the answers provided by the system, allowing administrators to view feedback through the data display interface and improve the knowledge base.
[0125] The LLM interaction module 304 is configured to execute: when outputting the answer to the question to the user, adding a reference source at the end of the sentence, and clicking on a specific reference source will output the original text of the document with a fixed format.
[0126] It should be noted that the above-mentioned devices are usually implemented on the server side, and can be set on independent servers respectively, or some or all of the devices can be combined and set on the same server. The server can be a single server or a server cluster composed of multiple servers. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system. The above-mentioned devices can also be implemented on a computer terminal with strong computing power.
[0127] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed in a computer, the computer is caused to execute a method in any one of the embodiments in the specification.
[0128] An embodiment of the present invention provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method in any embodiment of the specification is implemented.
[0129] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the device of the embodiment of the present invention. In other embodiments of the specification, the above-mentioned device may include more or fewer components than those shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0130] The various embodiments of the present invention are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0131] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0132] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A recall method for document knowledge with a fixed format, characterized in that: Obtain a document with a fixed format, parse the text knowledge in the document, segment the parsed text content according to the fixed format of the document, vectorize each segmented text unit and store it in a vector database, and store each segmented text unit in a corresponding JSON file; The method further includes: Receive user input questions; Vectorize the received problem; Based on the vectorized questions, similarity matching is performed in the vector database; If a match is found, the vector information matched in the vector database is converted into text data through a JSON file corresponding to the vector information; Input the converted text data into the large language model LLM; After LLM analyzes and summarizes the received text data, it outputs the answer to the question to the user.
2. The method according to claim 1, characterized in that The document with a fixed format includes at least one of the following: a legal document with chapters / sections / articles, a regulatory document with chapters / sections / articles, a policy document with chapters / sections / articles, and a system document with chapters / sections / articles; The segmenting of the parsed text content according to the fixed format of the document includes: The document is divided into chapters / sections / articles, and the text content of each chapter / section / article is regarded as a text unit; Finding the name list testimony of the document in each segmented text unit; and The name table testimony of the found document is replaced with the full name of the document in a fixed format.
3. The method according to claim 2, characterized in that The name list testimony of the document includes at least one of the following: this law, this regulation, this law, this system, this provision, and this article.
4. The method according to claim 2, characterized in that: After replacing the name table testimony of the found document with the complete name of the document having a fixed format, the method further includes: parsing each text unit into a CSV file, wherein the CSV file has two column fields, one is the article position index, and the other is the specific article content; The vectorization processing of the segmented text units and the storage in the vector database includes: The CSV file is vectorized and stored in the vector database.
5. The method according to claim 1, characterized in that: The vector database includes: a faiss vector library.
6. The method according to claim 1, characterized in that The method further includes: associating the vector data corresponding to each text unit in the vector database with the JSON file corresponding to the text unit through the position index; After matching a vector information for the problem, the JSON file corresponding to the matched vector information in the vector database is determined through the position index of the vector information.
7. The method according to claim 1, characterized in that The step of inputting the converted text data into the LLM comprises: The transformed text data is used as reference to generate interaction templates; The interaction template is input into the LLM, the LLM is guided to analyze and summarize according to the interaction module, and the answer is output in the form of a specific type of question and answer response.
8. The method according to claim 1, characterized in that The system further includes: providing an interface interaction function, so that users can like, dislike and evaluate the answers provided by the system, so that administrators can view feedback through the data display interface and improve the knowledge base; and / or, When the answer to the question is output to the user, a reference source is added at the end of the sentence, and clicking on a specific reference source will output the original text of the document with a fixed format.
9. A recall device for document knowledge having a fixed format, characterized in that The device includes: An interface interaction module, configured to provide an interaction interface to the user and receive questions input by the user on the interaction interface; The knowledge base generation module is configured to parse the text knowledge in the obtained document with a fixed format, segment the parsed text content according to the fixed format of the document, vectorize each segmented text unit and store it in a vector database, and store each segmented text unit in a corresponding JSON file; The knowledge base retrieval module is configured to vectorize the questions received by the interface interaction module; perform similarity matching in the vector database according to the vectorized questions; if a match can be found, for the vector information matched in the vector database, convert the vector information into text data through a JSON file corresponding to the vector information; and input the converted text data into the large language model LLM; The LLM interactive module is configured to trigger the LLM to analyze and summarize the received text data, and then output the answer to the question to the user on the interactive interface.
10. A computing device, comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Bank domain question answering method, system and device based on local knowledge base
CN117520515A
Intelligent document question and answer method based on large model
CN117932018A
Knowledge base question and answer construction method and device based on large model
CN118035405A
Document analysis method and system based on large model
CN118133808A
LLM-based intelligent questioning and answering method, system and equipment in power field and medium
CN118277521A
Cited By
Knowledge base updating and deleting method and system based on industry large model
CN119807214A
Hierarchical document parsing and metadata generation for machine learning applications
US12393637B1
