Task processing method, document dialogue method and document processing method
By building a multi-grained document structure diagram, using the association relationship and hierarchy between document blocks, the problem of limitations in document block knowledge is solved, and the comprehensiveness and accuracy of task processing is improved, and complex tasks such as full-text abstracts and chains can be handled. style reasoning.
Patent Information
- Application Number
- CN202411274436.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-11
AI Technical Summary
In the prior art, the knowledge limitations of document blocks lead to poor comprehensiveness and accuracy of task processing, and it is impossible to effectively handle complex tasks such as full-text abstracts, aggregated question-and-answer, and chain reasoning.
By building a multi-grained document structure diagram, using the association relationship and hierarchy between document blocks, the document representation ability is improved, and the input of the task processing model is realized to enhance the comprehensiveness and accuracy of task processing.
It improves the comprehensiveness and accuracy of task processing, can effectively handle complex tasks such as full-text abstracts, aggregated question-and-answer and chain reasoning, providing more detailed and accurate document knowledge.
Smart Images

Figure CN118797019B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a task processing method, a document dialogue method, and a document processing method. Background Art
[0002] With the development of computer technology, document-based task processing has gradually become a research focus. Take document question answering as an example. Document question answering refers to a natural language processing technology that allows users to ask questions to a document set in natural language and automatically extract relevant information from these documents to form answers.
[0003] At present, documents can usually be divided into multiple document blocks, and task processing can be performed on any document block. However, in the above scheme, due to the limited document knowledge in the document block, the comprehensiveness and accuracy of task processing are poor. Therefore, a comprehensive and accurate task processing solution is urgently needed. Summary of the invention
[0004] In view of this, an embodiment of the present application provides a task processing method. One or more embodiments of the present application also relate to a document dialogue method, a document processing method, a task processing device, a document dialogue device, a document processing device, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.
[0005] According to a first aspect of an embodiment of the present application, a task processing method is provided, including:
[0006] Obtaining task data for a target document and a document structure diagram of the target document;
[0007] The task data and the document structure diagram of the target document are input into the task processing model to obtain the task processing result, wherein the target document includes multiple document blocks, and the document structure diagram is constructed based on the association relationship between the multiple document blocks and the hierarchical structure diagram of the target document, and the hierarchical structure diagram is constructed with multiple document blocks as nodes and the hierarchical relationship between the multiple document blocks as edges.
[0008] According to a second aspect of an embodiment of the present application, a document dialogue method is provided, comprising:
[0009] Receive the conversation data for the target document sent by the client;
[0010] Inputting the dialog data and the document structure graph of the target document into the task processing model to obtain a dialog processing result, wherein the target document includes multiple document blocks, the document structure graph is constructed based on the association relationship between the multiple document blocks and the hierarchical structure graph of the target document, and the hierarchical structure graph is constructed with the multiple document blocks as nodes and the hierarchical relationship between the multiple document blocks as edges;
[0011] Send the conversation processing result to the client.
[0012] According to a third aspect of an embodiment of the present application, a document processing method is provided, including:
[0013] Obtaining a hierarchical structure graph of a target document, wherein the target document includes a plurality of document blocks, and the hierarchical structure graph is constructed with the plurality of document blocks as nodes and the hierarchical relationships between the plurality of document blocks as edges;
[0014] Input the information extraction pattern and hierarchical structure diagram of the target document into the task processing model to obtain the information extraction result;
[0015] According to the information extraction results, determine the association relationship between multiple document blocks;
[0016] According to the association relationship, the edges in the hierarchical graph are updated to obtain the document structure graph of the target document.
[0017] According to a fourth aspect of an embodiment of the present application, there is provided a task processing device, including:
[0018] A first acquisition module is configured to acquire task data for a target document and a document structure diagram of the target document;
[0019] The first input module is configured to input task data and a document structure diagram of a target document into a task processing model to obtain a task processing result, wherein the target document includes multiple document blocks, and the document structure diagram is constructed based on the association relationship between the multiple document blocks and a hierarchical structure diagram of the target document, and the hierarchical structure diagram is constructed with multiple document blocks as nodes and hierarchical relationships between the multiple document blocks as edges.
[0020] According to a fifth aspect of an embodiment of the present application, a document dialogue device is provided, including:
[0021] A receiving module, configured to receive the conversation data for the target document sent by the client;
[0022] a second input module configured to input the dialog data and a document structure graph of a target document into the task processing model to obtain a dialog processing result, wherein the target document includes a plurality of document blocks, the document structure graph is constructed based on association relationships between the plurality of document blocks and a hierarchical structure graph of the target document, and the hierarchical structure graph is constructed with the plurality of document blocks as nodes and the hierarchical relationships between the plurality of document blocks as edges;
[0023] The sending module is configured to send the dialogue processing result to the client.
[0024] According to a sixth aspect of an embodiment of the present application, there is provided a document processing device, including:
[0025] A second acquisition module is configured to acquire a hierarchical structure graph of a target document, wherein the target document includes a plurality of document blocks, and the hierarchical structure graph is constructed with the plurality of document blocks as nodes and the hierarchical relationships between the plurality of document blocks as edges;
[0026] A third input module is configured to input the information extraction pattern and the hierarchical structure diagram for the target document into the task processing model to obtain the information extraction result;
[0027] A determination module is configured to determine the association relationship between the plurality of document blocks according to the information extraction result;
[0028] The updating module is configured to update the edges in the hierarchical graph according to the association relationship to obtain the document structure graph of the target document.
[0029] According to a seventh aspect of an embodiment of the present application, there is provided a computing device, including:
[0030] Memory and processor;
[0031] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method provided in the first aspect, the second aspect, or the third aspect are implemented.
[0032] According to an eighth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program / instruction. When the computer program / instruction is executed by a processor, the steps of the method provided in the first aspect, the second aspect, or the third aspect are implemented.
[0033] According to the ninth aspect of the embodiments of the present application, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the steps of the method provided in the first aspect, the second aspect, or the third aspect.
[0034] A task processing method provided by an embodiment of the present application includes: obtaining task data for a target document and a document structure diagram of the target document; inputting the task data and the document structure diagram of the target document into a task processing model to obtain a task processing result, wherein the target document includes multiple document blocks, and the document structure diagram is constructed based on the association relationship between the multiple document blocks and a hierarchical structure diagram of the target document, and the hierarchical structure diagram is constructed with multiple document blocks as nodes and the hierarchical relationship between the multiple document blocks as edges. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 is an architecture diagram of a task processing system provided by an embodiment of the present application;
[0036] Figure 2 is a flowchart of a task processing method provided by an embodiment of the present application;
[0037] Figure 3 It is a schematic diagram of a document structure diagram in a task processing method provided by an embodiment of the present application;
[0038] Figure 4 It is a schematic diagram of a hierarchical structure diagram in a task processing method provided by an embodiment of the present application;
[0039] Figure 5 is a flowchart of a document dialogue method provided by an embodiment of the present application;
[0040] Figure 6 is a flowchart of a document processing method provided by an embodiment of the present application;
[0041] Figure 7 It is a process flow chart of a document processing method provided by an embodiment of the present application;
[0042] Figure 8 is a structural diagram of a task processing device provided by an embodiment of the present application;
[0043] Fig. 9 It is a structural diagram of a document dialogue device provided by an embodiment of the present application;
[0044] Fig.10 is a structural schematic diagram of a document processing device provided by an embodiment of the present application;
[0045] Fig.11 It is a structural diagram of a task platform provided by an embodiment of the present application;
[0046] Fig.12 It is a structural block diagram of a computing device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0047] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0048] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0049] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0050] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0051] In one or more embodiments of the present application, a large model refers to a deep learning model with large-scale model parameters, which usually contains hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than 10 trillion model parameters. A large model can also be called a foundation model / foundation model. The large model is pre-trained with large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks, and the model has good generalization ability, such as a large-scale language model (LLM, Large Language Model), a multi-modal pre-training model, etc.
[0052] When the big model is used in practice, only a small number of samples are needed to fine-tune the pre-trained model and it can be applied to different tasks. The big model can be widely used in natural language processing (NLP), computer vision and other fields. Specifically, it can be applied to computer vision tasks such as visual question answering (VQA), image description (IC, Image Caption), image generation, as well as natural language processing tasks such as text-based sentiment classification, text summary generation, and machine translation. The main application scenarios of the big model include digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc.
[0053] First, the terms involved in one or more embodiments of the present application are explained.
[0054] Portable Document Format-Parser (PDF-Parser) is a software tool or library used to parse the content of PDF files. This tool can extract text, images, tables and other elements from PDF files and convert this information into other formats for further processing or analysis.
[0055] Optical Character Recognition (OCR): is a technology that converts text in an image into editable and searchable text. OCR technology can be applied to scans, photos, books, newspapers and other images that contain printed or handwritten text.
[0056] Document Chunking: It is a text processing technique that divides a long document into a series of smaller, more manageable and processable fragments or chunks. Document chunking is applicable to natural language processing, information retrieval, text mining, and large-scale document processing.
[0057] Aggregated Question Answering: is an information retrieval and natural language processing technology that aims to collect and integrate relevant information from multiple sources to answer user questions. In traditional question-answering systems, answers are usually provided from a single source, while aggregated question answering attempts to provide more comprehensive and accurate answers by combining information from different sources.
[0058] Chain-of-Thought (CoT) is a technique in the field of artificial intelligence, especially for large models, which aims to improve the model's ability to solve tasks that require complex reasoning. The core idea of chain reasoning is to break down complex problems into a series of simpler, manageable steps, so that the model can solve the problem step by step, rather than trying to solve the entire problem at once.
[0059] For document-based tasks, document representation is a very important preparatory work. At present, documents can usually be parsed, and the text information inside can be extracted through layout recognition technologies such as PDF-Parser or OCR. The document is divided into multiple document blocks according to the text information, and task processing is performed on any document block. Assuming that the document has 1,000 words, it cannot be fully input into the model for task processing due to its length. Therefore, the 1,000 words can be cut into two document blocks of 500 words, and the document blocks related to the task data can be input into the model for task processing. However, in the above scheme, the granularity of the document representation is too coarse, and the document knowledge in the document block is relatively limited, resulting in poor comprehensiveness and accuracy of task processing, and it is also impossible to answer questions such as full-text summarization, aggregated question answering, and chain reasoning.
[0060] In order to solve the above problems, the embodiment of the present application improves the representation ability of unstructured multimodal documents by mining the documents at multiple granularities to form a document knowledge representation form of a multi-granularity document structure graph, thereby achieving a better effect in both fine-grained and coarse-grained task processing, making the task processing more comprehensive and the task processing results more accurate. Specifically, the task data for the target document and the document structure graph of the target document are obtained; the task data and the document structure graph of the target document are input into the task processing model to obtain the task processing results, wherein the target document includes multiple document blocks, and the document structure graph is constructed based on the association relationship between the multiple document blocks and the hierarchical structure graph of the target document, and the hierarchical structure graph is constructed with multiple document blocks as nodes and the hierarchical relationship between the multiple document blocks as edges.
[0061] In the present application, a task processing method is provided. The present application also relates to a document dialogue method, a document processing method, a task processing device, a document dialogue device, a document processing device, a computing device, a computer-readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.
[0062] Considering that the model parameters of the task processing model are relatively large and the computing resources of the client are limited, the task processing method proposed in the embodiment of the present application can be applied to the following: Figure 1 The task processing system shown is, but not limited to, Figure 1 , Figure 1 An architecture diagram of a task processing system provided by an embodiment of the present application is shown. The task processing system may include a client 100 and a server 200;
[0063] The client 100 is used to send task data for a target document to the server 200;
[0064] The server 200 is used to input the task data and the document structure diagram of the target document into the task processing model to obtain the task processing result, wherein the target document includes multiple document blocks, the document structure diagram is constructed based on the association relationship between the multiple document blocks and the hierarchical structure diagram of the target document, and the hierarchical structure diagram is constructed with the multiple document blocks as nodes and the hierarchical relationship between the multiple document blocks as edges; and send the task processing result to the client 100;
[0065] The client 100 is also used to receive the task processing result sent by the server 200.
[0066] like Figure 1 As shown, the task processing model is deployed in the server 200, and the server 200 can be connected to one or more clients 100 through a local area network connection, a wide area network connection, an Internet connection, or other types of data networks. The client 100 may include, but is not limited to: a smart phone, a tablet computer, a laptop computer, a PDA, a personal computer, a smart home device, a vehicle-mounted device, etc. The client 100 can also interact with the user through a graphical user interface to implement the call of the task processing model, thereby implementing the task processing method provided in the embodiment of the present application.
[0067] It is worth noting that the task processing method provided in the embodiment of the present application is generally executed by the server, but in other embodiments of the present application, when the operating resources of the client can meet the deployment and operating conditions of the task processing model, the client can also have similar functions as the server, thereby executing the task processing method provided in the embodiment of the present application. In other embodiments, the task processing method provided in the embodiment of the present application can also be jointly executed by the client and the server. Next, taking the execution of the task processing method proposed in the embodiment of the present application by the server as an example, the implementation process of the task processing method is described in detail.
[0068] See also Figure 2 , Figure 2 A flowchart of a task processing method provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0069] Step 202: Obtain task data for a target document and a document structure diagram of the target document.
[0070] In one or more embodiments of the present application, during task processing, task data for a target document may be acquired, thereby performing task processing based on the task data to obtain a task processing result.
[0071] It should be noted that the target document may be a document in different scenarios, such as a transaction document in a financial scenario, a knowledge document in an educational scenario, and a legal document in a legal scenario. The target document may be a document in different forms, such as PDF, HyperText Markup Language (HTML), Word document, table document, etc. The target document may be a document in different languages, such as an English document, a Chinese document, etc. In an optional embodiment of the present application, if the target document is a non-Chinese document, the target document may be converted into a Chinese document. The target document may be a unimodal document or a multimodal document, wherein the multimodal document includes any one of text content, image content, and table content. The multimodal document includes at least two of text content, image content, and table content. Task data refers to the data and information involved in performing a target task related to a target document. Task data includes, but is not limited to, the document content of the target document, the document identifier, and various parameters and settings in the process of processing the target document. The target task may be a task of different types for the target document, such as an aggregated question-and-answer task, a dialogue task, a summary extraction task, a chain reasoning task, a document analysis task, a document writing task, and the like.
[0072] In practical applications, there are many ways to obtain task data for a target document, which can be selected based on actual conditions, and the embodiments of the present application do not impose any restrictions on this. In one possible implementation of the present application, task data for a target document sent by a client can be received. In another possible implementation of the present application, task data for a target document can be read from other databases or data acquisition devices.
[0073] Step 204: Input the task data and the document structure diagram of the target document into the task processing model to obtain the task processing result, wherein the target document includes multiple document blocks, and the document structure diagram is constructed based on the association relationship between the multiple document blocks and the hierarchical structure diagram of the target document, and the hierarchical structure diagram is constructed with multiple document blocks as nodes and the hierarchical relationship between the multiple document blocks as edges.
[0074] It should be noted that the document structure graph (DocGraph) is used to represent the document structure and document content of the target document. The document structure graph captures the relationship between elements in the target document through a graph data structure. The document structure graph consists of nodes and edges, where nodes represent different components of the target document (such as paragraphs, sentences, words, etc.), and edges represent the connection relationship between nodes. The document structure graph can display the structured information in the target document, which helps to have a deeper understanding of the content and organizational structure of the target document. Through the document structure graph, various target tasks can be performed more easily. Document blocks include but are not limited to words, phrases, sentences, and paragraphs. An association relationship generally refers to the connection between two or more document blocks. Association relationships include but are not limited to grammatical relationships (such as subject-predicate relationships), semantic relationships (such as causal relationships), hierarchical relationships (such as chapters containing paragraphs), and entity relationships (such as synonymous relationships).
[0075] The task processing model refers to a deep learning model that can process the target task according to the given task data and document structure diagram and generate the corresponding processing results. The task processing model can be a large model or a model trained based on sample task data, sample document structure and sample processing results. The task processing result is related to the task type of the target task. If the target task is a summary extraction task, the task processing result is the document summary of the target document. If the target task is a document question-and-answer task, the task processing result is the document reply result. A document block refers to a logical unit or component in a target document. A document block includes at least one of text content, image content and table content. The association relationship between document blocks refers to the existence of semantic correlation, entity correlation, etc. between document blocks.
[0076] The hierarchical structure diagram of the target document is used to represent the hierarchical structure and document content of the target document. The hierarchical structure diagram can be called a hierarchical structure tree. A hierarchical structure tree refers to a tree data structure used to describe the internal structure of a document. This structure tree organizes the content of the document in the form of a tree. Each node represents a part or element in the document, and the relationship between the nodes reflects the hierarchical relationship between the document content. Hierarchical relationships include parent-child relationships and sibling relationships. If a parent node has multiple child nodes, and these child nodes have only one parent node, the relationship between the parent node and the child node can be called a parent-child relationship. If nodes at the same level have the same parent node, the relationship between nodes at the same level can be called a sibling relationship. The hierarchical structure tree includes a root node, child nodes, and leaf nodes. The root node usually represents the target document. The child node is a sub-part of the target document, such as a document block. A leaf node refers to a node without child nodes, which is usually the smallest segmentation unit of the target document. For example, in the target document, the root node is the entire target document, the child nodes are the chapters of the target document, and each chapter has subsections, and so on.
[0077] In actual applications, there are many ways to input the task data and the document structure diagram of the target document into the task processing model to obtain the task processing results. The specific selection depends on the actual situation. The embodiments of the present application do not impose any restrictions on this. In the first possible implementation method of the present application, the task data and the document structure diagram of the target document can be directly input into the task processing model to obtain the task processing results output by the task processing model. In the second possible implementation method of the present application, the task data, the document structure diagram of the target document and the processing prompt information (prompt) can be input into the task processing model to obtain the task processing results output by the task processing model, wherein the processing prompt information is used to guide the task processing model to generate the task processing results based on the task processing data and the document structure diagram. In the third possible implementation method of the present application, feature extraction can be performed on the task data and the document structure diagram of the target document respectively, and the extracted features can be input into the task processing model to obtain the task processing results.
[0078] By applying the solution of the embodiment of the present application, the target document is represented by utilizing multiple document blocks and the hierarchical relationship between the multiple document blocks, the coarse-grained information within the target document is mined, and the association relationship between the multiple document blocks is integrated to further mine the fine-grained information such as the text content, image content and table content within the target document, thereby representing the target document as a multi-granular document structure diagram, thereby providing more accurate and detailed document knowledge during the task processing process, thereby improving the comprehensiveness and accuracy of the task processing results.
[0079] In an optional embodiment of the present application, the above-mentioned inputting the task data and the document structure diagram of the target document into the task processing model to obtain the task processing result may include the following steps:
[0080] Extract features from task data to obtain task data features;
[0081] Extract features from the document structure graph to obtain document structure features;
[0082] The task data features and document structure features are input into the task processing model to obtain the task processing results.
[0083] It should be noted that feature extraction refers to the process of selecting and converting a set of features from raw data, which can effectively represent the key information in the raw data. Task data features refer to features extracted from task data that help complete the target task. Document structure features refer to features extracted from the document structure diagram that help complete the target task.
[0084] In practical applications, there are many ways to extract features from task data and obtain task data features. The specific method is selected according to the actual situation, and the embodiments of the present application do not impose any restrictions on this. In one possible implementation of the present application, the task data can be input into a bag of words model (BoW) to obtain task data features. In another possible implementation of the present application, the term frequency-inverse document frequency (TF-IDF) can be used to extract features from task data to obtain task data features.
[0085] Furthermore, there are many ways to extract features from the document structure graph and obtain document structure features, which can be selected based on actual conditions, and the embodiments of the present application do not impose any restrictions on this. In one possible implementation of the present application, the document structure graph can be input into a graph neural network (GNN) to obtain document structure features. In another possible implementation of the present application, the document structure graph can be input into a long short-term memory network (LSTM) to obtain document structure features.
[0086] By applying the solution of the embodiment of the present application, feature extraction is performed on the task data and document structure diagram outside the task processing model, so that the input of the task processing model is task data features and document structure features, making the application scope of the task processing model wider.
[0087] In an optional embodiment of the present application, before inputting the task data and the document structure diagram of the target document into the task processing model, the document structure diagram of the target document can be obtained. There are many ways to obtain the document structure diagram of the target document, which can be selected according to the actual situation, and the embodiment of the present application does not impose any restrictions on this. In a possible implementation method of the present application, the document structure diagram of the target document can be read from other data acquisition devices or databases. In another possible implementation method of the present application, the hierarchical structure diagram of the target document can be obtained, and the document structure diagram can be constructed based on the hierarchical structure diagram. That is, the above-mentioned inputting the task data and the document structure diagram of the target document into the task processing model, before obtaining the task processing result, can also include the following steps:
[0088] Get the hierarchical structure diagram of the target document;
[0089] Input the information extraction pattern and hierarchical structure diagram of the target document into the information extraction model to obtain the information extraction result;
[0090] According to the information extraction results, determine the association relationship between multiple document blocks;
[0091] According to the association relationship, the edges in the hierarchical graph are updated to obtain the document structure graph of the target document.
[0092] It should be noted that the information extraction schema for the target document refers to a structured description that defines what information to extract from the target document and how the information should be organized. The information extraction schema usually contains the key entities to be extracted, attributes, and the relationships between them. The information extraction model is used to extract the information extraction results from the document structure diagram of the target document using the information extraction schema of the target document. The information extraction model can be a pre-trained large model, or it can be a neural network model trained based on a sample information extraction model, a sample hierarchical result diagram, and sample extraction results. The information extraction results can be in text form or in tabular form, which is selected according to the actual situation, and the embodiments of the present application do not impose any restrictions on this.
[0093] For example, assuming that the target document is a Dongpo beef cooking instruction document, the information extraction pattern is ingredients, cooking method, and chef tips. The information extraction pattern and hierarchical structure diagram of the target document are input into the information extraction model, and the information extraction result is obtained as "Ingredients: beef, carrots, white radish, aniseed and bay leaves; Cooking method: Wash the beef and put it in clean water and cook until it is 70% done, then take it out and cut it into cubes...; Chef tips: Put a few hawthorns in the stewed beef, so that the beef can be cooked faster and have a fresh hawthorn fragrance."
[0094] In actual applications, when inputting the information extraction pattern and hierarchical structure diagram for the target document into the information extraction model, the information extraction pattern and hierarchical structure diagram can be directly input into the information extraction model, and extraction hint information can also be additionally added to the input of the information extraction model, that is, the information extraction pattern, hierarchical structure diagram and extraction hint information are input into the information extraction model to obtain the information extraction result.
[0095] Furthermore, when determining the association relationship between multiple document blocks based on the information extraction results, first, the information extraction results with the same information extraction mode can be determined, and then the document blocks to which these information extraction results belong can be determined. Thus, it can be determined that the document blocks to which these information extraction results belong have the same information extraction mode, that is, the document blocks to which these information extraction results belong have an association relationship. For example, the information extraction results beef and white radish have the same information extraction mode, and beef belongs to document block 1, and white radish belongs to document block 3, then it is determined that document block 1 and document block 3 have an association relationship. After determining the association relationship, edges can be added to the document blocks with an association relationship in the hierarchical graph to obtain the document structure graph of the target document.
[0096] By applying the solution of the embodiment of the present application, the information extraction pattern is used to extract information extraction results from the hierarchical diagram, and the information extraction results are used to determine the fine-grained relationship between multiple document blocks in the hierarchical diagram, so that the document structure diagram can provide more accurate and detailed document knowledge.
[0097] See also Figure 3 , Figure 3 FIG. 1 is a schematic diagram showing a document structure diagram in a task processing method provided by an embodiment of the present application. Figure 3 As shown, the document structure diagram includes five types of nodes, namely document nodes, document block nodes, table nodes, image nodes and text nodes. Figure 3 The solid single arrow in the indicates that there is a hierarchical relationship between the connected nodes, the dotted double arrow indicates that there is a semantic relationship between the connected nodes, the solid double arrow indicates that there is an entity relationship between the connected nodes, and the long dash double arrow indicates that there is a document relationship between the connected nodes. A document relationship indicates that two nodes are the same nodes in the document structure diagram of different documents.
[0098] In practical applications, there are many ways to obtain the hierarchical structure diagram of the target document, which can be selected according to the actual situation, and the embodiments of the present application do not impose any restrictions on this. In one possible implementation of the present application, the hierarchical structure diagram of the target document can be read from other data acquisition devices or databases. In another possible implementation of the present application, the hierarchical structure diagram of the target document can be constructed based on multiple document blocks in the target document and the hierarchical relationship between the multiple document blocks.
[0099] In an optional embodiment of the present application, the above-mentioned obtaining of the hierarchical structure diagram of the target document may include the following steps:
[0100] Acquire a target document, wherein the target document includes a plurality of document blocks, and the document blocks include at least one of text content, image content, and table content;
[0101] Parse multiple document blocks and determine the hierarchical relationship between the multiple document blocks;
[0102] With multiple document blocks as nodes and hierarchical relationships as edges, a hierarchical graph of the target document is constructed.
[0103] It should be noted that there are multiple ways to obtain the target document, which can be selected according to the actual situation, and the embodiments of the present application do not limit this. In one possible implementation of the present application, the target document sent by the user through the client can be received. In another possible implementation of the present application, the target document can be read from other data reading devices or databases.
[0104] In actual applications, after obtaining the target document, the text in the target document can be identified through OCR, layout recognition and other technologies, and the title, page number, text, table, picture, etc. corresponding to the text can be identified to determine multiple document blocks in the target document. Then, the hierarchical relationship between multiple document blocks is determined based on the location information (such as indentation, title level, paragraph spacing, etc.) and format information (such as font size, bold, italic, etc.) of the document blocks, or the hierarchical relationship between multiple document blocks is determined using layout analysis tools.
[0105] By applying the solution of the embodiment of the present application, a hierarchical diagram of the target document is constructed with multiple document blocks in the target document as nodes and the hierarchical relationships between the multiple document blocks as edges. This can intuitively display the relationship between the main parts and sub-parts of the target document, help to deeply understand the theme and development context of the target document, and provide more accurate document knowledge for the task processing process.
[0106] In an optional embodiment of the present application, before constructing the hierarchical structure diagram of the target document with multiple document blocks as nodes and hierarchical relationships as edges, the following steps may also be included:
[0107] Get the reading order of multiple document blocks;
[0108] Using multiple document blocks as nodes and hierarchical relationships as edges, constructing a hierarchical graph of the target document can include the following steps:
[0109] A hierarchical graph of the target document is constructed with multiple document blocks as nodes and hierarchical relationships and reading orders as edges.
[0110] It should be noted that the reading order of multiple document blocks refers to the way readers browse the various parts of the document in a certain logical order. The reading order is usually defined based on the structure and content layout of the document to ensure that the information can be correctly understood. The reading order includes but is not limited to the reading order based on physical position (such as reading from left to right and from top to bottom according to the actual position of the document block on the page) and the reading order based on logical structure (such as reading the title first and then the text / reading the chapter title first and then the sub-chapter title).
[0111] In practical applications, there are many ways to obtain the reading order of multiple document blocks, which are selected according to actual conditions, and the embodiments of the present application do not impose any restrictions on this. In another possible implementation of the present application, the reading order of multiple document blocks sent by the user through the client can be received. In another possible implementation of the present application, the reading order of multiple document blocks can be randomly selected from multiple candidate reading orders.
[0112] Furthermore, after obtaining the reading order of multiple document blocks, first, an initial hierarchical structure graph of the target document can be constructed with multiple document blocks as nodes and hierarchical relationships as edges. Then, edges can be added between multiple document blocks in the initial hierarchical structure graph according to the reading order to obtain the hierarchical structure graph of the target document.
[0113] By applying the solution of the embodiment of the present application, a hierarchical graph of the target document is constructed by taking multiple document blocks as nodes and hierarchical relationships and reading orders as edges, so that the hierarchical graph can not only display the hierarchical relationships between multiple document blocks, but also display the reading order, thereby providing more accurate document knowledge for the task processing process.
[0114] See also Figure 4 , Figure 4 FIG. 1 is a schematic diagram showing a hierarchical structure diagram in a task processing method provided by an embodiment of the present application. Figure 4 As shown, the root node in the hierarchical structure diagram represents the target document, and the root node includes two child nodes, document block 1 and document block 2. The child node document block 1 includes three leaf nodes, namely, table content, text content, and image content. Among them, document block 1 is a multimodal document block, and document block 1 includes four text segments that are read sequentially. The first text segment includes text content, the second text segment includes text content and image content, the third text segment includes table content, and the fourth text segment includes text content and image content. Among them, Figure 4 The solid single arrows in the hierarchical structure diagram shown represent the hierarchical relationship between document blocks, and the dashed single arrows represent edges added based on the reading order of multiple document blocks.
[0115] In an optional embodiment of the present application, since the target document may include non-text modal contents such as images and tables, in order to enable the task processing model to understand these contents more accurately, the summary information and key information of these contents can be determined, that is, the above-mentioned information extraction mode and hierarchical structure diagram for the target document are input into the information extraction model, and before obtaining the information extraction result, the following steps may be further included:
[0116] Inputting multiple document blocks into the information recognition model to obtain summary information and key information corresponding to the multiple document blocks;
[0117] Input the information extraction pattern and hierarchical structure diagram of the target document into the information extraction model to obtain the information extraction results, including:
[0118] The information extraction pattern, hierarchical structure diagram and summary information and key information corresponding to multiple document blocks of the target document are input into the information extraction model to obtain the information extraction result.
[0119] It should be noted that the information recognition model is used to identify summary information and key information in a document block. The information recognition model can be a pre-trained large model or a neural network model trained based on sample summary information, sample key information, and sample document blocks. Summary information can be called global information of a document block, and key information can be called local information of a document block. Global information refers to the descriptive summary content of a document block, and local information refers to the key content in a document block.
[0120] In actual applications, when multiple document blocks are input into the information recognition model, each document block can be directly input into the information recognition model to obtain summary information and key information of each document block. It is also possible to add recognition prompt information to the input of the information recognition model, that is, to input each document block and recognition prompt information into the information recognition model to obtain summary information and key information of each document block. Among them, the recognition prompt information may be, for example, to identify the summary and key information of the document block to obtain summary information and key information. Another example is to describe the global information and local information of the document block to obtain summary information and key information. The specific selection is made according to the actual situation, and the embodiments of the present application do not impose any limitation on this.
[0121] Exemplarily, if the document block includes text content, the pre-trained large model can be used to summarize and identify key information of the document block to obtain summary information and key information. If the document block includes table content, the pre-trained large model can be used to summarize and identify key information of the document block to obtain summary information and key information. If the document block includes image content, the multimodal large model can be used to globally and locally describe the document block to obtain summary information and key information. For example, the summary information of a document block including image content is "The picture is a scene of a family having a picnic on the lawn", and the key information is "There are three people in the picture, two adults and one child, the adults are wearing red clothes, and the child is wearing green clothes."
[0122] Furthermore, after obtaining the summary information and key information corresponding to each document block, the summary information and key information of each document block can be stored in the form of text on the node corresponding to the document block in the document structure diagram, thereby enriching the document knowledge in the document structure diagram.
[0123] By applying the solution of the embodiment of the present application, the information extraction pattern, hierarchical structure diagram and summary information and key information corresponding to multiple document blocks of the target document are input into the information extraction model to obtain the information extraction result, and the image content and table content in the document block are represented in text form in the document structure diagram, providing more comprehensive and accurate document knowledge for the task processing process.
[0124] In an optional embodiment of the present application, after obtaining the document structure diagram of the target document, the document structure diagram may be expanded using additional document blocks, that is, after the document structure diagram of the target document is obtained, the following steps may be further included:
[0125] Input the extended prompt information and the document structure diagram into the task processing model to obtain the document block to be added;
[0126] Using the document block to be added, the document structure diagram is updated to obtain an updated document structure diagram;
[0127] Inputting the task data and the document structure diagram of the target document into the task processing model to obtain the task processing result may include the following steps:
[0128] The task data and the updated document structure diagram of the target document are input into the task processing model to obtain the task processing result.
[0129] It should be noted that the extended prompt information is used to guide the task processing model to generate document blocks to be added that are related to each document block in the document structure diagram. The document blocks to be added refer to document blocks related to each document block in the document structure diagram. The relevance here can be the existence of entity relationships, semantic relationships, hierarchical relationships, etc. The number of document blocks to be added can be one or more. For example, the target document is a document about outdoor activities, and the document structure diagram includes the document block "camp". The extended prompt information and the document structure diagram are input into the task processing model, and the document blocks to be added can be "camping", "tent", and "single tent".
[0130] In actual applications, there are many ways to update the document structure diagram using the document block to be added, and obtain the updated document structure diagram. The specific selection depends on the actual situation, and the embodiments of the present application do not impose any restrictions on this. In one possible implementation of the present application, the document block to be added can be added to the document structure diagram, and an edge is added between the document block to be added and any document block to obtain an updated document structure diagram. In another possible implementation of the present application, a target document block that is very similar to the document block to be added can be screened out from multiple document blocks in the document structure diagram, and the document block to be added is added to the document structure diagram, and an edge is added between the document block to be added and the target document block to obtain an updated document structure diagram.
[0131] By applying the solution of the embodiment of the present application, the extended prompt information and the document structure diagram are input into the task processing model to obtain the document block to be added; the document block to be added is used to update the document structure diagram to obtain an updated document structure diagram, so that the updated document structure diagram includes more nodes, so that the updated document structure diagram can provide more accurate and detailed document knowledge, thereby improving the comprehensiveness and accuracy of the task processing results.
[0132] In an optional embodiment of the present application, the above-mentioned updating of the document structure diagram by using the document block to be added to obtain the updated document structure diagram may include the following steps:
[0133] Calculate the similarity index between the document block to be added and the information extraction result;
[0134] Filter the target document block from multiple document blocks according to similarity indicators;
[0135] In the document structure graph, a document block to be added is added, and an edge is added between the document block to be added and the target document block to obtain an updated document structure graph.
[0136] It should be noted that the similarity index is used to describe the degree of similarity between the document block to be added and the information extraction result. The similarity index can be a similarity (such as 0.8) or a similarity level (such as very similar, similar, dissimilar). The target document block refers to a document block corresponding to at least one information extraction result in the document structure diagram whose similarity index is greater than a preset threshold, wherein the preset threshold, such as 0.7, is set according to actual conditions. The target document block can also be understood as at least one document block in the document structure diagram that has a larger similarity index with the document block to be added.
[0137] In practical applications, there are many ways to calculate the similarity index between the document library to be added and the information extraction result, which can be selected according to the actual situation. The embodiments of the present application do not impose any restrictions on this. In one possible implementation of the present application, a similarity algorithm (such as cosine similarity, Euclidean distance, etc.) can be used to calculate the similarity index between the document block to be added and the information extraction result. In another possible implementation of the present application, feature extraction can be performed on the document block to be added to obtain the features to be added, feature extraction can be performed on the information extraction result to obtain the information extraction features, and the similarity algorithm can be used to calculate the similarity index between the features to be added and the information extraction features, and the similarity index is determined as the similarity index between the document block to be added and the information extraction result. Further, after obtaining the similarity index between the document block to be added and the information extraction result, at least one information extraction result with a larger similarity index can be first determined, and the document block corresponding to the at least one information extraction result can be determined as the target document block.
[0138] By applying the solution of the embodiment of the present application, in the document structure diagram, document blocks to be added that are related to each document block in the document structure diagram are added, and edges are added between the document blocks to be added and the target document blocks to obtain an updated document structure diagram, so that the structural relationship in the updated document structure diagram is more accurate, further improving the comprehensiveness and accuracy of the task processing results.
[0139] In an optional embodiment of the present application, after the edges in the hierarchical structure diagram are updated according to the association relationship to obtain the document structure diagram of the target document, the following steps may also be included:
[0140] Acquire a reference structure graph, wherein the reference structure graph and the document structure graph have at least one common node;
[0141] According to at least one identical node, merge the document structure graph and the reference structure graph to obtain a merged document structure graph;
[0142] Inputting the task data and the document structure diagram of the target document into the task processing model to obtain the task processing result may include the following steps:
[0143] The document structure diagram after the task data and the target document are merged is input into the task processing model to obtain the task processing result.
[0144] It should be noted that the reference structure graph refers to a structure graph having at least one common node with the document structure graph. Since the reference structure graph and the document structure graph have at least one common node, the reference document corresponding to the reference structure graph is related to the document structure graph.
[0145] In practical applications, there are many ways to obtain a reference structure diagram, which can be selected according to actual conditions, and the embodiments of the present application do not impose any restrictions on this. In one possible implementation of the present application, a reference structure diagram sent by a user through a client can be received. In another possible implementation of the present application, a reference structure diagram can be read from other data acquisition devices or databases.
[0146] Furthermore, when merging the document structure graph and the reference structure graph according to at least one identical node, the identical nodes in the document structure graph and the reference structure graph can be overlapped to obtain a merged document structure graph. A new graph can also be created to copy the nodes and edges in the document structure graph and the reference structure graph to the new graph. During the copying process, ensure that at least one identical node is not added repeatedly, and check the merged document structure graph to ensure that all edges are correctly connected to the corresponding nodes and that no information is missing. Then, the merged document structure graph of the task data and the target document is input into the task processing model to obtain the task processing result.
[0147] By applying the solution of the embodiment of the present application, the document structure diagram and the reference structure diagram are merged according to the nodes in the reference structure diagram that are the same as the document structure diagram to obtain a merged document structure diagram, thereby realizing the merging of the reference structure diagram and the document structure diagram, expanding the document knowledge in the document structure diagram, so that the merged document structure diagram can provide more accurate and detailed document knowledge, and improving the comprehensiveness and accuracy of the task processing results.
[0148] The following combination Figure 5 , taking the application of the task processing method provided by this application in the intelligent dialogue scenario as an example, the task processing method is further explained. Figure 5 A flowchart of a document dialogue method provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0149] Step 502: Receive the conversation data for the target document sent by the client.
[0150] Step 504: Input the conversation data and the document structure diagram of the target document into the task processing model to obtain the conversation processing result, wherein the target document includes multiple document blocks, and the document structure diagram is constructed based on the association relationship between the multiple document blocks and the hierarchical structure diagram of the target document, and the hierarchical structure diagram is constructed with multiple document blocks as nodes and the hierarchical relationship between the multiple document blocks as edges.
[0151] Step 506: Send the dialog processing result to the client.
[0152] It should be noted that the implementation of steps 502 to 504 can refer to the implementation of the above-mentioned task processing method, and the present embodiment will not be repeated. The dialogue data can be a simple dialogue question, such as what is the highest temperature in 2023, or a comprehensive question, such as "what equipment is needed for camping" and other summary and summary questions. The specific selection is based on the actual situation, and the present embodiment does not make any limitation on this.
[0153] By applying the solution of the embodiment of the present application, the target document is represented by utilizing multiple document blocks and the hierarchical relationship between the multiple document blocks, the coarse-grained information inside the target document is mined, and the association relationship between the multiple document blocks is integrated to further mine the fine-grained information inside the target document, thereby representing the target document as a multi-granular document structure diagram, thereby providing more accurate and detailed document knowledge during the document dialogue process, and improving the comprehensiveness and accuracy of the dialogue processing results.
[0154] By applying the solution of the embodiment of the present application, the target document is represented by utilizing multiple document blocks and the hierarchical relationship between the multiple document blocks, the coarse-grained information inside the target document is mined, and the association relationship between the multiple document blocks is integrated to further mine the fine-grained information inside the target document, thereby representing the target document as a multi-granular document structure diagram, thereby providing more accurate and detailed document knowledge during the document dialogue process, and improving the comprehensiveness and accuracy of the dialogue processing results.
[0155] See also Figure 6 , Figure 6 A flowchart of a document processing method provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0156] Step 602: Obtain a hierarchical structure graph of the target document, wherein the target document includes multiple document blocks, and the hierarchical structure graph is constructed with the multiple document blocks as nodes and the hierarchical relationships between the multiple document blocks as edges.
[0157] Step 604: Input the information extraction pattern and hierarchical structure diagram for the target document into the task processing model to obtain the information extraction result.
[0158] Step 606: Determine the association relationship between multiple document blocks based on the information extraction result.
[0159] Step 608: Update the edges in the hierarchical structure diagram according to the association relationship to obtain the document structure diagram of the target document.
[0160] It should be noted that the implementation of steps 602 to 608 can refer to the implementation of the above-mentioned task processing method, and will not be described in detail in the embodiment of the present application.
[0161] By applying the solution of the embodiment of the present application, the target document is represented by utilizing multiple document blocks and the hierarchical relationship between the multiple document blocks, the coarse-grained information inside the target document is mined, and the association relationship between the multiple document blocks is integrated to further mine the fine-grained information inside the target document, thereby representing the target document as a multi-granularity document structure diagram, thereby providing more accurate and detailed document knowledge during task processing.
[0162] In an optional embodiment of the present specification, after the edges in the hierarchical structure diagram are updated according to the association relationship to obtain the document structure diagram of the target document, the following steps may also be included:
[0163] Receive document retrieval data sent by the client;
[0164] Performing content retrieval on the document structure graph according to the document retrieval data to obtain retrieval results corresponding to the document retrieval data;
[0165] Send the search results to the client.
[0166] It should be noted that the document retrieval data is used to retrieve document content corresponding to the client's needs from the target document. The document retrieval data includes but is not limited to query words and query parameters. The query words are used to describe the information that the client wants to find, such as "how much is the price of a shirt". Query parameters such as sorting method, number limit of returned results, etc. are selected according to actual conditions, and the embodiments of this specification do not impose any restrictions on this. The retrieval result refers to the relevant documents or document fragments found from the target document based on the document retrieval data, such as "the price of a shirt is 99 yuan".
[0167] In actual applications, there are many ways to perform content retrieval on the document structure diagram according to the document retrieval data and obtain the retrieval results corresponding to the document retrieval data. The specific selection is based on the actual situation, and the embodiments of this specification do not impose any restrictions on this. In one possible implementation of this specification, the keywords in the document retrieval data can be matched with each node in the document structure diagram, and the nodes with a higher degree of matching can be determined as the retrieval results corresponding to the document retrieval data. In another possible implementation of this specification, a document search engine can be used to perform content retrieval on the document structure diagram according to the document retrieval data to obtain the retrieval results corresponding to the document retrieval data.
[0168] By applying the method of the embodiment of the present specification, the target document is represented as a multi-granularity document structure graph. Therefore, by performing content retrieval on the document structure graph according to the document retrieval data, more accurate and detailed retrieval results can be obtained.
[0169] See also Figure 7 , Figure 7 A flowchart of a document processing method provided by an embodiment of the present application is shown. Figure 7 As shown, the document processing process can be divided into six stages: target document parsing, hierarchical graph construction, summary information and key information identification, information extraction, document structure graph construction, and document structure graph update. Next, these six nodes are explained in detail.
[0170] Target document analysis: Analyze the target document, extract the text information through PDF-Parser or OCR and other layout recognition technologies, divide the document into multiple document blocks according to the text information;
[0171] Hierarchical graph construction: parse multiple document blocks and determine the hierarchical relationship between multiple document blocks; use multiple document blocks as nodes and hierarchical relationships as edges to construct a hierarchical graph of the target document;
[0172] Identification of summary information and key information: multiple document blocks in the hierarchical structure diagram of the target document are input into the information identification model to obtain summary information and key information corresponding to the multiple document blocks; the summary information and key information corresponding to the multiple document blocks are stored in multiple nodes of the hierarchical structure diagram;
[0173] Information extraction: Input the information extraction pattern for the target document and the hierarchical structure diagram storing the summary information and key information corresponding to multiple document blocks into the information extraction model to obtain the information extraction result;
[0174] Document structure graph construction: According to the information extraction results, determine the association relationship between multiple document blocks in the hierarchical graph; according to the association relationship, update the edges in the hierarchical graph to obtain the document structure graph of the target document;
[0175] Document structure graph update: input the extended prompt information and the document structure graph into the task processing model to obtain the document block to be added; calculate the similarity index between the document block to be added and the information extraction result; filter out the target document block from multiple document blocks based on the similarity index; add the document block to be added to the document structure graph of the target document, and add edges between the document block to be added and the target document block to obtain an updated document structure graph.
[0176] Corresponding to the above-mentioned task processing method embodiment, the present application also provides a task processing device embodiment, Figure 8 FIG. 1 is a schematic diagram showing the structure of a task processing device provided by an embodiment of the present application. Figure 8 As shown, the device comprises:
[0177] A first acquisition module 802 is configured to acquire task data for a target document and a document structure diagram of the target document;
[0178] The first input module 804 is configured to input the task data and the document structure diagram of the target document into the task processing model to obtain the task processing result, wherein the target document includes multiple document blocks, and the document structure diagram is constructed based on the association relationship between the multiple document blocks and the hierarchical structure diagram of the target document, and the hierarchical structure diagram is constructed with multiple document blocks as nodes and the hierarchical relationship between the multiple document blocks as edges.
[0179] Optionally, the device also includes: a third acquisition module, configured to obtain a hierarchical structure diagram of the target document; input the information extraction pattern and hierarchical structure diagram for the target document into the information extraction model to obtain an information extraction result; determine the association relationship between multiple document blocks based on the information extraction result; update the edges in the hierarchical structure diagram based on the association relationship to obtain a document structure diagram of the target document.
[0180] Optionally, the device also includes: a fourth input module, configured to input the extended prompt information and the document structure diagram into the task processing model to obtain the document block to be added; using the document block to be added, the document structure diagram is updated to obtain an updated document structure diagram; the first input module 804 is further configured to input the task data and the updated document structure diagram of the target document into the task processing model to obtain the task processing result.
[0181] Optionally, the fourth input module is further configured to calculate a similarity index between the document block to be added and the information extraction result; filter out a target document block from multiple document blocks based on the similarity index; add the document block to be added to the document structure diagram, and add an edge between the document block to be added and the target document block to obtain an updated document structure diagram.
[0182] Optionally, the device also includes: a fifth input module, configured to input multiple document blocks into the information recognition model to obtain summary information and key information corresponding to the multiple document blocks respectively; a third acquisition module, further configured to input the information extraction pattern, hierarchical structure diagram and summary information and key information corresponding to the multiple document blocks for the target document into the information extraction model to obtain the information extraction result.
[0183] Optionally, the third acquisition module is further configured to acquire a target document, wherein the target document includes multiple document blocks, and the document blocks include at least one of text content, image content and table content; parse the multiple document blocks to determine the hierarchical relationship between the multiple document blocks; and construct a hierarchical graph of the target document with the multiple document blocks as nodes and the hierarchical relationship as edges.
[0184] Optionally, the device also includes: a fourth acquisition module configured to acquire the reading order of multiple document blocks; and a third acquisition module further configured to construct a hierarchical structure diagram of the target document with multiple document blocks as nodes and hierarchical relationships and reading orders as edges.
[0185] Optionally, the device also includes: a fifth acquisition module, configured to acquire a reference structure diagram, wherein the reference structure diagram and the document structure diagram have at least one identical node; based on the at least one identical node, merging the document structure diagram and the reference structure diagram to obtain a merged document structure diagram; and a first input module 804, further configured to input the merged document structure diagram of the task data and the target document into the task processing model to obtain a task processing result.
[0186] Optionally, the first input module 804 is further configured to perform feature extraction on the task data to obtain task data features; perform feature extraction on the document structure graph to obtain document structure features; input the task data features and document structure features into the task processing model to obtain task processing results.
[0187] By applying the solution of the embodiment of the present application, since the task processing device includes a first input model that can use the document structure diagram to process task data, and the document structure diagram can represent the target document at multiple granularities, it can further provide the task processing device with more accurate and detailed document knowledge, thereby improving the comprehensiveness and accuracy of the task processing performed by the task processing device.
[0188] The above is a schematic scheme of a task processing device of this embodiment. It should be noted that the technical scheme of the task processing device and the technical scheme of the above task processing method belong to the same concept, and the details of the technical scheme of the task processing device that are not described in detail can all be referred to the description of the technical scheme of the above task processing method.
[0189] Corresponding to the above-mentioned document dialogue method embodiment, the present application also provides a document dialogue device embodiment, Fig. 9 FIG. 1 is a schematic diagram showing the structure of a document dialogue device provided by an embodiment of the present application. Fig. 9 As shown, the device comprises:
[0190] The receiving module 902 is configured to receive the conversation data for the target document sent by the client;
[0191] The second input module 904 is configured to input the dialog data and the document structure diagram of the target document into the task processing model to obtain a dialog processing result, wherein the target document includes multiple document blocks, the document structure diagram is constructed based on the association relationship between the multiple document blocks and the hierarchical structure diagram of the target document, and the hierarchical structure diagram is constructed with the multiple document blocks as nodes and the hierarchical relationship between the multiple document blocks as edges;
[0192] The sending module 906 is configured to send the dialogue processing result to the client.
[0193] By applying the solution of the embodiment of the present application, since the document dialogue device includes a second input model that can use the document structure diagram to process the dialogue data, and the document structure diagram can represent the target document at multiple granularities, it can further provide the document dialogue device with more accurate and detailed document knowledge, thereby improving the comprehensiveness and accuracy of the dialogue processing performed by the document dialogue device.
[0194] The above is a schematic scheme of a document dialogue device of this embodiment. It should be noted that the technical scheme of the document dialogue device and the technical scheme of the document dialogue method described above are of the same concept, and the details of the technical scheme of the document dialogue device that are not described in detail can be found in the description of the technical scheme of the document dialogue method described above.
[0195] Corresponding to the above document processing method embodiment, the present application also provides a document processing device embodiment, Fig.10 FIG. 1 is a schematic diagram showing the structure of a document processing device provided by an embodiment of the present application. Fig.10 As shown, the device comprises:
[0196] The second acquisition module 1002 is configured to acquire a hierarchical structure graph of a target document, wherein the target document includes a plurality of document blocks, and the hierarchical structure graph is constructed with the plurality of document blocks as nodes and the hierarchical relationships between the plurality of document blocks as edges;
[0197] The third input module 1004 is configured to input the information extraction pattern and the hierarchical structure diagram for the target document into the task processing model to obtain the information extraction result;
[0198] A determination module 1006 is configured to determine the association relationship between the plurality of document blocks according to the information extraction result;
[0199] The updating module 1008 is configured to update the edges in the hierarchical structure diagram according to the association relationship to obtain the document structure diagram of the target document.
[0200] Optionally, the device further includes: a retrieval module configured to receive document retrieval data sent by a client; perform content retrieval on the document structure diagram according to the document retrieval data to obtain retrieval results corresponding to the document retrieval data; and send the retrieval results to the client.
[0201] By applying the solution of the embodiment of the present application, the document processing device represents the target document by utilizing multiple document blocks and the hierarchical relationship between the multiple document blocks, thereby mining the coarse-grained information inside the target document, and further mining the fine-grained information inside the target document by integrating the association relationship between the multiple document blocks, thereby representing the target document as a multi-granularity document structure diagram, thereby providing more accurate and detailed document knowledge during the task processing process.
[0202] The above is a schematic solution of a document processing device of this embodiment. It should be noted that the technical solution of the document processing device and the technical solution of the document processing method described above are of the same concept, and the details not described in detail in the technical solution of the document processing device can be referred to the description of the technical solution of the document processing method described above.
[0203] See also Fig.11 , Fig.11 A schematic diagram of the structure of a task platform provided by an embodiment of the present specification is shown, and the task platform includes a request interface 1102 and a response unit 1104;
[0204] The request interface 1102 is used to receive a dialog processing request sent by a client, wherein the dialog processing request carries dialog data for a target document;
[0205] Response unit 1104 is used to input the dialogue data and the document structure diagram of the target document into the task processing model to obtain the dialogue processing result, wherein the target document includes multiple document blocks, and the document structure diagram is constructed based on the association relationship between the multiple document blocks and the hierarchical structure diagram of the target document, and the hierarchical structure diagram is constructed with multiple document blocks as nodes and the hierarchical relationship between the multiple document blocks as edges.
[0206] In an optional embodiment of this specification, the task platform also includes a document processing interface;
[0207] A document processing interface is used to obtain a hierarchical structure diagram of a target document, wherein the target document includes multiple document blocks, and the hierarchical structure diagram is constructed with multiple document blocks as nodes and hierarchical relationships between multiple document blocks as edges; the information extraction pattern and the hierarchical structure diagram for the target document are input into a task processing model to obtain information extraction results; based on the information extraction results, the association relationship between multiple document blocks is determined; based on the association relationship, the edges in the hierarchical structure diagram are updated to obtain the document structure diagram of the target document.
[0208] By applying the solution of the embodiments of this specification, the task platform represents the target document as a multi-granularity document structure diagram, providing more accurate and detailed document knowledge, thereby adapting to user requests for dialogue task processing, obtaining more accurate and detailed dialogue processing results, and realizing personalized dialogue services, providing users with an efficient, flexible and easy-to-use document service platform, and improving the user experience.
[0209] The above is a schematic scheme of a task platform of this embodiment. It should be noted that the technical scheme of the task platform and the technical scheme of the document dialogue method and document processing method described above are of the same concept, and the details not described in detail in the technical scheme of the task platform can be found in the description of the technical scheme of the document dialogue method and document processing method described above.
[0210] Fig.12 The block diagram of a computing device provided by an embodiment of the present application is shown. The components of the computing device 1200 include but are not limited to a memory 1210 and a processor 1220. The processor 1220 is connected to the memory 1210 via a bus 1230, and the database 1250 is used to store data.
[0211] The computing device 1200 also includes an access device 1240 that enables the computing device 1200 to communicate via one or more networks 1260. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1240 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world microwave interconnection access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0212] In one embodiment of the present application, the above components of the computing device 1200 and Fig.12 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.12 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0213] The computing device 1200 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 1200 may also be a mobile or stationary server.
[0214] The processor 1220 is used to execute computer programs / instructions, which, when executed by the processor, implement the steps of the above-mentioned task processing method or document dialogue method or document processing method.
[0215] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical schemes of the above-mentioned task processing method, document dialogue method and document processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical schemes of the above-mentioned task processing method or document dialogue method or document processing method.
[0216] An embodiment of the present application also provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned task processing method or document dialogue method or document processing method when executed by a processor.
[0217] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical schemes of the above-mentioned task processing method, document dialogue method and document processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical schemes of the above-mentioned task processing method or document dialogue method or document processing method.
[0218] An embodiment of the present application also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned task processing method or document dialogue method or document processing method when executed by a processor.
[0219] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical schemes of the task processing method, document dialogue method and document processing method described above belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be found in the description of the technical schemes of the task processing method or document dialogue method or document processing method described above.
[0220] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0221] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0222] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described action sequence, because according to the embodiments of the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of the present application.
[0223] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0224] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A task processing method, comprising: Acquire task data for a target document and a document structure diagram of the target document; The task data and the document structure diagram of the target document are input into a task processing model to obtain a task processing result, wherein the target document includes a plurality of document blocks, and the document structure diagram is constructed based on the association relationship between the plurality of document blocks and a hierarchical structure diagram of the target document, wherein the association relationship includes at least one of a grammatical relationship, a semantic relationship, and an entity relationship, and the association relationship is obtained based on an information extraction pattern of the target document and an information extraction result extracted from the hierarchical structure diagram, and the hierarchical structure diagram is constructed using the plurality of document blocks as nodes and the hierarchical relationships between the plurality of document blocks as edges.
2. The method according to claim 1, before inputting the task data and the document structure diagram of the target document into the task processing model and obtaining the task processing result, further comprises: Get the hierarchical structure diagram of the target document; Inputting the information extraction pattern for the target document and the hierarchical structure diagram into the information extraction model to obtain an information extraction result; Determining the association relationship between the plurality of document blocks according to the information extraction result; According to the association relationship, the edges in the hierarchical structure graph are updated to obtain the document structure graph of the target document.
3. The method according to claim 2, after updating the edges in the hierarchical structure diagram according to the association relationship to obtain the document structure diagram of the target document, further comprises: Inputting the extended prompt information and the document structure diagram into the task processing model to obtain the document block to be added; Using the document block to be added, updating the document structure diagram to obtain an updated document structure diagram; The step of inputting the task data and the document structure diagram of the target document into a task processing model to obtain a task processing result includes: The task data and the updated document structure diagram of the target document are input into a task processing model to obtain a task processing result.
4. The method according to claim 3, wherein the updating of the document structure diagram using the document block to be added to obtain an updated document structure diagram comprises: Calculating a similarity index between the document block to be added and the information extraction result; Filtering a target document block from the multiple document blocks according to the similarity index; In the document structure graph, the document block to be added is added, and an edge is added between the document block to be added and the target document block to obtain an updated document structure graph.
5. The method according to claim 2, before inputting the information extraction pattern for the target document and the hierarchical structure diagram into the information extraction model to obtain the information extraction result, further comprising: Inputting the multiple document blocks into an information recognition model to obtain summary information and key information respectively corresponding to the multiple document blocks; The step of inputting the information extraction pattern for the target document and the hierarchical structure diagram into the information extraction model to obtain the information extraction result includes: The information extraction pattern for the target document, the hierarchical structure diagram, and the summary information and key information respectively corresponding to the plurality of document blocks are input into the information extraction model to obtain an information extraction result.
6. The method according to claim 2, wherein obtaining the hierarchical structure diagram of the target document comprises: Acquire a target document, wherein the target document includes a plurality of document blocks, and the document blocks include at least one of text content, image content, and table content; Parsing the multiple document blocks to determine the hierarchical relationship between the multiple document blocks; A hierarchical graph of the target document is constructed with the multiple document blocks as nodes and the hierarchical relationships as edges.
7. The method according to claim 6, before constructing the hierarchical structure graph of the target document with the multiple document blocks as nodes and the hierarchical relationships as edges, further comprising: Obtaining a reading order of the plurality of document blocks; The step of constructing a hierarchical structure graph of the target document using the multiple document blocks as nodes and the hierarchical relationships as edges includes: A hierarchical structure graph of the target document is constructed with the multiple document blocks as nodes and the hierarchical relationship and the reading order as edges.
8. The method according to claim 2, after updating the edges in the hierarchical structure diagram according to the association relationship to obtain the document structure diagram of the target document, further comprises: Acquire a reference structure graph, wherein the reference structure graph and the document structure graph have at least one common node; According to the at least one identical node, merging the document structure graph and the reference structure graph to obtain a merged document structure graph; The step of inputting the task data and the document structure diagram of the target document into a task processing model to obtain a task processing result includes: The document structure diagram after the task data and the target document are combined is input into a task processing model to obtain a task processing result.
9. The method according to any one of claims 1 to 8, wherein the step of inputting the task data and the document structure diagram of the target document into a task processing model to obtain a task processing result comprises: Extracting features from the task data to obtain task data features; Performing feature extraction on the document structure graph to obtain document structure features; The task data features and the document structure features are input into a task processing model to obtain a task processing result.
10. A document dialogue method, comprising: Receive the conversation data for the target document sent by the client; Inputting the dialog data and the document structure graph of the target document into a task processing model to obtain a dialog processing result, wherein the target document includes a plurality of document blocks, the document structure graph is constructed based on association relationships between the plurality of document blocks and a hierarchical structure graph of the target document, the association relationships include at least one of grammatical relationships, semantic relationships, and entity relationships, the association relationships are obtained based on an information extraction pattern of the target document and an information extraction result extracted from the hierarchical structure graph, and the hierarchical structure graph is constructed using the plurality of document blocks as nodes and hierarchical relationships between the plurality of document blocks as edges; The dialogue processing result is sent to the client.
11. A document processing method, comprising: Acquire a hierarchical structure graph of a target document, wherein the target document includes a plurality of document blocks, and the hierarchical structure graph is constructed with the plurality of document blocks as nodes and the hierarchical relationships between the plurality of document blocks as edges; Inputting the information extraction pattern for the target document and the hierarchical structure diagram into the task processing model to obtain an information extraction result; Determine, according to the information extraction result, the association relationship between the plurality of document blocks, wherein the association relationship includes at least one of a grammatical relationship, a semantic relationship, and an entity relationship; According to the association relationship, the edges in the hierarchical structure graph are updated to obtain the document structure graph of the target document.
12. The method according to claim 11, after updating the edges in the hierarchical structure diagram according to the association relationship to obtain the document structure diagram of the target document, further comprises: Receive document retrieval data sent by the client; Performing content retrieval on the document structure graph according to the document retrieval data to obtain retrieval results corresponding to the document retrieval data; The search result is sent to the client.
13. A task platform, comprising a request interface and a response unit; The request interface is used to receive a dialog processing request sent by a client, wherein the dialog processing request carries dialog data for a target document; The response unit is used to input the dialogue data and the document structure diagram of the target document into the task processing model to obtain a dialogue processing result, wherein the target document includes multiple document blocks, and the document structure diagram is constructed based on the association relationship between the multiple document blocks and the hierarchical structure diagram of the target document, the association relationship includes at least one of a grammatical relationship, a semantic relationship, and an entity relationship, the association relationship is obtained based on the information extraction pattern of the target document and the information extraction result extracted from the hierarchical structure diagram, and the hierarchical structure diagram is constructed with the multiple document blocks as nodes and the hierarchical relationships between the multiple document blocks as edges.
14. The task platform according to claim 13, further comprising a document processing interface; The document processing interface is used to obtain a hierarchical structure diagram of a target document, wherein: The target document includes multiple document blocks, and the hierarchical structure diagram is constructed with the multiple document blocks as nodes and the hierarchical relationships between the multiple document blocks as edges; the information extraction pattern for the target document and the hierarchical structure diagram are input into the task processing model to obtain the information extraction result; based on the information extraction result, the association relationship between the multiple document blocks is determined; based on the association relationship, the edges in the hierarchical structure diagram are updated to obtain the document structure diagram of the target document.
15. A computing device comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method described in any one of claims 1 to 9 or claim 10 or any one of claims 11 to 12 are implemented.
16. A computer-readable storage medium storing a computer program / instruction, which, when executed by a processor, implements the steps of the method described in any one of claims 1 to 9 or claim 10 or any one of claims 11 to 12.
17. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9 or claim 10 or any one of claims 11 to 12.
