A method and system for improving long text processing efficiency and accuracy

By preprocessing and decomposing long texts, generating prompt paths for parallel processing, and evaluating and dynamically cutting in real time, the problems of performance degradation and high computing cost in the existing technology when processing long texts are solved, and efficient and accurate long text processing is achieved.

CN118656443BActive Publication Date: 2025-04-29SHEN ZHEN KUA KUA JING LING KE JI YOU XIAN GONG SI +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410844580.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2025-04-29
Estimated Expiration
2044-06-27

AI Technical Summary

Technical Problem

Existing natural language processing technologies face problems such as degradation in performance, high computational cost, poor retrieval quality, insufficient model flexibility and lack of dynamic optimization mechanism when processing long text tasks.

Method used

A method is adopted to preprocess and decompose the input long text into information units, generate a prompt path and process it in parallel based on the fork topology structure, evaluate and dynamically clip the prompt path with evaluation scores below the threshold, and finally synthesize the output results of the remaining prompt paths after cropping.

Benefits of technology

It significantly improves processing speed, improves the accuracy and quality of output results, optimizes resource usage and reduces operating costs, enhances the adaptability and scalability of the system, and supports real-time processing requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656443B_ABST
    Figure CN118656443B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for improving the efficiency and accuracy of long text processing, comprising the following steps: S1: preprocessing the input long text, and decomposing the preprocessed long text into a series of information units, wherein each information unit includes a paragraph, a paragraph, or a specific data block; S2: generating a prompt path for each information unit, wherein each prompt path represents a specific understanding or query processing angle. The present invention mainly solves the main challenges faced by existing natural language processing technology in processing long text tasks, especially the efficiency and accuracy problems of retrieval enhancement generation (RAG) systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing and machine learning, and in particular to a method and system for improving the efficiency and accuracy of long text processing. Background Art

[0002] In the field of natural language processing (NLP), existing technologies often encounter bottlenecks, especially when facing long text processing tasks such as text summarization, question-answering systems, and content generation. These technologies include but are not limited to traditional statistical methods, machine learning techniques, and deep learning models that have emerged in recent years, especially Transformer-based language models, specifically:

[0003] 1) Limitations in processing long texts. Most existing models (such as early RNNs and LSTMs) experience performance degradation when processing long texts because these models are limited by short-term memory issues. Even Transformer models that use an attention mechanism will face challenges in computing resources and time efficiency when the length of the text processed is much longer than the length of the text used for model training.

[0004] 2) Computational cost. Although Transformer models have significantly improved accuracy, their inference and training costs are very high, especially when processing long texts, because the computational complexity and memory requirements increase exponentially with the length of the text;

[0005] 3) Retrieval quality. In the Retrieval-Augmented Generation (RAG) model, if the retrieved content is irrelevant to the topic or the information is repeated, it will significantly affect the quality of the output results, and existing models are difficult to adapt to new or domain-specific long text content without a lot of fine-tuning;

[0006] 4) Insufficient model flexibility. Many existing models require extensive retraining or fine-tuning for specific tasks, which may be too costly and inefficient in practical applications;

[0007] 5) Lack of dynamic optimization mechanism. Traditional processing solutions usually do not have the ability to dynamically optimize the processing path during the processing process, which means that even if certain processing strategies have been proven to be inefficient, they will still consume valuable computing resources. Summary of the invention

[0008] The purpose of the present invention is to provide a method and system for improving the efficiency and accuracy of long text processing, so as to solve the main challenges faced by existing natural language processing technology in processing long text tasks, especially the efficiency and accuracy problems of retrieval augmentation generation (RAG) systems.

[0009] In order to achieve the above purpose, the following technical solutions are adopted:

[0010] A method for improving the efficiency and accuracy of long text processing comprises the following steps:

[0011] S1: Preprocess the input long text and decompose the preprocessed long text into a series of information units U 1 ,U 2 ,...,U n , where each information unit includes a paragraph, or a paragraph, or a specific data block;

[0012] S2: Generate a prompt path P(U) for each information unit i )=p i1 ,p i2 ,...,p ik , where each hint path represents a specific understanding or query processing perspective;

[0013] S3: Process each cue path in parallel based on the fork-join topology;

[0014] S4: construct an evaluation model, and perform real-time evaluation of each prompt path at different stages of processing based on the evaluation model;

[0015] S5: Dynamically trim the hint paths whose evaluation scores are lower than a preset threshold, and allocate the released resources to other hint paths whose evaluation scores are higher than the threshold;

[0016] S6: Synthesize the output results of the remaining prompt paths after cropping to generate the final output.

[0017] Furthermore, in S2, the generation of the prompt path adopts a variety of heuristic strategies, including keyword-based understanding, topic or summary-based understanding, specific context or background-based understanding, and information extraction or specific query-based strategies.

[0018] Furthermore, in S3, forward and backward connection structures are used to ensure the mutual independence and information flow between prompt paths. At the same time, each prompt path independently runs a pre-trained transformer model to process its corresponding information unit, wherein the transformer model includes BERT or GPT.

[0019] Furthermore, in S3, the importance of each prompt path will be evaluated in real time, and processing resources will be dynamically allocated based on the results of the real-time evaluation, wherein the importance of each prompt path is evaluated using the following formula: I(p)=α·S(p)+β·R(p), wherein S(p) represents the signal strength of the prompt path, R(p) represents the relevance of the prompt path, and α and β are adjustment parameters.

[0020] Furthermore, in S4, the evaluation model is evaluated using the following formula: E(p ij )=w c ·C(p ij )+w r ·R(p ij )+w i ·I(p ij ), where w c ,w r ,w i is the weight parameter, and C, R, and I represent the measures of contribution, relevance, and information richness, respectively.

[0021] Furthermore, in S6, a weighted average algorithm or an advanced fusion algorithm is used to synthesize the output results of the remaining prompt paths after clipping.

[0022] A system for improving the efficiency and accuracy of long text processing is also provided, which is used to implement the above method, including:

[0023] The input processing module is used to receive the input long text, pre-process it, and then decompose it into a series of information units;

[0024] A prompt path generation module, used for creating a prompt path for each information unit;

[0025] A parallel processing engine for executing parallel processing of multiple prompt paths simultaneously;

[0026] A real-time evaluation model for real-time evaluation of each cue pathway at different stages of processing;

[0027] A dynamic pruning module is used to prune the hint paths whose evaluation scores are below a preset threshold;

[0028] The result synthesizer module is used to synthesize the output results of the remaining prompt paths after clipping to generate the final output.

[0029] Furthermore, the prompt path generation module adopts a variety of heuristic strategies, including keyword-based understanding, topic or summary-based understanding, specific context or background-based understanding, and information extraction or specific query-based strategies; the parallel processing engine adopts a fork-joined topology and uses forward and backward connection structures to ensure the mutual independence and information flow between prompt paths, and the parallel processing engine will also dynamically allocate processing resources based on the results of real-time evaluation of the importance of each prompt path.

[0030] Furthermore, the real-time evaluation model is evaluated based on the contribution, relevance and information richness of the prompt path; the dynamic pruning module also dynamically adjusts the allocation of processing resources based on the feedback of the real-time evaluation model.

[0031] Furthermore, it also includes

[0032] Output optimization module, used to further optimize the language and logic before the result synthesizer module generates the final result;

[0033] Performance testing module to evaluate system response time, accuracy, and resource utilization efficiency;

[0034] The optimization and adjustment module is used to further optimize the system configuration and processing path according to the test results of the performance test module and user feedback.

[0035] By adopting the above scheme, the beneficial effects of the present invention are:

[0036] 1) Significantly improve the processing speed. The present invention adopts a strategy of parallel processing of multiple paths, combined with a real-time dynamic path evaluation and clipping mechanism, which greatly reduces invalid and redundant calculations, thereby achieving a significant improvement in processing speed, especially when processing large-scale text data.

[0037] 2) Improve the accuracy and quality of output results. The present invention intelligently selects and integrates the best performing path outputs and automatically discards low-quality processing paths, thereby ensuring the accuracy and relevance of the final output.

[0038] 3) Optimize resource usage and reduce operating costs. The dynamic resource allocation and path optimization mechanism of the present invention avoids ineffective consumption and excessive demand for computing resources, thereby reducing operating costs. Compared with traditional deep learning methods that require a large amount of computing resources, the present invention can more economically utilize existing hardware and reduce energy consumption and maintenance costs.

[0039] 4) Enhance the adaptability and scalability of the system. The super-overlay prompt technology of the present invention can easily cope with text processing tasks of different lengths and types, enhancing the adaptability of the system. In addition, the technical framework has good scalability and can easily integrate new processing strategies and optimization algorithms to adapt to new business needs and technological development.

[0040] 5) Support real-time processing requirements. The present invention is particularly suitable for real-time processing scenarios that require rapid response, such as online customer support, real-time news generation, etc. Through the optimized processing path, the system can quickly respond while ensuring output quality, greatly improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION

[0042] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0043] Reference Figure 1 As shown, the present invention provides a method for improving the efficiency and accuracy of long text processing. In one embodiment, the method comprises the following steps:

[0044] S1: Preprocess the input long text and decompose the preprocessed long text into a series of information units U 1 ,U 2 ,...,U n , where each information unit includes a paragraph, or a paragraph, or a specific data block.

[0045] In this embodiment, before implementing the above steps, it is necessary to configure the system and build the environment. The hardware configuration includes a computing environment of multiple GPUs to support the high parallel requirements of the algorithm. For the software environment, it is necessary to install and configure the required software tools and libraries, such as TensorFlow, PyTorch, etc., on the hardware environment to support the operation of the Transformer model and the implementation of parallel processing.

[0046] Then, perform model selection and preloading: You can select a suitable pre-trained Transformer model, such as BERT, GPT, or T5, according to the task requirements, and then load the selected model into the memory to pre-train or adjust the model to adapt to the specific application scenario.

[0047] Subsequently, the input data is prepared and preprocessed: first, the long text data to be processed is collected, such as articles, reports or research papers. In the preprocessing stage, the collected data will be cleaned and standardized, including removing redundancy, correcting errors, and segmenting sentences and words. Subsequently, the preprocessed long text is decomposed into a series of information units, and each information unit is standardized, such as removing spaces, correcting punctuation, and other necessary text cleaning work to ensure the quality of data input.

[0048] S2: Generate a prompt path P(U) for each information unit i )=p i1 ,p i2 ,...,p ik , where each hint path represents a specific understanding or query processing perspective.

[0049] In S2, the generation of prompt paths adopts a variety of heuristic strategies, including keyword-based understanding, topic or summary-based understanding, specific context or background-based understanding, and information extraction or specific query-based strategies.

[0050] In this step, multiple prompt path generation strategies are first constructed. Each strategy targets different aspects of the text, such as keywords, topics, and summaries. Then, multiple prompt paths are initialized in parallel based on the constructed strategies. These prompt paths reflect different understanding and processing angles, such as different query methods, information extraction strategies, or contextual frameworks. In addition, in order to ensure that multiple angles of understanding are covered, a variety of heuristic strategies are used in the path generation stage. For example, keyword extraction is used to generate prompts based on key information. k , or use summary techniques to generate prompts that focus on the main idea s .

[0051] S3: Each hint path is processed in parallel based on the fork-join topology.

[0052] In S3, forward and backward connection structures are used to ensure the mutual independence and information flow between prompt paths. At the same time, each prompt path independently runs a pre-trained transformer model to process its corresponding information unit, wherein the transformer model includes BERT or GPT.

[0053] In S3, the importance of each prompt path is evaluated in real time, and processing resources are dynamically allocated based on the results of the real-time evaluation. The importance of each prompt path is evaluated using the following formula: I(p)=α·S(p)+β·R(p), where S(p) represents the signal strength of the prompt path, R(p) represents the relevance of the prompt path, and α and β are adjustment parameters.

[0054] In this step, the fork topology is used to allow multiple paths to be forked from a single input point, and each path independently processes information units. Specifically, forward and backward connection structures can be used to ensure the independence of paths and information flow. At the same time, under the multi-path parallel framework, multiple GPUs or other parallel computing resources are used to process multiple prompt paths at the same time, that is, each prompt path independently runs a pre-trained transformer model, such as BERT or GPT, to process its corresponding information unit; in addition, the importance of each prompt path is evaluated in real time, and processing resources are dynamically allocated based on the results of the real-time evaluation. For paths with higher importance evaluation, more computing resources will be allocated to optimize processing efficiency.

[0055] S4: Construct an evaluation model and perform real-time evaluation of each prompt path at different stages of processing based on the evaluation model.

[0056] In S4, the evaluation model is evaluated using the following formula: E(p ij )=w c ·C(p ij )+w r ·R(p ij )+w i·I(p ij ), where w c ,w r ,w i is the weight parameter, and C, R, and I represent the measures of contribution, relevance, and information richness, respectively.

[0057] In this step, the evaluation function (E(p)) is first constructed: for each prompt path p ij The evaluation will be conducted in real time based on its contribution to the query, relevance, and information richness. If the evaluation score E(p ij ) is lower than the preset threshold θ, then this path is discarded and the resources it occupies are released; the evaluation function can be expressed as: E(p ij )=w c ·C(p ij )+w r ·R(p ij )+w i ·I(p ij ) Among them, w c ,w r ,w i is the weight parameter, and C, R, and I represent the measures of contribution, relevance, and information richness, respectively.

[0058] S5: Dynamically prune hint paths whose evaluation scores are lower than a preset threshold, and allocate the released resources to other hint paths whose evaluation scores are higher than the threshold.

[0059] In this step, paths that perform poorly in path evaluation will be dynamically pruned to release resources for paths that perform better. This screening mechanism ensures the efficiency and output quality of the overall system.

[0060] S6: Synthesize the output results of the remaining prompt paths after cropping to generate the final output.

[0061] In S6, a weighted average algorithm or an advanced fusion algorithm is used to synthesize the output results of the remaining prompt paths after clipping.

[0062] In this step, a data fusion strategy is applied to synthesize the output results of multiple excellent paths into one, that is, the output results of all unpruned paths are integrated. Weighted averaging or advanced data fusion technology can be used to generate the final output. At the same time, the language and logic of the synthesized final output are further optimized to ensure its naturalness and accuracy.

[0063] A system for improving the efficiency and accuracy of long text processing is also provided, which is used to implement the above method, including:

[0064] The input processing module is used to receive the input long text, pre-process it, and then decompose it into a series of information units;

[0065] A prompt path generation module, used for creating a prompt path for each information unit;

[0066] A parallel processing engine for executing parallel processing of multiple prompt paths simultaneously;

[0067] A real-time evaluation model for real-time evaluation of each cue pathway at different stages of processing;

[0068] A dynamic pruning module is used to prune the hint paths whose evaluation scores are below a preset threshold;

[0069] The result synthesizer module is used to synthesize the output results of the remaining prompt paths after clipping to generate the final output.

[0070] Among them, the prompt path generation module adopts a variety of heuristic strategies, including strategies based on keyword understanding, theme or abstract understanding, specific context or background understanding, information extraction or specific query based strategies; the parallel processing engine adopts a fork-joined topology structure, and uses forward and backward connection structures to ensure the mutual independence and information flow between prompt paths, and the parallel processing engine will also dynamically allocate processing resources based on the results of real-time evaluation of the importance of each prompt path; the real-time evaluation model is based on the contribution, relevance and information richness of the prompt path for evaluation; the dynamic pruning module will also dynamically adjust the allocation of processing resources based on the feedback of the real-time evaluation model.

[0071] In addition, it includes

[0072] Output optimization module, used to further optimize the language and logic before the result synthesizer module generates the final result;

[0073] Performance testing module to evaluate system response time, accuracy, and resource utilization efficiency;

[0074] The optimization and adjustment module is used to further optimize the system configuration and processing path according to the test results of the performance test module and user feedback.

[0075] The working principle of the system can be referred to the above method and will not be described in detail here. The system in the present invention adopts a unique forked prompt path topology design to allow the language model to efficiently process input documents in parallel prompt paths, and through a sophisticated path pruning mechanism, dynamically excludes those document paths that are not related to the query, which can significantly improve the accuracy and efficiency of the system when processing long texts.

[0076] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for improving the efficiency and accuracy of long text processing, characterized in that: The steps include: S1: preprocessing the input long text, and decomposing the preprocessed long text into a series of information units U1, U2, ..., Un, wherein each information unit includes a paragraph, a paragraph, or a specific data block; S2: Generate a prompt path P(U) for each information unit i )=p i1 ,p i2 ,...,p ik , where each hint path represents a specific understanding or query processing perspective; S3: Process each cue path in parallel based on the fork-join topology; S4: construct an evaluation model, and perform real-time evaluation of each prompt path at different stages of processing based on the evaluation model; S5: Dynamically trim the hint paths whose evaluation scores are lower than a preset threshold, and allocate the released resources to other hint paths whose evaluation scores are higher than the threshold; S6: synthesizing the output results of the remaining prompt paths after clipping to generate the final output; In S2, the generation of prompt paths adopts a variety of heuristic strategies, including keyword-based understanding, topic-based or abstract-based understanding, specific context-based or background-based understanding, and information extraction-based or specific query-based strategies; In S3, forward and backward connection structures are used to ensure mutual independence and information flow between prompt paths, and at the same time, each prompt path independently runs a pre-trained transformer model to process its corresponding information unit, wherein the transformer model includes BERT or GPT; In S3, the importance of each prompt path is evaluated in real time, and processing resources are dynamically allocated based on the results of the real-time evaluation. The importance of each prompt path is evaluated using the following formula: I(p)=α·S(p)+β·R(p), where S(p) represents the signal strength of the prompt path, R(p) represents the relevance of the prompt path, and α and β are adjustment parameters.

2. The method for improving the efficiency and accuracy of long text processing according to claim 1, characterized in that: In S4, the evaluation model is evaluated using the following formula: E(p ij )=w c ·C(p ij )+w r ·R(p ij )+w i ·I(p ij ), where w c ,w r ,w i is the weight parameter, and C, R, and I represent the measures of contribution, relevance, and information richness, respectively.

3. The method for improving the efficiency and accuracy of long text processing according to claim 1, characterized in that: In S6, a weighted average algorithm or an advanced fusion algorithm is used to synthesize the output results of the remaining prompt paths after clipping.

4. A system for improving the efficiency and accuracy of long text processing, used to implement the method of any one of claims 1 to 3, characterized in that: include The input processing module is used to receive the input long text, pre-process it, and then decompose it into a series of information units; A prompt path generation module, used for creating a prompt path for each information unit; A parallel processing engine for executing parallel processing of multiple prompt paths simultaneously; A real-time evaluation model for real-time evaluation of each cue pathway at different stages of processing; A dynamic pruning module is used to prune the hint paths whose evaluation scores are below a preset threshold; A result synthesizer module, used to synthesize the output results of the remaining prompt paths after clipping to generate the final output; The prompt path generation module adopts a variety of heuristic strategies, including strategies based on keyword understanding, theme or summary understanding, specific context or background understanding, information extraction or specific query based strategies; the parallel processing engine adopts a fork-join topology structure and uses forward and backward connection structures to ensure the mutual independence and information flow between prompt paths, and the parallel processing engine also dynamically allocates processing resources based on the results of real-time evaluation of the importance of each prompt path; The real-time evaluation model is based on the contribution, relevance and information richness of the prompt path for evaluation; the dynamic pruning module also dynamically adjusts the allocation of processing resources based on the feedback of the real-time evaluation model.

5. The system for improving the efficiency and accuracy of long text processing according to claim 4, characterized in that: Also includes Output optimization module, used to further optimize the language and logic before the result synthesizer module generates the final result; Performance testing module to evaluate system response time, accuracy, and resource utilization efficiency; The optimization and adjustment module is used to further optimize the system configuration and processing path according to the test results of the performance test module and user feedback.

Citation Information

Patent Citations

  • Visual development system for knowledge graph

    CN118093895A