Question and answer method based on file version relation meta-information

By constructing file relationships and vector storage, using vector matching and context time filtering, the existing Q&A system solves the recall problem when there are version files, and achieves more accurate Q&A results.

CN119248920AActive Publication Date: 2025-01-03SHANGHAI-CHONGQING ARTIFICIAL INTELLIGENCE RES INST
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411401585.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-03
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

When existing question and answer systems deal with files with version relationships, it is difficult for them to accurately recall relevant information, resulting in confusing and inaccurate questions in the answers.

Method used

By obtaining the meta information of the file, building the relationship between files and storing it in the knowledge base, vectorizing file data and storing it in a vector database, filtering out relevant file blocks using vector matching and context time, and generating using large models Answer.

Benefits of technology

Improve the accuracy of Q&A for versioned files, reduce confusing information in the answers, and adapt to knowledge base Q&A in multi-version file scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248920A_ABST
    Figure CN119248920A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of text questions and answers, and relates to a questions and answers method based on file version relation meta-information, which comprises the following steps: acquiring a file, and segmenting the file; key meta-information is extracted from the segmented file; according to the key meta-information of each file, establishing a relationship among the files, and storing the relationship in a knowledge base; vectorizing the segmented file and storing the file in a vector database; obtaining a statement to be questioned and answered, and extracting context time of a user question; matching corresponding vector blocks from the vector database in a vector matching manner, and recalling the vector blocks from the vector database; traversing the original file information in the recall vector block, and obtaining the up-down relationship of the file according to the original file information; according to the context time, the trained large model is adopted to screen the up-down relation of the file, and questions of the user are answered according to the screening result; according to the method, the problem that recall cannot be correctly carried out during multi-version file question answering is solved, and questions can be answered more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of text question answering, and in particular relates to a question answering method based on file version relationship meta information. Background Art

[0002] With the development of pre-trained language model technology, large language models such as ChatGLM, Tongyi Qianwen, and Baichuan Large Model have emerged. In order to solve the problem of vertical domain knowledge loss and hallucination in large models. This has spawned a series of question-answering systems based on large language models and text-based knowledge bases. The main way of question-answering is to recall multiple file blocks related to the question from the knowledge base based on the question provided by the user. Then the recalled file blocks and the question provided by the user are used as the input of the large language model to obtain the answer content.

[0003] However, in actual use, this recall method will have various problems, especially when it comes to Q&A of various files with version relationships, such as policies. For some files with versions, such as policies, there are the following problems: 1. There are different version problems. For example, policies and laws will have different versions at different times, and users who query laws based on cases need to obtain the corresponding laws based on the judgment time of the case; 2. The files have explanations and supplementary notes, and the relevant content is also helpful for knowledge base Q&A, so they should be recalled according to the corresponding situation; 3. Some files are still under revision instructions, and the revision instructions only explain the changes to the content, and there are no new files. Such files need to be modified to the specific file content through operations; 4. Files have an expiration date, and some files will be replaced by other new policies. Therefore, when recalling, two parts of the content blocks may be recalled at the same time, and confusing information will appear in the answer reference content. Summary of the invention

[0004] In order to solve the problems existing in the above-mentioned prior art, the present invention proposes a question-answering method based on file version relationship meta-information, which method includes: obtaining files and segmenting the files; extracting key meta-information from the segmented files; building the relationship between each file according to the key meta-information of each file; storing the relationship between the files in a knowledge base; vectorizing the segmented files, and storing the vectorized data in a vector database; obtaining the sentence to be asked and answered, and extracting the context time of the user's question according to the context environment of the sentence to be asked and answered; matching the corresponding vector block from the vector database by vector matching, and recalling the matched vector block from the vector database; traversing the original file information in the recalled vector block, and obtaining the context relationship of the file according to the context time and the original file information; screening the context relationship of the file by using the trained large model according to the context time, and answering the user's question according to the screening result.

[0005] Beneficial effects of the present invention:

[0006] Based on the original knowledge base question and answer method, the present invention introduces a specific process of file relationship construction for versioned file types to construct basic file relationship meta-information. When conducting knowledge base question and answer, the previous recall process will increase the way of meta-information screening and matching to make it more suitable for question and answer in this scenario. The present invention solves the problem of being unable to correctly recall when answering questions about multiple versions of files, and can answer questions more accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 It is the overall flow chart of the present invention;

[0008] Figure 2 A flowchart of the construction text relationship of the present invention;

[0009] Figure 3 A flow chart of storing vectorized data in a vector database according to the present invention;

[0010] Figure 4 The present invention is a flowchart of answering user questions. DETAILED DESCRIPTION

[0011] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0012] A question-answering method based on file version relation meta-information, such as Figure 1 As shown, the method includes: obtaining files and segmenting the files; extracting key meta information from the segmented files; building the relationship between the files based on the key meta information of each file; storing the relationship between the files in a knowledge base; vectorizing the segmented files and storing the vectorized data in a vector database; obtaining the sentence to be asked and answering, and extracting the context time of the user's question based on the context environment of the sentence to be asked and answering; matching the corresponding vector blocks from the vector database by vector matching, and recalling the matched vector blocks from the vector database; traversing the original file information in the recalled vector blocks, and obtaining the context relationship of the file based on the context time and the original file information; using the trained large model to filter the context relationship of the file based on the context time, and answering the user's question based on the filtering result.

[0013] In this embodiment, when the file is segmented, key meta information of the file is extracted, such as policy name, policy issuing agency, policy effective time, superior law, legal policy that the policy replaces and abandons, etc. Basic information of interpretation and revision is similarly extracted. After the key meta information of the file is extracted, the relationship between the corresponding files can be constructed based on the meta information.

[0014] Specifically, the file segmentation is mainly based on the different file types. The file is segmented according to the actual text content parsed, and the text content of the file is divided into multiple blocks to meet the length restrictions during subsequent embedding and recall. The following steps are used for segmentation: 1) First, the file is identified to generate a continuous text string stream and corresponding title relationships. Different methods are used for identification depending on the original file. For formatted text (such as word, text, etc.), the format is directly parsed and read, while for some non-formatted files (such as pdf, etc.), OCR-based models will be considered for identification; 2) Semantic hierarchical identification is performed on the text string. Based on the title hierarchical relationship identified in the text string previously, the text is hierarchically divided according to whether it is a title and the hierarchical relationship between titles. In addition to using the title relationship identified in the first step, the division will also be processed according to specific rules (specific rules are mainly for special file formats, such as chapters and clauses in laws, etc.). The final result is a document tree (internal nodes are hierarchical titles, and leaf nodes are text); 3) For the subsequent text, it is divided according to whether its length is greater than a specific maximum parameter value. The division boundary is the natural boundary character of the paragraph or sentence, and the two fragments can be optionally crossed.

[0015] Semantic analysis is performed on the content of the processed document tree to obtain key meta-information, such as the name of the law or policy, superior law, legal abolition relationship, etc. A model is needed to process the text. The model can be a group of professional tasks generated after training based on training corpus, or a large semantic model with strong general capabilities. Each block of the document tree is passed through the model to allow the model to identify key information, such as the name of the law, document number, issuing agency, issuance date, effective date, superior law, abandoned law, etc.

[0016] like Figure 2 As shown, the relationship between files is constructed and stored based on the file meta-information. The main relationships are version relationship, superordinate relationship, and replacement relationship between files. At the same time, the interpretation file is also associated with the original file. For the corresponding revision description file, a new file version is directly generated based on the revision description in the revision file and added to the knowledge base.

[0017] like Figure 3As shown, the file is divided into blocks, vectorized and stored in the vector database in the same way as before. Specifically, it includes: dividing each file into blocks according to the system configuration; calling the Embedding interface for each block to generate a vector, and storing the vector in the vector database.

[0018] like Figure 4 As shown, when answering questions for users, first determine the time point required for the user's question through the context of the question, which defaults to the current time. Then match the corresponding vector block through vector matching. In normal ways, the top-k or fixed total length of the returned file block should be returned. Traverse the file meta information of the file block in turn, find the corresponding original file, and find the upper and lower relationship files of the file based on the previous relationship. Filter the meta files according to the time point of the question, and select the files that meet the conditions (depending on the performance requirements, you can use the time directly or use the large model to make the judgment). Give the large model an answer based on the filtered file blocks combined with the question and answer prompt.

[0019] In this embodiment, in the multi-round question-answering system based on the knowledge base, the input of the question-answering module is the dialogue text records from rounds 1 to N-1, the questions raised by the user in round N, and the K pieces of knowledge retrieved from the knowledge base. The output is the reply to the question raised by the user in round N. Some of the user's questions have very clear intentions and clear and complete descriptions. In this case, the probability that the knowledge retrieved from the knowledge base can answer the user's question is very high.

[0020] Large Language Models: Large Language Models (LLMs) are an AI technology that learns to understand and generate natural language by training on large amounts of text data. These models have powerful expressive capabilities and can understand and generate various types of text, such as questions, answers, articles, comments, etc.

[0021] Large language models are built based on deep learning techniques, especially neural networks. They can capture the semantic, grammatical, and contextual information in text, thus performing well in various natural language processing tasks.

[0022] Prompt: The prompt of a large model (such as a large-scale pre-trained model, LLMs) is a guiding text used to instruct the model to generate a specific type of output. Prompts can be in the form of questions, instructions, examples, etc., to provide context and direction for the model.

[0023] Vector retrieval knowledge base: An enterprise knowledge base is usually the sum of all knowledge, information and resources accumulated, organized and managed within an enterprise. It includes the enterprise's professional knowledge, experience, best practices, management system, corporate culture and other aspects. Vector retrieval knowledge base refers to extracting text information in the enterprise knowledge base from knowledge files of various formats, and then merging, splitting, and re-merging data preprocessing to obtain a series of text fragments, and then using a pre-trained vector model to obtain a fixed-length vector corresponding to the text fragment.

[0024] Knowledge base: The knowledge base is constructed from the source data of the knowledge base, usually implemented as a vector database, and consists of vector indexes and multiple pieces of knowledge. Knowledge refers to the natural language strings in the source data of the knowledge base that have been preprocessed.

[0025] Category structure information of the knowledge base: refers to the way and method of classifying, organizing and displaying various types of knowledge content in the knowledge base. Category and structure information helps enterprises to effectively manage the knowledge base and improve the efficiency of employees in finding and acquiring knowledge. Category and structure information usually includes category division: logical division of the content in the knowledge base to form categories of different topics and fields. Category division should be systematic, complete and practical to facilitate the rapid location of required knowledge. Hierarchical structure: The hierarchical structure of the knowledge base refers to the organizational relationship between categories. The hierarchical structure can be tree-like, menu-like or other forms. Tag system: Tags are summaries of knowledge base content that are representative, intuitive and easy to understand. Classification system: The classification system makes the knowledge base content have better distinction and correlation between categories.

[0026] Source data of knowledge base: Source data of knowledge base refers to the enterprise's own structured, easy-to-operate, easy-to-use, easy-to-store, and inheritable knowledge clusters. This knowledge includes the enterprise's macro development plan, corporate culture, and all the knowledge content of each department at the micro level, such as training materials, learning materials, customer information, market information, etc. At the same time, the enterprise knowledge base also contains theoretical knowledge and factual data related to the field. These data are stored in formats such as word, excel, text documents, pictures, etc., or saved on cloud servers.

[0027] Intelligent customer service system: The intelligent customer service system is an industry-oriented system developed based on large-scale knowledge processing. It is suitable for technical industries such as large-scale knowledge processing, natural language understanding, knowledge management, and automatic question-and-answer systems. It can establish a fast and effective technical means based on natural language for communication between users and staff.

[0028] In this embodiment, the vector matching method is used to match the corresponding vector blocks from the vector database, including: after dividing the text into single blocks, merging its title information and file name information; calling the text embedding model to generate a 1024-dimensional vector; using the large model to generate the corresponding vector for the user's question; querying the vector database based on the vector, and returning the corresponding Top-K document blocks with the highest similarity.

[0029] In this embodiment, screening the contextual relationship of files includes: searching for corresponding meta-information based on the recalled content; for each text block, using a large model to determine whether the block meets the relevant relationship based on the question and the context time of the question, and directly filtering it if it does not meet the relevant relationship; that is, if the context time does not meet the requirements, then introducing the real legal policy document in the context through the version relationship; finally, rearranging the retained text blocks and their corresponding meta-information again, selecting Top-N and combining them with the user question and the user question and answer history to provide them to the large model, and the large model generates answers to the questions.

[0030] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A question-answering method based on file version relationship meta-information, characterized in that: include: Get the file and split it; Extract key meta information from the segmented files; build the relationship between the files based on the key meta information of each file; The relationship between files is stored in the knowledge base; the segmented files are vectorized and the vectorized data is stored in the vector database; the sentence to be answered is obtained, and the context time of the user's question is extracted according to the context of the sentence to be answered; the corresponding vector block is matched from the vector database by vector matching, and the matched vector block is recalled from the vector database; the original file information in the recalled vector block is traversed, and the context relationship of the file is obtained according to the context time and the original file information; the context relationship of the file is screened by the trained large model according to the context time, and the user's question is answered according to the screening result.

2. A question-answering method based on file version relationship meta-information according to claim 1, characterized in that: The file segmentation process includes: setting a text length threshold; identifying the file content to obtain continuous text strings and corresponding title relationships; performing semantic hierarchical recognition on the text strings, and hierarchically dividing the hierarchical relationship of the recognized text according to the corresponding title relationship to generate a document tree, in which the internal nodes of the document tree are hierarchical titles and the leaf nodes are the text; obtaining the length of the leaf nodes in the document tree, and comparing the length of the leaf nodes with the text length threshold. If it is greater than the set text length threshold, the leaf nodes are divided using natural boundary characters, otherwise no processing is performed.

3. A question-answering method based on file version relationship meta-information according to claim 1, characterized in that: Extracting key meta information from the segmented files includes: building a large language model and training the large language model; and extracting information from each node of the document tree using the trained large language model to obtain key information.

4. A question-answering method based on file version relationship meta-information according to claim 1, characterized in that: Constructing the relationship between each file includes: determining the hierarchical relationship between each file according to the key information extracted from each file, and obtaining the relationship between each file according to the hierarchical relationship.

5. A question-answering method based on file version relationship meta-information according to claim 1, characterized in that: Extracting the context time of the user's question includes: obtaining the user's question time, and comprehensively determining the context time of the user's question according to the user's question time and the user's question history.

6. A question-answering method based on file version relationship meta-information according to claim 1, characterized in that: The method of vector matching is used to match the corresponding vector blocks from the vector database, including: dividing the text into single blocks, merging its title information and file name information; calling the text embedding model to generate a 1024-dimensional vector; using the large model to generate the corresponding vector for the user's question; querying the vector database based on the vector, and returning the corresponding Top-K document blocks with the highest similarity.

7. A question-answering method based on file version relationship meta-information according to claim 1, characterized in that: Screening the contextual relationships of files includes: searching for the corresponding meta-information based on the recalled content; for each text block, using the big model to determine whether the block meets the relevant relationship based on the question and the context time of the question, and directly filtering it if it does not meet the requirements; that is, if the context time does not meet the requirements, the real legal policy document in the context is introduced through the version relationship; finally, the retained text blocks and their corresponding meta-information are rearranged again, and the Top-N are selected and combined with the user questions and user question and answer history to provide them to the big model, and the big model generates answers to the questions.

Citation Information

Patent Citations

  • Intelligent answering method, apparatus and system, and electronic device

    CN105893391A

  • Power equipment standard question and answer method and system based on attention and storage medium

    CN115905495A

  • Search question-answering system and method based on large model and electronic equipment

    CN117708274A

  • Question and answer method and device, electronic equipment and storage medium

    CN117708290A

  • Data processing method and device, equipment and storage medium

    CN118520096A