Intelligent document question and answer method and device and computer readable storage medium

Using multi-modal large models to perform natural language descriptions and question and answer construction on charts, combined with vectorization technology, it solves the problem of insufficient parsing capabilities of chart content in existing document question and answer systems, and improves the overall accuracy of the question and answer system.

CN118656457APending Publication Date: 2024-09-17BEIJING KNOWLEDGE ATLAS TECHNOLOGY CO LTD
View PDF 0 Cites 14 Cited by

Patent Information

Application Number
CN202410644045.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Existing document question and answer systems lack effective parsing capabilities when processing chart content, resulting in greater limitations in overall accuracy.

Method used

Use a multi-modal large model to perform natural language descriptions and automatically construct question and answer pairs for the charts in the input document. The chart descriptions, question and answer pairs, and plain text parsing content are combined to build a knowledge base. By vectorizing user input text and knowledge base slicing, matching, generating more comprehensive and accurate Q&A results.

Benefits of technology

The overall accuracy of the document question and answer system has been improved, and it can effectively analyze the content of charts and provide more comprehensive and accurate information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656457A
    Figure CN118656457A
Patent Text Reader

Abstract

The invention relates to an intelligent document question-answering method and device and a computer readable storage medium, belongs to the technical field of artificial intelligence and big data, and solves the problem that the overall accuracy of an existing document question-answering system is greatly limited. The method comprises: acquiring a user input text; vectorizing the text input by the user to obtain an input vector; performing vector similarity matching on the input vector and knowledge slices in the vector database to obtain knowledge base slices matched with the input vector; when the original document data is in a chart form, a description text of a corresponding chart and a question and answer pair are stored in the vector database as a knowledge slice; and inputting the user input text and the knowledge base slices into a large language model, and outputting a generated question and answer result. According to the method, the multi-modal large model is used for carrying out natural language description and question-answer pair automatic construction on the chart in the input document, and the overall accuracy of a document question-answer system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence and big data technology, and specifically relates to an intelligent document question-and-answer method, device, and computer-readable storage medium. Background Art

[0002] With the rapid development of artificial intelligence and big data technologies, the new generation of artificial intelligence technology represented by large language models has brought revolutionary breakthroughs. How to reconstruct and upgrade traditional products and businesses based on large language models has become a hot research topic.

[0003] Document question answering system is one of the most popular application directions of natural language processing. The system generates corresponding answers based on the documents and questions input by the user to meet the user's needs. The natural language expression of human beings is very diverse, and traditional methods are difficult to deal with well. However, the large language model has a strong emergence ability, a general understanding of natural language, and a high cross-domain ability and flexibility.

[0004] In some data-intensive technical fields, such as data in the financial field, which involve complex time series data, stock price changes, market analysis, etc., these data are often presented in the form of charts (such as line graphs, bar graphs, pie charts, etc.) to intuitively show trends, comparisons and forecasts. Therefore, charts are very important tools for communicating information in these documents.

[0005] The invention with patent publication number CN202310568188 proposes a method for generating financial question-answer text based on retrieval enhancement. The specific scheme is as follows:

[0006] S1: Using the retriever, a dual encoder model is used to encode questions and retrieval documents in the open domain and financial domain respectively, and recall documents related to the questions. The retriever uses a fuzzy supervised optimization method to adjust the probability of retrieving documents.

[0007] S2: Using the retrieval result integrator, a cross encoder model is used to re-rank the question-related documents recalled from the open domain and the financial domain and select the retrieval results, and a weighted integration strategy is used to splice the selected retrieval results with the original context.

[0008] S3: Use the generator to take the documents generated by the weighted ensemble as input and generate question-answering results based on the question and the retrieved auxiliary knowledge.

[0009] However, the above technical solution lacks the ability to analyze and parse the content of charts. It is difficult to obtain effective analysis when using the above technical solution for document question and answering, resulting in significant limitations in the overall accuracy of the document question and answer system. Summary of the invention

[0010] In view of the above analysis, the embodiments of the present invention aim to provide an intelligent document question and answer method, device and computer-readable storage medium to solve the problem that the overall accuracy of the existing document question and answer system is greatly limited.

[0011] In one aspect of the present application, a smart document question-answering method is provided, comprising:

[0012] Get user input text;

[0013] Vectorizing the user input text to obtain an input vector;

[0014] Performing vector similarity matching between the input vector and the knowledge slices in the vector database to obtain a knowledge base slice matching the input vector; wherein the knowledge base slice of the vector database is constructed by segmenting the original document data pre-input by the user; wherein, when the original document data is in the form of a chart, the description text and the question-answer pair corresponding to the chart are stored in the vector database as a knowledge slice;

[0015] The user input text and the knowledge base slice are input into a large language model, and the generated question-answering result is output.

[0016] Optionally, when the original document data is in the form of a chart, a multimodal large model is used to generate a description text and a question-answer pair corresponding to the chart, and the description text and the question-answer pair corresponding to the chart are used as a knowledge slice that is no longer segmented; wherein the multimodal large model is pre-fine-tuned and trained.

[0017] Optionally, segmenting the original document data pre-input by the user to construct knowledge base slices of the vector database includes:

[0018] Determining whether the current document data in the original document data is in a chart form;

[0019] If yes, the chart is input into the multimodal large model, a description text and a question-answer pair corresponding to the chart are generated, and the description text and the question-answer pair are spliced ​​into a sub-text block;

[0020] If not, the text content is split into sub-text blocks;

[0021] All sub-text blocks are vectorized to construct knowledge base slices of the vector database.

[0022] Optionally, the step of inputting the chart into the multimodal macro model to generate a description text and a question-answer pair corresponding to the chart includes:

[0023] Use computer vision techniques to perform image recognition and visual feature extraction on images including diagrams;

[0024] Convert the extracted visual features into semantic information and perform contextual understanding to generate the intended content of the chart;

[0025] Based on the semantic information and the intended content of the graph, natural language generation technology is used to generate question-answer pairs of descriptive text.

[0026] Optionally, the process of pre-fine-tuning the multimodal large model includes:

[0027] Creating a fine-tuning training data set; wherein the input of the fine-tuning training data set is a chart image and an instruction, and the output is a description text of the corresponding chart and a question-answer pair;

[0028] The fine-tuning training data set is used to perform fine-tuning training on the multimodal large model.

[0029] Optionally, the multimodal large model adopts a CogVLM model, a Qwen-VL model, or a GPT-4V model;

[0030] Fine-tuning a large multimodal model involves:

[0031] The full parameter fine-tuning method or the Lora fine-tuning method is used to fine-tune the multimodal large model.

[0032] Optionally, performing vector similarity matching between the input vector and the knowledge slices in the vector database to obtain a knowledge base slice matching the input vector comprises:

[0033] Determining the vector similarity between the input vector and the knowledge slice in the vector database;

[0034] Arrange according to the vector similarity to obtain a knowledge base slice with high similarity to the user input text vector;

[0035] Deduplication processing is performed, and the first N slices among the knowledge base slices with high similarity to the user input text vector are used as the knowledge base slices matching the input vector.

[0036] Optionally, vectorizing the user input text to obtain an input vector includes:

[0037] The user input text is vectorized using a vectorization model to obtain an input vector; the vectorization model is M3E.

[0038] According to a second aspect of the present application, there is provided an intelligent document question-and-answer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, any one of the intelligent document question-and-answer methods described above is implemented.

[0039] According to a third aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any one of the above-mentioned intelligent document question-and-answer methods is implemented.

[0040] The intelligent document question-and-answer method provided in this application obtains user input text; vectorizes the user input text to obtain an input vector; matches the input vector with the knowledge slice in the vector database for vector similarity to obtain a knowledge base slice that matches the input vector; when the original document data is in the form of a chart, the description text of the corresponding chart and the question-and-answer pair are stored in the vector database as a knowledge slice; the user input text and the knowledge base slice are input into a large language model, and the generated question-and-answer result is output. Based on the original document parsing component, this application uses a multimodal large model to perform natural language description and automatic construction of question-and-answer pairs for the charts in the input document, and constructs a knowledge base together with the chart description, question-and-answer pairs, and the original plain text parsed content. In this way, when performing document question-and-answer, the question-and-answer pairs corresponding to the chart content can be recalled, and the parsed information includes not only text but also charts, and the information is more comprehensive, which solves the problem that the traditional document question-and-answer system based on the large language model lacks effective parsing of chart content during the knowledge base construction process, thereby improving the overall accuracy of the document question-and-answer system.

[0041] In addition, the present application also provides an intelligent document question-and-answer device and a computer-readable storage medium having the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of this specification 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 only some embodiments recorded in the embodiments of this specification. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0043] Figure 1 A flowchart of a specific implementation method of the intelligent document question-and-answer method provided in this application;

[0044] Figure 2 A schematic diagram of the process of constructing a knowledge base slice of the vector database;

[0045] Figure 3 Schematic diagram of the process of pre-fine-tuning training for a multimodal large model;

[0046] Figure 4 A flowchart of another specific implementation of the intelligent document question-and-answer method provided in this application;

[0047] Figure 5 This is a structural block diagram of the intelligent document question and answer device provided in this application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. It should be noted that, in the absence of conflict, the embodiments in the present disclosure and the features in the embodiments can be combined, separated, interchanged and / or rearranged with each other. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0049] The terms used here are for the purpose of describing specific embodiments, and are not intended to be restrictive. As used here, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "said (the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, it is explained that there are stated features, integral bodies, steps, operations, parts, assemblies and / or their groups, but it is not excluded that there are or add one or more other features, integral bodies, steps, operations, parts, assemblies and / or their groups. It should also be noted that, as used here, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values ​​and / or the values ​​provided that will be recognized by those of ordinary skill in the art.

[0050] A flowchart of a specific implementation of the intelligent document question-answering method provided in this application is as follows Figure 1 As shown, the method includes:

[0051] S101: Obtain user input text.

[0052] The user provides a query question, which is received and can be marked as Q.

[0053] S102: vectorizing the user input text to obtain an input vector.

[0054] The text Q input by the user is converted into a numerical vector QV using a vectorization model. Data in vector form allows computers to process and compare information more efficiently. It is understandable that vectorization models are usually pre-trained to understand and encode semantic information in text.

[0055] Among them, the vectorization model can specifically be M3E (text embedding model), which can convert natural language into dense vectors and is mainly used to calculate text vectors.

[0056] S103: Perform vector similarity matching between the input vector and the knowledge slices in the vector database to obtain a knowledge base slice that matches the input vector. The knowledge base slice of the vector database is constructed by segmenting the original document data pre-input by the user; when the original document data is in the form of a chart, the description text and question-answer pair of the corresponding chart are stored in the vector database as a knowledge slice.

[0057] The vector QV of the user's question is compared with the knowledge slice vectors stored in the vector database. A knowledge slice is an information unit in the database, and each slice represents a piece of knowledge or data.

[0058] Use similarity calculation to find the knowledge slices that are most similar to the QV. These knowledge slices are sorted in descending order according to their similarity to the QV. The similarity calculation can be cosine similarity or other similarity metrics. Deduplication can be performed to ensure that the recalled knowledge slices are not repeated, and the top N slices with the highest similarity are selected as candidate answers to the question. This set of results can be called KR1.

[0059] The vector database pre-builds and stores vector representations of a large number of knowledge slices, which may come from text data or chart data.

[0060] When the original document data is in text form, it can be directly processed according to conventional segmentation rules (such as fixed length or specific symbols).

[0061] When the original document data is in the form of a chart, a multimodal large model is used to generate the corresponding chart description text and question-answer pairs, and the corresponding chart description text and question-answer pairs are used as a knowledge slice that is no longer segmented. This enables the system to process chart information that may be ignored in traditional text question-answering systems, especially in application scenarios with more charts and less text.

[0062] The multimodal large model is pre-fine-tuned and trained on specific graph data to obtain better performance. The multimodal large model can be deployed on a cloud server.

[0063] S104: Input the user input text and the knowledge base slice into a large language model, and output the generated question and answer result.

[0064] The user input text Q and the knowledge base slice recall result KR1 are input into the large language model, and the generated question-answering result is output. The large language model can directly use the mainstream model without fine-tuning training, such as ChatGLM, GPT-4, etc.

[0065] The intelligent document question-and-answer method provided in this application obtains user input text; vectorizes the user input text to obtain an input vector; matches the input vector with the knowledge slice in the vector database for vector similarity to obtain a knowledge base slice that matches the input vector; when the original document data is in the form of a chart, the description text of the corresponding chart and the question-and-answer pair are stored in the vector database as a knowledge slice; the user input text and the knowledge base slice are input into a large language model, and the generated question-and-answer result is output. Based on the original document parsing component, this application uses a multimodal large model to perform natural language description and automatic construction of question-and-answer pairs for the charts in the input document, and constructs a knowledge base together with the chart description, question-and-answer pairs, and the original plain text parsed content. In this way, when performing document question-and-answer, the question-and-answer pairs corresponding to the chart content can be recalled, and the parsed information includes not only text but also charts, and the information is more comprehensive, which solves the problem that the traditional document question-and-answer system based on the large language model lacks effective parsing of chart content during the knowledge base construction process, thereby improving the overall accuracy of the document question-and-answer system.

[0066] like Figure 2 As shown, the original document data pre-entered by the user is segmented and constructed to obtain the knowledge base slices of the vector database, including:

[0067] S201: Determine whether the current document data in the original document data is in a chart form; if yes, proceed to S202; if no, proceed to S203.

[0068] First, it is necessary to determine whether the document data currently being processed is in the form of a chart. This step is necessary because chart data and plain text data require different processing methods.

[0069] S202: Input the chart into the multimodal large model, generate description text and question-answer pairs corresponding to the chart, and splice the description text and question-answer pairs into a sub-text block; enter S204.

[0070] The chart is fed into a large multimodal model. The large multimodal model is ideal for parsing chart content because it can handle mixed data of images (charts) and text. The multimodal model converts the chart into descriptive text and related question-answer pairs. This is to convert non-text data (charts) into a text format that is easy for machines to process. The generated descriptive text and question-answer pairs are concatenated into a sub-text block for subsequent processing steps.

[0071] Specifically, the process of converting a graph into descriptive text and related question-answer pairs by the multimodal large model includes the following steps:

[0072] 1. Use computer vision technology to perform image recognition and visual feature extraction on images including charts.

[0073] This includes identifying the type of chart (e.g. bar chart, line chart, pie chart, etc.), labels and titles in the chart, and values ​​and trends in the chart. The model extracts visual features from the chart that capture the structure and content of the chart. This may involve deep learning techniques such as convolutional neural networks (CNNs), which are able to identify and interpret important visual patterns in images.

[0074] 2. Convert the extracted visual features into semantic information and perform contextual understanding to generate the intended content of the chart.

[0075] The extracted features need to be converted into semantic information, which means that the model needs to understand how the data in the chart corresponds to the visual representation of the chart. For example, the model needs to understand what the X-axis and Y-axis of the chart represent and how to interpret the data on these axes. After understanding the basic information of the chart, the model also needs to put this information into a broader context for interpretation. This may involve integrating information from the chart title or the context of the chart to fully understand the intention and content of the chart.

[0076] 3. Based on the semantic information and the intended content of the chart, natural language generation technology is used to generate question-answer pairs of descriptive text.

[0077] Once the model understands the content and context of the diagram, it uses natural language generation techniques to write descriptive text. This is usually done through sequence-to-sequence models such as RNN, LSTM, or Transformer, which are able to generate coherent and grammatically correct sentences.

[0078] Based on its understanding of the graph, the model generates relevant questions. This often involves creatively thinking about what the user might be interested in about the graph’s content. For each generated question, the model also needs to provide an answer. This requires the model to not only generate questions, but also extract or infer the correct answer from the graph.

[0079] In some advanced multimodal models, training description generation and question-answer pair generation simultaneously can improve the performance of both tasks. Fine-tuning the model on a specific dataset can further improve its performance on specific tasks (such as financial chart parsing).

[0080] S203: Divide the text content into sub-text blocks; proceed to S204.

[0081] If the original document data is in text form, this step will divide the text content into smaller sub-text blocks. This helps to refine the text information and facilitate subsequent vectorization processing and information retrieval.

[0082] S204: vectorize all sub-text blocks to construct knowledge base slices of the vector database.

[0083] All sub-text blocks, whether generated from a diagram or directly segmented, will be vectorized. This step can convert the text into a vector format using a vectorization model.

[0084] The vectorized sub-text blocks constitute knowledge base slices of the vector database. These slices are stored in the database to support subsequent information retrieval or question-answering tasks.

[0085] Different processing methods for charts and text reflect the need for multimodal information processing, and converting all content into vector form provides a unified format for machine learning or deep learning models to operate. This processing method is very suitable for application scenarios that need to process mixed data types, such as document analysis and question-answering systems in the financial field.

[0086] like Figure 3 As shown in the figure, the multimodal large model is pre-fine-tuned and trained in the following steps:

[0087] S301: Create a fine-tuning training data set; wherein the input of the fine-tuning training data set is a chart image and instructions, and the output is a description text of the corresponding chart and a question-answer pair.

[0088] Obtain the description text of the corresponding chart and question-answer pairs to generate fine-tuning training data sets. This can be collected using commercial multimodal large models for automatic annotation or manual annotation. Among them, manual annotation has guaranteed quality, but the cost is relatively high. Input chart images and instructions, and output the corresponding chart descriptions and question-answer pairs.

[0089] As a specific implementation, the format of the training data set of this application is as follows:

[0090] {"input":" <image_00001.png> ","prompt":"You are an expert in the financial field and are good at interpreting financial charts. Please give a professional interpretation and description of the content of the chart in the image, and ask questions about the chart and give professional and accurate answers.\nRequirements: 1. The questions raised should cover all the information in the chart as much as possible. \n2. If mathematical calculations are required, please list the mathematical expressions for the calculations and get the results, such as 54+6.75=60.75, do not get the results directly","target":"This is a bar chart about stock positions, titled "Chart: Stock Positions". The chart shows data from the fourth quarter of 2020 to the fourth quarter of 2023. The Y-axis represents percentages (%), ranging from 0% to 100%. The X-axis represents time, in quarters. Each column represents the stock position in a specific quarter. As can be seen from the figure, the stock position is above 70% most of the time, but there are also declines in some quarters. The following are the questions and answers for the chart: 1. [Question]: When was the stock position lowest? [Answer]: Lowest in 2023Q1\n2. [Question]: What is the highest proportion of stock positions? [Answer]: The highest proportion reaches 80%"}

[0091] Among them, "input" represents the input chart image, "prompt" represents the complete input text, including instructions and prompt words, and "target" represents the output chart description and question-answer pair.

[0092] S302: Use the fine-tuning training data set to perform fine-tuning training on the multimodal large model.

[0093] The multimodal large model uses existing models in the industry, such as the CogVLM model, or other multimodal large models, such as Qwen-VL, GPT-4V, etc., to achieve the same effect. Among them, CogVLM is a multimodal large model developed by Zhipu AI, a company that transforms the technological achievements of Tsinghua University. Qwen-VL is a large-scale visual language model (Large Vision Language Model) developed by Alibaba Cloud, which can take images, text, and detection boxes as input, and text and detection boxes as output. GPT-4V is a new generation of artificial intelligence chatbot program developed by OpenAI that supports multimodal input.

[0094] Use the multimodal big model to complete fine-tuning on the training dataset generated by the chart description and question-answer pairs created above, and enhance the multimodal big model's ability to understand charts.

[0095] The mainstream large language model fine-tuning method can be used to fine-tune the multimodal large model. For example, the full parameter fine-tuning method or the Lora fine-tuning method can be used to fine-tune the multimodal large model. The loss function can choose cross entropy. Among them, Low-Rank Adaptation of Large Language Models (LoRA) is a large language model fine-tuning method. Among them, full parameter fine-tuning adjusts all model parameters to adapt to specific tasks, while the LoRA fine-tuning method adjusts only part of the model to maintain the pre-trained knowledge structure while performing task-specific optimization.

[0096] Through such training, the model can not only understand text, but also interpret and answer complex questions related to charts, which is very useful for fields that need to process large amounts of data and charts, such as financial technology.

[0097] A flowchart of another specific implementation of the intelligent document question-answering method provided in this application is as follows: Figure 4 As shown in the figure, this method is applied to the financial document question answering system to improve the overall accuracy of the question answering system.

[0098] S401: Obtain user input text.

[0099] The user provides a query text, expressing the question or request for information. The user input text is obtained, denoted as Q.

[0100] S402: Vectorize the user input text to obtain an input vector.

[0101] The user input text Q is vectorized using a vectorization model to obtain an input vector QV. The vectorization model can use a mainstream model, such as M3E, etc. The vectorization model is usually a language model based on deep learning, which can capture the semantic features of the text.

[0102] S403: Determine the vector similarity between the input vector and the knowledge slice in the vector database.

[0103] The user's query vector QV is similarly calculated with the pre-vectorized knowledge base content stored in the vector database. This database contains vector representations of a large number of knowledge fragments, each of which represents a piece of information stored in the database.

[0104] S404: Arrange according to the vector similarity to obtain knowledge base slices with high similarity to the user input text vector.

[0105] Based on the calculated similarity, the system sorts the knowledge slices in the database and selects the most relevant knowledge fragments. This step is to find the information that best matches the user's query.

[0106] S405: Perform deduplication processing, and use the first N slices of the knowledge base slices with high similarity to the user input text vector as the knowledge base slices matching the input vector.

[0107] In order to provide accurate and non-repetitive information, the top-ranked knowledge slices are deduplicated, and then the top N most relevant slices are selected. This prevents the output of duplicate information and ensures that users receive diverse answers.

[0108] S406: Input the user input text and the knowledge base slice into the large language model, and output the generated question and answer results.

[0109] The original user query text and the filtered knowledge slices are input into a large language model (such as GPT, etc.). This model uses the provided text and knowledge information to generate a coherent and informative answer.

[0110] Furthermore, after obtaining the question and answer results, the method provided in the present application can also output the reasons and data sources for obtaining the question and answer results.

[0111] In addition to providing answers, users in the financial field often need to understand the logic behind the answers. The embodiment of the present application outputs the reasons and data sources for obtaining the question and answer results, explains its reasoning process and data sources, provides users with more explainable answers, and optimizes the user experience.

[0112] In addition, the present application also provides an intelligent document question-answering device, such as Figure 5 As shown in the structural block diagram of the intelligent document question and answer device provided in this application, the device specifically includes a memory 501 and a processor 502, and the memory 501 stores a computer program. When the computer program is executed by the processor 502, it implements the intelligent document question and answer method described in any one of the above.

[0113] In addition, the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the intelligent document question and answer method according to any one of the above-mentioned methods is implemented.

[0114] In summary, this application introduces a multimodal large model structured parsing component. Based on the original document parsing component, it uses a multimodal large model to perform natural language description and automatically construct question and answer pairs for the charts in the input document, and constructs a knowledge base together with the chart description, question and answer pairs, and the original plain text parsed content. This solves the problem that the traditional document question and answer system based on a large language model lacks effective parsing of chart content during the knowledge base construction process, thereby improving the overall accuracy of the document question and answer system.

[0115] Computer readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0116] The professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0117] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0118] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. An intelligent document question-answering method, characterized in that: include: Get user input text; Vectorizing the user input text to obtain an input vector; Performing vector similarity matching between the input vector and the knowledge slices in the vector database to obtain a knowledge base slice matching the input vector; the knowledge base slice of the vector database is constructed by segmenting the original document data pre-input by the user; wherein, when the original document data is in the form of a chart, the description text and the question-answer pair corresponding to the chart are stored in the vector database as a knowledge slice; The user input text and the knowledge base slice are input into a large language model, and the generated question-answering result is output.

2. The intelligent document question-answering method according to claim 1, characterized in that: When the original document data is in the form of a chart, a multimodal large model is used to generate a description text and a question-answer pair corresponding to the chart, and the description text and the question-answer pair corresponding to the chart are used as a knowledge slice that is no longer segmented; wherein the multimodal large model is pre-fine-tuned and trained.

3. The intelligent document question-answering method according to claim 2, characterized in that: The original document data pre-entered by the user is segmented and constructed to obtain the knowledge base slices of the vector database, including: Determining whether the current document data in the original document data is in a chart form; If yes, the chart is input into the multimodal large model, a description text and a question-answer pair corresponding to the chart are generated, and the description text and the question-answer pair are spliced ​​into a sub-text block; If not, the text content is split into sub-text blocks; All sub-text blocks are vectorized to construct knowledge base slices of the vector database.

4. The intelligent document question-answering method according to claim 3, characterized in that: The step of inputting the chart into the multimodal large model and generating the description text and question-answer pairs of the corresponding chart includes: Use computer vision techniques to perform image recognition and visual feature extraction on images including diagrams; Convert the extracted visual features into semantic information and perform contextual understanding to generate the intended content of the chart; Based on the semantic information and the intended content of the graph, natural language generation technology is used to generate question-answer pairs of descriptive text.

5. The intelligent document question-answering method according to claim 2, characterized in that: The process of pre-fine-tuning and training the multimodal large model includes: Creating a fine-tuning training data set; wherein the input of the fine-tuning training data set is a chart image and an instruction, and the output is a description text of the corresponding chart and a question-answer pair; The fine-tuning training data set is used to perform fine-tuning training on the multimodal large model.

6. The intelligent document question-answering method according to any one of claims 1 to 5, characterized in that: The multimodal large model adopts the CogVLM model, or the Qwen-VL model, or the GPT-4V model; Fine-tuning a large multimodal model involves: The full parameter fine-tuning method or the Lora fine-tuning method is used to fine-tune the multimodal large model.

7. The intelligent document question-answering method according to any one of claims 1 to 5, characterized in that: The performing vector similarity matching between the input vector and the knowledge slice in the vector database to obtain a knowledge base slice matching the input vector comprises: Determining the vector similarity between the input vector and the knowledge slice in the vector database; Arrange according to the vector similarity to obtain a knowledge base slice with high similarity to the user input text vector; Deduplication processing is performed, and the first N slices among the knowledge base slices with high similarity to the user input text vector are used as the knowledge base slices matching the input vector.

8. The intelligent document question-answering method according to any one of claims 1 to 5, characterized in that: The vectorizing the user input text to obtain an input vector comprises: The user input text is vectorized using a vectorization model to obtain an input vector; the vectorization model is M3E.

9. An intelligent document question-answering device, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the intelligent document question-and-answer method according to any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the intelligent document question and answer method according to any one of claims 1-8 is implemented.

Citation Information

Cited By

  • Visual question and answer method and device, equipment, storage medium and product

    CN118916471A

  • RAG system optimization method and system, electronic equipment and storage medium

    CN118917305A

  • Continuous question answering method and device based on large language model and electronic equipment

    CN118964585A

  • Construction method, device and equipment of intelligent criminal investigation platform and storage medium

    CN119357339A

  • Knowledge question and answer control method and system based on picture data and electronic equipment

    CN119441523A