System and method for analyzing and generating document metadata
Through the combination of the structure analyzer and metadata creator model, the problems of low efficiency and poor accuracy of document analysis in the existing technology are solved, and structured metadata and documents are efficiently generated, adapting to the needs of different document types, and improving the flexibility and quality of document generation.
Patent Information
- Application Number
- CN202480001940.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-04-15
- Filing Date
- 2024-04-12
- Publication Date
- 2025-08-08
AI Technical Summary
The prior art has problems in inefficiency, limited accuracy, difficulty in dealing with unstructured data and poor adaptability across document types in document analysis, especially in professional fields such as finance or law, traditional methods rely on isolated processing of words or phrases, lack context-awareness and ambiguity elimination capabilities, and difficult to generate high-quality metadata.
The structure analyzer model is used to identify the document segment title, generate regular expressions, combine the metadata creator model to generate structured metadata for the document, and process the document library through a large language model to realize the segmentation and metadata extraction of the document, and use the database query and segment generator module to generate documents that meet user requests.
It improves the efficiency and accuracy of document analysis, can generate consistent metadata across different document types, supports the effective processing of unstructured data, and enhances the flexibility and quality of document generation.
Smart Images

Figure CN120457434A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a system and method for analyzing documents of different types and structures by generating and associating metadata for such documents, including determining logical, contextually appropriate divisions within a single document. Documents analyzed according to the present disclosure can be stored in a repository and used to generate new documents based on the analyzed metadata and examples therein. Background Art
[0002] Document analysis and management, particularly in specialized fields like finance or law, has traditionally relied on time-consuming manual analysis performed by costly subject matter experts. As a result, the process of reviewing, understanding, and managing complex collections of documents like legal contracts can be labor-intensive and slow, often leading to inefficiencies and increased costs.
[0003] The present invention improves upon existing approaches in several key respects. Traditional natural language processing ("NLP") approaches struggle with contextual awareness of documents. For example, prior NLP approaches typically rely on approaches that process words or phrases in isolation, such as bag-of-words models or rule-based techniques. These approaches do not consider the larger surrounding context, making it difficult to accurately capture the intended meaning of large amounts of text. Additionally, because many languages are inherently ambiguous, existing approaches struggle to disambiguate phrases and words. Early approaches also relied heavily on manually specified rules or patterns to extract metadata, which often required significant work and expertise. These rule-based systems struggled to handle changes in text formatting, language usage, or complex document structure, resulting in limited accuracy and scalability.
[0004] Many existing methods also lack the ability to generalize across different document types or domains. These methods often rely on specific heuristics or hard-coded rules that may not be effectively applied to different documents. This limits the accuracy and adaptability of existing methods when classifying metadata for documents with different structures, terminology, or styles.
[0005] Traditional methods also face difficulties when processing unstructured data such as free-form text or documents with inconsistent formats. These technologies are primarily designed for structured data, making it difficult to accurately classify metadata and extract metadata from unstructured documents.
[0006] Finally, existing methods often struggle to leverage additional data to learn and improve accuracy. These methods have limited ability to acquire knowledge from external corpora and cannot be adapted beyond their design purpose.
[0007] It is an object of the present disclosure to provide an alternative that solves or at least ameliorates at least some of the problems and disadvantages of these approaches. Summary of the Invention
[0008] The features and advantages of the present disclosure will be set forth in the following description, and in part will be obvious from the description, or may be learned by practicing the principles disclosed herein. The features and advantages of the present disclosure may be realized and obtained by the instruments and combinations particularly pointed out in the appended claims.
[0009] According to a first aspect of the present disclosure, there is provided a computer-implemented method for generating metadata for a document, the method comprising the following steps:
[0010] receiving a document via a communication interface for analysis;
[0011] extracting text of the document from the document and identifying a plurality of segment headings in the text using a structural analyzer model to derive regular expressions therefrom;
[0012] Generate a segmented document by analyzing the generated regular expression, the segmented document including the extracted text in the logical segment and the corresponding segment title;
[0013] generating, using a metadata creator model, structured metadata summaries for at least some of the plurality of logical segments of the segmented document;
[0014] Use the Metadata Creator model to generate its document metadata.
[0015] Advantageously, the method may further comprise storing the document, corresponding document metadata and structured metadata for each segment analyzed in one or more repositories.
[0016] The document metadata and structural metadata of each segment analyzed may be stored in a first database with links to documents from which these data were derived, wherein the documents are stored in a separate document repository.
[0017] The method may further include
[0018] (a) generating one or more document repositories comprising a plurality of documents and metadata, wherein the metadata is generated by the method described herein;
[0019] (b) generating, via a document outlining module, a document outline data structure for the one or more segments of the request; the document outline specifying a plurality of segments therein; and
[0020] (c) generating text derived from the segment metadata for each segment of the generated document outline data structure;
[0021] (d) generating each segment of the requested document and using a collating module to merge and refine the generated segments of the document.
[0022] Segment text can be generated in the following ways:
[0023] converting the segment and its metadata into a text request similar to a user request;
[0024] generating, by a database query module, a database query request according to the generated text request for querying the document library;
[0025] retrieving segment metadata information from the repository using the database query request;
[0026] The retrieved information and text are used to generate corresponding segment text via a segment creator module, and a data structure is created with the segment text or the segment text is appended to a pre-existing data structure.
[0027] Preferably, the arranging step comprises:
[0028] extracting definition terms and definitions for all segments into a common raw definition terms data structure;
[0029] converting the raw definition term data structure into prompts;
[0030] generating another data structure using the prompt, wherein the another data structure includes a plurality of consistent definition terms and associated enhanced definitions for the definition terms;
[0031] Before merging each paragraph together, each occurrence of the original defined term is replaced in each paragraph with the updated defined term, where appropriate.
[0032] Optionally, the method may further comprise generating a global list of defined terms in the document from the consistent defined terms data structure as a first paragraph in the generated document.
[0033] In another aspect, a system is provided, comprising a communication interface and a processor, the system configured to generate a document by performing a method comprising:
[0034] (a) generating a document library comprising a plurality of documents, the plurality of documents comprising a plurality of segments and corresponding metadata for the documents and segments; wherein the metadata is generated as described herein;
[0035] (b) receiving a new document request via the communication interface;
[0036] (c) generating a document outline data structure according to the request via a document outline module, wherein the document outline specifies a plurality of sections therein;
[0037] as well as
[0038] (d) generating, via a segment creator module, a document segment for each segment of the document outline data structure generated in response to the request; and
[0039] (e) Generating a document by merging and refining the generated segments through a collating module.
[0040] Each segment can be generated by:
[0041] (a) converting the segment and its metadata into a text request similar to a user request;
[0042] (b) generating, via a database query module, a database query request based on the generated text request for querying the document library;
[0043] (c) retrieving segment metadata information from the document repository using the database query request;
[0044] (d) generating, via a segment creator module, document segments using the retrieved segment metadata information and text, and creating a data structure or appending the generated document segments to a pre-existing data structure;
[0045] The collating module may be configured to:
[0046] (a) extracting the definition terms and definitions of all segments into a common raw definition term data structure;
[0047] (b) converting the original definition term data structure into a prompt;
[0048] (c) generating another data structure using the prompt, wherein the another data structure includes a plurality of consistent definition terms and associated enhanced definitions for the definition terms;
[0049] (d) before merging each paragraph together, replacing each occurrence of the original defined term in each paragraph with the updated defined term, where appropriate.
[0050] Preferably, each of these modules is a separate large language model.
[0051] In another aspect, one or more non-transitory computer-readable media having stored thereon instructions for performing the methods described herein are provided. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to illustrate the manner in which the above and other advantages and features of the present disclosure can be obtained, a more particular description of the principles briefly described above will be presented by reference to specific embodiments of the present disclosure as illustrated in the accompanying drawings. It should be understood that these drawings depict only exemplary embodiments of the present disclosure and, therefore, should not be considered to limit the scope of the present disclosure. The principles herein will be described and explained with additional specificity and detail through the use of the accompanying drawings.
[0053] Preferred embodiments of the present disclosure will be further explained in detail below by way of examples and with reference to the accompanying drawings, in which:
[0054] Figure 1A Depicts an exemplary embodiment according to the present disclosure, highlighting the process for performing Figure 1B and Figure 1C The metadata generation outlined in Figure 2A 、 Figure 2B An exemplary schematic diagram of the arrangement of components of the steps of the document creation method is outlined.
[0055] Figure 1B Depicted is an exemplary flow chart illustrating steps in a document workflow for analyzing metadata of one or more documents to create a metadata-enriched document library in an embodiment of the present disclosure.
[0056] Figure 1C Depicted is a flow diagram illustrating steps in a document workflow for generating one or more documents utilizing a metadata-enriched document repository in an embodiment of the present disclosure.
[0057] Figure 2A Depicted is a high-level flow chart illustrating the steps of dividing a document based on logical segments, creating metadata for such segments in the document, and creating metadata for the entire document in an embodiment of the present disclosure.
[0058] Figure 2B Describes the Figure 2A A more detailed flowchart of the steps for creating metadata for segments within a document and for the document itself is outlined in more detail in the steps of FIG.
[0059] Figure 3A Depicted is a flowchart outlining the steps of a process for generating a novel document according to another embodiment of the present disclosure.
[0060] Figure 3B Depicted overview by reference Figure 3A A flowchart of the steps performed by an embodiment of a document outline model.
[0061] Figure 3C Depicted in more detail outlines reference Figure 3A A flowchart of the steps of operation of the database query module.
[0062] Figure 3D Depicted in more detail outlines reference Figure 3A A flow chart of the steps of operation of the Segment Creator module.
[0063] Figure 3E Describes the overview used to combine and refine Figure 3A A flowchart of the steps performed by an exemplary tidying module for segments is outlined in FIG. DETAILED DESCRIPTION
[0064] Various embodiments of the present disclosure are discussed in detail below.
[0065] While specific embodiments are discussed, it should be understood that this is done for illustrative purposes only. Those skilled in the relevant art will recognize that other components and configurations may be used without departing from the spirit and scope of the present disclosure.
[0066] The disclosed technology addresses the need in the art for a convenient and reliable document analysis method and system that can be used to populate a document repository. Access to the document repository by a document generation system can enable document generation in response to user-provided prompts and previously analyzed documents in the document repository.
[0067] With reference to the accompanying drawings, Figure 1A An exemplary schematic architecture 10 is depicted that depicts various modules of an embodiment of the system of the present disclosure.
[0068] As depicted, a client request 12a for analysis in the form of one or more documents 14a is received at a server 20 or a collection of servers 22, 24 via an interface 21. The request may be received via user interaction with a graphical user interface 16a, or via an application programming interface (API) call 16b, or in other ways known in the art.
[0069] As is known in the art, each of the servers 22, 24 has one or more processors 26a, 26b and one or more memory storage devices 28a, 28b for storing data, operating instructions, etc. It should be understood that different hardware arrangements can be used without departing from the scope of the present disclosure. Each server 22, 24 includes a plurality of logic modules 30, which will be explained in more detail below. Each server communicates with a document repository 50, which includes metadata for documents and their segments; and a potential data storage device 52 that can store the documents themselves. It should also be understood that the same data storage device can be configured to store documents and metadata without departing from the present disclosure.
[0070] It should also be noted that for ease of reference, two servers have been depicted; the first server performs document analysis, while the second server performs document creation; but these functions may of course be performed by various modules located on the same server without departing from the present disclosure.
[0071] As depicted, the request for document analysis is processed by server 22, which includes text extraction module 32, which is functionality configured to process various document formats and accurately extract text content while preserving as much of the original structure and formatting as possible.
[0072] The server 22 further includes a structure analyzer module 34, which is advantageously a large language module configured to discern structure within documents using advanced AI techniques including pre-hinting and few-shot learning, as will be further described herein.
[0073] The structure analyzer model is configured to identify multiple segment titles in the extracted text and derive regular expressions therefrom; and then generate a segmented document by analyzing the generated regular expressions. The segmented document includes the extracted text in logical segments and the corresponding segment titles.
[0074] The server 22 further includes a metadata creator module 36, which is advantageously a large language module that is configured to analyze the text and generate structured metadata for each segment of the document. Advantageously, this metadata, received in JSON or XML format, is processed and incorporated into the document object as document-level metadata and returned to the main process for further action or storage in the document repository 50.
[0075] Similarly, a client request 12b to generate one or more documents 14b is received at the server 20 or the collection of servers 22, 24 via interface 21b. The request may be received via user interaction with a graphical user interface 16a, or via an application programming interface (API) call 16b, or in other ways known in the art.
[0076] As depicted, server 24 includes a plurality of modules 30 .
[0077] The document outline module 38 is a large language model that is configured to generate a structured outline for the requested document type. The outline is more than just a series of headings; it is a comprehensive framework that includes logical segments, each with associated metadata.
[0078] Use a two-stage approach to transform a structured outline into a comprehensive document.
[0079] The first phase focuses on collecting context and examples from the document base, while subsequent phases utilize another large language module (segment generator module 42) to generate the text content of each segment.
[0080] The database query module 40 (advantageously a large language model) translates the plain language query into a structured database query to retrieve relevant samples from the document repository 50 .
[0081] The Segment Generator module 42 is another large language model that is configured to use context and examples to generate text content for each segment. This module receives the logical title and associated metadata for each segment, as well as relevant results from the document repository as pre-prompt examples. These inputs are used to guide the content generation process, ensuring that the text is relevant and informed by existing knowledge retrieved from the document repository 50.
[0082] The decluttering module 44 performs a number of processes and phases and may include a number of sub-modules, as will be further described herein.The clarity and coherence of a generated document comprising multiple sections is enhanced by identifying and defining key terms used throughout the section.
[0083] Advantageously, the collating module 44 may include the following submodules:
[0084] a definition term extractor 46 , which is advantageously a large language model configured to identify and extract definition terms from the text of the generated segment;
[0085] a consistency checker 47 , which is advantageously a large language model configured to analyze a series of definition terms and ensure their consistency and accuracy;
[0086] The various functions 48 are configured to:
[0087] a) comparing the original definition terms with the concise definition terms to identify any changes or refinements noted during the consistency check, thereby producing a data structure that maps each original definition term to its concise updated version;
[0088] b) replace each instance of the original defined term with its corresponding concise defined term; and
[0089] c) Compile the concisely generated segments into a single complete document.
[0090] Figure 1B is an exemplary high-level overview 60 of the various steps in a document workflow for analyzing metadata of one or more documents. The architecture has been abstracted into three main components—application module 61 , large language module 62 , and database 64 .
[0091] One or more documents 65 are provided to application module 61, which uses large language module 62 to generate surface-level metadata about the entire document (e.g., the document's general category, date, author or party, etc.) in step 66. Large language module 62 also generates information about the document's logical organization (e.g., by chapter, section, clause, etc.). The application module then uses this information about the document's organization to divide the document into segments in step 67. These segments are then provided to large language module 62 for further analysis and creation of additional detailed metadata in step 68. The initial document, the collection of document segments, and the associated metadata are then stored in a database in step 69.
[0092] Figure 1C is an illustrative, high-level overview of the steps in a document workflow for generating one or more documents. Figure 1A The described architecture has been abstracted into three main components, namely the application module 70 , the large language module 72 and the database repository of processed documents 74 .
[0093] Once the document repository is established, the user can provide several requirements to the application module 70 in step 76. These requirements are then passed to the large language modules 72 in step 77, which cross-reference the appropriate information in the document repository to create a novel document based on the user's requirements.
[0094] Then, in step 80, the novel document is packaged and then presented to the user through the application module.
[0095] With reference to the accompanying drawings, Figure 2A An outline 100 of steps in a method according to an embodiment of the present disclosure is depicted.
[0096] As depicted, the process of generating metadata for documents begins upon receiving a request to analyze one or more documents from a user, typically through programmatic interaction using an API or via a user-activated GUI, in step 110. The request includes the document(s) to be processed, which may be in various formats, such as PDF, DOCX, or TXT files.
[0097] Next, text is extracted from the document for analysis in step 112. Preferably, the extracted text can be extracted so as to be appropriately sized for the underlying model (e.g., approximately 1,000 words); larger documents may be divided into multiple text excerpts.
[0098] In step 114, the extracted text is passed to a structure analyzer module, which is configured to analyze the text to generate regular expressions for section headings. By analyzing a large number of text excerpts, the module can identify patterns that indicate section breaks, chapter headings, or other important text divisions. Preferably, the structure analyzer module is a large language model that has been adapted to generate regular expressions from the extracted text and formatting to identify logical breaks (including, for example, section headings).
[0099] Advantageously, using low-temperature settings in the structure analyzer model parameters ensures that the generated expressions are consistent and less prone to variation, which is crucial for creating accurate regular expressions for partial titles. Similarly, limiting the maximum token return helps keep the model's output concise and directly relevant to the task at hand. The generated regular expressions provide a method for programmatically identifying and classifying different parts of a document based on their titles or formatting cues. Preferably, the structure analyzer can be tuned with small sample learning examples and pre-hinted to provide assistance.
[0100] Next, at step 116, the generated regular expressions and the complete extracted text of the document are analyzed to identify and extract logical breaks (such as chapters or sections) and form segmented documents. Preferably, this function is configured to handle various document layouts and formatting styles, and the structure analyzer generates corresponding regular expressions for the parts of the now segmented document.
[0101] A segmented document consists of a data structure (e.g., a list) that includes multiple elements, each of which contains the text of a separate logical section or part. In practice, the document text is divided into constituent logical segments, each of which represents a coherent unit of document structure. For example, a textbook would be divided into constituent sections, while a contract would be divided into constituent parts.
[0102] This structured representation of documents facilitates further analysis, manipulation, or processing, such as metadata extraction, aggregation, or indexing.
[0103] Next, at step 118, the tuned machine learning model (preferably a large language model) is configured to traverse the document segments (logical chapters) and generate structured metadata for the segments. Advantageously, the metadata is generated by the model in a format that is easily machine-readable (e.g., JSON or XML format) and processed and incorporated into the document object as document-level metadata.
[0104] Advantageously, the metadata creator is an advanced AI model that is trained to understand and extract key information from text segments using small-shot learning techniques. The agent is specifically designed to generate metadata in a machine-readable structured format (e.g., JSON or XML) that concisely summarizes the content and key attributes of each chapter. Given a block of text in a chapter, the agent will generate metadata that may include a chapter title, summary, keywords, and other relevant information. Preferably, using a moderate temperature setting in the agent ensures a balance between creativity and relevance of the generated metadata, while a large token length parameter allows for comprehensive metadata generation suitable for chapters of varying lengths. The generated metadata can be parsed according to the desired format where appropriate.
[0105] Finally, at step 120, the initial document, the corresponding extracted text, the entire metadata for the document, the text for each logical section, and the corresponding generated metadata are stored in one or more document repositories; advantageously, in a database or data storage device. Alternatively, given the structure and potential large scale of the data, a NoSQL database may be used due to its flexibility in handling various data formats and scalability. In some embodiments, the initial document may be stored separately from the extracted text, the entire metadata for the document, the text for each logical section, and the corresponding generated metadata in another document repository in another data storage device.
[0106] It should be understood that the database schema should be designed to accommodate the document text, the entire metadata, and the metadata for each logical section. This structured storage allows for efficient retrieval, searching, and analysis of the document and its contents at a later stage. The document's original format (e.g., PDF, DOCX) can also be stored directly in the database (if size permits) or as a reference to the file's storage location.
[0107] If the last document in the provided document set has been analyzed (branch 121 ), the process ends. If there are additional documents to be analyzed, the above steps may be repeated, as indicated by branch 122 .
[0108] Figure 2B Describes the overview as above in Figure 2A Flowchart 150 of the steps for creating metadata for the segments within the document as well as the document itself as described in step 118 of FIG.
[0109] As depicted, at step 152, the adapted model receives text that has been divided into logical segments. If the text is the first logical segment, then, as indicated by branch 151, at step 154, a metadata creator module is prompted with an indication that this is the first logical segment, along with the regular expression and extracted text generated for the segment as described above. Advantageously, metadata (e.g., JSON or XML) is generated for the logical segment. A document data structure, such as a document object, is created at step 156, and the generated metadata is saved at step 158.
[0110] Alternatively, if the text is not the first logical segment, the process follows branch 153 .
[0111] As indicated, at step 160, an evaluation is performed to determine whether additional logical segments exist. If additional logical segments exist (as indicated by branch 161), then at step 162, the metadata creator model is prompted with the current segment text, regular expression, and training material as described herein; and metadata is generated for the segment. At step 164, the metadata for the segment is saved in the document object. Process control then returns to step 160, where an evaluation is performed until the document no longer contains logical segments (branch 165). At step 166, the document data structure is returned to the main process.
[0112] refer to Figure 3A , depicts a flowchart 300 outlining exemplary steps of a process for generating a novel document according to another embodiment of the present disclosure.
[0113] As depicted at step 310, a user request is received. Advantageously, the user request specifies the type of document to be created and additional details in plain language. The user specifies the type of document they wish to create, providing this information in plain language to ensure ease of use and accessibility. The request may also include additional details that further refine or specify the requirements for the document to be generated. This may include the specific purpose of the document, any specific clauses that need to be included, and more subtle details regarding the style or tone of the document.
[0114] At step 312, the text of the user's request is passed to the document outline module. The operation of the document outline module is described in more detail further herein. It should be noted that a structured outline of the type of document requested is generated that is not simply a series of headings, but rather a comprehensive framework comprising logical segments, each with associated metadata.
[0115] The module is configured to operate at a high setting and allow a large maximum number of tokens. As is known in the art, this setting controls the randomness of the output. These settings are crucial because they enable the agent to generate more creative and diverse output, ensuring that the document outline is not only relevant but also tailored to the user's request.
[0116] In step 314, a document outline is generated by the document outline module and sent as a document data structure.
[0117] A text is generated for each segment in the document data structure, derived from the segment metadata, and then merged and refined using a tidying module as described herein.
[0118] In step 316, text generation for each segment is performed, wherein the segment and metadata are converted by a function into a text request similar to a user request; the text request is then further processed to generate the text content for each segment in two main stages.
[0119] In step 318, in a first phase, for each segment specified in the document data structure, a query is formulated to retrieve relevant samples from a document repository (advantageously a NoSQL repository), such as reference Figure 3C The output of the specialized database query module is used to collect context and examples from the document repository.
[0120] The second stage, illustrated in step 320, utilizes another complex model (segment creator module) to generate the text content of each segment, as shown in FIG. Figure 3D Further described.
[0121] As depicted at step 322, if this is the first generated segment, a data structure (e.g., a list) of segments ("collected generated segments") is created with this as the first entry. Alternatively, if this is not the first segment, the newly generated segment is appended at the end of the existing data structure.
[0122] At step 324, an evaluation is made as to whether additional logical segments exist in the document; and if so the process repeats (branch 325), otherwise proceeds to the next step (branch 326).
[0123] Once all segments are generated, they are merged and refined, as indicated in step 328 ; and the final document is returned to the user in step 330 .
[0124] Figure 3B Flowchart 350 depicts exemplary steps performed by the document outline module in step 312 above in greater detail.
[0125] First, the document type and related additional context are received from the user in step 351. This is then provided as a prompt to the document outline module, which provides a document outline of logical segments with metadata in step 352.
[0126] In step 354, this is processed in a function called by the outline module to generate a document outline with logical segments and associated metadata in a document data structure (e.g., a document object). This structure encapsulates the generated document outline, which includes logical segments and associated metadata for each logical segment (these logical segments may also be considered chapters, divisions, or parts where appropriate). The metadata can cover a range of information, from subject keywords to specific legal or technical requirements associated with each part, depending on the document type. This data structure is then returned to the user in step 356.
[0127] As in Figure 3C , a flowchart 360 depicting steps in the operation of the database query module at step 318 is shown in more detail. As depicted, a request is received from a user at step 362, and then at step 364, the request is sent as a prompt to the adapted model, which is configured to generate an appropriate database query based on the prompt (e.g., SELECT * FROM documents WHERE year="2021").
[0128] Queries are formulated using a database query module that translates plain language queries into structured database queries. This module is advantageously a large language model that has been fine-tuned using few-shot learning techniques to understand natural language requests and translate them into precise queries for a specific database type, such as SQL or NoSQL. As described herein, given that the document repository is advantageously stored in a NoSQL database, the process will focus on generating NoSQL queries.
[0129] Given the unique capabilities of this module, a low temperature setting is used to ensure that queries are generated with high accuracy and low variability. Preferably, a moderate maximum token parameter is used to ensure that queries are concise.
[0130] The query returns to the main process, as depicted in step 366 .
[0131] As in Figure 3D , a flowchart 370 depicting the steps in the segment creator module is shown in more detail.
[0132] As depicted in step 372, the logical segment title and metadata, along with the document type and associated relevant results, are received from the main process. In step 374, the function uses these to generate appropriate prompts, which are then provided to the segment generation module. In step 376, the segment generation module receives the logical title and associated metadata for each segment, along with relevant results from the document repository as pre-prompt examples. These inputs guide the content generation process in step 378, ensuring that the text is relevant to and informs the existing knowledge contained in the document repository.
[0133] Next, it is necessary to ensure that the segments are consistent and coherent, which involves using a tuned model, preferably a large language model called a decluttering module, to merge and refine the individual segments that have been created. The processing performed by the decluttering module is schematically depicted with reference to FIG4 , and this occurs in a number of stages as depicted in flow chart 400 .
[0134] As depicted at step 402 , a plurality of generated segments are provided.
[0135] If the first segment is being analyzed, an empty data structure is created in step 404. If the segment being analyzed is not the first segment, this step is skipped. Next, definition terms are extracted in step 405 and added to the definition terms data structure in step 406.
[0136] This first phase involves a "definition term extractor," a specialized Large Language Model (LLM) submodule. This submodule generates a new dictionary data structure on the first iteration, either by creating an entry in that data structure or by updating an existing one with an additional definition based on the content of the term being analyzed, if the additional information adds more detail. Each entry consists of a definition term extracted from the segment and the corresponding definition, along with a content identifier.
[0137] This dictionary data structure facilitates easy reference to defined terms and also ensures consistency and clarity throughout the segments that make up the document.
[0138] Preferably, the submodule operates at a low temperature setting to prioritize accuracy and relevance of the extracted terms, while a high token length parameter allows for comprehensive definitions.
[0139] This process is repeated for each of the plurality of segments, as indicated by branch 407 , until there are no additional segments to process, as indicated by branch 408 .
[0140] Once all definition terms have been extracted from the multiple segments that have been passed to the collation module, it is necessary to evaluate these definition terms and introduce consistency.
[0141] Advantageously, in step 410, the definition terms are inserted into a predefined prompt template for further use in pre-prompt adjustment.
[0142] This hint is then passed along with the temperature and maximum token settings to the definition term consistency checker submodule in step 412. This submodule operates with a moderate temperature setting to balance creativity and accuracy, and uses a high token length parameter to fully process each term and its definition.
[0143] This submodule (preferably a large language model) is trained with few-shot learning techniques, one of which is the creation of definition term prompts in step 410, and is specifically designed to analyze a set of definition terms and ensure their consistency and accuracy. The output of this submodule is a "concisely defined terms" data structure in which inconsistencies have been resolved and definitions have been refined.
[0144] Once the definition terms have been aligned, it is necessary to reintroduce them back into the document segments. This is performed in two main steps: in step 414, a mapping of the initially extracted "original" definition terms and the concise definition terms is performed. In step 416, using this mapping, the system iterates over the generated segments to replace the original terms with their concise counterparts.
[0145] Advantageously, each term in the original definition terminology is matched with a corresponding updated term and definition; and a corresponding replacement entry is created for the original data structure entry. If there is an inconsistency between the definitions associated with the original entry, the updated definition can be used to replace it. Once this process is performed for each term in the original terminology data structure, a modified data structure is created.
[0146] Then, in step 418, each occurrence of the definition term in each segment is replaced using the modified data structure in each segment, and the updated segment is then stored.
[0147] In step 420, the explicitly generated segments are combined into a single complete document and returned. Optionally, legal or academic documents may require the creation of a dedicated "Defined Terms" section that consolidates all concisely defined terms and their definitions. Advantageously, this section is added to the beginning of the document for the reader's reference. After this, all segments (including the newly added "Defined Terms" segment) are combined into a single document text.
[0148] The process culminates in a well-structured, coherent document that presents the generated content in a logical order and also provides the reader with a “Defined Terms” section for easy reference.
[0149] This approach enhances the readability and professionalism of the final document, ensuring it meets the standards expected of a comprehensive, polished text. The integration of concisely defined terms throughout the document ensures consistency and clarity.
[0150] The above embodiments are described by way of example only. Many variations are possible without departing from the scope of the present disclosure as defined in the appended claims.
[0151] In an exemplary application of the present system, assume that a financial analyst uses the present invention to create a library of financial reports related to various companies. The analyst uploads a collection of financial reports, such as balance sheets, income statements, and cash flow statements, through a user interface. The system processes each document using the methods described herein, extracting relevant information and generating comprehensive metadata for each report. The application module associates this metadata with the corresponding document, and the structure analyzer module suggests context-aware divisions (such as sections or subsections) to present the financial data in a more organized and accessible manner.
[0152] Once financial statements and their associated metadata are stored in a document repository, financial analysts can efficiently search and retrieve specific information based on their needs.
[0153] Furthermore, analysts can use the system to generate new documents, such as a research report comparing the financial histories of two different companies. Through the user interface, the analyst specifies the desired criteria, such as the names of the two companies, the financial metrics of interest, and the time period for comparison. The system then accesses the relevant financial statements and metadata stored in the document repository, retrieving the necessary information to perform the comparative analysis.
[0154] The system processes the extracted data, synthesizing each company's financial metrics and historical trends, and generates a comprehensive research report that highlights both differences and similarities in their financial performance. The report includes key financial data, comparative charts, and insightful observations, all customized to the analyst's requirements. By leveraging the document generation capabilities of the present invention, financial analysts can efficiently generate customized research reports that facilitate informed decision-making and improve the overall quality of their analysis.
[0155] The system's ability to generate metadata-rich document repositories and novel documents significantly improves the productivity and efficiency of financial analysts. By automating the document analysis and organization process, the system reduces the time and effort required for data extraction and reporting. This allows financial analysts to focus on more advanced tasks, such as interpreting data and developing investment strategies, ultimately improving the finance department's decision-making and performance.
[0156] In another exemplary application, an in-house lawyer at a small business faces the challenge of organizing a large number of legal contracts (such as supplier agreements, employment contracts, and confidentiality agreements). To streamline the process and improve efficiency, the lawyer utilizes the system of the present disclosure to create a library of legal contracts and their associated clauses. Through a user interface, the lawyer uploads the contract and specifies the desired metadata fields, such as the contract type, the parties involved, the effective date, and the key legal clauses. The system uses the modules described herein to process each contract, extract relevant information, and generate comprehensive metadata. The application module associates the metadata with the corresponding contract, while the LLM module suggests context-aware divisions (such as sections or chapters or individual clauses) to better organize and access the underlying legal information.
[0157] Leveraging legal contracts and their associated metadata stored in a document repository, in-house lawyers can efficiently search and retrieve specific contracts or clauses based on their requirements.
[0158] A lawyer can employ the system of the present disclosure to generate a new contract with clauses similar to those found in other contracts in a document library. The lawyer first specifies the desired criteria through a user interface, such as the type of contract desired (e.g., a supplier agreement, an employment contract, or a confidentiality agreement), the parties involved, and any specific clauses or provisions that should be included or adjusted.
[0159] The system accesses relevant contracts and associated metadata stored in a document repository, retrieving the necessary information to satisfy the attorneys’ requests. The system processes clauses and provisions extracted from existing contracts, identifying patterns and similarities, and adapting the content as needed to create a new contract tailored to the specific situation.
[0160] Newly generated contracts incorporate clauses that are consistent with the legal language associated with similar contracts found in the document library, ensuring that the new contract complies with established standards and practices. By leveraging the document generation capabilities of the present invention, in-house lawyers can efficiently create new contracts with customized clauses based on existing legal documents in the library, ultimately saving time and effort while maintaining the quality and consistency of their legal work.
[0161] The powerful document analysis module described herein analyzes the structure and content of each document to determine appropriate divisions, such as sections, chapters, or clauses, that will facilitate a more organized and accessible presentation of the information. The document analysis module includes a metadata-rich document repository that is created and supplemented by each analyzed document and enhances the overall versatility and applicability of the present invention, ultimately providing users with a comprehensive solution for managing and utilizing complex documents across various professional fields. The document generation capability of the present invention represents a valuable extension to the core functionality of the system by generating documents based on the content and metadata present in the document repository. This feature leverages the text generation capabilities of the LLM to synthesize information, create summaries, compare documents, or produce new custom documents, all of which are tailored to the specific needs or preferences of the user.
[0162] The metadata generation and document analysis capabilities of the disclosed systems and methods improve the efficiency of document-intensive workflows. Leveraging metadata-rich document repositories, users can easily search, retrieve, and analyze specific sections or clauses across large volumes of documents, thereby enhancing the efficiency of financial analysis, contract analysis, or academic research. The organized presentation of information through appropriate compartmentalization further simplifies document navigation and understanding, enabling users to quickly access relevant information and make informed decisions within their areas of expertise. By automating these processes and providing a comprehensive solution, the disclosed systems and methods increase productivity and reduce the time and effort traditionally required for document management.
[0163] The document generation capabilities of the disclosed systems and methods ensure accuracy and consistency when creating new documents. This capability leverages existing content and metadata within a document repository and a powerful curation module to create professional, consistent new documents across a wide range of fields. This feature not only significantly reduces the time and effort typically associated with manually drafting documents, but also minimizes the risk of errors or inconsistencies in the generated content. With the precise and reliable document generation capabilities of the disclosed systems and methods, professionals in law, research, or any specialized field can rely on consistent, high-quality output, expediting various document-related tasks and improving overall productivity.
[0164] For clarity of explanation, in some cases, the present technology may be presented as including various functional blocks comprising apparatuses, apparatus components, steps in methods implemented in software, or a combination of hardware and software, or routines.
[0165] The method according to the above example can be implemented using computer-executable instructions, which are stored in a computer-readable medium or can otherwise be obtained from a computer-readable medium. These instructions can include, for example, instructions and data, which enable or otherwise configure a general-purpose computer, a special-purpose computer or a dedicated processing device to perform a specific function or function group. The partial computer resources used can be accessed via a network. Computer-executable instructions can be, for example, binary files, intermediate format instructions, such as assembly language, firmware or source code. The example of a computer-readable medium that can be used to store instructions, information used and / or information created in the method process according to the described example includes a magnetic disk or optical disk, a flash memory, a universal serial bus (USB) device provided with a non-volatile memory, a network storage device, etc.
[0166] The apparatus for implementing the methods according to these disclosures may include hardware, firmware, and / or software and may take any of a variety of form factors. Typical examples of such form factors include laptop computers, smartphones, small personal computers, personal digital assistants, and the like. The functionality described herein may also be implemented in peripheral devices or add-on cards. As a further example, such functionality may also be implemented on circuit boards of different chips, or may be implemented on different processes executed in a single apparatus.
[0167] Instructions, media for transmitting such instructions, computing resources for executing such instructions, and other structure for supporting such computing resources are the means for providing the functionality described in this disclosure.
[0168] Although various examples and other information are used to explain aspects within the scope of the appended claims, no limitation to the claims should be implied based on the specific features or arrangements in such examples, as one of ordinary skill in the art will be able to derive a variety of implementations using these examples. Further, and although a subject matter may have been described in language specific to examples of structural features and / or method steps, it should be understood that the subject matter defined in the appended claims is not necessarily limited to these described features or actions. For example, such functionality may be distributed differently or performed in components other than those identified herein. Rather, the described features and steps are disclosed as examples of system components and methods within the scope of the appended claims.
Claims
1. A computer-implemented method for generating metadata for a document, comprising: (a) receiving a document for analysis via a communication interface, (b) extracting text of the document from the document and identifying a plurality of segment headings in the text using a structural analyzer model to derive regular expressions therefrom; (c) generating a segmented document by analyzing the generated regular expression, wherein the segmented document includes the extracted text in the logical segment and the corresponding segment title; (d) generating, using a metadata creator model, structured metadata summaries for at least some of the plurality of logical segments of the segmented document; (e) Use the Metadata Creator model to generate its document metadata.
2. The computer-implemented method for generating metadata for a document according to claim 1 , further comprising: The documents, corresponding document metadata for each segment analyzed, and structural metadata are stored in one or more repositories.
3. The computer-implemented method for generating metadata for a document according to claim 2, further comprising: The document metadata and structured metadata of each segment analyzed are stored in a first database with links to documents from which the metadata were derived, wherein the documents are stored in a separate document repository.
4. A computer-implemented method for generating a request document, comprising: (a) generating one or more document libraries comprising a plurality of documents and metadata, wherein the metadata is generated by the method according to claim 1; (b) generating, via a document outline module, a document outline data structure for the one or more segments of the request, wherein the document outline specifies a plurality of segments therein; as well as (c) generating text derived from the segment metadata for each segment of the generated document outline data structure; (d) Generate each segment of the requested document and use a sorting module to merge and refine the generated segments of the document.
5. The computer-implemented method of generating one or more segments of a request document according to claim 4, wherein: Segment text is generated in the following way: converting the segment and its metadata into a text request similar to a user request; Generating, by a database query module, a database query request according to the generated text request for querying the document library; retrieving segment metadata information from the repository using the database query request; The retrieved information and text are used to generate corresponding segment text via a segment creator module, and a data structure is created with the segment text or the segment text is appended to a pre-existing data structure.
6. A computer-implemented method of generating a document, wherein: The arranging step comprises: extracting definition terms and definitions for all segments into a common raw definition terms data structure; converting the raw definition term data structure into prompts; generating another data structure using the prompt, wherein the another data structure includes a plurality of consistent definition terms and associated enhanced definitions for the definition terms; Before merging each paragraph together, each occurrence of the original defined term is replaced in each paragraph with the updated defined term, where appropriate.
7. The computer-implemented method of generating a document according to claim 6, further comprising generating a global list of defined terms in the document from the consistent defined terms data structure as a first paragraph in the generated document.
8. A system comprising a communication interface and a processor, the system configured to generate a document by performing a method comprising: (a) generating a document library comprising a plurality of documents, wherein the plurality of documents comprises a plurality of segments and corresponding metadata of the documents and segments; wherein, The metadata is generated by the method according to claim 1; (b) receiving a new document request via the communication interface; (c) generating a document outline data structure according to the request via a document outline module, wherein the document outline specifies a plurality of sections therein; as well as (d) generating, via a segment creator module, a document segment for each segment of the document outline data structure generated in response to the request; and (e) Generating a document by merging and refining the generated segments through a collating module.
9. The system of claim 8, wherein the system is configured to generate a document, Each segment is generated in the following way: converting the segment and its metadata into a text request similar to a user request; Generating, by a database query module, a database query request according to the generated text request for querying the document library; retrieving segment metadata information from the document repository using the database query request; The retrieved segment metadata information and text are used to generate document segments via a segment creator module, and a data structure is created or the generated document segments are appended to a pre-existing data structure.
10. The system for generating a document according to claim 8, wherein: The collating module is configured to: extracting definition terms and definitions for all segments into a common raw definition terms data structure; converting the raw definition term data structure into prompts; generating another data structure using the prompt, wherein the another data structure includes a plurality of consistent definition terms and associated enhanced definitions for the definition terms; Before merging each paragraph together, each occurrence of the original defined term is replaced in each paragraph with the updated defined term, where appropriate.
11. The system according to any one of claims 8 to 10, wherein: Each of the modules is an independent large language model.
12. One or more non-transitory computer-readable media having stored thereon instructions for executing the method of any one of claims 1 to 6.