Intelligent question and answer processing method and system, electronic equipment and storage medium
By constructing a knowledge graph and using multi-agent systems to handle different types of questions, the problem of inaccurate answer generation in complex documents by existing intelligent question answering systems is solved, achieving efficient and accurate question answering processing and source tracing support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2025-12-17
- Publication Date
- 2026-04-17
AI Technical Summary
Existing intelligent question-answering systems struggle to accurately and efficiently generate answers and provide traceability information when processing complex documents, especially when dealing with reasoning and computational questions.
By acquiring the content category and target location information of documents, a knowledge graph is constructed, and pre-built intelligent agents are used to generate answers and source information based on the knowledge graph. Multiple intelligent agents are used to handle factual, reasoning, and computational questions respectively.
It improves the accuracy and efficiency of question-and-answer processing, enhances intelligence and reliability, enables precise answers to complex documents, and provides traceability support for the answers.
Smart Images

Figure CN121880508A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, specifically to the field of artificial intelligence technology such as intelligent question answering and intelligent agents, and particularly to an intelligent question answering processing method, system, electronic device and storage medium. Background Technology
[0002] Existing intelligent question-answering systems can perform intelligent question-answering processing on a single document. For example, in a practical implementation, the entire document can be pre-vectorized into paragraphs. When a user asks a question about the document, the system first obtains the vectorized representation of the question; then it calculates the vector similarity between the question and each paragraph of the document; and finally, it recalls the paragraph with the highest vector similarity. Then, it calls a large language model to generate the answer based on the recalled paragraphs. Summary of the Invention
[0003] This disclosure provides an intelligent question-answering processing method, system, electronic device, and storage medium.
[0004] According to one aspect of this disclosure, an intelligent question-answering processing method is provided, comprising:
[0005] Obtain the source document in the first format and the questions raised in response to the source document;
[0006] Based on the source document in the first format, content information and target location information including content categories are obtained; the target location information is used to identify the location information of the content category in the source document in the first format.
[0007] Based on the content information of the content category and the target location information, a knowledge graph is constructed;
[0008] Using a pre-built intelligent agent, based on the knowledge graph, the answer to the question and the source information of the answer are generated.
[0009] According to another aspect of this disclosure, an intelligent question-answering processing system is provided, comprising:
[0010] The information acquisition module is used to acquire a source document in a first format and questions raised in response to the source document;
[0011] The content acquisition module is used to acquire content information and target location information, including content categories, based on the source document of the first format; the target location information is used to identify the location information of the content information of the content category in the source document of the first format.
[0012] The construction module is used to construct a knowledge graph based on the content information of the content category and the target location information;
[0013] The answer generation module is used to generate the answer to the question and the source information of the answer based on the knowledge graph using a pre-built intelligent agent.
[0014] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the methods described above and any possible implementations.
[0018] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the methods described above and any possible implementation thereof.
[0019] According to another aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the aspects and any possible implementations described above.
[0020] The technology disclosed herein can effectively improve the accuracy of text-to-text processing and the efficiency of question-and-answer processing.
[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0022] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0023] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure;
[0024] Figure 2 This is a schematic diagram according to the second embodiment of the present disclosure;
[0025] Figure 3 This is a schematic diagram according to the third embodiment of the present disclosure;
[0026] Figure 4 This is a schematic diagram according to the fourth embodiment of the present disclosure;
[0027] Figure 5 This is a schematic diagram according to the fifth embodiment of the present disclosure;
[0028] Figure 6 This is a block diagram of an electronic device used to implement the methods of the embodiments of this disclosure. Detailed Implementation
[0029] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0030] Obviously, the described embodiments are only some, not all, of the embodiments disclosed herein. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.
[0031] It should be noted that the terminal devices involved in the embodiments of this disclosure may include, but are not limited to, smart devices such as mobile phones, personal digital assistants (PDAs), wireless handheld devices, and tablet computers; the display devices may include, but are not limited to, personal computers, televisions, and other devices with display functions.
[0032] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0033] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure; as shown Figure 1 As shown in the figure, this embodiment provides an intelligent question-answering processing method, which may specifically include the following steps:
[0034] S101. Obtain the source document in the first format and the questions raised regarding the source document;
[0035] The application scenario of this embodiment is intelligent question-answering processing based on a specified document. In this embodiment, the source document in the first format is the provided specified document, that is, the document used as a reference for answering questions.
[0036] The first format of the source document in this embodiment can be any common format, such as a streaming document generated by various streaming input methods like Word or PowerPoint (ppt); or it can be a Portable Document Format (PDF) or a non-streaming document generated by non-streaming input methods like images. The problem in this embodiment can be any problem raised regarding the source document.
[0037] S102. Based on the source document of the first format, obtain the content information and target location information of the included content categories; the target location information is used to identify the location information of the content information of the content categories in the source document of the first format.
[0038] S103. Construct a knowledge graph based on content information and target location information of content categories;
[0039] To improve the accuracy of question-and-answer processing, in this embodiment, content information and target location information of the content categories included in the source document of the first format are first obtained. The content categories included in the source document of the first format can be at least one such as text paragraphs, tables, document images, headers, footers, tables of contents, titles, and annotations. That is to say, the source document of the first format in this embodiment can be a complex document including multiple content categories. In order to achieve accurate and efficient question-and-answer processing for complex documents, in this embodiment, a knowledge graph can be constructed based on the obtained content information of the content categories and target location information. Since the knowledge graph has a simple structure and very strong contextual reasoning, it has a very strong support capability for question-and-answer processing. Therefore, in this embodiment, by constructing a knowledge graph, effective support is provided for subsequent question-and-answer processing.
[0040] S104. Using a pre-built intelligent agent, based on a knowledge graph, generate answers to questions and source information for those answers.
[0041] To improve question-answering efficiency, this embodiment employs a pre-built intelligent agent that generates answers based on a pre-built knowledge graph, effectively enhancing both accuracy and efficiency. Furthermore, this embodiment generates source information for the answers along with the answers, allowing users to trace the answers' origins and further improving the accuracy and reliability of question-answering.
[0042] The executing entity of the intelligent question-answering processing method in this embodiment can be an intelligent question-answering processing system. This system can be an electronic entity or a software-integrated application. In use, a source document can be input into the intelligent question-answering processing system. The system first obtains content information including content categories and target location information based on the source document in the first format. Then, based on the obtained content information and target location information, it constructs a corresponding knowledge graph. Next, it receives questions posed about the source document in the first format. Optionally, the questions can be input simultaneously with the source document in the first format. Finally, an intelligent agent, based on the constructed knowledge graph, generates answers to the questions and source information for the answers.
[0043] The intelligent question-answering processing method of this embodiment constructs a knowledge graph based on the content information of the content category of the source document in the first format and the target location information, and uses an intelligent agent to generate answers to questions raised by the source document in the first format and the source information of the answers based on the knowledge graph. This can effectively improve the accuracy and efficiency of question-answering processing and enhance the intelligence and accuracy of question-answering processing.
[0044] Figure 2 This is a schematic diagram based on the second embodiment of this disclosure; the intelligent question-answering processing method of this embodiment, in the above... Figure 1 Based on the technical solutions of the illustrated embodiments, the technical solutions of this disclosure will be described in further detail. For example... Figure 2 As shown, the intelligent question-answering processing method of this embodiment may specifically include the following steps:
[0045] S201. Obtain the source document in the first format and the questions raised regarding the source document;
[0046] Refer to the above Figure 1 As described in the illustrated embodiment, the first format document in this embodiment can be a document generated by streaming input or a document generated by non-streaming input.
[0047] S202. Based on the source document page in the first format, obtain the content information of the content categories included in the page and the target location information;
[0048] In this embodiment, target location information is used to identify the location information of the content category in the source document of the first format.
[0049] The source document of the first format in this embodiment can be a document with a complex format. For example, the source document may include multiple content categories such as text paragraphs, tables, ID card images, headers, footers, tables of contents, titles, and annotations.
[0050] In this embodiment, each page of the source document in the first format can be preprocessed to obtain the content information of each content category included in each page and the position information of each content category within the page; then, the position information of each content category within the page, combined with the position information of the page in the source document, is used as the target position information of each content category to identify the unique position information of each content category in the source document.
[0051] S203. Store the content information of the content category and the target location information in the structured target document;
[0052] The structured target document in this embodiment can be a document in Markdown format, or a document in HyperText Markup Language (HTML) format, or a document in Excel format, or it can be a document in other custom formats, which are not limited here.
[0053] In this structured target document, there is no concept of pages. All content categories in the first-format source document are stored one by one according to content information and target location information, which enables unified management of all content categories in the first-format source document.
[0054] Optionally, in the specific implementation of step S202, attribute information for each content category can also be obtained. For example, for a text paragraph, information such as the font, font size, and number of words or lines can be obtained. For a title, attribute information such as font, color, font size, and whether it is bold can be obtained. For a table, the position information of each cell in the table can be obtained as the attribute information of that cell. When generating a structured target document, the attribute information of each content category needs to be stored as well.
[0055] Further optionally, in one embodiment of this disclosure, after obtaining the content information of the content categories and target location information of each page in the source document of the first format using the above method, the location information and attribute information such as font and font size of all titles in the source document of the first format can be used to obtain the classification information of each title using a pre-trained title analysis model. This allows for a clearer understanding of the structure of the source document of the first format, which can be used to split or perform other analyses on the source document of the first format when necessary.
[0056] S204. Extract entity nodes and semantic relationships from the structured target document to construct a knowledge graph, wherein the target location information corresponding to the content information of the entity node is stored in the attribute of the entity node.
[0057] In this embodiment, the extracted entity nodes may include names, organizations, indicators, charts, etc., and the extracted semantic relationships may include "belong to", "reference", "calculation result", etc., which will not be listed in detail here.
[0058] Alternatively, if attribute information is also obtained, the attribute information corresponding to the content information of the entity node should also be stored in the attributes of the entity node.
[0059] In this embodiment, the constructed knowledge graph can be in the form of a document graph (DocGraph), which can be stored in a graph database for efficient semantic retrieval and logical reasoning.
[0060] In this embodiment, steps S202-S204 above can be considered as preprocessing of the source document in the first format. By analyzing the source document in the first format, the content information and location information of the content categories included in the source document in the first format are accurately and effectively obtained and stored in the structured target document. This ensures that the obtained structured target document can comprehensively and accurately include all content categories of the source document in the first format. Then, based on the structured target document, the corresponding knowledge graph can be accurately and efficiently constructed, and it can be guaranteed that the constructed knowledge graph can accurately and comprehensively include all content categories of the source document in the first format, providing necessary data support for the intelligent solution of subsequent questions.
[0061] S205. Use a pre-trained intent recognition model to identify the type of question;
[0062] In this embodiment, the intent recognition model can be a pre-trained multi-classification model. When used, a question is input into the intent recognition model, and the intent recognition model can predict and output the type of the question.
[0063] For example, in this embodiment, the types of questions identified by the intent recognition model may include factual questions, reasoning questions, and computational questions. Alternatively, if a question cannot be identified by the pre-trained intent recognition model, the corresponding question type is categorized as "other questions."
[0064] S206. Based on the type of problem, match the corresponding target agent from multiple pre-built agents;
[0065] In this embodiment, to improve the accuracy and efficiency of question answering, a corresponding agent is pre-built for each type of question identified. Since agents with different functions have different characteristics, using the agent corresponding to the question type as the target agent for question-answering processing can effectively improve the accuracy and efficiency of question-answering processing.
[0066] For example, if the identified question is a factual question, the target agent matched from the pre-built multiple agents can be an information retrieval and extraction agent, which is used to answer the factual question.
[0067] If the identified problem type is a reasoning problem, the target agent matched from the pre-built multiple agents can be a reasoning agent, which is used to answer the reasoning problem.
[0068] If the identified problem type is a computational problem, the target agent matched from the pre-built multiple agents can be a computational agent used to solve the computational problem.
[0069] In this embodiment, multiple pre-built agents correspond to the categories of the intent recognition model. For each type of question identified, a corresponding agent is pre-built to answer the question of that type, thereby improving the accuracy and efficiency of answering that type of question.
[0070] S207. Using a target intelligent agent, based on a knowledge graph, generate answers to questions; and obtain the source information of the answers;
[0071] For example, for factual questions, an information retrieval and extraction agent can directly retrieve and extract the corresponding answer from the knowledge graph. Furthermore, the position information of the answer in the source document of the first format, such as the coordinate position of the box on page X, can be obtained from the attribute information of the entity nodes in the knowledge graph as the source information of the answer.
[0072] For example, for reasoning-based questions, a reasoning agent first retrieves relevant content information from the knowledge graph, along with the location information of this relevant content information within the first-format source document. Then, the reasoning agent performs certain reasoning to arrive at the answer. The location information of the relevant content information within the first-format source document can serve as tracing information for the answer.
[0073] For example, for computational problems, a computational agent first retrieves the source data required for the calculations in the problem, as well as the location information of the source data within the first-format source document, from the knowledge graph. Then, the computational agent performs certain calculations on the retrieved source data to obtain the answer. The location information of the source data within the first-format source document can serve as the source information for the answer.
[0074] S208. Present the answers to the questions;
[0075] S209. Based on the source information of the answer, the content information corresponding to the answer is highlighted in the source document in the first format.
[0076] Steps S208 and S209 can be displayed in any order, i.e., simultaneously. In this embodiment, while displaying the answer to the question, the source information of the answer can be highlighted in the source document of the first format, so that users can effectively verify the answer based on the source information.
[0077] The intelligent question-answering method in this embodiment can accurately and effectively generate structured target documents by obtaining content categories and corresponding location information from source documents. Then, a knowledge graph can be accurately and effectively constructed based on the structured target documents. Finally, based on the constructed knowledge graph, a target intelligent agent matching the question type can accurately and effectively answer the questions, which can effectively improve the accuracy and efficiency of question answering.
[0078] In this embodiment, by pre-constructing intelligent agents corresponding to each type of problem, different intelligent agents possess different capabilities, enabling them to accurately answer various types of problems and improve the accuracy and efficiency of answering each type of problem.
[0079] Figure 3 This is a schematic diagram based on the third embodiment of this disclosure; the intelligent question-answering processing method of this embodiment, in the above... Figure 2 Based on the technical solutions of the illustrated embodiments, the technical solutions of this disclosure will be described in further detail. For example... Figure 3 As shown, the intelligent question-answering processing method of this embodiment may specifically include the following steps:
[0080] S301. Obtain the source document in the first format and the questions raised regarding the source document;
[0081] S302. Detect whether the preset second format includes the first format; if it does, proceed to step S303; if it does not, proceed to step S307.
[0082] It should be noted that, in Figure 2 In the scenario of the illustrated embodiment, if the source document of the first format is a document generated by streaming input, such as a Word or PPT document, the document generated by streaming input is prone to formatting errors. In this case, directly using... Figure 2The technical solution of the illustrated embodiment may result in inaccurate location information for content categories. Therefore, to improve the accuracy of the obtained content categories, in this embodiment, before preprocessing the source document, it is first detected whether a preset second format includes the first format. In this embodiment, the preset second format is used to identify that the corresponding document was generated using a non-streaming input method. For example, the preset second format may include PDF and image formats. Compared to the first format, the document content structure of the second format is more stable and will not have layout chaos. It is an ideal document format in the document preprocessing stage and can effectively improve the accuracy of obtaining content information and target location information for each content category.
[0083] If the preset second format does not include the first format, then the first format is determined to be the format of a streaming document generated by the streaming input method, such as Word or PPT format. In this case, the source document in the first format can be converted to the source document in the second format to stabilize the structure of the source document and avoid formatting errors. Please refer to the subsequent steps in this embodiment.
[0084] S303. Using a pre-trained layout analysis model, analyze the layout of the pages in the source document of the first format; the layout includes content categories and the position information of the content categories on the page; execute step S304;
[0085] The preset second format includes the first format. For example, the source document of the first format can be a PDF document or an image document. In this embodiment, the layout of each page of the source document of the first format can be analyzed page by page to obtain the layout of each page. In this embodiment, the source document of the first format can be a document with a complex format, which may include text paragraphs, tables, ID card images, etc. Correspondingly, the layout of each page includes at least one content category and the position information of each content category on the page. For example, the layout of each page includes at least one content category such as text paragraphs, tables, ID card images, headers, footers, and tables of contents. The position information of the content category on each page may include the vertex coordinate information of the box that can surround the content of the content category, as identified by the layout analysis module.
[0086] S304. Based on the position information of the content categories included in the page layout, extract the content information of the content categories from the page corresponding to the source document of the first format.
[0087] Specifically, this method allows for the extraction of content information for each content category on each page. For example, if a page's content category includes a header or footer, the content information of the header or footer can also be obtained based on their location information.
[0088] For example, when the content category includes tables, the content information of the tables can be obtained from the corresponding page in the source document of the first format based on the position information of the tables on the page.
[0089] In practical applications, tables on a webpage can include both full-frame tables and non-full-frame tables.
[0090] In practice, if the table on the page is a full-frame table, since the structure of a full-frame table is clear, the content information of the table can be directly obtained from the corresponding page in the source document of the first format based on the position information of the table on the page.
[0091] If the table on the page is not a full-frame table, the structure of the non-full-frame table is not clear enough. In order to accurately obtain the content information included in the non-full-frame table, a pre-trained table analysis model can be used to obtain the content information of the table from the corresponding page in the source document of the first format based on the position information of the table on the page.
[0092] By using the above method, the content information in the tables on the page can be accurately obtained.
[0093] Further optionally, in one embodiment of this disclosure, if the content category includes an ID card image, the ID card image is obtained from the source document of the first format based on the location information of the ID card image within the page; and a pre-trained ID card recognition model is used to recognize the content information of the ID card image.
[0094] The document images in this embodiment may include images of ID cards or business licenses, etc. Using this method, the content information in the document images on the page can be accurately obtained.
[0095] For content categories such as text paragraphs, headings, tables of contents, headers, footers, or notes, since these are all in plain text format, the corresponding content information can be obtained directly based on the location information of the content category.
[0096] S305. Determine the page's position information within the source document of the first format; proceed to step S306;
[0097] S306. Based on the content category's location information on the page and the page's location information in the source document of the first format, determine the target location information of the content category; proceed to step S309;
[0098] If the header or footer includes page numbers, the position of each page in the source document can be determined based on the page number information in the header or footer. Furthermore, the position information of each content category within the page can be combined with the page number information to uniquely identify the position information of each content category in the first-format source document, i.e., the target position information of each content category.
[0099] Alternatively, some first-format source documents may not include headers or footers, nor any page numbering information. In this case, when performing layout analysis on each page sequentially using the layout analysis model, following the order from front to back of the first-format source document, the position of each page in the source document is recorded. This, combined with the position information of the content categories within each page, can then determine the position information of each content category within the first-format source document, i.e., the target position information of each content category.
[0100] S307. Convert the source document in the first format page by page to obtain the source document in the second format; proceed to step S308.
[0101] At this point, the source document in the second format does not include the source document in the first format. Therefore, the source document in the first format needs to be converted according to the page format to obtain the source document in the second format. This improves the stability of the document structure and, consequently, the accuracy of obtaining the target location information of the content category in the subsequent source document.
[0102] S308. Obtain content information including content categories and target location information from the pages of the source document in the second format; proceed to step S309;
[0103] For example, this step can be implemented by including the following steps:
[0104] (1) A pre-trained layout analysis model is used to analyze the layout of the pages in the source document of the second format; the layout includes content categories and the position information of the content categories on the page;
[0105] (2) Based on the position information of the content categories included in the page layout, extract the content information of the content categories from the page corresponding to the source document of the second format;
[0106] (3) Determine the page's position information within the source document in the second format;
[0107] (4) Determine the target location information of the content category based on the location information of the content category on the page and the location information of the page in the source document of the second format.
[0108] For details on the specific implementation of steps (1)-(4), please refer to steps S303-S306 above. They will not be repeated here.
[0109] This method analyzes the layout of pages in the source document of the second format using a layout analysis model, thereby accurately and effectively obtaining the location information and corresponding content information of all content categories included on the page, and thus accurately obtaining the target location information of the content categories.
[0110] S309. Store the content category information and target location information in the structured target document; proceed to step S310.
[0111] S310. Extract entity nodes and semantic relationships from the structured target document to construct a knowledge graph, wherein the target location information of the content information of the entity node is stored in the attribute of the entity node.
[0112] S311. Use a pre-trained intent recognition model to identify the type of question;
[0113] S312. Based on the type of problem, match the corresponding target agent from multiple pre-built agents;
[0114] S313. Using a target intelligent agent, based on a knowledge graph, generate answers to questions; and obtain the source information of the answers;
[0115] S314. Present the answers to the questions;
[0116] S315. Based on the source information of the answer, the content information corresponding to the answer is highlighted in the source document in the second format.
[0117] Optionally, in this embodiment, step S315 can be omitted, and the source information of the answer can be displayed directly when the answer is displayed, such as the location information of the answer-related content information in the source document. The user can then manually check the corresponding content information based on the source information of the answer to verify the answer.
[0118] For the specific implementation of steps S311-S315, please refer to the above. Figure 2 The implementation of steps S205-S210 in the illustrated embodiment will not be described again here. Since the source document structure of the second format is more stable, this embodiment displays the content information corresponding to the source information of the answer in the source document of the second format. Although steps S303-S306 do not involve format conversion, the second format includes the first format at this time.
[0119] Further optionally, in one embodiment of this disclosure, if in step S311, the intent recognition model identifies other types of questions, or in step S313, the target agent, based on the knowledge graph, is unable to generate an answer to the question, the Large Language Model (LLM) can be invoked to generate an answer to the question based on the generated structured target document, ensuring that all questions can be answered most accurately and effectively.
[0120] Alternatively, in step S311, an intent recognition model is used to identify the type of question, and a target agent is matched based on step S312. However, in step S313, if the target agent cannot generate an answer to the question based on the knowledge graph, an LLM can be invoked to extract question-related content information based on the generated structured target document and return it to the target agent so that the target agent can generate an answer to the question based on the question-related content information. This also ensures that all questions can be answered most accurately and effectively.
[0121] Alternatively, in this embodiment, attribute information of content information for each content category can also be acquired and stored; for details, please refer to the above. Figure 2 The relevant descriptions of the embodiments shown will not be repeated here.
[0122] The intelligent question-answering processing method of this embodiment can convert the first format into a second format that is not generated by streaming input when the first format is a streaming document generated by streaming input. This can effectively improve the accuracy of the position information of each content category in the source document, and further improve the accuracy and efficiency of question answering.
[0123] In this embodiment, by pre-constructing intelligent agents corresponding to each type of problem, different intelligent agents possess different capabilities, enabling them to accurately answer various types of problems and improve the accuracy and efficiency of answering each type of problem.
[0124] The technical solution of this embodiment can be applied to processing documents with complex structures, including text paragraphs, tables, ID card images, titles, tables of contents, headers, footers, and annotations, and is highly practical.
[0125] The technical solution of this embodiment can pre-build multiple intelligent agents, dynamically route tasks, reduce computational redundancy, and effectively improve the efficiency of question-and-answer processing.
[0126] The technical solution implemented here can preprocess and analyze the source document to generate a knowledge graph, and perform question-and-answer processing based on the knowledge graph. Since the knowledge graph structure has very strong contextual reasoning, especially for reasoning and computational questions, it can further improve the efficiency of answering such questions.
[0127] The technical solution implemented here can also obtain the source information of the answer and highlight the content information corresponding to the source information when displaying the answer, supporting auditing and verification.
[0128] The technical solution implemented here can support the processing of various types of documents such as certificates, annual reports, research reports, and contracts, without the need for manual adjustments, making it very convenient to use.
[0129] In this embodiment, the pre-built multiple intelligent agents are modularly designed, and functional modules can be added or removed according to business needs.
[0130] The technical solution of this embodiment can be applied in the financial field. For example, it can be used for annual report analysis, regulatory report verification, and automatic Q&A of financial indicators. It can also be applied to intelligent review of contract terms and risk warnings in bank credit approval.
[0131] The technical solution of this embodiment can also be applied in the legal field. For example, it can provide intelligent Q&A and identify default risks for contract terms; it can also automatically summarize legal documents and trace the source of clauses.
[0132] The technical solution of this embodiment can also be applied to document management within various organizations, supporting automatic parsing and Q&A of various official documents, announcements, approvals, and other documents; and can automatically identify and verify certificate information.
[0133] The technical solution of this embodiment can also be applied to scientific research and investment analysis, and can be used for extracting research report summaries, comparing data, and answering questions about core conclusions.
[0134] Figure 4 This is a schematic diagram based on the fourth embodiment of the present disclosure; as shown Figure 4 As shown, this embodiment provides an intelligent question-and-answer processing system 400, including:
[0135] Information acquisition module 401 is used to acquire a source document in a first format and questions raised in response to the source document;
[0136] The content acquisition module 402 is used to acquire content information and target location information of the content category based on the source document of the first format; the target location information is used to identify the location information of the content information of the content category in the source document of the first format.
[0137] Construction module 403 is used to construct a knowledge graph based on the content information of the content category and the target location information;
[0138] The answer generation module 404 is used to generate the answer to the question and the source information of the answer based on the knowledge graph using a pre-built intelligent agent.
[0139] The intelligent question-answering processing system 400 in this embodiment achieves the same implementation principle and technical effect as the above-mentioned related method embodiments by using the above-mentioned modules. For details, please refer to the description of the above-mentioned related method embodiments, which will not be repeated here.
[0140] Figure 5 This is a schematic diagram according to the fifth embodiment of this disclosure; as shown Figure 5 As shown, the intelligent question-answering processing system 500 of this embodiment, in the above-mentioned... Figure 4 Based on the technical solutions of the illustrated embodiments, the technical solutions of this disclosure will be described in further detail. For example... Figure 5 As shown, the intelligent question-answering processing system 500 of this embodiment includes the above-mentioned... Figure 4 The modules with the same name and function shown are: information acquisition module 501, content acquisition module 502, construction module 503, and answer generation module 504.
[0141] like Figure 5 As shown, the construction module 503 in this embodiment includes:
[0142] Storage unit 5031 is used to store the content information of the content category and the target location information in a structured target document;
[0143] The construction unit 5032 is used to extract entity nodes and semantic relationships from the structured target document and construct the knowledge graph, wherein the target location information of the content information where the entity node is located is stored in the attribute of the entity node.
[0144] Further optionally, in one embodiment of this disclosure, the content acquisition module 502 is configured to:
[0145] If the preset second format includes the first format, obtain the content information of the content category and the target location information from the page of the source document of the first format;
[0146] If the second format does not include the first format, the source document of the first format is converted page by page to obtain the source document of the second format; the content information of the included content categories and the target location information are obtained from the pages of the source document of the second format.
[0147] Further optionally, in one embodiment of this disclosure, the content acquisition module 502 is configured to:
[0148] A pre-trained layout analysis model is used to analyze the layout of pages in the source document of the second format; the layout includes the content category and the position information of the content category on the page;
[0149] Based on the position information of the content categories included in the layout of the page, the content information of the content categories is extracted from the page corresponding to the source document of the second format;
[0150] Determine the position information of the page in the source document of the second format;
[0151] Based on the position information of the content category on the page and the position information of the page in the source document of the second format, the target position information of the content category is determined.
[0152] Further optionally, in one embodiment of this disclosure, the content acquisition module 502 is configured to:
[0153] When the content category includes a table, the content information of the table is obtained from the corresponding page in the source document of the second format, based on the position information of the table within the page.
[0154] Further optionally, in one embodiment of this disclosure, the content acquisition module 502 is configured to:
[0155] If the table is a full-frame table, based on the position information of the table within the page, the content information of the table is obtained from the corresponding page in the source document of the second format;
[0156] If the table is not a full-frame table, a pre-trained table analysis model is used to obtain the content information of the table from the corresponding page in the source document of the second format based on the position information of the table within the page.
[0157] Further optionally, in one embodiment of this disclosure, the content acquisition module 502 is configured to:
[0158] If the content category includes an ID card image, the ID card image is obtained from the source document of the second format based on the location information of the ID card image within the page.
[0159] A pre-trained document recognition model is used to identify the content information of the document image.
[0160] Further optional, such as Figure 5 As shown, in one embodiment of this disclosure, the answer generation module 504 includes:
[0161] The identification unit 5041 is used to identify the type of the problem using a pre-trained intent recognition model;
[0162] The matching unit 5042 is used to match a corresponding target agent from a plurality of pre-built agents based on the type of the problem;
[0163] The generation unit 5043 is used to generate the answer to the question and the source information of the answer based on the knowledge graph using the target intelligent agent.
[0164] Further optionally, in one embodiment of this disclosure, the matching unit 5042 is used for:
[0165] If the question type is a factual question, the target intelligent agent is matched from the plurality of intelligent agents as an information retrieval and extraction intelligent agent;
[0166] If the problem type is a reasoning problem, the target intelligent agent is matched with the reasoning intelligent agent from the plurality of intelligent agents;
[0167] If the problem type is a computational problem, the target agent is matched from the plurality of agents to be a computational agent.
[0168] Further optional, such as Figure 5 As shown, in one embodiment of this disclosure, the intelligent question-answering processing system 500 further includes:
[0169] Display module 505 is used for:
[0170] Show the answer;
[0171] Based on the source information of the answer, the content information corresponding to the answer is highlighted in the source document displayed in the second format.
[0172] Further optionally, in one embodiment of this disclosure, the generation unit 5043 is also used for:
[0173] If the target agent, based on the knowledge graph, cannot generate an answer to the question, a large language model is used to obtain target content information related to the question from the structured target document; the large language model is then used to generate an answer to the question based on the target content information.
[0174] The intelligent question-answering processing system 500 in this embodiment achieves the same implementation principle and technical effect as the above-mentioned related method embodiments by using the above-mentioned modules. For details, please refer to the description of the above-mentioned related method embodiments, which will not be repeated here.
[0175] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0176] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0177] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0178] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded into random access memory (RAM) 603 from storage unit 608. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0179] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0180] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the methods of this disclosure. For example, in some embodiments, the methods of this disclosure may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the methods of this disclosure described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the methods of this disclosure by any other suitable means (e.g., by means of firmware).
[0181] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0182] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0183] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0184] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0185] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0186] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0187] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0188] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. An intelligent question-answering processing method, comprising: Obtain the source document in the first format and the questions raised in response to the source document; Based on the source document of the first format, content information and target location information including content categories are obtained; the target location information is used to identify the location information of the content information of the content category in the source document of the first format. Based on the content information of the content category and the target location information, a knowledge graph is constructed; Using a pre-built intelligent agent, based on the knowledge graph, the answer to the question and the source information of the answer are generated.
2. The method according to claim 1, wherein, Based on the content information of the content category and the target location information, a knowledge graph is constructed, including: The content information of the content category and the target location information are stored in a structured target document; From the structured target document, entity nodes and semantic relationships are extracted to construct the knowledge graph, wherein the target location information of the content information where the entity node is located is stored in the attributes of the entity node.
3. The method according to claim 2, wherein, Based on the source document in the first format, obtain content information and target location information including content categories, including: If the preset second format includes the first format, obtain the content information of the content category and the target location information from the page of the source document of the first format; If the second format does not include the first format, the source document of the first format is converted page by page to obtain the source document of the second format; the content information of the included content categories and the target location information are obtained from the pages of the source document of the second format.
4. The method according to claim 3, wherein, Retrieve content information including content categories and target location information from the source document page of the second format, including: A pre-trained layout analysis model is used to analyze the layout of pages in the source document of the second format; the layout includes the content category and the position information of the content category on the page; Based on the position information of the content categories included in the layout of the page, the content information of the content categories is extracted from the page corresponding to the source document of the second format; Determine the position information of the page in the source document of the second format; Based on the position information of the content category on the page and the position information of the page in the source document of the second format, the target position information of the content category is determined.
5. The method according to claim 4, wherein, Based on the positional information of the content categories included in the page layout, the content information of the content categories is extracted from the page corresponding to the source document of the second format, including: When the content category includes a table, the content information of the table is obtained from the corresponding page in the source document of the second format, based on the position information of the table within the page.
6. The method according to claim 5, wherein, Based on the position information of the table within the page, the content information of the table is obtained from the corresponding page in the source document of the second format, including: If the table is a full-frame table, based on the position information of the table within the page, the content information of the table is obtained from the corresponding page in the source document of the second format; If the table is not a full-frame table, a pre-trained table analysis model is used to obtain the content information of the table from the corresponding page in the source document of the second format based on the position information of the table within the page.
7. The method according to claim 4, wherein, Based on the positional information of the content categories included in the page layout, the content information of the content categories is extracted from the page corresponding to the source document of the second format, including: If the content category includes an ID card image, the ID card image is obtained from the source document of the second format based on the location information of the ID card image within the page. A pre-trained document recognition model is used to identify the content information of the document image.
8. The method according to any one of claims 1-7, wherein, Using a pre-built intelligent agent, based on the knowledge graph, the answer to the question is generated, including: A pre-trained intent recognition model is used to identify the type of the question; Based on the type of problem, a corresponding target agent is matched from a plurality of pre-built agents; Using the target intelligent agent and based on the knowledge graph, the answer to the question and the source information of the answer are generated.
9. The method according to claim 8, wherein, Based on the type of problem, a corresponding target agent is matched from a pre-built pool of agents, including: If the question type is a factual question, the target intelligent agent is matched from the plurality of intelligent agents as an information retrieval and extraction intelligent agent; If the problem type is a reasoning problem, the target intelligent agent is matched with the reasoning intelligent agent from the plurality of intelligent agents; If the problem type is a computational problem, the target agent is matched from the plurality of agents to be a computational agent.
10. The method according to claim 8, wherein, After generating the answer to the question and the source information of the answer based on the knowledge graph using the target intelligent agent, the method further includes: Show the answer; Based on the source information of the answer, the content information corresponding to the answer is highlighted in the source document displayed in the second format.
11. The method according to any one of claims 2-8, wherein, The method further includes: if the target agent cannot generate an answer to the question based on the knowledge graph, a large language model is used to obtain target content information related to the question from the structured target document; and the large language model is used to generate an answer to the question based on the target content information.
12. An intelligent question-answering processing system, comprising: The information acquisition module is used to acquire a source document in a first format and questions raised in response to the source document; The content acquisition module is used to acquire content information and target location information, including content categories, based on the source document of the first format; the target location information is used to identify the location information of the content information of the content category in the source document of the first format. The construction module is used to construct a knowledge graph based on the content information of the content category and the target location information; The answer generation module is used to generate the answer to the question and the source information of the answer based on the knowledge graph using a pre-built intelligent agent.
13. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-11.
14. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-11.
15. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method according to any one of claims 1-11.