Document processing method and device, equipment, storage medium and program product

By combining graph sorting computation and a two-stage generation model with a lightweight language model, the problems of low document processing efficiency and difficulty in information location in existing technologies are solved, achieving efficient and accurate document semantic representation and retrieval.

CN121052257APending Publication Date: 2025-12-02INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511257176.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-04
Publication Date
2025-12-02

AI Technical Summary

Technical Problem

Existing document processing methods rely on keyword matching, which cannot fully understand the deep semantic information of documents. This results in low processing efficiency and difficulty in quickly locating key information in complex technical documents, failing to meet the intelligent search needs of financial institutions.

Method used

Candidate summary sentences are selected by graph sorting calculation, and summary text is generated by combining a two-stage generation model and a lightweight language model. The full text and summary text are semantically represented and indexed to achieve efficient retrieval.

Benefits of technology

It significantly improves the efficiency and accuracy of information processing, enabling rapid location of key information in complex technical documents and enhancing user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121052257A_ABST
    Figure CN121052257A_ABST
Patent Text Reader

Abstract

The invention provides a document processing method which can be applied to the technical field of artificial intelligence. The document processing method comprises the steps of obtaining a to-be-processed document, and segmenting a full text of the document according to sentence levels to obtain a plurality of sentences; on the basis of graph sorting calculation of the multiple sentences, multiple candidate abstract sentences of the document are obtained; inputting the plurality of candidate abstract sentences into a first target model to obtain an abstract text of the document; the full text and the abstract text are jointly input into a second target model, and semantic representation of the document is obtained; according to the semantic representation, executing a document processing flow to obtain a result related to document semantics; wherein the first target model is a two-stage generation model based on a coding and decoding structure, and the second target model is a pre-trained lightweight language model. The invention further provides a document processing device and equipment, a storage medium and a program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and more specifically to a document processing method, apparatus, device, storage medium, and program product. Background Technology

[0002] In the current financial sector, with the explosive growth of digital information, financial institutions face significant challenges in natural language processing and information retrieval in terms of how to efficiently and accurately extract core semantic information from massive amounts of documents.

[0003] Existing document processing methods often rely on keyword matching and fuzzy keyword-based search mechanisms. They use full-text indexing technology to retrieve the raw text content of documents, failing to fully understand the deeper semantic information. This results in users frequently obtaining inaccurate and relevant results. This approach not only leads to extremely low document processing efficiency but also fails to quickly locate key information in complex technical documents, making it difficult to meet the growing intelligent search needs of financial institutions. Summary of the Invention

[0004] In view of the above problems, this application provides a document processing method, apparatus, device, storage medium, and program product.

[0005] According to a first aspect of this application, a document processing method is provided, comprising: acquiring a document to be processed, and segmenting the full text of the document into sentences at the sentence level to obtain multiple sentences; calculating multiple candidate summary sentences of the document based on graph sorting of the multiple sentences; inputting the multiple candidate summary sentences into a first target model to obtain the summary text of the document; inputting the full text and the summary text into a second target model to obtain the semantic representation of the document; and executing a document processing flow based on the semantic representation to obtain results related to the semantics of the document; wherein the first target model is a two-stage generation model based on an encoding and decoding structure, and the second target model is a pre-trained lightweight language model.

[0006] According to an embodiment of this application, a graph sorting calculation based on multiple sentences is used to obtain multiple candidate summary sentences of a document, including: setting each sentence as a corresponding graph node to construct a co-directed graph corresponding to the document; performing a full-graph iterative graph sorting calculation based on the co-directed graph to obtain an initial calculation result; and normalizing and filtering the initial calculation result to obtain multiple candidate summary sentences of the document.

[0007] According to an embodiment of this application, the method includes: in a plurality of nodes of a co-directed graph, the initial weight of a target graph node is obtained after being enhanced by a gain factor, and the target graph node is the node corresponding to the sentence containing the target statement.

[0008] According to an embodiment of this application, based on a co-directed graph, a graph sorting calculation is performed using full graph iteration to obtain an initial calculation result, including: determining the position penalty factor of each sentence based on the structural position information of each sentence in the full text; and performing a graph sorting calculation using full graph iteration based on the position penalty factor of each sentence to complete the reordering of all sentences and obtain the initial calculation result.

[0009] According to an embodiment of this application, inputting multiple candidate summary sentences into a first target model to obtain a document summary text includes: constructing a candidate summary sentence set; inputting the candidate summary sentence set as a prompt into the first target model to obtain a first output text of the first target model; and performing correction processing on the first output text to obtain a document summary text.

[0010] According to an embodiment of this application, the correction processing of the first output text includes: restoring punctuation marks in the first output text based on a preset punctuation predictor; and performing grammatical segmentation processing on sentences in the first output text based on a conditional random field syntactic segmentation model.

[0011] According to an embodiment of this application, the full-text text and the summary text are input into a second target model to obtain a semantic representation of the document, including: preprocessing the full-text text and the summary text as input text, including word segmentation and part-of-speech tagging; fusing the preprocessed input text with a preset target graph to obtain a fused input text, wherein the target graph is established based on the category to which the document belongs; and inputting the fused input text into the second target model to obtain a semantic representation of the document.

[0012] According to an embodiment of this application, a document processing flow is executed based on the semantic representation to obtain results related to the document semantics, including: storing the semantic representation of the document in a preset vector database and establishing an index; and when a query request is received, searching for results related to the document semantics in the vector data.

[0013] A second aspect of this application provides a document processing apparatus, comprising: a document acquisition module for acquiring a document to be processed and segmenting the full text of the document into multiple sentences at the sentence level; a candidate summary sentence acquisition module for calculating multiple candidate summary sentences of the document based on graph sorting of the multiple sentences; a summary text acquisition module for inputting the multiple candidate summary sentences into a first target model to obtain the summary text of the document; a semantic representation acquisition module for inputting the full text and summary text into a second target model to obtain the semantic representation of the document; and a processing result acquisition module for executing a document processing flow according to the semantic representation to obtain results related to the semantics of the document; wherein the first target model is a two-stage generation model based on an encoding and decoding structure, and the second target model is a pre-trained lightweight language model.

[0014] A third aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.

[0015] A fourth aspect of this application also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.

[0016] The fifth aspect of this application also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description

[0017] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0018] Figure 1 This diagram illustrates an application scenario of a document processing method according to an embodiment of this application.

[0019] Figure 2 A flowchart illustrating a document processing method according to an embodiment of this application is shown schematically.

[0020] Figure 3 A flowchart illustrating the process of obtaining candidate abstract sentences according to an embodiment of this application is shown schematically;

[0021] Figure 4 A flowchart illustrating graph sorting calculation according to an embodiment of this application is shown schematically;

[0022] Figure 5 A flowchart illustrating the process of obtaining a document summary text according to an embodiment of this application is shown schematically.

[0023] Figure 6 This schematically illustrates a structural block diagram of a document processing apparatus according to an embodiment of the present application; and

[0024] Figure 7 A block diagram schematically illustrates an electronic device suitable for implementing a document processing method according to an embodiment of this application. Detailed Implementation

[0025] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0026] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0027] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0028] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0029] In the technical solution of this application, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.

[0030] In scenarios involving automated decision-making using personal information, the methods, devices, and systems provided in this application all offer users corresponding entry points for choosing to agree to or reject the automated decision-making results. If the user chooses to reject, the process proceeds to the expert decision-making stage. Here, "automated decision-making" refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests, or economic, health, and credit status through computer programs, and then making a decision. Here, "expert decision-making" refers to the activity of making decisions by personnel who specialize in a particular field, possess specialized experience, knowledge, and skills, and have reached a certain level of professional expertise.

[0031] Embodiments of this application provide a document processing method, including: acquiring a document to be processed, and segmenting the full text of the document into sentences at the sentence level to obtain multiple sentences; calculating multiple candidate summary sentences of the document based on graph sorting of the multiple sentences; inputting the multiple candidate summary sentences into a first target model to obtain the summary text of the document; inputting the full text and summary text into a second target model to obtain the semantic representation of the document; and executing a document processing flow according to the semantic representation to obtain results related to the semantics of the document; wherein the first target model is a two-stage generation model based on encoding and decoding structures, and the second target model is a pre-trained lightweight language model.

[0032] Through the embodiments of this application, the method uses a graph sorting algorithm combined with sentence position and structural information to filter candidate summary sentences from a global perspective, effectively avoiding the omission of key information. Then, a two-stage generation model (encoding-decoding structure) is used to further refine and generate summaries, significantly improving the coherence, coverage, and readability of the summaries. Finally, by processing the full-text and summary text of the document, a deeper understanding of the document's semantics is achieved, resulting in a more comprehensive semantic representation. This document processing method improves the efficiency and accuracy of information processing, quickly locating key information in complex technical documents, enabling users to quickly obtain results relevant to their query semantics during retrieval, thereby significantly improving the user experience.

[0033] Figure 1 The illustration shows an application scenario diagram of the document processing method according to an embodiment of this application.

[0034] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, and a server 105. Network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0035] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0036] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0037] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0038] It should be noted that the document processing method provided in this application embodiment can generally be executed by server 105. Correspondingly, the document processing device provided in this application embodiment can generally be located in server 105. The document processing method provided in this application embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the document processing device provided in this application embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.

[0039] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0040] The following will be based on Figure 1 The described scene, through Figures 2-5 The document processing method according to the embodiments of this application will be described in detail.

[0041] In scenarios involving document processing within financial institutions (such as document searches), this application proposes a document processing method to efficiently locate key information in complex technical documents, improve document comprehension, and meet the growing demand for intelligent search within financial institutions.

[0042] Figure 2 A flowchart illustrating a document processing method according to an embodiment of this application is shown schematically.

[0043] like Figure 2 As shown, according to an embodiment of this application, the document processing method specifically includes operations S210 to S250.

[0044] In operation S210, the document to be processed is obtained, and the full text of the document is segmented into sentences to obtain multiple sentences.

[0045] For example, a document to be processed is obtained. This document can be a text document, or it can be a bank technical document that has been processed by word segmentation and part-of-speech tagging. The full text of the bank technical document is then segmented and cleaned at the sentence level to obtain multiple sentences.

[0046] In operation S220, a graph sorting calculation based on multiple sentences is performed to obtain multiple candidate summary sentences of the document.

[0047] In the embodiments of this application, after obtaining multiple sentences from the document to be processed, a graph-ranking-based summary extraction algorithm is used, which integrates banking domain terminology, document structure information, and computational performance optimization strategies to complete the graph ranking calculation, thereby generating a candidate sentence set with domain importance and structural coverage. The process of obtaining candidate summary sentences is described in detail below.

[0048] Figure 3 A flowchart illustrating the process of obtaining candidate abstract sentences according to an embodiment of this application is shown.

[0049] like Figure 3 As shown, according to an embodiment of this application, multiple candidate summary sentences of a document are obtained based on graph sorting calculation of multiple sentences. This process specifically includes operations S310 to S330.

[0050] In operation S310, each sentence is set as a corresponding graph node to construct a co-directed graph corresponding to the document.

[0051] In embodiments of this application, a graph node is created for each sentence, where each node represents a sentence and edges represent relationships between sentences (e.g., semantic similarity or co-occurring words), constructing a co-directed graph corresponding to the document. Among the multiple nodes in the co-directed graph, the initial weight of the target graph node is obtained after enhancement by a gain factor; the target graph node is the node corresponding to the sentence containing the target statement.

[0052] For example, each sentence is set as a node in the graph, and a co-directed graph is constructed, which includes a set of sentences and an edge set based on sentence similarity. The sentence similarity measure is the average cosine similarity of word vectors. To improve domain coverage, a terminology enhancement mechanism is introduced. That is, in the initial weight of a node, if the sentence contains banking domain terms (such as "corporate marketing"), the node is given a terminology gain factor to achieve weighting.

[0053] In operation S320, based on the co-directed graph, a graph sorting calculation is performed using full graph iteration to obtain the initial calculation results.

[0054] Figure 4 A flowchart illustrating graph sorting calculation according to an embodiment of this application is shown schematically.

[0055] like Figure 4 As shown, according to an embodiment of this application, a graph sorting calculation is performed based on a co-directed graph to obtain an initial calculation result. This specific process includes operations S410 to S420.

[0056] In operation S410, the position penalty factor for each sentence is determined based on the structural position information of each sentence in the full text.

[0057] In operation S420, a graph sorting calculation is performed iteratively across the entire graph based on the position penalty factor of each sentence to complete the reordering of all sentences and obtain the initial calculation results.

[0058] In the embodiments of this application, based on the co-directed graph constructed above, the initial ranking score of each node is obtained by performing full-graph iterative calculation using a graph sorting algorithm.

[0059] It should be noted that, in order to better preserve the logical structure hierarchy of the document, a position-based penalty factor is introduced, and a sentence position information modulation term is added to the transition probability formula in the graph sorting algorithm.

[0060] Specifically, a position penalty factor is set based on the structural position of each sentence in the full text. For example, the position penalty factor for position 1 is 0.9 (beginning position, high importance), the position penalty factor for position 2 is 0.8, the position penalty factor for position 3 is 0.7, and the position penalty factor for position 4 is 0.6 (end position, decreased importance).

[0061] Furthermore, for each sentence, its positional penalty factor is combined with the initial ranking score calculated based on the ranking algorithm to obtain a comprehensive score for each sentence. Then, through full graph iteration, the comprehensive score of all sentences (i.e., the initial calculation result) can be obtained, thus completing the reordering of all sentences.

[0062] In the embodiments of this application, considering that bank documents are usually quite long and contain multiple functional paragraphs, full-text graph construction and full-graph iteration would involve a large computational burden. Therefore, this embodiment introduces paragraph-level incremental graph partitioning, dividing the global document into multiple logical sub-blocks according to paragraphs or chapters. A sub-local graph is constructed for each sub-block and iterated in parallel. Finally, the local scores of sentences in each sub-local graph are standardized and summarized into the global score space.

[0063] Through the embodiments of this application, the introduction of the position penalty factor can finely adjust every step of the document processing process, thereby achieving more flexible information filtering and processing, and better preserving the logical structure hierarchy of the document.

[0064] In operation S330, the initial calculation results are normalized and filtered to obtain multiple candidate summary sentences of the document.

[0065] In the embodiments of this application, after the graph sorting calculation is completed, all sentences are ranked by normalized scores. To avoid information redundancy or sentence repetition, inter-sentence distance constraints are added, and the word overlap ratio between sentences is set. When the cosine similarity between sentences exceeds a threshold, only the one with the higher score is retained. In this way, multiple configurable sentences are finally obtained, that is, multiple candidate summary sentences of the document.

[0066] Through the embodiments of this application, the method can effectively filter out the candidate summary sentences with the most informational value by using graph sorting calculation and combining the semantic relationships between sentences, thereby generating more accurate and coherent summary text.

[0067] In operation S230, multiple candidate summary sentences are input into the first target model to obtain the document summary text.

[0068] In the embodiments of this application, after obtaining multiple candidate summary sentences of a document, the multiple candidate summary sentences are input into a first target model. The first target model is a two-stage generation model based on a lightweight encoding and decoding structure. The generation model generates summary text based on these candidate summary sentences as context information, thereby effectively focusing on the core information of the document. The process of obtaining summary text is described in detail below.

[0069] Figure 5 A flowchart illustrating a summary text of a document obtained according to an embodiment of this application is shown schematically.

[0070] like Figure 5 As shown, according to an embodiment of this application, multiple candidate summary sentences are input into the first target model to obtain the summary text of the document. This specific process includes operations S510 to S530.

[0071] In operation S510, a set of candidate summary sentences is constructed.

[0072] In operation S520, the set of candidate summary sentences is used as prompts input into the first target model to obtain the first output text of the first target model.

[0073] Specifically, multiple candidate summary sentence sets obtained above are constructed, and then the candidate summary sentence sets are used as prompts input into the first target model according to the predefined prompt template, that is, the two-stage generation model based on encoding and decoding structure, and then the first output text is obtained.

[0074] It should be noted that the first target model is a lightweight generative model architecture that not only optimizes the inference efficiency during the generation of summary text but also ensures the quality of the generated summary text. Traditional generative models typically require huge computational resources and storage space, making it difficult to meet real-time requirements in practical deployments, especially in resource-constrained environments. However, in this embodiment, the first target model is a simplified, small-scale multi-head attention self-attention mechanism, specifically a lightweight model composed of a six-layer encoder and a four-layer decoder. The architecture design of this first target model significantly reduces computational resources while maintaining high generation quality.

[0075] Furthermore, in order to improve the inference efficiency of the first target model, the model's weights and activation tensors are converted into a low-precision data format, which significantly reduces memory usage and accelerates the inference process.

[0076] Furthermore, during the inference process of the first target model, a simplified bundle width optimization method is adopted to limit the bundle width parameter, and a repetition penalty mechanism is introduced. This effectively avoids redundant information in the generation process, improves the diversity and accuracy of the summary, and reduces the consumption of computational resources, ensuring that summary text can be generated quickly in real-time tasks.

[0077] Furthermore, to ensure the accuracy of financial terminology in the generated summary text, this embodiment performs domain-specific adaptation on the vocabulary and embedding layer of the first target model. Traditional generative models typically use general-purpose vocabularies, but often fall short when dealing with specific financial terminology. This embodiment constructs a vocabulary of sub-vocabularies corresponding to the banking domain. This vocabulary includes common financial terms and compound expressions (such as "credit risk"), and assigns high weights to these terms during word vector initialization, thereby enabling the first target model to achieve higher accuracy and expressive power when processing financial terminology.

[0078] Furthermore, the generative model can be guided to process only important sentence fragments, avoiding the risks of redundancy and deviation from the topic that may occur with full-text generation. Specifically, the selection of candidate summary sentences in the input first target model is based on their importance and relevance in the document. These candidate summary sentences contain key information of the document and provide a clear context for the generative model. This not only improves the accuracy of the generated summary but also significantly reduces the length of the generated text, enhancing the readability and professionalism of the generated summary text.

[0079] In operation S530, the first output text is corrected to obtain the document summary text.

[0080] In the embodiments of this application, the correction processing of the first output text includes: restoring the punctuation marks in the first output text based on a preset punctuation predictor; and performing grammatical segmentation processing on the sentences in the first output text based on a conditional random field syntactic segmentation model.

[0081] Understandably, although the first target model can input high-quality first output text content, its output results often have inconsistencies in syntax or format, which may affect the readability and professionalism of the final summary text. Therefore, it is necessary to correct the first output text to obtain the final summary text.

[0082] For example, during the generation process, the aforementioned first target model might ignore punctuation marks, resulting in a loose text structure. A punctuation predictor based on grammar rules can automatically recover punctuation marks and predict missing punctuation marks using contextual information, thereby improving the first output text and making the corrected summary text readable. As another example, to ensure the syntactic correctness of the generated text, a conditional random field-based syntactic segmentation model is used to automatically identify and correct sentence boundaries in the first output text, avoiding long sentences and semantic ambiguity. When processing long texts, this syntactic segmentation model can accurately determine the start and end positions of sentences, ensuring that the processed summary text is logically clear and well-defined.

[0083] Through the embodiments of this application, candidate summary sentences are screened from a global perspective, which effectively avoids the omission of key information. Then, the summary is further refined and generated through a two-stage generation model (encoding-decoding structure), which significantly improves the coherence, coverage and readability of the summary.

[0084] In operation S240, the full text and the summary text are input into the second target model to obtain the semantic representation of the document.

[0085] In the embodiments of this application, the full-text text and the summary text are input into the second target model to obtain the semantic representation of the document, including: preprocessing the full-text text and the summary text as input text, including word segmentation and part-of-speech tagging; fusing the preprocessed input text with a preset target graph to obtain the fused input text, wherein the target graph is established based on the category to which the document belongs; and inputting the fused input text into the second target model to obtain the semantic representation of the document.

[0086] In the embodiments of this application, the second target model is a pre-trained lightweight language model.

[0087] For example, the full text and summary text of the document are segmented and labeled with parts of speech. To meet the professional needs of the banking industry, the input text is fused with a knowledge graph specific to the banking domain to enhance the model's understanding of financial terminology. The fused text is then input into a pre-trained lightweight language model, which can be understood as a deep learning-based semantic vector generation model. Finally, the semantic representation vector of the document is obtained.

[0088] It should be noted that a dynamic domain adaptation layer is introduced during the semantic vector generation process of this semantic vector generation model. This adaptation layer is located between the last layer and the output layer of the model, and uses a small multilayer perceptron structure to fine-tune the output of the pre-trained model to better handle terminology and entity information in the banking domain.

[0089] Through the embodiments of this application, by inputting both the full-text and summary text into a lightweight language model, deep fusion of multi-granular semantic information is achieved; knowledge enhancement by combining domain graphs effectively improves the discriminative ability and generalization performance of semantic representation.

[0090] In operation S250, based on the semantic representation, the document processing flow is executed to obtain results related to the document semantics.

[0091] In the embodiments of this application, a document processing flow is executed based on the semantic representation to obtain results related to the document semantics, including: storing the semantic representation of the document in a preset vector database and establishing an index; when a query request is received, searching for results related to the document semantics in the vector data.

[0092] For example, after converting the text content of a document into a semantic vector representation, a suitable vector database is selected to store the document's semantic vectors. The document's semantic vectors are then stored in the vector database, along with the document's metadata (such as title, summary, links, etc.) for subsequent retrieval. An index is created in the vector database for the stored vectors to accelerate the subsequent query process.

[0093] Furthermore, when a user enters a query through the search box, a query request is received. This query request corresponds to a document with a semantic vector generated above. The user's query is then subjected to the same preprocessing and semantic embedding to generate a semantic vector for the query. In the vector database, a similarity algorithm (such as cosine similarity or Euclidean distance) is used to search for document vectors similar to the semantic vector of the user's query. Finally, based on the similarity score, the most relevant document is returned to the user, along with corresponding metadata for reference.

[0094] Through the embodiments of this application, the semantic representation of a document is stored in a vector database, and an index is built to accelerate the query, enabling users to quickly obtain results related to their query semantics during retrieval, thereby significantly improving the user experience.

[0095] Based on the above document processing method, this application also provides a document processing apparatus. The following will be combined with... Figure 6 The device is described in detail.

[0096] Figure 6 A schematic block diagram of a document processing apparatus according to an embodiment of this application is shown.

[0097] like Figure 6 As shown, the document processing device 600 of this embodiment includes a document acquisition module 610, a candidate summary sentence acquisition module 620, a summary text acquisition module 630, a semantic representation acquisition module 640, and a processing result acquisition module 650.

[0098] The document acquisition module 610 is used to acquire the document to be processed and to segment the full text of the document into multiple sentences at the sentence level. In one embodiment, the document acquisition module 610 can be used to perform the operation S210 described above, which will not be repeated here.

[0099] The candidate summary sentence acquisition module 620 is used to calculate multiple candidate summary sentences of a document based on graph sorting of multiple sentences. In one embodiment, the candidate summary sentence acquisition module 620 can be used to perform the operation S220 described above, which will not be repeated here.

[0100] The summary text acquisition module 630 is used to input multiple candidate summary sentences into the first target model to obtain the summary text of the document. In one embodiment, the summary text acquisition module 630 can be used to perform the operation S230 described above, which will not be repeated here.

[0101] The semantic representation acquisition module 640 is used to input both the full-text text and the summary text into the second target model to obtain the semantic representation of the document. In one embodiment, the semantic representation acquisition module 640 can be used to perform the operation S240 described above, which will not be repeated here.

[0102] The processing result acquisition module 650 is used to execute a document processing flow based on the semantic representation to obtain results related to the document semantics. In one embodiment, the processing result acquisition module 650 can be used to execute the operation S250 described above, which will not be repeated here.

[0103] In the embodiments of this application, the first target model is a two-stage generation model based on encoding and decoding structures, and the second target model is a pre-trained lightweight language model.

[0104] In the embodiments of this application, the candidate summary sentence acquisition module 620 includes a co-directional graph construction submodule, an initial calculation result acquisition submodule, and a candidate summary sentence acquisition submodule.

[0105] The co-directed graph construction submodule is used to set each sentence as a corresponding graph node to construct a co-directed graph corresponding to the document. In one embodiment, the co-directed graph construction submodule can be used to perform the operation S310 described above, which will not be repeated here.

[0106] The initial calculation result acquisition submodule is used to perform graph sorting calculations based on the co-directed graph, performing full-graph iterations, to obtain the initial calculation results. In one embodiment, the initial calculation result acquisition submodule can be used to perform the operation S320 described above, which will not be repeated here.

[0107] The candidate summary sentence acquisition submodule is used to normalize and filter the initial calculation results to obtain multiple candidate summary sentences of the document. In one embodiment, the candidate summary sentence acquisition submodule can be used to perform the operation S330 described above, which will not be repeated here.

[0108] In the embodiments of this application, the initial calculation result acquisition submodule includes a position penalty factor determination unit and an initial calculation result acquisition unit.

[0109] The position penalty factor determination unit is used to determine the position penalty factor of each sentence based on the structural position information of each sentence in the full text. In one embodiment, the position penalty factor determination unit can be used to perform the operation S410 described above, which will not be repeated here.

[0110] The initial calculation result acquisition unit is used to perform a full-graph iterative graph sorting calculation based on the position penalty factor of each sentence to complete the reordering of all sentences and obtain the initial calculation result. In one embodiment, the initial calculation result acquisition unit can be used to perform the operation S420 described above, which will not be repeated here.

[0111] In the embodiments of this application, the summary text acquisition module 630 includes a set construction submodule, a first output text acquisition submodule, and a summary text acquisition submodule.

[0112] The set construction submodule is used to construct a set of candidate summary sentences. In one embodiment, the set construction submodule can be used to perform the operation S510 described above, which will not be repeated here.

[0113] The first output text acquisition submodule is used to input the candidate summary sentence set as prompts into the first target model to obtain the first output text of the first target model. In one embodiment, the first output text acquisition submodule can be used to perform the operation S520 described above, which will not be repeated here.

[0114] The summary text acquisition submodule is used to correct the first output text to obtain the document's summary text. In one embodiment, the summary text acquisition submodule can be used to perform the operation S530 described above, which will not be repeated here.

[0115] In embodiments of this application, the summary text acquisition submodule includes a correction unit.

[0116] The correction unit is used to restore the punctuation marks in the first output text based on a preset punctuation predictor; and to perform grammatical segmentation processing on the sentences in the first output text based on a conditional random field syntactic segmentation model.

[0117] In the embodiments of this application, the semantic representation acquisition module 640 includes a preprocessing submodule, a fusion submodule, and a semantic representation acquisition submodule.

[0118] The preprocessing submodule is used to perform preprocessing, including word segmentation and part-of-speech tagging, on both the full-text and summary texts as input.

[0119] The fusion submodule is used to fuse the preprocessed input text with the preset target map to obtain the fused input text. The target map is built based on the document's category.

[0120] The semantic representation acquisition submodule is used to input the fused input text into the second target model to obtain the semantic representation of the document.

[0121] In the embodiments of this application, the processing result acquisition module 650 includes a storage submodule and a processing result acquisition submodule.

[0122] The storage submodule is used to store the semantic representation of the document in a pre-defined vector database and create an index.

[0123] The result retrieval submodule is used to search for results related to the document semantics in vector data when a query request is received.

[0124] According to embodiments of this application, any multiple modules among the document acquisition module 610, candidate summary sentence acquisition module 620, summary text acquisition module 630, semantic representation acquisition module 640, and processing result acquisition module 650 can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this application, at least one of the document acquisition module 610, candidate summary sentence acquisition module 620, summary text acquisition module 630, semantic representation acquisition module 640, and processing result acquisition module 650 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any appropriate combination of any of these three implementation methods. Alternatively, at least one of the document acquisition module 610, candidate summary sentence acquisition module 620, summary text acquisition module 630, semantic representation acquisition module 640, and processing result acquisition module 650 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0125] Figure 7 A block diagram schematically illustrates an electronic device suitable for implementing a document processing method according to an embodiment of this application.

[0126] like Figure 7As shown, an electronic device 700 according to an embodiment of this application includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 708 into a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.

[0127] RAM 703 stores various programs and data required for the operation of electronic device 700. Processor 701, ROM 702, and RAM 703 are interconnected via bus 704. Processor 701 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 702 and / or RAM 703. It should be noted that programs may also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in one or more memories.

[0128] According to embodiments of this application, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to a bus 704. The electronic device 700 may also include one or more of the following components connected to the input / output (I / O) interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0129] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.

[0130] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used or combined with an instruction-modified execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 702 and / or RAM 703 and / or one or more memories other than ROM 702 and RAM 703 described above.

[0131] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to enable the computer system to implement the document processing method provided in the embodiments of this application.

[0132] When the computer program is executed by the processor 701, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0133] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 709, and / or installed from a removable medium 711. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0134] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, it performs the functions defined in the system of this application embodiment. According to the embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0135] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0136] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0137] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.

Claims

1. A document processing method, characterized in that, The method includes: Obtain the document to be processed, and segment the full text of the document into sentences to obtain multiple sentences; Based on the graph sorting calculation of the multiple sentences, multiple candidate summary sentences of the document are obtained; The multiple candidate summary sentences are input into the first target model to obtain the summary text of the document; The full text and the summary text are input into the second target model to obtain the semantic representation of the document; Based on the semantic representation, a document processing flow is executed to obtain results related to the document semantics; The first target model is a two-stage generation model based on encoding and decoding structures, and the second target model is a pre-trained lightweight language model.

2. The document processing method according to claim 1, characterized in that, The graph sorting calculation based on the multiple sentences yields multiple candidate summary sentences for the document, including: Each sentence is set as a corresponding graph node to construct a co-directed graph corresponding to the document; Based on the co-directed graph, a graph sorting calculation is performed using full graph iteration to obtain the initial calculation results; The initial calculation results are normalized and filtered to obtain multiple candidate summary sentences for the document.

3. The document processing method according to claim 2, characterized in that, include: In the multiple nodes of the co-directed graph, the initial weight of the target graph node is obtained after enhancement by a gain factor, and the target graph node is the node corresponding to the sentence containing the target statement.

4. The document processing method according to claim 2, characterized in that, The graph sorting calculation based on the co-directed graph, performed on a full graph iteration, yields initial calculation results, including: Based on the structural position information of each sentence in the full text, determine the position penalty factor for each sentence; Based on the position penalty factor of each sentence, a graph sorting calculation is performed iteratively across the entire graph to complete the reordering of all sentences and obtain the initial calculation results.

5. The document processing method according to claim 1, characterized in that, The step of inputting the plurality of candidate summary sentences into the first target model to obtain the summary text of the document includes: Construct a set of candidate summary sentences; The candidate summary sentence set is used as a prompt input into the first target model to obtain the first output text of the first target model; The first output text is corrected to obtain the summary text of the document.

6. The document processing method according to claim 5, characterized in that, The correction process for the first output text includes: Based on a preset punctuation predictor, the punctuation marks in the first output text are recovered; and A syntactic segmentation model based on conditional random fields is used to perform syntactic segmentation on sentences in the first output text.

7. The document processing method according to claim 1, characterized in that, The step of inputting the full-text and summary text into the second target model to obtain the semantic representation of the document includes: The full text and the abstract text are used together as input text for preprocessing including word segmentation and part-of-speech tagging; The preprocessed input text is fused with a preset target map to obtain the fused input text. The target map is established based on the category to which the document belongs. The fused input text is then input into the second target model to obtain the semantic representation of the document.

8. The document processing method according to claim 1, characterized in that, The step of executing a document processing flow based on the semantic representation to obtain results related to the document semantics includes: The semantic representation of the document is stored in a pre-defined vector database and an index is created; When a query request is received, results related to the semantics of the document are searched in the vector data.

9. A document processing device, characterized in that, The device includes: The document acquisition module is used to acquire the document to be processed and to segment the full text of the document into multiple sentences by sentence level; The candidate summary sentence acquisition module is used to calculate multiple candidate summary sentences of the document based on the graph sorting of the multiple sentences; The summary text acquisition module is used to input the multiple candidate summary sentences into the first target model to obtain the summary text of the document; The semantic representation acquisition module is used to input the full text and the summary text into the second target model to obtain the semantic representation of the document; The processing result acquisition module is used to execute the document processing flow according to the semantic representation to obtain results related to the document semantics; The first target model is a two-stage generation model based on encoding and decoding structures, and the second target model is a pre-trained lightweight language model.

10. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.

12. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.