Abstract text processing method, device and storage medium

CN123012164APending Publication Date: 2026-10-30CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611271202.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-20
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0005]本申请的主要目的在于提供一种摘要文本的处理方法、设备和存储介质,旨在解决文本摘要的处理效果不佳的技术问题

Benefits of technology

[0016]本申请提供了一种摘要文本的处理方法,包括通过基于待处理流水摘要文本逐一两两计算相似度构建全量相似矩阵,依托相似矩阵统计各文本相似关联累计得分确定每轮全局最优聚簇质心,筛选相似度达标文本生成对应聚簇集合,再以各组聚簇质心为基准和簇内文本求取最长公共子序列并筛选生成流水摘要目标文本模式的完整前置处理流程,解决了传统文本算法适配短文本非标准化流水摘要效果差、随机聚类算法结果不稳定、海量流水摘要直接送入大模型受窗口限制导致分类精度低、人工整理文本模式规则人力成本高昂且易遗漏的技术问题,无需分词与专用词库即可完成海量短文本压缩降量,依靠全局确定性聚类消除聚类结果随机偏差,缩减了待输入大模型的数据体量规避上下文缺失缺陷,降低了文本规则梳理人力与模型推理计算成本,同时保障提取的文本模式具备通用泛化能力,提升了流水摘要模式提取效率、稳定性与分类准确度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012164A_ABST
    Figure CN123012164A_ABST
Patent Text Reader

Abstract

The application discloses a processing method and device of abstract text and a storage medium, relates to the technical field of natural language processing, and comprises the following steps: based on a to-be-processed running abstract text, the similarity between any two texts is calculated one by one, and a similarity matrix of the running abstract text is constructed; according to the similar correlation cumulative score corresponding to each text in the similarity matrix, the cluster center of the current round is determined; based on the text with a similarity to the cluster center reaching a preset similarity threshold, a cluster set is generated by clustering; the cluster center of each cluster set is taken as a reference, and the longest common subsequence is calculated between the cluster center and all texts in the cluster set in sequence, and the target text mode of the running abstract text is obtained through screening. The application determines the global optimal cluster by constructing the full-amount similarity matrix, extracts the common subsequence to generate the text mode, solves the problem of poor text abstract processing effect, and achieves the effects of improving the clustering stability, the mass short text processing efficiency and the large model classification precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing technology, and in particular to a method, apparatus and storage medium for processing summary text. Background Technology

[0002] In the scenario of automated accounting of corporate financial transactions, the ability to extract features from massive summaries of income and expenditure transactions, generate rules in batches, and automatically convert vouchers directly affects the efficiency of accounting processing, the accuracy of voucher generation, and the cost of financial human resources.

[0003] In related technologies, accounting rules are built by financial personnel using spreadsheets to summarize text patterns one by one, manually configuring accounting rules, and then using traditional text similarity algorithms and large language models to conduct data-assisted analysis. However, this manual summarization is highly subjective and lacks unified standards, making it easy for feature summarization to be overlooked. It is difficult to adapt to the scenario of large-scale automatic rule extraction of large amounts of non-standardized transaction data, resulting in poor text summarization processing.

[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main objective of this application is to provide a method, apparatus, and storage medium for processing text summaries, aiming to solve the technical problem of poor text summarization processing results.

[0006] To achieve the above objectives, this application proposes a method for processing abstract text, the method comprising: Based on the stream summary text to be processed, the similarity between any two texts in the stream summary text is calculated one by one, and the similarity matrix of the stream summary text is constructed. Based on the cumulative similarity association score corresponding to each text in the similarity matrix, the cluster centroid of the current round is determined; Based on texts whose similarity to the centroid of the cluster reaches a preset similarity threshold, cluster sets are generated. Using the centroid of each cluster set as a reference, the longest common subsequence is obtained by sequentially comparing it with all texts in the cluster set, and the target text pattern of the streaming summary text is obtained by filtering.

[0007] In one embodiment, the text features of the stream summary text are processed according to a unified character format, and invalid and redundant characters are removed to obtain a set of texts to be calculated; For any two different text pairs in the text set to be calculated, calculate the similarity of the text pairs; Using the text of each text pair as row and column indices, and the similarity as matrix elements, an initial matrix is ​​constructed. The initial matrix is ​​subjected to symmetry verification and numerical boundary correction. After correcting the calculation deviation and outliers, the similarity matrix of the pipeline summary text is obtained.

[0008] In one embodiment, the similarity score corresponding to each text in the similarity matrix is ​​compared one by one with the association similarity threshold to determine all similar association pairs that reach the association similarity threshold; Based on the number of similar association pairs corresponding to each text, the cumulative score of the similar associations corresponding to the text is accumulated, and a score mapping set is obtained by mapping. Based on the cumulative similarity association scores of all texts in the score mapping set, determine the target text with the highest cumulative similarity association score; The target text is identified as the centroid of the current round, and the text content and index information of the centroid are associated with it.

[0009] In one embodiment, based on the similarity pairs in the similarity matrix, each of the single stream summary texts is collected one by one to obtain a list of similarity pairs corresponding to each text. The total number of valid association pairs in the list of similar association pairs is counted one by one, and the total number of valid association pairs is determined as the cumulative score of the similar association of the corresponding text. Construct the identifiers of the stream summary text and their corresponding association relationships with the cumulative scores of similar associations, and map them to obtain an initial score set; The initial score set is verified according to the set integrity rules, and missing text and duplicate mapping entries are corrected to obtain the score mapping set.

[0010] In one embodiment, the similarity of all unclustered text within the line corresponding to the centroid of the cluster is extracted to generate a centroid similarity comparison sequence; The similarity values ​​in the centroid similarity comparison sequence are compared one by one with the preset similarity threshold to determine the text whose similarity values ​​meet the preset similarity threshold, thereby obtaining a cluster candidate member set; Embed the cluster centroid of the current round into the cluster candidate member set, and use the cluster centroid as the intra-cluster reference text to obtain the initial cluster set; Perform member deduplication verification and clustering status marking on the initial cluster set, output the cluster set of the current round, and mark all members of the cluster set as clustered.

[0011] In one embodiment, the centroid of the cluster set is used as the benchmark for the initial common subsequence, and a queue of texts to be compared is constructed using the text of the cluster set; Based on the texts in the text queue to be compared, the longest common subsequence is solved sequentially with the benchmark of the common subsequence, and the common subsequence set is obtained by sorting. Based on the set of common subsequences and the cluster centroid, variable segments are filtered and uniformly replaced with standardized wildcards to obtain the target text pattern of the streaming summary text.

[0012] In one embodiment, the common subsequences in the common subsequence set are aligned and matched with the centroid text character by character, and the character intervals in the centroid text not covered by the common subsequences are marked to obtain the variable segment positions; The character segments at the corresponding variable segment positions in the centroid text are uniformly replaced with the standardized wildcards to generate the initial text pattern; Based on the initial text pattern, multiple consecutive adjacent wildcards are merged into a single standardized wildcard, and redundant wildcard fragments at the beginning and end of the pattern are removed to obtain the text regularization pattern. The text normalization pattern is generalized and matched with the text in the cluster set. After confirming that all texts are matched and covered, the target text pattern of the pipeline summary text is obtained.

[0013] In one embodiment, based on the target text pattern, a classification reasoning framework is constructed by retrieving the enterprise financial knowledge base and a preset classification rule template according to the retrieval enhancement mechanism; Typical business classification sample examples are embedded within the classification reasoning framework, and classification reasoning prompts are generated by combining the thinking chain constraint logic set according to the cumulative score of similar associations. The target text pattern and the classification reasoning prompt are input into the large language model to guide the model to optimize the step-by-step reasoning and division of income and expenditure categories according to the semantics of the pattern subject, and output the initial classification result set. After performing classification consistency verification and format normalization on the initial classification result set and correcting abnormal entries that deviate from the classification rules, the classification result of the stream summary text is obtained.

[0014] In addition, to achieve the above objectives, this application also proposes a text processing apparatus for abstract text, the text processing apparatus comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the text processing method for abstract text as described above.

[0015] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the summary text processing method described above.

[0016] This application provides a method for processing summary text, including constructing a full similarity matrix by calculating the similarity of each pair of texts to be processed in the pipeline summary, determining the global optimal cluster centroid for each round by statistically analyzing the cumulative score of similarity associations of each text based on the similarity matrix, selecting texts that meet the similarity standard to generate corresponding cluster sets, and then using the centroids of each cluster as a benchmark and the texts within the cluster to find the longest common subsequence and select to generate the target text pattern for the pipeline summary. This complete preprocessing process solves the technical problems of poor performance of traditional text algorithms in adapting to non-standardized pipeline summaries of short texts, unstable results of random clustering algorithms, low classification accuracy due to window limitations when directly feeding massive pipeline summaries into large models, and high labor costs and easy omissions in manually sorting text pattern rules. It can complete the compression and reduction of massive short texts without word segmentation and dedicated thesaurus, eliminates random bias in clustering results by relying on global deterministic clustering, reduces the data volume to be input into large models and avoids the defect of missing context, reduces the labor cost of sorting text rules and the computational cost of model inference, and at the same time ensures that the extracted text patterns have generalization ability, thereby improving the extraction efficiency, stability and classification accuracy of pipeline summary patterns.

[0017] In summary, this application solves the technical problem of poor text summarization performance by constructing a full similarity matrix to determine the globally optimal cluster and extracting common subsequences to generate text patterns. It achieves the effects of improving clustering stability, efficiency in processing massive amounts of short text, and accuracy in large model classification. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the first embodiment of the method for processing the abstract text of this application; Figure 2 This is a processing framework diagram for this application; Figure 3 This is a flowchart illustrating the fourth embodiment of the method for processing the abstract text of this application; Figure 4 This is a flowchart of the text processing for the abstract of this application; Figure 5 This is a flowchart illustrating the seventh embodiment of the method for processing the abstract text of this application; Figure 6 This is a flowchart illustrating the eighth embodiment of the method for processing the abstract text of this application; Figure 7 This is a schematic diagram of the structure of the device for processing the abstract text of this application.

[0021] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0022] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0023] In related technologies, accounting rules are built by financial personnel using spreadsheets to summarize text patterns one by one, manually configuring accounting rules, and then using traditional text similarity algorithms and large language models to conduct data-assisted analysis. However, this manual summarization is highly subjective and lacks unified standards, making it easy for feature summarization to be overlooked. It is difficult to adapt to the scenario of large-scale automatic rule extraction of large amounts of non-standardized transaction data, resulting in poor text summarization processing.

[0024] This application provides a solution: First, based on the stream summary text to be processed, the similarity between any two texts in the stream summary text is calculated one by one to construct a similarity matrix of the stream summary text. Then, based on the cumulative similarity association score corresponding to each text in the similarity matrix, the centroid of the current round is determined. Then, based on the texts whose similarity with the centroid of the cluster reaches a preset similarity threshold, cluster sets are generated. Finally, the centroid of each cluster set is used as a benchmark, and the longest common subsequence is calculated with all texts in the cluster set in turn to obtain the target text pattern of the stream summary text.

[0025] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or text summarization device capable of performing the above functions. The following description uses a text summarization device as an example to illustrate this embodiment and the subsequent embodiments.

[0026] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0027] This application provides a method for processing abstract text, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the method for processing the abstract text of this application.

[0028] This embodiment uses deterministic clustering based on similarity matrices and extraction of generalized text patterns from the longest common subsequence. Combined with a large model and retrieval enhancement, it completes semantic classification, solving the problems of poor adaptability of traditional algorithms, high cost of manual rules, and low efficiency of large models directly connecting to massive amounts of data. This effectively improves the efficiency of financial transaction processing and classification accuracy.

[0029] In this embodiment, the method for processing the summary text includes steps S10 to S40: Step S10: Based on the stream summary text to be processed, calculate the similarity between any two texts in the stream summary text one by one, and construct the similarity matrix of the stream summary text.

[0030] The transaction summary texts to be processed are short text data derived from banking transaction records and cash receipts and payments records. They are characterized by short character length, non-standardized expressions, and a high proportion of abbreviations. Similarity is a quantitative indicator that measures the degree of similarity in character structure between two transaction summary texts. The similarity matrix is ​​a two-dimensional data table with all transaction summary texts as rows and columns, and the similarity values ​​between each pair of texts as matrix elements.

[0031] In this embodiment, the aforementioned similarity matrix can be constructed in three ways. The first is a full character-level pairwise traversal calculation. Before the matrix construction officially begins, all stream summary texts undergo character normalization preprocessing to unify full-width and half-width characters, uppercase and lowercase letters, and redundant spaces. Then, a double loop traverses all text combinations, calculating character-level similarity values ​​pairwise and sequentially filling them into the corresponding row and column positions of the matrix to complete the construction of the full similarity matrix. This method has rigorous calculation logic, complete matrix elements without missing components, is suitable for small to medium-sized stream summary datasets, and can provide high-precision similarity criteria for subsequent clustering.

[0032] The second approach involves incremental construction using a batch sliding window. For massive pipelined summary datasets, the dataset is divided into batches based on a fixed number of texts. Text is read batch by batch using a sliding window, and pairwise similarity calculations and local submatric generation are performed within each batch. Subsequently, the submatrices from each batch are concatenated into the global matrix according to the text index, and the corresponding row and column data of the calculated texts are updated synchronously until all batches are processed to obtain the complete similarity matrix. This method eliminates the need to load the entire dataset at once, effectively reducing memory usage and making it suitable for processing ultra-large-scale pipelined summary datasets of millions or more.

[0033] Thirdly, a streamlined calculation method using pre-filtering of common characters is employed. First, a character set is extracted from all pipelined summary texts. Text pairs without any common characters are pre-filtered, and their similarity is directly marked as the lowest value. Formal similarity calculations are performed only on text pairs containing common characters. The calculation results are then filled into the corresponding matrix positions, while the remaining positions are directly filled with the preset minimum similarity value. This method significantly reduces unnecessary computation, dramatically improves matrix construction speed, and is suitable for pipelined summary processing scenarios with a large number of texts and significant differences in the characters of individual texts.

[0034] For example, the complete execution flow of similarity matrix construction includes three stages: character preprocessing, pairwise calculation, and matrix generation. First, all the pipeline summary texts to be processed are loaded, and character standardization is performed, removing leading and trailing whitespace characters and unifying the format of numbers and punctuation to obtain a standardized text set. Then, a two-dimensional matrix structure is initialized, with the row and column indices corresponding one-to-one with the text indices of the standardized text set, and the initial values ​​of the matrix are all set to zero. Next, an outer loop iterates through the baseline text corresponding to each row, and an inner loop iterates through all columns corresponding to the comparison text after the current row, calculating the similarity value of each pair of texts. The value is then simultaneously filled into the corresponding row and column of the matrix, as well as swapped rows and columns, to ensure the symmetry of the matrix. After all text pairs have been calculated, a matrix integrity check is performed to check for and correct index misalignment and missing values, outputting the final full similarity matrix for subsequent cluster centroid determination.

[0035] Step S20: Determine the cluster centroid of the current round based on the cumulative similarity association score corresponding to each text in the similarity matrix.

[0036] The cumulative similarity score is a quantified statistical value of all associated texts with a similarity score reaching a preset threshold in the similarity matrix for a single text. It is used to characterize the degree of similarity clustering of the text in the overall dataset. The current round refers to a single iteration that uses only the similarity matrix of the remaining unclassified texts to calculate scores, select specific centroids, and generate a cluster. For example, if there are initially 10,000 pipeline summaries in the first round, this round selects the first centroid, aggregates thousands of summaries, and then discards them. The remaining texts enter the second round, and so on. The cluster centroid is the text with the highest similarity clustering degree in the current round, serving as the core benchmark for generating the corresponding cluster.

[0037] In this embodiment, the cluster centroid of the current round can be determined in three ways. The first is a correlation count-based scoring method. This involves traversing each row of the similarity matrix, comparing each similarity value in that row with a preset similarity threshold, and counting the total number of correlated texts that reach the threshold. This number is then used as the cumulative similarity score for the corresponding text. After all text scores are tallied, the text with the highest score is selected as the cluster centroid of the current round. This method has a simple calculation logic, high statistical efficiency, and is suitable for pipelined summary datasets with moderate data size and uniform text similarity distribution.

[0038] The second method uses a weighted cumulative similarity score determination. It iterates through each row of the similarity matrix, performing a weighted cumulative calculation on all similarity values ​​within that row. Values ​​reaching a preset similarity threshold are counted in full, while values ​​below the threshold are discounted using a preset discount factor. The cumulative result serves as the accumulated similarity score for the corresponding text. Finally, the text with the highest cumulative score is selected as the centroid of the current cluster. This method balances the quantity and strength of associations, enabling more accurate location of texts at the center of similarity clusters, and is suitable for processing scenarios with significant differences in text similarity and high clustering accuracy requirements.

[0039] Thirdly, a neighborhood density-based scoring method is used. First, an initial score is obtained for each text by counting the number of associations. Then, a neighborhood density check is performed on the top-ranking candidate texts based on their initial scores. This check calculates the density of the surrounding texts of each candidate text, multiplies the neighborhood density coefficient by the initial score to obtain the final cumulative score, and selects the candidate text with the highest final score as the centroid of the current cluster. This method effectively eliminates isolated high-scoring outliers, ensuring that the centroid is located in the core region of the cluster, thus improving the stability of subsequent clustering results.

[0040] For example, the complete execution process for determining the cluster centroid includes three stages: score statistics, candidate selection, and centroid confirmation. First, the similarity matrix sub-table corresponding to the remaining unclustered texts is read, with a preset similarity threshold used as the association judgment criterion. Then, the sub-table is traversed row by row, counting the number of texts in each row whose similarity value is greater than or equal to the preset similarity threshold. This number is recorded as the cumulative similarity association score for the corresponding text, generating a score statistics table for this round. Next, the score statistics table is sorted in descending order of score value, and the top three texts are extracted as candidate centroids. Then, the neighborhood average similarity of the three candidate centroids is calculated, i.e., the average similarity between the candidate centroid and all its associated texts. The neighborhood average similarity is multiplied by the cumulative score to obtain a comprehensive score. Finally, the text with the highest comprehensive score is selected as the cluster centroid for the current round, and the centroid text content and corresponding index are output for the generation of subsequent cluster sets.

[0041] Step S30: Based on texts whose similarity to the centroid of the cluster reaches a preset similarity threshold, cluster sets are generated.

[0042] The preset similarity threshold is a pre-defined minimum similarity standard used to determine whether text should be assigned to a corresponding cluster. A cluster set is a text clustering group composed of the cluster centroid and all texts that meet the similarity requirement.

[0043] In this embodiment, the aforementioned cluster set can be generated in three ways. One method is direct clustering based on a single threshold. This involves extracting all similarity values ​​of the row corresponding to the cluster centroid, comparing each value with a preset similarity threshold, and incorporating all unclustered text with a similarity greater than or equal to the threshold into the current cluster. These clusters, along with their centroids, form the cluster set for the current round. This method is simple and direct, has fast clustering speed, and is suitable for pipelined summarization processing scenarios where text similarity distribution is uniform and clustering granularity is required.

[0044] The second method employs a hierarchical, progressive clustering approach. This involves setting multiple similarity thresholds. First, the highest threshold is used to filter core, related texts into clusters. Then, the thresholds are progressively lowered, with additional texts within the corresponding similarity range filtered at each lower threshold. Simultaneously, the average similarity between the newly added texts and the already clustered core texts is verified. If the average similarity still meets the basic requirements, the text is officially added to the cluster. This process continues until the threshold is lowered to the preset similarity threshold, ultimately forming a cluster set containing a core layer and an extension layer. This method can create a gradient clustering structure, balancing cluster density and coverage, and is suitable for streaming summary datasets with diverse text patterns and significant differences in similarity levels.

[0045] Thirdly, cross-cluster conflict-checking clustering generation first identifies all texts that meet the similarity criteria to the centroid of the current cluster. Then, it checks whether these texts have already been marked as candidate members of other clusters to be generated. If conflicting texts meet the selection criteria for multiple clusters, the similarity between the text and the centroids of each cluster is calculated, and the text is assigned to the cluster with the higher similarity. Finally, the members of the current cluster are confirmed, generating a set of clusters without duplicate assignments. This method avoids duplicate text clustering, ensures the mutual exclusivity of all cluster sets, and improves the accuracy of the overall clustering results.

[0046] For example, the complete execution flow for cluster set generation includes three stages: member selection, conflict verification, and status marking. First, the cluster centroid index for the current round is read, and a list of similarity values ​​for all unclustered texts corresponding to that centroid is extracted from the similarity matrix. Then, the similarity value list is compared one by one with a preset similarity threshold, filtering out all unclustered texts that meet the similarity standard to form an initial member list. Next, it is verified whether any texts in the initial member list have already been pre-labeled by other clusters to be generated. If conflicting texts exist, their similarity values ​​are compared with those of different centroids, and the texts are assigned to clusters with higher similarity, thus correcting the initial member list. The cluster centroid is then added to the corrected member list, completing the final aggregation of cluster members and generating the formal cluster set. Finally, all texts within the cluster set are marked as clustered, and the corresponding rows and columns are removed from the similarity matrix for use in the next round of cluster centroid selection.

[0047] Step S40: Using the centroid of each cluster set as a reference, the longest common subsequence is obtained by sequentially comparing it with all texts in the cluster set, and the target text pattern of the streaming summary text is obtained by filtering.

[0048] The longest common subsequence is a sequence of identical characters that appear sequentially but are not necessarily consecutive in two texts, used to characterize common structural features between texts. The target text pattern is a standardized text expression generated based on the common structure, replacing variable segments with wildcards, and can match all sequential summary texts within the corresponding cluster.

[0049] In this embodiment, the target text pattern can be generated in three ways. One method is iterative convergent generation, using the cluster centroid text as the initial common sequence benchmark. Individual texts within the cluster are sequentially extracted, and their longest common subsequence is calculated against the current common sequence benchmark. The resulting new common subsequence is then used as the benchmark for the next round of comparison. This process is repeated until all texts within the cluster have been compared. Finally, the target text pattern is generated by replacing variable segments with the converged common subsequence. This method offers a clear and controllable iterative process, with the common sequence gradually converging, making it suitable for processing scenarios where the number of texts within the cluster is moderate and the pattern structure is relatively uniform.

[0050] The second approach involves multi-group parallel intersection generation. The text within a cluster is divided into multiple comparison groups. Each group solves for the longest common subsequence within its text in parallel, resulting in multiple sets of local common subsequences. Then, the global intersection of all local common subsequences is calculated to obtain the longest common subsequence covering the entire cluster. Finally, the target text pattern is generated by replacing variable segments based on the global common subsequence. This method improves processing efficiency through parallel computation and is suitable for processing scenarios with a large number of texts within a cluster that require rapid pattern generation.

[0051] Thirdly, the core semantic anchoring generation method first extracts core semantic fragments representing business meaning from the cluster centroid as fixed anchor points. Then, the text is divided into multiple segments using the anchor points as boundaries. Within each segment, the longest common subsequence of the text within the cluster is calculated. The common subsequences of each segment are concatenated to obtain the full common structure. Finally, non-common variable fragments are replaced to generate the target text pattern. This method ensures that the core business semantics are not lost, and the generated pattern is more in line with the actual business of financial transactions, adapting to transaction summary datasets with clear business semantics and obvious pattern segmentation features.

[0052] For example, the complete execution flow of target text pattern generation includes three stages: common sequence solving, variable fragment replacement, and pattern verification. First, a single cluster set is loaded, and the cluster centroid is extracted as the initial comparison benchmark. Simultaneously, all member texts within the cluster are retrieved to form a comparison queue. Then, each text in the queue is sequentially retrieved, and the longest common subsequence is solved with the current comparison benchmark. The obtained common subsequence is updated as the new comparison benchmark until all texts in the queue are compared, resulting in the final full-cluster common subsequence. Next, the final common subsequence is aligned character-by-character with the cluster centroid text. Character intervals in the centroid text not covered by the common subsequence are marked as variable fragments, and all variable fragments are uniformly replaced with standardized wildcards to generate the initial text pattern. Finally, the initial text pattern is used to perform matching verification on all texts within the cluster, confirming that all texts can be completely matched by the pattern. If any text fails to match, the common subsequence is iteratively optimized. Once the verification is successful, the target text pattern corresponding to that cluster is output.

[0053] Further, please refer to Figure 2 , Figure 2This is a processing framework diagram for this application. After receiving the input pipeline summary, the system enters the pattern extraction stage. Considering the short and non-normalized characteristics of the pipeline summary, the Jaro-Winkler algorithm is used to calculate the similarity between any two texts and construct a full similarity matrix. Based on this, a clustering strategy based on improved similarity scoring is used to perform clustering. This process differs from the traditional K-Means clustering algorithm; it does not rely on randomly initialized centroids but performs deterministic clustering based on global similarity relationships, automatically grouping texts with high similarity into the same cluster, ensuring the stability and consistency of the clustering results. After clustering, the Longest Common Subsequence (LCS) algorithm is used to extract the common structural parts of different texts within each cluster, uniformly replacing non-common parts with wildcard forms. For samples where inconsistent semantic paths prevent the formation of stable common subsequences, multiple iterations are used to ensure the stability of the final output, generating summary patterns with generalization capabilities. The summary pattern is then input into the Large Language Model (LLM), and combined with the Retrieval-Augmented Generation (RAG) mechanism, it incorporates the enterprise financial knowledge base and classification rule templates to carry out semantic reasoning, ultimately completing the pattern semantic classification.

[0054] Second Embodiment This embodiment solves the calculation deviation problem caused by messy serial text format through character standardization preprocessing, text pair similarity calculation, and matrix verification correction, and outputs a similarity matrix to support subsequent clustering processing.

[0055] This embodiment provides an exemplary scheme for constructing a pipelined summary similarity matrix. In this example, the pipelined summary text is first processed with a unified character format and invalid redundant characters are removed to obtain a set of texts to be calculated. Then, the similarity matching operation of all text pairs is completed by iteratively polling. Subsequently, the similarity values ​​are filled with text as the row and column dimensions to generate an initial matrix. Finally, a stable and reliable pipelined summary similarity matrix is ​​obtained after symmetry verification and numerical boundary correction. Step S10 includes steps A11 to A14: Step A11: Process the text features of the stream summary text according to a unified character format and remove invalid and redundant characters to obtain the text set to be calculated.

[0056] Step A12: For any two different text pairs in the text set to be calculated, calculate the similarity of the text pairs.

[0057] Step A13: Construct an initial matrix using the text of each text pair as row and column indices and the similarity as matrix elements.

[0058] Step A14: Perform symmetry verification and numerical boundary correction on the initial matrix. After correcting the calculation deviation and outliers, obtain the similarity matrix of the pipeline summary text.

[0059] The set of text to be calculated is a stream summary text set that has been standardized and formatted, and invalid and redundant content has been removed. It is the basic processing unit for similarity matching operations. Invalid and redundant characters are redundant content in the stream summary that does not carry core business semantics and does not affect the similarity determination. They are the core objects to be removed in the text preprocessing stage. Examples include leading and trailing whitespace characters, meaningless special characters, repeated and redundant separators, full-width and half-width difference characters, and uppercase and lowercase difference characters of English letters. The initial matrix is ​​a two-dimensional data structure filled with similarity values ​​in rows and columns of all text, without verification or correction. It is an intermediate product in the similarity matrix generation process.

[0060] In this example, when performing character formatting on the pipeline summary text to obtain the text set to be calculated, it can be done using a full batch normalization approach. This involves loading all pipeline summary text at once, uniformly converting character encoding, full-width / half-width formats, and uppercase / lowercase English letters, and simultaneously removing leading and trailing whitespace, meaningless special characters, and other invalid and redundant characters. This batch normalization process completes the standardization of all text, resulting in the text set to be calculated. Alternatively, a streaming incremental reading approach can be used, performing character normalization and redundant character removal on individual texts while reading the pipeline summary text, accumulating the results to obtain the text set to be calculated. This completes text preprocessing and set construction, adapting to pipeline summary datasets of different sizes.

[0061] After constructing the set of texts to be calculated, the similarity matching operation is initiated. Each text in the set is iterated through and compared with the remaining texts in the set, yielding the similarity scores for all pairwise text pairs. Then, using all the pipelined summary texts as the row and column dimensions of a matrix, the similarity scores for each pair of texts are filled into the intersection of the corresponding rows and columns to generate an initial matrix. Next, symmetry verification and numerical boundary correction are performed on the initial matrix to correct calculation biases and outliers, resulting in the pipelined summary similarity matrix. This layered text preprocessing and multi-round verification and correction improve the calculation accuracy and data stability of the similarity matrix, avoiding distortion of subsequent clustering results due to text formatting issues and numerical biases.

[0062] For example, there are two methods for calculating the similarity of all pairwise text pairs from the text set to be calculated. The first method is an index-incrementing serial symmetric calculation. Following the index order of the text set, the outer loop sequentially selects each text as the reference text, while the inner loop only iterates through the remaining texts with indices greater than the reference text as comparison texts, performing similarity calculations pairwise. After each pair's similarity calculation is completed, the value is simultaneously filled into two symmetrical positions in the matrix: the reference row's comparison column and the comparison row's reference column. After all text pairs have been calculated and backfilled, a complete initial matrix is ​​obtained. This method employs an index-locked pairwise serial calculation and symmetric synchronous backfilling logic. By limiting the range of the inner loop, it avoids redundant calculations while ensuring the natural symmetry of the matrix, restoring the true correspondence of similarity between texts. The calculation logic is rigorous and stable.

[0063] The second approach involves parallel batch computation through sub-block splitting. This method splits the text set to be computed into equal-sized blocks and marks the global index. Based on the total amount of text in the set and the available computing resources, sub-blocks are created, dividing texts with continuous indices and consistent size into the same sub-block. The global index range of each sub-block is then marked, generating multiple sub-blocks that are computationally independent. All the divided sub-blocks are then paired to form parallel computation task groups. Multiple groups of computation tasks are simultaneously launched to perform text pair similarity calculations between the sub-blocks. After each task group completes its calculation, the results are batch-filled back into the corresponding sub-regions of the matrix. Once all parallel computations and backfilling of all task groups are complete, the initial matrix is ​​obtained by concatenating the results. This method employs a sub-block task splitting and full-task parallel computation processing logic. By splitting the text set into blocks beforehand, a large-scale computation task is divided into multiple independent sub-tasks, reducing the computation time of a single task and improving the matrix construction efficiency of ultra-large-scale pipelined summary datasets.

[0064] The initial matrix assignment methods include: 1) Fixed constant diagonal assignment method: Using each pipeline summary text as the row and column indices of the matrix, and the cross-row and cross-column similarity between different texts as the off-diagonal elements of the matrix, the initial matrix is ​​constructed. The elements on the main diagonal (positions where the row and column indices are identical) are uniformly assigned a fixed value of 1, representing the complete similarity between a single text and itself, ensuring that the main diagonal of the similarity matrix is ​​always 1, thus completing the initial matrix generation. 2) Native similarity algorithm calculation diagonal assignment method: Using each pipeline summary text as the row and column indices of the matrix, the similarity algorithm is called to calculate the text matching degree pairwise, generating the initial matrix. During the calculation process, the similarity algorithm is directly called to calculate the similarity result of a single text itself, and the algorithm's native output value is used as the value of the main diagonal element, completing the initial matrix construction. The symmetric verification and synchronous backfilling diagonal assignment method uses each pipeline summary text as the row and column indices of the matrix. First, it calculates the pairwise text similarity for all positions i ≠ j and performs symmetric backfilling. Then, it iterates through the main diagonal positions individually, uniformly verifying and assigning a value of 1. Simultaneously, it performs a full matrix symmetry verification to ensure A[i, j] = A[j, i], generating a symmetric and compliant initial matrix. The dynamic threshold adaptation diagonal assignment method uses each pipeline summary text as the row and column indices of the matrix. It fills off-diagonal matrix elements with cross-index text similarity, with the main diagonal assigned a default value of 1. It also configures global similarity value range verification rules, allowing only similarities between 0 and 1. If abnormal values ​​exist, truncation correction is performed, completing the initial matrix construction.

[0065] Furthermore, in the business scenario of batch processing monthly bank transaction summary data in an enterprise financial system, the entire original transaction summary data is first imported. All full-width characters and uppercase / lowercase English letters in the summary text are converted to standard half-width format according to a unified character format. Simultaneously, leading and trailing whitespace characters, meaningless special separators, and other invalid and redundant characters are removed, resulting in a standardized set of text to be calculated. Then, the Jaro-Winkler (Jaro-WinklerDistance) algorithm is used to iterate through each transaction summary text in the set, performing character-level similarity matching operations with all other texts in the set to calculate the similarity values ​​for all pairwise text pairs. Finally, using all transaction summary texts as the row and column dimensions of a matrix, the similarity values ​​for each pairwise text pair are precisely filled into the intersection of the corresponding rows and columns of the matrix, generating an initial matrix covering all transaction summaries. Finally, symmetry verification and numerical boundary correction were performed on the initial matrix. After correcting floating-point calculation deviations and outliers that exceeded reasonable value ranges, a pipeline summary similarity matrix with accurate data and symmetrical structure was obtained, providing a reliable calculation basis for subsequent deterministic clustering and text pattern extraction.

[0066] Third Embodiment This embodiment solves the problem of unstable results caused by random initialization of centroids in traditional clustering by using threshold filtering of similar association pairs, statistical accumulation of similar association scores and sorting for the best, and outputs the global best centroid, ensuring the determinism and representativeness of the clustering results.

[0067] This embodiment provides an exemplary scheme for determining the centroid of a pipelined summary cluster. In this example, the similarity of each text in the similarity matrix is ​​compared with the association similarity threshold one by one to determine all similar association pairs. Then, based on the number of similar association pairs corresponding to each text, a cumulative similarity association score is generated and a score mapping set is constructed. Subsequently, the score set is sorted in descending order to lock the target text with the highest score. Finally, it is determined as the cluster centroid of the current round and associated with the corresponding text content and index information. Step S20 includes steps B11 to B14: Step B11: Compare the similarity of each text in the similarity matrix with the association similarity threshold one by one to determine all similar association pairs that reach the association similarity threshold.

[0068] Step B12: Based on the number of similar association pairs corresponding to each text, accumulate the cumulative score of the similar associations corresponding to the text, and map them to obtain a score mapping set.

[0069] Step B13: Based on the cumulative similarity association scores of all texts in the score mapping set, determine the target text with the highest cumulative similarity association score.

[0070] Step B14: Determine the target text as the cluster centroid of the current round, and associate the text content and index information of the cluster centroid.

[0071] The association similarity threshold is a pre-set minimum similarity standard used to determine whether two stream summary texts constitute a valid similar association. It is the core criterion for screening similar association pairs. Examples include character structure similarity threshold, common segment ratio threshold, and comprehensive similarity threshold. A similar association pair is a combination of two stream summary texts whose similarity values ​​reach the association similarity threshold. It is the basic statistical unit for calculating the degree of text similarity clustering. Examples include all qualifying text pairs corresponding to a single text, bidirectional symmetrical text similarity combinations, and valid similar association text pairs.

[0072] The score mapping set is a mapping dataset that maps all the pipelined summary texts to their corresponding cumulative similarity scores. It is the core data foundation for ranking and selecting the optimal cluster centroids. Examples include the text index-score key-value pair set, the text content-score mapping table, and the global score statistics mapping table. The cluster centroid is the text with the highest cumulative similarity score in the current round. As the core benchmark text for generating the corresponding cluster, it determines the core structural features and cluster boundaries of the corresponding cluster. Examples include the globally optimal cluster center text, the cluster core benchmark text, and the cluster representative text.

[0073] In this example, when comparing similarity scores with association similarity thresholds to determine similarity pairs, a full row-by-row sequential comparison can be performed. This involves iterating through each row of the similarity matrix, comparing each similarity value in that row with the association similarity threshold, marking all text combinations that reach the threshold, and thus obtaining all similarity pairs. Alternatively, a block-based parallel threshold comparison approach can be used. This involves dividing the similarity matrix into multiple computational sub-blocks along the row dimension, with each sub-block performing threshold comparisons and association pair marking in parallel, accumulating and summarizing to obtain all similarity pairs. This method effectively filters similarity pairs and adapts to similarity matrix calculation scenarios of different sizes.

[0074] After filtering similarity pairs, the process of calculating the cumulative similarity score is initiated. For each text, the number of similarity pairs is counted, and the cumulative similarity score for that text is generated. A one-to-one correspondence between text identifiers and scores is established, mapping to obtain a score mapping set. Then, all texts in the score mapping set are sorted in descending order according to their cumulative similarity scores, and the target text with the highest score is located. Finally, this target text is determined as the cluster centroid for the current round, and its text content and index information are associated and bound. This hierarchical threshold filtering and global sorting optimization improve the accuracy and representativeness of cluster centroid selection, avoiding the instability caused by random initialization of centroids in traditional clustering algorithms.

[0075] For example, there are two methods for determining the cluster centroid through the score mapping set. The first is a single-pass dynamic locking method, which reads the cumulative similarity score of each text sequentially according to the text index order of the score mapping set. The current highest score and its corresponding text information are maintained synchronously. The score of each text read is compared with the current highest score; if the current text score is higher, the highest score and its corresponding text record are updated. After traversing all texts, the text corresponding to the highest score is finally locked as the target text, which is determined as the cluster centroid of the current round and associated with the corresponding text content and index information. This method uses a single-pass dynamic update calculation logic, maintaining the optimal result in real time through successive comparisons. It does not require additional full sorting storage overhead, is suitable for fast centroid selection of small to medium-sized score mapping sets, and is logically simple and stable and reliable in execution.

[0076] The second method is a hierarchical initial selection and neighborhood verification approach. This involves globally sorting the score mapping set in descending order and extracting the top-ranked texts as a candidate centroid set. Then, a neighborhood similarity check is performed on each text in the candidate centroid set, calculating the average similarity between the candidate text and all its associated texts. A comprehensive score is calculated by combining the cumulative similarity score with the average neighborhood similarity. The candidate text with the highest comprehensive score is selected as the target text, determined as the cluster centroid for the current round, and associated with its corresponding text content and index information. This method employs a hierarchical processing logic of global initial sorting and neighborhood verification for final selection. Through secondary verification, it eliminates abnormal texts with high scores on the margins, ensuring that the selected centroids are truly located in the core region of the cluster, thus improving the compactness and overall stability of subsequent clustering results.

[0077] Furthermore, in the business scenario of batch processing monthly bank transaction summaries and extracting common accounting text patterns in corporate finance departments, the similarity matrix (SM) generated by the Jaro-Winkler (Jaro-Winkler Distance) algorithm is first loaded. The similarity value corresponding to each transaction summary text in the similarity matrix is ​​compared one by one with a preset association similarity threshold to determine the similarity, filtering out all similar association pairs that meet the similarity standard and possess strong character structure similarity. Then, using a single transaction summary text as the statistical dimension, all its corresponding similar association pairs are collected one by one. Based on the number of similar association pairs corresponding to each text, a cumulative similarity score for that text is generated, establishing a one-to-one correspondence between the unique text index and the score, mapping to obtain a score mapping set covering all transaction summaries. Next, all transaction summary texts in the score mapping set are globally sorted in descending order according to their cumulative similarity scores. The single text with the highest score peak is then located and marked as the target text with the highest cumulative similarity score. Finally, the target text was officially identified as the cluster centroid (CC) of the current round. The original text content of the cluster centroid and its unique index information in the dataset were synchronously associated and bound, providing a stable and reliable core benchmark for subsequent clustering and generalized text pattern extraction.

[0078] Fourth embodiment This embodiment generates a cumulative score by aggregating similar association pairs and counting the number of valid associations. After integrity verification to correct omissions and duplicate entries, it solves the problem of score statistical bias and outputs an accurate mapping set, ensuring the accuracy of cluster centroid selection.

[0079] This embodiment provides an exemplary scheme for generating a stream summary score mapping set. In this example, similar association pairs in the similarity matrix are first aggregated one by one along the stream summary text dimension to obtain a list of similar association pairs corresponding to each text. Then, the total number of valid association pairs in each list is counted and determined as the cumulative similarity score for the corresponding text. Subsequently, a mapping relationship between text identifiers and scores is constructed to obtain an initial score set. Finally, missing texts and duplicate mapping entries are verified and corrected according to the set integrity rules to obtain an accurate and standardized score mapping set. Please refer to... Figure 3 , Figure 3 This is a flowchart illustrating the fourth embodiment of the method for processing the abstract text of this application. Step B12 includes steps C11 to C14: Step C11: Based on the similarity pairs in the similarity matrix, each of the single stream summary texts is used as a processing unit to collect them one by one, resulting in a list of similarity pairs corresponding to each text.

[0080] Step C12: Count the total number of valid association pairs in the list of similar association pairs one by one, and determine the total number of valid association pairs as the cumulative score of the similar association of the corresponding text.

[0081] Step C13: Construct the identifier of the stream summary text and its corresponding association relationship with the cumulative score of similar association, and map it to obtain the initial score set.

[0082] Step C14: Verify the initial score set according to the set integrity rules, correct missing text and duplicate mapping entries, and obtain the score mapping set.

[0083] The similarity association pair list is a collection of entries centered around a single stream summary text, gathering all similar association pairs that meet the association similarity threshold. It serves as the basic statistical unit for calculating the cumulative similarity association score. Examples include a list of all qualifying text pairs for a single text, a set of positive similarity association entries, and a detailed list of bidirectional symmetric association pairs. Valid association pair entries are those in the similarity association pair list whose corresponding texts are not clustered and whose similarity values ​​are valid. These are the valid statistical objects for calculating the cumulative similarity association score. Examples include association pairs corresponding to non-clustered texts, association pairs with similarity values ​​within a reasonable range, and valid association pairs without duplicates.

[0084] The initial score set is a mapping dataset that has not yet undergone integrity verification and has initially established the correspondence between text identifiers and scores. It is an intermediate product in the process of generating the score mapping set. Examples include a preliminary set of text-score key-value pairs, an unverified draft of the score mapping, and a temporary score statistics set. The score mapping set, on the other hand, is a dataset that has undergone integrity verification and contains a one-to-one correspondence between text and scores without omissions or duplicates. It serves as the core basis for subsequent cluster centroid sorting and selection. Examples include a standardized text score mapping table, a verified score index set, and a global score statistics mapping library. Set integrity rules are preset rules used to verify the initial score set, ensuring that all text has a corresponding score and that there are no duplicate mappings. These rules include full text coverage rules and mapping uniqueness rules. Examples include full text index coverage verification rules, duplicate mapping deduplication rules, and score value validity verification rules.

[0085] In this example, when collecting similarity pairs to obtain a list of similarity pairs for each text, it can be done by sequentially collecting all pairs row by row. This involves iterating through each row of the similarity matrix, collecting all eligible similarity pairs within that row based on the row index, and storing each pair in the corresponding similarity pair list, thus completing the collection of similarity pairs for all texts. Alternatively, a block-based parallel collection method can be used. The similarity matrix is ​​divided into multiple data sub-blocks along the row dimension, and each sub-block performs pair filtering and text-based collection in parallel. Finally, the results from each sub-block are summarized to obtain a list of similarity pairs for each text, thus completing the dimensional collection of similarity pairs and adapting to similarity matrix processing scenarios of different sizes.

[0086] After compiling the list of similar association pairs, the score statistics and mapping construction process is initiated. The total number of valid association pairs in each similar association pair list is counted, and this total number of valid association pairs is determined as the cumulative similarity score for the corresponding text. Subsequently, a one-to-one correspondence is established between the unique identifier of the pipeline summary text and its cumulative similarity score, mapping to obtain the initial score set. Then, the initial score set is validated according to the set integrity rules, identifying and supplementing missing texts and removing duplicate mapping entries, ultimately obtaining a standardized and accurate score mapping set. This hierarchical collection and multi-round validation improve the completeness and accuracy of score statistics, avoiding cluster centroid selection bias caused by statistical omissions or duplicate mappings.

[0087] For example, there are two verification methods for obtaining the score mapping set from the initial score set. The first is a single-pass serial item-by-item verification. Following the global index order of the pipeline summary texts, each text is checked sequentially to see if it exists in the initial score set, simultaneously verifying whether the same text has multiple score records. After each text is verified, if there is an omission, the corresponding score is added; if there are duplicates, valid entries are retained and redundant records are removed, and the set data is updated synchronously. After all texts have been verified and corrected, a complete and unique score mapping set is obtained. This method employs index-locked sequential verification and real-time correction processing logic. By checking item by item in sequence, it ensures no text omissions, strictly guarantees the one-to-one correspondence of the mappings, and has rigorous verification logic, making it suitable for high-precision verification scenarios with small to medium-sized datasets.

[0088] The second method is domain-based batch parallel verification. The initial score set is divided into multiple verification subdomains based on text index intervals, with no index overlap or data dependency between subdomains. Multiple verification tasks are simultaneously launched to perform integrity verification in parallel on each subdomain, checking for missing text and duplicate entries and correcting them within each subdomain. After all subdomains have been verified in parallel, a global duplicate check and boundary text completion verification are performed across subdomains. The resulting global score mapping set is then aggregated and corrected. This method employs a domain-based task splitting and full-subdomain parallel verification processing logic. By dividing the large-scale verification task into independent subtasks through pre-defined index intervals, the full verification time is shortened. Simultaneously, cross-domain global verification ensures overall consistency, making it suitable for efficient verification scenarios of ultra-large-scale pipelined summary datasets.

[0089] Furthermore, in the business scenario where commercial bank financial accounting systems batch process monthly corporate account transaction summaries to provide data support for automatically generating accounting rule templates, the similarity matrix (SM) calculated using the Jaro-Winkler Distance algorithm is first loaded. Based on all similarity association pairs (SAP) confirmed by a preset threshold in the similarity matrix, association pairs are collected and archived one by one, with each transaction summary text as an independent dimension. All qualifying association pairs corresponding to each text are organized and summarized in global index order to obtain a list of similar association pairs corresponding to each text. Subsequently, the similarity association pair lists of all transaction summary texts are traversed one by one, and invalid entries that have been marked as clustered are filtered out. The total number of remaining valid association pairs in each list is accurately counted, and this total number is directly determined as the similarity association cumulative score (SACS) of the corresponding transaction summary text. Next, a globally unique index identifier for each stream summary text is established, binding it one-to-one with its corresponding cumulative similarity score. This completes the mapping and input of score information for all texts, generating an initial score set (ISS). Finally, a full validation is performed on the initial score set according to the preset set integrity rule (SIR), supplementing any missing text scores, removing redundant entries with duplicate mappings, and correcting all statistical biases. This yields a standardized score mapping set (SMS) with complete data and unique mappings, providing a stable and reliable data basis for the subsequent accurate selection of the global optimal cluster centroid.

[0090] Fifth Embodiment This embodiment solves the problems of repeated clustering and member redundancy by extracting centroid similarity sequences, filtering candidate members by threshold and embedding centroids, and generating clusters by deduplication verification and state labeling, thus ensuring the accuracy and consistency of iterative clustering.

[0091] This embodiment provides an exemplary scheme for generating a stream summary cluster set. In this example, the similarity of all unclustered texts in the line corresponding to the cluster centroid is first extracted to generate a centroid similarity comparison sequence. Then, the similarity values ​​in the sequence are compared with a preset similarity threshold one by one to obtain a cluster candidate member set. Subsequently, the cluster centroid is embedded into the candidate set and used as the reference text within the cluster to obtain the initial cluster set. Finally, after member deduplication verification and clustering status labeling, the cluster set of the current round is output. Step S30 includes steps D11~D14: Step D11: Extract the similarity of all unclustered texts in the row corresponding to the centroid of the cluster, and generate a centroid similarity comparison sequence.

[0092] Step D12: Compare the similarity values ​​in the centroid similarity comparison sequence one by one with the preset similarity threshold to determine the text whose similarity values ​​meet the preset similarity threshold, and obtain a cluster candidate member set.

[0093] Step D13: Embed the cluster centroid of the current round into the cluster candidate member set, and use the cluster centroid as the intra-cluster reference text to obtain the initial cluster set.

[0094] Step D14: Perform member deduplication verification and clustering status marking on the initial cluster set, output the cluster set of the current round, and mark all members of the cluster set as clustered.

[0095] The centroid similarity comparison sequence is a numerical sequence formed by extracting the similarity values ​​of all non-clustered texts and arranging them in order, based on the rows corresponding to the centroids of the clusters. It is the core comparison basis for selecting cluster members. Examples include: a list of non-clustered text similarities for the rows corresponding to the centroids, a similarity value sequence sorted by the global index, and a set of similarities for members to be determined. The cluster candidate member set is a set of members to be confirmed, composed of all non-clustered texts whose similarity meets a preset similarity threshold. It is a core component of the initial cluster set. Examples include: a set of qualified non-clustered texts, a list of candidate texts to be included in the cluster, and a set of initially screened cluster members. The initial cluster set is a preliminary set of cluster members after embedding the cluster centroids. It has not yet undergone deduplication verification and status marking and is an intermediate product in the cluster set generation process. Examples include: an unverified cluster member set, a preliminarily aggregated clustered text group, and a temporary cluster set.

[0096] In this example, when extracting the similarity values ​​corresponding to cluster centroids to generate centroid similarity comparison sequences, a row-oriented serial extraction method can be used. This involves locating the row index of the cluster centroid in the similarity matrix, traversing each column of the corresponding position in that row, simultaneously verifying the clustering status of the corresponding text, filtering out the similarity values ​​corresponding to all non-clustered texts, and arranging them according to the global text index order to generate the centroid similarity comparison sequence. Alternatively, a batch extraction method using index filtering can be used. First, obtain the index set of all non-clustered texts. Then, based on the centroid row index, batch retrieve the similarity values ​​of the corresponding columns in the index set to directly generate centroid similarity comparison sequences matching the non-clustered range. This method completes the targeted extraction of similarity sequences, adapting to matrix data processing scenarios of different scales.

[0097] After constructing the centroid similarity comparison sequence, the cluster member selection and aggregation process is initiated. Each similarity value in the sequence is compared with a preset similarity threshold to determine the candidate cluster members. All texts meeting the threshold requirements are selected to obtain the candidate cluster member set. The current round's cluster centroid is then embedded into the candidate cluster member set and used as the baseline text within the cluster, resulting in the initial cluster set. Subsequently, member deduplication and clustering status labeling are performed on the initial cluster set, outputting the current round's cluster set and marking all members as clustered. This hierarchical selection and closed-loop status management improve the accuracy of cluster generation and the consistency of subsequent iterations, avoiding duplicate clustering and member redundancy.

[0098] For example, there are two methods for verifying the cluster set obtained from the initial cluster set. The first is a sequential deduplication and marking method, which verifies the global clustering status and duplicate entries within the set for each text in the order of the text index in the initial cluster set. If duplicate entries exist, the unique valid entry is retained and redundant records are removed. If a text is not marked with a clustering status, it is synchronously updated to a clustered status. After each text is verified and marked, the set member list is synchronously updated. After all members have been processed, the final cluster set for the current round is output. This method uses a sequential verification and synchronous status update processing logic, ensuring no duplicate members and complete status marking through item-by-item checks. The verification process is highly controllable and suitable for high-precision verification scenarios of small to medium-sized clusters.

[0099] The second method is batch parallel verification and marking. The initial cluster set is divided into multiple verification subgroups based on text index ranges. There is no overlap or data dependency between subgroups. Multiple verification tasks are started simultaneously to perform member deduplication verification and state pre-marking, completing the removal of duplicate entries and state marking within each subgroup. After all subgroups have been processed in parallel, global duplicate verification and state consistency confirmation are performed across subgroups. After summarizing and correcting, the official cluster set for the current round is obtained, and the global clustering state of all members is updated simultaneously in batches. This method uses the logic of group task splitting and parallel processing of all subgroups. By splitting the verification tasks through pre-defined index range division, the overall time for cluster generation is shortened. At the same time, global verification ensures member uniqueness and state consistency, making it suitable for efficient generation scenarios of large-scale clusters.

[0100] Furthermore, in the business scenario where the enterprise financial intelligent accounting system performs automated clustering and grouping of all bank transaction records for the current month as a pre-processing step for the subsequent batch generation of standardized accounting templates, the system first locates the corresponding row index of the selected cluster centroid (CC) in the transaction record similarity matrix (SM). It then extracts the similarity values ​​of all texts in that row that are not clustered, and generates a centroid similarity comparison sequence (CSCS) by arranging them in order according to the global text index. Subsequently, each similarity value in the centroid similarity comparison sequence is compared with the system's preset cluster admission similarity threshold (PST). All unclustered transaction record texts whose similarity values ​​meet the threshold requirements are selected and aggregated into a cluster candidate member set (CCMS). Next, the cluster centroid of the current round is formally embedded into the cluster candidate member set, and the cluster centroid is set as the benchmark text within the cluster, serving as the reference core for subsequent text pattern extraction. After completing the initial collection of members, the initial cluster set (CIS) is obtained. Finally, the system performs full member deduplication verification on the initial cluster set, checking and removing duplicate text entries. After confirming that the members are unique and all are valid unclustered texts, the formal cluster set (CS) of the current round is output. At the same time, all pipeline summary texts within this cluster set are globally marked as clustered, avoiding repeated calculations and groupings in subsequent iterations, and ensuring the accuracy and consistency of deterministic clustering throughout the entire process.

[0101] Sixth Embodiment This embodiment uses the cluster centroid as the reference to iteratively solve the longest common subsequence, replaces variable segments with wildcards, solves the problem of sequence bias in a single alignment, and generates a stable text pattern with generalization ability.

[0102] This embodiment provides an exemplary scheme for generating a target text pattern for a streaming summary. In this example, the centroid of the cluster set is first used as the initial common subsequence benchmark to construct a queue of texts to be compared. Then, the longest common subsequence is calculated between the texts in the queue and the current common subsequence benchmark, and the common subsequence set is obtained. Finally, the common subsequence set and the cluster centroid are combined to filter variable segments, which are then uniformly replaced with standardized wildcards to obtain the target text pattern of the streaming summary text. Step S40 includes steps E11 to E13: Step E11: Use the cluster centroid of the cluster set as the benchmark for the initial common subsequence, and construct a text queue to be compared using the text of the cluster set.

[0103] Step E12: Based on the texts in the text queue to be compared, solve for the longest common subsequence with the benchmark of the common subsequence in turn, and sort them to obtain the set of common subsequences.

[0104] Step E13: Based on the common subsequence set and the cluster centroid, filter variable segments and uniformly replace them with standardized wildcards to obtain the target text pattern of the streaming summary text.

[0105] The initial common subsequence serves as the starting reference sequence for iteratively solving the common subsequence of the entire cluster. The first iteration directly uses the text content of the cluster centroid, which is the core reference basis for progressively converging the common subsequence. Examples include the original text sequence of the cluster centroid, the benchmark sequence for the first iteration, and the initial reference sequence of the common structure. The text queue to be compared consists of all member texts within the cluster set, excluding the centroid, arranged in a specified order. It is the set of processing objects for iteratively solving the longest common subsequence. Examples include the queue of member texts within the cluster, the comparison text sequence sorted by index, and the iterative solution text queue. The longest common subsequence is a sequence of identical characters that appear in the same character order in two texts, but do not need to be consecutive. It is used to characterize stable structural features shared between texts. Examples include character-level common sequences, ordered common strings, and text common structure sequences.

[0106] The common subsequence set is a set of common character sequences covering all text within a cluster, obtained after iterative solving of the entire text. It is the core basis for filtering variable fragments and generating text patterns. Examples include the full cluster common character sequence set, the converged common structure set, and the result set of iteratively solved common sequences. Variable fragments are character ranges in the centroid text of a cluster that are not covered by the common subsequences. They are non-common content that differs between different texts and belong to the differentiated parts that need to be replaced by wildcards. Examples include non-common character fragments, differentiated variable ranges, and text difference segments. Standardized wildcards are standardized identifiers used to uniformly replace all variable fragments. They have semantic generalization capabilities and can match any character content that meets the length requirements. Examples include general placeholder wildcards, variable fragment replacement characters, and generalized matching identifiers.

[0107] In this example, when constructing the text queue to be compared using the cluster centroid as the initial benchmark, it can be done sequentially in descending order of similarity. First, extract all member texts within the cluster set except for the centroid, calculate the similarity value between each text and the cluster centroid, and then sort them in descending order of similarity to form the text queue to be compared. This allows the common sequence to prioritize highly similar texts for rapid convergence. Alternatively, it can be constructed in ascending order of text length, sorting the member texts within the cluster set in ascending order of character length and adding them to the queue one by one to form the text queue to be compared. Prioritizing the comparison of shorter texts can gradually expand the structural boundary of the common sequence, thus completing the orderly construction of the text queue to be compared and adapting to processing scenarios with different convergence speed requirements.

[0108] After constructing the queue of texts to be compared, an iterative process for finding the longest common subsequence is initiated. Each text in the queue is sequentially retrieved and compared with the currently effective common subsequence benchmark to find the longest common subsequence. The resulting new common subsequence is then updated as the benchmark for the next round. This process is repeated until all texts in the queue have been compared, and the converged common sequences are compiled into a common subsequence set. Subsequently, based on this common subsequence set and the cluster centroid text, all non-common variable segments are located. All variable segments are uniformly replaced with standardized wildcards to obtain the target text pattern for the streaming summary text. This iterative sequence convergence and wildcard generalization replacement improves the generalization ability and structural stability of the text pattern, avoiding common sequence bias caused by a single comparison.

[0109] For example, there are two methods for obtaining the set of common subsequences through the text queue to be compared. The first is the successive iterative serial convergence method, which sequentially takes out a single text and performs the longest common subsequence calculation with the current common subsequence benchmark according to the order of the text queue to be compared. After each comparison is completed, the new common subsequence is updated as the effective benchmark for the next round, and the sequence convergence status during the iteration process is recorded simultaneously. After all texts in the queue have completed the iterative calculation, the finally converged common subsequences are organized into a common subsequence set. This method adopts the processing logic of sequential serial iteration and dynamic benchmark update. By gradually tightening the range of common sequences, it ensures that the final result covers all clustered texts. The iteration process is clear and controllable, and it is suitable for cluster processing scenarios with a moderate number of texts and small differences in pattern structure. The results are stable and reliable.

[0110] The second method is the grouped intersection parallel convergence method. The queue of texts to be compared is divided into multiple comparison groups of a fixed size. Within each group, the longest common subsequence (LCS) of the texts within the group is solved independently, simultaneously obtaining multiple sets of local common subsequences. Then, the local common subsequences of all groups are used to perform a global intersection calculation with the cluster centroid benchmark to obtain the final common subsequence covering the entire cluster of texts, which is then organized into a common subsequence set. This method employs grouped parallel computation and global intersection convergence processing logic. By decomposing the queue into groups beforehand, the long iterative process is broken down into multiple parallel subtasks, shortening the overall solution time. Simultaneously, the global intersection ensures full cluster coverage of the common sequence, making it suitable for processing scenarios with a large number of texts within a cluster and the need for efficient pattern extraction.

[0111] Further, please refer to Figure 4 , Figure 4 This is a flowchart of the abstract text processing for this application. After receiving input terms, the system initiates the entire process of extracting the abstract text pattern. First, it calculates the pairwise similarity between all input term strings and stores the corresponding similarity values ​​in an ordered similarity matrix (SM), thus completing the construction of the similarity matrix. Then, it iterates through each text element in the similarity matrix, comparing its similarity coefficient with the other elements in the matrix. Relationships with similarity coefficients exceeding a preset similarity threshold are accumulated and added to the score of the corresponding text element. The global optimal cluster centroid (CC) is located by sorting the global scores; this is the text element with the highest accumulated score. Next, all elements in the similarity matrix that meet the similarity threshold with the cluster centroid are selected, generating a cluster with that centroid as its core. Simultaneously, all elements in this cluster are removed from the similarity matrix and no longer participate in subsequent rounds of clustering calculations. The steps of score calculation, centroid selection, and cluster generation are repeated until all input terms are assigned to their corresponding cluster groups. Finally, for each cluster, the longest common subsequence (LCS) is calculated sequentially with all elements in the cluster, using the cluster centroid as the reference. The obtained LCS is then compared with the centroid text bit by bit. Variable segments not included in the common subsequence are uniformly replaced using wildcards to construct a standardized text pattern with generalization capabilities, thus completing the text pattern generation for all input terms.

[0112] For example, in step one, obtain a batch of bank transaction summaries for the enterprise as the input string set. Use the Yarovickler algorithm to calculate the pairwise similarity between any two input strings in the set, and store all pairwise similarity coefficients in a similarity matrix. In step two, iterate through each element denoted as p within the similarity matrix, comparing the similarity coefficient of element p with all other elements in the matrix one by one. If the similarity coefficient exceeds a pre-set similarity threshold h, the two strings are considered similar, and the effective matching value is added to the matching score s corresponding to element p, completing the score statistics for all elements in the matrix. In step three, retrieve the matching scores s corresponding to all elements, selecting the element p with the highest score as the centroid for this round. Iterate through the similarity matrix to retrieve all elements with a similarity coefficient greater than the threshold h with this centroid. Integrate this centroid with all matching elements to generate an independent cluster centered on element p. Then, delete all element data from the similarity matrix; this batch of elements will no longer participate in subsequent rounds of clustering operations. Step four: Continuously repeat the complete operations of steps two and three. In each round, based on the similarity matrix of the remaining unclassified elements, recalculate the scores, generate a cluster, and remove the corresponding elements. Repeat this process until there are no remaining elements in the similarity matrix, and all input strings are assigned to their corresponding clusters. After completing all clustering, the similarity coefficients of the centroid and all elements within each cluster are higher than the similarity threshold h. For each cluster, calculate the longest common subsequence between each element and the centroid of that cluster. Replace any differential text fragments in each element that do not belong to this longest common subsequence with wildcards, ultimately generating a standardized text pattern with generalized matching capabilities.

[0113] Seventh Embodiment This embodiment solves the problems of wildcard fragmentation and pattern boundary ambiguity by performing full cluster matching verification after aligning variable fragments with common subsequences, replacing wildcards, and regularizing the structure, and outputs a concise and highly adaptable target text pattern.

[0114] This embodiment provides an exemplary scheme for generating the target text pattern of a pipelined summary. In this example, the common subsequences in the common subsequence set are first matched character-by-character with the centroid text. The uncovered character intervals in the centroid text are marked to obtain variable fragment positions. Then, the character fragments at the corresponding positions are uniformly replaced with standardized wildcards to generate an initial text pattern. Subsequently, continuous wildcard matching is performed on the initial pattern, and redundant wildcards at the beginning and end are removed to obtain a text regularization pattern. Finally, after full coverage is confirmed by intra-cluster full text generalization matching, the target text pattern of the pipelined summary is obtained. Please refer to... Figure 5 , Figure 5 This is a flowchart illustrating the seventh embodiment of the method for processing the abstract text of this application. Step E13 includes steps F11 to F14: Step F11: Align and match the common subsequences in the common subsequence set with the centroid text character by character, and mark the character ranges in the centroid text that are not covered by the common subsequences to obtain the variable segment positions.

[0115] Step F12: Replace the character segments at the corresponding variable segment positions in the centroid text with the standardized wildcards to generate the initial text pattern.

[0116] Step F13: Based on the initial text pattern, merge multiple consecutive adjacent wildcards into a single standardized wildcard, and remove redundant wildcard fragments at the beginning and end of the pattern to obtain the text regularization pattern.

[0117] Step F14: Perform a generalized matching verification between the text normalization pattern and the text in the cluster set. After confirming that all texts are matched and covered, the target text pattern of the pipeline summary text is obtained.

[0118] Variable fragment positions are the location markers of character intervals in the centroid text that are not covered by common subsequences. They include the start and end indices of the intervals and serve as the precise location basis for wildcard replacement. Examples include the start and end indices of non-common character intervals, variable fragment boundary markers, and coordinates of differing character intervals. The initial text pattern is the preliminary text pattern after variable fragment replacement but before normalization. It contains fragmented consecutive wildcards and redundant wildcards at the beginning and end, and is an intermediate product of pattern normalization. Examples include the text template with initial wildcard replacements, the initial draft of an unnormalized generalized expression, and the temporary text pattern. The normalized text pattern is the standardized text pattern after merging consecutive wildcards and removing redundant wildcards at the beginning and end. It has a concise structure and clear boundaries and is the object to be verified during generalized matching checks. Examples include the normalized generalized text template, the pattern expression with clear boundaries, and the text pattern to be verified.

[0119] In this example, when performing alignment matching between the common subsequence and the centroid text to obtain the variable fragment position, it can be done by traversing the alignment line by line. Starting from the first character of the centroid text, it matches and locates each character in the common subsequence in character order, simultaneously marking the start and end indices of each unmatched character interval. After traversal, all intervals are summarized to obtain the variable fragment position. Alternatively, it can be done by segmented parallel alignment matching, using fixed semantic anchors in the common subsequence as boundaries to split the centroid text into multiple independent segments. Each segment performs subsequence alignment and variable interval marking in parallel, and finally concatenates the results of each segment to obtain the complete variable fragment position. This achieves accurate positioning of variable intervals and adapts to centroid text processing scenarios with different lengths and structures.

[0120] After marking the variable fragment positions, a wildcard replacement and pattern regularization verification process is initiated. Character fragments corresponding to the variable fragment positions in the centroid text are uniformly replaced with standardized wildcards to generate an initial text pattern. Then, based on the initial text pattern, multiple consecutive adjacent wildcards are merged into a single standardized wildcard, while redundant wildcard fragments at the beginning and end of the pattern are removed, resulting in a structurally regularized text regularization pattern. Next, a generalized matching verification is performed between the regularized text pattern and all text within the cluster set. After confirming that all text can be completely matched and covered by the pattern, the target text pattern of the pipeline summary text is obtained. In this way, through layered replacement regularization and full verification, the simplicity and generalization adaptability of the text pattern are improved, avoiding matching redundancy and pattern boundary ambiguity caused by fragmented wildcards.

[0121] For example, there are two methods for verifying the target text pattern obtained through text warping. The first is a line-by-line serial matching verification method. Following the index order of the texts within the cluster set, the text warping pattern is used sequentially to perform generalized matching on each individual text. After each text is matched, the matching result and details of any unmatched texts are recorded simultaneously. Once all texts in the cluster have been verified, if all texts are completely matched and covered, the text warping pattern is determined as the target text pattern. If there are texts that fail to match, the process reverts to iterative optimization in the common subsequence solution stage and re-verifies. This method employs a line-by-line serial matching and closed-loop iteration processing logic. By verifying each text line individually, it accurately locates matching deviations, ensuring strong controllability in the verification process. It is suitable for cluster processing scenarios with a small number of members and high pattern accuracy requirements, and the results are rigorous and reliable.

[0122] The second method is a grouped parallel batch verification method. This method divides the text within a cluster into multiple verification subgroups based on index ranges. There is no overlap or data dependency between subgroups. Multiple verification tasks are simultaneously launched to perform generalized matching verification of the text regularization pattern. The matching coverage and unmatched samples within each subgroup are statistically analyzed. After all subgroups have completed parallel verification, the global matching results are summarized. If the overall cluster text matching coverage reaches 100%, the text regularization pattern is determined as the target text pattern. If unmatched samples exist, the deviation information is summarized, and a rollback optimization is performed. This method employs a processing logic of grouped task splitting and full subgroup parallel verification. By splitting the large-scale verification task into independent subtasks through pre-grouping, the overall time consumption of full-scale matching verification is shortened. Simultaneously, the global result summary ensures the integrity of the verification, making it suitable for cluster processing scenarios with a large number of members and the need for efficient pattern verification.

[0123] Furthermore, in the business scenario where the enterprise financial intelligent accounting system extracts standardized text patterns of bank transaction summaries in batches to provide generalized templates for subsequent automatic accounting rule configuration, the system first extracts the longest common subsequence (LCS) from the set of common subsequences obtained through full cluster iteration convergence. It then performs precise character-by-character alignment matching with the text of the current cluster centroid (CC). The system marks the start and end indices of all character intervals in the centroid text not covered by the common subsequence, obtaining the variable fragment position (VFP). Subsequently, based on the marked variable fragment positions, it uniformly replaces the differentiated character fragments in the corresponding intervals of the centroid text with preset standardized wildcard characters (SWC). After replacing all variable intervals, it generates a text initial mode (TIM) containing scattered wildcard characters. Next, the system performs structural regularization on the initial text pattern, scanning and identifying all consecutive adjacent wildcards and merging them into a single standardized wildcard. Simultaneously, it removes redundant and invalid wildcard fragments at the beginning and end of the pattern, eliminates fragmented placeholders and redundant boundary content, resulting in a concise and clearly defined Text Regularized Mode (TRM). Finally, the system performs a full generalization matching verification between the Text Regularized Mode and all pipeline summary texts within the corresponding cluster set (CS). It confirms that each text within a cluster can be completely matched and covered by the pattern. After all verifications pass, the system officially obtains the Target Text Mode (TTM), which can generalize and match similar pipeline summaries, providing concise, patterned input data for subsequent semantic classification using a larger model.

[0124] Eighth embodiment This embodiment enhances the integration of financial knowledge base and classification rules through retrieval, embeds thought chain constraints to guide large-scale model reasoning, and verifies and standardizes the output results, thus solving the problems of large-scale model classification fluctuations and knowledge biases, and improving classification accuracy and consistency.

[0125] This embodiment provides an exemplary scheme for semantic classification of stream summary text. In this example, a classification reasoning framework is first constructed based on the target text pattern, retrieving the enterprise financial knowledge base and preset classification rule templates using a retrieval enhancement mechanism. Then, typical business classification sample examples are embedded within the classification reasoning framework. Classification reasoning prompts are generated by combining the thinking chain constraint logic set according to the cumulative score of similar associations. Subsequently, the target text pattern and classification reasoning prompts are input into a large language model, guiding the model to gradually reason and divide income and expenditure categories according to the semantics of the pattern subject and output an initial classification result set. Finally, after classification consistency verification and format regularization to correct abnormal entries, the classification result of the stream summary text is obtained. Please refer to... Figure 6 , Figure 6 This is a flowchart illustrating the eighth embodiment of the method for processing the abstract text of this application. Following step S40, steps G11-G14 are also included: Step G11: Based on the target text pattern, retrieve the enterprise financial knowledge base and preset classification rule template according to the retrieval enhancement mechanism, and construct a classification reasoning framework.

[0126] Step G12: Embed typical business classification sample examples within the classification reasoning framework, and combine them with the thinking chain constraint logic set according to the cumulative score of similar associations to generate classification reasoning prompts.

[0127] Step G13: Input the target text pattern and the classification reasoning prompt into the large language model, guide the model to optimize the step-by-step reasoning and division of income and expenditure categories according to the semantics of the pattern subject, and output the initial classification result set.

[0128] Step G14: Perform classification consistency verification and format normalization on the initial classification result set, correct abnormal entries that deviate from the classification rules, and obtain the classification result of the stream summary text.

[0129] Retrieval enhancement mechanisms are used to accurately retrieve relevant business knowledge and rules from external knowledge bases, assisting large language models in improving classification accuracy. They serve as a core bridge connecting external knowledge and model reasoning. Examples include vector knowledge base retrieval mechanisms, semantic similarity retrieval mechanisms, and rule template matching retrieval mechanisms. Enterprise financial knowledge bases are structured knowledge sets storing enterprise financial revenue and expenditure classification standards, business scenario interpretations, and subject correspondence rules. They are the core knowledge basis for semantic classification. Examples include revenue and expenditure subject knowledge bases, business scenario interpretation bases, financial accounting rule bases, and industry classification standard bases. Pre-defined classification rule templates are standardized templates with pre-configured financial revenue and expenditure classification levels, judgment logic, and output formats. They are the core framework for standardizing classification reasoning paths. Examples include revenue and expenditure category division rule templates, subject level mapping templates, and classification output format templates. Classification reasoning frameworks are structured reasoning carriers that integrate external knowledge, classification rules, and reasoning constraints. They are the basic architecture for generating prompts and instructions. Examples include knowledge-enhanced reasoning frameworks, rule-constrained reasoning frameworks, and classification task reasoning frameworks.

[0130] The thought chain constraint logic sets hierarchical inference weights based on the cumulative score of similar associations, guiding the large language model to gradually derive classification results according to a specified inference path. Its core requirement is to prioritize anchoring core categories based on high-scoring common semantic fragments, ensuring the consistency of classification logic. Examples include subject-priority determination logic, step-by-step inference constraint rules, and inference path verification logic. Typical business classification sample examples are pre-labeled typical flow summary pattern samples of classification results, used to demonstrate classification standards and output formats to the large language model, providing few-sample support to improve output stability. Examples include income and expenditure classification labeling samples, subject mapping example samples, and abnormal scenario classification examples. Classification inference prompts are standardized instructions generated after integrating the inference framework, constraint logic, and sample examples, used to drive the large language model to perform classification tasks, serving as direct input for the model. Examples include classification task prompt words, inference guidance instructions, and few-sample classification prompts.

[0131] Large language models are large-scale pre-trained language models with natural language understanding and semantic reasoning capabilities, serving as the core reasoning entity for performing pipelined summary semantic classification. Examples include general-purpose large language models, fine-tuned large models for the financial domain, and large models specifically for text classification. The initial classification result set is the preliminary classification result set output by the large language model based on prompts, containing the income and expenditure category determination results corresponding to each target text pattern. This set is the object of subsequent verification and standardization. Examples include the preliminary classification result set, the model's original output classification set, and the unverified classification result set. Classification consistency verification is a compliance check performed on the initial classification results, used to identify abnormal classification entries that deviate from classification rules or have logical contradictions. It is a core verification step to ensure the uniformity and standardization of classification results. Examples include rule compliance verification, classification logic consistency verification, and uniformity verification of classification within the same pattern. Format standardization is a standardized format correction performed on the classification results, unifying output fields, hierarchical structures, and naming conventions. It is a standardization step to ensure the usability of the classification results. Examples include field standardization, hierarchical structure standardization, and unified naming formats.

[0132] In this example, when retrieving the knowledge base and rule templates to build the classification reasoning framework, a full pre-loading approach can be used. This involves pre-loading the enterprise financial knowledge base and preset classification rule templates, performing knowledge retrieval and rule matching based on the semantic features of the target text pattern, and integrating the retrieved knowledge and matched rule templates into the reasoning structure to complete the construction of the classification reasoning framework. Alternatively, a dynamic incremental construction approach can be used. First, a basic classification reasoning framework is built. Then, based on the semantic type of the target text pattern, corresponding financial knowledge items and classification rule subsets are dynamically retrieved and matched, incrementally populated into the corresponding modules of the framework. This completes the construction of a classification reasoning framework adapted to the current pattern set, thus adapting to the classification reasoning needs of pattern sets of different sizes.

[0133] After constructing the classification reasoning framework, the prompt instruction generation and model reasoning process are initiated. Typical business classification sample examples are embedded within the framework, and standardized classification reasoning prompt instructions are generated by combining the thought chain constraint logic set based on the cumulative score of similar associations. Subsequently, the target text pattern and the classification reasoning prompt instructions are simultaneously input into the large language model, guiding the model to perform step-by-step reasoning and division of income and expenditure categories according to the semantics of the pattern subject, outputting an initial classification result set. Next, classification consistency verification and format regularization are performed on the initial classification result set, correcting abnormal entries that deviate from the classification rules, resulting in the classification result of the stream summary text. This dual guarantee of knowledge enhancement and score-adaptive reasoning constraints improves the accuracy and consistency of the large language model's classification, avoiding fluctuations and knowledge biases in pure large model reasoning results.

[0134] For example, there are two methods for obtaining the final classification result from the initial classification result set. The first is a sequential verification and normalization method. Following the index order of the target text pattern, the conformity of each classification result with the classification rule template is checked sequentially. This verifies whether the classification logic follows the thought chain constraint set based on the cumulative score of similar associations, and whether the classification result conforms to the subject definition of the financial knowledge base. After each result is verified, if a deviation is found, the corresponding classification entry is corrected, and format standardization is performed simultaneously. After all results have been verified and normalized, the final classification result of the stream summary text is obtained. This method uses a sequential verification and correction logic, ensuring the accuracy of each classification result through meticulous item-by-item checks. The verification and correction process is highly controllable, adaptable to processing scenarios with a small number of patterns and high classification accuracy requirements, and the results are rigorous and reliable.

[0135] The second method is the grouped parallel batch verification method. The initial classification result set is divided into multiple verification subgroups according to the business domain to which the pattern belongs. There are no classification rule conflicts or data dependencies between subgroups. Multiple verification tasks are started simultaneously to perform classification consistency verification and format pre-regulation, correcting abnormal entries and standardizing formats within each subgroup. After all subgroups have been processed in parallel, a global classification consistency verification and overall format unification are performed across subgroups. The final pipeline summary text classification result is obtained after summarizing and correcting the results. This method uses the logic of grouped task splitting and parallel processing of all subgroups. By splitting the verification tasks into business domain groups beforehand, the time spent on verification and regulation of the entire classification result is shortened. At the same time, global verification ensures the uniformity of the overall classification standard, adapting to business scenarios with a large number of patterns and the need for efficient classification processing.

[0136] Furthermore, in the business scenario of batch processing bank income and expenditure transaction summaries and automatically matching accounting subjects in the enterprise financial intelligent accounting system, the system first retrieves the enterprise financial knowledge base and preset classification rule templates based on the extracted target text pattern, following the retrieval enhancement generation mechanism, and integrates knowledge items and rule structures to build a classification reasoning framework. Then, typical business classification sample examples are embedded within the classification reasoning framework. Simultaneously, a hierarchical reasoning weight constraint logic is set based on the cumulative similarity scores obtained from previous steps, clarifying the reasoning priority of high-scoring common semantic fragments as the primary basis for classification and low-scoring variable fragments as supplementary basis, generating standardized classification reasoning prompts. Next, the target text pattern and classification reasoning prompts are simultaneously input into the large language model, guiding the model to perform step-by-step reasoning and classification of income and expenditure categories according to the semantics of the pattern subject, outputting an initial classification result set containing the classification conclusions corresponding to each pattern. Finally, the system performs a full classification consistency check and format standardization on the initial classification result set, checks and corrects abnormal entries that deviate from the classification rules one by one, and unifies the naming conventions of output fields and accounts to obtain accurate and standardized transaction summary text classification results, providing reliable classification data support for subsequent financial accounting processes such as automatic bookkeeping and voucher generation.

[0137] This application provides a text summarization processing apparatus, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the text summarization processing method in Embodiment 1 above.

[0138] The following is for reference. Figure 7 The diagram illustrates a structural schematic of a text processing device suitable for implementing the embodiments of this application. The text processing device in the embodiments of this application may include, but is not limited to, mobile terminals such as general-purpose computing servers, industrial-grade intelligent edge computing gateways, and industry-specific intelligent terminals, as well as fixed terminals such as intelligent document scanners, intelligent voice-to-text all-in-one machines, and industrial tablets. Figure 7 The illustrated device for processing summary text is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0139] like Figure 7As shown, the text summarization processing device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The random access memory 1004 also stores various programs and data required for the operation of the text summarization processing device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the text processing device to communicate wirelessly or wiredly with other devices to exchange data. Although text processing devices with various systems are shown in the figures, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems may be implemented alternatively.

[0140] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0141] The text processing device provided in this application, employing the text processing method described in the above embodiments, can solve the technical problem of poor text summarization processing results. Compared with the prior art, the beneficial effects of the text processing device provided in this application are the same as those of the text processing method described in the above embodiments, and other technical features of the text processing device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0142] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0143] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0144] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the summary text processing method in the above embodiments.

[0145] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.

[0146] The aforementioned computer-readable storage medium may be included in a text processing device for abstracting text; or it may exist independently and not be assembled into a text processing device for abstracting text.

[0147] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by a text summarization processing device, the text summarization processing device performs the following actions: Based on the stream summary text to be processed, it calculates the similarity between any two texts in the stream summary text, constructing a similarity matrix for the stream summary text; determines the cluster centroid for the current round based on the cumulative similarity association score corresponding to each text in the similarity matrix; clusters texts whose similarity to the cluster centroid reaches a preset similarity threshold, generating a cluster set; and uses the cluster centroid of each cluster set as a benchmark, sequentially calculates the longest common subsequence with all texts within the cluster set, and filters out the target text pattern of the stream summary text.

[0148] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0149] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation that may be implemented in 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 the 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 the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, 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.

[0150] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0151] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described text summarization processing method, thereby solving the technical problem of poor text summarization processing results. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the text summarization processing method provided in the above embodiments, and will not be repeated here.

[0152] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for processing summary text, characterized in that, The method includes: Based on the stream summary text to be processed, the similarity between any two texts in the stream summary text is calculated one by one, and the similarity matrix of the stream summary text is constructed. Based on the cumulative similarity association score corresponding to each text in the similarity matrix, the cluster centroid of the current round is determined; Based on texts whose similarity to the centroid of the cluster reaches a preset similarity threshold, cluster sets are generated. Using the centroid of each cluster set as a reference, the longest common subsequence is obtained by sequentially comparing it with all texts in the cluster set, and the target text pattern of the streaming summary text is obtained by filtering.

2. The method for processing abstract text as described in claim 1, characterized in that, The step of calculating the similarity between any two texts in the stream summary text based on the stream summary text to be processed, and constructing the similarity matrix of the stream summary text includes: The text features of the stream summary text are processed according to a unified character format, and invalid and redundant characters are removed to obtain the set of texts to be calculated; For any two different text pairs in the text set to be calculated, calculate the similarity of the text pairs; Using the text of each text pair as row and column indices, and the similarity as matrix elements, an initial matrix is ​​constructed. The initial matrix is ​​subjected to symmetry verification and numerical boundary correction. After correcting the calculation deviation and outliers, the similarity matrix of the pipeline summary text is obtained.

3. The method for processing abstract text as described in claim 1, characterized in that, The step of determining the cluster centroid of the current round based on the cumulative similarity association score corresponding to each text in the similarity matrix includes: The similarity score corresponding to each text in the similarity matrix is ​​compared with the association similarity threshold one by one to determine all similar association pairs that reach the association similarity threshold; Based on the number of similar association pairs corresponding to each text, the cumulative score of the similar associations corresponding to the text is accumulated, and a score mapping set is obtained by mapping. Based on the cumulative similarity association scores of all texts in the score mapping set, determine the target text with the highest cumulative similarity association score; The target text is identified as the centroid of the current round, and the text content and index information of the centroid are associated with it.

4. The method for processing abstract text as described in claim 3, characterized in that, The step of accumulating the cumulative score of similar associations corresponding to each text based on the number of similar association pairs, and mapping the score mapping set to the cumulative score associations corresponding to the text includes: Based on the similarity pairs in the similarity matrix, each of the single stream summary texts is collected one by one to obtain a list of similarity pairs corresponding to each text. The total number of valid association pairs in the list of similar association pairs is counted one by one, and the total number of valid association pairs is determined as the cumulative score of the similar association of the corresponding text. Construct the identifiers of the stream summary text and their corresponding association relationships with the cumulative scores of similar associations, and map them to obtain an initial score set; The initial score set is verified according to the set integrity rules, and missing text and duplicate mapping entries are corrected to obtain the score mapping set.

5. The method for processing abstract text as described in claim 1, characterized in that, The step of generating a cluster set by clustering texts whose similarity to the cluster centroid reaches a preset similarity threshold includes: Extract the similarity of all unclustered text within the line corresponding to the centroid of the cluster, and generate a centroid similarity comparison sequence; The similarity values ​​in the centroid similarity comparison sequence are compared one by one with the preset similarity threshold to determine the text whose similarity values ​​meet the preset similarity threshold, thereby obtaining a cluster candidate member set; Embed the cluster centroid of the current round into the cluster candidate member set, and use the cluster centroid as the intra-cluster reference text to obtain the initial cluster set; Perform member deduplication verification and clustering status marking on the initial cluster set, output the cluster set of the current round, and mark all members of the cluster set as clustered.

6. The method for processing abstract text as described in claim 1, characterized in that, The step of using the centroid of each cluster set as a reference, sequentially finding the longest common subsequence with all texts within the cluster set, and filtering to obtain the target text pattern of the streaming summary text includes: The centroid of the cluster set is used as the benchmark for the initial common subsequence, and a text queue to be compared is constructed using the text of the cluster set. Based on the texts in the text queue to be compared, the longest common subsequence is solved sequentially with the benchmark of the common subsequence, and the common subsequence set is obtained by sorting. Based on the set of common subsequences and the cluster centroid, variable segments are filtered and uniformly replaced with standardized wildcards to obtain the target text pattern of the streaming summary text.

7. The method for processing abstract text as described in claim 6, characterized in that, The step of filtering variable segments and uniformly replacing them with standardized wildcards based on the common subsequence set and the cluster centroid to obtain the target text pattern of the streaming summary text includes: The common subsequences in the set of common subsequences are aligned and matched with the centroid text character by character, and the character intervals in the centroid text that are not covered by the common subsequences are marked to obtain the variable segment positions; The character segments at the corresponding variable segment positions in the centroid text are uniformly replaced with the standardized wildcards to generate the initial text pattern; Based on the initial text pattern, multiple consecutive adjacent wildcards are merged into a single standardized wildcard, and redundant wildcard fragments at the beginning and end of the pattern are removed to obtain the text regularization pattern. The text normalization pattern is generalized and matched with the text in the cluster set. After confirming that all texts are matched and covered, the target text pattern of the pipeline summary text is obtained.

8. The method for processing abstract text as described in claim 1, characterized in that, After the step of using the cluster centroid of each cluster set as a reference and sequentially calculating the longest common subsequence with all texts within the cluster set to filter out the target text pattern of the streaming summary text, the method for processing the summary text further includes: Based on the target text pattern, the enterprise financial knowledge base and preset classification rule templates are retrieved according to the retrieval enhancement mechanism to construct a classification reasoning framework; Typical business classification sample examples are embedded within the classification reasoning framework, and classification reasoning prompts are generated by combining the thinking chain constraint logic set according to the cumulative score of similar associations. The target text pattern and the classification reasoning prompt are input into the large language model to guide the model to optimize the step-by-step reasoning and division of income and expenditure categories according to the semantics of the pattern subject, and output the initial classification result set. After performing classification consistency verification and format normalization on the initial classification result set and correcting abnormal entries that deviate from the classification rules, the classification result of the stream summary text is obtained.

9. A device for processing summary text, characterized in that, The device for processing the abstract text includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the method for processing the abstract text as described in any one of claims 1 to 8.

10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the method for processing the summary text as described in any one of claims 1 to 8.