PROCESSING MULTI-TYPE DOCUMENT FOR MACHINE LEARNING COMPREHENSION
20250322684 ยท 2025-10-16
Inventors
- Li Juan GAO (Xi'an, CN)
- Zhong Fang Yuan (Xi'an, CN)
- Yuan Yuan Ding (Shanghai, CN)
- Tong Liu (Xi'an, CN)
- Jin Zhou (Dalian, CN)
Cpc classification
G06V30/414
PHYSICS
International classification
G06V30/414
PHYSICS
Abstract
A computer-implemented method includes receiving a digital image of a document and a workflow describing an automation task. The method also include converting the digital image of the document into rich text that includes layout information in the document. The method further includes creating, based on the rich text and the workflow, a tree of thoughts that includes nodes and edges connecting the nodes and that binds at least some nodes representing the rich text with a task node representing the automation task. The method also includes converting the nodes and edges of the tree of thoughts into a natural language text. The method further includes inputting the natural language text into a language machine learning model with attention given to a token in the natural language text representing the task node. The language machine learning model, in response, outputs a result of completing the automation task.
Claims
1. A computer-implemented method comprising: receiving, by a processor set, a digital image of a document and a workflow describing an automation task; converting, by the processor set, the digital image of the document into rich text that includes layout information in the document; creating, by the processor set, based on the rich text and the workflow, a tree of thoughts that includes nodes and edges connecting the nodes and that binds at least some nodes representing the rich text with a task node representing the automation task; converting, by the processor set, the nodes and edges of the tree of thoughts into a natural language text; and inputting, by the processor set, the natural language text into a language machine learning model with attention given to a token in the natural language text representing the task node, the language machine learning model, in response, outputting a result of completing the automation task.
2. The computer-implemented method of claim 1, wherein the inputting the natural language text into the language machine learning model includes iteratively inputting the natural language text to complete the automation task.
3. The computer-implemented method of claim 1, wherein computer vision and optical character recognition techniques are used to convert the digital image of the document into the rich text.
4. The computer-implemented method of claim 1, wherein the result output by the language machine learning model is presented on a user interface.
5. The computer-implemented method of claim 1, wherein the result output by the large language model is fed into another automation task.
6. The computer-implemented method of claim 1, wherein the layout information includes images and associated captions contained in the document.
7. The computer-implemented method of claim 1, wherein the layout information includes formatting of document content contained in the document.
8. A computer program product comprising: a set of one or more computer-readable storage media; and program instructions, collectively stored in the set of one or more storage media, for causing a processor set to perform the following computer operations: receive a digital image of a document and a workflow describing an automation task; convert the digital image of the document into rich text that includes layout information in the document; create, based on the rich text and the workflow, a tree of thoughts that includes nodes and edges connecting the nodes and that binds at least some nodes representing the rich text with a task node representing the automation task; convert the nodes and edges of the tree of thoughts into a natural language text; and input the natural language text into a language machine learning model with attention given to a token in the natural language text representing the task node, the language machine learning model, in response, outputting a result of completing the automation task.
9. The computer program product of claim 8, wherein the natural language text is iteratively input into the language machine learning model to complete the automation task.
10. The computer program product of claim 8, wherein computer vision and optical character recognition techniques are used to convert the digital image of the document into the rich text.
11. The computer program product of claim 8, wherein the result output by the language machine learning model is presented on a user interface.
12. The computer program product of claim 8, wherein the result output by the language machine learning model is fed into another automation task.
13. The computer program product of claim 8, wherein the layout information includes images and associated captions contained in the document.
14. The computer program product of claim 8, wherein the layout information includes formatting of document content contained in the document.
15. A computer system comprising: a processor set; a set of one or more computer-readable storage media; and program instructions, collectively stored in the set of one or more computer-readable storage media, for causing the processor set to perform the following computer operations: receive a digital image of a document and a workflow describing an automation task; convert the digital image of the document into rich text that includes layout information in the document; create, based on the rich text and the workflow, a tree of thoughts that includes nodes and edges connecting the nodes and that binds at least some nodes representing the rich text with a task node representing the automation task; convert the nodes and edges of the tree of thoughts into a natural language text; and input the natural language text into a language machine learning model with attention given to a token in the natural language text representing the task node, the language machine learning model, in response, outputting a result of completing the automation task.
16. The computer system of claim 15, wherein the natural language text is iteratively input into the language machine learning model to complete the automation task.
17. The computer system of claim 15, wherein computer vision and optical character recognition techniques are used to convert the digital image of the document into the rich text.
18. The computer system of claim 15, wherein the result output by the language machine learning model is presented on a user interface.
19. The computer system of claim 15, wherein the result output by the language machine learning model is fed into another automation task.
20. The computer system of claim 15, wherein the layout information includes images and associated captions contained in the document.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0007]
[0008]
[0009]
[0010]
[0011]
[0012]
[0013]
[0014]
DETAILED DESCRIPTION
[0015] A computer-implemented method, in some embodiments, includes receiving, by a processor set, a digital image of a document and a workflow describing an automation task. The computer-implemented method also includes converting, by the processor set, the digital image of the document into rich text that includes layout information in the document. The computer-implemented method also includes creating, by the processor set, based on the rich text and the workflow, a tree of thoughts that includes nodes and edges connecting the nodes and that binds at least some nodes representing the rich text with a task node representing the automation task. The computer-implemented method also includes converting, by the processor set, the nodes and edges of the tree of thoughts into a natural language text. The computer-implemented method also includes inputting, by the processor set, the natural language text into a language machine learning model with attention given to a token in the natural language text representing the task node. The language machine learning model, in response, outputs a result of completing the automation task.
[0016] In this way, structured data is organized into text inputs that language machine learning models can easily comprehend, thus enabling efficient automation workflows. Various types of documents can be organized into inputs that language machine learning models can easily comprehend. This enables efficient automation processing of diverse document types, such as invoices, contracts, reports, and more, improves digital document processing efficiency and accuracy while reducing the cost and error rate of manual operations. Use cases can include, but are not limited to, automated invoice reimbursement, contract review, and document summarization.
[0017] One or more of the following features can be separable or optional from each other. In some embodiments, the inputting the natural language text into the language machine learning model includes iteratively inputting the natural language text to complete the automation task. In this way, an automation task can be completed in an accurate and/or precise manner, for example, based on feedback from a previous iteration.
[0018] In some embodiments, computer vision and optical character recognition techniques are used to convert the digital image of the document into the rich text. In this way, structural content and layout, information contained in the document content, can be extracted automatically without needing human input.
[0019] In some embodiments, the result output by the language machine learning model is presented on a user interface. In this way, a human-computer interface can provide the completed automation task and/or output of the completed automation task to facilitate information sharing, e.g., visibly, with an external agent who evaluates information and makes other decisions based on the information.
[0020] In some embodiments, the result that is output by the language machine learning model is fed into another automation task. In this way, another computer-implemented component can link with and use the result of the language machine learning model, for performing another automated task.
[0021] In some embodiments, the layout information includes images and associated captions contained in the document. In this way, elements of the document can be converted into rich text, incorporated into the tree of thoughts, and also incorporated into the natural language text for understanding by the language machine learning model.
[0022] In some embodiments, the layout information includes formatting of document content contained in the document. In this way, non-text information contained in the document can be converted into rich text, incorporated into the tree of thoughts, and also incorporated into the natural language text for understanding by the language machine learning model.
[0023] A system including at least one computer processor and at least one memory device coupled with the at least one computer processor is also disclosed, where the memory device stores program instructions that can be executed by the computer processor to cause the performance of one or more methods described above. A computer program product is also disclosed that includes a computer readable storage medium having program instructions embodied therewith, where the program instructions are readable by a device to cause the device to perform one or more methods described above.
[0024] Various aspects of the present disclosure are described by narrative text, flowcharts, block diagrams of computer systems and/or block diagrams of the machine logic included in computer program product (CPP) embodiments. With respect to any flowcharts, depending upon the technology involved, the operations can be performed in a different order than what is shown in a given flowchart. For example, again depending upon the technology involved, two operations shown in successive flowchart blocks may be performed in reverse order, as a single integrated step, concurrently, or in a manner at least partially overlapping in time.
[0025] A computer program product embodiment (CPP embodiment or CPP) is a term used in the present disclosure to describe any set of one, or more, storage media (also called mediums) collectively included in a set of one, or more, storage devices that collectively include machine readable code corresponding to instructions and/or data for performing computer operations specified in a given CPP claim. A storage device is any tangible device that can retain and store instructions for use by a computer processor. Without limitation, the computer readable storage medium may be an electronic storage medium, a magnetic storage medium, an optical storage medium, an electromagnetic storage medium, a semiconductor storage medium, a mechanical storage medium, or any suitable combination of the foregoing. Some known types of storage devices that include these mediums include: diskette, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), static random access memory (SRAM), compact disc read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanically encoded device (such as punch cards or pits/lands formed in a major surface of a disc) or any suitable combination of the foregoing. A computer readable storage medium, as that term is used in the present disclosure, is not to be construed as storage in the form of transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide, light pulses passing through a fiber optic cable, electrical signals communicated through a wire, and/or other transmission media. As will be understood by those of skill in the art, data is typically moved at some occasional points in time during normal operations of a storage device, such as during access, de-fragmentation or garbage collection, but this does not render the storage device as transitory because the data is not transitory while it is stored.
[0026] Computing environment 100 contains an example of an environment for the execution of at least some of the computer code involved in performing the inventive methods, such as multi-type document machine learning analysis code 200. In addition to multi-type document machine learning analysis code 200, computing environment 100 includes, for example, computer 101, wide area network (WAN) 102, end user device (EUD) 103, remote server 104, public cloud 105, and private cloud 106. In this embodiment, computer 101 includes processor set 110 (including processing circuitry 120 and cache 121), communication fabric 111, volatile memory 112, persistent storage 113 (including operating system 122 and multi-type document machine learning analysis code 200, as identified above), peripheral device set 114 (including user interface (UI) device set 123, storage 124, and Internet of Things (IoT) sensor set 125), and network module 115. Remote server 104 includes remote database 130. Public cloud 105 includes gateway 140, cloud orchestration module 141, host physical machine set 142, virtual machine set 143, and container set 144.
[0027] COMPUTER 101 may take the form of a desktop computer, laptop computer, tablet computer, smart phone, smart watch or other wearable computer, mainframe computer, quantum computer or any other form of computer or mobile device now known or to be developed in the future that is capable of running a program, accessing a network or querying a database, such as remote database 130. As is well understood in the art of computer technology, and depending upon the technology, performance of a computer-implemented method may be distributed among multiple computers and/or between multiple locations. On the other hand, in this presentation of computing environment 100, detailed discussion is focused on a single computer, specifically computer 101, to keep the presentation as simple as possible. Computer 101 may be located in a cloud, even though it is not shown in a cloud in
[0028] PROCESSOR SET 110 includes one, or more, computer processors of any type now known or to be developed in the future. Processing circuitry 120 may be distributed over multiple packages, for example, multiple, coordinated integrated circuit chips. Processing circuitry 120 may implement multiple processor threads and/or multiple processor cores. Cache 121 is memory that is located in the processor chip package(s) and is typically used for data or code that should be available for rapid access by the threads or cores running on processor set 110. Cache memories are typically organized into multiple levels depending upon relative proximity to the processing circuitry. Alternatively, some, or all, of the cache for the processor set may be located off chip. In some computing environments, processor set 110 may be designed for working with qubits and performing quantum computing.
[0029] Computer readable program instructions are typically loaded onto computer 101 to cause a series of operational steps to be performed by processor set 110 of computer 101 and thereby effect a computer-implemented method, such that the instructions thus executed will instantiate the methods specified in flowcharts and/or narrative descriptions of computer-implemented methods included in this document (collectively referred to as the inventive methods). These computer readable program instructions are stored in various types of computer readable storage media, such as cache 121 and the other storage media discussed below. The program instructions, and associated data, are accessed by processor set 110 to control and direct performance of the inventive methods. In computing environment 100, at least some of the instructions for performing the inventive methods may be stored in multi-type document machine learning analysis code 200 in persistent storage 113.
[0030] COMMUNICATION FABRIC 111 is the signal conduction path that allows the various components of computer 101 to communicate with each other. Typically, this fabric is made of switches and electrically conductive paths, such as the switches and electrically conductive paths that make up buses, bridges, physical input/output ports and the like. Other types of signal communication paths may be used, such as fiber optic communication paths and/or wireless communication paths.
[0031] VOLATILE MEMORY 112 is any type of volatile memory now known or to be developed in the future. Examples include dynamic type random access memory (RAM) or static type RAM. Typically, volatile memory 112 is characterized by random access, but this is not required unless affirmatively indicated. In computer 101, the volatile memory 112 is located in a single package and is internal to computer 101, but, alternatively or additionally, the volatile memory may be distributed over multiple packages and/or located externally with respect to computer 101.
[0032] PERSISTENT STORAGE 113 is any form of non-volatile storage for computers that is now known or to be developed in the future. The non-volatility of this storage means that the stored data is maintained regardless of whether power is being supplied to computer 101 and/or directly to persistent storage 113. Persistent storage 113 may be a read only memory (ROM), but typically at least a portion of the persistent storage allows writing of data, deletion of data and re-writing of data. Some familiar forms of persistent storage include magnetic disks and solid state storage devices. Operating system 122 may take several forms, such as various known proprietary operating systems or open source Portable Operating System Interface type operating systems that employ a kernel. The code included in multi-type document machine learning analysis code 200 typically includes at least some of the computer code involved in performing the inventive methods.
[0033] PERIPHERAL DEVICE SET 114 includes the set of peripheral devices of computer 101. Data communication connections between the peripheral devices and the other components of computer 101 may be implemented in various ways, such as Bluetooth connections, Near-Field Communication (NFC) connections, connections made by cables (such as universal serial bus (USB) type cables), insertion type connections (for example, secure digital (SD) card), connections made through local area communication networks and even connections made through wide area networks such as the internet. In various embodiments, UI device set 123 may include components such as a display screen, speaker, microphone, wearable devices (such as goggles and smart watches), keyboard, mouse, printer, touchpad, game controllers, and haptic devices. Storage 124 is external storage, such as an external hard drive, or insertable storage, such as an SD card. Storage 124 may be persistent and/or volatile. In some embodiments, storage 124 may take the form of a quantum computing storage device for storing data in the form of qubits. In embodiments where computer 101 is required to have a large amount of storage (for example, where computer 101 locally stores and manages a large database) then this storage may be provided by peripheral storage devices designed for storing very large amounts of data, such as a storage area network (SAN) that is shared by multiple, geographically distributed computers. IoT sensor set 125 is made up of sensors that can be used in Internet of Things applications. For example, one sensor may be a thermometer and another sensor may be a motion detector.
[0034] NETWORK MODULE 115 is the collection of computer software, hardware, and firmware that allows computer 101 to communicate with other computers through WAN 102. Network module 115 may include hardware, such as modems or Wi-Fi signal transceivers, software for packetizing and/or de-packetizing data for communication network transmission, and/or web browser software for communicating data over the internet. In some embodiments, network control functions and network forwarding functions of network module 115 are performed on the same physical hardware device. In other embodiments (for example, embodiments that utilize software-defined networking (SDN)), the control functions and the forwarding functions of network module 115 are performed on physically separate devices, such that the control functions manage several different network hardware devices. Computer readable program instructions for performing the inventive methods can typically be downloaded to computer 101 from an external computer or external storage device through a network adapter card or network interface included in network module 115.
[0035] WAN 102 is any wide area network (for example, the internet) capable of communicating computer data over non-local distances by any technology for communicating computer data, now known or to be developed in the future. In some embodiments, the WAN 102 may be replaced and/or supplemented by local area networks (LANs) designed to communicate data between devices located in a local area, such as a Wi-Fi network. The WAN and/or LANs typically include computer hardware such as copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and edge servers.
[0036] END USER DEVICE (EUD) 103 is any computer system that is used and controlled by an end user (for example, a customer of an enterprise that operates computer 101), and may take any of the forms discussed above in connection with computer 101. EUD 103 typically receives helpful and useful data from the operations of computer 101. For example, in a hypothetical case where computer 101 is designed to provide a recommendation to an end user, this recommendation would typically be communicated from network module 115 of computer 101 through WAN 102 to EUD 103. In this way, EUD 103 can display, or otherwise present, the recommendation to an end user. In some embodiments, EUD 103 may be a client device, such as thin client, heavy client, mainframe computer, desktop computer and so on.
[0037] REMOTE SERVER 104 is any computer system that serves at least some data and/or functionality to computer 101. Remote server 104 may be controlled and used by the same entity that operates computer 101. Remote server 104 represents the machine(s) that collect and store helpful and useful data for use by other computers, such as computer 101. For example, in a hypothetical case where computer 101 is designed and programmed to provide a recommendation based on historical data, then this historical data may be provided to computer 101 from remote database 130 of remote server 104.
[0038] PUBLIC CLOUD 105 is any computer system available for use by multiple entities that provides on-demand availability of computer system resources and/or other computer capabilities, especially data storage (cloud storage) and computing power, without direct active management by the user. Cloud computing typically leverages sharing of resources to achieve coherence and economies of scale. The direct and active management of the computing resources of public cloud 105 is performed by the computer hardware and/or software of cloud orchestration module 141. The computing resources provided by public cloud 105 are typically implemented by virtual computing environments that run on various computers making up the computers of host physical machine set 142, which is the universe of physical computers in and/or available to public cloud 105. The virtual computing environments (VCEs) typically take the form of virtual machines from virtual machine set 143 and/or containers from container set 144. It is understood that these VCEs may be stored as images and may be transferred among and between the various physical machine hosts, either as images or after instantiation of the VCE. Cloud orchestration module 141 manages the transfer and storage of images, deploys new instantiations of VCEs and manages active instantiations of VCE deployments. Gateway 140 is the collection of computer software, hardware, and firmware that allows public cloud 105 to communicate through WAN 102.
[0039] Some further explanation of virtualized computing environments (VCEs) will now be provided. VCEs can be stored as images. A new active instance of the VCE can be instantiated from the image. Two familiar types of VCEs are virtual machines and containers. A container is a VCE that uses operating-system-level virtualization. This refers to an operating system feature in which the kernel allows the existence of multiple isolated user-space instances, called containers. These isolated user-space instances typically behave as real computers from the point of view of programs running in them. A computer program running on an ordinary operating system can utilize all resources of that computer, such as connected devices, files and folders, network shares, CPU power, and quantifiable hardware capabilities. However, programs running inside a container can only use the contents of the container and devices assigned to the container, a feature which is known as containerization.
[0040] PRIVATE CLOUD 106 is similar to public cloud 105, except that the computing resources are only available for use by a single enterprise. While private cloud 106 is depicted as being in communication with WAN 102, in other embodiments a private cloud may be disconnected from the internet entirely and only accessible through a local/private network. A hybrid cloud is a composition of multiple clouds of different types (for example, private, community or public cloud types), often respectively implemented by different vendors. Each of the multiple clouds remains a separate and discrete entity, but the larger hybrid cloud architecture is bound together by standardized or proprietary technology that enables orchestration, management, and/or data/application portability between the multiple constituent clouds. In this embodiment, public cloud 105 and private cloud 106 are both part of a larger hybrid cloud.
[0041] Extracting information from images is in demand for a highly diverse set of applications in computer processes and automated workflows. These applications includes tasks such as basic invoice/contract information extraction, complex extraction of irregularly formatted report information, as well as an extraction of complex, heterogeneous data sources and uncertain pattern information. To address these challenges, scene-based training methods are commonly employed, where each scene requires a complete data collection, data annotation, data quality enhancement, model training, model optimization, and online deployment process. However, existing solutions suffer from drawbacks such as high manual workload and poor transferability. Throughout the entire model deployment lifecycle, a considerable amount of manual work is required, and the trained models cannot be easily transferred to other scenarios.
[0042] Furthermore, existing large-scale machine learning models perform well when processing natural language text data but exhibit subpar performance when dealing with structured format documents (e.g., word processing editor documents, portable document format (PDF)) and tabular data (e.g., spread sheet application format, comma-separated values (CSV)) or when directly inputting optical character recognition (OCR)-recognized text into large models. This is due to the loss of original formatting, positional information, other layout data, and image data when directly inputting these documents.
[0043] In some embodiments, a computer-implemented method and/or system is disclosed that organizes structured data (e.g., layout data) into text inputs that large language models can comprehend, thus enabling efficient automation workflows.
[0044] Large language models or LLMs are artificial neural networks, for example, which can have transformer-based architecture or other architectures, such as recurrent neural networks. Large language models are capable of performing natural language processing to understand natural language and performing natural language generation. A large language model is trained to understand and generate human-like text. Its function includes language understanding, text generation, information extraction, and task-specific applications. When given input text, it processes the data through neural networks to generate contextually relevant responses or outputs, leveraging its trained parameters and deep learning techniques. Large language models are a type of language machine learning models and, therefore, references throughout to large language models also refers to language machine learning models. Language machine learning models predict and generate plausible language.
[0045] In some embodiments, the computer-implemented method and/or system combines techniques such as tree of thoughts and layout analysis to organize various types of documents into inputs that large language models can easily comprehend. This combined approach enables efficient automation workflows. A computer-implemented method in some embodiments includes a process that performs layout analysis and OCR recognition, a process that builds trees of thoughts based on document content and tasks, and a process that inputs organized text and required tasks into a large language model and iteratively completes tasks. A system in some embodiments includes a processor set and program instructions stored in computer-readable storage media that cause the processor set to perform such processes. In various embodiments, the methods, processes, acts and/or operations described herein are performed by a computer or a processor set running computer codes or instructions (e.g., shown at 200 in
[0046]
[0047] At 204, the method includes building a tree of thoughts based on document content and tasks. Tasks, for example, are given as or extracted from a workflow. Such workflow can pre-exist or is given as an input. A workflow can be algorithm or a sequence of steps, which define one or more tasks, also referred to as one or more automation tasks. For instance, a workflow defines a set of (or a series of) automation tasks to be performed or completed. For different types of documents, the method constructs a tree of thoughts (TOT), also referred to as a mind map, to organize and describe the document's content and the documents' association with automation tasks, for example, relevance to automated tasks. Tree of thoughts is a graphical representation, a tree-like structure, which displays information (e.g., key information), structures, and hierarchical relationships within the document, e.g., extracted from the layout of the document. When building the tree of thoughts, the method considers the document's topics, chapters or sections, paragraphs, and/or other modular content items, as nodes of the tree, and key concepts, facts, data, and/or other content, as the edges of the tree. The tree of thoughts can also include additional metadata (e.g., author, date, source). The tree of thoughts binds such nodes to automation tasks that are relevant. The tree of thoughts (data structured into the tree of thoughts) is converted in an automated manner into a natural language text description.
[0048] At 206, the method includes inputting the organized text and required tasks into a large language model and iteratively completing tasks. For example, once the document content and tree of thoughts including tasks are constructed at 202 and 204 respectively, the method includes inputting the text description organized based on the tree of thought into the large language model for processing. The input is iteratively adjusted based on the feedback from the model. The large language model can comprehend various information within the tree of thoughts and perform or initiate performance of relevant operations based on the task requirements. In case some information is missing during the process, the text is further organized using the tree of thoughts and input into the large model until the automation workflow is completed.
[0049] The processing in the method shown in
[0050] Layout analysis and OCR recognition, for example, at 202, is further described below. In some embodiments, processing multiple document types is performed using a combination of layout analysis and OCR to recognize elements (e.g., main elements) within a single document. Using computer vision algorithms, different types of elements in the document, such as tables, body text, headings, and images, are distinguished. Layout analysis identifies the document's structure, thereby facilitating better extraction and comprehension of its content.
[0051]
[0052]
[0053] For different types of documents, the method includes organizing and describing the document's content and its association with automation tasks using a tree of thoughts (TOT). The tree of thoughts is a graphical representation that displays information, structures, and hierarchical relationships that were captured from the document based on the information and presentation of the document. When building the tree of thoughts, the method uses the document's themes, chapters, paragraphs, and other structural information as nodes of the tree. Other information such as key concepts, facts, data, and other content within the document are treated/used as edges of the tree. Additionally, the tree of thoughts can include metadata such as author, date, and source.
[0054]
[0055] At 504, the method includes extracting key content, e.g., key concepts, facts, data, and other content from the document. Natural language processing techniques such as keyword extraction, entity recognition, and relationship extraction are used to obtain this information in some embodiments. The extracted key content serves as the edges of the tree of thoughts, connecting various structural nodes.
[0056] At 506, the method includes associating with automation tasks. For example, during the construction of the tree of thoughts, the method also associates the document content with relevant automation tasks. This association can be achieved by adding task nodes and edges to the tree of thoughts. For example, in the context of invoice reimbursement, the method can add a reimbursement task node to the tree of thoughts and connect the reimbursement task node to key content such as invoice information.
[0057] At 508, the method includes building the tree of thoughts. The method organizes the extracted structural information, key content, and associated tasks into a complete tree of thoughts. This tree of thoughts can be presented in a graphical manner for easier comprehension and processing by users and large language models. The tree of thoughts is a graphical representation that shows key information, structures, and hierarchical relationships within the document. For example, when building the tree of thoughts, the method considers the document's topics, chapters, paragraphs, etc., as nodes of the tree, and key concepts, facts, data, etc., as the edges of the tree. It can also include additional metadata (e.g., author, date, source). In some embodiments, the constructed tree of thoughts can be shown as a JavaScript Object Notation (JSON), Extensible Markup Language (XML) or another like format. The constructed tree of thoughts also in at least some embodiments includes additional task nodes and/or edges representing identified automated tasks to be performed that are associated with the analyzed document and/or are taken from an associated workflow.
[0058]
[0059]
[0060] The code 200 inputs the converted text description and task information together into the large language model 704 based on one or more task requirements or automation tasks. In some embodiments, the code 200 while inputting into the large language model, combines the text description organized from the tree of thoughts 704 with the task information that needs to be accomplished, e.g., based on associations of nodes that represent content and nodes that represent tasks. This combining allows the large language model 704 to perform relevant operations according to the specified task. Generally, text in the form of well-structured language is easier for large models to comprehend compared to unorganized text recognized by OCR. This transition of the tree of thoughts to text and combination with task information enhances the model's understanding of user inputs and improves its performance on corresponding tasks. In some embodiments, the large language model 704 is given task driven attention, e.g., the given task can provide attention to the large language model 704. For example, the large language model 704 pays attention to a node that is related to the given task, in turn, possibly introducing more information that is related to the node.
[0061] In at least some embodiments, the large language model 704 pays attention to a node that is related to the given automation task by leveraging natural language processing techniques such as contextual keyword recognition and attention mechanism utilization.
[0062] In at least some embodiments the large language model 704 employs contextual keyword recognition to pay attention to the automation task node. The contextual keyword recognition is an analysis that recognizes keywords or phrases indicative of task nodes within the natural language text. By understanding the context surrounding these keywords, the large language model 704 effectively pinpoints and focuses its attention on relevant task nodes. For instance, if the document discusses a specific automation task such as data extraction, the large language model 704 can recognize related phrases or terms, e.g., using semantic word analysis, and prioritize the original term and the related phrases and terms during processing. In some embodiments, the large language model 704 adds additional weight to the tokens for these task-related terms as a part of providing this attention.
[0063] In at least some embodiments, the large language model 704 utilizes an attention mechanism, a component of neural networks, to dynamically weigh the importance of different parts of the input text. The large language model 704 employs this attention mechanism to allocate more focus and processing resources to task-related nodes within the natural language text. By dynamically adjusting the attention weights based on the relevance of each token to the task nodes, the model ensures more accurate and efficient task completion.
[0064] The large language model 704 outputs responses to the automation tasks based on the document, e.g., focuses on a given task with respect to the document, generates computer instructions that cause an automated task to be performed in an automated manner, and/or provides results of the given task. The code 200 analyzes an output 706 of the large language model and iteratively optimizes the output as needed. For example, the processor set analyzes the output results (output 706) of the large language model 704 and assesses whether the output results meet the requirements of the task, e.g., whether the large language model 704 accurately provided a response to one or more automation tasks. If the results do not meet the expectations, the processor set can adjust the tree of thoughts based on the model's feedback and re-input the data into the large language model until the task is satisfactorily completed. An adjustment of the tree of thoughts may include refining the structure of nodes and edges within the tree of thoughts based on insights gained from the large language model's feedback. Additionally, the code 200 may explore different traversal and description methods to enhance the effectiveness of the tree of thoughts in guiding the large language model's responses.
[0065] In some embodiments, the output 706 of the large language model 704 can be presented directly to users or serve as input for subsequent automated workflows. For example, in the context of invoice reimbursement, the large language model 704 can automatically extract and cross-check key information (such as invoice numbers, amounts, etc.) based on the tree of thoughts 702. For example, the structured representation of knowledge encapsulated within the tree of thoughts is leveraged in some embodiments. This structured framework aids in comprehending the information contained within documents, such as invoices or contracts. By utilizing the tree of thought trees, the large language model effectively navigates through the document's content and identifies key pieces of information, such as invoice numbers or contract dates. This structured approach facilitates a more comprehensive analysis of the document's contents and enables the accurate extraction of relevant data. The tree of thoughts facilitates the utilization of structured knowledge representation to enhance machine learning understanding and automated extraction of information from documents. The techniques described herein enable the automation of the reimbursement process, with the large language model 704 outputting accurately verified invoice information that can be automatically populated into the reimbursement system, thereby achieving an end-to-end automated reimbursement workflow.
[0066] In some embodiments, the system and/or method described herein provides for efficient processing of multiple document types. For example, by combining a tree of thoughts with layout analysis and other methods, the system and/or method organizes various types of documents into inputs that large language models can comprehend. This organization enables efficient automation processing of diverse document types, such as invoices, contracts, reports, and more. The system and/or method contribute to improving document processing efficiency and accuracy while reducing the cost and error rate of manual operations.
[0067] In some embodiments, the system and/or method described herein provide for flexible adaptation to different application scenarios. For example, the system and/or method exhibits strong generality and scalability, making the system and/or method adaptable to various application scenarios and task requirements. By adjusting the construction of a tree of thoughts and training data for the large language model, customization for different scenarios (e.g., invoice reimbursement, contract review, document summarization) can be achieved. This versatility allows the system and/or method to provide application value across a wide range of domains and scenarios.
[0068]
[0069] At 804, the processor set converts the scanned image such as the digital image of the document into rich text, for example, as described above with reference to
[0070] At 806, the processor set creates a tree of thoughts based on the rich text and the workflow, for example, as described above with reference to
[0071] At 808, the processor set converts the content nodes, which are bound to at least one task node, and at least one task node into text in a natural language format, also described above, for example, with reference to
[0072] At 810, the processor set inputs the natural language text into a large language model with attention given to a token in the natural language representing at least one task node. The large language model outputs a result of completing at least one automation task, also described above, for example, with reference to
[0073] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms a, an and the are intended to include the plural forms as well, unless the context clearly indicates otherwise. As used herein, the term or is an inclusive operator and can mean and/or, unless the context explicitly or clearly indicates otherwise. It will be further understood that the terms comprise, comprises, comprising, include, includes, including, and/or having, when used herein, can specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. As used herein, the phrase in some embodiments does not necessarily refer to the same embodiment, although it may. As used herein, the phrase in one embodiment does not necessarily refer to the same embodiment, although it may. As used herein, the phrase in another embodiment does not necessarily refer to a different embodiment, although it may. Further, embodiments and/or components of embodiments can be freely combined with each other unless they are mutually exclusive.
[0074] The corresponding structures, materials, acts, and equivalents of all means or step plus function elements, if any, in the claims below are intended to include any structure, material, or act for performing the function in combination with other claimed elements as specifically claimed. The description of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the invention. The embodiment was chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.