Method for generating text summary, text processing method, device, equipment, medium and program product

By generating text summaries through cluster analysis and representative sentence selection, the problem of low efficiency in long text processing is solved, and efficient and accurate text summarization is achieved.

CN121278091BActive Publication Date: 2026-05-08SHENZHEN ZHICHENG SOFTWARE TECH SERVICE CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN ZHICHENG SOFTWARE TECH SERVICE CO LTD
Filing Date
2025-12-05
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Manual processing of long texts is time-consuming and labor-intensive, and key information may be missed or misread due to subjective factors. Furthermore, the lack of effective text summarization technology results in high computational resource consumption and low processing efficiency.

Method used

By clustering analysis of sentences in the text, the positional weights and semantic distances of sentence clusters are determined, representative sentences are selected, and combined in the original text order to generate a text summary.

Benefits of technology

The generated summary is concise while retaining the original logical order and information coherence of the text, accurately summarizing the core content of the text, and meeting the need to quickly grasp the main idea of ​​the text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121278091B_ABST
    Figure CN121278091B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a method for generating a text summary, a text processing method, an apparatus, a device, a medium and a program product. The method for generating a text summary comprises: obtaining a to-be-processed text; performing cluster analysis on all sentences in the to-be-processed text to obtain at least one sentence cluster; determining a first parameter set and a second parameter set of each sentence cluster in the at least one sentence cluster, the first parameter set of a target sentence cluster being a set composed of position weights of each sentence in the target sentence cluster, and the second parameter set of the target sentence cluster being a set composed of semantic distances between each sentence in the target sentence cluster and a cluster centroid of the target sentence cluster; determining a representative sentence of each sentence cluster in the at least one sentence cluster according to the first parameter set and the second parameter set of each sentence cluster; and combining the representative sentences corresponding to the at least one sentence cluster to obtain a summary of the to-be-processed text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more specifically to a method for generating text summaries, a text processing method, an apparatus, a device, a medium, and a program product. Background Technology

[0002] With the widespread application of natural language processing (NLP) technology in government departments, the legal field, enterprise management, finance, healthcare, and education, efficient processing of long texts (such as policy documents, legal documents, industry reports, medical literature, and academic papers) has become a core requirement for various industries. For example, government departments need to quickly extract core content from lengthy policy documents to aid policy interpretation and public affairs management; legal professionals need to extract key information from massive amounts of legal documents to improve judicial efficiency; and medical institutions need to extract core content from lengthy medical literature and medical records to accelerate drug development and disease research. However, manual processing of long texts is not only time-consuming and labor-intensive, but also prone to errors due to subjective factors, leading to the omission or misinterpretation of key information, and can hinder subsequent information applications (such as entity attribute extraction, data storage, and retrieval). On the other hand, without effective text summarization technology, directly processing long texts will result in high computational resource consumption and low processing efficiency. Therefore, there is an urgent need for a technology that automates text summarization. Summary of the Invention

[0003] The purpose of this application is to provide a method, text processing method, apparatus, device, medium, and program product for generating text summaries, which can automate the generation of text summaries to a certain extent.

[0004] A first aspect of this application provides a method for generating text summaries, the method comprising:

[0005] Get the text to be processed;

[0006] Cluster analysis is performed on all sentences in the text to be processed to obtain at least one sentence cluster;

[0007] Determine a first parameter set and a second parameter set for each sentence cluster in the at least one sentence cluster. The first parameter set of the target sentence cluster is a set composed of the position weights of each sentence in the target sentence cluster in the text to be processed. The second parameter set of the target sentence cluster is a set composed of the semantic distances between each sentence in the target sentence cluster and the cluster centroid of the target sentence cluster. The target sentence cluster is any sentence cluster in the at least one sentence cluster.

[0008] Based on the first parameter set and the second parameter set of each sentence cluster in the at least one sentence cluster, determine the representative sentence of each sentence cluster in the at least one sentence cluster;

[0009] According to the order of each representative sentence in the text to be processed, the representative sentences corresponding to the at least one sentence cluster are combined to obtain a summary of the text to be processed.

[0010] A second aspect of this application provides an information extraction method, the method comprising:

[0011] Obtain the target text to be processed and extract prompt words;

[0012] If the extraction prompt indicates that the deep information of the target text is extracted, then a summary of the target text is generated according to the method for generating text summaries described in the first aspect;

[0013] The summary of the target text and the extraction prompts are input into the information extraction model for information extraction, and the first target information output by the information extraction model is obtained.

[0014] The first target information is stored in a structured manner.

[0015] A third aspect of this application provides an apparatus for generating text summaries, the apparatus comprising:

[0016] The first acquisition module is used to acquire the text to be processed.

[0017] The first clustering module is used to perform cluster analysis on all sentences in the text to be processed, and obtain at least one sentence cluster.

[0018] The first determining module is used to determine the first parameter set and the second parameter set of each sentence cluster in the at least one sentence cluster. The first parameter set of the target sentence cluster is a set composed of the position weights of each sentence in the target sentence cluster in the text to be processed. The second parameter set of the target sentence cluster is a set composed of the semantic distances between each sentence in the target sentence cluster and the cluster centroid of the target sentence cluster. The target sentence cluster is any sentence cluster in the at least one sentence cluster.

[0019] The second determining module is used to determine the representative sentence of each sentence cluster in the at least one sentence cluster based on the first parameter set and the second parameter set of each sentence cluster in the at least one sentence cluster.

[0020] The first combination module is used to combine the representative sentences corresponding to the at least one sentence cluster according to the order of each representative sentence in the text to be processed, so as to obtain a summary of the text to be processed.

[0021] A fourth aspect of this application provides a text processing apparatus, the apparatus comprising:

[0022] The second acquisition module is used to acquire the target text to be processed and extract prompt words;

[0023] The first generation module is configured to generate a summary of the target text according to the method for generating a text summary as described in the first aspect if the extraction prompt word indicates that deep information of the target text is to be extracted.

[0024] The first extraction module is used to extract information from the summary of the target text and the extraction prompt words into the information extraction model to obtain the first target information output by the information extraction model.

[0025] The first storage module is used to structurally store the first target information.

[0026] A fifth aspect of this application provides an electronic device including a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the method for generating text summaries as described in the first aspect or the steps of the text processing method as described in the second aspect.

[0027] A sixth aspect of this application provides a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the method for generating a text summary as described in the first aspect or the steps of the text processing method as described in the second aspect.

[0028] A seventh aspect of this application provides a chip including a processor and a communication interface coupled to the processor. The processor is configured to run a program or instructions to implement the steps of the method for generating text summaries as described in the first aspect or the steps of the text processing method as described in the second aspect.

[0029] An eighth aspect of this application provides a computer program product stored in a storage medium, which is executed by at least one processor to implement the steps of the method for generating text summaries as described in the first aspect or the steps of the text processing method as described in the second aspect.

[0030] In this embodiment, the first step is to acquire the text to be processed, providing basic data for subsequent text analysis and processing. This is the initial step in generating a text summary; only after acquiring the text can subsequent operations be carried out. Next, cluster analysis can group sentences in the text according to rules such as semantic similarity, causing sentences with similar semantics to cluster together. For example, in a text discussing the characteristics of multiple products, clustering can group sentences describing the same product into one cluster. Then, the first parameter set and the second parameter set of each sentence cluster obtained from the clustering are determined. The first parameter set of the target sentence cluster consists of the positional weights of each sentence in the target sentence cluster within the text to be processed. Since the beginning and end of the text often contain important summaries or thematic information, assigning positional weights to sentences can highlight the role of sentences in these important positions. For example, in an academic paper, sentences in the abstract and conclusion sections have relatively high positional weights and are more likely to be selected as representative sentences. The second parameter set of the target sentence cluster consists of the semantic distance between each sentence in the target sentence cluster and the cluster centroid of the target sentence cluster. Semantic distance reflects how closely a sentence fits the core semantics of its cluster; a smaller distance indicates that the sentence is more representative of the cluster's semantics. Next, based on the first and second parameter sets of each sentence cluster, a representative sentence for each cluster is determined. By comprehensively considering positional weight and semantic distance, sentences that both conform to the core semantics of their cluster and hold an important position within the overall text can be selected as representative sentences. This avoids the bias caused by selecting representative sentences based on a single factor and improves the representativeness of the representative sentences for both the sentence cluster and the overall text. Finally, the representative sentences are combined in the original text order to preserve the original logical order and information coherence of the text to the greatest extent possible. This results in a concise summary that allows readers to quickly grasp the general argumentative structure of the text. This method of generating summaries contains key information from each part of the text, effectively summarizing the core content and meeting users' needs for quickly obtaining the main idea. Attached Figure Description

[0031] Figure 1 This is a flowchart illustrating the method for generating text summaries provided in an embodiment of this application;

[0032] Figure 2 This is a flowchart illustrating the text processing method provided in an embodiment of this application;

[0033] Figure 3 This is a schematic diagram of the structure of the apparatus for generating text summaries provided in the embodiments of this application;

[0034] Figure 4 This is a schematic diagram of the structure of the text processing device provided in the embodiments of this application;

[0035] Figure 5This is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of this application;

[0036] Figure 6 This is a schematic diagram of another hardware structure of an electronic device that implements an embodiment of this application. Detailed Implementation

[0037] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0038] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0039] The method, apparatus, device, storage medium, chip, and computer program product for generating text summaries provided in this application can effectively solve the above-mentioned technical problems. The method, apparatus, device, medium, and program product for generating text summaries provided in this application will be described in detail below with reference to the accompanying drawings and specific embodiments and application scenarios.

[0040] like Figure 1 As shown, Figure 1 This is a schematic flowchart illustrating the process of generating text summaries provided in an embodiment of this application. The method for generating text summaries can be applied to electronic devices, such as computers, smartphones, tablets, wearable smart devices, etc., or servers in distributed systems, cloud servers, intelligent cloud computing servers with artificial intelligence technology, or intelligent cloud hosts. It can also be applied to... Figure 3 The apparatus shown for generating text summaries Figure 5 or Figure 6 For details regarding the electronic devices shown, please refer to the relevant descriptions below. Figure 1 The method for generating text summaries or the text processing method includes the following steps S11 to S15:

[0041] S11, obtain the text to be processed.

[0042] The text to be processed is the starting data for generating text summaries, such as policy documents and academic papers.

[0043] In the field of text processing, obtaining the text to be processed is the foundation of all subsequent operations. Common text sources include web pages, document files (Word, PDF, etc.), database records, etc. The methods of obtaining the text vary depending on the source. For example, web crawling technology is often used to obtain text from web pages, while the corresponding file reading functions are required to obtain text from document files.

[0044] S12, perform cluster analysis on all sentences in the text to be processed to obtain at least one sentence cluster.

[0045] Cluster analysis is an unsupervised learning method that aims to group data objects into clusters of similar objects. In text processing, it calculates semantic similarity and other metrics between sentences to group semantically similar sentences into the same cluster. Common clustering algorithms include K-means and hierarchical clustering. Cluster analysis is used to group sentences in the text to be processed so that representative sentences can be selected from each cluster later.

[0046] S13, determine the first parameter set and the second parameter set of each sentence cluster in the at least one sentence cluster.

[0047] The first parameter set of the target sentence cluster is a set composed of the position weights of each sentence in the target sentence cluster in the text to be processed. The second parameter set of the target sentence cluster is a set composed of the semantic distances between each sentence in the target sentence cluster and the cluster centroid of the target sentence cluster. The target sentence cluster is any sentence cluster in the at least one sentence cluster.

[0048] The first parameter set reflects the positional weight of a sentence in the text to be processed, and the second parameter set reflects the semantic distance between a sentence and the centroid of its cluster. In subsequent step S14, the importance of each sentence in its cluster is comprehensively evaluated using these two parameter sets.

[0049] In some alternative implementations, the first parameter of a sentence in the text to be processed is determined by the following steps a to j (taking the target sentence as an example, the target sentence is any sentence in the text to be processed):

[0050] a) Obtain the total number of sentences in the text to be processed. .

[0051] b, Calculate the target index The third difference after subtracting the natural number 1 The target index It is the index of the target sentence.

[0052] The index of the first sentence at the beginning of the text to be processed is the natural number 1, and the absolute value of the difference between the indices of any two adjacent sentences in the text to be processed is the natural number 1. Furthermore, the index of the sentence located in the preceding text is always less than the index of the sentence located in the following text.

[0053] Third difference This is used to measure the positional offset of a sentence relative to the first sentence (index 1) in the text being processed. For example, in a city traffic article, a sentence with index 5, after subtracting 1, becomes 4, which can be used to calculate its positional weight later.

[0054] c, Calculate the total number of sentences. Subtract the index of the target sentence The fourth difference .

[0055] Fourth difference Used to measure the relative end of a sentence in the text to be processed (indexed as the last sentence). The position offset of the sentence. For example, if a city traffic article has a total of 20 sentences and a certain sentence has an index of 5, then 20-5=15, which reflects the distance of that sentence from the end of the text.

[0056] d, calculate the third difference. and the fourth difference minimum value .

[0057] In determining the sentence position weight, this third difference is taken. and the fourth difference The minimum value in the formula highlights how close a sentence is to the beginning or end of the text, as a smaller value better reflects the sentence's proximity to either end. For example, in the example above, the minimum value of 4 and 15 is 4.

[0058] f, calculate the total number of sentences The fifth difference after subtracting the natural number 1 .

[0059] Total number of sentences This operation is performed to calculate the total number of sentences. This is converted into a numerical value related to the sentence index range for subsequent proportion calculations. Fifth Difference This is used as the denominator in the subsequent calculation formula for location weights. For example, if the total number of sentences in an article about urban traffic is 20, then 20-1=19, which is used to prepare for subsequent calculations.

[0060] g, calculate the fifth difference The first quotient when divided by the natural number 2 .

[0061] In the formula for calculating position weights, a middle value is obtained by dividing the fifth difference by 2, which is then used as part of the denominator to make the calculated position weights more reasonable. For example, 19 ÷ 2 = 9.5 (rounded to one decimal place).

[0062] h, calculate the first quotient and the smallest positive number First sum .

[0063] Add very small positive numbers To prevent division by zero in subsequent division operations, a very small positive number (such as 1e-12) is added to the first quotient. The addition ensures that the denominator is not zero in subsequent calculations, thus enabling the entire position weight calculation to proceed smoothly.

[0064] i, calculate the minimum value Divided by the first sum Second quotient .

[0065] j, calculate the natural number 1 minus the second quotient. The sixth difference The first parameter of the target sentence is obtained. .

[0066] By subtracting 1 The result obtained is the sixth difference. This can be directly used as a parameter to measure the importance of a sentence's position; the larger the value, the more important the sentence is in its position. This sixth difference value It refers to the first parameter of the target sentence, namely the positional weight. .like This value can be used to determine the representative sentence in conjunction with other parameters.

[0067] That is, it contains In the text to be processed for each sentence, the index is... Position weight of the target sentence It can be calculated using the following formula:

[0068]

[0069] For example, taking the aforementioned article on urban traffic improvement measures as an example, assume the article has a total of 30 sentences. For one sentence, "Optimizing bus stop layout can improve travel efficiency," its index is 10. First, calculate the third difference: 10-1=9; the fourth difference: 30-10=20, taking the minimum value of 9. The fifth difference: 30-1=29; the first quotient: 29÷2=14.5; the first sum: 14.5+1e-12; the second quotient: 9÷(14.5+1e-12); the sixth difference, i.e., the first parameter (position weight): 1-[9÷(14.5+1e-12)]. Through this calculation, the position weight of the sentence is determined, which is used subsequently, along with parameters such as semantic distance, to determine the representative sentence.

[0070] In this embodiment, through a series of rigorous calculation steps, the position of a sentence in the text is transformed into a specific numerical weight. This allows for the accurate quantification of the importance of a sentence in its position, clearly distinguishing the importance of sentences in different positions to the core content of the text. This positional weight, as one of the important parameters for determining the representative sentence, is combined with other parameters (such as semantic distance) to ensure that the selection of the representative sentence considers not only semantics but also the sentence's position in the text. This improves the rationality of the representative sentence selection and more comprehensively reflects the key information of each part of the text. Accurate selection of the representative sentence helps generate a more accurate text summary. The representative sentence determined based on the reasonably calculated positional weight enables the generated summary to better cover the important content of the text, improving the accuracy of the summary's generalization of the original text. For summary generation, it ensures that important information in key positions is not omitted.

[0071] In some alternative implementations, the second parameter of the sentence in the text to be processed is determined by the following steps k to p (still taking the target sentence as an example).

[0072] k, obtain the first embedding vector of the target sentence. and the second embedding vector of the target cluster centroid .

[0073] In natural language processing, word vectors or sentence vectors are a way to transform textual information into numerical vector representations so that computers can understand and process the semantic information of the text. Embedding vectors are obtained by training models, and different models (such as Embedding Model, Word2Vec, GloVe, etc.) can generate different types of embedding vectors. These vectors can capture the semantic relationships between words or sentences, and vectors that are close together in the vector space represent semantically similar content.

[0074] In the text summarization scenario of this application, obtaining the embedding vectors of the target sentence and the target cluster centroid is to prepare for subsequent calculation of the semantic distance between them. Taking the aforementioned article on urban traffic improvement measures as an example, "Increasing public transportation routes can alleviate congestion" is taken as the target sentence, and its corresponding first embedding vector is obtained through a specific embedding model. The centroid of the cluster to which the sentence belongs also obtains the corresponding second embedding vector. .

[0075] l, calculate the first embedding vector and the second embedding vector Euclidean distance between The target Euclidean distance between the target sentence and the target cluster centroid is obtained. ;Right now:

[0076]

[0077] Euclidean distance is a commonly used method to measure the distance between two vectors, calculating the straight-line distance between two points in a multidimensional space. In text processing, it is used to calculate sentence embedding vectors. With cluster centroid embedding vector Euclidean distance between The distance can measure the semantic closeness between a sentence and its cluster centroid. A smaller distance indicates that the sentence's semantics are closer to the semantics represented by the cluster centroid. The target Euclidean distance is obtained by calculating the Euclidean distance between the target sentence and the embedding vector of the target cluster centroid. This is used to assess the semantic representativeness of a target sentence within its respective cluster. For example, in a cluster of sentences related to public transportation, the Euclidean distance between "increasing public transportation routes can alleviate congestion" and the centroid of that cluster is calculated to determine how closely the sentence fits the core semantics of the cluster.

[0078] m, obtain the target Euclidean distance set minimum Euclidean distance and maximum Euclidean distance The target Euclidean distance set It is the Euclidean distance between each sentence in the sentence cluster to which the target sentence belongs and the centroid of the target cluster. A set of components.

[0079] Obtain the minimum and maximum Euclidean distances from the set of all sentences in the sentence cluster to which the target sentence belongs to, and use them for subsequent Euclidean distance calculations of the target sentence. Normalization was performed to eliminate differences in distance scales between different clusters.

[0080] n, calculate the target Euclidean distance minus To the minimum Euclidean distance The sixth difference .

[0081] This calculation step is part of the normalization process, done by subtracting the minimum value. The starting point of the data is adjusted to 0, allowing subsequent calculations to be performed from a relatively uniform starting point, which facilitates ratio calculations and comparisons. In this application, the target Euclidean distance between the target sentence and the target cluster centroid is used. Subtract the minimum Euclidean distance within the sentence cluster to which the target sentence belongs. This prepares for subsequent calculations of normalized semantic distance. For example, suppose the target Euclidean distance is 5, the minimum Euclidean distance is 2, and the sixth difference is 3.

[0082] o, calculate the maximum Euclidean distance Subtract the target Euclidean distance The seventh difference .

[0083] This step works in conjunction with the previous step, calculating the maximum value. With target value The difference, together with the result from the previous step, is used to construct a normalized proportional relationship, further mapping the data to a reasonable range. In this application, the maximum Euclidean distance is calculated. European distance from the target The difference For example, if the maximum Euclidean distance is 8 and the target Euclidean distance is 5, the seventh difference is 3.

[0084] p, calculate the seventh difference and the smallest positive number The second sum .

[0085] When calculating the normalized semantic distance in this application, a very small positive number (such as 1e-12) is added to the seventh difference. Add them together to ensure that the denominator is not zero, so that subsequent calculations can proceed smoothly.

[0086] q, calculate the sixth difference Divide by the second sum The third quotient The second parameter of the target sentence is obtained. .

[0087] This division operation transforms the previously calculated difference into a normalized value between 0 and 1. This value more intuitively reflects the relative semantic distance between the target sentence and the cluster centroid, facilitating comparisons between different sentences. This third quotient... The second parameter of the target sentence represents the normalized semantic distance, such as 3÷(3+1e-12), which is used to determine the representative sentence together with other parameters (such as position weights).

[0088] That is, it contains In the text to be processed for each sentence, the index is... The semantic distance between the target sentence and the cluster centroid of the sentence cluster to which the target sentence belongs. It can be calculated using the following formula:

[0089]

[0090] For example, taking the aforementioned article on urban traffic improvement measures, the target sentence in the public transportation sentence cluster is "Optimizing bus stop layout can improve travel efficiency." Its first embedding vector and the second embedding vector of the cluster centroid are obtained through an embedding model. Assume the calculated Euclidean distance (target Euclidean distance) between them is 6. In this sentence cluster, among the set of Euclidean distances between all sentences and the cluster centroid, the minimum Euclidean distance is 3, and the maximum Euclidean distance is 9. The sixth difference is 6-3=3, the seventh difference is 9-6=3, the second sum is 3+1e-12, and the third quotient (i.e., the second parameter of the target sentence) is 3÷(3+1e-12). Through this calculation, the normalized semantic distance of the sentence is determined, which is used together with parameters such as position weights to determine the representative sentence.

[0091] In this embodiment, by calculating and normalizing the Euclidean distance between embedding vectors, the semantic similarity between the target sentence and the cluster centroid is accurately measured, which can accurately reflect the semantic representativeness of the sentence in its respective cluster. In the sentence cluster of urban traffic articles, the closeness of each sentence to the core semantics of the cluster is clearly determined. Obtaining the minimum and maximum Euclidean distances and normalizing them unifies the distance scale between different sentence clusters, making the semantic distances calculated in different clusters comparable, providing a basis for subsequent cross-cluster comparisons of sentence semantic importance. This normalized semantic distance, as one of the important parameters for determining representative sentences, combined with other parameters such as positional weights, more accurately selects representative sentences from a semantic perspective, improving the accuracy of representative sentence selection and thus improving the quality of text summarization. For urban traffic article summarization, it can better select sentences that reflect the semantic core.

[0092] S14, determine the representative sentence of each sentence cluster in the at least one sentence cluster based on the first parameter set and the second parameter set of each sentence cluster in the at least one sentence cluster.

[0093] A representative sentence is one that summarizes the core content of its cluster. Selecting a representative sentence is crucial for presenting cluster information concisely, and its accurate selection is essential in text summarization. By comprehensively considering both the first and second parameter sets, sentences that are representative in both semantics and position are chosen as representative sentences, ensuring that the selected sentences better reflect the content of their respective sentence clusters.

[0094] In some alternative implementations, the representative sentence of the sentence cluster is selected through steps r to z2 (taking the target sentence cluster as an example):

[0095] r, obtain the preset balance coefficient .

[0096] In multi-factor comprehensive evaluation algorithms, the balance coefficient It is used to adjust the relative importance of different factors in the final result. It is a pre-set value determined according to the specific problem and data characteristics, and can balance the influence of different factors on the final decision.

[0097] In the process of determining the representative sentence in this application, the balance coefficient Used to weigh semantic distance and position weight These two factors affect the overall sentence score. The impact. Taking the aforementioned article on urban traffic improvement measures as an example, the balance coefficient... The semantic distance determines whether a sentence is a representative sentence. and position weight Who has more influence?

[0098] s, calculate the balance coefficient and the second parameter of the target sentence First product The second parameter of the target sentence. It is the semantic distance between the target sentence and the target cluster centroid, where the target cluster centroid is the cluster centroid of the sentence cluster to which the target sentence belongs.

[0099] By balancing coefficient The second parameter of the target sentence Multiplication is used to determine the specific degree of influence of semantic distance factors on the overall sentence score. Taking a sentence in an article about urban traffic as an example, assuming the balance coefficient is 0.6 and the second parameter (normalized semantic distance) of the sentence is 0.3, then the first product is 0.6 × 0.3 = 0.18. This value reflects the partial contribution of semantic distance factors to the overall sentence score.

[0100] t, calculate the natural number 1 minus the first parameter of the target sentence. First difference The first parameter of the target sentence It is the positional weight of the target sentence in the text to be processed.

[0101] In scenarios involving weight calculations, subtracting a weight value from 1 yields the "reverse" influence of that weight. Here, this is used to subtract the first parameter of the target sentence. (Location weight) is converted into a value calculated using the same method as semantic distance factors, facilitating subsequent comprehensive calculations. For example, for a sentence in an article about urban transportation, if its first parameter (location weight) is 0.7, then the first difference is 1-0.7=0.3. This value will be used in the comprehensive score calculation along with the semantic distance factor.

[0102] x, calculate the natural number 1 minus the balance coefficient. The second difference .

[0103] This calculation is to determine the location weights. The weighting adjustment value of factors in the overall score calculation. This is achieved by subtracting the balance coefficient from 1. This yields a balance coefficient. Relative values ​​are used to adjust position weights. The contribution ratio in the overall score. For example, if the balance coefficient is 0.6, the second difference is 1-0.6=0.4. This 0.4 will be used to multiply with the position weight-related value to determine the contribution of the position weight to the sentence's overall score.

[0104] y, calculate the first difference Between and the second difference The second product .

[0105] This calculation is used to incorporate the location weight adjustment value. Inverse value of position weight To obtain the position weights Factors in the overall sentence score The specific contribution value is calculated in this way. This integrates the positional weight factor into the overall score calculation in an appropriate proportion. For example, multiplying the first difference of 0.3 and the second difference of 0.4 obtained in the previous step yields a second product of 0.3 × 0.4 = 0.12, which reflects the partial contribution of the positional weight factor to the sentence's overall score.

[0106] z, calculate the first product and the second product and The overall score of the target sentence is obtained. .

[0107] semantic distance Factors and position weights The contributions of each factor to the sentence are summed to obtain the overall score of the target sentence. This allows for a comprehensive assessment of the sentence's importance within its sentence cluster. For example, in the scenario of identifying a representative sentence in this application, the first product 0.18 and the second product 0.12 calculated earlier are added together to obtain a comprehensive score of 0.18 + 0.12 = 0.3 for the sentence. This comprehensive score is used to compare with other sentences to determine whether it is a representative sentence.

[0108] That is, it contains In the text to be processed for each sentence, the index is... The overall score of the target sentence can be calculated using the following formula:

[0109]

[0110] aa, the sentence with the lowest overall score in the target sentence cluster is determined as the representative sentence of the target sentence cluster.

[0111] Select Overall Score The sentence with the lowest score was chosen as the representative sentence because of its overall score. It can reflect the overall performance of a sentence under multiple factors. Selecting the sentence with the best score as the representative sentence can best represent the characteristics of the sentence cluster. For example, in a sentence cluster of an article on urban transportation, after calculating the comprehensive score of all sentences, the sentence with the lowest comprehensive score is selected as the representative sentence. For example, in the public transportation sentence cluster, the sentence "Increasing public transportation routes can alleviate congestion" has the lowest comprehensive score and is therefore determined as the representative sentence of the cluster because it best represents the core content of the cluster under the comprehensive consideration of semantic distance and positional weight.

[0112] For example, taking the aforementioned article on urban traffic improvement measures as an example, in the public transportation sentence cluster, suppose there are three sentences: Sentence A "Increasing public transportation routes can alleviate congestion," Sentence B "Optimizing bus stop layout can improve travel efficiency," and Sentence C "Opening dedicated bus lanes can increase operating speed." The preset balance coefficient is 0.6.

[0113] For sentence A, assuming its first parameter (positional weight) is calculated to be 0.8 and its second parameter (normalized semantic distance) is 0.2, the first product is 0.6 × 0.2 = 0.12, the first difference is 1 - 0.8 = 0.2, the second difference is 1 - 0.6 = 0.4, the second product is 0.2 × 0.4 = 0.08, and the overall score is 0.12 + 0.08 = 0.2.

[0114] For sentence B, assume its first parameter is 0.6 and its second parameter is 0.3. The first product is 0.6 × 0.3 = 0.18, the first difference is 1 - 0.6 = 0.4, the second difference is 0.4, the second product is 0.4 × 0.4 = 0.16, and the overall score is 0.18 + 0.16 = 0.34.

[0115] For sentence C, assume its first parameter is 0.7 and its second parameter is 0.25. The first product is 0.6 × 0.25 = 0.15, the first difference is 1 - 0.7 = 0.3, the second difference is 0.4, the second product is 0.3 × 0.4 = 0.12, and the overall score is 0.15 + 0.12 = 0.27.

[0116] Comparing the overall scores of the three sentences, sentence A has the lowest overall score. Therefore, sentence A, "Increasing public transportation routes can alleviate congestion," is identified as the representative sentence of the public transportation sentence cluster.

[0117] In this embodiment, a balance coefficient is used to weigh two important factors: semantic distance and positional weight. This ensures that the representative sentence is selected by comprehensively considering its semantic and textual structural importance, avoiding the one-sidedness of selecting a representative sentence based on only a single factor, and fully reflecting the characteristics of the sentence cluster. In urban traffic articles, both the closeness of the sentence to the core semantics of the cluster and its position in the article are considered, resulting in a more accurate selection of the representative sentence. Through a series of precise calculation steps, a comprehensive score is obtained for each sentence, and the sentence with the lowest score is selected as the representative sentence, enabling precise selection of the most representative sentence from the sentence cluster. This approach improves the representative sentence's ability to summarize the content of the sentence cluster, making the generated text summary more accurately reflect the core information of each sentence cluster. Accurate selection of representative sentences is key to generating high-quality text summaries. The method in this embodiment ensures that the sentences in the summary are determined after comprehensive evaluation of multiple factors, thereby improving the coverage and accuracy of the text summary of the original content. For the generation of summaries for urban traffic articles, it can better present the key information of the article and help readers quickly understand the core content.

[0118] S15, according to the order of each representative sentence in the text to be processed, combine the representative sentences corresponding to the at least one sentence cluster to obtain a summary of the text to be processed.

[0119] When generating text summaries, combining representative sentences in the original order preserves the text's logical flow, allowing readers to quickly grasp the general structure of the argument. Following this principle, combining representative sentences from each sentence cluster in sequence generates a summary that concisely summarizes the text's content while maintaining its original logic.

[0120] For example, suppose the text to be processed is an article about urban traffic improvement measures, containing numerous sentences such as "Increasing public transportation routes can alleviate congestion," "Raising road speed limits requires careful evaluation," and "Strengthening traffic law publicity can improve safety awareness." Through cluster analysis, sentences about public transportation can be clustered into one cluster, sentences about road speed limits into another, and sentences about traffic law publicity into yet another. After determining the first and second parameter sets, representative sentences are selected from each cluster, such as "Increasing public transportation routes can alleviate congestion," "Raising road speed limits requires careful evaluation," and "Strengthening traffic law publicity can improve safety awareness," and then combined according to their order in the original text to obtain a summary of the text.

[0121] In this embodiment, by clustering sentences, determining two parameter sets (a first parameter set and a second parameter set), and combining both to determine representative sentences, the semantic and positional factors of sentences in the text are comprehensively considered. This ensures that the selected representative sentences more accurately reflect the text content, thereby improving the accuracy of the generated summary. Grouping representative sentences according to their order in the original text preserves the original logical order of the text, allowing readers to quickly grasp the text's argumentative structure through the summary. Clustering analysis groups numerous sentences, simplifying the subsequent process of determining representative sentences, reducing the complexity of processing a large number of sentences, and improving the efficiency of summary generation.

[0122] In some optional implementations, step S12 includes steps a1-a4:

[0123] a1, obtain the preset constraint coefficients. and the total number of sentences in the text to be processed .

[0124] In clustering analysis algorithms, the constraint coefficient is a manually set parameter used to limit the clustering results, specifically limiting the number of clusters obtained.

[0125] The total number of sentences is basic information describing the size of the text.

[0126] Taking the aforementioned article on urban traffic improvement measures as an example, the constraint coefficient may be set based on experience or experiments. For example, the constraint coefficient may be set to 3, 4, 5 or 6, etc. The total number of sentences is obtained by counting the sentences in the article. The two are combined to determine the appropriate number of clusters.

[0127] a2, calculate the total number of sentences. Divided by the constraint coefficient The fourth quotient .

[0128] a3, Calculate the fourth quotient The value of rounding down The number of clusters was obtained. .

[0129] In cluster analysis scenarios, the total number of sentences is... Divide by constraint coefficient This yields a numerical value related to the number of clusters, which initially reflects the approximate number of clusters that should be divided based on the text size and constraints.

[0130] Rounding down is a mathematical operation used to convert a value into the largest integer not greater than it. In determining the number of clusters, since the number of clusters must be an integer, rounding down yields a practically feasible number of clusters, avoiding inappropriate numbers in decimal or fractional form.

[0131] For example, taking the aforementioned urban traffic article as an example, assuming the total number of sentences is 50 and the constraint coefficient is 5, then the fourth quotient is 52 ÷ 5 = 10.4. This 10.4 indicates that, according to the current settings, the article should be roughly divided into 10 sentence clusters. Rounding down the fourth quotient obtained in the previous step, for example, if the fourth quotient is 10.4, rounding down gives 10 clusters, thus determining the final number of sentence clusters to be divided when clustering the urban traffic article.

[0132] a4, based on the number of clusters As a constraint, cluster analysis is performed on all sentences in the text to be processed to obtain the specified number of sentence clusters.

[0133] Cluster analysis is the process of grouping data objects based on their similarity. It involves determining the number of clusters. Clustering with constraints means that during the operation of the clustering algorithm, data objects are forced to be divided into a specified number of clusters, so that the data objects within each cluster have high similarity, while the data objects between different clusters have large differences.

[0134] For example, in processing articles about urban traffic, with a constraint of 10 clusters, a suitable clustering algorithm (such as the K-means algorithm) is used to perform cluster analysis on all sentences in the article, and finally the sentences in the article are divided into 10 sentence clusters. For example, sentences about different aspects such as public transportation routes, bus stop layout, road speed limits, and traffic regulations are clustered into different sentence clusters.

[0135] Optionally, step a4 includes the following sub-steps a41-a42:

[0136] a41, Select a number of sentences with different numbers of clusters from the text to be processed as the initial cluster centroids;

[0137] a42, using the selected initial cluster centroid as a benchmark, perform cluster analysis on all sentences in the text to be processed to obtain the number of sentence clusters.

[0138] In clustering algorithms (such as K-means), the choice of initial cluster centroids has a significant impact on the clustering results. The cluster centroid is the central representative point of each cluster, and the method of selecting the initial centroids determines the initial state of the clustering. Generally, choosing different initial centroids may lead to differences in the final clustering results. The selected initial centroids should be as dispersed as possible to better cover the data space and make the clustering results more reasonable.

[0139] For example, in a scenario where cluster analysis is performed on articles about urban traffic improvement measures, based on the previously determined number of clusters, sentences with an equal number of distinct clusters are selected from all sentences in the article as the initial cluster centroids. For instance, if the number of clusters is 10, 10 different sentences are identified from the article. These sentences may come from different paragraphs and discuss different aspects of the content, and these sentences serve as the starting centers for subsequent clustering, guiding the clustering process.

[0140] Based on the selected initial centroids, the clustering algorithm assigns data points (in this case, sentences in text) to the clusters represented by the nearest centroids according to their distances (e.g., semantic distance) to each centroid. As the clustering process progresses, the centroids continuously adjust their positions until certain convergence conditions are met, ultimately forming stable clusters. This clustering method based on initial centroids is the core operation of many clustering algorithms.

[0141] For example, in an article about urban transportation, using 10 initial centroid sentences as a benchmark, the semantic distance between other sentences in the article and these 10 centroid sentences is calculated, and each sentence is assigned to the cluster containing the nearest centroid. For instance, the sentence "Increasing public transportation routes can alleviate congestion" is semantically closest to an initial centroid sentence representing the direction of public transportation optimization, so it is assigned to the cluster corresponding to that centroid. After multiple iterations to adjust the centroid positions, 10 sentence clusters are finally obtained.

[0142] For example, taking the aforementioned article on urban traffic improvement measures as an example, the article has a total of 52 sentences and a preset constraint coefficient of 5. First, the fourth quotient is calculated: 52 ÷ 5 = 10.4, which is rounded down to obtain a cluster size of 10. Then, using 10 as the cluster size constraint, the K-means clustering algorithm is applied to cluster all sentences in the article. After clustering, the article sentences are divided into 10 sentence clusters. For example, one sentence cluster contains sentences related to public transportation optimization, such as "increasing public transportation routes can alleviate congestion" and "optimizing bus stop layout can improve travel efficiency"; another sentence cluster contains sentences related to road speed limits, such as "raising road speed limits requires careful evaluation" and "lowering speed limits on some road sections can reduce accidents," and so on. The article sentences are then grouped into 10 sentence clusters based on semantic similarity.

[0143] In this embodiment, the number of clusters is determined based on the total number of sentences in the text and a preset constraint coefficient, allowing the number of clusters to adapt to the size and information density of the text. For articles like those on urban traffic, which vary in length and content richness, a relatively suitable number of clusters can be found, avoiding excessive information dispersion or concentration due to too many or too few clusters, thus improving the clustering effect. Using the calculated number of clusters as a constraint for cluster analysis makes the clustering process more targeted, enabling more effective grouping of sentences in the text according to semantic similarity. This helps in accurately selecting representative sentences from each sentence cluster, thereby improving the accuracy of text summarization. Reasonably determining the number of clusters is a crucial step in the text summarization process. The method in this embodiment determines an appropriate number of clusters, optimizes the clustering steps, lays a good foundation for subsequent determination of representative sentences and summary generation, and improves the efficiency and quality of the entire text processing process. For summarizing urban traffic articles, it enables more efficient and accurate extraction of key information.

[0144] Optionally, step a4 includes the following sub-steps a43-a46:

[0145] a43, repeat the initial cluster centroid selection step at least twice to obtain at least two initial cluster centroid sets. The initial cluster centroid selection step selects a number of sentences with different clusters from the text to be processed as initial cluster centroids. Each round of the initial cluster centroid selection step yields an initial cluster centroid set. Each of the at least two initial cluster centroid sets is different.

[0146] In cluster analysis, the choice of initial cluster centroids has a significant impact on the final clustering result. Different initial centroids may lead to differences in the clustering results. By selecting different initial cluster centroid sets multiple times, various possible clustering results can be explored, increasing the likelihood of finding a better cluster. Each selected initial cluster centroid set should contain the same number of distinct centroids as the set number of clusters.

[0147] For example, when processing articles on urban traffic improvement measures, the number of clusters is set accordingly. The initial cluster centroids are selected from different combinations of sentences in the article multiple times. For example, assuming there are 10 clusters, the first round selects 10 sentences as initial cluster centroids to form the first initial cluster centroid set; the second round selects another 10 different sentences to form the second initial cluster centroid set. This is done to try different initial clustering states to obtain more ideal clustering results.

[0148] a44, using each initial cluster centroid set in the at least two initial cluster centroid sets as a benchmark, perform cluster analysis on all sentences in the text to be processed to obtain at least two sentence cluster sets. One sentence cluster set in the at least two sentence cluster sets corresponds to one initial cluster centroid set in the at least two initial cluster centroid sets, and each sentence cluster set in the at least two sentence cluster sets has a one-to-one correspondence with each initial cluster centroid set in the at least two initial cluster centroid sets.

[0149] Cluster analysis based on different initial centroid sets divides sentences into different clusters according to the distance (such as semantic distance) between each centroid and sentences in the text, thus generating different sentence clusters. Each initial centroid set corresponds to one sentence cluster, and due to the different initial centroids, the distribution and clustering of sentences within each sentence cluster will also be different.

[0150] For example, in an article about urban transportation, using the initial cluster centroid set obtained in the first round as a benchmark, a clustering algorithm is applied to cluster all sentences in the article, resulting in the first sentence cluster set. Then, using the initial cluster centroid set from the second round as a basis, clustering is performed to obtain the second sentence cluster set. Sentences may be assigned to different clusters; for example, a sentence in the first cluster set might belong to the public transportation-related cluster, but in the second cluster set, it might be classified as a traffic management-related cluster. This depends on the selection of the initial cluster centroids.

[0151] a45, determine the concentration of each sentence cluster in the at least two sentence cluster sets.

[0152] Concentration is a metric for measuring clustering quality, used to assess the tightness or similarity of data within a cluster. Higher concentration means that sentences within a cluster are more semantically similar, resulting in better clustering. Common metrics for measuring concentration include SSE (sum of squared errors), which reflects concentration by calculating the sum of squared distances from each sentence to the centroid of its cluster.

[0153] In this embodiment, for each sentence cluster, the sum of squared distances from each sentence to its corresponding cluster centroid is calculated to determine the concentration of the sentence cluster. For example, using the SSE index, for a sentence cluster of an urban traffic article, the squared Euclidean distance between each sentence and its cluster centroid is calculated and summed to obtain the SSE value of the sentence cluster. The smaller the SSE value, the higher the concentration of the sentence cluster.

[0154] a46, the number of sentence clusters with the highest concentration is taken as the final number of sentence clusters obtained from the cluster analysis.

[0155] The sentence cluster with the highest concentration was chosen as the final clustering result because the sentences within this cluster have the highest similarity, better representing the semantic structure of the text and resulting in better clustering performance. This allows for the selection of the best-quality clustering results from multiple possible clustering outcomes, meeting the needs of subsequent effective text analysis (such as identifying representative sentences and generating summaries).

[0156] For example, after performing multiple clustering operations on urban traffic articles to obtain multiple sentence clusters, their concentration (such as SSE value) is compared. The 10 sentence clusters with the lowest SSE value (i.e., the highest concentration) are determined as the final clustering result. The sentence clusters obtained in this way can more accurately group sentences with similar meanings together, laying the foundation for generating high-quality text summaries in the future.

[0157] For example, taking the aforementioned article on urban traffic improvement measures as an example, let's assume that the number of clusters is determined to be 8 through the aforementioned steps.

[0158] First, two rounds of initial cluster centroid selection were performed. In the first round, eight sentences were selected as the initial cluster centroid set 1: "Increasing public transportation routes can alleviate congestion," "Raising road speed limits requires careful evaluation," "Strengthening traffic regulations can improve safety awareness," "Optimizing bus stop layout can improve travel efficiency," "Lowering speed limits on some road sections can reduce accidents," "Conducting traffic safety education activities can regulate driving behavior," "Improving traffic signal systems can optimize traffic order," and "Promoting intelligent transportation technology can improve management." Based on the initial cluster centroid set 1, cluster analysis was performed on all sentences in the article, resulting in sentence cluster set 1.

[0159] In the second round, select the following 8 sentences as the initial cluster centroid set 2: "Opening bus lanes can improve the running speed", "Reasonably planning parking lots can alleviate the parking problem", "Strengthening the crackdown on drunk driving can ensure traffic safety", "Improving the driver training standards can enhance driving skills", "Optimizing traffic sign settings can guide traffic flow", "Strengthening pedestrian traffic safety education can reduce accidents", "Promoting the construction of traffic informatization can improve management efficiency", and "Implementing tidal lanes can relieve peak congestion". Based on the initial cluster centroid set 2, perform cluster analysis on all sentences in the article to obtain the sentence cluster set 2.

[0160] Then, determine the concentration degrees of the sentence cluster set 1 and the sentence cluster set 2. Assume that the SSE index is used for measurement. Calculate the sum of the squares of the Euclidean distances from each sentence in the sentence cluster set 1 to the centroid of its cluster to obtain SSE1; similarly, calculate SSE2 of the sentence cluster set 2. Compare SSE1 and SSE2. If SSE1 < SSE2, it means that the concentration degree of the sentence cluster set 1 is higher.

[0161] Finally, take the 8 sentence clusters in the sentence cluster set 1 as the 8 sentence clusters obtained from the final cluster analysis.

[0162] In this embodiment, by repeatedly selecting initial cluster centroids and performing cluster analysis to obtain multiple sentence cluster sets, and then choosing the one with the highest concentration degree as the final result, it can effectively avoid the clustering deviation caused by improper selection of the initial cluster centroids, thereby optimizing the clustering result. In the clustering of urban traffic articles, it ensures that sentences with similar semantics are more accurately clustered together, improving the quality of clustering. Repeatedly trying different initial cluster centroids makes the clustering result independent of a specific initial selection, increasing the stability and reliability of clustering. Different runs of the clustering process can obtain relatively stable and high-quality clustering results in this way, providing a reliable basis for subsequent text processing steps. A better clustering result helps to more accurately select representative sentences from each sentence cluster, and then generate a text summary with higher quality. For urban traffic articles, it can make the summary more comprehensively and accurately reflect the core content of the article, helping readers better understand the main idea of the article.

[0163] With the rapid development of Natural Language Processing (NLP) technology, semi-structured text (such as web page content, PDF documents, scanned paper documents, and emails) has become an important medium for government departments, legal institutions, enterprises, financial institutions, medical institutions, and the education sector to obtain information. While this type of text contains a wealth of valuable information, its inconsistent format and scattered information distribution make manual extraction and structuring not only time-consuming and labor-intensive but also prone to omissions and errors, failing to meet the needs of various sectors for efficient information utilization. For example, government departments need to quickly process policy texts to aid decision-making and policy interpretation; legal professionals need to extract key information from massive amounts of legal documents to improve judicial efficiency; enterprises need to optimize market strategies through text analysis; financial institutions need to rely on text data for compliance checks and investment decision support; and medical institutions need to mine information from medical literature and medical records to accelerate research processes. Therefore, achieving the automated conversion of semi-structured text into structured information has become a key technological requirement for reducing labor costs and improving information utilization efficiency.

[0164] Therefore, embodiments of this application also provide an information extraction method for converting semi-structured text into structured information.

[0165] like Figure 2 As shown, Figure 2 This is a schematic flowchart illustrating the process of generating text summaries provided in an embodiment of this application. The text processing method can be applied to electronic devices, such as computers, smartphones, tablets, wearable smart devices, etc., or servers in distributed systems, cloud servers, intelligent cloud computing servers with artificial intelligence technology, or intelligent cloud hosts. It can also be applied to... Figure 4 The information extraction device shown Figure 5 or Figure 6 For details regarding the electronic devices shown, please refer to the relevant descriptions below. Figure 2 The method for generating text summaries or the text processing method includes the following steps S21 to S25:

[0166] S21, Obtain the target text to be processed and the extraction prompt words; if the extraction prompt words indicate that the deep information of the target text should be extracted, then execute steps S22-S24; if the extraction prompt words indicate that the shallow information of the target text should be extracted, then execute steps S25-28; if the extraction prompt words indicate that both the deep information and the shallow information of the target text should be extracted, then execute steps S22, S25-S26, and S29-S30.

[0167] In information extraction tasks, the target text to be processed is the source of information, which can take various forms, such as documents and web page content. Extraction prompts are keywords or phrases used to indicate the extraction of specific information, clarifying the direction and goal of information extraction. Obtaining these two provides basic data and guidance for subsequent information extraction operations.

[0168] For example, taking the aforementioned article on urban traffic improvement measures as an example, this article is the target text to be processed. The extraction prompts might be "traffic improvement measures" or "the effect of traffic regulation publicity," clearly indicating that information related to these topics should be extracted from the article.

[0169] Deep information typically refers to information that requires in-depth understanding and analysis of the text to obtain, such as the text's underlying intent and core arguments. Shallow information generally refers to information that is relatively easy to obtain directly from the text and does not require in-depth semantic analysis.

[0170] S22, Generate a summary of the target text according to the method for generating text summaries described in any of the foregoing embodiments.

[0171] Methods for generating text summaries can condense text content, highlight key information, and help uncover deeper information. Choosing the appropriate text processing method based on different extraction prompts is a common strategy in information extraction tasks.

[0172] For example, if the extraction prompt is "core strategies for improving urban traffic," this indicates the need to extract deeper information. In this case, by using methods such as cluster analysis and identifying representative sentences to generate text summaries, the urban traffic article can be processed. The generated summary will contain key sentences from the article regarding core strategies for improving traffic, facilitating further extraction of deeper information.

[0173] S23, the summary of the target text and the extraction prompt words are input into the information extraction model to extract information, and the first target information output by the information extraction model is obtained.

[0174] Information extraction models are tools based on machine learning or natural language processing techniques that can identify and extract relevant information from input text and prompts. Inputting text summaries and extraction prompts into the model leverages the conciseness of the summaries and the specificity of the prompts to improve the accuracy and efficiency of information extraction.

[0175] Input the generated urban traffic article summary and the extraction prompt "core strategies for improving urban traffic" into the information extraction model. The model will identify content related to the core strategies in the summary, such as "increasing public transportation routes" and "strengthening the publicity of traffic regulations", and output the first target information.

[0176] S24, Store the first target information in a structured manner.

[0177] Structured storage involves storing extracted information in a specific format, such as tables or databases. This storage method facilitates information management, retrieval, and further analysis, thereby improving the usability and value of the information.

[0178] The primary objective information on the core strategies for improving urban traffic, output by the information extraction model, is stored in a table. The columns of the table can be set as "strategy name", "specific measures", etc. Information such as "increasing public transportation routes" and "strengthening traffic regulations publicity" are filled into the corresponding cells for easy use later.

[0179] For example, using the aforementioned article on urban traffic improvement measures as the target text, and assuming the extraction prompt is "urban traffic congestion relief measures," this indicates the extraction of deeper information. First, based on the aforementioned method for generating text summaries, the article is clustered to identify sentence clusters, representative sentences are selected, and an article summary is generated. For example, the summary might contain key sentences such as "increasing public transportation routes can alleviate congestion," "optimizing bus stop layout can improve travel efficiency," and "establishing dedicated bus lanes can improve operating speed." Then, this summary and the extraction prompt "urban traffic congestion relief measures" are input into the information extraction model. After analyzing the summary, the model outputs the first target information, such as "increasing public transportation routes," "optimizing bus stop layout," and "establishing dedicated bus lanes." Finally, this information is structured and stored in a database. The database table structure can be designed to include a "measure name" field, into which the above information is sequentially filled.

[0180] By identifying extraction prompts to determine deeper information and utilizing text summarization techniques, this approach enables precise extraction of in-depth information from complex target texts. For urban traffic articles, it can accurately extract key content such as congestion mitigation measures, meeting the needs of in-depth text analysis. First, a summary is generated from the target text; then, extraction prompts are input into the information extraction model. The conciseness of the summary reduces the amount of data processed by the model, improving information extraction efficiency. Compared to directly extracting information from the full text, this saves processing time, especially for lengthy urban traffic-related documents. The extracted primary target information is stored in a structured manner, ensuring orderly preservation and facilitating subsequent querying, statistics, and analysis. For example, in urban traffic management, congestion mitigation measures can be easily retrieved from the stored information, providing data support for policy formulation.

[0181] S25, identify a suspected fragment in the target text that may contain the shallow information.

[0182] Identifying suspected fragments containing shallow information is typically based on surface features of the text, such as the location of keywords and specific sentence structures. This method narrows down the search scope and improves information extraction efficiency.

[0183] For example, taking the aforementioned article on urban traffic improvement measures as an example, if the extraction prompt is "content related to transportation facilities," this indicates that shallow information should be extracted. In this case, by searching for sentences or paragraphs in the article that contain keywords related to "transportation facilities," we can identify potential passages, such as sentences or paragraphs containing phrases like "increasing public transportation routes can alleviate congestion" or "optimizing the layout of bus stops can improve travel efficiency," because these contents directly involve statements related to transportation facilities.

[0184] S26. According to the order of each suspected fragment in the target text, combine all suspected fragments to obtain a simplified text.

[0185] Combining suspected fragments in the original text order preserves the original logical sequence while eliminating content irrelevant to the target information, resulting in a more concise text focused on the target message. This simplified text is easier for subsequent information extraction models to process, reducing noise interference.

[0186] For example, in an article about urban transportation, identified fragments related to "transportation facilities" are arranged and combined according to their chronological order within the article to create a concise text. For instance, sentences containing phrases like "increasing public transportation routes" and "optimizing bus stop layout" are organized sequentially, and other irrelevant sentences are removed to form a short text focused on transportation facilities.

[0187] S27, the simplified text and the extraction prompt words are input into the information extraction model for information extraction to obtain the second target information output by the information extraction model.

[0188] The information extraction model extracts information from concise text and by extracting prompts. Leveraging the focus of concise text and the guiding nature of prompts, it can more accurately and quickly identify and extract target superficial information. Based on pre-defined algorithms and rules, the model analyzes and matches the text, outputting information that meets the requirements.

[0189] For example, the generated concise text about "transportation facilities" and the extraction prompt "transportation facilities" are input into the information extraction model. After analysis, the model outputs the second target information, which may be explicit information related to transportation facilities, such as "public transportation routes" or "bus stop layout".

[0190] S28, the second target information is stored in a structured manner.

[0191] Similar to structured storage of deep information, extracted shallow information is stored in a structured form, such as tables or databases, to facilitate information management, retrieval, and further analysis and utilization, thereby enhancing the value and usability of the information.

[0192] For example, the secondary target information about transportation facilities output by the information extraction model can be stored in tabular form. The table can include columns such as "Transportation Facility Name" and "Related Description," and information such as "Public Transportation Routes" and "Bus Stop Layout" along with their corresponding descriptions can be filled into the appropriate columns for easy retrieval and use later.

[0193] For example, using the aforementioned article on urban traffic improvement measures as the target text, and assuming the extraction prompt is "specific traffic improvement facilities," the focus is on extracting shallow information. First, sentences containing keywords related to traffic improvement facilities are searched within the article to identify potential fragments, such as sentences containing phrases like "increasing public transport routes can alleviate congestion," "creating dedicated bus lanes can improve operating speed," and "improving traffic signal systems can optimize traffic flow." Then, these potential fragments are combined according to their order within the article to obtain a simplified text, such as "increasing public transport routes can alleviate congestion. Creating dedicated bus lanes can improve operating speed. Improving traffic signal systems can optimize traffic flow." Next, this simplified text and the extraction prompt "specific traffic improvement facilities" are input into the information extraction model. After analysis, the model outputs second target information, such as "public transport routes," "dedicated bus lanes," and "traffic signal systems." Finally, this information is structured and stored in a database. The database table has a "facility name" field, and the aforementioned information is sequentially filled into this field.

[0194] In this embodiment, suspected fragments are identified based on extraction prompts and combined into concise text. Then, an information extraction model is used to efficiently extract shallow information from the target text. For urban traffic articles, it can quickly locate and extract straightforward information such as specific traffic improvement facilities, meeting the need for rapid acquisition of specific shallow information from the text. By filtering suspected fragments and combining them into concise text, a large amount of content irrelevant to the target shallow information is removed, reducing interference factors in the information extraction process and improving the accuracy of the information extraction model. This allows the extraction results to more accurately focus on the required traffic facility-related information, avoiding the influence of other irrelevant content. The extracted secondary target information is stored in a structured manner, facilitating systematic organization and classification of the information. In practical application scenarios such as urban traffic management, this allows relevant personnel to quickly query and use this traffic facility information, providing clear data support for traffic planning, facility construction, and other work.

[0195] S29, extract information from the summary of the target text, the simplified text, and the information extraction model of the extraction prompt words to obtain the first target information and the second target information output by the information extraction model.

[0196] S30, the first target information and the second target information are stored in a structured manner.

[0197] Steps S29 and S30 are similar to the aforementioned steps S23 (S27) and S24 (S28), respectively. Those skilled in the art can understand this by referring to the foregoing description, so they will not be repeated here.

[0198] The method for generating text summaries provided in this application can be executed by an apparatus for generating text summaries. This application uses an apparatus for generating text summaries to illustrate the method for generating text summaries provided in this application.

[0199] like Figure 3 The diagram shows a schematic representation of the apparatus for generating text summaries provided in an embodiment of this application. Please refer to... Figure 3 The apparatus 40 for generating text summaries includes:

[0200] The first acquisition module 401 is used to acquire the text to be processed;

[0201] The first clustering module 402 is used to perform cluster analysis on all sentences in the text to be processed to obtain at least one sentence cluster.

[0202] The first determining module 403 is used to determine the first parameter set and the second parameter set of each sentence cluster in the at least one sentence cluster. The first parameter set of the target sentence cluster is a set composed of the position weights of each sentence in the target sentence cluster in the text to be processed. The second parameter set of the target sentence cluster is a set composed of the semantic distances between each sentence in the target sentence cluster and the cluster centroid of the target sentence cluster. The target sentence cluster is any sentence cluster in the at least one sentence cluster.

[0203] The second determining module 404 is used to determine the representative sentence of each sentence cluster in the at least one sentence cluster based on the first parameter set and the second parameter set of each sentence cluster in the at least one sentence cluster.

[0204] The first combination module 405 is used to combine the representative sentences corresponding to the at least one sentence cluster according to the order of the representative sentences in the text to be processed, so as to obtain a summary of the text to be processed.

[0205] The text processing method provided in this application can be executed by a text processing device. This application uses a text processing device executing the text processing method as an example to illustrate the text processing device provided in this application.

[0206] like Figure 4The diagram shows a schematic representation of the text processing apparatus provided in an embodiment of this application. Please refer to [link / reference]. Figure 4 The text processing device 50 includes:

[0207] The second acquisition module 501 is used to acquire the target text to be processed and extract prompt words;

[0208] The first generation module 502 is used to generate a summary of the target text according to the method for generating a text summary described in any one of the preceding items if the extraction prompt word indicates that the deep information of the target text is extracted.

[0209] The first extraction module 503 is used to extract information from the summary of the target text and the extraction prompt words into the information extraction model to obtain the first target information output by the information extraction model.

[0210] The first storage module 504 is used to structure and store the first target information.

[0211] The text summarizing device 40 or text processing device 50 in this application embodiment can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, handheld computer, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the scope.

[0212] The text summarizing device 40 or text processing device 50 in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit the specific operating system.

[0213] The apparatus 40 for generating text summaries provided in this application embodiment can achieve... Figure 1The text processing device 50 is capable of achieving Figure 3 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0214] In some alternative implementations, such as Figure 5 As shown, this application embodiment also provides an electronic device 1300, including a processor 1301 and a memory 1302. The memory 1302 stores a program or instructions that can run on the processor 1301. When the program or instructions are executed by the processor 1301, they implement the various steps of the above-described method for generating text summaries or text processing method embodiments and can achieve the same technical effect. To avoid repetition, they will not be described again here.

[0215] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0216] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.

[0217] The electronic device 170 includes, but is not limited to, components such as: a radio frequency unit 1701, a network module 1702, an audio output unit 1703, an input unit 1704, a sensor 1705, a display unit 1706, a user input unit 1707, an interface unit 1708, a memory 1709, and a processor 17010. Those skilled in the art will understand that the electronic device 170 may also include a power supply (such as a battery) for powering the various components. The power supply can be logically connected to the processor 17010 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Figure 5 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0218] The processor 17010 is used for:

[0219] Get the text to be processed;

[0220] Cluster analysis is performed on all sentences in the text to be processed to obtain at least one sentence cluster;

[0221] Determine a first parameter set and a second parameter set for each sentence cluster in the at least one sentence cluster. The first parameter set of the target sentence cluster is a set composed of the position weights of each sentence in the target sentence cluster in the text to be processed. The second parameter set of the target sentence cluster is a set composed of the semantic distances between each sentence in the target sentence cluster and the cluster centroid of the target sentence cluster. The target sentence cluster is any sentence cluster in the at least one sentence cluster.

[0222] Based on the first parameter set and the second parameter set of each sentence cluster in the at least one sentence cluster, determine the representative sentence of each sentence cluster in the at least one sentence cluster;

[0223] According to the order of each representative sentence in the text to be processed, the representative sentences corresponding to the at least one sentence cluster are combined to obtain a summary of the text to be processed.

[0224] or,

[0225] Obtain the target text to be processed and extract prompt words;

[0226] If the extraction prompt indicates that the deep information of the target text is extracted, then a summary of the target text is generated according to the method for generating text summaries described in the first aspect;

[0227] The summary of the target text and the extraction prompts are input into the information extraction model for information extraction, and the first target information output by the information extraction model is obtained.

[0228] The first target information is stored in a structured manner.

[0229] It should be understood that, in this embodiment, the input unit 1704 may include a graphics processing unit (GPU) 17041 and a microphone 17042. The GPU 17041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1706 may include a display panel 17061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1707 includes at least one of a touch panel 17071 and other input devices 17072. The touch panel 17071 is also called a touch screen. The touch panel 17071 may include a touch detection device and a touch controller. Other input devices 17072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.

[0230] The memory 1709 can be used to store software programs and various data. The memory 1709 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 1709 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1709 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0231] Processor 17010 may include one or more processing units; optionally, processor 17010 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 17010.

[0232] Each of the above product embodiments can implement the various processes of the above text summarization method or text processing method embodiment through its own processor, and can achieve the same technical effect. To avoid repetition, they will not be described in detail.

[0233] This application also provides a readable storage medium storing a program or instructions. When executed by a processor, the program or instructions implement the various processes of the above-described methods for generating text summaries or text processing methods, achieving the same technical effects. To avoid repetition, these will not be described again here. The processor is the processor in the electronic device or electronic system described in the above embodiments. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk.

[0234] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described methods for generating text summaries or text processing methods, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0235] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0236] This application provides a computer program product that is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described method for generating text summaries or text processing methods, and achieves the same technical effects. To avoid repetition, further details are omitted here.

[0237] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0238] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0239] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0240] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0241] The above descriptions are merely embodiments of this application and do not limit the patent scope of this application. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art, under the guidance of this application, may make equivalent structural or procedural transformations based on the description and drawings of the embodiments of this application, or directly or indirectly apply them to other related technical fields, without departing from the spirit and scope of protection of the claims. All such transformations are similarly included within the patent protection scope of the embodiments of this application.

Claims

1. A method for generating text summaries, characterized in that, The method includes: Obtain the text to be processed and the preset balance coefficient; Cluster analysis is performed on all sentences in the text to be processed to obtain at least one sentence cluster; Determine a first parameter set and a second parameter set for each sentence cluster in the at least one sentence cluster. The first parameter set of the target sentence cluster is a set composed of the position weights of each sentence in the target sentence cluster in the text to be processed. The second parameter set of the target sentence cluster is a set composed of the semantic distances between each sentence in the target sentence cluster and the cluster centroid of the target sentence cluster. The target sentence cluster is any sentence cluster in the at least one sentence cluster. Based on the balance coefficient, the first parameter set and the second parameter set of each sentence cluster in the at least one sentence cluster, a representative sentence of each sentence cluster is determined. The representative sentence of each sentence cluster is the sentence with the lowest comprehensive score in that sentence cluster. The comprehensive score of each sentence is calculated based on the position weight of the sentence in the text to be processed and the semantic distance between the sentence and the cluster centroid of its sentence cluster. The balance coefficient is used to weigh the influence of semantic distance and position weight on the comprehensive score of the sentence. According to the order of each representative sentence in the text to be processed, the representative sentences corresponding to the at least one sentence cluster are combined to obtain a summary of the text to be processed.

2. The method according to claim 1, characterized in that, Based on the first parameter set and the second parameter set of each sentence cluster in the at least one sentence cluster, the representative sentence of each sentence cluster in the at least one sentence cluster is determined, including: Calculate the first product of the balance coefficient and the second parameter of the target sentence, wherein the target sentence is any sentence in the text to be processed, the second parameter of the target sentence is the semantic distance between the target sentence and the target cluster centroid, and the target cluster centroid is the cluster centroid of the sentence cluster to which the target sentence belongs; Calculate the first difference between the natural number 1 and the first parameter of the target sentence, where the first parameter of the target sentence is the positional weight of the target sentence in the text to be processed. Calculate the second difference between the natural number 1 and the balance coefficient; Calculate the second product between the first difference and the second difference; The sum of the first product and the second product is calculated to obtain the overall score of the target sentence; The sentence with the lowest overall score in the target sentence cluster is identified as the representative sentence of the target sentence cluster.

3. The method according to claim 2, characterized in that, The first parameter of the target sentence is determined through the following steps: Obtain the total number of sentences in the text to be processed; Calculate the third difference between the target index and the natural number 1. The target index is the index of the target sentence. The index of the first sentence at the beginning of the text to be processed is the natural number 1. The absolute value of the difference between the indices of any two adjacent sentences in the text to be processed is the natural number 1. The index of the sentence in the preceding text is always less than the index of the sentence in the following text. Calculate the fourth difference between the total number of sentences and the index of the target sentence; Calculate the minimum value between the third difference and the fourth difference; Calculate the fifth difference between the total number of sentences and the natural number 1; Calculate the first quotient value by dividing the fifth difference by the natural number 2; Calculate the first sum of the first quotient and the smallest positive number; Calculate the second quotient of the minimum value divided by the first sum; The sixth difference between the natural number 1 and the second quotient is calculated to obtain the first parameter of the target sentence.

4. The method according to claim 2, characterized in that, The second parameter of the target sentence is determined through the following steps: Obtain the first embedding vector of the target sentence and the second embedding vector of the target cluster centroid; Calculate the Euclidean distance between the first embedding vector and the second embedding vector to obtain the target Euclidean distance between the target sentence and the target cluster centroid; Obtain the minimum and maximum Euclidean distances in the target Euclidean distance set, wherein the target Euclidean distance set is a set composed of the Euclidean distances between each sentence in the sentence cluster to which the target sentence belongs and the centroid of the target cluster; Calculate the sixth difference between the target Euclidean distance and the minimum Euclidean distance; Calculate the seventh difference between the maximum Euclidean distance and the target Euclidean distance; Calculate the second sum of the seventh difference and the smallest positive number; The third quotient of the sixth difference divided by the second sum is used to obtain the second parameter of the target sentence.

5. The method according to claim 1, characterized in that, The clustering analysis of all sentences in the text to be processed yields at least one sentence cluster, including: Obtain the preset constraint coefficients and the total number of sentences in the text to be processed; Calculate the fourth quotient value by dividing the total number of sentences by the constraint coefficient; The fourth quotient is rounded down to obtain the number of clusters. Using the number of clusters as a constraint, cluster analysis is performed on all sentences in the text to be processed to obtain the number of sentence clusters.

6. The method according to claim 5, characterized in that, The method involves clustering all sentences in the text to be processed, using the specified number of clusters as a constraint, to obtain the specified number of sentence clusters, including: Select a number of sentences with different cluster sizes from the text to be processed as the initial cluster centroids; Based on the selected initial cluster centroid, cluster analysis is performed on all sentences in the text to be processed to obtain the number of sentence clusters.

7. The method according to claim 5, characterized in that, The method involves clustering all sentences in the text to be processed, using the specified number of clusters as a constraint, to obtain the specified number of sentence clusters, including: The initial cluster centroid selection step is repeated at least twice to obtain at least two initial cluster centroid sets. The initial cluster centroid selection step selects a number of sentences with different clusters from the text to be processed as initial cluster centroids. Each round of the initial cluster centroid selection step yields an initial cluster centroid set. Each of the at least two initial cluster centroid sets is different. Based on each initial cluster centroid set in the at least two initial cluster centroid sets, cluster analysis is performed on all sentences in the text to be processed to obtain at least two sentence cluster sets. One sentence cluster set in the at least two sentence cluster sets corresponds to one initial cluster centroid set in the at least two initial cluster centroid sets, and there is a one-to-one correspondence between each sentence cluster set in the at least two sentence cluster sets and each initial cluster centroid set in the at least two initial cluster centroid sets. Determine the concentration of each sentence cluster in the at least two sentence cluster sets; The number of sentence clusters with the highest concentration is taken as the final number of sentence clusters obtained from the cluster analysis.

8. An information extraction method, characterized in that, The method includes: Obtain the target text to be processed and extract prompt words; If the extraction prompt indicates that deep information of the target text is extracted, then the method for generating text summaries according to any one of claims 1 to 7 generates a summary of the target text; The summary of the target text and the extraction prompts are input into the information extraction model for information extraction, and the first target information output by the information extraction model is obtained. The first target information is stored in a structured manner.

9. The method according to claim 8, characterized in that, The method further includes: If the extraction prompt word indicates that shallow information of the target text is extracted, then a suspected segment in the target text that is suspected of containing the shallow information is determined. According to the order of each suspected fragment in the target text, all suspected fragments are combined to obtain a simplified text; The simplified text and the extraction prompt words are input into the information extraction model for information extraction, and the second target information output by the information extraction model is obtained. The second target information is stored in a structured manner.

10. The method according to claim 8, characterized in that, The method further includes: If the extraction prompt indicates that both deep information and shallow information of the target text should be extracted, then the method for generating text summaries according to any one of claims 1 to 7 generates a summary of the target text and identifies suspected segments in the target text that may contain the shallow information. According to the order of each suspected fragment in the target text, all suspected fragments are combined to obtain a simplified text; The summary of the target text, the simplified text, and the extraction prompt words are input into the information extraction model to extract information, thereby obtaining the first target information and the second target information output by the information extraction model. The first target information and the second target information are stored in a structured manner.

11. An apparatus for generating text summaries, characterized in that, The device includes: The first acquisition module is used to acquire the text to be processed and the preset balance coefficient; The first clustering module is used to perform cluster analysis on all sentences in the text to be processed, and obtain at least one sentence cluster. The first determining module is used to determine the first parameter set and the second parameter set of each sentence cluster in the at least one sentence cluster. The first parameter set of the target sentence cluster is a set composed of the position weights of each sentence in the target sentence cluster in the text to be processed. The second parameter set of the target sentence cluster is a set composed of the semantic distances between each sentence in the target sentence cluster and the cluster centroid of the target sentence cluster. The target sentence cluster is any sentence cluster in the at least one sentence cluster. The second determining module is used to determine the representative sentence of each sentence cluster in the at least one sentence cluster based on the balance coefficient, the first parameter set of each sentence cluster in the at least one sentence cluster and the second parameter set of each sentence cluster. The representative sentence of each sentence cluster is the sentence with the lowest comprehensive score in that sentence cluster. The comprehensive score of each sentence is calculated based on the position weight of the sentence in the text to be processed and the semantic distance between the sentence and the cluster centroid of its sentence cluster. The balance coefficient is used to weigh the influence of the two factors, semantic distance and position weight, on the comprehensive score of the sentence. The first combination module is used to combine the representative sentences corresponding to the at least one sentence cluster according to the order of each representative sentence in the text to be processed, so as to obtain a summary of the text to be processed.

12. An information extraction device, characterized in that, The device includes: The second acquisition module is used to acquire the target text to be processed and extract prompt words; The first generation module is configured to generate a summary of the target text according to any one of claims 1 to 7 if the extraction prompt word indicates that deep information of the target text is to be extracted. The first extraction module is used to extract information from the summary of the target text and the extraction prompt words into the information extraction model to obtain the first target information output by the information extraction model. The first storage module is used to store the first target information in a structured manner.

13. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the method for generating text summaries as claimed in any one of claims 1 to 7 or the steps of the method for extracting information as claimed in any one of claims 8 to 11.

14. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method for generating text summaries as claimed in any one of claims 1 to 7 or the steps of the information extraction method as claimed in any one of claims 8 to 11.

15. A computer program product, characterized in that, The computer program includes a program or instructions that, when executed by a processor, implement the steps of the method for generating text summaries as claimed in any one of claims 1 to 7 or the steps of the information extraction method as claimed in any one of claims 8 to 11.

Citation Information

Patent Citations

  • Text processing method and device, electronic equipment and storage medium

    CN117290496A

  • Bidding document information extraction method

    CN121031593A